// JavaScript Document

//populate debtor with firm name on credit app
function changeName() {
	document.creditAppForm.debtorName.value=document.creditAppForm.firmName.value;
	//alert(document.creditAppForm.firmName.value);
}

function repeatAdr() {
	document.creditAppForm.shipAdr.value=document.creditAppForm.billAdr.value;
	document.creditAppForm.shipCity.value=document.creditAppForm.billCity.value;
	document.creditAppForm.shipSt.value=document.creditAppForm.billSt.value;
	document.creditAppForm.shipZip.value=document.creditAppForm.billZip.value;
	document.creditAppForm.shipPhone1.value=document.creditAppForm.billPhone1.value;
	document.creditAppForm.shipPhone2.value=document.creditAppForm.billPhone2.value;
	document.creditAppForm.shipPhone3.value=document.creditAppForm.billPhone3.value;
}

//contact.jsp - general contact form validation
function validateContactForm(f) {
	if (f.firstName.value=="") {
		alert('Please enter your first name.');
		f.firstName.focus();
		return false;
	}
	if (f.lastName.value=="") {
		alert('Please enter your last name.');
		f.lastName.focus();
		return false;
	}
	if (f.contactPhone1.value=="") {
		alert('Please enter your area code.');
		f.contactPhone1.focus();
		return false;
	}
	if (f.contactPhone1.value.length > 0)
	{
      for (i = 0; i < f.contactPhone1.value.length; i++) {
        thisChar =f.contactPhone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone1.focus();
          return false;
        }
      }
	  if (f.contactPhone1.value.length < 3){
		  alert ("Your area code must be 3 digits.");
		  f.contactPhone1.focus();
          return false;
	  }
    }
	if (f.contactPhone2.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone2.focus();
		return false;
	}
	if (f.contactPhone2.value.length > 0)
	{
      for (i = 0; i < f.contactPhone2.value.length; i++) {
        thisChar =f.contactPhone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone2.focus();
          return false;
        }
      }
	  if (f.contactPhone2.value.length < 3){
		  alert ("Your phone number must be 3 digits.");
		  f.contactPhone2.focus();
          return false;
	  }
    }
	if (f.contactPhone3.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone3.focus();
		return false;
	}
	if (f.contactPhone3.value.length > 0)
	{
      for (i = 0; i < f.contactPhone3.value.length; i++) {
        thisChar =f.contactPhone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone3.focus();
          return false;
        }
		if (f.contactPhone3.value.length < 4){
		  alert ("Your phone number must be 4 digits.");
		  f.contactPhone3.focus();
          return false;
	  	}
     }
    }
	if (f.contactEmail.value=="") {
		alert('Please enter your email address.');
		f.contactEmail.focus();
		return false;
	}
	if (f.contactComments.value=="") {
		alert('Please enter your comments or question.');
		f.contactComments.focus();
		return false;
	}
	if (echeck(f.contactEmail.value)==false){
		f.contactEmail.value="";
		f.contactEmail.focus()
		return false
	}
	f.btnSubmit.value = "Submitting...";
	f.btnSubmit.disabled = true;
	return true;
}

//regenRvsp.jsp - general rsvp form validation
function validateRsvpForm(f) {
	if (f.firstName.value=="") {
		alert('Please enter your first name.');
		f.firstName.focus();
		return false;
	}
	if (f.lastName.value=="") {
		alert('Please enter your last name.');
		f.lastName.focus();
		return false;
	}
	if (f.companyName.value=="") {
		alert('Please enter your company\'s name.');
		f.companyName.focus();
		return false;
	}
	if (f.contactPhone1.value=="") {
		alert('Please enter your area code.');
		f.contactPhone1.focus();
		return false;
	}
	if (f.contactPhone1.value.length > 0)
	{
      for (i = 0; i < f.contactPhone1.value.length; i++) {
        thisChar =f.contactPhone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone1.focus();
          return false;
        }
      }
	  if (f.contactPhone1.value.length < 3){
		  alert ("Your area code must be 3 digits.");
		  f.contactPhone1.focus();
          return false;
	  }
    }
	if (f.contactPhone2.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone2.focus();
		return false;
	}
	if (f.contactPhone2.value.length > 0)
	{
      for (i = 0; i < f.contactPhone2.value.length; i++) {
        thisChar =f.contactPhone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone2.focus();
          return false;
        }
      }
	  if (f.contactPhone2.value.length < 3){
		  alert ("Your phone number must be 3 digits.");
		  f.contactPhone2.focus();
          return false;
	  }
    }
	if (f.contactPhone3.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone3.focus();
		return false;
	}
	if (f.contactPhone3.value.length > 0)
	{
      for (i = 0; i < f.contactPhone3.value.length; i++) {
        thisChar =f.contactPhone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone3.focus();
          return false;
        }
		if (f.contactPhone3.value.length < 4){
		  alert ("Your phone number must be 4 digits.");
		  f.contactPhone3.focus();
          return false;
	  	}
     }
    }
	if (f.contactEmail.value=="") {
		alert('Please enter your email address.');
		f.contactEmail.focus();
		return false;
	}
	if (f.numAttending.value=="" || f.numAttending.value==0) {
		alert('Provide the number that will be attending.');
		f.numAttending.focus();
		return false;
	}
	if (echeck(f.contactEmail.value)==false){
		f.contactEmail.value="";
		f.contactEmail.focus()
		return false
	}
	f.btnSubmit.value = "Submitting...";
	f.btnSubmit.disabled = true;
	return true;
}
//bid request form validatino
function validateBidRequestForm(f) {
	if (f.firstName.value=="") {
		alert('Please enter your first name.');
		f.firstName.focus();
		return false;
	}
	if (f.lastName.value=="") {
		alert('Please enter your last name.');
		f.lastName.focus();
		return false;
	}
	if (f.companyName.value=="") {
		alert('Please enter your company\'s name.');
		f.companyName.focus();
		return false;
	}
	if (f.contactPhone1.value=="") {
		alert('Please enter your area code.');
		f.contactPhone1.focus();
		return false;
	}
	if (f.contactPhone1.value.length > 0)
	{
      for (i = 0; i < f.contactPhone1.value.length; i++) {
        thisChar =f.contactPhone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone1.focus();
          return false;
        }
      }
	  if (f.contactPhone1.value.length < 3){
		  alert ("Your area code must be 3 digits.");
		  f.contactPhone1.focus();
          return false;
	  }
    }
	if (f.contactPhone2.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone2.focus();
		return false;
	}
	if (f.contactPhone2.value.length > 0)
	{
      for (i = 0; i < f.contactPhone2.value.length; i++) {
        thisChar =f.contactPhone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone2.focus();
          return false;
        }
      }
	  if (f.contactPhone2.value.length < 3){
		  alert ("Your phone number must be 3 digits.");
		  f.contactPhone2.focus();
          return false;
	  }
    }
	if (f.contactPhone3.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone3.focus();
		return false;
	}
	if (f.contactPhone3.value.length > 0)
	{
      for (i = 0; i < f.contactPhone3.value.length; i++) {
        thisChar =f.contactPhone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone3.focus();
          return false;
        }
		if (f.contactPhone3.value.length < 4){
		  alert ("Your phone number must be 4 digits.");
		  f.contactPhone3.focus();
          return false;
	  	}
     }
    }
	if (f.contactEmail.value=="") {
		alert('Please enter your email address.');
		f.contactEmail.focus();
		return false;
	}
	if (echeck(f.contactEmail.value)==false){
		f.contactEmail.value="";
		f.contactEmail.focus()
		return false;
	}
	if (f.contactAdr.value=="") {
		alert('Please enter your address.');
		f.contactAdr.focus();
		return false;
	}
	if (f.contactCity.value=="") {
		alert('Please enter your city.');
		f.contactCity.focus();
		return false;
	}
	if (f.contactState.value=="") {
		alert('Please enter your state.');
		f.contactState.focus();
		return false;
	}
	if (f.contactZip.value=="") {
		alert('Please enter your zip code.');
		f.contactZip.focus();
		return false;
	}
	
	f.btnSubmit.value = "Submitting...";
	f.btnSubmit.disabled = true;
	return true;
}
//end bid request form

//creditApp.jsp - credit application form validation
function validateCreditAppForm(f) {
	if (f.firmName.value=="") {
		alert('Please enter your firm\'s name.');
		f.firmName.focus();
		return false;
	}
	if (f.contactName.value=="") {
		alert('Please enter your name.');
		f.contactName.focus();
		return false;
	}
	if (f.emailAdr.value=="") {
		alert('Please enter your email address.');
		f.emailAdr.focus();
		return false;
	}
	if (echeck(f.emailAdr.value)==false){
		f.emailAdr.value="";
		f.emailAdr.focus()
		return false
	}
	if (f.billAdr.value=="") {
		alert('Please enter your billing address.');
		f.billAdr.focus();
		return false;
	}
	if (f.billCity.value=="") {
		alert('Please enter your billing city.');
		f.billCity.focus();
		return false;
	}
	if (f.billSt.value=="") {
		alert('Please enter your billing state.');
		f.billSt.focus();
		return false;
	}
	if (f.billZip.value=="") {
		alert('Please enter your billing zip code.');
		f.billZip.focus();
		return false;
	}
	if (f.billPhone1.value=="") {
		alert('Please enter your billing area code.');
		f.billPhone1.focus();
		return false;
	}
	if (f.billPhone1.value.length > 0)
	{
      for (i = 0; i < f.billPhone1.value.length; i++) {
        thisChar =f.billPhone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your billing phone number must be numeric.");
		  f.billPhone1.focus();
          return false;
        }
		if (f.billPhone1.value.length < 3){
		  alert ("Your billing phone number must be 3 digits.");
		  f.billPhone1.focus();
          return false;
	  	}
     }
    }
	if (f.billPhone2.value=="") {
		alert('Please enter your billing phone number.');
		f.billPhone2.focus();
		return false;
	}
	if (f.billPhone2.value.length > 0)
	{
      for (i = 0; i < f.billPhone2.value.length; i++) {
        thisChar =f.billPhone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your billing phone number must be numeric.");
		  f.billPhone2.focus();
          return false;
        }
		if (f.billPhone2.value.length < 3){
		  alert ("Your billing phone number must be 3 digits.");
		  f.billPhone2.focus();
          return false;
	  	}
     }
    }
	if (f.billPhone3.value=="") {
		alert('Please enter your billing phone number.');
		f.billPhone3.focus();
		return false;
	}
	if (f.billPhone3.value.length > 0)
	{
      for (i = 0; i < f.billPhone3.value.length; i++) {
        thisChar =f.billPhone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your billing phone number must be numeric.");
		  f.billPhone3.focus();
          return false;
        }
		if (f.billPhone3.value.length < 4){
		  alert ("Your billing phone number must be 4 digits.");
		  f.billPhone3.focus();
          return false;
	  	}
     }
    }
	if (f.shipAdr.value=="") {
		alert('Please enter your shipping address.');
		f.shipAdr.focus();
		return false;
	}
	if (f.shipCity.value=="") {
		alert('Please enter your shipping city.');
		f.shipCity.focus();
		return false;
	}
	if (f.shipSt.value=="") {
		alert('Please enter your shipping state.');
		f.shipSt.focus();
		return false;
	}
	if (f.shipZip.value=="") {
		alert('Please enter your shipping zip code.');
		f.shipZip.focus();
		return false;
	}
	if (f.shipPhone1.value=="") {
		alert('Please enter your shipping area code.');
		f.shipPhone1.focus();
		return false;
	}
	if (f.shipPhone1.value.length > 0)
	{
      for (i = 0; i < f.shipPhone1.value.length; i++) {
        thisChar =f.shipPhone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your shipping phone number must be numeric.");
		  f.shipPhone1.focus();
          return false;
        }
		if (f.shipPhone1.value.length < 3){
		  alert ("Your shipping phone number must be 3 digits.");
		  f.shipPhone1.focus();
          return false;
	  	}
     }
    }
	if (f.shipPhone2.value=="") {
		alert('Please enter your shipping phone number.');
		f.shipPhone2.focus();
		return false;
	}
	if (f.shipPhone2.value.length > 0)
	{
      for (i = 0; i < f.shipPhone2.value.length; i++) {
        thisChar =f.shipPhone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your shipping phone number must be numeric.");
		  f.shipPhone2.focus();
          return false;
        }
		if (f.shipPhone2.value.length < 3){
		  alert ("Your shipping phone number must be 3 digits.");
		  f.shipPhone2.focus();
          return false;
	  	}
     }
    }
	if (f.shipPhone3.value=="") {
		alert('Please enter your shipping phone number.');
		f.shipPhone3.focus();
		return false;
	}
	if (f.shipPhone3.value.length > 0)
	{
      for (i = 0; i < f.shipPhone3.value.length; i++) {
        thisChar =f.shipPhone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your shipping phone number must be numeric.");
		  f.shipPhone3.focus();
          return false;
        }
		if (f.shipPhone3.value.length < 4){
		  alert ("Your shipping phone number must be 4 digits.");
		  f.shipPhone3.focus();
          return false;
	  	}
     }
    }
	if (f.busYears.value=="") {
		alert('Please provide the number of years your firm has been in business.');
		f.busYears.focus();
		return false;
	}
	if (f.president.value=="") {
		alert('Please provide your firm president\'s name.');
		f.president.focus();
		return false;
	}
	if (f.controller.value=="") {
		alert('Please provide your firm controller\'s name.');
		f.controller.focus();
		return false;
	}
	if (f.bankName.value=="") {
		alert('Please provide your bank\'s name.');
		f.bankName.focus();
		return false;
	}
	if (f.bankAdr.value=="") {
		alert('Please provide your bank\'s address.');
		f.bankAdr.focus();
		return false;
	}
	if (f.bankCity.value=="") {
		alert('Please provide your bank\'s city.');
		f.bankCity.focus();
		return false;
	}
	if (f.bankSt.value=="") {
		alert('Please provide your bank\'s state.');
		f.bankSt.focus();
		return false;
	}
	if (f.bankZip.value=="") {
		alert('Please provide your bank\'s zip code.');
		f.bankZip.focus();
		return false;
	}
	if (f.bankPhone1.value=="") {
		alert('Please provide your bank\'s area code.');
		f.bankPhone1.focus();
		return false;
	}
	if (f.bankPhone1.value.length > 0)
	{
      for (i = 0; i < f.bankPhone1.value.length; i++) {
        thisChar =f.bankPhone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your bank\'s phone number must be numeric.");
		  f.bankPhone1.focus();
          return false;
        }
		if (f.bankPhone1.value.length < 3){
		  alert ("Your bank\'s phone number must be 3 digits.");
		  f.bankPhone1.focus();
          return false;
	  	}
     }
    }
	if (f.bankPhone2.value=="") {
		alert('Please enter your bank\'s phone number.');
		f.bankPhone2.focus();
		return false;
	}
	if (f.bankPhone2.value.length > 0)
	{
      for (i = 0; i < f.bankPhone2.value.length; i++) {
        thisChar =f.bankPhone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your bank\'s phone number must be numeric.");
		  f.bankPhone2.focus();
          return false;
        }
		if (f.bankPhone2.value.length < 3){
		  alert ("Your bank\'s phone number must be 3 digits.");
		  f.bankPhone2.focus();
          return false;
	  	}
     }
    }
	if (f.bankPhone3.value=="") {
		alert('Please enter your bank\'s phone number.');
		f.bankPhone3.focus();
		return false;
	}
	if (f.bankPhone3.value.length > 0)
	{
      for (i = 0; i < f.bankPhone3.value.length; i++) {
        thisChar =f.bankPhone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your bank\'s phone number must be numeric.");
		  f.bankPhone3.focus();
          return false;
        }
		if (f.bankPhone3.value.length < 4){
		  alert ("Your bank\'s phone number must be 4 digits.");
		  f.bankPhone3.focus();
          return false;
	  	}
     }
    }
	//1st reference
	if (f.refName1.value=="") {
		alert('Please provide your 1st reference\'s name.');
		f.refName1.focus();
		return false;
	}
	if (f.refAdr1.value=="") {
		alert('Please provide your 1st reference\'s address.');
		f.refAdr1.focus();
		return false;
	}
	if (f.refCity1.value=="") {
		alert('Please provide your 1st reference\'s city.');
		f.refCity1.focus();
		return false;
	}
	if (f.refSt1.value=="") {
		alert('Please provide your 1st reference\'s state.');
		f.refSt1.focus();
		return false;
	}
	if (f.refZip1.value=="") {
		alert('Please provide your 1st reference\'s zip code.');
		f.refZip1.focus();
		return false;
	}
	if (f.ref1Phone1.value=="") {
		alert('Please provide your 1st reference\'s area code.');
		f.ref1Phone1.focus();
		return false;
	}
	if (f.ref1Phone1.value.length > 0)
	{
      for (i = 0; i < f.ref1Phone1.value.length; i++) {
        thisChar =f.ref1Phone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your 1st reference\'s phone number must be numeric.");
		  f.ref1Phone1.focus();
          return false;
        }
		if (f.ref1Phone1.value.length < 3){
		  alert ("Your 1st reference\'s phone number must be 3 digits.");
		  f.ref1Phone1.focus();
          return false;
	  	}
     }
    }
	if (f.ref1Phone2.value=="") {
		alert('Please provide your 1st reference\'s phone number.');
		f.ref1Phone2.focus();
		return false;
	}
	if (f.ref1Phone2.value.length > 0)
	{
      for (i = 0; i < f.ref1Phone2.value.length; i++) {
        thisChar =f.ref1Phone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your 1st reference\'s phone number must be numeric.");
		  f.ref1Phone2.focus();
          return false;
        }
		if (f.ref1Phone2.value.length < 3){
		  alert ("Your 1st reference\'s phone number must be 3 digits.");
		  f.ref1Phone2.focus();
          return false;
	  	}
     }
    }
	if (f.ref1Phone3.value=="") {
		alert('Please provide your 1st reference\'s phone number.');
		f.ref1Phone3.focus();
		return false;
	}
	if (f.ref1Phone3.value.length > 0)
	{
      for (i = 0; i < f.ref1Phone3.value.length; i++) {
        thisChar =f.ref1Phone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your 1st reference\'s phone number must be numeric.");
		  f.ref1Phone3.focus();
          return false;
        }
		if (f.ref1Phone3.value.length < 4){
		  alert ("Your 1st reference\'s phone number must be 4 digits.");
		  f.ref1Phone3.focus();
          return false;
	  	}
     }
    }
	//2nd reference
	if (f.refName2.value=="") {
		alert('Please provide your 2nd reference\'s name.');
		f.refName2.focus();
		return false;
	}
	if (f.refAdr2.value=="") {
		alert('Please provide your 2nd reference\'s address.');
		f.refAdr2.focus();
		return false;
	}
	if (f.refCity2.value=="") {
		alert('Please provide your 2nd reference\'s city.');
		f.refCity2.focus();
		return false;
	}
	if (f.refSt2.value=="") {
		alert('Please provide your 2nd reference\'s state.');
		f.refSt2.focus();
		return false;
	}
	if (f.refZip2.value=="") {
		alert('Please provide your 2nd reference\'s zip code.');
		f.refZip2.focus();
		return false;
	}
	if (f.ref2Phone1.value=="") {
		alert('Please provide your 2nd reference\'s area code.');
		f.ref2Phone1.focus();
		return false;
	}
	if (f.ref2Phone1.value.length > 0)
	{
      for (i = 0; i < f.ref2Phone1.value.length; i++) {
        thisChar =f.ref2Phone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your 2nd reference\'s phone number must be numeric.");
		  f.ref2Phone1.focus();
          return false;
        }
		if (f.ref2Phone1.value.length < 3){
		  alert ("Your 2nd reference\'s phone number must be 3 digits.");
		  f.ref2Phone1.focus();
          return false;
	  	}
     }
    }
	if (f.ref2Phone2.value=="") {
		alert('Please provide your 2nd reference\'s phone number.');
		f.ref2Phone2.focus();
		return false;
	}
	if (f.ref2Phone2.value.length > 0)
	{
      for (i = 0; i < f.ref2Phone2.value.length; i++) {
        thisChar =f.ref2Phone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your 2nd reference\'s phone number must be numeric.");
		  f.ref2Phone2.focus();
          return false;
        }
		if (f.ref2Phone2.value.length < 3){
		  alert ("Your 2nd reference\'s phone number must be 3 digits.");
		  f.ref2Phone2.focus();
          return false;
	  	}
     }
    }
	if (f.ref2Phone3.value=="") {
		alert('Please provide your 2nd reference\'s phone number.');
		f.ref2Phone3.focus();
		return false;
	}
	if (f.ref2Phone3.value.length > 0)
	{
      for (i = 0; i < f.ref2Phone3.value.length; i++) {
        thisChar =f.ref2Phone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your 2nd reference\'s phone number must be numeric.");
		  f.ref2Phone3.focus();
          return false;
        }
		if (f.ref2Phone3.value.length < 4){
		  alert ("Your 2nd reference\'s phone number must be 4 digits.");
		  f.ref2Phone3.focus();
          return false;
	  	}
     }
    }
	//3rd reference
	if (f.refName3.value=="") {
		alert('Please provide your 3rd reference\'s name.');
		f.refName3.focus();
		return false;
	}
	if (f.refAdr3.value=="") {
		alert('Please provide your 3rd reference\'s address.');
		f.refAdr3.focus();
		return false;
	}
	if (f.refCity3.value=="") {
		alert('Please provide your 3rd reference\'s city.');
		f.refCity3.focus();
		return false;
	}
	if (f.refSt3.value=="") {
		alert('Please provide your 3rd reference\'s state.');
		f.refSt3.focus();
		return false;
	}
	if (f.refZip3.value=="") {
		alert('Please provide your 3rd reference\'s zip code.');
		f.refZip3.focus();
		return false;
	}
	if (f.ref3Phone1.value=="") {
		alert('Please provide your 3rd reference\'s area code.');
		f.ref3Phone1.focus();
		return false;
	}
	if (f.ref3Phone1.value.length > 0)
	{
      for (i = 0; i < f.ref3Phone1.value.length; i++) {
        thisChar =f.ref3Phone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your 3rd reference\'s phone number must be numeric.");
		  f.ref3Phone1.focus();
          return false;
        }
		if (f.ref3Phone1.value.length < 3){
		  alert ("Your 3rd reference\'s phone number must be 3 digits.");
		  f.ref3Phone1.focus();
          return false;
	  	}
     }
    }
	if (f.ref3Phone2.value=="") {
		alert('Please provide your 3rd reference\'s phone number.');
		f.ref3Phone2.focus();
		return false;
	}
	if (f.ref3Phone2.value.length > 0)
	{
      for (i = 0; i < f.ref3Phone2.value.length; i++) {
        thisChar =f.ref3Phone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your 3rd reference\'s phone number must be numeric.");
		  f.ref3Phone2.focus();
          return false;
        }
		if (f.ref3Phone2.value.length < 3){
		  alert ("Your 3rd reference\'s phone number must be 3 digits.");
		  f.ref3Phone2.focus();
          return false;
	  	}
     }
    }
	if (f.ref3Phone3.value=="") {
		alert('Please provide your 3rd reference\'s phone number.');
		f.ref3Phone3.focus();
		return false;
	}
	if (f.ref3Phone3.value.length > 0)
	{
      for (i = 0; i < f.ref3Phone3.value.length; i++) {
        thisChar =f.ref3Phone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your 3rd reference\'s phone number must be numeric.");
		  f.ref3Phone3.focus();
          return false;
        }
		if (f.ref3Phone3.value.length < 4){
		  alert ("Your 3rd reference\'s phone number must be 4 digits.");
		  f.ref3Phone3.focus();
          return false;
	  	}
     }
    }
	if (f.signedBy.value=="") {
		alert('Please provide your digital signature.');
		f.signedBy.focus();
		return false;
	}
	if (f.signedByTitle.value=="") {
		alert('Please provide your title.');
		f.signedByTitle.focus();
		return false;
	}
	if (f.guarantor1.value=="") {
		alert('Please provide your 1st guarantor.');
		f.guarantor1.focus();
		return false;
	}
	if (f.guarantor2.value=="") {
		alert('Please provide your 2nd guarantor.');
		f.guarantor2.focus();
		return false;
	}
	/*if (echeck(f.contactEmail.value)==false){
		f.contactEmail.value="";
		f.contactEmail.focus()
		return false
	}*/
	f.btnSubmit.value = "Submitting...";
	f.btnSubmit.disabled = true;
	return true;
}
//end of Credit App Check


//requestQuote.jsp - vehicle quote request form validation
function validateRequestQuoteForm(f) {
	if (f.firstName.value=="") {
		alert('Please enter your first name.');
		f.firstName.focus();
		return false;
	}
	if (f.lastName.value=="") {
		alert('Please enter your last name.');
		f.lastName.focus();
		return false;
	}
	if (f.contactAdr.value=="") {
		alert('Please enter your street address.');
		f.contactAdr.focus();
		return false;
	}
	if (f.contactCity.value=="") {
		alert('Please enter your city name.');
		f.contactCity.focus();
		return false;
	}
	if (f.contactState.value=="") {
		alert('Please enter your state.');
		f.contactState.focus();
		return false;
	}
	if (f.contactZip.value=="") {
		alert('Please enter your zip code.');
		f.contactZip.focus();
		return false;
	}
	if (f.contactPhone1.value=="") {
		alert('Please enter your area code.');
		f.contactPhone1.focus();
		return false;
	}
	if (f.contactPhone1.value.length > 0)
	{
      for (i = 0; i < f.contactPhone1.value.length; i++) {
        thisChar =f.contactPhone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone1.focus();
          return false;
        }
      }
	  if (f.contactPhone1.value.length < 3){
		  alert ("Your area code must be 3 digits.");
		  f.contactPhone1.focus();
          return false;
	  }
    }
	if (f.contactPhone2.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone2.focus();
		return false;
	}
	if (f.contactPhone2.value.length > 0)
	{
      for (i = 0; i < f.contactPhone2.value.length; i++) {
        thisChar =f.contactPhone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone2.focus();
          return false;
        }
      }
	  if (f.contactPhone2.value.length < 3){
		  alert ("Your phone number must be 3 digits.");
		  f.contactPhone2.focus();
          return false;
	  }
    }
	if (f.contactPhone3.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone3.focus();
		return false;
	}
	if (f.contactPhone3.value.length > 0)
	{
      for (i = 0; i < f.contactPhone3.value.length; i++) {
        thisChar =f.contactPhone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone3.focus();
          return false;
        }
		if (f.contactPhone3.value.length < 4){
		  alert ("Your phone number must be 4 digits.");
		  f.contactPhone3.focus();
          return false;
	  	}
     }
    }
	if (f.contactEmail.value=="") {
		alert('Please enter your email address.');
		f.contactEmail.focus();
		return false;
	}
	if (echeck(f.contactEmail.value)==false){
		f.contactEmail.value="";
		f.contactEmail.focus()
		return false
	}
	if (f.vehYear.value==0) {
		alert('Please select your vehicle\'s year.');
		f.vehYear.focus();
		return false;
	}
	if (f.vehMake.value==0) {
		alert('Please select your vehicle\'s make.');
		f.vehMake.focus();
		return false;
	}
	if (f.vehModel.value=="---- Select Model ----") {
		alert('Please select your vehicle\'s model.');
		f.vehModel.focus();
		return false;
	}
	if (f.vehMiles.value=="") {
		alert('Please enter your vehicle\'s mileage.');
		f.vehMiles.focus();
		return false;
	}
	if (f.vehDesc.value=="") {
		alert('Please provide a brief description of your vehicle.');
		f.vehDesc.focus();
		return false;
	}
	f.btnSubmit.value = "Submitting...";
	f.btnSubmit.disabled = true;
	return true;
}





//partsRequest.jsp - general parts request form validation
function validatePartsRequestForm(f) {
	if (f.firstName.value=="") {
		alert('Please enter your first name.');
		f.firstName.focus();
		return false;
	}
	if (f.lastName.value=="") {
		alert('Please enter your last name.');
		f.lastName.focus();
		return false;
	}
	if (f.contactAdr.value=="") {
		alert('Please enter your street address.');
		f.contactAdr.focus();
		return false;
	}
	if (f.contactCity.value=="") {
		alert('Please enter your city name.');
		f.contactCity.focus();
		return false;
	}
	if (f.contactState.value=="") {
		alert('Please enter your state.');
		f.contactState.focus();
		return false;
	}
	if (f.contactZip.value=="") {
		alert('Please enter your zip code.');
		f.contactZip.focus();
		return false;
	}
	if (f.contactPhone1.value=="") {
		alert('Please enter your area code.');
		f.contactPhone1.focus();
		return false;
	}
	if (f.contactPhone1.value.length > 0)
	{
      for (i = 0; i < f.contactPhone1.value.length; i++) {
        thisChar =f.contactPhone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone1.focus();
          return false;
        }
      }
	  if (f.contactPhone1.value.length < 3){
		  alert ("Your area code must be 3 digits.");
		  f.contactPhone1.focus();
          return false;
	  }
    }
	if (f.contactPhone2.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone2.focus();
		return false;
	}
	if (f.contactPhone2.value.length > 0)
	{
      for (i = 0; i < f.contactPhone2.value.length; i++) {
        thisChar =f.contactPhone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone2.focus();
          return false;
        }
      }
	  if (f.contactPhone2.value.length < 3){
		  alert ("Your phone number must be 3 digits.");
		  f.contactPhone2.focus();
          return false;
	  }
    }
	if (f.contactPhone3.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone3.focus();
		return false;
	}
	if (f.contactPhone3.value.length > 0)
	{
      for (i = 0; i < f.contactPhone3.value.length; i++) {
        thisChar =f.contactPhone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone3.focus();
          return false;
        }
		if (f.contactPhone3.value.length < 4){
		  alert ("Your phone number must be 4 digits.");
		  f.contactPhone3.focus();
          return false;
	  	}
     }
    }
	if (f.contactEmail.value=="") {
		alert('Please enter your email address.');
		f.contactEmail.focus();
		return false;
	}
	if (f.contactMethod.value==0) {
		alert('Please select your preferred method of contact.');
		f.contactMethod.focus();
		return false;
	}
	if (echeck(f.contactEmail.value)==false){
		f.contactEmail.value="";
		f.contactEmail.focus()
		return false
	}
	if (f.vehYear.value==0) {
		alert('Please select your vehicle\'s year.');
		f.vehYear.focus();
		return false;
	}
	if (f.vehMake.value==0) {
		alert('Please select your vehicle\'s make.');
		f.vehMake.focus();
		return false;
	}
	if (f.vehModel.value=="---- Select Model ----") {
		alert('Please select your vehicle\'s model.');
		f.vehModel.focus();
		return false;
	}
	if (f.vehVin.value=="") {
		alert('Please enter your vehicle\'s VIN number.');
		f.vehVin.focus();
		return false;
	}
	if (f.orderDesc.value=="") {
		alert('Please enter your parts order/description.');
		f.orderDesc.focus();
		return false;
	}
	f.btnSubmit.value = "Submitting...";
	f.btnSubmit.disabled = true;
	return true;
}

//specials/specialSignUp.jsp - signup for exclusive specials
function validateSpecialsForm(f) {
	if (f.firstName.value=="") {
		alert('Please enter your first name.');
		f.firstName.focus();
		return false;
	}	
	if (f.lastName.value=="") {
		alert('Please enter your last name.');
		f.lastName.focus();
		return false;
	}
	if (f.contactPhone1.value=="") {
		alert('Please enter your area code.');
		f.contactPhone1.focus();
		return false;
	}
	if (f.contactPhone1.value.length > 0)
	{
      for (i = 0; i < f.contactPhone1.value.length; i++) {
        thisChar =f.contactPhone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone1.focus();
          return false;
        }
      }
	  if (f.contactPhone1.value.length < 3){
		  alert ("Your area code must be 3 digits.");
		  f.contactPhone1.focus();
          return false;
	  }
    }
	if (f.contactPhone2.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone2.focus();
		return false;
	}
	if (f.contactPhone2.value.length > 0)
	{
      for (i = 0; i < f.contactPhone2.value.length; i++) {
        thisChar =f.contactPhone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone2.focus();
          return false;
        }
      }
	  if (f.contactPhone2.value.length < 3){
		  alert ("Your phone number must be 3 digits.");
		  f.contactPhone2.focus();
          return false;
	  }
    }
	if (f.contactPhone3.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone3.focus();
		return false;
	}
	if (f.contactPhone3.value.length > 0)
	{
      for (i = 0; i < f.contactPhone3.value.length; i++) {
        thisChar =f.contactPhone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone3.focus();
          return false;
        }
		if (f.contactPhone3.value.length < 4){
		  alert ("Your phone number must be 4 digits.");
		  f.contactPhone3.focus();
          return false;
	  	}
     }
    }
	if (f.contactEmail.value=="") {
		alert('Please enter your email address.');
		f.contactEmail.focus();
		return false;
	}
	if (f.vehMake.value==0) {
		alert('Please select your vehicle\'s make.');
		f.vehMake.focus();
		return false;
	}
	if (f.vehNum.value==0) {
		alert('Please indicate how many vehicles you own.');
		f.vehNum.focus();
		return false;
	}
	if (echeck(f.contactEmail.value)==false){
		f.contactEmail.value="";
		f.contactEmail.focus()
		return false
	}
	f.btnSubmit.value = "Submitting...";
	f.btnSubmit.disabled = true;
	return true;
}

//phone number check
//check each phone number input for value, length and text
function phCheck(f){
	if (f.contactPhone1.value=="") {
		alert('Please enter your area code.');
		f.contactPhone1.focus();
		return false;
	}
	if (f.contactPhone1.value.length > 0)
	{
      for (i = 0; i < f.contactPhone1.value.length; i++) {
        thisChar =f.contactPhone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone1.focus();
          return false;
        }
      }
	  if (f.contactPhone1.value.length < 3){
		  alert ("Your area code must be 3 digits.");
		  f.contactPhone1.focus();
          return false;
	  }
    }
	if (f.contactPhone2.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone2.focus();
		return false;
	}
	if (f.contactPhone2.value.length > 0)
	{
      for (i = 0; i < f.contactPhone2.value.length; i++) {
        thisChar =f.contactPhone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone2.focus();
          return false;
        }
      }
	  if (f.contactPhone2.value.length < 3){
		  alert ("Your phone number must be 3 digits.");
		  f.contactPhone2.focus();
          return false;
	  }
    }
	if (f.contactPhone3.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone3.focus();
		return false;
	}
	if (f.contactPhone3.value.length > 0)
	{
      for (i = 0; i < f.contactPhone3.value.length; i++) {
        thisChar =f.contactPhone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone3.focus();
          return false;
        }
		if (f.contactPhone3.value.length < 4){
		  alert ("Your phone number must be 4 digits.");
		  f.contactPhone3.focus();
          return false;
	  	}
     }
    }
}

//check for valid email addresses - used for all forms
function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert("Please enter a valid email address.")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Please enter a valid email address.")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("Please enter a valid email address.")
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		alert("Please enter a valid email address.")
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("Please enter a valid email address.")
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		alert("Please enter a valid email address.")
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		alert("Please enter a valid email address.")
		return false
	 }

	 return true					
}

//once a user selects a vehicle make, this function populates the model select menu
		  
function populateModel(formName,idx) {

var vehModelValue=[
["---- Select Model ----"],
//Buick
["---- Select Model ----","Enclave","Lacrosse","Lucerne"],
//Cadillac
["---- Select Model ----","CTS","DTS","Escalade","SRX","STS","XLR"],
//Chevrolet Light Duty
["---- Select Model ----","Avalanche","Aveo","Cobalt","Colorado","Corvette","Equinox","Express","HHR","Impala","Malibu","Silverado 1500","Silverado 2500 HD","Silverado 3500 HD","Suburban","Tahoe","Trailblazer","Traverse"],
//Chevrolet Med Duty
["---- Select Model ----","Kodiak","W3500","W4500","C4500","C5500","C6500","C7500","C8500"],
//Freightliner
["---- Select Model ----","Cascadia","M2 Business Class","Sprinter","Century Class","Columbia","Coronado","Classic","Classic XL","FLD Severe Duty","FCC MT45","FCC MT55"],
//GMC
["---- Select Model ----","Acadia","Canyon","Envoy","Savana","Sierra 1500","Sierra 2500 HD","Sierra 3500 HD","Yukon","Yukon Denali","Yukon XL","Yukon XL Denali"],
//GMC Med Duty
["---- Select Model ----","Topkick","W3500","W4500","C4500","C5500","C6500","C7500","C8500"],
//Isuzu
["---- Select Model ----","NPR","NQR","NRR","FTR","FVR","FXR","FRR","FSR"],
//Kalmar
["---- Select Model ----","Kalmar Ottawa 4x2 Off Road","Kalmar Ottawa 4x2 DOT/EPA Certified","Kalmar Ottawa 6x4 DOT/EPA"],
//Mack
["---- Select Model ----","CHN612","CHN613","CHU612","CHU613","CL733","CT713","CTP713","CTP713B","CV513","CV533","CV713","CXN612","CXN613","CXP612","CXP613","CXU612","CXU613","GU712","GU713","GU812","GU813","LE613","LEU612","LEU613","MR688S","MRU612","MRU613","TD713","TD714"],
//Pontiac
["---- Select Model ----","Aztec","Bonneville","Grand Am","Grand Prix","GTO","G5","G6","G8","Montana","Solstics","Sunfire","Torrent","Vibe"],
//UD
["---- Select Model ----","1300","1400","1800CS","1800HD","2000","2300LP","2300DH","2600","3300"],
//Volvo
["---- Select Model ----","VNL","VLN64TDAY","VNL64T","VNL64T430","VNL64T420","VNL64T630","VNL64T610","VNL64T670","VNL64T660","VNL64T780","VNL64300","VNL42T300","VNL42TDAY","VNL42300","VNL42T420","VNL42T630","VNL42T610","VNL84T300","VNM64T200","VNM64TDAY","VNM64T","VNM64T430","VNM64T630","VNM42T200","VNM42TDAY","VNM4220","VNM42T","VNM42T430","VHD64BT200","VHD64B200","VHD64BDAY","VHD42B200","VHD84B200","VHD104B200","VHD64FT200","VHD64F200","VHD64FDAY","VHD64FTDAY","VHD42F200","VHD84F200","VHD84FDAY","VHD104F200","VHD124F200","FM1064T","VNL42T430","VNL64T730","VNL64430","VNL64670","VNL64780","VT64T800","VT64T830","VT64T880","VNM84T200","VHD84FT200","VHD64FT430","VHD64BT430","VHD86B200","VHD64F430","VHD64B430"],
//Workhorse
["---- Select Model ----","Motorhome","Commercial Chassis"],
//Other
["Other"],
];
/*
var vehModelValue=[
["varieties","granny smith","golden delicious","jonathan"],
["varieties","anjou","bartlett","conference"],
["varieties","valencia","pineapple","pera"]
];
*/
	//alert(idx);
	if (formName == 'svcApptForm') {
		var f = document.svcApptForm;	
	}
	else if (formName = 'partsRequestForm') {
		var f=document.partsRequestForm;
	}
	
	f.vehModel.options.length=null;

	for(i=0; i<vehModelValue[idx].length; i++) {
		//f.vehModel.options[i]=new Option(vehModelValue[idx][i], i); 
		f.vehModel.options[i]=new Option(vehModelValue[idx][i], vehModelValue[idx][i]); 
	} 

	f.vehModel.disabled=false;
}

function enableDt() {
	var dept = document.svcApptForm.dept.value;
	//create the date
	var myDate = new Date();
	
	if (dept == 1) {
		//add a day to the date
		myDate.setDate(myDate.getDate() + 2);
		var myMonth = myDate.getMonth()+1;
		var myDay = myDate.getDate();
		var myYear = myDate.getFullYear();	
		//set form values;
		document.svcApptForm.calDate.enable;
		document.svcApptForm.calDate.value = myMonth + '/' + myDay + '/' + myYear;
	}
	if (dept == 2) {
		//add a day to the date
		myDate.setDate(myDate.getDate() + 3);
		var myMonth = myDate.getMonth()+1;
		var myDay = myDate.getDate();
		var myYear = myDate.getFullYear();
		//set form values;
		document.svcApptForm.calDate.enable;
		document.svcApptForm.calDate.value = myMonth + '/' + myDay + '/' + myYear;
	}
}

function validateSvcApptForm(f) {
	if (f.firstName.value=="") {
		alert('Please enter your first name.');
		f.firstName.focus();
		return false;
	}	
	if (f.lastName.value=="") {
		alert('Please enter your last name.');
		f.lastName.focus();
		return false;
	}
	if (f.contactPhone1.value=="") {
		alert('Please enter your area code.');
		f.contactPhone1.focus();
		return false;
	}
	if (f.contactPhone1.value.length > 0)
	{
      for (i = 0; i < f.contactPhone1.value.length; i++) {
        thisChar =f.contactPhone1.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone1.focus();
          return false;
        }
      }
	  if (f.contactPhone1.value.length < 3){
		  alert ("Your area code must be 3 digits.");
		  f.contactPhone1.focus();
          return false;
	  }
    }
	if (f.contactPhone2.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone2.focus();
		return false;
	}
	if (f.contactPhone2.value.length > 0)
	{
      for (i = 0; i < f.contactPhone2.value.length; i++) {
        thisChar =f.contactPhone2.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone2.focus();
          return false;
        }
      }
	  if (f.contactPhone2.value.length < 3){
		  alert ("Your phone number must be 3 digits.");
		  f.contactPhone2.focus();
          return false;
	  }
    }
	if (f.contactPhone3.value=="") {
		alert('Please enter your complete phone number.');
		f.contactPhone3.focus();
		return false;
	}
	if (f.contactPhone3.value.length > 0)
	{
      for (i = 0; i < f.contactPhone3.value.length; i++) {
        thisChar =f.contactPhone3.value.charAt(i);
        if (thisChar < '0' || thisChar > '9')
	    {
          alert ("Your phone number must be numeric.");
		  f.contactPhone3.focus();
          return false;
        }
		if (f.contactPhone3.value.length < 4){
		  alert ("Your phone number must be 4 digits.");
		  f.contactPhone3.focus();
          return false;
	  	}
     }
    }
	if (f.contactEmail.value=="") {
		alert('Please enter your email address.');
		f.contactEmail.focus();
		return false;
	}
	if (f.contactMethod.value==0) {
		alert('Please select your preferred method of contact.');
		f.contactMethod.focus();
		return false;
	}
	if (f.dept.value==0) {
		alert('Please select which department you need.');
		f.dept.focus();
		return false;
	}
	if (f.calDate.value=="") {
		alert('Please enter the date you wish to bring your vehicle in.');
		f.calDate.focus();
		return false;
	}
		
	//check to see if appt is within allowed time by department
	var currDate = new Date();		
	var reqDate = new Date(f.calDate.value);	
		
	if (f.dept.value==1) {
		currDate.setDate(currDate.getDate() + 1);
		if (currDate > reqDate) {
			alert("You must request an appointment at least two business days in the future.");
			return false;
		}
	}
	if (f.dept.value==2) {
		currDate.setDate(currDate.getDate() + 2);
		if (currDate > reqDate) {
			alert("You must request an appointment at least three business days in the future.");
			return false;
		}
	}
		
	
	if (f.apptTime.value==0) {
		alert('Please enter the desired time of day for your appointment.');
		f.apptTime.focus();
		return false;
	}
	if (f.vehYear.value==0) {
		alert('Please select your vehicle\'s year.');
		f.vehYear.focus();
		return false;
	}
	if (f.vehMake.value==0) {
		alert('Please select your vehicle\'s make.');
		f.vehMake.focus();
		return false;
	}
	if (f.vehModel.value=="---- Select Model ----") {
		alert('Please select your vehicle\'s model.');
		f.vehModel.focus();
		return false;
	}
	if (f.vehVin.value=="") {
		alert('Please enter your vehicle\'s VIN number.');
		f.vehVin.focus();
		return false;
	}
	if (f.vehMileage.value=="") {
		alert('Please enter your vehicle\'s mileage.');
		f.vehMileage.focus();
		return false;
	}
	if (f.svcNeeded.value=="") {
		alert('Please enter a description of the service you need.');
		f.svcNeeded.focus();
		return false;
	}
	f.btnSubmit.value = "Submitting...";
	f.btnSubmit.disabled = true;
	return true;
}

//onload=function() {vehModel(0);};
