$(document).ready(function(){lastloaded="/#/";tango=0;alpha="#competitions-radioactive";$("#news").newsticker();$.history.init(callback);$("a[rel*='history']").livequery('click',function(){var hash=this.href;temp=hash.split("#");hash="";hash=temp[1];$.history.load(hash);tango=1;return false;});});function loadin(){$("#loadimg").fadeIn("fast");}
function loadout(){$("#loadimg").fadeOut("fast");}
function callback(hash){urchinTracker(hash);temp=hash.split("-");temp1=hash.split("/");temp2=lastloaded.split("/");temp3=location.href;temp4=temp3.split("/");if(temp1.length==1){if(temp4.length<5){$.history.load("/index");}}
if(temp1.length>1&&lastloaded!=hash){loadin();temp1=temp1[1].split("-");temp2=temp2[1].split("-");if(temp.length==1){hashnew=hash;$.ajaxq("whoal",{url:hashnew+"?leftmenu=1",cache:false,dataType:"html",success:function(data){$("#LeftNavBar").fadeOut("fast",function(){$("#LeftNavBar").empty().append(data);$("#LeftNavBar").fadeIn("fast");});}});$.ajaxq("whoa",{url:hashnew+"?centredata=1",cache:false,dataType:"html",success:function(data){$("#Level2").fadeOut("fast",function(){$("#Level2").empty().append(data);loadout();$("#Level2").fadeIn("fast");});}});lastloaded=hash;}
if(temp.length==2||temp.length==3){if(temp1[0]!=temp2[0]){$.ajaxq("whoal",{url:temp1[0]+"?leftmenu=1",cache:false,dataType:"html",success:function(data){$("#LeftNavBar").fadeOut("fast",function(){$("#LeftNavBar").empty().append(data);$("#LeftNavBar").fadeIn("fast",function(){beta="#"+temp1[0]+"-"+temp1[1];if(alpha!=beta){$(alpha).css('display','none');$(beta).css('display','block');alpha=beta;}});});}});}
$.ajaxq("whoa",{url:hash,cache:false,dataType:"html",success:function(data){$("#Level2").fadeOut("fast",function(){$("#Level2").empty().append(data);});loadout();$("#Level2").fadeIn("fast");}});beta="#"+temp1[0]+"-"+temp1[1];if(alpha!=beta){$(alpha).css('display','none');$(beta).css('display','block');alpha=beta;}
lastloaded=hash;}
if(temp.length==4){if(temp1[0]!=temp2[0]){$.ajaxq("whoal",{url:temp1[0]+"?leftmenu=1",cache:false,dataType:"html",success:function(data){$("#LeftNavBar").fadeOut("fast",function(){$("#LeftNavBar").empty().append(data);$("#LeftNavBar").fadeIn("fast");});}});$("#Level2").fadeOut("fast");beta="#"+temp1[0]+"-"+temp1[1];if(alpha!=beta){$(alpha).css('display','none');$(beta).css('display','block');alpha=beta;}}
if(temp1[1]!=temp2[1]){$.ajaxq("whoa",{url:temp1[0]+"-"+temp1[1]+"-"+temp1[2]+"/",cache:false,dataType:"html",success:function(data){$("#Level2").empty().append(data);}});}
$.ajaxq("whoa",{url:hash,cache:false,dataType:"html",success:function(data){$("#innercontent").fadeOut("fast",function(){$("#innercontent").empty().append(data);loadout();});$("#innercontent").fadeIn("fast");if(temp1[0]!=temp2[0]){$("#Level2").fadeIn("fast");}}});lastloaded=hash;}}}