function closesearch(){$("div.search-wrapper a.close").parent().css("width","0").css("opacity","0");$("div.search-wrapper a.close").next().children("input").css("width","0").css("padding","10px 0");$("div.search-wrapper a.close").next().children("button").css("display","none");$(".search-wrapper").removeClass("isActive")}function fullWidthImagePanel(){window.innerWidth>=992&&$(".fullWidthImagePanel .img").css("height",$(".fullWidthImagePanel .dsc").outerHeight())}document.querySelector("#nav-toggle").addEventListener("click",function(){this.classList.toggle("active")});var navtoggle=0;$("a#nav-toggle").click(function(){closesearch();navtoggle==0?($("div#mobilenav").fadeIn(),$("div#nav").addClass("active"),$("div#navigation").addClass("active"),$("div#mobilenavoverlay").fadeIn(),$(".fa-search").css("display","none"),navtoggle++):($("div#mobilenav").fadeOut(),$("div#nav").removeClass("active"),$("div#navigation").removeClass("active"),$("div#mobilenavoverlay").fadeOut(),$(".fa-search").css("display","block"),navtoggle--)});$(window).scroll(function(){$(window).scrollTop()>10&&!$("div#mobilenav").is(":visible")?$("a#nav-toggle").fadeOut():$("a#nav-toggle").fadeIn()});$("a#next-slide").click(function(){$(".cycle-slideshow").cycle("next")});$("a#previous-slide").click(function(){$(".cycle-slideshow").cycle("prev")});$("#banner").touchwipe({wipeLeft:function(){$("#banner .cycle-slideshow").cycle("next")},wipeRight:function(){$("#banner .cycle-slideshow").cycle("prev")},wipeUp:function(){return!1},wipeDown:function(){return!1},min_move_x:50,min_move_y:50,preventDefaultEvents:!1});$("span.open-state").click(function(){$(this).next().hasClass("expanded")?($(this).next().addClass("closedimportant"),$(this).next().removeClass("expanded")):($(this).next().removeClass("closedimportant"),$(this).next().css("height","auto"),$(this).next().addClass("expanded"),$(this).parent("li").css("height","auto"))});$('#library-filter input[type="checkbox"]').on("ifClicked",function(){$("#listview").attr("checked")?$("#listview").removeAttr("checked"):$("#listview").attr("checked","checked");$(this).closest("form").submit()});$("#library-filter .search-input").click(function(){$(this).closest("form").submit()});$(document).ready(function(){$(".col-xs-3 span.open-state").next().addClass("closedimportant");$(".col-xs-3 .current span.open-state").next().removeClass("closedimportant");$(".col-xs-3 .current").parents().removeClass("closedimportant");$(".col-xs-3 .current ul li").children("ul").addClass("closedimportant");$(".col-xs-3 .current > span").addClass("active-icon");$(".col-xs-3 .current > ul").addClass("expanded");$(".col-xs-3 .current").parents().children("span").addClass("active-icon");$(".col-xs-3 .current").parents().children("ul").addClass("expanded");$(".content-nav li.current").each(function(){$(this).css("height","auto");$(this).parents().css("height","auto");$(this).addClass("expanded");$(this).prev("span").addClass("active-icon")});$(".open-important").removeClass("closedimportant").addClass("expanded")});$("a.open-grey").click(function(){$(this).parent().parent().next().hasClass("expanded")?($(this).parent().parent().next().css("height","0"),$(this).parent().parent().next().css("padding","0"),$(this).parent().parent().next().removeClass("expanded")):($(this).parent().parent().next().css("height","auto"),$(this).parent().parent().next().css("padding-top","15px"),$(this).parent().parent().next().addClass("expanded"))});$("span.open-state").click(function(){$(this).hasClass("active-icon")?$(this).removeClass("active-icon"):$(this).addClass("active-icon")});/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&$(".newsarticle").each(function(){$(this).prev().hasClass("box-grey")?($(this).removeClass("box-grey"),$(this).addClass("box-blue")):$(this).prev().hasClass("box-blue")&&($(this).removeClass("box-blue"),$(this).addClass("box-grey"))});$(document).ready(function(){$(".custom-select").each(function(){$(this).wrap("<span class='select-wrapper'><\/span>");$(this).after("<span class='holder'><\/span>")});$(".custom-select").change(function(){var n=$(this).find(":selected").text();$(this).next(".holder").text(n)}).trigger("change")});$(document).ready(function(){var n=-1;$(".newsarticle").each(function(){n=n>$(this).height()?n:$(this).height()});$(".newsarticle").each(function(){$(this).height(n)})});$(document).ready(function(){$("input[type=file]").nicefileinput()});$(document).ready(function(){$(".local-headway .tab:nth-child(1)").click(function(){$("#headway-local-results").addClass("active");$(this).addClass("active");$("#headway-national-results").removeClass("active");$(".local-headway .tab:nth-child(2)").removeClass("active")});$(".local-headway .tab:nth-child(2)").click(function(){$("#headway-local-results").removeClass("active");$(this).addClass("active");$("#headway-national-results").addClass("active");$(".local-headway .tab:nth-child(1)").removeClass("active")})});$(document).ready(function(){$("div.search-wrapper a.close").click(function(){closesearch()});$(".fa-search").click(function(){$(".search-wrapper").css("width","500px").css("opacity","1");$('.search-wrapper form input[type="text"]').css("width","400px").css("padding","10px");$(".search-wrapper form button").css("display","block");$(".search-wrapper").addClass("isActive")});$(window).scroll(function(){var n=$(".search-wrapper").offset().top;$(window).scrollTop()>n&&$(".search-wrapper").hasClass("isActive")&&closesearch()})});$(document).ready(function(){$("#event-cal-tab").click(function(){$(".cal-wrapper").hasClass("active")?$(".cal-wrapper").removeClass("active"):$(".cal-wrapper").addClass("active")});$(".backbutton").click(function(n){n.preventDefault();window.history.back()});$("div.emailaddress input, div.email input, input#Email").removeAttr("type").attr("type","email");$("div.phonenumber input, div.telephone input, input#PhoneNumber").attr("pattern","[0-9]*")});fullWidthImagePanel();$(window).on("resize",fullWidthImagePanel)