//餐饮搜索框
function subdc(){
var dcsearchStr=document.getElementById("searchStr").value;
		   dcsearchStr= dcsearchStr.replace("&", "& amp;");
                   dcsearchStr= dcsearchStr.replace("<", "& lt;");
                   dcsearchStr= dcsearchStr.replace(">", "& gt;");
		   dcsearchStr= dcsearchStr.replace("(", "&#40;");
		   dcsearchStr= dcsearchStr.replace(")", "&#41;");
		   dcsearchStr= dcsearchStr.replace("#", "&#35;");
		   dcsearchStr= dcsearchStr.replace("&", "&#38;");
                   dcsearchStr= dcsearchStr.replace("\"", "& quot;");
		   dcsearchStr= dcsearchStr.replace("script", "");
var area=document.getElementById("areaid_sc").value.replace(/^\s+|\s+$/,"");
if(dcsearchStr==""||dcsearchStr=="如：川菜、粤菜等"){
 alert("请输入餐厅名、路名、小区名等关键词");
 }
else
{
//dcsearch.submit();
//window.open('/haobai/canyin/search_key.jsp?searchStr='+dcsearchStr+'&areaid_sc='+area);
window.open("/haobai/canyin/search_key.jsp?searchStr="+encodeURI(encodeURI(dcsearchStr))+"&areaid_sc="+encodeURI(area));
}
   }
// search shop
function searchOrderShop(){
var kw = document.getElementById("kw").value;
if(kw==""||kw==null){
alert("请输入您要查找的关键字");
document.getElementById('kw').focus();
return;

}
//window.open();
window.open('http://ordershop.gx118114.net:8002/OrderShop/luceneEdit.do?md=search&kw='+encodeURI(kw));
}
document.onkeydown = function(e){
        if(!e) e = window.event;//火狐中是 window.event
        if((e.keyCode || e.which) == 13){
           //document.getElementById("auto").click();
         // searchOrderShop();
        }
    }
	
	//ding zhi
	
	function AddArray(){

 
    var nme="";
	var ul;
    var len=companyForm.compare.length;
      if (len>0)  
		  {  
		    for(i=0;i<len;i++)  
		      if(companyForm.compare[i].checked)  
		          {  
		           
		            nme+=companyForm.compare[i].value+"|";
					 var Days = 30;
                     var exp = new Date(); 
                     exp.setTime(exp.getTime() + Days*24*60*60*1000);
		            //document.cookie="user="+nme;
					document.cookie = "che="+ nme+ ";expires=" + exp.toGMTString();
					  createXmlHttp();
                      xmlHttp.onreadystatechange = showSuggest;
                      xmlHttp.open("GET", "z_index.jsp", true);
                      xmlHttp.send(null);
					  ul=parseInt(companyForm.compare[i].value);
                      var uar=url(ul);
                      window.open(uar,'newwindow'); 
                    　
		          }  
		  } 
		  
		  

	
	}
	
	
function getCookie(str){
	var tmp,reg=new RegExp("(^| )"+str+"=([^;]*)(;|$)","gi");
	if(tmp=reg.exec(document.cookie))return(tmp[2]);
	return null;
	}
function ReadCookie(){
	//alert(getCookie("username").split(","));
	//var ste=getCookie("user");
	
   var ste=getCookie("che");
	alert(ste);
	}
 function checkcompare(){
		//var nme="";
		var num=0;
		var len=companyForm.compare.length;  
		  if (len>0)  
		  {  
		    for(i=0;i<len;i++)  
		      if(companyForm.compare[i].checked)  
		          {  
		            num=num+1;
		            // nme=companyForm.compare[i].value; 
		          }  
		  }  
		  	 
		  if(num>1)  
		  {  
		      alert("定制一次只能选一个!");  
			 
		      document.companyForm.reset();
			  //return false;
		  }
	
	}
	//ji piao 
	
	function dosubmit(){

		 var queryUrl = "";
		 var from=document.getElementById("from").value;
		 var todate=document.getElementById("todate").value;
		 var fromdate=document.getElementById("fromdate").value;
		 var to=document.getElementById("to").value;
		 var fromair=document.getElementById("fromair").value;
	     var startcity = GetCityCode(from);
		 var endcity = GetCityCode(to);
         //alert(endcity);
	     queryUrl = "http://travel.118114.cn/searchflight.do?flytype=1&seladult=1&txtstartcity="+startcity+"&txtstartdate="+fromdate+"&txtendcity="+endcity+"&txtenddate="+todate+"&txtseconddest=&PrintState=&PrintCity=&carbinlevel=&selflightcompany=&selstarttime=&selendtime=";
		//queryUrl = "http://www.itour.cc/AgentShare/(S(0xdkxg555ct0jv5512mhw355))/DAirticket/default.aspx?AgentID=wzhz016";
		    //alert(queryUrl);
		    window.open (queryUrl,"survey_server1","");
			//newWindow.focus();
     	// }
	 }
	 //jiu dian
	 function sub1(){
	form_hotel.submit();
    }

