try{$(document).ready(function(){document.relativePathModifier=".";$("link[rel='home']").each(function(){var D=($(this).attr("href")).match("^([./]+)/.*");if(D&&D.length==2){document.relativePathModifier=D[1]}});$("form[id~='searchbox_015848178315289032903']").attr("action","http://www.hse.gov.uk/search/googlecoop.htm");$("a.styleswitcher").click(function(){switchStylesheet(this.id);return false});$("a.styleswitcherreset").click(function(){resetStylesheet()});switchStylesheet($.cookie("alternate-stylesheet"));$("#colleft:not(.cms) li:has(ul)").addClass("selectCollapsed").prepend("<div><a href='#' class='dropArrow'><img height='16' width='16' alt='click to expand' src='"+document.relativePathModifier+"/images/spacer.gif' /></a>").parent().children("ul").toggle("slow");$(".dropArrow").each(function(){$(this).parent().parent().each(function(){$(this).contents().eq(1).each(function(){if(this.nodeType==3){$(this).wrap("<a href='#'></a>")}});$(this).contents().eq(1).addClass("dropText").appendTo($(this).children().eq(0))})}).click(function(D){showhide($(this).parent().parent());return false});if(!$("link[rel='prev'][href='null']").length){var B=new Array();B.push($.cookie("page-highlight"));var A=$("link[rel='prev']");if(A.length){B.push(A.get(0).href)}B.push(document.location);var C=null;while(B.length&&!C){highlightThis=B.pop();if(highlightThis){$("#colleft a").each(function(){var D=this.href;if(D==highlightThis&&D.lastIndexOf("#")!=(D.length-1)){$(this).parent().addClass("selected");reveal($(this),"#colleft");C=D}})}}if(C){$.cookie("page-highlight",C)}}$("a.link-redirect").each(function(){window.location=this.href});$("a[href$='.doc'], a[href$='.ppt'], a[href$='.xls'], a[href$='.pdf'], a[href$='.rtf']").each(function(){this.title+=" opens in new window"}).click(function(){window.open(this.href,"popper","resizable,scrollbars,toolbar=yes,menubar=yes,location=yes");return false});$("input:text:not(.noclear), textarea:not(.noclear)").each(function(){this.old=this.value}).focus(function(){this.value=(this.value==this.old)?"":this.value});$("form:not(.nostyle) input[type!='hidden'], form:not(.nostyle) textarea ").each(function(){$(this).addClass(this.form.className+this.type)});$("*.noscript").remove();if($(".tablesortable").length){$.getScript(document.relativePathModifier+"/js/jquery.tablesorter.min.js",function(){$(".tablesortable").tablesorter()})}$("table.stripe tbody tr").removeClass("highlight");$("table.stripe tbody tr:odd").addClass("highlight");$("table.stripe").each(function(){if($(this).hasClass("tablesortable")){$(this).bind("sortEnd",function(){$(this).children("tbody").children("tr").removeClass("highlight");$(this).children("tbody").children("tr:odd").addClass("highlight")})}});if($(".countdown").length){$.getScript(document.relativePathModifier+"/js/jquery.countdown.min.js",function(){$(".countdown").countdown()})}$("ul.ddmswitch").each(function(){if(!$(this).prev().is(":header,div,p")){return }this.id||(this.id="hse-ddm-"+Math.floor(Math.random()*10000));var H=$(document.createElement("label")).attr("for",this.id);var E=$(this).prev().wrapInner(H);var G=$(document.createElement("select")).attr("id",this.id);var D=$(document.createElement("input")).attr("type","button").attr("value","Go").click(function(){document.location=$(this).parent().find("select option:selected").attr("value")});var F=$(document.createElement("form")).insertBefore(this).append(E).append(G).append(D);$(this).find("a").each(function(){$(this).replaceWith('<option value="'+$(this).attr("href")+'">'+$(this).text()+"</option>")});$(this).find("option").appendTo(G);$(this).remove()});$("#footnotes").append("<h2>Footnotes - Link URLs in this page</h2><ol id='olFootnotes' />");$("#colmiddle a:not([href$='#']):not([href^='javascript:']):not(:empty):not([href^='#'])").each(function(){$this=$(this);var D=$.trim($this.text()).length>0?$this.text():$this.find("img").attr("alt");$("#olFootnotes").append('<li><span class="hideFromScreen">'+D+"<br />"+this.href+"</span></li>");$this.after("<sup class='hideFromScreen'>["+$("#olFootnotes li").length+"]</sup>")});if($("#olFootnotes li").length==0){$("#footnotes").html("")}if($("a.feed").length){$.getScript(document.relativePathModifier+"/js/jquery.loadlegacyscript.min.js",function(){$("a.feed").each(function(){var G="https?://([a-zA-Z0-9_-]+.[a-zA-Z0-9_-]+)+(/*[A-Za-z0-9/\\-_&:?+=//.%]*)*";var F=this.title.match(G);if(F){var D=F[0];var E=$(document.createElement("div")).attr("id","feed_"+Math.floor(Math.random()*10000));var H=$(document.createElement("div")).addClass("feed-transient").addClass("loading-graphic");$(E).append(H);$(this).after(E);$(E).getUnsafeScriptInline(D,function(){$(this).find(".feed-transient").remove()},function(){$(this).find(".feed-transient").remove();$(this).append("<p>Currently unable to load newsfeed, please try later.</p>")});this.parentNode.removeChild(this)}})})}if($(".hse-thickbox-gallery").length){$("head").append('<link rel="stylesheet" href="'+document.relativePathModifier+'/styles/thickbox.css" media="all" />');$.getScript(document.relativePathModifier+"/js/thickbox-compressed.js",function(){$(".hse-thickbox-gallery").each(function(){var D="hse-thickbox-gallery-"+this.id;$(this).find("a").attr("rel",D)});tb_init(".hse-thickbox-gallery a")})}})}catch(e){alert("Found an exception: "+e.toString())}$(window).load(function(){var A=$(document.createElement("div")).attr("id","pbtemp").addClass("realbanner").addClass("hideComplete");$(document.body).append(A);var B=$("#pbtemp").css("background-image");var C=B.match('url[\dws]?\\("?([^")]*)"?\\)');if(C&&C.length&&C.length==2){$("#printbanner img").each(function(){this.src=C[1]})}$("#pbtemp").remove()});function reveal(B,A){if(B.is("li")){showhide(B)}if(!B.is(A)){reveal(B.parent(),A)}}function showhide(B){B.children("ul").toggle();if(!B.hasClass("selected")){var A="";if(B.hasClass("selectExpanded")){B.addClass("selectCollapsed").removeClass("selectExpanded");A="click to expand"}else{B.addClass("selectExpanded").removeClass("selectCollapsed");A="click to close"}B.children().eq(0).find("a img").attr("alt",A)}}function switchStylesheet(A){if(null==A){return false}var C=A.match("^(.*?):(.*)");if(C.length==3){var D=C[1];var B=C[2].replace(/_/g,"/");if(B.substr(0,1)=="/"){B=document.relativePathModifier+B}$("link[rel*='stylesheet'][media='']").each(function(){if(!this.resethref){this.resethref=this.href}}).attr("href",B);$.cookie("alternate-stylesheet",A,{expires:100,path:"/"})}}function resetStylesheet(){$("link[rel*='stylesheet'][media='']").each(function(){this.href=this.resethref});$.cookie("alternate-stylesheet",null,{expires:-1,path:"/"})}function stripeTable(A){$(this).each(function(){alert(this.innerHTML)}).filter("tbody tr").removeClass(A);$(this).filter("tbody tr:odd").addClass(A)}function equalHeight(A){tallest=0;A.each(function(){thisHeight=$(this).height();if(thisHeight>tallest){tallest=thisHeight}});A.height(tallest)}$(window).load(function(){equalHeight($(".row1"));equalHeight($(".row2"));equalHeight($(".row3"));equalHeight($(".row4"));equalHeight($(".row5"));equalHeight($(".row6"));equalHeight($(".row7"));equalHeight($(".row8"));equalHeight($(".row9"));equalHeight($(".row0"))});jQuery.cookie=function(B,I,L){if(typeof I!="undefined"){L=L||{};if(I===null){I="";L.expires=-1}var E="";if(L.expires&&(typeof L.expires=="number"||L.expires.toUTCString)){var F;if(typeof L.expires=="number"){F=new Date();F.setTime(F.getTime()+(L.expires*24*60*60*1000))}else{F=L.expires}E="; expires="+F.toUTCString()}var K=L.path?"; path="+(L.path):"";var G=L.domain?"; domain="+(L.domain):"";var A=L.secure?"; secure":"";document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")}else{var D=null;if(document.cookie&&document.cookie!=""){var J=document.cookie.split(";");for(var H=0;H<J.length;H++){var C=jQuery.trim(J[H]);if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));break}}}return D}};
