function Validator(theForm)
{
 
   
   /* Check First Name */
  if (theForm.firstname.value.length < 1)
  {
    alert("You cannot leave your First Name Blank!");
    theForm.firstname.focus();
    return (false);
  }
 
  
   /* Check Last Name */
  if (theForm.lastname.value.length < 1)
  {
    alert("You cannot leave your Last Name Blank!");
    theForm.lastname.focus();
    return (false);
  }
  
   /* Address 1 */
  if (theForm.addressa.value.length < 1)
  {
    alert("You cannot leave the address Field blank");
    theForm.addressa.focus();
    return (false);
  }  
  
    
    /* Address 2 */
  if (theForm.addressb.value.length < 1)
  {
    alert("You cannot leave the address Field blank");
    theForm.addressb.focus();
    return (false);
  }  
  
 
    /* PostCode */
  if (theForm.postcode.value.length < 1)
  {
    alert("You cannot leave the postcode Field blank");
    theForm.postcode.focus();
    return (false);
  }  
  
  
     /* Tel */
  if (theForm.phone.value.length < 1)
  {
    alert("You cannot leave the Telephone Field blank");
    theForm.phone.focus();
    return (false);
  }  
 
 
 
 /* Email check */
 
 {
	var emailID=document.Subscribe.email
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		//emailID.value=""
		emailID.focus()
		return false
	}
 }

 
  
 /* Check Tel is a number */
	if ( (parseFloat(theForm.phone.value) != theForm.phone.value) ||
             theForm.phone.value.length < 0 ||
             theForm.phone.value.length > 255) {
		alert("The phone number must be a number");
		theForm.phone.focus();
		theForm.phone.select();
		return (false);
	}
 

   /* Check Country */
  if (theForm.country.value == "** Select **")
  {
    alert("You must select a Country");
    theForm.country.focus();
    return (false);
  }

  
   /* Product */
  if (theForm.prod_code.value.length < 1)
  {
    alert("You cannot leave the Product Field blank");
    theForm.prod_code.focus();
    return (false);
  }  
  
  /* Date */
  if (theForm.date_purchase.value.length < 1)
 {
    alert("You cannot leave the Purchase Date Field blank");
    theForm.date_purchase.focus();
    return (false);
  }  

/* Place */
  if (theForm.place_purchase.value.length < 1)
 {
    alert("You cannot leave the Place of Purchase Field blank");
    theForm.place_purchase.focus();
    return (false);
  }  

 }


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("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
	
	
function Validator1(theForm)
{

   
   /* Check First Name */
  if (theForm.firstname.value.length < 1)
  {
    alert("You cannot leave your First Name Blank!");
    theForm.firstname.focus();
    return (false);
    
  }
 
  
   /* Check Last Name */
  if (theForm.lastname.value.length < 1)
  {
    alert("You cannot leave your Last Name Blank!");
    theForm.lastname.focus();
    return (false);
  }	
	
	
/* Email check */
 
 {
	var emailID=document.regDetails.email
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		//emailID.value=""
		emailID.focus()
		return false
	}
 }	

/* Check Customer Reference */
  if (theForm.custRef.value.length < 1)
  {
    alert("You cannot leave your Customer Reference Blank!");
    theForm.custRef.focus();
    return (false);
  }

/* Check Warranty Reference 
  if (theForm.warrRef.value.length < 1)
  {
    alert("You cannot leave your Warranty Reference Blank!");
    theForm.warrRef.focus();
    return (false);
  }	*/
	
/* Check CR is a number */
	if ( (parseFloat(theForm.custRef.value) != theForm.custRef.value) ||
             theForm.custRef.value.length < 0 ||
             theForm.custRef.value.length > 255) {
		alert("The Customer Reference number must be a number");
		theForm.custRef.focus();
		theForm.custRef.select();
		return (false);
	}	
	else 
	{
	document.getElementById('message').style.visibility="visible";
	return (true);
	
}
	 /*Check WR is a number 
	if ( (parseFloat(theForm.warrRef.value) != theForm.warrRef.value) ||
             theForm.warrRef.value.length < 0 ||
             theForm.warrRef.value.length > 255) {
		alert("The Warranty Reference number must be a number");
		theForm.warrRef.focus();
		theForm.warrRef.select();
		return (false);
	}*/
	
}


/*
function showmessage (elmnt) {
document.getElementById(elmnt).style.visibility="visible"
}
 onclick="showmessage ('message')"
*/

