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){
		   
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		  
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		  
		    return false
		 }

 		 return true					
	}

 function ValidateEmail(){
	var emailID=document.form.email
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please enter your e-mail address.")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }


  
 function validate_submit()
  {
     with (document.form)
    {
    
        if (name.value =="")
        {  
            alert("Please fill in your name!!");
           
            name.focus();
             return false
         }
         
        else if (contact.value =="")
        {
            alert("Please fill in your contact no.");
            contact.focus();
            return false
         }
         
        else if (email.value =="")
        {
            alert("Please fill in your email.");
            email.focus();
             return false
         }
        else if (echeck(email.value)== false ) {
           alert("Invalid e-mail address.");
           email.focus();
           return false
        }
        else if (typeof(product)!="undefined" && product.value =="")
        {
            alert("Please fill the product.");
            product.focus();
             return false
         }
      
        else if (typeof(quantity)!= "undefined" && quantity.value =="")
        {
            alert("Please fill in the quntity.");
            quantity.focus();
             return false
         }
         
          else if (typeof(quantity)!= "undefined" && quantity.value !="" && isNaN(quantity.value )==true)
	         {
	             alert("Please fill in the correct quntity format.");
	             quantity.value="";
	             quantity.focus();
	              return false
         }
	
	
	    else if (SecurityCode.value == '')  {
	        alert('Please insert the characters as shown.');
	        SecurityCode.focus();  
	        return false 
	    } 
	
	    else if (SecurityCode.value != ImageNo2.value ) 
	     { 
	        alert('Characters do not match.'); 
	        SecurityCode.value="";
	        SecurityCode.focus();  
	        return false 
	   }
       
        else{
            return true
        }

      }
    
  }

