
function UrlSearch() 
{
   var name,value; 
   var str=location.href;
   var num=str.indexOf("?") 
   str=str.substr(num+1);
   var arr=str.split("&");
   for(var i=0;i < arr.length;i++){ 
    num=arr[i].indexOf("="); 
    if(num>0){ 
     name=arr[i].substring(0,num);
     value=arr[i].substr(num+1);
     this[name]=value;
     } 
    } 
} 
var Request=new UrlSearch();
document.write("<INPUT type=hidden value='"+Request.code+"' name=code>")

function getArea(d){
	getareaForm.tel.value=d;
	var mobile=d;
	var regmobile = /^[0-9]{11}$/;;
    if(!regmobile.exec(mobile))
    {
        alert("手机号不正确！"+mobile);
		return false;
    }
		search(d,'QueryBack1');
			//getareaForm.submit();
}	

function setPayAmounta(mon){
	var url="http://www.532500.com:8082/sms/CardPrice.aspx?action=getPhone&callback=?";
	var _PhonePrice=mon;
	//var _username="sanjer";var _userid="110";
	var data={PhonePrice:_PhonePrice};
	$.getJSON(url,data,function(backdata){
	 	$("#needAmount").html(backdata.cardvalue+'元');
		//needAmount.innerText=backdata.cardvalue;
		document.getElementById("cardvalue").value=backdata.cardvalue;
		document.getElementById("cardid").value=backdata.cardid;
		document.getElementById("cardprice").value=backdata.cardprice;
		document.getElementById("inum").value=backdata.inum;
	});
	
}

	function search(tel,showFun) {
		var oHead = document.getElementsByTagName('head')[0];
	var oTar = document.getElementById("remotejs");
	
	if (oTar)	oHead.removeChild(oTar);
	
	var oScript = document.createElement('script');
	oScript.type = "text/javascript";
	oScript.id = "remotejs";
	oScript.src = "http://api.showji.com/Locating/default.aspx?m=" + escape(tel) + "&output=json&callback="+showFun;

	oHead.appendChild(oScript);
	}

	function QueryBack1(obj) {
		if (obj["Province"].length>0)
                        diqu.innerText=obj["Province"]+""+obj["City"];
		else
                       diqu.innerText='未知数据';
                       yunying.innerText=obj["Corp"];
	}
	
function Hmb(){}
Hmb.prototype.CheckRegion = function()
{
		var mobile=getareaForm.tel.value;
		var regmobile = /^[0-9]{11}$/;;
		if(!regmobile.exec(mobile))
		{
			alert("手机号不正确！"+mobile);
			return false;
		}
}
var Hmbser = new Hmb();