
// <!CDATA[

function Reset1_onclick() 
{
}
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 validation()
{
valid = true;
//alert ( "Please fill in the 'Your Name' box." );
    if (document.getElementById('f_name').value == "" )
    {
        alert ( "Please fill in the 'First Name' box." );
        valid = false;
    }
    else if(document.getElementById('l_name').value == "" )
    {
        alert ( "Please fill in the 'Last Name' box." );
        valid = false;
    }
    else if(document.getElementById('tel_h').value == "" )
    {
        alert ( "Please fill in the 'Telephone: (Home)' box." );
        valid = false;
    }
    else if(document.getElementById('tel_m').value == "" )
    {
        alert ( "Please fill in the 'Telephone: (Mobile)' box." );
        valid = false;
    }
    else if(document.getElementById('txtemail').value == "" || document.getElementById('txtemail').value == null)
    {
	    alert("Please Enter your Email ID");
        valid = false;
    }
    else if(echeck(document.getElementById('txtemail').value)==false)
    {
		txtemail.focus()
		valid = false;
    }
    else if(document.getElementById('msg').value == "" )
    {
        alert ( "Please fill in the 'Query' box." );
        valid = false;
    }
    
    return valid;
}


