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 || 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()
{
		if(document.Validform.title.value==""){
		alert("Enter the title");
		document.Validform.title.focus();
		return false;
		}
		
		 			
			
			if ((document.Validform.email.value==null)||(document.Validform.email.value=="")){
				alert("Please Enter your Email ID");
				document.Validform.email.focus();
				return false;
			}
			if (echeck(document.Validform.email.value)==false){
				document.Validform.email.value="";
				document.Validform.email.focus();
				return false;
			}
			if(document.Validform.phone_num.value==""){
			alert("Enter the phone number");
			document.Validform.phone_num.focus();
			return false;
			}
			
		
		
		return true;	
}
function validations()
{
		
		
		 			
			
			if ((document.Validform.email.value==null)||(document.Validform.email.value=="")){
				alert("Please Enter your Email ID");
				document.Validform.email.focus();
				return false;
			}
			if (echeck(document.Validform.email.value)==false){
				document.Validform.email.value="";
				document.Validform.email.focus();
				return false;
			}
			if(document.Validform.mob_num.value==""){
			alert("Enter the Mobile number");
			document.Validform.mob_num.focus();
			return false;
			}
			
		
		return true;	
}
 	
function validation_em(id) {
	if ((document.Validform.email.value==null)||(document.Validform.email.value=="")){
		alert("Please Enter your Email ID");
		document.Validform.email.focus();
		return false;
	}
	if (echeck(document.Validform.email.value)==false){
		document.Validform.email.value="";
		document.Validform.email.focus();
		return false;
	}
	if(document.Validform.mob_num.value==""){
		alert("Enter the Mobile number");
		document.Validform.mob_num.focus();
		return false;
	}
		
	document.Validform.submit();
	return true;	
}

function isInteger(s,id)
{
      var i;
	s = s.toString();
      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);
         if (isNaN(c)) 
	   {
		alert("Given value is not a number");
		document.getElementById(id).value="";		
		return false;
	   }
      }
      return true;
}

