//判断浏览器
function createXMLHttp()
{
    var request = false;
    if (window.XMLHttpRequest){ request = new XMLHttpRequest(); }
    else if (window.ActiveXObject) 
    {
       try{ request = new ActiveXObject("MSXML2.XMLHTTP"); } 
       catch (e1) 
       {
         try{ request = new ActiveXObject("Microsoft.XMLHTTP"); } 
         catch (e2){ request = false; }
       }
    }
    return request;
}
	
	//检测用户名
	function CheckAccount(username)
    {
      var re, r;
    
      re = /\S/;
      r = username.match(re);
      if (!r)
      {
        alert("请输入用户帐号！");
        return false;
      }
      else
      {
        window.open("Register_Check.aspx?type=username&value="+username,"")
      }
    }
    
    //检测邮箱地址
	function CheckMail(email)
    {
      var re, r;
    
      re = /\S/;
      r = email.match(re);
      if (!r)
      {
        alert("请输入邮箱地址！");
        return false;
      }
      else
      {
        window.open("Register_Check.aspx?type=email&value="+email,"")
      }
    }

    //以XML求取ddl_LocusCity的数据
	function XmlPost_LocusCity(obj)
    {
		var svalue = obj.value;
		var webFileUrl = "?provinceid=" + svalue;
		var result = "";
		var xmlHttp = createXMLHttp();
		xmlHttp.open("POST", webFileUrl, false);
		xmlHttp.send("");
		result = xmlHttp.responseText;
				　　
		if(result != "")
		{
			document.getElementById("ddl_LocusCity").length=0;
			var piArray = result.split(",");
			for(var i=0;i<piArray.length;i++)
			{
				var ary = piArray[i].toString().split("|");
				document.getElementById("ddl_LocusCity").options.add(new Option(ary[1].toString(),ary[0].toString()));
			}
			document.getElementById("hid_LocusCity").value = document.getElementById("ddl_LocusCity").options[document.getElementById("ddl_LocusCity").selectedIndex].value;
		}
		else
		{
			alert(result);
		}
	}
	
	
	//以XML求取ddl_LocusPlaceCity的数据
	function XmlPost_LocusPlaceCity(obj)
    {
		var svalue = obj.value;
		var webFileUrl = "?provinceid=" + svalue;
		var result = "";
		var xmlHttp = createXMLHttp();
		xmlHttp.open("POST", webFileUrl, false);
		xmlHttp.send("");
		result = xmlHttp.responseText;
				　　
		if(result != "")
		{
			document.getElementById("ddl_LocusPlaceCity").length=0;
			var piArray = result.split(",");
			for(var i=0;i<piArray.length;i++)
			{
				var ary = piArray[i].toString().split("|");
				document.getElementById("ddl_LocusPlaceCity").options.add(new Option(ary[1].toString(),ary[0].toString()));
			}
			document.getElementById("hid_LocusPlaceCity").value = document.getElementById("ddl_LocusPlaceCity").options[document.getElementById("ddl_LocusPlaceCity").selectedIndex].value;
		}
		else
		{
			alert(result);
		}
	}


//单选框 单击事件
function RadioClick()
{
	var dom = document.getElementById;
	var el = event.srcElement;
	
	if(el.tagName=="INPUT"&&el.type.toLowerCase()=="radio")
	{
		for(i=0;i<dom.length;i++)
		{
			if(dom[i].tagName=="INPUT" && dom[i].type.toLowerCase()=="radio")
			{
				dom[i].checked=false;
			}
		}
	}
	el.checked=true;
}