/* Blue River Digital API - Window **********************************
 *	
 *	This API contains all the functions needed to get and set 
 *	window properties.
 *
 ***************************************************************************/
 
    
 
 /*  Get Window Width * *******************************************************
 *
 *	TAKES:		NOTHING
 * 	RETURNS:	The width of the window.
 *	
 *************************************************************************/
 
 	function getWindowWidth()
	{
		var myWidth = 0;
		
		if ( typeof( window.innerWidth ) == "number" )
		{
			//Non-IE
			myWidth = window.innerWidth;
		}
		else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
		{
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
		}
		else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
		{
			//IE 4 compatible
			myWidth = document.body.clientWidth;
		}

		return myWidth;	
	}

    var siteWidth           = 1010;
    var windowLeftOffset    = (getWindowWidth() - siteWidth)/2;

 /*  Get Window Height * *******************************************************
 *
 *	TAKES:		NOTHING
 * 	RETURNS:	The height of the window.
 *	
 *************************************************************************/
 
	function getWindowHeight()
	{
		var myHeight = 0;
		
		if ( typeof( window.innerWidth ) == "number" )
		{
			//Non-IE
			myHeight = window.innerHeight;
		}
		else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
		{
			//IE 6+ in 'standards compliant mode'
			myHeight = document.documentElement.clientHeight;
		}
		else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
		{
			//IE 4 compatible
			myHeight = document.body.clientHeight;
		}

		return myHeight;	
	}


 /*  Get Page Y Offset  * *******************************************************
 *
 *	TAKES:		NOTHING
 * 	RETURNS:	The offset from the top of the webpage.
 *	NOTE:		This is the value of webpage, not the browser or window offset.
 *	
 *************************************************************************/
 
	function getPageYOffset()
	{
		var ScrollTop = document.body.scrollTop;
		
		if (ScrollTop == 0)
		{
			if (window.pageYOffset)
			{
				ScrollTop = window.pageYOffset;
			}
			else
			{
				ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
			}
		}
		
		return ScrollTop;
	}
	
 /*  Get Page X Offset  * *******************************************************
 *
 *	TAKES:		NOTHING
 * 	RETURNS:	The offset from the top of the webpage.
 *	NOTE:		This is the value of webpage, not the browser or window offset.
 *	
 *************************************************************************/
 
	function getPageXOffset()
	{
		var ScrollTop = document.body.scrollLeft;
		
		if (ScrollTop == 0)
		{
			if (window.pageXOffset)
			{
				ScrollTop = window.pageXOffset;
			}
			else
			{
				ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollLeft : 0;
			}
		}
		
		return ScrollTop;
	}
