<!--
/**
 *  Author: Pivocom
 *	Date: 5/12/2009
 *	URL: www.pivocom.com
 *	Support: info@pivocom.com
 *
 *  Description: Javascript functions for First American landing page that calculate
 *							 various browser widths in order to maintain both centering and glow effect
 *						   by setting the appropriate style.
 **/	
var currentWidth = 0;

function ResizeEvent(){
	if(BrowserDetect.browser == 'Explorer'){
		param = document.documentElement.clientWidth;
	}else{
		param = document.body.scrollWidth;
	}
	//alert(param);
	if(currentWidth == param){
		//do nothing
	}else{
		DetermineBG(param);
		currentWidth = param;
	}
}

function DetermineBG(pxWidth){
	browser = BrowserDetect.browser;
	version = BrowserDetect.version;
	if((browser == 'Explorer') && (version == 6)){
		//alert(pxWidth);
		if (pxWidth <= 770) {
			document.body.className = "resLow";			
		}else{
			if (pxWidth >= 1484) {document.body.className = "resHigh";}
			if ((pxWidth > 770) && (pxWidth <= 800)) {document.body.className = "res800";
				document.getElementById("mainContent").style.margin = '22px 0px 0px 16px';
				document.getElementById("bodyTag").style.background = 'url(../images/bg800.jpg) no-repeat';
			}
			if ((pxWidth > 800) &&(pxWidth <= 1024)) {
				document.body.className = "res1024";
				document.getElementById("mainContent").style.margin = '22px 0px 0px 128px';
				document.getElementById("bodyTag").style.background = 'url(../images/bg1024.jpg) no-repeat';
			}
			if ((pxWidth > 1024) && (pxWidth <= 1280)) {document.body.className = "res1280";
				document.getElementById("mainContent").style.margin = '22px 0px 0px 256px';
				document.getElementById("bodyTag").style.background = 'url(../images/bg1280.jpg) no-repeat';
			}
			if ((pxWidth > 1280) && (pxWidth <=1360)) {document.body.className = "res1360";
				document.getElementById("mainContent").style.margin = '22px 0px 0px 296px';
				document.getElementById("bodyTag").style.background = 'url(../images/bg1360.jpg) no-repeat';
			}
			if ((pxWidth > 1360) && (pxWidth <= 1400)) {document.body.className = "res1400";
				document.getElementById("mainContent").style.margin = '22px 0px 0px 316px';
				document.getElementById("bodyTag").style.background = 'url(../images/bg1400.jpg) no-repeat';
			}
			if ((pxWidth > 1400) && (pxWidth <= 1440)) {document.body.className = "res1440";
				document.getElementById("mainContent").style.margin = '22px 0px 0px 336px';
				document.getElementById("bodyTag").style.background = 'url(../images/bg1440.jpg) no-repeat';
			}
		}
	}else{

	if (pxWidth <= 770) {
		document.body.className = "resLow";

		document.getElementById("mainContent").style.margin = '22px 0px 0px 0px';
	}else{
		//alert(pxWidth + ' - ' + document.documentElement.clientWidth);
		if (pxWidth >= 1484) {
			document.body.className = "resHigh";
			document.getElementById("mainContent").style.margin = '22px 0px 0px 358px';
		}
		if ((pxWidth > 770) && (pxWidth <= 800)){
			document.body.className = "res800";
			document.getElementById("mainContent").style.margin = '22px 0px 0px 16px';
		}
		if ((pxWidth > 800) &&(pxWidth <= 1024)){
			document.body.className = "res1024";
			document.getElementById("mainContent").style.margin = '22px 0px 0px 128px';
		}
		if ((pxWidth > 1024) && (pxWidth <= 1280)){
			document.body.className = "res1280";
			document.getElementById("mainContent").style.margin = '22px 0px 0px 256px';
		}
		if ((pxWidth > 1280) && (pxWidth <=1360)){
			document.body.className = "res1360";
			document.getElementById("mainContent").style.margin = '22px 0px 0px 296px';
		}
		if ((pxWidth > 1360) && (pxWidth <= 1400)){
			document.body.className = "res1400";
			document.getElementById("mainContent").style.margin = '22px 0px 0px 316px';
		}
		if ((pxWidth > 1400) && (pxWidth <= 1440)){
			document.body.className = "res1440";
			document.getElementById("mainContent").style.margin = '22px 0px 0px 336px';
		}
		/*if ((pxWidth > 1440) && (pxWidth < 1638)){
			document.body.className = "res1600";
			document.getElementById("mainContent").style.margin = '24px 0px 0px 376px';
		}*/	
	}
	}
}



function LoadStyle() {	
	if((BrowserDetect.browser == 'Explorer') && (BrowserDetect.version == 6)){
		pxWidth = document.documentElement.clientWidth;
	}else{
		pxWidth = document.body.scrollWidth;
	}

	DetermineBG(pxWidth);	
	currentWidth = pxWidth;
	document.getElementById("mainContent").style.visibility = 'visible';
	if(BrowserDetect.browser != 'Explorer'){
		cssAppend('styleNormal.css');
	}
}
function cssAppend(cssFile){
	
  	var headID = document.getElementsByTagName("head")[0];         
        var c = document.createElement('link');
        c.type = 'text/css';
        c.rel = 'stylesheet';
        c.href = 'inc/' + cssFile;
        headID.appendChild(c);           
}
-->