var cal1,cal1Exists,cal1Shown;
var cal2,cal2Exists,cal2Shown;
cal1Exists=false;
cal2Exists=false;
cal1Shown=false;
cal2Shown=false;
var dt=new Date();
var cur_year=dt.getYear();
if(cur_year<1000){cur_year=cur_year+1900
}var min_holdate=(dt.getMonth()+1)+"/"+(dt.getDate()+1)+"/"+cur_year;
var max_holdate=(dt.getMonth()+1)+"/"+(dt.getDate()+1)+"/"+(cur_year+2);
function calHide(){if(cal1Exists){cal1.hide();
cal1Shown=false
}if(cal2Exists){cal2.hide();
cal2Shown=false
}}function changeSelect(b,d){var c=false;
for(var a=0;
a<b.options.length;
a++){if(b.options[a].value==d){b.selectedIndex=a;
c=true;
break
}}return c
}function updateBoxes(d,c){var a=c[0]+"-";
if(c[1]<10){a=a+"0"+c[1]
}else{a=a+c[1]
}var b=document.getElementById(d+"_dt2");
changeSelect(b,a);
b=document.getElementById(d+"_dt1");
changeSelect(b,c[2])
}function getCalData(e){var d=document.getElementById(e+"_dt1");
var c=document.getElementById(e+"_dt2");
var b=c.options[c.selectedIndex].value.split("-");
var a=[];
a[0]=b[1]+"/"+d.options[d.selectedIndex].value+"/"+b[0];
a[1]=b[1]+"/"+b[0];
return a
}function setCalDate(a,b){var c=getCalData(a);
b.select(c[0]);
b.cfg.setProperty("pagedate",c[1]);
b.render()
}function updateDepart(){var a=document.getElementById("arrive_dt1");
var h=document.getElementById("arrive_dt2");
var e=a.options[a.selectedIndex].value;
var d=h.options[h.selectedIndex].value;
var c=document.getElementById("depart_dt1");
var b=document.getElementById("depart_dt2");
var g=c.options[c.selectedIndex].value;
var f=b.options[b.selectedIndex].value;
if(d>f){changeSelect(b,d);
changeSelect(c,e)
}if((d=f)&&(e>g)){changeSelect(c,e)
}}function handleArriveClick(){if(cal1Shown){cal1.hide();
cal1Shown=false
}else{showArriveCal();
cal1Shown=true
}}function handleDepartClick(){if(cal2Shown){cal2.hide();
cal2Shown=false
}else{showDepartCal();
cal2Shown=true
}}var arriveSelected=function(c,b,e){var d=b[0];
var a=d[0];
updateBoxes("arrive",a);
updateDepart();
cal1.hide();
cal1Shown=false
};
var departSelected=function(c,b,e){var d=b[0];
var a=d[0];
updateBoxes("depart",a);
cal2.hide();
cal2Shown=false
};
function showArriveCal(){calHide();
if(cal1Exists){setCalDate("arrive",cal1);
cal1.show()
}else{var a=getCalData("arrive");
cal1=new YAHOO.widget.Calendar("cal1","cal1Container",{mindate:min_holdate,maxdate:max_holdate,title:"Choose a date:",selected:a[0],pagedate:a[1]});
cal1.selectEvent.subscribe(arriveSelected);
cal1.render();
cal1Exists=true
}}function showDepartCal(){calHide();
if(cal2Exists){setCalDate("depart",cal2);
cal2.show()
}else{var a=getCalData("depart");
cal2=new YAHOO.widget.Calendar("cal2","cal2Container",{mindate:min_holdate,maxdate:max_holdate,title:"Choose a date:",selected:a[0],pagedate:a[1]});
cal2.selectEvent.subscribe(departSelected);
cal2.render();
cal2Exists=true
}}function fnCallbackClick(b){var c=YAHOO.util.Event.getTarget(b);
var a=true;
while(c.nodeName.toUpperCase()!="BODY"){if((YAHOO.util.Dom.hasClass(c,"se_calcon"))||(c.className=="cal_icon")){a=false;
break
}else{c=c.parentNode
}}if(a){calHide()
}}var selected_lid;
var map_buff;
var map_buff_off;
var selected_region;
var bb_left;
var bb_top;
var bb_size;
var bb_lid;
reset_globals();
var request_id=0;
var cm_name="clickmap0";
window.onload=start_engine;
function reset_globals(){selected_lid=0;
map_buff=0;
map_buff_off=1;
selected_region=0;
bb_left=0;
bb_top=0;
bb_size=0;
bb_lid=0
}function start_engine(){YAHOO.util.Event.addListener(document.body,"click",fnCallbackClick);
if(document.getElementById(cm_name)){var f=document.getElementById(cm_name);
var e=null;
var d=undefined;
for(var b=f.childNodes.length-2;
b>=0;
b--){e=f.childNodes[b];
if(e.getAttribute("hl_bl")){d=e.getAttribute("hl_bl")
}if(e.getAttribute("hl_select")){selected_lid=parseInt(e.getAttribute("hl_select"))
}}if(d!=undefined){document.getElementById("map_base"+map_buff_off).src="maps/"+d+".gif"
}}var a=window.location.href.split("#");
if(a[1]!=null){document.getElementById("load_anim").style.display="block";
var g=a[1].split("=");
var c=document.getElementById(g[0]);
c.disabled=false;
c.options[c.options.length]=new Option("Please wait...",g[1]);
c.options.selectedIndex=c.options.length-1;
document.myform.action="search_easy.asp";
document.myform.submit()
}}function getCursorPosition(c){c=c||window.event;
var d={x:0,y:0};
if(c.pageX||c.pageY){d.x=c.pageX;
d.y=c.pageY
}else{var f=document.documentElement;
var a=document.body;
d.x=c.clientX+(f.scrollLeft||a.scrollLeft)-(f.clientLeft||0);
d.y=c.clientY+(f.scrollTop||a.scrollTop)-(f.clientTop||0)
}return d
}function show_tip(c){var b=document.getElementById("map_title");
var d=getCursorPosition(c);
var a=d.x;
var e=d.y;
if((a>0)&&(e>0)){b.style.top=(e+15)+"px";
b.style.left=(a+15)+"px"
}}function create_tip(b){var a=document.getElementById("map_title");
a.style.display="block";
a.innerHTML=document.getElementById("cl_"+b).getAttribute("hltitle")
}function destroy_tip(){var a=document.getElementById("map_title");
a.style.display="none";
a.innerHTML=""
}function showlayer(a){var b=document.getElementById("im_"+a);
b.style.visibility="visible";
create_tip(a)
}function hidelayer(a){if(a!=selected_lid){var b=document.getElementById("im_"+a);
b.style.visibility="hidden"
}destroy_tip()
}function fix_layer(c){if(selected_lid!=0){if(document.getElementById("im_"+selected_lid)){var b=document.getElementById("im_"+selected_lid);
b.style.visibility="hidden"
}}var a=document.getElementById("im_"+c);
a.style.visibility="visible";
selected_lid=c
}function start_anim(d,e){if(document.getElementById("cl_"+e)){var b=document.getElementById("cl_"+e);
bb_lid=parseInt(b.getAttribute("hl_bl"));
bb_left=parseInt(b.getAttribute("hl_bx"));
bb_top=parseInt(b.getAttribute("hl_by"));
bb_size=parseInt(b.getAttribute("hl_bs"));
var a=b.getAttribute("hlmap");
if(a=="1"){start_zoom(e,b.getAttribute("hlx"),b.getAttribute("hly"),b.getAttribute("hlscale"))
}else{if(a=="2"){load_new_map(e,d)
}else{if(a=="3"){start_pan(e,b.getAttribute("hlx"),b.getAttribute("hly"),b.getAttribute("hlscale"))
}else{if(a=="4"){var c=selected_lid;
selected_lid=e;
hidelayer(c)
}else{if(a=="5"){zoom_out(e,b.getAttribute("hlx"),b.getAttribute("hly"),b.getAttribute("hlscale"))
}else{fix_layer(e)
}}}}}}else{if(document.getElementById(cm_name)){load_new_map(e,d)
}else{if(d=="country"){load_new_map(e,d)
}else{}}}store_history(d,e)
}function change_box(a){request_id++;
var c=document.getElementById("loc_"+a);
var b=c.options[c.selectedIndex].value;
c=document.getElementById("loc_suburb");
c.value="";
if((b=="17")&&(a=="region")){changeloc("country",b)
}if((b=="11")&&(a=="region")){changeloc("country",b)
}if((b=="42")&&(a=="region")){changeloc("country",b)
}if((b=="any")&&(a=="town")){a="subregion";
c=document.getElementById("loc_"+a);
b=c.options[c.selectedIndex].value
}if((b=="any")&&(a=="subregion")){a="region";
c=document.getElementById("loc_"+a);
b=c.options[c.selectedIndex].value
}if((b=="any")&&(a=="region")){a="country";
c=document.getElementById("loc_"+a);
b=c.options[c.selectedIndex].value
}if((b=="--please select--")&&(a=="country")){clear_children(a)
}else{update_children(a,b)
}if(a=="town"){store_history(a,b)
}else{start_anim(a,b)
}}function changeloc(a,c){request_id++;
if((c==selected_lid)&&(document.getElementById(cm_name))){}else{var k="0";
if(document.getElementById("cl_"+c)){var h=document.getElementById("cl_"+c);
if(h.getAttribute("hlparent")){k=h.getAttribute("hlparent")
}}var f=a;
var d=c;
if(k!="0"){a="country";
d=k;
selected_region=c
}var e=document.getElementById("loc_"+a);
var g=false;
for(var b=0;
b<e.options.length;
b++){if(e.options[b].value==d){e.selectedIndex=b;
g=true;
break
}}update_children(a,d,c);
start_anim(f,c)
}}function update_children(a,e,b){clear_children(a);
var d="sr_ajax.asp?action=children&parent="+e+"&ms="+new Date().getTime()+"&req="+request_id;
if(b!=undefined){d=d+"&crumbstart="+b
}var c=YAHOO.util.Connect.asyncRequest("GET",d,{success:handle_child_data,failure:show_error})
}function clear_map(){var b=document.getElementById(cm_name);
for(var a=b.childNodes.length-1;
a>=0;
a--){b.removeChild(b.childNodes[a])
}b=document.getElementById("highlights");
for(var a=b.childNodes.length-1;
a>=0;
a--){b.removeChild(b.childNodes[a])
}}function pre_anim(d){var a=document.getElementById("map_title");
a.style.display="none";
a.innerHTML="";
document.getElementById("townsoverlay").style.display="none";
document.getElementById("highlights").style.display="none";
document.getElementById("too").src="maps/"+d+"-towns.gif";
document.getElementById("map_base"+map_buff_off).src="maps/"+d+".gif";
clear_map();
var c="sr_ajax.asp?action=highclick&parent="+d+"&ms="+new Date().getTime()+"&req="+request_id;
var b=YAHOO.util.Connect.asyncRequest("GET",c,{success:repop_map,failure:show_error})
}function start_zoom(d,c,b,a){pre_anim(d);
zoom_anim.element="map_base"+map_buff;
zoom_anim.start_zoom(c,b,200-c,200-b,a,"swap_map();",-7,0);
selected_lid=d
}function start_pan(e,d,c,a){var b=document.getElementById("map_base"+map_buff_off);
b.src="maps/"+bb_lid+".gif";
b.style.width=bb_size+"px";
b.style.height=bb_size+"px";
b.style.left=bb_left+"px";
b.style.top=bb_top+"px";
swap_map(false);
pre_anim(e);
zoom_anim.element="map_base"+map_buff;
zoom_anim.start_zoom(d,c,((-bb_left-d)+200),((-bb_top-c)+200),a,"swap_map();",bb_left,bb_top);
selected_lid=e
}function zoom_out(e,d,c,a){var b=document.getElementById("map_base"+map_buff_off);
b.src="maps/"+bb_lid+".gif";
b.style.width=bb_size+"px";
b.style.height=bb_size+"px";
b.style.left=bb_left+"px";
b.style.top=bb_top+"px";
swap_map(false);
pre_anim(e);
zoom_anim.element="map_base"+map_buff;
zoom_anim.start_zoom(-bb_left+200,-bb_top+200,d,c,a,"swap_map()",bb_left,bb_top);
selected_lid=0
}function load_new_map(d,a){document.getElementById("townsoverlay").style.display="none";
document.getElementById("highlights").style.display="none";
document.getElementById("load_anim").style.display="block";
document.getElementById("map_base"+map_buff).style.opacity="0.5";
document.getElementById("map_base"+map_buff).style.filter="Alpha(opacity=50)";
reset_globals();
selected_lid=d;
var c="sr_ajax.asp?action=newmap&lid="+d+"&level="+a+"&ms="+new Date().getTime()+"&req="+request_id;
var b=YAHOO.util.Connect.asyncRequest("GET",c,{success:reset_map,failure:show_error})
}function reset_map(b){var a=b.responseText;
a=valid_request(a);
if(a==null){return false
}document.getElementById("load_anim").style.display="none";
document.getElementById("map_title").style.display="none";
document.getElementById("htmlmap").innerHTML=a;
document.getElementById("too").useMap="#clickmap"+request_id;
cm_name="clickmap"+request_id
}function swap_map(b){var a=document.getElementById("map_base"+map_buff_off);
if((b==undefined)||(b)){a.style.left="";
a.style.top="";
a.style.width="";
a.style.height=""
}a.style.visibility="visible";
a=document.getElementById("map_base"+map_buff);
a.style.visibility="hidden";
a.style.left="";
a.style.top="";
a.style.width="";
a.style.height="";
if(map_buff==0){map_buff=1;
map_buff_off=0
}else{map_buff=0;
map_buff_off=1
}document.getElementById("townsoverlay").style.display="";
document.getElementById("highlights").style.display="";
document.getElementById("load_anim").style.display="none"
}function clear_children(a){var b=null;
switch(a){case"country":b=document.getElementById("loc_region");
b.selectedIndex=0;
b.disabled="disabled";
case"region":b=document.getElementById("loc_subregion");
b.selectedIndex=0;
b.disabled="disabled";
b.style.display="none";
case"subregion":b=document.getElementById("loc_town");
b.selectedIndex=0;
b.disabled="disabled"
}sb=document.getElementById("loc_suburb");
sb.value=""
}function show_error(c){var a=c.status;
if(a==-1){}else{var b=document.getElementById("map_crumbs");
b.style.backgroundColor="#cc0000";
b.innerHTML="Communication error with holidaylettings.co.uk - please try your search again."
}}function valid_request(a){var c=a.split("|||");
if(parseInt(c[0])==request_id){var b=c[1]
}else{var b=null
}return b
}function handle_child_data(g){var e="";
var a="";
var h="";
var c="";
var d=g.responseText;
d=valid_request(d);
if(d==null){return false
}updates=d.split("|");
for(i in updates){if(i%3==0){e=updates[i]
}else{if(i%3==1){a=updates[i]
}else{h=updates[i];
switch(e){case"tg_data":if(a!="n"&&a!=""){c=a
}break;
case"select":repop_boxes(a,h);
break;
case"crumbs":var b=document.getElementById("map_crumbs");
if(c!=""&&a.charAt(1)=="s"){var b=document.getElementById("map_crumbs");
b.innerHTML="<span style='float:right;'><a id='map_tg' style='text-decoration:none;color:#ffffff;' href='travel_guide/to."+c+"/'>Travel Guide to "+c+"</a></span>"+a;
c=0
}else{b.innerHTML=a
}break;
case"bb_data":var f=h.split("*");
if(parseInt(f[0])!=0){bb_lid=parseInt(f[0]);
bb_size=parseInt(f[1]);
bb_left=parseInt(f[2]);
bb_top=parseInt(f[3])
}else{bb_lid=0;
bb_size=0;
bb_left=0;
bb_top=0
}break
}}}}}function repop_boxes(e,b){var a="";
var c="";
var d=0;
c=b.split("*");
a=document.getElementById("loc_"+e);
a.disabled="";
a.style.display="block";
a.options.length=1;
for(j in c){if(j%2==0){d=c[j]
}else{a.options[a.options.length]=new Option(c[j],d);
if(d==selected_region){a.options.selectedIndex=a.options.length-1;
selected_region=""
}}}}function repop_map(e){var b=e.responseText;
b=valid_request(b);
if(b==null){return false
}var d=b.split("|");
document.getElementById("highlights").innerHTML=d[0];
var c=document.getElementById(cm_name).parentNode;
c.removeChild(document.getElementById(cm_name));
var a=document.createElement("map");
cm_name="clickmap"+request_id;
a.setAttribute("id",cm_name);
a.setAttribute("name",cm_name);
c.appendChild(a);
document.getElementById(cm_name).innerHTML=d[1];
document.getElementById("too").useMap="#"+cm_name
}function store_history(b,c){var a=window.location.href.split("#");
window.location.href=a[0]+"#loc_"+b+"="+c
};