

function imgOff() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function loadNav() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=loadNav.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function imgOn() { //v3.0
  var i,j=0,x,a=imgOn.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

	function chgStatus(msg)  {
		window.status=msg;
	}
	function swp(i,loc)  {i.src=loc;}
	function DistApp(pg)  {var win = window.open (pg,"","height=475,width=775,top=0,left=0,screenX=0,screenY=0");}


	function validateRegForm(f) {
		var bolBadZip = false;
		var bolNG = false;
		var msg = "";
		msg = "You must complete the following fields prior to submitting this form:";
		if (f.fNm.value == "")  
			{
				msg += "\n     First Name";
				bolNG=true;
			}
		if (f.lNm.value == "")  
			{ 
				msg += "\n     Last Name";
				bolNG=true;
			}
		if (f.addr1.value == "")  
			{ 
				msg += "\n     Street Address";
				bolNG=true;
			}
		if (f.city.value == "")  
			{ 
				msg += "\n     City";
				bolNG=true;
			}
		if (! f.state.selectedIndex>0)
			{
				msg += "\n     State";
				bolNG=true;
			}
/*		strZip = new String (f.zip.value);
		if (strZip.value == "" || strZip.length < 5 )  
			{ 
				bolBadZip=true;
		} else {
			for (i=0;i<strZip.length;i++)
			{
				if (isNaN(strZip.charAt(i))) 
				{
					bolBadZip = true;
				}
			}
		}
		if (bolBadZip == true)
		{
			msg += "\n     Zip Code";
			bolNG=true;
		}		
*/
		strEmail = new String (f.email.value);
		if (strEmail.length < 10 || strEmail.indexOf("@") < 2 || strEmail.indexOf(".") < 6)
			{
				msg += "\n     Email Address";
				bolNG=true;

			}

		if (! f.v1yr.selectedIndex>0)
			{
				msg += "\n     Vehicle 1 Year";
				bolNG=true;
			}
		if (f.v1mke.value == "")  
			{ 
				msg += "\n     Vehicle 1 Make";
				bolNG=true;
			}
		if (f.v1mdl.value == "")  
			{ 
				msg += "\n     Vehicle 1 Model";
				bolNG=true;
			}
		if (bolNG == true)
			{
				alert (msg);
				return false;
			}
		return true;                                                           			                  
	}


	function validateEmail()  {
		strEmail = new String (document.email.email.value);
		strMsg = new String(document.email.msg.value);

		if (strEmail.length<10)
		{
			alert("Please enter your email address");
			document.email.email.focus();
			return false;

		} else {
			if (! (strEmail.indexOf("@") > 2) || !(strEmail.indexOf(".") > 6))
			{
				alert ("Please enter your email address");
				return false;

			}
		}


		if (! document.email.subj.selectedIndex>0)
		{
			alert ("So that we may direct your inquiry to the appropriate staff member, please choose a subject line for your email");
			document.email.subj.focus();
			return false;
		}

		if (strMsg.length <=0)
		{
			alert ("Type your message in the message field");
			document.email.msg.focus();
			return false;
		}

		return true;

	}
	
	function regWin()  {var win = window.open ("regThanks.asp", "", "height=200,width=250");}
	function prodWin(pg)  {var win = window.open (pg,"",'height=280,width=260,top=0,left=0,screenX=0,screenY=0');}
	function emailWin(pg)  {var win = window.open (pg,"","height=575,width=775,top=0,left=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes");}

	function clearEmailForm()  {
		document.email.email.value="";
		document.email.name.value="";
		document.email.addr.value="";
		document.email.city.value="";
		document.email.state.value="";
		document.email.cntry.value="";
		document.email.zip.value="";
		document.email.msg.value="";
		document.email.subj.selectedIndex=0;
		document.email.email.focus();
	}
