function loadMap(){if(MM_findObj("map")){load()}}function unloadMap(){if(MM_findObj("map")){GUnload()}}function searchOption(type){if(current_selection==type){resetSearchOptions()}else{if(current_selection!=""){document.getElementById("search_option_"+current_selection+"_div").style.borderBottom="1px solid #FFFFFF"}var search_option_content="";if(type=="region"){search_option_content=populateRegion(document.getElementById("search_country").value)}else{if(type=="area"){if(document.getElementById("region")){search_option_content=populateArea(document.getElementById("search_region").value)}}else{search_option_content=search_options_html[type]}}document.getElementById("set_search_option_div").innerHTML=search_option_content;if(type=="location_features"||type=="property_features"){populateMultiOptions(type)}else{if(type=="dates"){showSearchDates("both")}else{populateRadioButton(type)}}current_selection=type}}var called=0;function enableOption(option,enable){obj=document.getElementById("search_option_"+option+"_div");if(obj){var enabled="<span>&raquo; </span><a href=\"javascript:searchOption('"+option+"');\">"+option+"</a>";var disabled='<span>&raquo; </span><a href="#" onclick="return false;">'+option+"</a>";obj.innerHTML=(enable)?enabled:disabled;obj.className=(enable)?"search_option":"search_option_disabled"}}function selectOption(option,select){obj=document.getElementById("search_option_"+option+"_div");if(obj){obj.className=(select)?"search_option_selected":"search_option"}}function toggleFlexibleDates(obj){document.getElementById("results_option_flexible_dates").value=(document.getElementById("search_flexible_dates").checked)?"yes":"no";updateNavFlexibleDates();if(checkInAndCheckOutSet()){updateCurrentSelection()}}function changeSearchOption(change,to){var objName="";var val_obj=document.getElementById("results_option_"+change);var current_value=val_obj.value;if(current_value){objName="results_option_"+change+"_"+current_value.replace(/ /g,"_");var current_obj=document.getElementById(objName);current_obj.className="results_option"}objName="results_option_"+change+"_"+to.replace(/ /g,"_");var obj=document.getElementById(objName);obj.className="results_option_selected";val_obj.value=to;if(change=="results_to_display"){setPage(1)}else{doSearch()}}function toggleResultsOptionDiv(objName){for(var i=0;i<results_option_divs.length;i++){if(results_option_divs[i]!=objName){document.getElementById(results_option_divs[i]+"_div").style.display="none"}}var obj=document.getElementById(objName+"_div");obj.style.display=(obj.style.display=="none")?"":"none"}function showSearchDates(show_type){if(show_type=="both"){setLoading("search_dates_checkin_calendar",true);show_type_both=true;current_show_type="checkin";qs="type="+current_show_type+"&month="+current_cim+"&year="+current_ciy;var url="/ajax/search_get_dates_calendar.ajax.php?"+qs;showSearchDatesRequest(url)}else{setLoading("search_dates_"+show_type+"_calendar",true);current_show_type=show_type;qs="type="+show_type;qs+=(show_type=="checkin")?"&month="+current_cim+"&year="+current_ciy:"&month="+current_com+"&year="+current_coy;if(current_cim!=""&&current_ciy!=""&&current_com==""&&current_coy==""&&show_type=="checkout"){qs="type=checkout&month="+current_cim+"&year="+current_ciy}var url="/ajax/search_get_dates_calendar.ajax.php?"+qs;showSearchDatesRequest(url)}}function panCalendar(type,month,year){current_show_type=type;qs="type="+current_show_type+"&month="+month+"&year="+year;var url="/ajax/search_get_dates_calendar.ajax.php?"+qs;showSearchDatesRequest(url)}function populateSearchDates(){var bgcolor_selected="/images/bgcolor_selected.png";if(current_cid!=0&&current_cim!=0&&current_ciy!=0){objName="search_checkin_date_"+current_cid+"_"+current_cim+"_"+current_ciy;obj=document.getElementById(objName);if(obj){obj.style.backgroundImage="url("+bgcolor_selected+")"}}if(current_cod!=0&&current_com!=0&&current_coy!=0){objName="search_checkout_date_"+current_cod+"_"+current_com+"_"+current_coy;obj=document.getElementById(objName);if(obj){obj.style.backgroundImage="url("+bgcolor_selected+")"}}if(document.getElementById("search_flexible_dates")){document.getElementById("search_flexible_dates").checked=(document.getElementById("results_option_flexible_dates").value=="no")?false:true}}function checkInAndCheckOutSet(){return(document.getElementById("search_dates_checkin").value!=""&&document.getElementById("search_dates_checkout").value!="")}function checkOutSet(){return(document.getElementById("search_dates_checkout").value!="")}function updateNavDates(){var _search_dates_checkin=new Date(document.getElementById("search_dates_checkin").value*1000);var _search_dates_checkout=new Date(document.getElementById("search_dates_checkout").value*1000);var from_day_obj=document.getElementById("from_day");var from_month_obj=document.getElementById("from_month");var from_year_obj=document.getElementById("from_year");var to_day_obj=document.getElementById("to_day");var to_month_obj=document.getElementById("to_month");var to_year_obj=document.getElementById("to_year");from_day_obj.value=_search_dates_checkin.getDate();from_month_obj.value=_search_dates_checkin.getMonth()+1;from_year_obj.value=_search_dates_checkin.getFullYear();to_day_obj.value=_search_dates_checkout.getDate();to_month_obj.value=_search_dates_checkout.getMonth()+1;to_year_obj.value=_search_dates_checkout.getFullYear()}function updateNavFlexibleDates(){var to_set=document.getElementById("results_option_flexible_dates").value;if(!checkInAndCheckOutSet()){to_set="any"}document.getElementById("flexible_"+to_set).checked=true;enableNavDates()}function searchDateSelect(d,m,y,type){if(selectedDateIsValid(d,m,y,type)){searchDateHighlight(d,m,y,type);var _d=Date.UTC(y,m-1,d,0,0,0,0);_d/=1000;document.getElementById("search_dates_"+type).value=_d;if(checkInAndCheckOutSet()){selectOption("dates",true);updateNavFlexibleDates();updateNavDates();updateCurrentSelection()}else{if(type=="checkin"&&!checkOutSet()&&(display_com!=m||display_coy!=y)){setLoading("search_dates_checkout_calendar",true);panCalendar("checkout",m,y)}}}else{if(type=="checkin"){alert("Please ensure the check-in date is before the check-out date")}else{if(type=="checkout"){alert("Please ensure the check-out date is after the check-in date")}}}}function selectedDateIsValid(d,m,y,type){if(type=="checkin"){if(current_cod!=0&&current_com!=0&&current_coy!=0){if(current_coy>y||(current_coy==y&&current_com>m)||(current_coy==y&&current_com==m&&current_cod>d)){return true}else{return false}}else{return true}}else{if(type=="checkout"){if(current_cid!=0&&current_cim!=0&&current_ciy!=0){if(current_ciy<y||(current_ciy==y&&current_cim<m)||(current_ciy==y&&current_cim==m&&current_cid<d)){return true}else{return false}}else{return true}}}}function searchDateHighlight(d,m,y,type){var bgcolor_selected="/images/bgcolor_selected.png";var objName;var obj;if(type=="checkin"){if(current_cid!=0&&current_cim!=0&&current_ciy!=0){objName="search_"+type+"_date_"+current_cid+"_"+current_cim+"_"+current_ciy;obj=document.getElementById(objName);if(obj){obj.style.backgroundImage=""}}current_cid=d;current_cim=m;current_ciy=y}else{if(current_cod!=0&&current_com!=0&&current_coy!=0){objName="search_"+type+"_date_"+current_cod+"_"+current_com+"_"+current_coy;obj=document.getElementById(objName);if(obj){obj.style.backgroundImage=""}}current_cod=d;current_com=m;current_coy=y}objName="search_"+type+"_date_"+d+"_"+m+"_"+y;obj=document.getElementById(objName);obj.style.backgroundImage="url("+bgcolor_selected+")"}function populateMultiOptions(type){var current_value=","+document.getElementById("search_"+type).value;var selection=new Array();selection=current_value.split(",");for(var i=0;i<selection.length;i++){var val=selection[i];if(val!=null&&val!=""&&!isNaN(val)){var obj=type+"_cb_"+selection[i];document.getElementById(obj).checked=true}}}function populateRadioButton(type){var obj=document.getElementById("search_"+type);var inputs=document.getElementsByTagName("input");if(inputs){for(var i=0;i<inputs.length;i++){if(inputs[i].type=="radio"&&inputs[i].name==type+"_rb"){inputs[i].checked=inputs[i].value==obj.value}}}}function useOption(search_by,value){if(search_by=="country"){enableOption("region",true);enableOption("area",false);resetRegion();resetArea()}if(search_by=="region"){enableOption("area",true);resetArea()}document.getElementById("search_"+search_by).value=value;selectOption(search_by,true);resetSearchOptions();updateCurrentSelection()}function optionClickHandler(search_by,value,do_toggle){var obj=document.getElementById(search_by+"_cb_"+value);if(do_toggle){toggleCheckBox(obj)}if(obj.checked){useMultiOption(search_by,value)}else{removeSearchMultiOption(search_by,value)}}function toggleCheckBox(obj){obj.checked=!obj.checked}function setRadioButton(obj,value){obj.value=value}function toggleMapOption(option){var obj=document.getElementById("slideshow_button");var src=obj.src;if(option=="slideshow"){if(src.indexOf("pause")==-1){obj.src="/images/pause.gif";showOnMap()}else{obj.src="/images/play.gif";stopSlideShow()}}}function useMultiOption(search_by,value){var current_value=document.getElementById("search_"+search_by).value;if(current_value.indexOf(value+",")==-1){document.getElementById("search_"+search_by).value=current_value+value+",";selectOption(search_by,true);updateCurrentSelection()}}function removeSearchOption(search_by,value){if(search_by=="dates"){document.getElementById("search_dates_checkin").value="";document.getElementById("search_dates_checkout").value="";if(current_cid!=0&&current_cim!=0&&current_ciy!=0){objName="search_checkin_date_"+current_cid+"_"+current_cim+"_"+current_ciy;obj=document.getElementById(objName);if(obj){obj.style.backgroundImage=""}}if(current_cod!=0&&current_com!=0&&current_coy!=0){objName="search_checkout_date_"+current_cod+"_"+current_com+"_"+current_coy;obj=document.getElementById(objName);if(obj){obj.style.backgroundImage=""}}current_cid=0;current_cim=0;current_ciy=0;current_cod=0;current_com=0;current_coy=0;updateNavFlexibleDates()}else{document.getElementById("search_"+search_by).value="";if(search_by=="country"){document.getElementById("search_region").value="";document.getElementById("search_area").value="";enableOption("region",false);enableOption("area",false)}if(search_by=="region"){document.getElementById("search_area").value="";enableOption("area",false)}}resetSearchOptions();selectOption(search_by,false);updateCurrentSelection()}function removeSearchMultiOption(search_by,value){var objName=search_by+"_cb_"+value;var obj=document.getElementById(objName);if(obj){obj.checked=false}var current_value=","+document.getElementById("search_"+search_by).value;var new_value=current_value.replace(","+value+",",",");new_value=new_value.substring(1);document.getElementById("search_"+search_by).value=new_value;if(new_value==""){selectOption(search_by,false)}updateCurrentSelection()}function resetArea(){document.getElementById("search_area").value=""}function resetRegion(){document.getElementById("search_region").value=""}function resetSearchOptions(){if(current_selection!=""){document.getElementById("search_option_"+current_selection+"_div").style.borderBottom="1px solid #FFFFFF"}document.getElementById("set_search_option_div").innerHTML="&nbsp;";document.getElementById("set_search_option_div").style.borderLeft="1px solid #FFFFFF";current_selection=""}function populateArea(region){var search_option_content="";if(!isNaN(region)&&region>0){search_option_content=ajaxRequestAlt("/ajax/get_sub_menu.ajax.php?area_obj_name=area_rb&area_id="+region+"&format=radio",false)}else{search_option_content="please select a region before narrowing your search to a particular area"}return search_option_content}function populateRegion(country){var search_option_content="";if(!isNaN(country)&&country>0){search_option_content=ajaxRequestAlt("/ajax/get_sub_menu.ajax.php?area_obj_name=region_rb&area_id="+country+"&format=radio",false)}else{search_option_content="please select a country before narrowing your search to a particular region"}return search_option_content}function showSearchDatesResponse(){if(xmlHttp.readyState==4){rc=xmlHttp.responseText;var _arr=rc.split("|");if(_arr[0]=="checkin"){display_cim=_arr[1];display_ciy=_arr[2]}else{if(_arr[0]=="checkout"){display_com=_arr[1];display_coy=_arr[2]}}var div="search_dates_"+current_show_type+"_calendar_div";document.getElementById(div).innerHTML=_arr[3];setLoading("search_dates_"+current_show_type+"_calendar",false);if(show_type_both&&current_show_type=="checkin"){current_show_type=="checkout";show_type_both=false;showSearchDates("checkout")}populateSearchDates()}}function showSearchDatesRequest(url){xmlHttp=GetXmlHttpObject();if(xmlHttp!=null){xmlHttp.onreadystatechange=showSearchDatesResponse;xmlHttp.open("GET",url,true);xmlHttp.send(null)}}function setPage(page){setLoading("search_results",true);var obj=document.getElementById("search_page");obj.value=page;doSearch();var idx=this.location.href.indexOf("#");this.location.href=(idx==-1)?this.location.href+"#search":this.location.href.substring(0,idx)+"#search";window.location.href="#q="+getQ()}function doSearch(){if(g_no_add_to_history!=true){addHistoryEvent("#q="+getQ(),null)}else{g_no_add_to_history=false}setLoading("search_results",true);unloadMap();var vars=[];var qs="";vars[0]="region";vars[1]="area";vars[2]="property_type";vars[3]="bedrooms";vars[4]="sleeps";vars[5]="price";vars[6]="dates_checkin";vars[7]="dates_checkout";vars[8]="location_features";vars[9]="property_features";vars[10]="page";vars[11]="country";for(var i=0;i<vars.length;i++){qs+=vars[i]+"="+document.getElementById("search_"+vars[i]).value+"&"}vars=[];vars[0]="results_to_display";vars[1]="display_map";vars[2]="flexible_dates";vars[3]="sort_by";vars[4]="sort_type";for(var i=0;i<vars.length;i++){qs+=vars[i]+"="+document.getElementById("results_option_"+vars[i]).value+"&"}qs=qs.substring(0,qs.length-1);qs+="&shortlist_session="+server_shortlist_session;var url="/ajax/search_get_results.ajax.php?"+qs;doSearchRequest(url)}function doSearchResponse(){if(xmlHttp.readyState==4){rc=xmlHttp.responseText;var search_results_div=document.getElementById("search_results_div");var _div=document.createElement("div");_div.innerHTML=rc;search_results_div.innerHTML="";search_results_div.appendChild(_div);setLoading("search_results",false);if(document.getElementById("to_eval")){eval(document.getElementById("to_eval").innerHTML.substring(4))}if(document.getElementById("urchin_data_to_eval")){eval(document.getElementById("urchin_data_to_eval").innerHTML.substring(4))}}}function doSearchRequest(url){xmlHttp=GetXmlHttpObject();if(xmlHttp!=null){xmlHttp.onreadystatechange=doSearchResponse;xmlHttp.open("GET",url,true);xmlHttp.send(null)}}function base64_encode(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,enc="",tmp_arr=[];if(!data){return data}data=utf8_encode(data+"");do{o1=data.charCodeAt(i++);o2=data.charCodeAt(i++);o3=data.charCodeAt(i++);bits=o1<<16|o2<<8|o3;h1=bits>>18&63;h2=bits>>12&63;h3=bits>>6&63;h4=bits&63;tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4)}while(i<data.length);enc=tmp_arr.join("");switch(data.length%3){case 1:enc=enc.slice(0,-2)+"==";break;case 2:enc=enc.slice(0,-1)+"=";break}return enc}function utf8_encode(string){string=(string+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n");var utftext="";var start,end;var stringl=0;start=end=0;stringl=string.length;for(var n=0;n<stringl;n++){var c1=string.charCodeAt(n);var enc=null;if(c1<128){end++}else{if((c1>127)&&(c1<2048)){enc=String.fromCharCode((c1>>6)|192)+String.fromCharCode((c1&63)|128)}else{enc=String.fromCharCode((c1>>12)|224)+String.fromCharCode(((c1>>6)&63)|128)+String.fromCharCode((c1&63)|128)}}if(enc!=null){if(end>start){utftext+=string.substring(start,end)}utftext+=enc;start=end=n+1}}if(end>start){utftext+=string.substring(start,string.length)}return utftext}function base64_decode(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,dec="",tmp_arr=[];if(!data){return data}data+="";do{h1=b64.indexOf(data.charAt(i++));h2=b64.indexOf(data.charAt(i++));h3=b64.indexOf(data.charAt(i++));h4=b64.indexOf(data.charAt(i++));bits=h1<<18|h2<<12|h3<<6|h4;o1=bits>>16&255;o2=bits>>8&255;o3=bits&255;if(h3==64){tmp_arr[ac++]=String.fromCharCode(o1)}else{if(h4==64){tmp_arr[ac++]=String.fromCharCode(o1,o2)}else{tmp_arr[ac++]=String.fromCharCode(o1,o2,o3)}}}while(i<data.length);dec=tmp_arr.join("");dec=utf8_decode(dec);return dec}function utf8_decode(str_data){var tmp_arr=[],i=0,ac=0,c1=0,c2=0,c3=0;str_data+="";while(i<str_data.length){c1=str_data.charCodeAt(i);if(c1<128){tmp_arr[ac++]=String.fromCharCode(c1);i++}else{if((c1>191)&&(c1<224)){c2=str_data.charCodeAt(i+1);tmp_arr[ac++]=String.fromCharCode(((c1&31)<<6)|(c2&63));i+=2}else{c2=str_data.charCodeAt(i+1);c3=str_data.charCodeAt(i+2);tmp_arr[ac++]=String.fromCharCode(((c1&15)<<12)|((c2&63)<<6)|(c3&63));i+=3}}}return tmp_arr.join("")}function decodeQ(no_add_to_history,initial_load){var loc=this.location.href;var idx=loc.indexOf("#q=");if(idx!=-1){var q=loc.substring(idx+3);var decoded_q=base64_decode(q);var q_parts=decoded_q.split("_");var vars=[];vars[0]="country";vars[1]="region";vars[2]="area";vars[3]="dates_checkin";vars[4]="dates_checkout";vars[5]="price";vars[6]="property_type";vars[7]="bedrooms";vars[8]="sleeps";vars[9]="location_features";vars[10]="property_features";vars[11]="page";vars[12]="results_to_display";vars[13]="display_map";vars[14]="flexible_dates";vars[15]="sort_by";vars[16]="sort_type";for(var i=0;i<vars.length;i++){var prefix=(i<=11)?"search_":"results_option_";if(i==16){q_parts[16]=(q_parts[16]=="DESC")?"highest_to_lowest":"lowest_to_highest"}if(prefix=="search_"){document.getElementById(prefix+vars[i]).value=q_parts[i]}else{var objName="";var val_obj=document.getElementById("results_option_"+vars[i]);var current_value=val_obj.value;if(current_value){objName="results_option_"+vars[i]+"_"+current_value.replace(/ /g,"_");var current_obj=document.getElementById(objName);if(current_obj){current_obj.className="results_option"}}objName="results_option_"+vars[i]+"_"+q_parts[i].replace(/ /g,"_");var obj=document.getElementById(objName);if(obj){obj.className="results_option_selected"}if(val_obj){val_obj.value=q_parts[i]}if(vars[i]=="flexible_dates"){if(document.getElementById("search_flexible_dates")){document.getElementById("search_flexible_dates").checked=(q_parts[i]=="no")?false:true}}}if(vars[i]!="dates_checkin"&&vars[i]!="dates_checkout"){if(q_parts[i]!=""){selectOption(vars[i],true);if(vars[i]=="country"){enableOption("region",true)}else{if(vars[i]=="region"){enableOption("area",true)}}}else{if(document.getElementById("search_option_"+vars[i]+"_div").className!="search_option_disabled"){selectOption(vars[i],false)}if(vars[i]=="country"){enableOption("region",false)}else{if(vars[i]=="region"){enableOption("area",false)}}}}}if(q_parts[3]!=""&&q_parts[4]!=""){document.getElementById("search_dates_checkin").value=q_parts[3];document.getElementById("search_dates_checkout").value=q_parts[4];selectOption("dates",true)}else{document.getElementById("search_dates_checkin").value="";document.getElementById("search_dates_checkout").value="";selectOption("dates",false)}g_no_add_to_history=no_add_to_history;updateCurrentSelection(true)}else{if(initial_load!=true){var vars=[];vars[0]="country";vars[1]="region";vars[2]="area";vars[3]="dates_checkin";vars[4]="dates_checkout";vars[5]="price";vars[6]="property_type";vars[7]="bedrooms";vars[8]="sleeps";vars[9]="location_features";vars[10]="property_features";vars[11]="page";vars[12]="results_to_display";vars[13]="display_map";vars[14]="flexible_dates";vars[15]="sort_by";vars[16]="sort_type";for(var i=0;i<vars.length;i++){var prefix=(i<=11)?"search_":"results_option_";if(prefix=="search_"){if(vars[i]=="page"){document.getElementById(prefix+vars[i]).value="1"}else{document.getElementById(prefix+vars[i]).value="";if(vars[i]!="dates_checkin"&&vars[i]!="dates_checkout"){if(document.getElementById("search_option_"+vars[i]+"_div").className!="search_option_disabled"){selectOption(vars[i],false)}}else{if(document.getElementById("search_option_dates_div").className!="search_option_disabled"){selectOption("dates",false)}}if(vars[i]=="country"){enableOption("region",false)}else{if(vars[i]=="region"){enableOption("area",false)}}}}else{var val="";switch(vars[i]){case"results_to_display":val="20";break;case"display_map":val="no";break;case"flexible_dates":val="yes";break;case"sort_by":val="default";break;case"sort_type":val="highest_to_lowest";break}var _objName="";var _val_obj=document.getElementById("results_option_"+vars[i]);var _current_value=_val_obj.value;if(_current_value){_objName="results_option_"+vars[i]+"_"+_current_value.replace(/ /g,"_");var _current_obj=document.getElementById(_objName);if(_current_obj){_current_obj.className="results_option"}}_objName="results_option_"+vars[i]+"_"+val.replace(/ /g,"_");var _obj=document.getElementById(_objName);if(_obj){_obj.className="results_option_selected"}if(_val_obj){_val_obj.value=val}}}g_no_add_to_history=no_add_to_history;updateCurrentSelection(true)}else{if(document.getElementById("to_eval")){eval(document.getElementById("to_eval").innerHTML.substring(4))}if(document.getElementById("urchin_data_to_eval")){eval(document.getElementById("urchin_data_to_eval").innerHTML.substring(4))}}}}function getQ(){var qs="";var vars=[];vars[0]="country";vars[1]="region";vars[2]="area";vars[3]="dates_checkin";vars[4]="dates_checkout";vars[5]="price";vars[6]="property_type";vars[7]="bedrooms";vars[8]="sleeps";vars[9]="location_features";vars[10]="property_features";vars[11]="page";for(var i=0;i<vars.length;i++){var val=document.getElementById("search_"+vars[i]).value;qs+=val+"_"}vars=[];vars[0]="results_to_display";vars[1]="display_map";vars[2]="flexible_dates";vars[3]="sort_by";vars[4]="sort_type";for(var i=0;i<vars.length;i++){var val=document.getElementById("results_option_"+vars[i]).value;if(vars[i]=="sort_type"){switch(val){case"highest_to_lowest":val="DESC";break;case"lowest_to_highest":val="ASC";break;case"":val="ASC";break}}qs+=val+"_"}qs=qs.substring(0,qs.length-1);return base64_encode(qs)}function initAJAXHistory(){dhtmlHistory.initialize();dhtmlHistory.addListener(historyChange)}function addHistoryEvent(l,d){dhtmlHistory.add(l,d)}function updateCurrentSelection(no_reset_page){setLoading("current_selection",true);if(no_reset_page!=true){document.getElementById("search_page").value=1}var vars=[];var qs="";vars[0]="region";vars[1]="area";vars[2]="property_type";vars[3]="bedrooms";vars[4]="sleeps";vars[5]="price";vars[6]="dates_checkin";vars[7]="dates_checkout";vars[8]="location_features";vars[9]="property_features";vars[10]="country";vars[11]="page";for(var i=0;i<vars.length;i++){qs+=vars[i]+"="+document.getElementById("search_"+vars[i]).value+"&"}vars=[];vars[0]="results_to_display";vars[1]="display_map";vars[2]="flexible_dates";vars[3]="sort_by";vars[4]="sort_type";for(var i=0;i<vars.length;i++){qs+=vars[i]+"="+document.getElementById("results_option_"+vars[i]).value+"&"}qs=qs.substring(0,qs.length-1);var url="/ajax/search_get_current_selection_text.ajax.php?"+qs;updateCurrentSelectionRequest(url)}function updateCurrentSelectionResponse(){if(xmlHttp.readyState==4){rc=xmlHttp.responseText;var current_selection_div=document.getElementById("current_selection_div");current_selection_div.innerHTML=rc;setLoading("current_selection",false);doSearch()}}function setLoading(obj,loading){var div=document.getElementById(obj+"_div");var loading_div=document.getElementById(obj+"_loading_div");div.style.display=(loading)?"none":"";loading_div.style.display=(loading)?"":"none"}function updateCurrentSelectionRequest(url){xmlHttp=GetXmlHttpObject();if(xmlHttp!=null){xmlHttp.onreadystatechange=updateCurrentSelectionResponse;xmlHttp.open("GET",url,true);xmlHttp.send(null)}}function GetXmlHttpObject(){var xmlHttp;try{xmlHttp=new XMLHttpRequest()}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}}return xmlHttp}var map;var tooltip;var gmarkers=[];var marker_counter=0;var baseIcon=new GIcon();var map_geo_lat=0;var map_geo_lng=0;baseIcon.iconSize=new GSize(32,32);baseIcon.shadowSize=new GSize(56,32);baseIcon.iconAnchor=new GPoint(16,32);baseIcon.infoWindowAnchor=new GPoint(16,0);var propertyIcon=new GIcon(baseIcon,"http://maps.google.com/mapfiles/kml/pal5/icon12.png",null,"http://maps.google.com/mapfiles/kml/pal5/icon12s.png");function load(){if(GBrowserIsCompatible()){var loc;map=new GMap2(document.getElementById("map"));map.addControl(new GSmallMapControl());map.setCenter(new GLatLng(map_geo_lat,map_geo_lng),13);map.setMapType(G_HYBRID_MAP);tooltip=document.createElement("div");map.getPane(G_MAP_FLOAT_PANE).appendChild(tooltip);tooltip.style.visibility="hidden"}}function setMapGeoLatLng(lat,lng){map_geo_lat=lat;map_geo_lng=lng}function importanceOrder(marker,b){return GOverlay.getZIndex(marker.getPoint().lat())+marker.importance*1000000}function createMarker(pPoint,pName,pLink,pIcon,pStyling,pImportance){var marker=new GMarker(pPoint,{icon:pIcon,zIndexProcess:importanceOrder});marker.importance=pImportance;marker.tooltip='<div class="tooltip" style="'+pStyling+'">'+pName+"</div>";marker.url=pLink;gmarkers[marker_counter++]=marker;map.addOverlay(marker);GEvent.addListener(marker,"click",function(){window.location.href=marker.url});GEvent.addListener(marker,"mouseover",function(){var obj=document.getElementById("slideshow_button");if(obj){obj.src="/images/play.gif";stopSlideShow()}showTooltip(marker)});GEvent.addListener(marker,"mouseout",function(){tooltip.style.visibility="hidden"});return(marker_counter-1)}function showTooltip(marker){tooltip.innerHTML=marker.tooltip;var point=map.getCurrentMapType().getProjection().fromLatLngToPixel(map.fromDivPixelToLatLng(new GPoint(0,0),true),map.getZoom());var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),map.getZoom());var anchor=marker.getIcon().iconAnchor;var width=marker.getIcon().iconSize.width;var height=130;var pos=new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(offset.x-point.x-anchor.x+width,offset.y-point.y-anchor.y-height));pos.apply(tooltip);tooltip.style.visibility="visible"}function showOnMap(){startSlideShow(gmarkers)}var currentSlideShowList="";var currentSlideShowT="";var slideShowIntermission=4;function startSlideShow(item_list){currentSlideShowList=item_list;currentSlideShowT=setInterval("nextSlideShowItem();",slideShowIntermission*1000)}function resetMapVariables(){stopSlideShow();gmarkers=[];marker_counter=0;currentSlideShowList="";currentSlideShowT="";slideShowIntermission=4}function nextSlideShowItem(){var nextMarker=currentSlideShowList.shift();map.panTo(new GLatLng(nextMarker.getPoint().lat()+0.01,nextMarker.getPoint().lng()+0.02));showTooltip(nextMarker);currentSlideShowList.push(nextMarker)}function stopSlideShow(){if(currentSlideShowT){clearInterval(currentSlideShowT)}}function toggleShowSearch(){sToggleDiv("show_search_div");sToggleDiv("show_search_desc_div");sToggleImg("customise_img")}function sToggleDiv($WhichDiv){if(document.getElementById($WhichDiv).style.display=="none"){document.getElementById($WhichDiv).style.display="block"}else{document.getElementById($WhichDiv).style.display="none"}}function sToggleImg($WhichImg){if(document.getElementById($WhichImg).src.indexOf("_up_")==-1){document.getElementById($WhichImg).src="/images/shortlist_move_up_s.png"}else{document.getElementById($WhichImg).src="/images/shortlist_move_down_s.png"}};
