/*********************************
* Returns value of querystring variable
**********************************/
function getQueryVariable(variable) 
{ 
  var query = window.location.search.substring(1); 
  var vars = query.split("&");
  
  for (var iCurrent=0;iCurrent<=15;iCurrent++)
  {     
	var pair = vars[iCurrent].split("="); 
    if (pair[0] == variable) 
	{ 
      return pair[1]; 
    }
  } 
} 

/*********************************
* Returns height of window in pixels
**********************************/
function getWindowHeight()
{
	// calculate windowheight 
	var height = 0;
	
	if( typeof(window.innerHeight ) == 'number' )
	{
		//Non-IE
		height = window.innerHeight;
	}
	else if( document.documentElement && document.documentElement.clientHeight )
	{
		//IE 6+ in 'standards compliant mode'
		height = document.documentElement.clientHeight;
	}
	else if( document.body && document.body.clientHeight )
	{
		//IE 4 compatible
		height = document.body.clientHeight;
	}
	return height;
}

/*********************************
* Returns width of window in pixels
**********************************/
function getWindowWidth()
{
	// calculate windowheight 
	var width = 0;
	
	if( typeof(window.innerWidth ) == 'number' )
	{
		//Non-IE
		width = window.innerWidth;
	}
	else if( document.documentElement && document.documentElement.clientWidth )
	{
		//IE 6+ in 'standards compliant mode'
		width = document.documentElement.clientWidth;
	}
	else if( document.body && document.body.clientWidth )
	{
		//IE 4 compatible
		width = document.body.clientWidth;
	}
	return width;
}

/*********************************
* Returns height of body in pixels
**********************************/
function getBodyHeight()
{
	return document.getElementsByTagName('body')[0].clientHeight;
}

/*********************************
* Returns width of body in pixels
**********************************/
function getBodyWidth()
{
	return document.getElementsByTagName('body')[0].clientWidth;
}
