 function isNumber(data, type)
{
	var numStr=type;
	var thisChar;
	var counter=0;
	for(var i=0; i < data.length; i++)
		{
			thisChar=data.substring(i,i+1);
			if(numStr.indexOf(thisChar)!=-1)
			{counter++;}
		}
		if(counter==data.length)
		{return true;}
		else
		return false;
 }
 function checkmail(e)
          {
                var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
                var returnval=emailfilter.test(e.value);
                return returnval;
          }

function Regvalidat()
 {
   var ob = this.document.getElementById("frm");
      
   if(ob.txt_FullName.value =="")
   {
    alert("Enter Contact Name.");
    ob.txt_FullName.focus();
    return false;
   }

   
   if(ob.txt_Phone.value =="")
   {
    alert("Enter your phone number.");
    ob.txt_Phone.focus();
    return false;
   }
   if(isNumber(ob.txt_Phone.value, "0123456789-()")!=true)
   {
       alert("Please check the Phone No. -'"+ob.txt_Phone.value+"'");
       ob.txt_Phone.select();
       return false;
   }
   if(ob.txt_Email.value =="")
   {
      alert("Enter the email id.");
      ob.txt_Email.focus();
      return false;
	}
     if(!checkmail(ob.txt_Email))
     {
        alert("Please enter valid email id.");
        ob.txt_Email.select();
        return false;
     }
     
  
   if(ob.txt_heard.selectedIndex == 2)
    {
       if(ob.txt_Reference.value =="")
       {
          alert("Enter Business Partner Name.");
          ob.txt_Reference.focus();
          return false;
	    }
    }

    
   
 }
function ShowDiv()
{
	var txt_heard = document.getElementById("txt_heard");
	if(txt_heard.selectedIndex == 2  )
	{
		 document.getElementById('div_refer').style.visibility='visible';
	}
	else
	{
	     document.getElementById('div_refer').style.visibility='hidden';
	}
}