function init(){replacepop();$j("label.labelover").each(function(){if(!$j(this).hasClass("nooverlabel")){$j(this).overlabel()}});if(document.getElementById("featured-viewer")){$j("#featured-viewer .contents li a").RFUcarousel()}if($j(".section-3 .locator select").length>0){$j(".section-3 .locator input").hide();$j(".section-3 .locator select").css({width:"100%"}).change(function(){$j("#locationsearch").submit()})}if(jQuery.browser.mozilla){if(parseFloat(jQuery.browser.version.substr(0,3))<1.9){$j("table.results").each(function(){if(!$j(this).hasClass("league")&&!$j(this).hasClass("playerdetail")){if(!$j(this).hasClass("stats")&&!$j(this).hasClass("scoring")){var A=$j(this).find("thead").html();$j(this).find("thead").replaceWith(A);var B=$j(this).find("tbody").html();$j(this).find("tbody").replaceWith(B)}}});if(navigator.appVersion.indexOf("Mac")!=-1){$j("body").css("opacity",0.9999);$j(".pagewrap").css({"font-size":"1.28em;"});$j(".breadcrumb").css({"font-size":"0.95em;"});$j(".partition p.detailed").css({top:"0.5em;"});$j(".partition p.simple").css({top:"0.5em;"});$j(".menu #tab-11").css({"padding-right":"0"})}}}if(jQuery.browser.opera){$j("div.pagehead").height("10em")}if(jQuery.browser.msie&&parseInt(jQuery.browser.version)<=7){$j(".form .input").focus(function(){$j(".form .input").removeClass("focusinput");$j(this).addClass("focusinput")})}if(jQuery.browser.opera){if(navigator.appVersion.indexOf("Mac")!=-1){$j(".menu li.tab a.tab").css({padding:"0 0.74em"});$j(".menu #tab-11 a.tab").css({padding:"0 1em"});$j(".o2 h1").css({"margin-right":"-16px"})}$j(".poll .alignbutton").css({"margin-left":"2em"});$j(".menu li.tab a.tab").css({padding:"0 0.6em"})}$j("html").removeClass("no-js");galleryCarousel.init();$j("#social-twitter").tweet({username:"Official_RFU",count:2,template:"{join}{text}{time}"})}function check(A){if(document.getElementById("check"+A).className=="delvisible"){document.getElementById("check"+A).className="hidden"}else{document.getElementById("check"+A).className="delvisible"}}function replacesearch(){if(!document.getElementsByTagName){return false}if(document.getElementById("searchlink")){var A=document.getElementById("searchlink");A.onclick=function(){var C=document.getElementById("search").value;var B=A.getAttribute("href");A.href=B+"?search="+C}}}function replacepop(){$j(".popup").click(function(){window.open($j(this).attr("href"),"newwindow","location=yes,status=yes,scrollbars=yes,resizable=yes,width=800,height=800,top=5,left=5");return false});$j(".casepop").click(function(){window.open($j(this).attr("href"),"casewindow","location=yes,status=yes,scrollbars=yes,resizable=yes,width=880,height=680,top=5,left=5");return false});$j(".mappopup").click(function(){window.open($j(this).attr("href"),"mapwindow","location=yes,status=yes,scrollbars=yes,resizable=yes,width=547,height=600,top=5,left=5");return false})}function searchset(){var A=document.getElementById("fsearch");A.setAttribute("onfocus","checksearch()");A.setAttribute("onblur","resetsearch()")}function checksearch(){var A=document.getElementById("fsearch");A.setAttribute("style","color:#000;font-style:normal;");if(A.value=="search"){A.value=""}}function resetsearch(){var A=document.getElementById("fsearch");A.setAttribute("style","color:#333;font-style:italic;");if(A.value==""){A.value="search"}}function centerElement(B){var A=document.documentElement.clientWidth;var E=document.documentElement.clientHeight;var D=$j(B).height();var C=$j(B).width();$j(B).css({position:"absolute",top:E/2-D/2,left:A/2-C/2})}jQuery.preloadImages=function(){for(var A=0;A<arguments.length;A++){jQuery("<img>").attr("src",arguments[A])}};function animatenugget(){$j("#logo").css({width:"0"});$j("#content").hide();$j("#logo").animate({width:"0"},2500,"linear",function(){$j("#logo").animate({width:"213"},2500,"linear",function(){$j("#content").animate({margin:"0"},2500,"linear",function(){$j("#content").show()})});$j(".nuggetcontent").bind("click",animateup)})}function animatenuggetlabel(){jQuery.easing.def="easeOutElastic";$j(".nugget h2").attr("style","cursor:pointer");$j(".nugget h2").click(function(){var C="160px";var A="80px";var B=$j("#nugget1");if($j(this).is("#nugget2title")){B=$j("#nugget2")}else{if($j(this).is("#nugget3title")){B=$j("#nugget3")}else{if($j(this).is("#nugget4title")){B=$j("#nugget4")}else{if($j(this).is("#nugget5title")){B=$j("#nugget5")}else{if($j(this).is("#nugget6title")){B=$j("#nugget6")}}}}}if(B.hasClass("nuggetselect")){animatedown()}else{animatedown();B.addClass("nuggetselect");B.parent().css({"z-index":"2"});if(B.is("#nugget2")){C="-90px"}else{if(B.is("#nugget3")){C="-350px"}else{if(B.is("#nugget4")){A="-214px"}else{if(B.is("#nugget5")){C="-90px";A="-214px"}else{if(B.is("#nugget6")){C="-350px";A="-214px"}}}}}B.animate({left:C,top:A,width:"436px",height:"428px"},2200,onceup)}});return false}var currhtml="";function animateup(){jQuery.easing.def="easeOutElastic";var B="160px";var A="60px";if($j(this).hasClass("nuggetselect")){animatedown()}else{animatedown();$j(this).addClass("nuggetselect");$j(this).parent().css({"z-index":"2"});if($j(this).is("#nugget2")){B="-90px"}else{if($j(this).is("#nugget3")){B="-350px"}else{if($j(this).is("#nugget4")){A="-244px"}else{if($j(this).is("#nugget5")){B="-90px";A="-244px"}else{if($j(this).is("#nugget6")){B="-350px";A="-244px"}}}}}$j(this).animate({left:B,top:A,width:"436px",height:"428px"},1800,onceup)}return false}function animatedown(){jQuery.easing.def="easeOutElastic";$j(".nuggetselect").stop(true,true);if($j(".nuggetselect iframe")){$j(".nuggetselect iframe").remove();$j(".nugget div.close").remove();$j("a.bound").css({display:"block"})}$j(".nuggetselect").animate({left:"0",top:"0",width:"219px",height:"217px"},1500);$j(".nuggetselect").removeClass("nuggetselect");$j(".nugget").css({"z-index":"1"})}function onceup(){var D=$j(this).children();var A=D.filter(function(E){return E==0}).attr("href");var C='<div class="close"><a href="#">close <span class="close">X</span></a></div><iframe frameborder="0" src="'+A+'" class="nuggetframe" allowtransparency="true" scrolling="no"><p>Loading...</p></iframe>';var B=$j(this).find("a.bound");B.after(C);B.focus;$j(".nuggetframe").load(function(){showiframe(B)});$j(".close").hide()}function showiframe(A){A.css({display:"none"});$j(".close").show();$j(".close a").bind("click",function(B){animatedown();return false})}function linksetup(){$j(".close").remove();if(!$j(".col2 .menu a").hasClass("casepop")){$j(".col2 .menu a").bind("click",function(A){var B=$j(this).attr("href");$j(".sectionselect").removeClass("sectionselect");$j(".col1").animate({opacity:"0"},300,function(){$j(".col1").load(B+" .col1 > *",function(){$j(".col1").animate({opacity:"1"},300);$j("#content .featured a").focus();$j("#content .featured a").click(function(){return false})})});$j(this).parent().addClass("sectionselect");return false})}}function coverup(){$j("#header").remove();$j("#menu").remove();$j(".over").remove();$j("#content .featured a").click(function(){return false});$j("h2 a").click(function(){return false})}function addpopie(){$j("#popiediv").hide();centerPopup();$j("#popiediv").fadeIn(900);$j("#popiediv .close").click(function(){$j("#popdiv").remove();return false})}function trackFlashAdvert(A){jQuery.ajax({type:"GET",url:"http://sdc.rfu.com/dcs0kn0n338nrlsph0th1dc4b_7z8b/dcs.gif",data:{dcsdat:new Date().getTime(),dcssip:window.location.hostname,dcsuri:window.location.pathname,"WT.ac":A},async:(jQuery.browser.safari)?false:true})}$j(document).ready(function(){$j("#fixturesFlash").each(function(){var A={url:escape("/FixturesAndResults/CupCompetitionData.aspx?CompetitionID="+$j("#fixturesFlash .CompID").text()+"&GroupID="+$j("#fixturesFlash .GroupID").text()+"&SeasonID="+$j("#fixturesFlash .SeasonID").text()),prev:escape($j("#fixturesFlash a.prev").attr("href"))};swfobject.embedSWF("/flash/rugbyFix.swf","fixturesFlash","998","600","9.0.0",false,A)})});
