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 Address");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address");
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address");
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address");
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address");
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address");
		    return false;
		 }

 		 return true;					
	}

function CheckValidation()
	{
		var i,sel;
		
		if(document.frmContact.txtname.value=='')
		{
			alert("Please enter your name.");
			document.frmContact.txtname.focus();			
			return false;
		}	
		
		if(document.frmContact.txtname.value=='Name')
		{
			alert("Please enter your name.");
			document.frmContact.txtname.focus();			
			return false;
		}
                
		
		var emailID=document.frmContact.txtemail;
	
		if ((emailID.value==null)||(emailID.value=="") || (emailID.value=="Email Address")){
			alert("Please enter your email address");
			emailID.focus();
			return false;
		}
		if (echeck(emailID.value)==false){
			emailID.value="";
			emailID.focus();
			return false;
		}
		

		checkEmail=document.frmContact.txtemail.value;
		if(checkEmail=='')
		{
			alert("Please enter your email address");
			document.frmContact.txtemail.focus();
			return false;
		}
		
		if(checkEmail=='Email Address')
		{
			alert("Please enter your email address");
			document.frmContact.txtemail.focus();
			return false;
		}
		
		if ((checkEmail.indexOf('@') <= 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.')))
		{
			alert("Invalid email address");
			document.frmContact.txtemail.focus();
			return false;
		}
		
		
		if(document.frmContact.message.value=='')
		{
			alert("Please enter your message.");
			document.frmContact.message.focus();			
			return false;
		}
		
		if(document.frmContact.message.value=='Message')
		{
			alert("Please enter your message.");
			document.frmContact.message.focus();			
			return false;
		}
		
		return true;
	}

function search_validation()
{

      if(document.getElementById("keywords").value=='' || document.getElementById("keywords").value == 'Search this site'){
       alert('Please enter keyword');
       return false;
       }
      else{document.search_form.submit();}}