function contactcheck(theform)
{
	
	var fnamestr = document.form1.fname.value;
	var phonestr = document.form1.phone.value;

    splitphonestr = phonestr.split("-")

	//alert("fname length = " + fnamestr.length);

if (document.form1.fname.value == "")
  {
	  alert("Please enter your First Name!");
	  form1.fname.focus();
	  return false;
  }
  /*if (fnamestr.length < 2)
	  {
		  alert("Please Enter your complete First Name!");
	      form1.fname.focus();
	      return false;
	  }
 */
  if (document.form1.lname.value == "")
  {
	  alert("Please enter your Last Name!");
	  form1.lname.focus();
	  return false;
  }

  if (document.form1.address.value == "")
   {
	  alert("Please enter your Address!");
	  form1.address.focus();
	  return false;
   }

  if (document.form1.city.value == "")
   {
	  alert("Please enter your City!");
	  form1.city.focus();
	  return false;
   }

  if (document.form1.state.value == "")
  {
	  alert("Please select your State!");
	  form1.state.focus();
	  return false;
  }

  if (document.form1.zip.value == "")
  {
	  alert("Please enter your Zip code!");
	  form1.zip.focus();
	  return false;
  }
  /*
  if (document.form1.ContactTime.value == "")
  {
	  alert("Please select a time of day we may contact you!");
	  form1.ContactTime.focus();
	  return false;
  }

  if (document.form1.LegalNeeds.value == "")
  {
	  alert("Please select your type of \"Legal need\"");
	  form1.LegalNeeds.focus();
	  return false;
  }
  
  */
  if (document.form1.phone.value == "")
  {
	  alert("Please enter your Phone number!\n(all contact information is strictly confidential)");
	  form1.phone.focus();
	  return false;
  }
  if (phonestr.length < 12)
  {
	  alert("Please enter your \"Area Code\" and Phone number!\n(all contact information is strictly confidential)");
	  form1.phone.focus();
	  return false;
  }
  
  
  if(isNaN(splitphonestr[0]))
   {
    alert("Please enter a valid Phone number!\n(all contact information is strictly confidential)");
	  form1.phone.focus();
	  return false; 
   } 
   if(isNaN(splitphonestr[1]))
   {
    alert("Please enter a valid Phone number!\n(all contact information is strictly confidential)");
	  form1.phone.focus();
	  return false; 
   } 
   if(isNaN(splitphonestr[2]))
   {
    alert("Please enter a valid Phone number!\n(all contact information is strictly confidential)");
	  form1.phone.focus();
	  return false; 
   } 

  if (document.form1.email.value == "")
  {
	  alert("Please enter your Email address!");
	  form1.email.focus();
	  return false;
  }

  if (document.form1.product.value == "")
  {
	  alert("Please select a \"Product type\"!");
	  form1.product.focus();
	  return false;
  }
   //return check();

   form1.submit();
   //return false;
}

//------- Check the Password form -------
function thepassword(passcheck)
{
	
	var user = document.form2.username.value;
	var password = document.form2.password.value;

    //alert("Username = " + user + " Password = " + password);

if (document.form2.username.value == "")
  {
	  alert("Please enter your username name!");
	  form2.username.focus();
	  return false;
  }

  if (document.form2.password.value == "")
  {
	  alert("Please enter your password!");
	  form2.password.focus();
	  return false;
  }

  //form2.submit();
  //alert("crap");

}
//function to disable a form elemtnst
function enableField(state)
{
 
  //clear it also just in case
 document.form1.companyb.value = "";
 document.form1.fnameb.value = "";
 document.form1.lnameb.value = "";
 document.form1.addressb.value = "";
 document.form1.cityb.value = "";
 document.form1.stateb.value = "";
 document.form1.zipb.value = "";

 document.form1.companyb.disabled=state;
 document.form1.fnameb.disabled=state;
 document.form1.lnameb.disabled=state;
 document.form1.addressb.disabled=state;
 document.form1.cityb.disabled=state;
 document.form1.stateb.disabled=state;
 document.form1.zipb.disabled=state;

 disappear(document.form1.companyb);
 disappear(document.form1.fnameb);
 disappear(document.form1.lnameb);
 disappear(document.form1.addressb);
 disappear(document.form1.cityb);
 disappear(document.form1.stateb);
 disappear(document.form1.zipb);
}

function addup(stuff)
{

 //var thetotal = 0;
 //alert("select3 = " + document.form1.select3.value);
thetotal = eval(document.form1.select2.value * 2255);
thetotal = thetotal + eval(document.form1.select3.value * 2475);
thetotal = thetotal + eval(document.form1.select4.value * 425);
thetotal = thetotal + eval(document.form1.select5.value * 200);
thetotal = thetotal + eval(document.form1.select6.value * 48);
thetotal = thetotal + eval(document.form1.select7.value * 48);
thetotal = thetotal + eval(document.form1.select8.value * 40);
thetotal = thetotal + eval(document.form1.select9.value * 655);

document.form1.subtotal.value = " " + String(thetotal);
document.form1.total.value = "$" + String(thetotal);
 
}

function disappear(obj) {
  if (obj.style.visibility == "hidden") {
    obj.style.visibility = "visible";
  }
  else {
    obj.style.visibility = "hidden";
  }
}
