function checkmail(str){
   		var at="@"        
		var dot="."
		var temp;
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		var invalidchar=" \"([{}])!#$%^&*';:,/\\?|+`~<>=~"
		if (str.indexOf(at)==-1){
			alert("Please Enter a valid Email ID.")			
		   	return false }
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr-1){
		   alert("Please Enter a valid Email ID.")		  
		   return false	}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr-1){
		    alert("Please Enter a valid Email ID.")			
		    return false }
		if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please Enter a valid Email ID.")			
		    return false }
		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please Enter a valid Email ID.")			
		    return false }
		if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please Enter a valid Email ID.")			
		    return false }		
		for (i=0; i<(invalidchar.length-1); i++){
		      temp=invalidchar.substring(i,i+1);		      
		      if (str.indexOf(temp)!=-1){
		         alert("Please Enter a valid Email ID.")				 
		         return false} 
	 	}		 		
return true; } 

function addnew() {
	
	    if (document.addnews.title.value==""){
			alert("Input Title Name."); document.addnews.title.focus();
			return;
			} 
		else if (document.addnews.summary.value==""){
			alert("Input Summary."); document.addnews.summary.focus();	
			}
		else if (document.addnews.content.value==""){
			alert("Input content."); document.addnews.content.focus();	
			}
		else if (document.addnews.keyword.value==""){
			alert("Input Keyword."); document.addnews.keyword.focus();
			}
		else if (document.addnews.author.value==""){
			alert("Input Author."); document.addnews.author.focus();
			}
			else if (document.addnews.email.value==""){
			alert("Input Email."); document.addnews.email.focus();
			}
			else if (document.addnews.contact.value==""){
			alert("Input Signature"); document.addnews.contact.focus();
			}
		else if(document.addnews.email.value!=""){
	               val1=document.addnews.email.value; 
				   focusv=document.addnews.email.focus();
	               var check=checkmail(val1) 
		if (check==true) {
		document.addnews.submit();
		}
		}
}

function editnews() {
	
	    if (document.editnew.title.value==""){
			alert("Input Title Name."); document.editnew.title.focus();
			return;
			} 
		else if (document.editnew.summary.value==""){
			alert("Input Summary."); document.editnew.summary.focus();	
			}
		else if (document.editnew.content.value==""){
			alert("Input content."); document.editnew.content.focus();	
			}
		else if (document.editnew.keyword.value==""){
			alert("Input Keyword."); document.editnew.keyword.focus();
			}
		else if (document.editnew.author.value==""){
			alert("Input Author."); document.editnew.author.focus();
			}
			else if (document.editnew.email.value==""){
			alert("Input Email."); document.editnew.email.focus();
			}
		else if(document.editnew.email.value!=""){
	               val1=document.editnew.email.value; 
				   focusv=document.editnew.email.focus();
	               var check=checkmail(val1) 
		if (check==true) {
		document.editnew.submit();
		}
		}
}

function check_contact() {
	
	    if (document.contact.txtName.value==""){
			alert("Input Name."); document.contact.txtName.focus();
			
			} 
		else if (document.contact.txtAdd.value==""){
			alert("Input Address."); document.contact.txtAdd.focus();	
			}
		else if (document.contact.txtPhone.value==""){
			alert("Input Contact No."); document.contact.txtPhone.focus();	
			}
		else if (document.contact.txtMail.value==""){
			alert("Input Mail."); document.contact.txtMail.focus();
			}
		else if (document.contact.txtMsg.value==""){
			alert("Input Message."); document.contact.txtMsg.focus();
			}
		else if(document.contact.txtMail.value!=""){
	               val1=document.contact.txtMail.value; 
				   focusv=document.contact.txtMail.focus();
	               var check=checkmail(val1) 
		if (check==true) {
		document.contact.submit();
		}
		}
}
function checknewsletter()
{
	 if (document.newsletter.name.value==""){
			alert("Input Name."); document.newsletter.name.focus();
			return false; 
			
	  } 
	else if (document.newsletter.newslettermail.value==""){
			alert("Input Email."); document.newsletter.newslettermail.focus();	
	 }else if(document.newsletter.newslettermail.value!=""){
	               val1=document.newsletter.newslettermail.value; 
				   focusv=document.newsletter.newslettermail.focus();
	               var check=checkmail(val1) 
		if (check==true) {
		document.newsletter.submit();
		}
 }
}

function change_country()
{
    //Mozzila	
	window.navigate=document.getElementById("country").value;
	//IE
	window.top.location.href=document.getElementById("country").value;
}
function change_industry()
{
    //Mozzila	
	window.navigate=document.getElementById("industry").value;
	//IE
	window.top.location.href=document.getElementById("industry").value;
}

function check_comment() {
	
	    if (document.comment.name.value==""){
			alert("Input Name."); document.comment.name.focus();
			
			} 
		else if (document.comment.email.value==""){
			alert("Input Address."); document.comment.email.focus();	
			}
		else if (document.comment.title.value==""){
			alert("Input Contact No."); document.comment.title.focus();	
			}
		else if (document.comment.comments.value==""){
			alert("Input Mail."); document.comment.comments.focus();
			}
		else if(document.comment.email.value!=""){
	               val1=document.comment.email.value; 
				   focusv=document.comment.email.focus();
	               var check=checkmail(val1) 
		if (check==true) {
		document.comment.submit();
		}
		}
}
<!--  ***********  -->

