
    function ValidateForm(){
    var strnameID=document.frm1.name
    var stremailID=document.frm1.email
    var strmessageID=document.frm1.message
       
    // alert("testing11")
    if ((strnameID.value==null)||(strnameID.value=="")){
        alert("Please enter your name")
        strnameID.focus()
        return false
    }
    
     //alert("testing10")
    if ((stremailID.value==null)||(stremailID.value=="")){
        alert("Please enter your email address")
        stremailID.focus()
        return false
    }
	
	 if (echeck(stremailID.value)==false){
        stremailID.value=""
        stremailID.focus()
        return false
    }
    
    // alert("testing11")
     if ((strmessageID.value==null)||(strmessageID.value=="")){
     alert("Please enter your message")
     strmessageID.focus()
     return false
     }    
        
   
    return true
 }
function echeck2(str) {
           alert("Invalid E-mail Address")
           return false
        }
function echeck(str) {
        //alert("testing0")
        var at="@"
        var dot="."
        var lat=str.indexOf(at)
        var lstr=str.length
        var ldot=str.indexOf(dot)
		
//alert("test")
        if (str.indexOf(at)==-1){
           alert("Your email address is missing the @ I think")
           return false
        }
//alert("testing1")
        if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
           alert("Your email address is missing the @ I think")
           return false
        }
//alert("testing2")
        if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
            alert("Your email address is missing the . I think")
            return false
        }
//alert("testing3")
         if (str.indexOf(at,(lat+1))!=-1){
            alert("Have another go")
            return false
         }
//alert("testing4")
         if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
            alert("Invalid Email Address")
            return false
         }
         if (str.indexOf(dot,(lat+2))==-1){
            alert("Invalid Email Address")
            return false
         }
        
         if (str.indexOf(" ")!=-1){
            alert("Invalid Email Address")
            return false
         }
          return true                    
    }
