function validate_form ( )
  {
    //return true;
	
	if ( document.form2.name.value == "" )
    {
        alert ( "Please fill 'Name' in the box." );
        return false;
    }
	
	if ( document.form2.email.value == "" )
    {
        alert ( "Please fill 'Email id' in the box." );
        return false;
    }

     var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    str = document.form2.email.value;
	
	if(!str.match(emailRegEx)){
	alert('Please enter a valid email address.');
	return false;
	}
	
	if ( document.form2.pwd.value == "" )
    {
        alert ( "Please fill 'Password' in the box." );
        return false;
    }
		
	if ( document.form2.phone.value == "" )
    {
        alert ( "Please fill 'Mobile Number' in the box." );
        return false;
    }
	
    
	if ( document.form2.fmain_cat.selectedIndex == 0 )
    {
        alert ( "Please select Education Interest." );
        return false;
    }
	
  if ( document.form2.fcountry.selectedIndex == 0 )
    {
        alert ( "Please select Country Interest." );
        return false;
    }
  if ( document.form2.agree.checked == false)
    {
        alert ( "Please Cheked 'Privacy and  Policy' in the box." );
        return false;
    }
  
     return true;
 }

 
    function checknumber(data) {
    var checkOK = "()-0123456789. ";
    var checkStr = data.value;
    var allValid = true;
    var allNum = "";
    
      for (i = 0;  i < checkStr.length;  i++) {
        ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
        if (j == checkOK.length) {
          allValid = false;
          break;
        }
        if (ch != ",")
          allNum += ch;
        }
        if (!allValid) {
          alert("Please enter a number");
          data.value = "";
        return (false);
      }
    }
	
function AjaxFunction(url12,resid)
	{
	//alert(url12);
	
	var httpxml;
	try
	{
	// Firefox, Opera 8.0+, Safari
	httpxml=new XMLHttpRequest();
	}
	catch (e)
	{
	// Internet Explorer
	try
	{
	httpxml=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
	{
	try
	{
	httpxml=new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch (e)
	{
	alert("Your browser does not support AJAX!");
	return false;
	}
	}
	}
	function stateck()
	{
	if(httpxml.readyState==4)
	{
	//alert(resid);
	document.getElementById(resid).innerHTML=httpxml.responseText;
	
	}
	}
	
	httpxml.onreadystatechange=stateck;
	httpxml.open("GET",url12,true);
	httpxml.send(null);
	}
	
	function MM_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}
		