<!--

var verNum;
var sPath;
var sPath2;
var sPath3;

var iBase;
verNum = parseInt(navigator.appVersion);
sPath = "/media/images/topNavImages/";
sPath2 = "/media/images/homeImages/";
sPath3 = "/media/images/customTrailerImages/";


initBase();

function initBase(){
	var x;
	x= window.screen.width;
	if(x<1024){
		iBase = 100;
	}else if(x=1024){
		iBase = 210;
	}else if(x>1024){
		iBase = 0;
	}
}

function getBase(){
	return iBase;
}

//THIS JAVASCRIPT FUNCTION SETS THE ACTION VALUE
	//UPON BUTTON CLICK
	function setTask(sForm,sTask,bSubmit){
		alert('here');
		var sLoc = "";
	
		sLoc = eval("document."+ sForm +".action");
		sLoc = sLoc + "&task=" + sTask;
		eval("document."+ sForm +".action = sLoc");
		
		if(bSubmit){
			eval("document."+ sForm +".submit()");
		}
	}	
	
	function setChapter(sForm,sChapter,bSubmit){
		var sLoc = "";
	
		sLoc = eval("document."+ sForm +".action");
		sLoc = sLoc + "&chapter=" + sChapter;
		eval("document."+ sForm +".action = sLoc");
		
		if(bSubmit){
			eval("document."+ sForm +".submit()");
		}
	}					

	
	function dispForm(sURL){
		window.open(sURL,'PrintForm','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500,top=100,left=150');
	}

	function dispFormAdv(sURL, iWidth, iHeight){
		if(isNaN(iWidth) || isNaN(iHeight)){
			iWidth=300;
			iHeight=300;
		}
		window.open(sURL,'PrintForm','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+ iWidth +',height='+ iHeight +',top=100,left=150');
	}	
	
	
	function pageJump(sForm,sWho){
		eval("document."+ sForm +"."+ sWho +".focus()");
	}
	
	function redirParent(sLoc, bClose){
		//alert(sLoc);
		opener.location = sLoc;	
		
		if(bClose){
			//var browserName = navigator.appName.toLowerCase(); 
			//alert(browserName);
			window.close();	
		}
	}	

	
	function setParentFormValue(sForm,sField,sValue){
		eval("opener."+ sForm +"."+ sField +".value = '"+ sValue +"'");
	}

	function cancelClick(sWhere){
		switch(sWhere){
			case "freebieCenter":
				document.location.href="/?class=freebieCenter&chapter=1";
				break;
				
			default:	
				document.location.href="/";
				break;
		}	
	}

	
	function writeFreebieDiv(nXMax,nYMax){
		var nX;
		var nY;
		
		switch(nXMax){
			case 1024:
				nX = 123;
				nY = 400;
				break;
				
			case 800:
				nX = 50;
				nY = 130;
				break;
				
			case 640:
				break;
				
			default:
				
		}
		
		
		document.write ('	<div id="jet" name="jet" style="position:absolute; width:760px; height:30px; z-index:2; left: '+ nX +'px; top: '+ nY +'; visibility: visible;">');
		document.write ('	<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" z-index:2;'); 
		document.write ('		codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"');
		document.write ('		 WIDTH=760 HEIGHT=30>');
		document.write ('		<PARAM NAME=movie VALUE="/media/flash/flashSlider.swf"> <PARAM NAME=loop VALUE=true> <PARAM NAME=z-index VALUE=2> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#666666> <EMBED src="/media/flash/flashSlider.swf" loop=true quality=high wmode=transparent bgcolor=#666666  WIDTH=160 HEIGHT=300 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
		document.write ('	</OBJECT>');
		document.write ('	</div>');
	}


function getFloatingMenuX(prevBtnWidth){
	var newX;
	
	if (!isNaN(prevBtnWidth)){
		newX = getBase() + prevBtnWidth;
	}else{
		newX = 0;
	}
	
	return newX;
}


button = new Array();
sImgType = ".gif";

button[0] = "home";
button[1] = "customTrailers";
button[2] = "galvanizedTrailers";
button[3] = "aluminumTrailers";
button[4] = "manufacturing";
button[5] = "links";
button[6] = "placeAnOrder";
button[7] = "contactUs";
button[8] = "selectingATrailer";
button[9] = "galvanizedTrailersButton";
button[10] = "aluminumTrailersButton";


button[11] = "customImg_lg";
btnStart = 12;

for(h=0;h<16;h++){
	myVal = "lg_" + h;
	button[btnStart] = myVal; 
	btnStart ++;
}


mevent = new Array(3);
mevent[0] = "";
mevent[1] = "_on";
//IF YOU HAVE A SPECIFIC IMAGE TO FLIP TO ONCLICK RUN IT HERE
//mevent[2] = "_click";


//IF YOU HAVE A SPECIFIC IMAGE TO FLIP TO ONCLICK SET J<3 ELSE SET TO 2
for(j=0;j<2;j++)
{

		for(i=0;i<button.length;i++)
		{
			eval(button[i]+mevent[j]+" = new Image;")
			
			if(i>10){
				tmpPath = sPath3;
				sImgType = ".jpg";
			
			}else if(i>8){
				tmpPath = sPath2;
				sImgType = ".jpg";
			
			}else{
			
				tmpPath = sPath;
				sImgType = ".gif";
			}
		
		eval(button[i]+mevent[j]+".src = '"+tmpPath+button[i]+mevent[j]+sImgType+"';")
		//alert(button[i]+mevent[j]+".src");
		}

	//alert(j);
}




function flipOver(imgName) {
if (verNum >= 3) 
{
	if(document [imgName].src != eval(imgName+"_on.src"))
	{
		document [imgName].src = eval(imgName+"_on.src");
	}
}
}

function flipOut(imgName) {
	if (verNum >= 3)
	{
		if(document [imgName].src != eval(imgName+".src"))
		{
			document [imgName].src = eval(imgName+".src");
		}
	}
}

function flipOverLarge(imgName, imgTarget){
	if (verNum >= 3)
	{
		document [imgTarget].src = eval(imgName+".src");
	}
}


//-->

