/****************************************************/
// Browser Window Size and Position
// copyright Stephen Chapman, 3rd Jan 2005, 8th Dec 2005
// all other content 
// @copyright Fonqi, 23. oct 2008 
/****************************************************/

function Page()
{	
}

//Gets the width of the page 
Page.Width = function()
{
	 return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       
    document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}

//Gets the height of the page 
Page.Height = function()
{
	 return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;
}

Page.PosLeft = function()
{
	return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;

}

Page.PosTop = function()
{
	return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
}

//Adds a stylesheet to the header
Page.AddStyleSheet = function(path)
{
    var headerNode = document.getElementsByTagName("head")[0];         
    var cssNode = document.createElement('link');
    cssNode.type = 'text/css';
    cssNode.rel = 'stylesheet';
    cssNode.href = path;
    cssNode.media = 'screen';
    headerNode.appendChild(cssNode);
}

//Adds a style snippet to the header
Page.AddStyle = function(styleSnippet)
{
    var headerNode = document.getElementsByTagName("head")[0];
    var cssNode = document.createElement('style');
    cssNode.type = 'text/css';
    cssNode.media = 'screen';
	cssNode.innerHTML = styleSnippet;
    headerNode.appendChild(cssNode);
}

//Adds a stylesheet to the header
Page.AddScript = function(path)
{
    var headerNode = document.getElementsByTagName("head")[0];         
    var scriptNode = document.createElement('script');
    scriptNode.type = 'text/javascript';
    scriptNode.src = path;
    headerNode.appendChild(scriptNode);
}

/****************************************************/
