var LP={util:{},currentDate:new Date,keys:{ENTER:13,UP:38,DOWN:40,LEFT:37,RIGHT:39,PAGEUP:33,PAGEDOWN:34},topNav:{over:function(){768<$(window).width()&&($(".active").removeClass("active").find(".sub").hide(),$(this).addClass("active").find(".sub").show())},out:function(){$(this).removeClass("active").find(".sub").stop().hide()}},fixProductLinks:function(){$("a[href^='/accommodation/'], a[href^='/attractions/'], a[href^='/travel/'], a[href^='/category/']").attr("href",function(){return"http://www.visitlondon.com"+
$(this).attr("href")}).attr("rel","external")},externalLinks:function(){var a=/^(https?\:)?\/\/([a-z0-9\-]+\.)?londonandpartners\.com/,b=/(localhost|web[45]|preview\-landp|(vl|lap)\-(dev|test|stage)\-web\d\-landp)/,c=/\.(mp3|pdf|doc|docx|wmv|gif|jpg|xls)$/;$("a[href^='http'],a[href^='//']").not(".gallery").filter(function(){return!a.test($(this).attr("href"))}).filter(function(){return!b.test($(this).attr("href"))}).add("a[rel=external]").add(function(){return c.test($(this).attr("href"))}).attr("title",
"Link will open in a new window").attr("target","_blank")},biographyExpanders:function(){$(".biogExpand .biogContent").hide().after('<div class="biogExpander button r">+ Show Biography</div>');$(".biogExpander").toggle(function(a){$(a.target).addClass("expanded").text("- Hide Biography").siblings(".biogContent").fadeIn("slow")},function(a){$(a.target).removeClass("expanded").text("+ Show Biography").siblings(".biogContent").fadeOut("slow")})},tabbedPageNavigation:function(){$(".vlSnTabbeNavPanel").prependTo(".content");
$(".vlSnTabbeNavPanel a").each(function(){window.location.pathname===$(this).attr("href")?$(this).removeAttr("href").parent().addClass("current"):-1!==window.location.pathname.indexOf($(this).attr("href"))&&$(this).parent().addClass("current")})}};
LP.tabs={hide:function(){$(".tab").hide().attr("aria-hidden","true");$(".tabs a").attr("tabindex","-1");$(".tabs .current").removeClass("current")},show:function(a){var a=a||$(".tabs .current a"),b=$(a.attr("href"));$map=b.find(".map");this.hide();a.parent("li").addClass("current");a.attr("tabindex","0");b.show().removeAttr("aria-hidden");$map.length&&!$map.hasClass("googlemap")&&(LP.map.drawMap($map),$map.addClass("googlemap"))},keysdown:function(a){var b=$(".tabs .current").index(),c=$(".tabs li").length,
d=a.which,f=!0,g=!0,a=a.altKey,e=0;(d===LP.keys.LEFT||d===LP.keys.RIGHT)&&!a?(f=!1,d===LP.keys.RIGHT?e=1:d===LP.keys.LEFT&&(e=-1)):g=!1;if(!0===g){b=+b+e;if(b===c||0>b)g=!1;!0===g&&this.show(b)}return f},setup:function(){var a=this,b=$(".tabs a"),c=$(".tab");b.length&&c.length&&($(".tabs ul").attr("role","tablist").keydown(function(b){a.keysdown(b)}),c.hide().attr("role","tabpanel").attr("aria-hidden","true"),b.attr("tabindex","-1"),b.attr("role","tab").css("cursor","pointer").click(function(){a.show($(this));
return!1}),this.show())}};LP.initClientSpotlight=function(){$("#client-spotlight .snippet").length?(LP.clientSpotlight(),setInterval(LP.clientSpotlight,5E3)):$("#client-spotlight").remove()};LP.clientSpotlight=function(){var a=$("#client-spotlight .snippet"),a=Math.floor(Math.random()*a.length);$("#client-spotlight .snippet:visible").fadeOut("slow");$("#client-spotlight .snippet:eq("+a+")").fadeIn("slow")};
LP.slides={isSetup:!1,change:function(a){var a=a||"right",b=$(".lpSnHeroTeaser"),c=$(".lpSnHeroTeaser:visible"),d=$("#slides button"),f=$("#slides").width(),g,e;"left"===a&&(e=b.index(c)-1,0>e&&(e=b.length-1),g=f+"px");"right"===a&&(e=b.index(c)+1,e>=b.length&&(e=0),g="-"+f+"px");a=$(".lpSnHeroTeaser:eq("+e+")");d.hide();c.css("z-index","0");a.css("z-index","10").css("left",g).show().animate({left:0},500,function(){c.hide();d.show()})},setup:function(){var a=$(".lpSnHeroTeaser");if(!(LP.slides.isSetup||
2>a.length))a.hide().wrapAll('<div id="slides"></div>'),$("#slides").parent().hasClass("rotate-true")?$(".lpSnHeroTeaser:eq("+Math.floor(Math.random()*a.length)+")").show():$(".lpSnHeroTeaser:eq(0)").show(),$("#slides").append('<button type="button" id="prev-slide" class="ir icon-prev">Previous</button><button type="button" id="next-slide" class="ir icon-next">Next</button>'),$("#next-slide").click(function(){LP.slides.change("right")}),$("#prev-slide").click(function(){LP.slides.change("left")}),
LP.slides.isSetup=!0}};LP.map={};LP.map.points=[];LP.map.drawMap=function(a){var b=a.attr("data-latlng").split(","),c=a.attr("data-zoom"),b=new google.maps.LatLng(b[0],b[1]);LP.map.theMap=new google.maps.Map(a[0],{zoom:+c,center:b,mapTypeId:google.maps.MapTypeId.ROADMAP});a.attr("data-markers")&&(a=a.attr("data-markers").split(","),a=new google.maps.LatLng(a[0],a[1]),new google.maps.Marker({position:a,clickable:!1,map:LP.map.theMap}))};
LP.map.addMarker=function(a){if(a.latitude&&a.longitude){var b=new google.maps.LatLng(a.latitude,a.longitude);LP.map.bounds.extend(b);LP.map.theMap.fitBounds(LP.map.bounds);var c=new google.maps.InfoWindow({content:'<div class="infoWindowContent">'+a.content+"</div>"}),b={map:LP.map.theMap,position:b};if(a.icon)b.icon=a.icon;var d=new google.maps.Marker(b);google.maps.event.addListener(d,"click",function(){c.open(LP.map.theMap,d)})}};
LP.map.drawBoundsMap=function(a){var b={zoom:11,center:new google.maps.LatLng(51.481625,-0.103883),mapTypeId:google.maps.MapTypeId.ROADMAP};LP.map.theMap=new google.maps.Map(document.getElementById(a.attr("id")),b);LP.map.bounds=new google.maps.LatLngBounds;for(a=0;a<LP.map.points.length;a++)LP.map.addMarker(LP.map.points[a]);window.setTimeout(function(){15<LP.map.theMap.getZoom()&&LP.map.theMap.setZoom(15)},100)};
LP.map.makePoints=function(a){var b,c,d="";$("div[data-venueid]").each(function(){LP.map.points.push({id:$(this).attr("data-venueid"),content:$(this).html(),latitude:"",longitude:""});d+=$(this).attr("data-venueid")+","});$.getJSON("http://"+window.location.host+"/api/json/venuelist?ids="+d,"",function(d){if(d.venues){for(b=0;b<LP.map.points.length;b++)if(c=LP.map.points[b],d.venues[c.id])c.latitude=d.venues[c.id].defaultLocation.latitude,c.longitude=d.venues[c.id].defaultLocation.longitude;LP.map.drawBoundsMap(a)}})};
$(document).ready(function(){$(".content li").not(".results li, .pager li, .tabs li, .commentlist li").addClass("bullet").wrapInner('<div class="li"/>');$(".lpSnCalloutLargeWide").each(function(){0===$("img",this).length&&($(this).css("min-height","0"),$("h3,p",this).css("margin-left","0"))});$("#menu .parent").hoverIntent({sensitivity:2,interval:100,over:LP.topNav.over,timeout:500,out:LP.topNav.out});LP.homelink=$("#menu .first .nomob").html();$(window).on("resize",function(){997>$(window).width()?
$("#menu .first .nomob").html('<i class="ir home-icon"></i>Home'):$("#menu .first .nomob").html(LP.homelink)}).resize();LP.slides.setup();$("table.zebra tr:even").addClass("alt");$(".pullquote").append('<i class="pq-l"/><i class="pq-r"/>');LP.initClientSpotlight();LP.fixProductLinks();LP.externalLinks();LP.biographyExpanders();LP.tabs.setup();LP.tabbedPageNavigation();$("a.gallery, .gallery-icon a").lightBox();$("#gmap").length&&!$("#gmap-venues").length?LP.map.drawMap($("#gmap")):$("#gmap").length&&
$("div[data-venueid]").length&&LP.map.makePoints($("#gmap"));$(".youtubevideo").each(function(){var a="http://www.youtube.com/v/"+$(this).attr("data-youtubeid")+"?rel=0",b=$(window).width(),c="16x9"===$(this).attr("data-youtubeformat"),d="300",f=c?"183":"239";768<b&&(d="540",f=c?"329":"430");997<b&&(d="640",f=c?"390":"510");$(this).flashembed({src:a,width:d,height:f,play:"true",wmode:"transparent",version:[8,0]})});$(".youtubevideo").on("resize",function(){var a=$(window).width(),b="16x9"===$(this).attr("data-youtubeformat");
ytW="300";ytH=b?"183":"239";768<a&&(ytW="540",ytH=b?"329":"430");997<a&&(ytW="640",ytH=b?"390":"510");$(this).find("object").attr("width",ytW).attr("height",ytH)});$("#videolarge").each(function(){var a=$(this).attr("data-videoid"),b=$(this).attr("data-videotranscript");$(this).flashembed({src:"http://static.visitlondon.com/assets/video/vl-video-player-large.swf?playerSize=SL&xmltouse="+a+".xml&PageColour=grey",width:"540",height:"353",play:"true",wmode:"transparent",allowFullScreen:"true",version:[8,
0]});!0===b||"true"===b?($(this).append('<a id="transcriptLink" href="http://vlstatic.com/assets/video/transcripts/'+a+'.html"><img src="http://vlstatic.com/images/icons/transcript.gif" alt="" width="16" height="13"/>Read the transcript</a>'),$("#transcriptLink").click(function(){window.open("http://vlstatic.com/assets/video/transcripts/"+a+".html","trans","width=600, height=550, location=no, scrollbars=yes");return!1}),$(this).height(375)):$(this).height(360)});$.datepicker.setDefaults({altFormat:"dd-mm-yy",
dateFormat:"dd/m/yy",minDate:LP.currentDate,maxDate:"+1Y +1M",showOn:"focus",changeYear:!1,changeMonth:!1,changeFirstDay:!1});$("#from-date").datepicker({altField:"input[name='from']"});$("#to-date").datepicker({altField:"input[name='to']"})});
