// JavaScript Document
function DisplayDropdown(DIVName)
{
  //alert(DIVName.style.display);
 	//DIVName.style.display = '';
	//DIVName = document.getElementByName(DIVName);
	DIVName = document.getElementById(DIVName);
	//alert(DIVName);
	DIVName.className = "showDiv";		
}
function HideDropdown(DIVName)
{
  //alert(DIVName.style.display);
  //alert(DIVName);
 	//DIVName.style.display = 'none';
	DIVName = document.getElementById(DIVName);
	DIVName.className = "hdnDrop";		
}
function ChangeTD(TDName)
{
 // alert(TDName.ClassName);
 if(TDName.className == "menu")
 	TDName.className = "menuOver"; else

	TDName.className = "menu";	
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		Home_over = newImage("images/Home-over.gif");
		Products_over = newImage("images/Products-over.gif");
		Orders_over = newImage("images/Orders-over.gif");
		contact_US_over = newImage("images/contact_US-over.gif");
		preloadFlag = true;
	}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function ValidateContactUS(theForm)
{
 var objFocus;
 var blErrors = false;
 var msg="";
 var noOfErrors=0;
 if(theForm.txtName.value.length < 2)
 {
 	noOfErrors++
 	msg = noOfErrors +". Please Enter your Name\n";
 	blErrors = true;
	objFocus = theForm.txtName;
 }

 if(theForm.txtAddress1.value.length < 2)
 {
 	noOfErrors++
 	msg += noOfErrors +". Please Enter your Address\n";
	if(!blErrors)
	{
 		blErrors = true;
		objFocus = theForm.txtAddress1;
	}
 }

 if(theForm.txtEmail.value.length < 2)
 {
 	noOfErrors++
 	msg += noOfErrors +". Please Enter your Email\n";
	if(!blErrors)
	{
 		blErrors = true;
		objFocus = theForm.txtEmail;
	}
 }
 
 if(theForm.txtComments.value.length < 2)
 {
 	noOfErrors++
 	msg += noOfErrors +". Please Enter some Comments\n";
	if(!blErrors)
	{
 		blErrors = true;
		objFocus = theForm.txtComments;
	}
 }
 
 if(blErrors)
 {
    var s;
	if(noOfErrors > 1)
		s = "s";
	else
		s="";		 
 	alert("We cannot submit this form beacuse of the error"+ s +" listed below\n------------------------------------------\n"+ msg +"------------------------------------------\n");
	objFocus.focus(); 
	return false;
 }

}
var preloadImagetrailerImc = false;

function ChangeImage(img, name, captionID, caption)
{
 if(preloadImagetrailerImc)
 {
 	//alert(imgSrc[img].src);
	//alert(img);
 	name.src=imgSrc[img].src;
 	captionID.innerHTML = ImgCaption[caption];
 }
 else
 	alert("Please wait until all the images are loaded\nthank you!!");

}
var imgIndex = 0;
var imgSrc = new Array(20);
function preloadImagestrailerEnc(i)
{
	
	var imageSrc;
	if(i < 20)
	{
		imgSrc[i] = new Image();
		imgSrc[i].src = "images/TrailerEnc/"+ (i+1) +".gif";
		//alert(imgSrc[i].src);
		document.frmLoaded.txtLoaded.value = parseInt(i/20 * 100);
		imgIndex++;
		//alert(imgIndex +"  "+ parseInt(i/19 * 100));
		setTimeout("preloadImagestrailerEnc("+ imgIndex +")", 1000);
	}
	else
	{
		divLoaded.style.display='none';
		preloadImagetrailerImc = true;
	}
}
var ImgCaption = new Array(20);
for(j=0;j<20;j++)
	ImgCaption[j] = "This is a test - "+ j ;
	
ImgCaption[0]= "The frame is strong angle metal and tubing with pre-punched holes.  You assemble using our instructions. To view a sample of the Instructions click Instructions to upper left of this page. It has many angle braces for strength.  It is rust treated for durability.";
ImgCaption[1]= "The cover material is a strong industrial grade PVC fiberfabric made in one piece to the width, length, shape and height you choose and comes in black or gray and 4 accent side colors.  It is UV (sun) resistant, waterproof, unaffected by temperature can be repaired (if minor damage should occur).  It is tough, better by weight than aluminum or fiberglass because it gives with impact.  It is not a canvas, so it does not stretch.";
ImgCaption[2]= "Gas Springs help open and hold up the lids for easy access.  2 are used on the front lid and 2 are used on the rear lid.  No center lift arms to drive around.";
ImgCaption[3]= "This is how we make our enclosure taller.  We add either 6 inch  or 12 inch to the base of the normal 56 inch  tall enclosure (for snowmobiles), thus 62 inch (for ATVs etc.), 68 inch (for full size motorcycles).  This 6 inch or 12 inch added height cannot be added later, it has to be ordered and made at the time of manufacture.";
ImgCaption[4]= "Triangle based center support (called 'A' supports in our instructions) attaches to your trailer floor, inside of and next to your side rails.  We provide all he hardware to assemble the enclosure but not the hardware you must use to attach it to the floor of your trailer.";
ImgCaption[5]= "After you have built the frame, place the one piece cover over the frame.  Pull it tight and attach it to the frame at the perimeter, capturing it between the frame and a like piece of metal.  Then bolt the two pieces of metal together and trim off the excess material.";
ImgCaption[6]= "A self adhesive rubber gasket is provided to place across the bottom of the front and back lids.  This will rest on the trailer floor to seal while traveling.";
ImgCaption[7]= "A braided handle is placed in the bottom center of the front and rear lids to aid in opening and closing.";
ImgCaption[8]= "A slide bolt, one at each corner, is attached to the enclosure frame to keep lids closed during travel.  This slide bolt has a place you can put a padlock for security.";
ImgCaption[9]= "A keeper is installed to the trailer siderail at each slide bolt.  You slide the bolt into the keeper to latch it.";
ImgCaption[10]= "The 5ft. front lid opens up for drive off or easy access for tie downs or minor engine maintenance.  The frame is hinged across the roof.  These hinges are part of the frame and the cover goes on top of the frame in one piece to prevent leaks.";
ImgCaption[11]= "The 5ft rear lid opens up for easy loading and works with tilt or drive on/off trailers.  For tilt trailers the rear lid can lift a little higher than is needed in drive on/off for better ground to lid clearance (we show you this feature in the instructions).";
ImgCaption[12]= "At the vertical center the lids close or slide behind a metal side guard to seal the vertical opening joint.  The trailer siderails provide the protection for the bottom edge of the lid.  There are no zippers, snaps or Velcro to ice up or get damaged  anywhere on our enclosures.";
ImgCaption[13]= "Lightweight- 10ft, 2 place weighs about 175lbs. 12ft 2 place weighs about 190 lbs. and 20ft 4 place weighs about 300 lbs.(CAN BE ADDED AS A FEATURE)";
ImgCaption[14]= "The pieces of angle metal (#3 in the instructions) are what determine the width of the enclosure.  They have a series of holes at each end that we cut off in one inch increments to get the closest width measurement to match your trailer.";
ImgCaption[15]="If your trailer is a little in between our one inch increments our instructions show you how the frame (before you put on the cover), at the corner next to the side rail can be modified slightly  to get the most width for your application.";
ImgCaption[16]="We have a 5 year limited warranty on the materials.TO VIEW WARRANTY click WARRANTY to the upper left of this page.";
ImgCaption[17]="You can contact us to ask any questions or request a brochure with a sample of the material  to be sent to you.";
ImgCaption[18]="For 10.5ft and longer enclosures, a thin piece of plywood is recommended to be bolted on the top of the roof framing before the cover is installed.  This is not for strength, (the frame has that already) it is to give a uniform surface to shed rain, support snow and prevent pocketing of the cover material.";
ImgCaption[19]="Polyester thread has been used industrywide, and we use it also however it has a life expectance that is limited. We have recently found a synthetic thread that is guranteed to last three times as long as the polyester, that means it should last 15 - 20 years.";

function ViewImage(image,ix,iy,ititle,msg) { 
var win;
var sWidth;
var sHeight;
var NS = (document.layers) ? 1 : 0;
win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
if (NS) 
{
sWidth = win.innerWidth;
sHeight = win.innerHeight;
} else 
{
sWidth = win.document.body.clientWidth;
sHeight = win.document.body.clientHeight;
}
if(sWidth!=ix || sHeight!=iy) 
{
win.close();
setTimeout("ViewImage('"+image+"',"+ix+","+iy+",'"+ititle+"')", 250);
return;
}
if(msg==null){
		 msg="";
		 }
win.document.open();
win.document.write("<html><head><title>"+ititle+"</title>");
win.document.write("<link href='Style/Styles.css' rel='stylesheet' type='text/css'> ");
win.document.write("</head><body>");
win.document.write('<center><div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
win.document.write("<img src="+image+">");
win.document.write("<br>"+msg+"<br><input type=button value='Close Window' onclick='javascript:window.close()' class=textbox></span></center>");
win.document.write("</div></body></html>");
win.document.close();
}
