function LiveSearchList(a,b){m_listaDiv=b;m_strReq=a;if(typeof(m_tim)!="undefined"){clearTimeout(m_tim)}m_tim=setTimeout(StartRequest,200)}function StartRequest(){var a=new XMLHttp();a.SendAsync(m_strReq,callBackLiveSearchList,null,null)}function callBackLiveSearchList(b){var a=b.responseXML;var d=a.getElementsByTagName("response")[0].firstChild.nodeValue;var c=document.getElementById(m_listaDiv);c.innerHTML=d;c.style.display="block";c.style.border="1px";$("#nomeCity").removeClass("loading")}function NumCamereChanged(a){for(var b=1;b<=3;b++){if(b<=a){ShowDiv("camera"+b+"Div")}else{HideDiv("camera"+b+"Div")}}}function NumAdultiChanged(d,e){var f=document.getElementById("selectNumBambini"+e+"Div");var a=2;if(d>2){a=4-d}var c='<select name="numChild'+e+'" id="numChild'+e+"\" style='width:34px' onChange=\"NumBambiniChanged(this.value, "+e+')">';for(var b=0;b<=a;b++){c+='<option value="'+b+'">'+b+"</option>"}c+="</select>";if(f!=null){f.innerHTML=c;NumBambiniChanged("0",e)}}function NumBambiniChanged(b,c){var d=document.getElementById("numRooms");for(var a=1;a<=9;a++){if(a<=b){ShowDiv("Child"+c+a+"Div")}else{HideDiv("Child"+c+a+"Div")}}}function CheckRoomConfig(g,i,f,k,j,h,d,b,a,e,c,m,l){if(g>0){if(document.getElementById("numRooms")!==null){document.getElementById("numRooms").selectedIndex=g-1}if(document.getElementById("numAdulti1")!==null){document.getElementById("numAdulti1").selectedIndex=i-1}if(f>=1){document.getElementById("numChild1").selectedIndex=f;document.getElementById("Room1_numChild1").selectedIndex=k;ShowDiv("Child1Div");ShowDiv("Child11Div");if(f==2){document.getElementById("Room1_numChild2").selectedIndex=j;ShowDiv("Child12Div")}}if(h>0){ShowDiv("camera2Div");document.getElementById("numAdulti2").selectedIndex=h-1;if(d>=1){document.getElementById("numChild2").selectedIndex=d;document.getElementById("Room2_numChild1").selectedIndex=b;ShowDiv("Child2Div");ShowDiv("Child21Div");if(d==2){document.getElementById("Room2_numChild2").selectedIndex=a;ShowDiv("Child22Div")}}}if(e>0){ShowDiv("camera3Div");document.getElementById("numAdulti3").selectedIndex=e-1;if(c>=1){document.getElementById("numChild3").selectedIndex=c;document.getElementById("Room3_numChild1").selectedIndex=m;ShowDiv("Child3Div");ShowDiv("Child31Div");if(c==2){document.getElementById("Room3_numChild2").selectedIndex=l;ShowDiv("Child32Div")}}}}}function HideDiv(a){var b=document.getElementById(a);if(b){b.style.display="none"}}function ShowDiv(a){var b=document.getElementById(a);if(b){b.style.display="block"}}function GetConfig(){var a=document.getElementById("numRooms").value;var f="&numRooms="+a;for(var b=1;b<=a;b++){var d=document.getElementById("numAdulti"+b);if(d!=null){f+="&"+d.id+"="+d.value;d=document.getElementById("numChild"+b);if(d!=null){f+="&"+d.id+"="+d.value;var e=d.value;for(var c=1;c<=e;c++){d=document.getElementById("Room"+b+"_numChild"+c);if(d!=null){f+="&"+d.id+"="+d.value}}}}}return f}function formatCurrency(a){num=a.toFixed(2);nStr=num+"";x=nStr.split(".");x1=x[0];x2=x.length>1?","+x[1]:"";var b=/(\d+)(\d{3})/;while(b.test(x1)){x1=x1.replace(b,"$1.$2")}return x1+x2}function unformatCurrency(a){nStr=a+"";x=nStr.split(",");x1=x[0];x2=x.length>1?"."+x[1]:"";var b=/(\d+)(.)(\d{3})/;while(b.test(x1)){x1=x1.replace(b,"$1$3")}return x1+x2};
