var IE = document.all?true:false;
function onlynum_wap(event, valpass)
  {	
	 if (((event.keyCode<48) || (event.keyCode>57)) && ((event.keyCode<96) || (event.keyCode>105)))
			{						
				document.getElementById("wap_mobile_no").value="";
				return false;
			}
	
	 if ((event.keyCode==190) || (event.keyCode==110))
			{						
				document.getElementById("wap_mobile_no").value="";
				return false;
			}
			
  }


  function activate_click()
{
	
		val_mobile=document.getElementById("wap_mobile_no").value;
	

	  if(val_mobile=="")
	{
		alert("Please enter your mobile number");
		document.getElementById("wap_mobile_no").focus();
		return false;
	}

		if(val_mobile.substring(0,1)!=9)
	{
		alert("Mobile number should start with 9");
		document.getElementById("wap_mobile_no").focus();
		return false;
	}

	if(val_mobile.length < 10)
	{
		alert("You should enter your 10 digits mobile number");
		document.getElementById("wap_mobile_no").focus();
		return false;
	}


var old_activate_div=document.getElementById("activate_wap").innerHTML;
document.getElementById("activate_wap").innerHTML ="<img src='http://img1.moneycontrol.com/images/wap/wap1.gif' hspace=10 vspace=0 border=0>";

		if(!IE)
		var objXml = new XMLHttpRequest();
		else
		var objXml = new ActiveXObject("Microsoft.XMLHTTP");



		datafile = "/promo/wap/get_mconmobile.php?mob="+val_mobile;

		

		objXml.open("GET", datafile, true);
		objXml.setRequestHeader("Cache-Control","no-cache"); 

		objXml.onreadystatechange=function() 
		{
			if (objXml.readyState==4) 
			{
				if (objXml.status!=404)
				{	
					if((objXml.responseText).length > 0)
					{
						
						alert("Thank you. You will receive the SMS shortly from MC.");
						document.getElementById("activate_wap").innerHTML=old_activate_div;
						document.getElementById("wap_mobile_no").value="";
						
					}
				}

			}
		}
		objXml.send(null);


}