﻿var rc_lgCn,rc_lgCt;var rc_lgUrl="/catalog/City.asmx/SearchListGuid";function rd(){if(!CheckCountryCity())return false;if(!CheckADDate())return false;var cn=decodeURIComponent(String(getCountryCode()).trim().toLowerCase()).replace(/\+/g," ");var ct=decodeURIComponent(String($v("SelectCity")).trim().toLowerCase()).replace(/\+/g," ");rc_redirect(cn,ct)}
function CheckCountryCity(){var cn=getCountryCode();if(!cn||cn==""){alert($v("msgChoiceCountry"));return false}
var ct=$v("SelectCity");if(!ct||ct==""){alert($v("msgChoiceCity"));return false}
return true}
function rc_redirect(cn,ct){rc_lgCn=cn.replace(/\ /g,"+");rc_lgCt=ct.replace(/\ /g,"+");SearchListGuid()}
function SearchListGuid(){var sl=new LoadList();sl.OnError=snOnError;sl.OnComplete=slComplete;var URL=rc_lgUrl;var Query=getParam("ad",getAD())+
getParam("dd",getDD())+
getParam("country",rc_lgCn)+
getParam("city",rc_lgCt)+
getParam("RoomType",$v("CountOfPerson"))+
getParam("RoomCount",$v("CountOfRoom"))+
getParam("VisitorID",$v("VisitorID"))+
getParam("Lang",$v("Lang"))+
getParam("User","")+
getParam("rating","")+
getParam("chain","")+
getParam("facility","")+
getParam("name",typeof getName!='undefined'?getName():"")+
getParam("price","")+
getParam("ll","");sl.DoCallBack(URL,Query);return false;}
function snOnError(status,statusText,responseText){alert("Error:\n"+status+"\n"+statusText+"\n"+responseText)}
function slComplete(responseText,responseXML){response=responseXML.documentElement;var d=response.getElementsByTagName('SearchListGuid');var lg="";if(response&&response.firstChild){lg=response.firstChild.textContent||response.firstChild.data}
jumpPage(lg)}
function jumpPage(lg){pageGoto("/"+(rc_lgCn.replace(/ /g,"+"))+"+hotels/"+(rc_lgCt.replace(/ /g,"+"))+"+hotels"+"/"+lg)}
