// JavaScript Document
function findXPos(obj)
{
	var curleft = 0;
	if(obj.offsetParent)
	{
		while(1) 
		{
		  curleft += obj.offsetLeft;
		  if(!obj.offsetParent)
			break;
		  obj = obj.offsetParent;
		}
	}
	else if(obj.x)
	{
		curleft += obj.x;
	}
	return curleft;
}

function findYPos(obj)
{
	var curtop = 0;
	if(obj.offsetParent)
	{
		while(1)
		{
		  curtop += obj.offsetTop;
		  if(!obj.offsetParent)
			break;
		  obj = obj.offsetParent;
		}
	}
	else if(obj.y)
	{
		curtop += obj.y;
	}
	return curtop;
}

function setContentPaneHeight()
{
	var contentHeight = 210;

	var browserSizeProps = getBrowserSpace();
	var width = browserSizeProps[0];
	var height = browserSizeProps[1];
	var paneHeight = height-contentHeight;
	var content = document.getElementById('content');
	
	if( content.style.height > 0 && (content.style.height < paneHeight) )
	{
		content.style.height = paneHeight;
	}
	
	content.style.display = 'block'
}

function getBrowserSpace()
{
	var browserWidth;
	var browserHeight;
 
 	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	if (typeof window.innerWidth != 'undefined')
	{
		browserWidth = window.innerWidth,
		browserHeight = window.innerHeight
	}
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0)
	{
		browserWidth = document.documentElement.clientWidth,
		browserHeight = document.documentElement.clientHeight
	}
 	// older versions of IE
	else
	{
		browserWidth = document.getElementsByTagName('body')[0].clientWidth,
		browserHeight = document.getElementsByTagName('body')[0].clientHeight
	}
	
	var array = new Array(2);
	array[0] = browserWidth;
	array[1] = browserHeight;
	return array;
}

function positionQouteButton()
{
	var qouteButton = document.getElementById('quote_button');
	var banner =  document.getElementById('banner');
	var pageLeftMargin = findXPos(document.getElementById('banner'));
	
	qouteButton.style.position = 'relative';
	qouteButton.style.top = 33;
	qouteButton.style.left = 540;
	
	qouteButton.style.display = 'block';
}

function setPageTitle(pageTitle)
{
	var titleCell = document.getElementById('page_title');
	titleCell.innerHTML = pageTitle;
}