var reinstateMailingList;window.addEvent("domready",function(){document.getElement("body").addClass("scripted");document.getElement("a.live-chat").addEvent("click",function(c){c.stop();window.open("http://81.179.23.239/chat/chatstart.htm?domain=www.craigmanor.co.uk","new_win","width=484,height=361")});if($$(".feature-box")){(function(){$$(".feature-box").each(function(e){var d=e.getElement("span");var c=d.getStyle("height");d.set({styles:{height:16},tween:{duration:350}});e.addEvents({mouseenter:function(){d.tween("height",c)},mouseleave:function(){d.tween("height",16)}})})})()}(function(){var d=function(g){var e=g.getElement("a");var f=g.getElement("ul");e.tween("background-position","0 0");if(f){f.setStyle("z-index",10000).tween("height",f.retrieve("fullheight"))}};var c=function(g){var e=g.getElement("a");var f=g.getElement("ul");if(!g.hasClass("selected")){e.tween("background-position","0 40px")}if(f){f.setStyle("z-index",9999).tween("height",0)}};$$("#navigation > li").each(function(g){var e=g.getElement("a").set({tween:{duration:250},styles:{backgroundPosition:(g.hasClass("selected")?"0 0":"0 40px")}}).addEvents({mouseenter:function(h){h.preventDefault()},mouseleave:function(h){h.preventDefault()},focus:function(h){h.preventDefault();d(g)},blur:function(h){h.preventDefault();c(g)}});var f=g.getElement("ul");if(f){f.set({tween:{duration:250},styles:{left:-9999,height:"auto"}});f.store("fullheight",f.getSize().y);f.setStyles({left:"auto",height:0})}g.addEvents({mouseenter:function(h){h.stop();d(g)},mouseleave:function(h){h.stop();c(g)}})})})();if($("large-feature")&&large_feature_images&&large_feature_images.length>1){(function(){var h=1200;var l=3500;var k=0;var i=$("large-feature");var g=$("large-feature-text");if(g){var m=g.getElement("span")}var e=function(p){$clear(c);if(p===undefined||isNaN(p)){p=k+1}if(p>=large_feature_images.length){p=0}k=p;var r=function(){q.set({styles:{opacity:0},tween:{duration:h,onComplete:function(){i.setStyle("background-image","url("+q.get("src")+")");q.destroy();c=e.delay(l)}}}).inject(i,"top");if(m){m.set("tween",{duration:h,onComplete:function(){m.set({html:large_feature_images[p].details,tween:{duration:h,onComplete:$empty}}).tween.delay(h,m,["opacity",1]);q.fade("in")}}).tween("opacity",0)}};var q=new Asset.image(large_feature_images[p].image,{id:"large-feature-image",onload:r})};var f=function(){e((k==0?large_feature_images.length-1:k-1))};var j=function(){e((k==large_feature_images-1?0:k+1))};var n=function(){$clear(c);document.getElement("#large-feature-navigation li.pause").removeClass("pause").addClass("play").removeEvents("click").addEvent("click",d)};var d=function(){$clear(c);c=e.delay(l-h);document.getElement("#large-feature-navigation li.play").removeClass("play").addClass("pause").removeEvents("click").addEvent("click",n)};var o=new Element("ul",{id:"large-feature-navigation"}).adopt(new Element("li",{"class":"previous"}).addEvent("click",f),new Element("li",{"class":"pause"}).addEvent("click",n),new Element("li",{"class":"next"}).addEvent("click",j));i.adopt(o);var c=e.delay(l-h)})()}if($$("ul.gallery")){$$("ul.gallery li a").slimbox({},null,function(c){return true})}if($$(".feature-discounted-rates")){$$(".feature-discounted-rates noscript").each(function(d){var c=new Swiff("/flash/moneyspinner.swf",{width:211,height:90});c.replaces(d)})}if($$(".feature-mailing-list")){var a=document.getElement(".feature-mailing-list").get("html");var b=function(d){var e=new Form.Validator(d);var c=new Form.Request(d,d,{extraData:{is_ajax_req:1}});d.addEvent("submit",function(f){f.stop();c.send()})};reinstateMailingList=function(d){d.stop();var c=d.target.getParent(".feature-mailing-list").set("html",a);b(c);c.getElement("input").focus()};$$(".feature-mailing-list").each(b)}if($("map")){(function(){if(GBrowserIsCompatible()){var h=new GMap2($("map"));h.addControl(new GSmallMapControl());h.addControl(new GMapTypeControl());h.setCenter(new GLatLng(54.368777,-2.91451),13);var f=[new GInfoWindowTab("Tab #1",'<strong>Craig Manor Hotel</strong><br />Lake Road, Windermere, Cumbria, LA23 2JF<br /><br /><strong>Tel:</strong> 015394 88877<br /><strong>Fax:</strong> 015394 88878<br /><a href="mailto:info@craigmanor.co.uk">info@craigmanor.co.uk</a>')];var c=new GMarker(h.getCenter());GEvent.addListener(c,"click",function(){c.openInfoWindowTabsHtml(f)});h.addOverlay(c);c.openInfoWindowTabsHtml(f);var i={};var e,g;var d={attractions:"/images/map-icons/info.png",shopping:"/images/map-icons/shopping.png","food-and-drink":"/images/map-icons/food-and-drink.png"};var e=function(k){i[k.get("id")]=new Array();k.getElement("a.showhide").set("html","(hide markers)").removeEvents("click").addEvent("click",function(){g(k)});var j=new GIcon();j.image=d[k.get("id").substring(13)];j.shadow=d[k.get("id").substring(13)];j.iconSize=new GSize(32,37);j.shadowSize=new GSize(32,37);j.iconAnchor=new GPoint(16,35);j.infoWindowAnchor=new GPoint(16,1);k.getElements("ul > li > a").each(function(p,o){var q=p.get("text");var n=new URI(p.get("href"));var m=n.getData("ll").split(",");var l=new GLatLng(m[0],m[1]);i[k.get("id")][o]=new GMarker(l,{icon:j});GEvent.addListener(i[k.get("id")][o],"click",function(){i[k.get("id")][o].openInfoWindowTabsHtml([new GInfoWindowTab("Tab #1","<strong>"+q+"</strong>")])});h.addOverlay(i[k.get("id")][o]);p.removeEvents("click").addEvent("click",function(r){r.stop();h.panTo(l);i[k.get("id")][o].openInfoWindowTabsHtml([new GInfoWindowTab("Tab #1","<strong>"+q+"</strong>")])})})};var g=function(j){i[j.get("id")].each(function(k){h.removeOverlay(k)});i[j.get("id")]=false;j.getElement("a.showhide").set("html","(show markers)").removeEvents("click").addEvent("click",function(){e(j)});j.getElements("ul > li > a").each(function(o,n){var p=o.get("text");var m=new URI(o.get("href"));var l=m.getData("ll").split(",");var k=new GLatLng(l[0],l[1]);o.removeEvents("click").addEvent("click",function(q){q.stop();e(j);h.panTo(k);i[j.get("id")][n].openInfoWindowTabsHtml([new GInfoWindowTab("Tab #1","<strong>"+p+"</strong>")])})})};$$("#map-controls > ul > li").each(function(j){new Element("a",{"class":"showhide"}).inject(j.getElement("ul"),"before");e(j)})}})()}});