// JavaScript Document
function validate_form()
{
	 if ( document.allcontact.debitc.value == "" )
   		 {
        alert ( "Please fill in the box" );
		document.allcontact.debitc.focus();
	     return false;
    	}
		if ( document.allcontact.debitp.value == "" )
   		 {
        alert ( "Please fill in the box" );
		document.allcontact.debitp.focus();
	     return false;
    	}
		if ( document.allcontact.dtime.value == "" )
   		 {
        alert ( "Please fill in the box" );
		document.allcontact.dtime.focus();
	     return false;
    	}
       if ( document.allcontact.name.value == "" )
        {
        alert ( "Please fill in the 'Your Name' box." );
		document.allcontact.name.focus();
        return false;
         }
		 if ( document.allcontact.cname.value == "" )
   		 {
        alert ( "Please fill in the company name box" );
		document.allcontact.cname.focus();
	     return false;
    	}
        if(document.getElementById("p12").value.length < 3)
         {
          alert("Please Enter a 3 numbers");
          document.getElementById("p12").focus();
          return false
         }
        else if(document.getElementById("p22").value.length < 3)
          {
           alert("Please Enter a 3 numbers");
          document.getElementById("p22").focus();
          return false;
          }
         else if(document.getElementById("p32").value.length < 4)
          {
           alert("Please Enter a 4 numbers");
          document.getElementById("p32").focus();
          return false;
          }
          else if((isNaN(document.getElementById("p12").value)) || (isNaN(document.getElementById("p22").value)) || (isNaN(document.getElementById("p32").value)))
          {
          alert("Enter numbers only");
           document.getElementById("p12").value="";
           document.getElementById("p22").value="";
           document.getElementById("p32").value="";
          document.getElementById("p12").focus();
          return false;
            } 
		if ( document.allcontact.zip.value == "" )
        {
        alert ( "Please fill in the 'zip' box." );
		document.allcontact.zip.focus();
        return false;
        }
	  if (document.allcontact.email.value == "")
	  {
      	 alert("You must enter a email.");
          document.allcontact.email.focus();
		   return false;
	   }
      else
 	   {
		 var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
				var address = document.allcontact.email.value;
				if(reg.test(address) == false) 
				{
				     alert("Invalid email");
						document.allcontact.email.value= "";
					 document.allcontact.email.focus();
					  return false;//flag=1;					  
  				 }
 		}
    return true;
}

















// contact us page script

function contct_validate()
{
       if ( document.contact1.name.value == "" )
    {
        alert ( "Please fill in the 'Your Name' box." );
		document.contact1.name.focus();
        return false;
    }
	if (document.contact1.email.value == "") {
  alert("You must enter a email.");
  	document.contact1.email.focus();
 		  return false;
   		}
  		 else
		 {
			 var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
				var address = document.contact1.email.value;
				if(reg.test(address) == false) 
				{
				     alert("Invalid email");
						document.contact1.email.value= "";
					 document.contact1.email.focus();
					  return false;//flag=1;					  
  				 }
 		}

        if((isNaN(document.getElementById("p12").value)) || (isNaN(document.getElementById("p22").value)) || (isNaN(document.getElementById("p32").value)))
          {
          alert("Enter numbers only");

           document.getElementById("p12").value="";

           document.getElementById("p22").value="";

           document.getElementById("p32").value="";

          document.getElementById("p12").focus();

          return false;
            }   

		 if ( document.contact1.subject.value == "" )

   		 {

        alert ( "Please fill in the 'subject' box." );

		document.contact1.subject.focus();

	     return false;

    	}

		 if ( document.contact1.message.value == "" )

   		 {

        alert ( "Please fill in the 'message' box." );

		document.contact1.message.focus();

	     return false;

    	}
    return true;
	
}
	
	
	
function mov()
{
        if(document.getElementById("p12").value.length > 2)
         {
          document.getElementById("p22").focus();
         }
}
function mov1() {
    if(document.getElementById("p22").value.length > 2)
          {
          document.getElementById("p32").focus();
          }
}

