document.write('<link rel=\"StyleSheet\" href=\"/inc/corejs.css\" type=\"text/css\" media=\"screen\" />')
var homeHeroSpeed=8000;var homeHeroCurrent=1;var homeHeroSlides=0;google.setOnLoadCallback(function(){$(document).ready(function(){newWindowLinks();clickable();defaultText();titles();galleries();FAQs();reviews();homeHero();mailingList();rooms();bookingform();if($.browser.msie){$("iframe").each(function(){$(this).attr("frameBorder","no");this.outerHTML=this.outerHTML;})}});});function defaultText(){$(".defaultText").unbind("focus,blur").focus(function(){if($(this).val()==$(this)[0].defaultValue){$(this).val("");}}).blur(function(){if($(this).val()==""){$(this).val($(this)[0].defaultValue);}});}
function newWindowLinks(){$('a.pop').unbind('click').click(function(){window.open($(this).attr('href'));return false;});}
function clickable(){$(".clickable:has(a)").css({"cursor":"pointer"}).live("click",function(){var link=$("a",this).eq(0);var url=link.attr("href");if(link.hasClass("pop")){window.open(url);}else{window.location=url;}}).hover(function(){$(this).addClass("hover");},function(){$(this).removeClass("hover");})}
function fnE(inarr,text){inarr=inarr.split(",");var out="";for(i=inarr.length-1;i>=0;i--){out+=inarr[i];}
if(text==false||text==""||text==undefined){text=out;}
document.write('<a href="mailto:'+out+'" class="email">'+text+'</a>');}
function titles(){$(".title").append('<b></b>');$(".title b").fadeIn(1000);}
function galleries(){$(".galleryThumbsWrapper").each(function(i){if($("li",this).size()>5){$(this).after('<a href="#" onclick="scrollGallery('+i+',\'up\');return false" class="upArrow">Up</a><a href="#" onclick="scrollGallery('+i+',\'down\');return false" class="downArrow">Down</a>')}});$(".galleryThumbs a").click(function(){var src=$(this).attr("href");var target=$('.galleryFrame img',$(this).closest('.galleryWrapper'));if(target.attr("src")!=src){target.stop(true,true).fadeOut(200,function(){imageObj=new Image();imageObj.onload=function(){target.attr("src",src).fadeIn();}
imageObj.src=src;});}
return false;});}
function scrollGallery(index,direction){var gallery=$(".galleryThumbs:eq("+index+")");gallery.stop(true,true);var contentHeight=$("li",gallery).size()*71;var curY=parseInt(gallery.css("top").split("px")[0]);if(direction=="down"){var newY=curY-71;if(newY<-(contentHeight-355)){newY=curY;}}
if(direction=="up"){var newY=curY+71;if(newY>0){newY=curY;}}
gallery.animate({"top":newY+"px"});}
function FAQs(){$("#weddingFAQs li h3").click(function(){$("#weddingFAQs li p:visible").slideUp()
$(this).next().slideDown()})}
function reviews(){$(".reviewsList q[cite]").hover(function(){$(this).css({cursor:"pointer"})},function(){}).click(function(){window.open($(this).attr("cite"))
return false})}
function homeHero(){homeHeroSlides=$("#homeHero .slide").size();if(homeHeroSlides>1){setInterval("nextHomeHero()",homeHeroSpeed);}
var homeHeroCurrent=1;setHeroLink()}
function nextHomeHero(){$("#homeHero .slide:not(.slide"+homeHeroCurrent+")").css({zIndex:"1"});$("#homeHero .slide"+homeHeroCurrent).css({zIndex:"2"});homeHeroCurrent++;if(homeHeroCurrent>homeHeroSlides){homeHeroCurrent=1;}
$("#homeHero .slide"+homeHeroCurrent).hide().css({zIndex:"3"}).fadeIn(1000);setHeroLink()}
function setHeroLink(){if($("#homeHero .slide"+homeHeroCurrent+" a.heroLink").size()>0){var href=$("#homeHero .slide"+homeHeroCurrent+" a.heroLink").attr('href');$("#homeHero b").unbind("click").click(function(){window.location=href;}).css({cursor:"pointer"})}else{$("#homeHero b").unbind("click").css({cursor:"default"})}}
function mailingList(){$("#mailingListForm").submit(function(){var val=$("#email").val();if(val!=null&&val!=""&&/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/.test(val)){return true;}else{alert("Please enter a valid email address");return false;}});}
function rooms(){$("#rooms").prepend('<div class="frame galleryFrame"><span><img src="/inc/s.gif" alt="" /></span><b></b></div>');$("#externalImageMap area").hover(function(){var i=$(this).attr("class");$("#external").removeClass("hover1 hover2 hover3").addClass("hover"+i);},function(){$("#external").removeClass("hover1 hover2 hover3");}).click(function(){var id=$(this).attr("href");$("#external").removeClass("select1 select2 select3 select4").addClass("select"+$(this).attr("class"))
$("#floorPlan li,.floor,.galleryFrame, #help").hide();$(id+"Plan").fadeIn();$(id+"Plan area:eq(0)").click();return false;});$("#floorPlan area").click(function(){$("#floorPlan li").removeClass("select1 select2 select3 select4");$(this).closest("li").addClass("select"+$(this).attr("class"));var id=$(this).attr("href");var room=$(id);var floor=room.closest(".floor");floor.show();$(".room,",floor).hide()
$(".galleryFrame,").fadeIn()
room.fadeIn();$(".galleryThumbs a:eq(0)",room).click();return false;})
$("#level1ImageMap area").hover(function(){var i=$(this).attr("class");$("#level1Plan").removeClass("hover1 hover2 hover3 hover4").addClass("hover"+i);},function(){$("#level1Plan").removeClass("hover1 hover2 hover3 hover4");});$("#level2ImageMap area").hover(function(){var i=$(this).attr("class");$("#level2Plan").removeClass("hover1 hover2 hover3 hover4").addClass("hover"+i);},function(){$("#level2Plan").removeClass("hover1 hover2 hover3 hover4");});$("#level3ImageMap area").hover(function(){var i=$(this).attr("class");$("#level3Plan").removeClass("hover1 hover2 hover3 hover4").addClass("hover"+i);},function(){$("#level3Plan").removeClass("hover1 hover2 hover3 hover4")});}
function bookingform(){$("#booking").dialog({height:520,width:750,modal:true,resizable:false,autoOpen:false});$("#bookatable,.booking").click(function(){$("#booking").dialog('open')
return false;})}