//判断浏览器
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;
}

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

	//以XML求取lib_WishTrainBox的数据
	function XmlPost_WishTrainBox(obj)
    {
        var svalue = obj.value;
		var webFileUrl = "?wishTrainid=" + svalue;
		var result = "";
		var xmlHttp = createXMLHttp();
		xmlHttp.open("POST", webFileUrl, false);
		xmlHttp.send("");
		result = xmlHttp.responseText;
				　　
		if(result != "")
		{
		    document.getElementById("lib_WishTradeBox").length = 0;
			var piArray = result.split(",");
			for(var i=0;i<piArray.length;i++)
			{
				var ary = piArray[i].toString().split("|");
				document.getElementById("lib_WishTradeBox").options.add(new Option(ary[1].toString(), ary[0].toString()));
			}
		}
		else
		{
		    document.getElementById("hid_CurrentTrade").value = "";
		    document.getElementById("ddl_CurrentTrade").length = 0;
		    document.getElementById("ddl_CurrentTrade").options.add(new Option("请选择", ""));
		}
	}
	//以XML求取lib_WishTrainBox的数据
	function XmlPost_WishTrainBoxs(obj) {
	    var svalue = obj.value;
	    var webFileUrl = "?wishTrainid=" + svalue;
	    var result = "";
	    var xmlHttp = createXMLHttp();
	    xmlHttp.open("POST", webFileUrl, false);
	    xmlHttp.send("");
	    result = xmlHttp.responseText;
	    if (result != "") {
	        document.getElementById("ddl_Trade").length = 0;
	        var piArray = result.split(",");
	        for (var i = 0; i < piArray.length; i++) {
	            var ary = piArray[i].toString().split("|");
	            document.getElementById("ddl_Trade").options.add(new Option(ary[1].toString(), ary[0].toString()));
	        }
	    }
	    else {
	        alert(result);
	    }
	}
	//以XML求取lib_WishTBox的数据
	function XmlPost_WishTBox(obj) {
	    var svalue = obj.value;
	    var webFileUrl = "?wishTrainid=" + svalue;
	    var result = "";
	    var xmlHttp = createXMLHttp();
	    xmlHttp.open("POST", webFileUrl, false);
	    xmlHttp.send("");
	    result = xmlHttp.responseText;
	    if (result != "") {
	        document.getElementById("ddl_CurrentTrade").length = 0;
	        var piArray = result.split(",");
	        for (var i = 0; i < piArray.length; i++) {
	            var ary = piArray[i].toString().split("|");
	            document.getElementById("ddl_CurrentTrade").options.add(new Option(ary[1].toString(), ary[0].toString()));
	        }
	    }
	    else {
	        document.getElementById("hid_CurrentTrade").value = "";
	        document.getElementById("ddl_CurrentTrade").length = 0;
	        document.getElementById("ddl_CurrentTrade").options.add(new Option("请选择", ""));
	    }
	}

	//以XML求取lib_WishTBox的数据
	function XmlPost_WishTBoxz(obj) {
	    var svalue = obj.value;
	    var webFileUrl = "?wishTrainid=" + svalue;
	    var result = "";
	    var xmlHttp = createXMLHttp();
	    xmlHttp.open("POST", webFileUrl, false);
	    xmlHttp.send("");
	    result = xmlHttp.responseText;
	    if (result != "") {
	        document.getElementById("ddl_CompanyTrade").length = 0;
	        var piArray = result.split(",");
	        for (var i = 0; i < piArray.length; i++) {
	            var ary = piArray[i].toString().split("|"); 
	            document.getElementById("ddl_CompanyTrade").options.add(new Option(ary[1].toString(), ary[0].toString()));
	        }
	    }
	    else {
	        alert(result);
	    }
	}
	//以XML求取lib_WishJobBox的数据
	function XmlPost_WishJobBox(obj) {
	    var svalue = obj.value;
	    var webFileUrl = "?wishjobid=" + svalue;
	    var result = "";
	    var xmlHttp = createXMLHttp();
	    xmlHttp.open("POST", webFileUrl, false);
	    xmlHttp.send("");
	    result = xmlHttp.responseText;
	    if (result != "") {
	        document.getElementById("lib_WishJobBox").length = 0;
	        var piArray = result.split(",");
	        for (var i = 0; i < piArray.length; i++) {
	            var ary = piArray[i].toString().split("|");
	            document.getElementById("lib_WishJobBox").options.add(new Option(ary[1].toString(), ary[0].toString()));
	        }
	    }
	    else {
	        alert(result);
	    }
	}

    //以XML求取lib_WishWorkPlaceCity的数据
	function XmlPost_WishWorkPlaceCity(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("lib_WishWorkPlaceCity").length=0;
			var piArray = result.split(",");
			for(var i=0;i<piArray.length;i++)
			{
				var ary = piArray[i].toString().split("|");
				document.getElementById("lib_WishWorkPlaceCity").options.add(new Option(ary[1].toString(),ary[0].toString()));
			}
		}
		else
		{
			alert(result);
		}
	}

 //以XML求取ddl_SkillName的数据
	function XmlPost_Skill(obj)
    {
		var svalue = obj.value;
		var webFileUrl = "?skillid=" + svalue;
		var result = "";
		var xmlHttp = createXMLHttp();
		xmlHttp.open("POST", webFileUrl, false);
		xmlHttp.send("");
		result = xmlHttp.responseText;		　　
		if(result != "")
		{
			document.getElementById("ddl_SkillName").length=0;
			var piArray = result.split(",");
			for(var i=0;i<piArray.length;i++)
			{
				var ary = piArray[i].toString().split("|");
				document.getElementById("ddl_SkillName").options.add(new Option(ary[1].toString(),ary[0].toString()));
			}
			document.getElementById("hid_SkillName").value = document.getElementById("ddl_SkillName").options[document.getElementById("ddl_SkillName").selectedIndex].value;
		}
		else
		{
			alert(result);
		}
	}
	
//以XML求取ddl_CertSub的数据
	function XmlPost_Cert(obj)
    {
		var svalue = obj.value;
		var webFileUrl = "?certid=" + svalue;
		var result = "";
		var xmlHttp = createXMLHttp();
		xmlHttp.open("POST", webFileUrl, false);
		xmlHttp.send("");
		result = xmlHttp.responseText;		　　
		if(result != "")
		{
			document.getElementById("ddl_CertSub").length=0;
			var piArray = result.split(",");
			for(var i=0;i<piArray.length;i++)
			{
				var ary = piArray[i].toString().split("|");
				document.getElementById("ddl_CertSub").options.add(new Option(ary[1].toString(),ary[0].toString()));
			}
			document.getElementById("hid_CertSub").value = document.getElementById("ddl_CertSub").options[document.getElementById("ddl_CertSub").selectedIndex].value;
		}
		else
		{
			alert(result);
		}
}

function TypeSelect(obj) {
    var id = obj.value;
    if (id == 1) {
        document.getElementById("trade").style.display = 'block';
        document.getElementById("area").style.display = 'none';
    }
    if (id == 2) {
        document.getElementById("trade").style.display = 'none';
        document.getElementById("area").style.display = 'block';
    }
    if (id == 0) {
        document.getElementById("trade").style.display = 'none';
        document.getElementById("area").style.display = 'none';
    }
}