//------------------------------------------------------------------------------
// general javascript routines used by various other sites and routines
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// default error view routine
//------------------------------------------------------------------------------

function incaErrorHandler(msg, url, l)
{
	var incaErrText = "";
	incaErrText =  "There was an error on this page.\n\n";
	incaErrText += "Error: " + msg + "\n";
	incaErrText += "URL: " + url + "\n";
	incaErrText += "Line: " + l + "\n\n";
	incaErrText += "Click OK to continue.\n\n";
	alert(incaErrText);
	return true;
}

//------------------------------------------------------------------------------
// browser identification
//------------------------------------------------------------------------------
function incaBrowIsIE()      {if (navigator.appName == 'Microsoft Internet Explorer') {return true;} return false;}
function incaBrowIsOpera()   {if (navigator.appName == 'Opera')                       {return true;} return false;}
//function incaBrowIsFireFox() {if (navigator.appName == 'Netscape')                    {return true;} return false;}
function incaBrowIsFireFox() {if (navigator.userAgent.indexOf("Firefox") != -1)       {return true;} return false;}

//------------------------------------------------------------------------------
// geometric data aquisition
//------------------------------------------------------------------------------
function incaBrowGetHeight() 
{
	var iBrowHeight;
	if (incaBrowIsIE()) {
		iBrowHeight = parseInt(document.documentElement.clientHeight); 	
	} else if (incaBrowIsOpera()) {
		iBrowHeight = parseInt(window.innerHeight);
	} else if (incaBrowIsFireFox()) {
		//height = (document.layers)?window.innerHeight:window.document.body.clientHeight;
		iBrowHeight = parseInt(window.innerHeight);
	} else {
		testsize = document.getElementById('resizingWindowTestSizeDiv');
		iBrowHeight = testsize.scrollHeight;
	}
	return iBrowHeight;
}

function incaBrowGetWidth()
{
	var width;
	if (incaBrowIsIE()) {
		width = parseInt(document.documentElement.clientWidth); 	
	} else if (incaBrowIsOpera()) {
		width = parseInt(window.innerWidth) - 16;
	} else if (incaBrowIsFireFox()) {
		//width = (document.layers)?window.innerWidth:window.document.body.clientWidth;
		width = parseInt(window.innerWidth);
	} else {
		testsize = document.getElementById('resizingWindowTestSizeDiv');
		width = testsize.scrollWidth;
	}
	return width;	
}
	
function incaClientHeightDiv()
{
	var iCorHeight;
	//if (incaBrowIsFireFox()) {cheight = 100;}
	iCorHeight = incaBrowGetHeight() - 260;
	//iCorHeight = window.innerHeight - 280;
	//alert(window.innerHeight);
	document.write('<div style="overflow:auto; height:');
	document.write(iCorHeight);
	document.write('px">');	
//	document.write('</br>[SP:');
//	document.write(iCorHeight);
//	document.write(']</br>');
}

function incaCloseDiv()
{
	document.write('</div>');		
}

//var wih;
//var wihc;
////wih = getWindowHeight();
//wih  = incaBrowGetHeight();
//wihc = wih - 170;

function pullDynHeight()
{
//	wih = incaBrowGetHeight();
//	wihc = wih - 170;
//	document.write('<td valign="top" height="');
//	document.write(wihc );
//	document.write('">');
//	//document.write(wihc); 
//	return;
////	if (wihc < 350) { document.write('0300'); return;}
//	if (wihc < 400) { document.write('0350'); return;}
//	if (wihc < 450) { document.write('0400'); return;}
//	if (wihc < 500) { document.write('0450'); return;}
//	if (wihc < 550) { document.write('0500'); return;}
//	if (wihc < 600) { document.write('0550'); return;}
//	if (wihc < 650) { document.write('0600'); return;}
//	if (wihc < 700) { document.write('0650'); return;}
//	if (wihc < 750) { document.write('0700'); return;}
//	if (wihc < 800) { document.write('0750'); return;}
//	if (wihc < 850) { document.write('0800'); return;}
//	if (wihc < 900) { document.write('0850'); return;}
//	if (wihc < 950) { document.write('0900'); return;}
//	if (wihc <1000) { document.write('0950'); return;}
//	if (wihc <1050) { document.write('1000'); return;}
//	if (wihc <1100) { document.write('1050'); return;}
//	if (wihc <1150) { document.write('1100'); return;}
//	document.write('1150');
//	return;		
}

function pullDynDesign2()
{
	if (wihc < 350) { document.write('spheight0300'); return;}
	if (wihc < 400) { document.write('spheight0350'); return;}
	if (wihc < 450) { document.write('spheight0400'); return;}
	if (wihc < 500) { document.write('spheight0450'); return;}
	if (wihc < 550) { document.write('spheight0500'); return;}
	if (wihc < 600) { document.write('spheight0550'); return;}
	if (wihc < 650) { document.write('spheight0600'); return;}
	if (wihc < 700) { document.write('spheight0650'); return;}
	if (wihc < 750) { document.write('spheight0700'); return;}
	if (wihc < 800) { document.write('spheight0750'); return;}
	if (wihc < 850) { document.write('spheight0800'); return;}
	if (wihc < 900) { document.write('spheight0850'); return;}
	if (wihc < 950) { document.write('spheight0900'); return;}
	if (wihc <1000) { document.write('spheight0950'); return;}
	if (wihc <1050) { document.write('spheight1000'); return;}
	if (wihc <1100) { document.write('spheight1050'); return;}
	if (wihc <1150) { document.write('spheight1100'); return;}
	document.write('spheight1150');
	return;	
}

function pullDynDesign()
{
  document.write('<div id="');
  pullDynDesign2();
  document.write('">');
}

