
function SubmitForm(){var key_words=document.search_form.searchterm.value;key_words=key_words.replace(/ /g," +");document.search_form.action="/search_results.html?keywords="+key_words;document.search_form.submit();}
function initializeWeather(){for(var count=2;count<=6;count++){var countstr=String(count);tempTemperature=document.getElementById("high"+countstr).innerHTML;highCelsiusValue.push(tempTemperature);highFahrenheitValue.push(Math.round((212-32)/100*tempTemperature+32));tempTemperature=document.getElementById("low"+countstr).innerHTML;lowCelsiusValue.push(tempTemperature);lowFahrenheitValue.push(Math.round((212-32)/100*tempTemperature+32));}}
function toggleWeather(toggleText){var od=document.getElementById('otherDays').style.display;if(od=='none'){$('#otherDays').slideDown('normal');$("#seeFiveDayForecast").html(toggleText);height=$('#layoutRight').height();$('#layoutRight').height(height+370);}
else{$('#otherDays').slideUp('normal');$("#seeFiveDayForecast").html(toggleText);height=$('#layoutRight').height();$('#layoutRight').height(height-370);}}
function fahrenheit(){try{document.getElementById("temperature_matrix").innerHTML="<a href='javascript:celsius();'><sup>o</sup>C</a> or <sup>o</sup>F"
for(var count=2;count<=6;count++){var countstr=String(count);document.getElementById("high"+countstr).innerHTML=highFahrenheitValue[count-2]+"<sup>o</sup>F";document.getElementById("low"+countstr).innerHTML=lowFahrenheitValue[count-2]+"<sup>o</sup>F";}}
catch(e){}
$("#temperature_matrix a").css("visibility","visible");}
function celsius(){try{document.getElementById("temperature_matrix").innerHTML="<sup>o</sup>C or <a href='javascript:fahrenheit();'><sup>o</sup>F</a>"
for(var count=2;count<=6;count++){var countstr=String(count);document.getElementById("high"+countstr).innerHTML=highCelsiusValue[count-2]+"<sup>o</sup>C";document.getElementById("low"+countstr).innerHTML=lowCelsiusValue[count-2]+"<sup>o</sup>C";}}
catch(e){}
$("#temperature_matrix a").css("visibility","visible");}
function updateDMY()
{dayPiece=document.getElementById("dayDisplay");dayPiece.innerHTML=clockDay+" "+month[clockMonth]+" "+clockYear;dateToday=clockMonth+"/"+clockDay+"/"+clockYear;dateToday2=clockMonth+"/"+[clockDay+1]+"/"+clockYear;}
function updateClock()
{var AmPm="";var smallHour=0;var strHour="";var strMinute="";var strSecond="";timePiece=document.getElementById("timeDisplay");clockSecond++;if(clockSecond==60)
{clockSecond=0;clockMinute++;}
if(clockMinute>=60)
{clockMinute=0;clockHour++;}
if(clockHour>=24)
{clockHour=0;clockDay++;}
if(clockHour>=12)
{if(clockHour!=12)
smallHour=clockHour-12;else
smallHour=clockHour;AmPm=PM;}
else
{smallHour=clockHour;AmPm=AM;}
if(clockHour==0)
smallHour=12;if(clockSecond<10)
strSecond="0"+clockSecond;else
strSecond=clockSecond;if(clockMinute<10)
strMinute="0"+clockMinute;else
strMinute=clockMinute;if(smallHour<10)
strHour="0"+smallHour;else
strHour=smallHour;timePiece.innerHTML=strHour+":"+strMinute+" "+AmPm;setTimeout("updateClock()",1000);}
function writeClock(){$('#timeLine').html(clockCountry+' <br /> '+clockTimeLabel+': <span id="timeDisplay"></span> <span id="dayDisplay"></span>')}
function findCity(prop){var city="";for(var i=0;i<promoMatrix.length;i++){if(promoMatrix[i][2]==prop){city=promoMatrix[i][0];break;}}
return city;}
function findProperty(offer){var prop="";for(var i=0;i<promoMatrix.length;i++){if(promoMatrix[i][4]==offer){prop=promoMatrix[i][2];break;}}
return prop;}
function updateDDLarrays(){$(b2).empty().append(c2);$(b3).empty().append(c3);for(x in d2){$(b2).append('<option value="'+x+'">'+d2[x]+'</option>');}
for(x in d3){$(b3).append('<option value="'+x+'">'+d3[x]+'</option>');}
$(b2).css('width','190px');$(b3).css('width','190px');}
function generateDDLarrays(DDLobj){var DDLid=$(DDLobj).attr('id');d1=[];d2=[];d3=[];function updateFromb1(){var ddlval=$(b1).val();for(var i=0;i<promoMatrix.length;i++){if((promoMatrix[i][0]==ddlval||ddlval==0)&&!d2[promoMatrix[i][2]])d2[parseInt(promoMatrix[i][2])]=promoMatrix[i][3];if((promoMatrix[i][0]==ddlval||ddlval==0)&&!d3[promoMatrix[i][4]])d3[parseInt(promoMatrix[i][4])]=promoMatrix[i][5];}
updateDDLarrays();}
function updateFromb2(){var ddlval=$(b2).val();var b3Sel=$(b3).val();var cityID=findCity(ddlval);for(var i=0;i<promoMatrix.length;i++){if((promoMatrix[i][0]==cityID||ddlval==0)&&!d2[promoMatrix[i][2]])d2[parseInt(promoMatrix[i][2])]=promoMatrix[i][3];if((promoMatrix[i][2]==ddlval||ddlval==0)&&!d3[promoMatrix[i][4]])d3[parseInt(promoMatrix[i][4])]=promoMatrix[i][5];}
updateDDLarrays();if(ddlval==0){$(b1+" > option").eq(0).attr('selected',true);$(b2+" > option").eq(0).attr('selected',true);}
else{$(b1+" > option[value*="+cityID+"]").attr('selected',true);$(b2+" > option[value*="+ddlval+"]").attr('selected',true);$(b3+" > option[value*="+b3Sel+"]").attr('selected',true);}}
function updateFromb3(){var b1Sel=$(b1).val();var b2Sel=$(b2).val();var ddlval=$(b3).val();var propID=findProperty(ddlval);var cityID=findCity(propID);var cntr=0;for(var i=0;i<promoMatrix.length;i++){if((promoMatrix[i][0]==b1Sel||b1Sel==0)&&(promoMatrix[i][4]==ddlval||ddlval==0)&&!d2[promoMatrix[i][2]])d2[parseInt(promoMatrix[i][2])]=promoMatrix[i][3];}
for(x in d2){for(var i=0;i<promoMatrix.length;i++){if((promoMatrix[i][2]==b2Sel||b2Sel==0)&&promoMatrix[i][2]==x&&!d3[promoMatrix[i][4]])d3[parseInt(promoMatrix[i][4])]=promoMatrix[i][5];}}
updateDDLarrays();if(b2Sel==0){$(b3).html(a3).css('width','190px');$(b2+" > option").eq(0).attr('selected',true);}
else{$(b2+" > option[value*="+b2Sel+"]").attr('selected',true);}
if(ddlval!=0)$(b3+" > option[value*="+ddlval+"]").attr('selected',true);}
if("#"+DDLid==b1)updateFromb1();if("#"+DDLid==b2)updateFromb2();if("#"+DDLid==b3)updateFromb3();}
function showImage(src,clickFlag){var largeImage=new Image();$(largeImage).bind('load',function(){$(this).hide().addClass('homegalleryPic').attr('alt',$("#galleria img").eq(c).attr("alt")).attr('title',$("#galleria img").eq(c).attr("alt"));$("#imageViewer").append(this);$(this).fadeIn(FADE_SPEED,function(){var t1=$("#galleria span.title").eq(c).text();var t2=$("#galleria span.body").eq(c).text();var t3=$("#galleria span.linkTitle").eq(c).text();var t4=$("#galleria span.linkTitleMain").eq(c).text();var appendHTML='<div id="detailContainer">';appendHTML+='<div id="headline">'+t1+'</div>';appendHTML+='<div id="para">'+t2+'</div>';if(t4!=''){appendHTML+='<div id="link"><a href="'+t3+'" title="'+t4+'">'+t4+'</a></div>';}
appendHTML+='</div>'
$("#imageViewer").append(appendHTML);if($("#imageViewer img").length>1){$("#imageViewer img:first").remove();$("#detailContainer:first").remove();}
$("#detailContainer").hide();$("#detailContainer").fadeIn(500);if(e-1>c){c++;timer=setTimeout('showImage($("#galleria img:eq('+c+')"),0)',TRANSITION_SPEED);}
else{c=0;timer=setTimeout('showImage($("#galleria img:first"),0)',TRANSITION_SPEED);}});});var c=$("#galleria img").index(src);$(largeImage).attr("src",src.attr("src"));}
function toggleMap(){$("#listHotelView").html('<a href="javascript:toggleList();">List view</a>');$("#listHotelView").removeClass('listMapActive');$("#listMapView").addClass('listMapActive');$("#content-container").slideToggle("normal");}
function toggleList(){$("#listMapView").html('<a href="javascript:toggleMap();">Map View</a>');$("#listHotelView").addClass('listMapActive');$("#listMapView").removeClass('listMapActive');$("#content-container").slideToggle("normal");}
function mycarousel_initCallback(carousel){$("#content-container .chooseRoomLeft ul li img").removeClass('hidden');}
function detailExpand(imgObj){var imgParent=imgObj.parentNode;var hotelWrapper=imgObj.parentNode.parentNode.parentNode;$(imgObj).remove();$(imgParent).prepend(MINUS);expandHotelDetail(hotelWrapper);}
function detailCollapse(imgObj){var imgParent=imgObj.parentNode;var hotelWrapper=imgObj.parentNode.parentNode.parentNode;$(imgObj).remove();$(imgParent).prepend(PLUS);collapseHotelDetail(hotelWrapper);}
function collapseHotelDetail(hotelObj){$(hotelObj).find('.hotelDetailsImg').css('width','175px');$(hotelObj).find('.venuesGreyBoxAddress address').css('width','200px');$(hotelObj).find('.venuesGreyBoxAddress p').css('width','200px');$(hotelObj).find('.venuesGreyBoxSpaces p').css('width','215px');$(hotelObj).find('.hotelDetailsImg li > img.big').eq(0).addClass('hidden');$(hotelObj).find('.hotelDetailsImg li > img.small').eq(0).removeClass('hidden');$(hotelObj).find('.facilityList').toggleClass('hidden');$(hotelObj).find('.hotelDetailContact').toggleClass('hidden');$(hotelObj).find('.hotelDetailInfo p.topBottomPadding').toggleClass('hidden');}
function expandHotelDetail(hotelObj){$(hotelObj).find('.hotelDetailsImg').css('width','275px');$(hotelObj).find('.venuesGreyBoxAddress address').css('width','350px');$(hotelObj).find('.venuesGreyBoxAddress p').css('width','350px');$(hotelObj).find('.venuesGreyBoxSpaces p').css('width','350px');$(hotelObj).find('.hotelDetailsImg li > img.small').eq(0).addClass('hidden');$(hotelObj).find('.hotelDetailsImg li > img.big').eq(0).removeClass('hidden');$(hotelObj).find('.facilityList').toggleClass('hidden');$(hotelObj).find('.hotelDetailContact').toggleClass('hidden');$(hotelObj).find('.hotelDetailInfo p.topBottomPadding').toggleClass('hidden');}
function mycarousel_initCallback2(carousel){$('#pageContainer #'+sliderBuffer+' .hotelDetailsImg .mycarousel-next').bind('click',function(){carousel.next();return false;});$('#pageContainer #'+sliderBuffer+' .hotelDetailsImg .mycarousel-prev').bind('click',function(){carousel.prev();return false;});};function injectCarousel(){$("#pageContainer .hotelDetailsBox").each(function(){sliderBuffer=$(this).attr('id');$(this).find('.imageSlide').after(controlHTML);$(this).find('.imageSlide').eq(0).jcarousel({scroll:1,initCallback:mycarousel_initCallback2,buttonNextHTML:null,buttonPrevHTML:null});});}
function filterRooms(){var r="";$('#roomFilters input').each(function(){if($(this).attr('checked')==true)r=$(this).attr('value');});if(r=='all')r='chooseRoomBox';$('.chooseRoomBox').css('display','none');$('.'+r).css('display','block');if($('#accessibleRoomFilter').attr('checked')==true){$('.chooseRoomBox:not([class*=acc])').each(function(){if($(this).css('display')=='block')$(this).css('display','none');});}
$('#chooseRoomTop p:last').html('There are '+$('.chooseRoomBox:visible').length+' Room options available in your choice of hotel');}
function showImageSub(src,clickFlag){var largeImage=new Image();$(largeImage).load(function(){$(this).hide().addClass('homegalleryPic');$("#imageViewer").append(this);if(eType=='0'){$(this).fadeIn(FADE_SPEED,function(){$("#imageViewer img").attr('alt',$("#galleria img").eq(c).attr("alt"));$("#imageViewer img").attr('title',$("#galleria img").eq(c).attr("alt"));if($("#imageViewer img").length>1){$("#imageViewer img:first").remove();}
if(e_carousel-1>c){$("#ulfullscreen li").find("a").attr("href",$("#galleria img").eq(c).attr("src"));c++;timer=setTimeout('showImageSub($("#galleria img:eq('+c+')"),0)',TRANSITION_SPEED);}
else{c=0;$("#ulfullscreen li").find("a").attr("href",$("#galleria img").eq(c).attr("src"));timer=setTimeout('showImageSub($("#galleria img:first"),0)',TRANSITION_SPEED);}});}
else if(eType=='1'){$(this).css("left","-754px");$(this).css('opacity','0.15');$(this).animate({'width':754,'left':0,'opacity':0.99},'normal',function(){if($("#imageViewer img").length>1){$("#imageViewer img:first").remove();}
if(e_carousel-1>c){$("#ulfullscreen li").find("a").attr("href",$("#galleria img").eq(c).attr("src"));c++;timer=setTimeout('showImageSub($("#galleria img:eq('+c+')"),0)',TRANSITION_SPEED);}
else{c=0;$("#ulfullscreen li").find("a").attr("href",$("#galleria img").eq(c).attr("src"));timer=setTimeout('showImageSub($("#galleria img:first"),0)',TRANSITION_SPEED);}});}});$(largeImage).attr("src",src.parent().attr("href"));src.parent().parent().parent().find("img").each(function(){$(this).css({"border":"0px","width":"48px","height":"48px"});});src.css({"border":"1px white solid","width":"47px","height":"47px"});$("#viewFullPic").unbind('click').click(function(){src.trigger('dblclick');});var c=$("#galleria img").index(src);}
function parseURLParam()
{var temp=location.href;if(temp.indexOf("?")>0){temp=temp.substr(temp.indexOf("?")+1,temp.length);var parArrayTemp=temp.split('&');var parArray=new Array();for(var i=0;i<parArrayTemp.length;i++){parArray.push(parArrayTemp[i].split('='));}
return parArray;}
else return"";}