// JScript File

  function validate(id,password)
  {
  if (id=="") 
  {
  alert("Email Id should not be empty! ")
  return false
  id.focus()
  }
  else
  if(password==null || password=="")
  {
  alert("Password should not be empty!")
  return false
  }
  return true
  }
  function popup()
  {
    window.open('popupadd.aspx','xczzxc' ,'top=0,left=30,width=900,height=600,scrollbars=yes');
  }
  //----------------------------------------------------------------------------------------------------
  function ans_validate(uid,ans)
  {
  if(uid=="")
  {
  alert("Email Id should not be empty!")
  return false
  id.focus()
  }
  
  else if(ans=="")
  {
  alert("Answer should not be empty!")
  return false
  ans.focus()
  }
  return true
  }
 //-------------------------------------------------------------------------------------------------
 
 function err()
 {
 alert('hi');
 }
   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 gothere()
{
 var where_to= confirm("Do you Want Delete the current Record?");
 if (where_to== true)
 {
   return true
 }
 else
 {
  return false
  }
}
   function validation(emailID,name){
   if (echeck(emailID)==false){
		return false
		}
		else
		if(name==""){
		alert("Answer should not be Empty")
		return false
		}
		return true
		}
	function validates(name,emailID){	
	if(name=="" || name==null){
		alert("Name should not be empty")
		return false
		}
		else
if (echeck(emailID)==false){
		return false
		}
		else
		
		{
		return true
		}
		}
			
