function checkvalidate()
{
   
	errStr=true;
    if(document.getElementById("txt_name").value == "")
    {
	   errStr=false;
       alert('Please enter  Name');
	   document.getElementById("txt_name").focus();
	
    }
    else if(document.getElementById("Designation").value == "")
    {
		errStr=false;
        alert('Please enter Designation');
		document.getElementById("Designation").focus();
    }
	else if(document.getElementById("email").value == "")
    {
		errStr=false;
        alert('Please enter email');
		document.getElementById("email").focus();
    }
	else if(document.getElementById("email").value != "" && echeck(document.getElementById("email").value) == false)
    {
				errStr=false;
		  		emailid = "";		  
		  		document.getElementById("email").focus();
		  		
	}
	else if(document.getElementById("Contactdetails").value == "")
    {
		errStr=false;
        alert('Please enter Contact details');
		document.getElementById("Contactdetails").focus();
    }
	else if(document.getElementById("subject").value == "")
    {
		errStr=false;
        alert('Please select your subject');
		document.getElementById("subject").focus();
    }
	else if(document.getElementById("message").value == "")
    {
		errStr=false;
        alert('Please enter message');
		document.getElementById("message").focus();
    }
   

	if(errStr == false)
    {
       
        return false;
    }
    else
    {
		document.form1.submit();
        return true;
    }



}

function makenull()
{
   
	document.getElementById("txt_name").value == "";    
   document.getElementById("Designation").value == "";
   
	document.getElementById("email").value == "";
    
	document.getElementById("Contactdetails").value == "";
    
	document.getElementById("subject").value == "";
   
	document.getElementById("message").value == "";
    
   

	



}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function validation()
{
//	alert ('hi');
	
}





	
<!--Email validation code -->
 
 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					
	}

