
new MBP.scaleFix();new MBP.hideUrlBar();new MBP.hideUrlBarOnLoad();$(document).ready(function(){if($('#sidenav').length>0){$('#sidenav-link').on('click',function(){$('#viewport').addClass('sidenav-in');});$('#pagecover').on('click',function(){$('#viewport').removeClass('sidenav-in');});}
$("#language").change(function(){window.location.href=$(this).val();});$("#currency").change(function(){$.cookie("currency",$(this).val(),{path:'/'});if($.cookie("currency")==$(this).val()){window.location.reload();}else{$("#form_currency").submit();}});if($('.hvr').length>0){$('.hvr').on('click',function(e){var a=$(this).find('a.name');var firstA=a[0];document.location.href=firstA.href;});}
if($('#change-dates').length>0){$('#change-dates').on('click',function(){$("#showresults").removeClass('active');$("#showsearch").addClass('active');$('#lodgment-search').show();});}
if($('#aboutsection').length>0){$('#aboutsection h3').on('click',function(e){$(this).next('.collapse').toggle();$(this).toggleClass('open');});}
if($('#changedates').length>0){$('#changedates').on('click',function(e){$('#lodgment-search').show().animate({scrollTop:0},"slow");e.preventDefault();});}
if($('.selector').length>0){$(".selector select").change(function(){$(this).parent('.selector').find('.select').text($(this).find("option:selected").text());});}
if($('.imageslider').length>0){var sliderUL=$('.imageslider .inner').css('overflow','hidden').children('ul'),imgs=sliderUL.find('img'),spans=sliderUL.find('span.i'),imgWidth=imgs[0].width,imgsLen=imgs.length,current=1,totalImgsWidth=imgsLen*imgWidth;$('.imageslider-nav').show().find('a').on('click',function(e){$('.hideable').fadeOut().delay(2000).fadeIn();var direction=$(this).data('dir'),loc=imgWidth;(direction==='next')?++current:--current;if(current===0){current=imgsLen;loc=totalImgsWidth-imgWidth;direction='next';}else if(current-1===imgsLen){current=1;loc=0;}
transition(sliderUL,loc,direction);e.preventDefault();});function transition(container,loc,direction){var unit;if(direction&&loc!==0){unit=(direction==='next')?'-=':'+=';}
container.animate({'margin-left':unit?(unit+loc):loc});}}});