var destination = 'Destination'; var villa_not_found = 'Error: Villa not found'; var size = 'Size'; var name = 'Name'; var email = 'Email'; var nature_of_enquiry = 'Nature of Enquiry'; var country_of_interest = 'Country of Interest'; var enquiry = 'Enquiry'; var fields_are_required = 'The following fields are required'; var submit_again = 'Please re-enter and submit again!'; var please_select = 'Please Select'; var villa_added = 'Villa has been added to your Quote List'; var authorization_code = 'Authorization Code'; var firstImageToLoad = null; function PortfolioTextNameOnfocus(){ document.getElementById("port").style.color= '#000000'; document.getElementById("port").value=""; } function alltrim(str) { return str.replace(/^\s+|\s+$/g, ''); } function checkPortfolio() { missinginfo = ""; if (alltrim(document.getElementById("port").value) == "" ) { alert("A valid name must be specified."); return false; } if (document.getElementById("port").value == "Type name here" ) { alert("A name must be specified."); return false; } if (document.getElementById("port").value != "Type name here" || document.getElementById("port").value != ""){ for(x=0; x< portfolios.length; x++){ temp = portfolios[x].split("|"); if(document.getElementById("port").value==temp[1]){ alert("Please assign a different name. '"+document.getElementById("port").value+"' already exists.") return false; } } } else return true; } function PortfolioTextNameOnblur(){ if(document.getElementById("port").value==""){ document.getElementById("port").style.color= '#999999'; document.getElementById("port").value="Type name here"; } if(document.getElementById("port").value=="Type name here"){ document.getElementById("port").style.color= '#999999'; } } function disabledRemove(count){ for(a=1;a<=count;a++){ document.getElementById("remove_disabled"+a).style.display="none"; } } function hideNewPortfolio(ch){ if(ch==1){ document.getElementById("new_portfolio").style.display="none"; }else{ PortfolioTextNameOnblur(); document.getElementById("new_portfolio").style.display=""; } } ///ajax start ////////////// /// for left hand site start /////////////// function showHint(value,ch,f,msg){ xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="/customer/search/show/"+value+"/"+msg; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); if(ch==1){ if(value!=0){ v="v_"+value document.getElementById(v).innerHTML=villa_added; setTimeout('showRigthResult(' + value + ','+ f +')', 300); } } } function changePortfolio(value){ if(value!='-1'){ window.location.href="/customer/search/portfolio/"+value; // showHint(value); } } function removeHint(value,count) { var run = false; if(document.getElementById('back_from_server_2') == null){ run = true; } else if(document.getElementById('back_from_server_2').value == 'true'){ run = true; } if(run){ xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="/customer/search/remove/"+value; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); for (a=1;a<=count;a++){ document.getElementById("remove"+a).style.display="none"; document.getElementById("remove_disabled"+a).style.display=""; } showHintRight(value,count); } else{ setTimeout('removeHint(' + value + ')', 200); } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } function stateChanged() { if (xmlHttp.readyState==4) { document.getElementById("txtHint").innerHTML=xmlHttp.responseText; } } /// for left hand site end /////////////// /// for right hand side start////////// function showHintRight(value,count) { if(document.getElementById('back_from_server_1') != null){ if(document.getElementById('back_from_server_1').value != 'false'){ xmlHttp=GetXmlHttpObject1() if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="/customer/search/showRigthVilla/"+value; xmlHttp.onreadystatechange=stateChanged1; xmlHttp.open("GET",url,true); xmlHttp.send(null); for(a=1;a<=count;a++){ document.getElementById("remove"+a).style.display=""; document.getElementById("remove_disabled"+a).style.display="none"; } document.getElementById('back_from_server_1').value = 'false'; if(document.getElementById('back_from_server_2') != null){ document.getElementById('back_from_server_2').value == 'false'; } } else{ setTimeout('showHintRight(' + value + ')', 200); } } else{ setTimeout('showHintRight(' + value + ')', 200); } } function GetXmlHttpObject1() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } function stateChanged1() { if (xmlHttp.readyState==4) { document.getElementById("test").innerHTML=xmlHttp.responseText; } } function showRigthResult(value,f){ xmlHttp2=GetXmlHttpObject2() if (xmlHttp2==null) { alert ("Your browser does not support AJAX!"); return; } //if(value!=0){ var url="/customer/search/showRigthResult/"+value+"/"+f; //} xmlHttp2.onreadystatechange=stateChanged2; xmlHttp2.open("GET",url,true); xmlHttp2.send(null); } function GetXmlHttpObject2() { var xmlHttp2=null; try { // Firefox, Opera 8.0+, Safari xmlHttp2=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp2; } function stateChanged2() { if (xmlHttp2.readyState==4) { //alert(xmlHttp2.responseText) document.getElementById("res1").innerHTML=xmlHttp2.responseText; } } /// for right hand sit end //////////// ///ajax end ////////// function registration(type,val){ if(rentalPurchaseValue == type){ if(type=="Rent"){ document.getElementById("weekly_budget_rent").style.display="" document.getElementById("weekly_budget_acquisition").style.display="none" }else{ document.getElementById("weekly_budget_rent").style.display="none" document.getElementById("weekly_budget_acquisition").style.display="" } return; } if(val==1){ if(type=="Rent"){ msg ="Select Villa-Hotel?" }else{ msg ="Select Property Purchase?" } if(confirm(msg)){ rentalPurchaseValue = type; if(type=="Rent"){ document.getElementById("weekly_budget_rent").style.display="" document.getElementById("weekly_budget_acquisition").style.display="none" document.getElementById("length_of_stay").disabled=false document.getElementById("dates").disabled=false }else{ document.getElementById("weekly_budget_rent").style.display="none" document.getElementById("weekly_budget_acquisition").style.display="" document.getElementById("length_of_stay").disabled=true document.getElementById("dates").disabled=true } }else{ if(type=="Rent"){ document.getElementById("rent").checked=false document.getElementById("purchase").checked=true }else{ document.getElementById("rent").checked=true document.getElementById("purchase").checked=false } } }else{ // for onload page if(type=="Rent"){ document.getElementById("weekly_budget_rent").style.display="" document.getElementById("weekly_budget_acquisition").style.display="none" }else{ document.getElementById("weekly_budget_rent").style.display="none" document.getElementById("weekly_budget_acquisition").style.display="" } } } function adjustSlideShowMeter(){ count=SLIDES.timeout; if(count==10000){ count=2 width=4 }else if(count==9000){ count=3 width=8 }else if(count==8000){ count=4 width=12 }else if(count==7000){ count=5 width=16 }else if(count==6000){ count=6 width=20 }else if(count==5000){ count=7 width=24 }else if(count==4000){ count=8 width=28 }else if(count==3000){ count=9 width=32 }else if(count==2000){ count=10 width=36 } str=""; for(a=1; a<=count; a+=1){ //str+="-
"; } document.getElementById("img_meter").width=width } function increaseSlideShowSpeed(){ if(SLIDES.timeout > 2000){ SLIDES.timeout = SLIDES.timeout - 1000; } adjustSlideShowMeter(); } function decreaseSlideShowSpeed(){ if(SLIDES.timeout < 10000){ SLIDES.timeout = SLIDES.timeout + 1000; } adjustSlideShowMeter(); } function switchSearch(){ document.getElementById("villa_code").value="VIP-"; document.getElementById("keyword").value=""; } function switchDDVillacode(){ document.getElementById("villa_code").value="VIP-"; document.getElementById("bedrooms_ad").value="-2"; document.getElementById("area_code1").value="-1"; document.getElementById("country").value="-1"; document.getElementById("budget").value="-1"; document.getElementById("tennis").checked=false; document.getElementById("heat").checked=false; } function switchDDkeyword(){ document.getElementById("keyword").value=""; document.getElementById("bedrooms_ad").value="-2"; document.getElementById("area_code").value="-1"; document.getElementById("country").value="-1"; document.getElementById("budget").value="-1"; document.getElementById("tennis").checked=false; document.getElementById("heat").checked=false; } function fillPorts(selectedChoice,selectarea,select){ if(selectedChoice!="-1") {switchSearch() } if(selectedChoice==9){ document.getElementById("budget").disabled=true document.getElementById("bedrooms_ad").disabled=true }else{ document.getElementById("budget").disabled=false document.getElementById("bedrooms_ad").disabled=false } // for area start area = document.getElementById('area_code1'); area.options.length = 0; area.options[0] = new Option("----"+please_select+"----", "-1"); var filled=0; if(selectedChoice=='PEV'){ for(x=0; x