function checkfunc()
{
	
	if(document.frm.email_address.value=="" &&  document.frm.phone_no.value=="")
	{
		alert('Please Enter Email or Phone Number');
		document.frm.email_address.focus();
		return false;
	}
	
	if(document.frm.email_address.value!="")
	{

		if (echeck(document.frm.email_address.value)==false)
		{
			document.frm.email_address.value="";
		   document.frm.email_address.focus();
			return false;
		}
	}
	if(document.frm.phone_no.value!="")
 	{
		
		if(document.frm.phone_no.value=="")
		{
			alert('Please Enter Contact No.');
			document.frm.phone_no.focus();
			return false;
		}
		if(document.frm.phone_no.value!="")
		{

			var phone= document.frm.phone_no.value;
		
			if (isNaN(phone)) 
			{
				alert("The Contact Number Contains illegal characters.");
				document.frm.phone_no.value="";
				document.frm.phone_no.focus();
				return false;
			}
		}
		
	}
	
	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;                    
}
	/*if(document.frm.email_address.value=="")
	{
		alert('Please Enter Email');
		document.frm.email_address.focus();
		return false;
	}
	
	if (echeck(document.frm.email_address.value)==false)
	{
        document.frm.email_address.value="";
       document.frm.email_address.focus();
        return false;
	}
	
	if(document.frm.country_code.value=="")
	{
		alert('Please Enter Country Code');
		document.frm.country_code.focus();
		return false;
	}
	 if(document.frm.country_code.value!="")
 	{
		var phone= document.frm.country_code.value;
	
		if (isNaN(phone)) 
		{
     		alert("The Country Code Contains illegal characters.");
			document.frm.country_code.value="";
			document.frm.country_code.focus();
	 		return false;
		}
		
	}
	if(document.frm.phone_no.value=="")
	{
		alert('Please Enter Contact No.');
		document.frm.phone_no.focus();
		return false;
	}
	 if(document.frm.phone_no.value!="")
 	{
		var phone= document.frm.phone_no.value;
	
		if (isNaN(phone)) 
		{
     		alert("The Contact Number Contains illegal characters.");
			document.frm.phone_no.value="";
			document.frm.phone_no.focus();
	 		return false;
		}
		
	}
	return true;
}	


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 ;                   
}
