function FN_Body_OnLoad()
{
	UTIL_HideWhiteOutBox();
}

function FN_Body_OnResize()
{
	NewsletterSignup_UpdateScreenPosition();
	UTIL_UpdateWhiteOutBoxSize();
}

function FN_Body_OnScroll()
{
	NewsletterSignup_UpdateScreenPosition();
	UTIL_UpdateWhiteOutBoxSize();
}

function FN_GetScrollArray()
{
	var scrollX = 0, scrollY = 0;
	if( typeof( window.pageYOffset ) == 'number' )
	{
		//Netscape compliant
		scrollY = window.pageYOffset;
		scrollX = window.pageXOffset;
	}
	else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
	{
		//DOM compliant
		scrollY = document.body.scrollTop;
		scrollX = document.body.scrollLeft;
	}
	else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
	{
		//IE6 standards compliant mode
		scrollY = document.documentElement.scrollTop;
		scrollX = document.documentElement.scrollLeft;
	}
	return [scrollX, scrollY]
}

function FN_GetScrollX()
{
	var scroll_val_array = FN_GetScrollArray();
	return scroll_val_array[0];
}

function FN_GetScrollY()
{
	var scroll_val_array = FN_GetScrollArray();
	return scroll_val_array[1];
}

function FN_GetWindowWidth()
{
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number')
	{
		windowWidth = window.innerWidth;
	}
	else
	{
		if (document.documentElement && document.documentElement.clientWidth)
		{
			windowWidth = document.documentElement.clientWidth;
		}
		else
		{
			if (document.body && document.body.clientWidth)
			{
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}
function FN_GetWindowHeight()
{
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number')
	{
		windowHeight = window.innerHeight;
	}
	else
	{
		if (document.documentElement && document.documentElement.clientHeight)
		{
			windowHeight = document.documentElement.clientHeight;
		}
		else
		{
			if (document.body && document.body.clientHeight)
			{
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}


function FN_GetDocumentHeight()
{
	var doc_size_array = GetDocumentSizeArray();
	return doc_size_array[1];
}

function FN_GetDocumentWidth()
{
	var doc_size_array = GetDocumentSizeArray();
	return doc_size_array[0];
}

function GetDocumentSizeArray()
{
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' )
	{
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	return [myWidth, myHeight];
	//window.alert( 'Width = ' + myWidth );
	//window.alert( 'Height = ' + myHeight );
}

function SpecialReferral_ConvertToLinks_Click()
{
	if(!document.getElementById("company_key").value)
	{
		alert("You did not enter a company key!");
		return;
	}

	document.getElementById("quick_links_result_area").innerHTML = "loading...";

	var ajax_obj = new Class_Ajax();

	ajax_obj.data_obj.op = 'convert_key_to_links';
	ajax_obj.data_obj.company_key = document.getElementById("company_key").value;

	ajax_obj.SendRequest('index.php?param=sr_report&');
}