function doSearch() {
  var keywords = trim(document.searchForm.keywords.value);
  document.searchForm.keywords.value = keywords;
  var p_z_Z_Type = document.searchForm.p_z_Z_Type.value;
  var catId =document.searchForm.catId.value;
  if(keywords == "") {
    alert("请输入关键字！");
    return false;
  }
  if(p_z_Z_Type == "Allsearch") {
  	url = "http://so.cnfmw.com/sotrade/?keywords=" + keywords +""
  }
  if(p_z_Z_Type == "Sale") {
  	url = "http://so.cnfmw.com/sotrade/?keywords=" + keywords +""
  }
  if (p_z_Z_Type == "Buy") {
  	url = "http://so.cnfmw.com/SoSeller/?keywords=" + keywords +""
  }
  if (p_z_Z_Type == "Product") {
  	url = "http://so.cnfmw.com/SoProduct/?keywords=" + keywords +""
  }
  if (p_z_Z_Type == "Company") {
  	url = "http://so.cnfmw.com/SoCompany/?keywords=" + keywords +""
  }
   
  if (p_z_Z_Type == "News") {
  	url = "http://so.cnfmw.com/SoNews/?keywords=" + keywords +""
  }
  if (p_z_Z_Type == "Art") {
  	url = "http://so.cnfmw.com/SoArt/?keywords=" + keywords +""
  }
    if (p_z_Z_Type == "Expo") {
  	url = "http://so.cnfmw.com/SoExpo/?keywords=" + keywords +""

 }
  	document.searchForm.action = url;
  	document.searchForm.submit();  
}

 function trim(inputString) {

       if (typeof inputString != "string") { return inputString; }
       var retValue = inputString;
       var ch = retValue.substring(0, 1);
       while (ch == " ") {
       //检查字符串开始部分的空格
           retValue = retValue.substring(1, retValue.length);
           ch = retValue.substring(0, 1);
       }
       ch = retValue.substring(retValue.length-1, retValue.length);
       while (ch == " ") {
          //检查字符串结束部分的空格
          retValue = retValue.substring(0, retValue.length-1);
          ch = retValue.substring(retValue.length-1, retValue.length);
       }
       while (retValue.indexOf("  ") != -1) {
      //将文字中间多个相连的空格变为一个空格
          retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length);
       }
       return retValue;
    }

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}