function contactval(){
if (trimBlank(document.contactus.customer_fname.value) ==""){
alert ("Please enter your First name!")
return false;
}else if (trimBlank(document.contactus.customer_lname.value) ==""){
alert ("Please enter your Last name");
  return false; 
}else if (trimBlank(document.contactus.customer_email.value) ==""){
alert ("Please enter a valid email Address");
  return false; 
}else if  (!isEmailAddr(document.contactus.customer_email.value)){
   alert("Please enter a correct email address: name@yourdomain.com");
   document.contactus.customer_email.focus();
  return false; 
}else if (trimBlank(document.contactus.customer_enquiry.value) ==""){
alert ("Please enter your Enquiry");
  return false; 
  } else{
return true;
	}
}

function trimBlank(checkString){
   var newString = "";
   if (checkString.length > 0){
      for (i=0; i<checkString.length; i++)  {
         if (checkString.charAt(i) != " ") newString += checkString.charAt(i)
      }
   }
return newString
}

function clrEmail2(){
document.getElementById("signupemail2").value = "";
}
function clrEmail(){
document.getElementById("signupemail").value = "";
}
function valRetailFrm(){
  email = document.getElementById("retailEmail").value;
  AtPos = email.indexOf("@");
  StopPos = email.lastIndexOf(".");
   if(document.getElementById("retailEmail").value == ""){
    alert("Please enter an email address.");
	return false;
  } else if (AtPos == -1 || StopPos == -1) {
    alert("Not a valid email address");
	return false;
  } else if (StopPos < AtPos) {
    alert("Not a valid email address");
	return false;
  } else if(document.getElementById("Business_name").value == ""){
    alert("Please enter a Business Name.");
	return false;
  } else if(document.getElementById("Contact_name").value == ""){
    alert("Please enter a Contact Name.");
	return false;
	} else if(document.getElementById("Contact_telephone").value == ""){
    alert("Please enter a Contact telephone Number.");
	return false;
	
  }
  document.retailFrm.submit();	
}
  
  
  
  
function valRegFrm(){
  email = document.getElementById("userEmail").value;
  AtPos = email.indexOf("@");
  StopPos = email.lastIndexOf(".");
  
  if(document.getElementById("userEmail").value == ""){
    alert("Please enter an email address.");
	return false;
  } else if (AtPos == -1 || StopPos == -1) {
    alert("Not a valid email address");
	return false;
  } else if (StopPos < AtPos) {
    alert("Not a valid email address");
	return false;
  } else if(document.getElementById("userForename").value == ""){
    alert("Please enter a forename.");
	return false;
  } else if(document.getElementById("userSurname").value == ""){
    alert("Please enter a surname.");
	return false;
  }
  document.regFrm.submit();	
}
