function page_get_window_height()
{
	if (self.innerHeight)	// all except Explorer
		return (self.innerHeight);
	else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
		return (document.documentElement.clientHeight);
	else if (document.body) // other Explorers
		return (document.body.clientHeight);
}

function page_get_window_width()
{
	if (self.innerHeight) // all except Explorer
	{
		if(document.documentElement.clientWidth)
			return (document.documentElement.clientWidth); 
		else
			return (self.innerWidth);
	}
	else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
		return (document.documentElement.clientWidth);
	else if (document.body) // other Explorers
		return (document.body.clientWidth);
}

function page_get_document_height()
{
	var l_page_height;
	var l_window_height;
	
	if ( window.innerHeight && window.scrollMaxY ) // Firefox 
		l_page_height = window.innerHeight + window.scrollMaxY;
	else if ( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac
		l_page_height = document.body.scrollHeight;
	else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		l_page_height = document.body.offsetHeight + document.body.offsetTop; 

	l_window_height=page_get_window_height();

	// for small pages with total height less then height of the viewport
	if(l_page_height < l_window_height)
		return (l_window_height);
	else
		return (l_page_height);

}

function page_get_document_width()
{
	var l_page_width;
	var l_window_width;
	
	if ( window.innerHeight && window.scrollMaxY ) // Firefox 
		l_page_width = window.innerWidth + window.scrollMaxX;
	else if ( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac
		l_page_width = document.body.scrollWidth;
	else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		l_page_width = document.body.offsetWidth + document.body.offsetLeft; 
		
	l_window_width=page_get_window_width();

	// for small pages with total width less then width of the viewport
	if(l_page_width < l_window_width)	
		return (l_page_width);		
	else
		return (l_window_width);		
}

 
