function getHsearchValue(bound)
{
	this.type = (GI(bound + "_Type_0").checked ? "0" : "1");
	this.keyword = GI(bound + "_Keyword").value;
	this.filter = GI(bound + "_Filter").value;
	this.isFirst = (GI(bound + "_IsFirst").checked ? "1" : "0");
	
	//关键字过滤类型
	for(var i=0; i<GN(bound + "_FilterType").length-1; i++)
	{
		if(GI(bound + "_FilterType_"+i).checked)	
		{
			this.filterType = GI(bound + "_FilterType_"+i).value;	
			break;
		}
	}
	if(this.type==1)
	{
		//产品分类
		this.categoryno = GI(bound + "_Categoryno_0").value;
		for(var i=2; i>=0; i--)
		{
			var tempObj = GI(bound + "_Categoryno_"+i)
			if(tempObj.className=="showElement" && tempObj.value!="")	
			{
				this.categoryno = tempObj.value;
				break;
			}
		}
	}
	else if(this.type==0)
	{
		this.booth = GI(bound + "_Booth").value;
		this.areano = GI(bound + "_Areano").value;
	}
	//省|市
	if(bound=="Exp")
		this.region = GI(bound + "_Province").value + (GI(bound + "_City").value!="" ? GI(bound + "_City").value : "");
	else
		this.region = GI(bound + "_Country").value;
}
function goHSearch(bound, version, errMsg)
{
	var oV = new getHsearchValue(bound);
	var bound = "&TopPage_search_bound=" + bound.toLowerCase();
	var type = "TopPage_search_type=" + oV.type;
	var keyword = (oV.keyword!="" ? ("&TopPage_search_keyword=" + oV.keyword) : "");
	var filter = (oV.filter!="" ? ("&filter=" + oV.filter) : "");
	var filterType = "&filterType=" + oV.filterType;
	var booth = ((oV.booth!=undefined && oV.booth!="") ? ("&booth="+oV.booth) : "");
	var areano = ((oV.areano!=undefined && oV.areano!="-") ? ("&areano="+oV.areano) : "");
	var categoryno = ((oV.categoryno!=undefined && oV.categoryno!="-") ? ("&categoryno="+oV.categoryno) : "");
	var region = (oV.region!="-" ? ("&region=" + oV.region) : "");
	var filterType = "&isFirst=" + oV.isFirst;
	
	var href = "/pages/SearchList.aspx" +"?"+type  ;
	href += "&version=" + version+bound+ keyword + filter + filterType;
	href += booth + areano + categoryno + region;
	if(keyword=="" && areano=="" && categoryno=="" && region=="" && booth=="")
		alert(errMsg);
	else
		location.href = href ;
	//alert(href);
}
function searchChild(id, v)
{
  this.value = v;
  if(v=="-")
    this.rt = false;
  else
  {
    this.rt = true;
  }
}

//高级查询中的产品/企业查询条件切换
function switchPaC(name)
{
	
	var bound = (name.split("_"))[0];
	var selectedValue;
  for(var i=0; i<GN(name).length; i++)
  {
    var obj = GN(name)[i];
    if(obj.tagName=="INPUT" && obj.checked)
      selectedValue = obj.value;
  }
  if(selectedValue=="1")
  {
    GI(bound + "CompanySwitch").style.display = "none";
    GI(bound + "ProductSwitch").style.display = "";
  }
  else if(selectedValue=="0")
  {
    GI(bound + "CompanySwitch").style.display = "";
    GI(bound + "ProductSwitch").style.display = "none";
  }
}
//------------------------------------------------------------
//产品分类
function disposeCategoryList(id, xmlDoc, bound, version)
{
  var itemsNode = xmlDoc.documentElement.childNodes;
  var _selectObj = [GI(bound + "_Categoryno_0"), GI(bound + "_Categoryno_1"), GI(bound + "_Categoryno_2")];
  var flag = 0;
  for(var i=0; i<_selectObj.length; i++)
  {
    if(_selectObj[i].id==id)
      flag = i + 1;
    _selectObj[i].className = "hiddenElement";
  }
  for(var i=0; i<=flag; i++)
  {
    if(i!=flag)
      _selectObj[i].className = "showElement";
    else
    {
      if(itemsNode.length>0)
        _selectObj[i].className = "showElement";
    }
  }  
  if(itemsNode.length>0)
  {
    _selectObj[flag].options.length = 0;
		var oOption = document.createElement("OPTION");
		oOption.text = (version.toLowerCase()=="cn" ? "请选择" : "Please Select");
		oOption.value = "";
		_selectObj[flag].options.add(oOption);
    for(var i=0; i<itemsNode.length; i++)
    {
      oOption = document.createElement("OPTION");
      var _itemsNode = itemsNode[i].childNodes;
      oOption.text = _itemsNode[0].firstChild.nodeValue;
      oOption.value = _itemsNode[1].firstChild.nodeValue;
      _selectObj[flag].options.add(oOption);
    }
  }
//  alert(id+"   "+flag+"    "+itemsNode.length); 
}
//------------------------------------------------------------
//省市
function disposeRegion(xmlDoc, version)
{
  var selectObj = GI("Exp_City");
  var itemsNode = xmlDoc.documentElement.childNodes;
  if(itemsNode.length>0)
  {
    selectObj.className = "showElement";
    selectObj.options.length = 0;
		var oOption = document.createElement("OPTION");
		oOption.text = (version.toLowerCase()=="cn" ? "请选择" : "Please Select");
		oOption.value = "";
		selectObj.options.add(oOption);
    for(var i=0; i<itemsNode.length; i++)
    {
      oOption = document.createElement("OPTION");
      var _itemsNode = itemsNode[i].childNodes;
      oOption.text = _itemsNode[0].firstChild.nodeValue;
      oOption.value = _itemsNode[1].firstChild.nodeValue;
      selectObj.options.add(oOption);
    }
  }
  else
    selectObj.className = "hiddenElement";
}