var path = "";
var searchPath = "";
function superSubmit(e)
{
	var k = window.event?window.event.keyCode:e.which;
	if (k==13)
	{
		superSearch();
	}
}
//获取国家省市
function getProvinceListTop(paths,url)
{
	path = paths;
	searchPath = url;
	XMLHttp.sendReq('post', ''+path+'/ajax/countryProviceCityListAjax.html?operationType=getProvinceList&countryId=1', '', showProvinceListTop);
}
function showProvinceListTop(http_request)
{
	/*是否成功请求*/
    if(http_request.responseText!="")
    {
    	 var results=http_request.responseXML;
		 var roots=results.documentElement;
		 var ajaxMessage=roots.getAttribute("ajaxMessage");
		 var operationType=roots.getAttribute("operationType");
		 var datas=roots.getAttribute("datas");
		 var dataList=datas.split(",");
		 
		 if(ajaxMessage=="success")
		 {
		 	var dataSelect=document.getElementById("provincess");
	 		for(var i=0;i<=dataList.length-1;i++)
		 	{
		 		opt=document.createElement("Option");
		 		if(dataList[i]=="")continue;
		 		opt.text=dataList[i].split("_")[1];;
    			opt.value=dataList[i].split("_")[0];;
		 		
		 		if(getOs()=='MSIE')
			    {
			      dataSelect.add(opt);
			    }
			    else
			   	{
			      dataSelect.appendChild(opt);
			    }
		 	}
		 }
	}
}
function getCityListTop(provinceId)
{
	if(provinceId==0)
	{
		var dataSelect=document.getElementById("cityss");
	 	var l=dataSelect.length;
		for (var i=0;i<=l;i++)
		{
			dataSelect.remove(0);   
		}
		
		opt=document.createElement("Option");
 		opt.text="城市";
  		opt.value="0";
 		
 		if(getOs()=='MSIE')
	    {
	      dataSelect.add(opt);
	    }
	    else
	   	{
	      dataSelect.appendChild(opt);
	    }
		
	}
	else
		XMLHttp.sendReq('post', ''+path+'/ajax/countryProviceCityListAjax.html?operationType=getCityList&provinceId='+provinceId, '', showCityListTop);
}
function showCityListTop(http_request)
{
	/*是否成功请求*/
    if(http_request.responseText!="")
    {
    	 var results=http_request.responseXML;
		 var roots=results.documentElement;
		 var ajaxMessage=roots.getAttribute("ajaxMessage");
		 var operationType=roots.getAttribute("operationType");
		 var datas=roots.getAttribute("datas");
		 var dataList=datas.split(",");
		 if(ajaxMessage=="success")
		 {
		 	var dataSelect=document.getElementById("cityss");
		 	var l=dataSelect.length;
			for (var i=0;i<=l;i++)
			{
				dataSelect.remove(0);   
			}
	 		for(var i=0;i<=dataList.length-1;i++)
		 	{
		 		opt=document.createElement("Option");
		 		if(dataList[i]=="")continue;
		 		opt.text=dataList[i].split("_")[1];
    			opt.value=dataList[i].split("_")[0];
		 		
		 		if(getOs()=='MSIE')
			    {
			      dataSelect.add(opt);
			    }
			    else
			   	{
			      dataSelect.appendChild(opt);
			    }
		 	}
		 }
	}
}
 
//高级搜索
function superSearchTop()
{
	var haves=document.getElementById("havestop");
	var wants=document.getElementById("wantstop");
	var company=document.getElementById("companytop");
	var tradeCompany=document.getElementById("tradeCompanytop");
	var position=document.getElementById("positiontop");
	var interest=document.getElementById("interesttop");
	var name = document.getElementById("nametop");
	var citys = document.getElementById("cityss");
	var sex = document.getElementById("sex");
	var province = document.getElementById("provincess");
	if(jsTrim(haves.value)==""&&jsTrim(wants.value)==""&&jsTrim(company.value)==""&&jsTrim(tradeCompany.value)==""&&jsTrim(position.value)==""&&jsTrim(interest.value)==""&&jsTrim(name.value)==""&&citys.value=='0'&&sex.value=='all'&&province.value=='0')
	{
		getScreenByStatus("jsAddScreenInfo","info","","","","","")
		document.getElementById("p_content").innerHTML="请至少填写一个高级搜索条件";
		showScreen("","ScreenInForss","promptBoxInForss",null,260,20);
	}
	else 
	{
		//重置过滤条件
		var sortParams="";
		if(sex.value!="all")sortParams+="&sex="+sex.value;
		if(citys.value!="0")sortParams+="&city="+citys.value;
		if(province.value!="0")sortParams+="&pro="+province.value;
		if(haves.value!="")sortParams+="&haves="+encodeURI(haves.value);
		if(wants.value!="")sortParams+="&wants="+encodeURI(wants.value);
		if(company.value!="")sortParams+="&company="+encodeURI(company.value);
		if(tradeCompany.value!="")sortParams+="&tradeCompany="+encodeURI(tradeCompany.value);
		if(position.value!="")sortParams+="&position="+encodeURI(position.value);
		if(interest.value!="")sortParams+="&interest="+encodeURI(interest.value);
		if(name.value!="")sortParams+="&name="+encodeURI(name.value);
		window.location.href=''+searchPath+'/newCardBookVertical.html?status=Vertical&cookie=false&mth=superSearch'+sortParams;
	}
}

 
