function validateForm() 
{
 var okSoFar=true
 with (document.phpformmailer)
 {
	 	  
 // var e1 = email.value
 // var e2 = email2.value
 // if (!(e1==e2) && okSoFar)
 // {
 //   okSoFar = false
  //  alert ("Email addresses you entered do not match.  Please re-enter.")
  //  email.focus()
 // }
  
 function firstName()
{
	document.getElementById("firstName").innerHTML = "Please enter your first name";
}

  if (fname.value=="" && okSoFar)
  {
    okSoFar=false
	firstName()
    fname.focus()
	fname.className="warning-form-background";
  }
  
  if (okSoFar)
  {
	document.getElementById("firstName").innerHTML = "";
   fname.className="oksofar-back"
   }
 
 function lastName()
{
	document.getElementById("lastName").innerHTML = "Please enter your last name";
}

  if (lname.value=="" && okSoFar)
  {
    okSoFar=false
	lastName()
    lname.focus()
	lname.className="warning-form-background";
  }
  
  if (okSoFar)
  {
	document.getElementById("lastName").innerHTML = "";
   lname.className="oksofar-back"
   } 
   
   
   
   
 function emailCheck()
{
	document.getElementById("emailAddress").innerHTML = "Enter a valid email.";
}
  var foundAt = email.value.indexOf("@",0)
  
  if (foundAt < 1 && okSoFar)
  {
    okSoFar = false
	emailCheck()
    email.focus()
	email.className="warning-form-background";
  }
   if (okSoFar)
 {
   document.getElementById("emailAddress").innerHTML = "";
   email.className="oksofar-back"}
 
  
  function emailAddress()
{
	document.getElementById("emailAddress").innerHTML = "Enter a valid Email. (xxxx@xxx.xxx)";
}

  if (email.value=="" && okSoFar)
  {
    okSoFar=false
    emailAddress()
    email.focus()
	email.className="warning-form-background";
  }
   if (okSoFar)
 {
	document.getElementById("emailAddress").innerHTML = "";
  email.className="oksofar-back"
  }
  
//   function lastName()
//{
//	document.getElementById("lastName").innerHTML = "Please enter your last name.";
//}
//  if (lname.value=="" && okSoFar)
//  {
//    okSoFar=false
//    //alert("Please enter your last name.")
//	lastName()
//    lname.focus()
//	lname.className="warning-background";
//  }
//     if (okSoFar)
//  {document.getElementById("lastName").innerHTML = "Thank You"
//   lname.className="oksofar-background"}
 
  
// function companyName()
//{
//	document.getElementById("companyName").innerHTML = "Please enter your company's name.";
//}
// if (okSoFar)
// {document.getElementById("companyName").innerHTML = ""}
//
//  if (company.value=="" && okSoFar)
//  {
//    okSoFar=false
//    //alert("Please enter your company name.")
//	companyName()
//    company.focus()
//	company.style.backgroundColor='#ebebeb';
//  }
//   if (okSoFar)
// {document.getElementById("companyName").innerHTML = ""
//  company.style.backgroundColor='#ffffff'}
  
  
  
//  function state()
//{
//	document.getElementById("st").innerHTML = "Please enter your state/province.";
//}
//  if (st.value=="" && okSoFar)
//  {
//    okSoFar=false
//    //alert("Please enter your state (ST).")
//	state()
//    st.focus()
//	st.className="warning-background";
//  }
//  
//   if (okSoFar)
// {document.getElementById("st").innerHTML = "Thank You";
//  st.className="oksofar-background"}
 
 
// function zipcode()
//{
//	document.getElementById("zipcode").innerHTML = "Please enter your zipcode."
//}
// if (zip.value=="" && okSoFar)
//  {
//    okSoFar=false
//   // alert("Please enter your zip code.")
//	zipcode()
//    zip.focus()
//	zip.className="warning-background";
//  }
//   if (okSoFar)
// {document.getElementById("zipcode").innerHTML = "Thank You"
// zip.className="oksofar-background"}
  
  
  
 // function telephone()
// {
//	document.getElementById("telephone").innerHTML = "Please enter a valid phone number.";
// 	}
//  
//  
//  function checkPhone(str) 
//{
//	var phone2 = /^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/; 
//	if (str.match(phone2)) 
//	{
//		return okSoFar;
// 	} else {
//		
//       return okSoFar=false
//    
//  }
//  
//}
//
// if (okSoFar = true)
//  {
//    okSoFar=false
//    //alert("Please enter your phone number.")
//	telephone()
//    phone.focus()
//	phone.style.backgroundColor='#ebebeb';
//  }
//  
//   if (okSoFar)
// {document.getElementById("telephone").innerHTML = ""
//  phone.style.backgroundColor='#ffffff'}
//  
  
  
  
  
//function checkPhone(str) 
//{
//	var phone2 = /^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/; 
//	if (str.match(phone2)) {
//   		return true;
// 	} else {
// 		return false;
// 	}
//}
  
 
// function telephone()
//{
//	document.getElementById("telephone").innerHTML = "Please enter a valid phone number.";
//}
//
// if (phone.value=="" && okSoFar)
//  {
//    okSoFar=false
//    //alert("Please enter your phone number.")
//	telephone()
//    phone.focus()
//	phone.className="warning-background";
//  }
//  
//   if (okSoFar)
// {document.getElementById("telephone").innerHTML = "Thank You"
//  phone.className="oksofar-background"}
  
 
  
  
 
 
   //if (comments.value=="" && okSoFar)
//  {
//    okSoFar=false
//    alert("Please enter the details for your enquiry.")
//    comments.focus()
//  }
  
//if (document.phpformmailer.check.checked ==false  && okSoFar)	
// 
//  {	okSoFar=false
//  	alert ("You didn\'t choose any of the checkboxes!");		
// 	document.phpformmailer.check.focus()
//
//	return false;}	else {return true;}	}
//	 }	
  
   
  if (okSoFar==true)  return true;
 }
}