// library.js
// This file contains javascript functions used in the Hitch Warehouse web site


function DisplayPicture() 
{

	if (navigator.userAgent.indexOf("MSIE") == -1) 
	 {
	  	var NewWindow = window.open("",null,"scrollbars = 1, width=800,height=750,screenx=100,screeny=100");
	 }
	   else 
	 {
	  	var NewWindow = window.open("",null,'scrollbars = 1, width=800,height=750,left=100,top=100, scrollbars = 1');
	 }
	   	    	   		  
	NewWindow.document.write("<html><head><title>Vehicles with and without ModuLite Power Modules</title></head><body>");
	NewWindow.document.write("<center><h2>Without ModuLite</h2></center>All the additional power required to supply the trailer lights (represented by the red line) pass through the vehicle's electrical system including the fuse panel, turn signal switch, taillight harness and lampout sensor.<br><br><center><img src='graphics/withoutmodulite.jpg' width='675' height='224' alt='Without the ModuLite power module' border='0'><br><br><h2>With ModuLite</h2></center>The additional power required to supply the trailer lights (represented by the green line) is supplied directly from the battery. Only a minute amount of power is required from the fuse panel, turn signal switch, taillight harness and lampout sensor to signal when to illuminate the trailer lights.<br><br><center><img src='graphics/withmodulite.jpg' width='675' height='224' alt='Without the ModuLite power module' border='0'></center>");  
	NewWindow.document.write("<form method='Post' onsubmit='window.close()'><center><input type='submit' value='Close Window'>");
	NewWindow.document.write("</form></center></body></html>");   

} // end function DisplayPicture()

function CheckForm()
{

	if (document.form1.FirstName.value == "")
	{
		window.alert("First Name is a required field!");
		document.form1.FirstName.focus();
	}
	
	else if (document.form1.LastName.value == "")
	{
		window.alert("Last Name is a required field!");
		document.form1.LastName.focus();
	}
	else if (document.form1.Email.value == "")
	{
		window.alert("Email is a required field!");
		document.form1.Email.focus();
	}
	else
	{
		document.form1.submit();
	}

} // end function CheckForm()

		