$.cookie=function(b,k,n){if(typeof k!="undefined"){n=n||{};if(k===null){k="";n.expires=-1}var e="";if(n.expires&&(typeof n.expires=="number"||n.expires.toUTCString)){var f;if(typeof n.expires=="number"){f=new Date();f.setTime(f.getTime()+(n.expires*24*60*60*1000))}else{f=n.expires}e="; expires="+f.toUTCString()}var m=n.path?"; path="+(n.path):"";var g=n.domain?"; domain="+(n.domain):"";var a=n.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(k),e,m,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var l=document.cookie.split(";");for(var j=0;j<l.length;j++){var c=$.trim(l[j]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}return false};$.expr[":"].windows=function(a){return(/\.(asx|asf|wmv|wma|wmv|wpl)(\?.*)?$/i).test(a.getAttribute("url"))};$.expr[":"].real=function(a){return(/\.(rm|ra|ram)(\?.*)?$/i).test(a.getAttribute("url"))};$.expr[":"].flash=function(a){var b=(/\.(flv)(\?.*)?$/i);return(b.test(a.getAttribute("url"))||b.test(a.getAttribute("href")))};$.expr[":"].m4v=function(a){var b=(/\.(m4v)(\?.*)?$/i);return(b.test(a.getAttribute("url"))||b.test(a.getAttribute("href")))};$.expr[":"].jpeg=function(a){return(/\.(jpeg|jpg|jpe)(\?.*)?$/i).test(a.getAttribute("url"))};$.expr[":"].mp3=function(b){var a=(/\.(mp3)(\?.*)?$/i);return(a.test(b.getAttribute("url"))||a.test(b.getAttribute("href")))};$.expr[":"].low=function(b){var a=parseInt(b.getAttribute("bitrate"),10);return a<=56};$.expr[":"].medium=function(b){var a=parseInt(b.getAttribute("bitrate"),10);return a>56&&a<=512};$.expr[":"].high=function(b){var a=parseInt(b.getAttribute("bitrate"),10);return a>512};String.prototype.toTitleCase=function(){var a=this.toLowerCase();var c=a.split(" ");for(var b=0;b<c.length;b++){c[b]=c[b].charAt(0).toUpperCase()+c[b].slice(1)}return c.join(" ")};if(!window.encodeURIComponent){encodeURIComponent=function(a){return escape(a).replace(/\+/,"%2B")}}if(!window.decodeURIComponent){decodeURIComponent=function(a){return unescape(a.replace(/%2B/,"+"))}}function getQueryStringVariable(){var c=window.location.search.substring(1);var d=c.split("&");for(var b=0;b<getQueryStringVariable.arguments.length;b++){for(var a=0;a<d.length;a++){var e=d[a].split("=");if(e[0]==getQueryStringVariable.arguments[b]){return decodeURIComponent(e[1])}}}return""}preferences=[{name:"connection",possibleValues:["hi","lo"],defaultValue:"hi"},{name:"video",possibleValues:["inpage","wm","real"],defaultValue:"inpage"},{name:"audio",possibleValues:["inpage","wm","real","mp3"],defaultValue:"inpage"},{name:"timestamp",possibleValues:["relative","absolute"],defaultValue:"relative"},{name:"state",possibleValues:["nsw","vic","qld","wa","sa","tas","act","nt"],defaultValue:"nsw"},{name:"layout",possibleValues:["fixed","liquid"],defaultValue:"fixed"},{name:"nswregion",possibleValues:["","sydney","northcoast","midnorthcoast","newengland","newcastle","centralwest","illawarra","riverina","southeastnsw","brokenhill","westernplains","centralcoast","coffscoast"],defaultValue:""},{name:"vicregion",possibleValues:["","melbourne","goulburnmurray","gippsland","milduraswanhill","ballarat","westernvic","centralvic"],defaultValue:""},{name:"qldregion",possibleValues:["","brisbane","goldcoast","southqld","sunshine","widebay","capricornia","westqld","tropic","northqld","northwest","farnorth"],defaultValue:""},{name:"waregion",possibleValues:["","perth","southwestwa","southcoast","goldfields","wheatbelt","northwestwa","kimberley","greatsouthern","esperance"],defaultValue:""},{name:"saregion",possibleValues:["","adelaide","riverland","northandwest","southeastsa","eyre"],defaultValue:""},{name:"tasregion",possibleValues:["","hobart","northtas"],defaultValue:""},{name:"actregion",possibleValues:["","canberra"],defaultValue:""},{name:"ntregion",possibleValues:["","darwin","alicesprings","katherine"],defaultValue:""}];var preferencesCookie="newsPreferences";function preferenceSet(e,g){for(var f=0;f<preferences.length;f++){if(preferences[f].name==e){for(var d=0;d<preferences[f].possibleValues.length;d++){if(preferences[f].possibleValues[d]==g){var c=$.cookie(preferencesCookie);var l=[];if(c){l=c.split(";");for(var b=0;b<l.length;b++){var a=l[b].split("~");if(a[0]==e){l.splice(b,1)}}}l[l.length]=e+"~"+g;c=l.join(";");$.cookie(preferencesCookie,c,{expires:31,path:"/",domain:".abc.net.au"})}}}}}function preferenceGet(d){var c=$.cookie(preferencesCookie);if(c){var f=c.split(";");for(var e=0;e<f.length;e++){var b=f[e].split("~");if(b[0]==d){return b[1]}}}for(var a=0;a<preferences.length;a++){if(preferences[a].name==d){return preferences[a].defaultValue}}return null}function preferenceReset(){$.cookie(preferencesCookie,null,{path:"/",domain:".abc.net.au"})}function loadPreferences(){$("#preferencesPanel input:radio").each(function(){if(preferenceGet($(this).attr("name"))==$(this).val()){$(this).attr("checked","checked")}else{$(this).removeAttr("checked")}})}function closePreferences(){$("#preferencesPanel").slideUp("fast",function(){$(this).remove()})}function openPreferences(){if((!document.domain.match(/^([-a-zA-Z0-9.]+\.)?abc\.net\.au$/))||(document.domain.match(/^(search|upload|blogs|www2b)\.abc\.net\.au$/))){return true}if($("#preferencesPanel").length){closePreferences()}else{$("#nav").after('<div id="preferencesPanel"></div>');$("#preferencesPanel").hide().load("/news/assets/v5/includes/common/preferences.htm",function(){loadPreferences();$(this).slideDown("fast")})}return false}function enablePreferences(){$("#n-more div.drop ul:last").children("li.last").removeClass("last").end().append('<li class="last"><a id="preferencesButton" href="/news/preferences/">Site Preferences</a></li>');$("#preferencesButton").click(function(){return openPreferences()})}function savePreferences(){$("form#preferences input:radio:checked").each(function(){preferenceSet($(this).attr("name"),$(this).val())});alert("Your preferences have been saved.");setLayout();relativeTimestamps();closePreferences()}function resetPreferences(){if(confirm("Are you sure you want to clear your preferences and return to the default settings?")){alert("Your preferences have been reset.");preferenceReset();loadPreferences();setLayout();relativeTimestamps()}}inpageplayer="inpageplayer";iThing=(navigator.userAgent.indexOf("AppleWebKit")!=-1&&/(iPod|iPhone|iPad)/.test(navigator.userAgent));function showVideo_play(c,b,d,e,g){$(b).addClass("active").after('<div id="'+inpageplayer+'" class="videoplayer"></div>');var a;if(d.indexOf("%")!=-1){a=Math.round((parseInt(d,10)/100)*$(b).parent().width()/16*9)}else{a=Math.round(parseInt(d,10)/16*9)}$(window).unbind("resize").resize(function(){resize16x9(inpageplayer+"Object")});var f=new SWFObject("http://www.abc.net.au/news/swf/flvplayer.swf",inpageplayer+"Object",d,a,"8","#000000",true);f.addParam("allowFullScreen","true");f.addVariable("mediaURL",c);f.addVariable("autoPlay",e);f.write(inpageplayer);resize16x9(inpageplayer+"Object");if(g){if(g.indexOf("/news/")==-1){$("#"+inpageplayer).append('<p><small><a href="'+g+'" onclick="return popup(this.href, 950, 500);">View Transcript</a></small></p>')}}}function showVideo(b,a,d,e,c){if(!b||!a){return true}if(typeof a=="string"){a=$("#"+a).get(0)}if(!d){d="100%"}if(!e){e="true"}if(!c){c=null}$("#"+inpageplayer).remove();$(a).removeClass("active");if(typeof nowPlaying!="undefined"&&nowPlaying==b+"?"+c){delete nowPlaying}else{nowPlaying=b+"?"+c;if(b.indexOf(".flv")!=-1){showVideo_play(b,a,d,e)}else{if(b.indexOf(".xml")!=-1||b.indexOf(".rss")!=-1){var f=preferenceGet("video");if(f=="inpage"){f=(iThing?"m4v":"flash")}else{if(f=="wm"){f="windows"}else{if(f=="real"){f="real"}}}var g=preferenceGet("connection");if(g=="hi"){g="medium"}else{if(g=="lo"){g="low"}}b+=(b.indexOf("?")==-1?"?":"&")+Math.floor(new Date().getTime()/(1000*60*2));$.ajax({type:"GET",url:b,dataType:"xml",success:function(j){$(j).find((!c?"item:first":'item:has(guid:contains("'+c+'"))')).each(function(){var k=$(this).find("[nodeName=media:content]:"+f+":"+g).attr("url");var l=($(this).find("title").text()||$.trim(a.innerHTML.replace(/<[^>]+>/g,""))||document.title||"");trackVideo(k,l);if(preferenceGet("video")=="inpage"&&!iThing){showVideo_play(k,a,d,e,$(this).find('link:contains(".htm")').text())}else{$(document).ready(function(){location=k})}})}})}else{delete nowPlaying;trackVideo(b,($.trim(a.innerHTML.replace(/<[^>]+>/g,""))||document.title||""));location=b}}}if(a.blur){a.blur()}return false}function showAudio_play(c,b,d,e,g){$(b).addClass("active");if(d.indexOf("%")!=-1){d=Math.round((parseInt(d,10)/100)*$(b).parent().width())}if(d>285){d=285}var a=Math.round(d/285*40);$(b).after('<div id="'+inpageplayer+'" class="audioplayer"></div>');$(window).unbind("resize");var f=new SWFObject("http://www.abc.net.au/news/swf/mp3player.swf",inpageplayer+"Object",d,a,"8","#FFFFFF",true);f.addParam("allowFullScreen","true");f.addVariable("mediaURL",c);f.addVariable("autoPlay",e);f.write(inpageplayer);if(g){if(g.indexOf("/news/")==-1){$("#"+inpageplayer).append('<p><small><a href="'+g+'" onclick="return popup(this.href, 950, 500);">View Transcript</a></small></p>')}}}function showAudio(b,a,d,e,c){if(!b||!a){return true}if(typeof a=="string"){a=$("#"+a).get(0)}if(!d){d="100%"}if(!e){e="true"}if(!c){c=null}$("#"+inpageplayer).remove();$(a).removeClass("active");if(typeof nowPlaying!="undefined"&&nowPlaying==b+"?"+c){delete nowPlaying}else{nowPlaying=b+"?"+c;if(b.indexOf(".mp3")!=-1){showAudio_play(b,a,d,e)}else{if(b.indexOf(".xml")!=-1||b.indexOf(".rss")!=-1){var f=preferenceGet("audio");if(f=="mp3"){f="mp3"}else{if(f=="inpage"){f="mp3"}else{if(f=="wm"){f="windows"}else{if(f=="real"){f="real"}}}}b+=(b.indexOf("?")==-1?"?":"&")+Math.floor(new Date().getTime()/(1000*60*2));$.ajax({type:"GET",url:b,dataType:"xml",success:function(g){$(g).find((!c?"item:first":'item:has(guid:contains("'+c+'"))')).each(function(){var j=$(this).find("[nodeName=media:content]:"+f).attr("url");var k=($(this).find("title").text()||$.trim(a.innerHTML.replace(/<[^>]+>/g,""))||document.title||"");trackAudio(j,k);if(preferenceGet("audio")=="inpage"&&!iThing){showAudio_play(j,a,d,e,$(this).find('link:contains(".htm")').text())}else{$(document).ready(function(){location=j})}})}})}else{delete nowPlaying;trackAudio(b,($.trim(a.innerHTML.replace(/<[^>]+>/g,""))||document.title||""));location=b}}}if(a.blur){a.blur()}return false}function showPhotos(a){if(!a){return true}if(a.indexOf(".xml")!=-1||a.indexOf(".rss")!=-1){$.ajax({type:"GET",url:a,dataType:"xml",success:function(b){slideshow=[];slideshowIndex=0;var c=$("#storyPhotosImg");if(c.length){slideshow[slideshow.length]=new StoryPhoto(c.get(0).src,c.get(0).width,c.get(0).height,($("#storyPhotosCaption").length?$("#storyPhotosCaption").html():c.get(0).alt))}$(b).find("item").each(function(){var p=$(this).find("[nodeName=media:copyright]");var n=$(this).find("[nodeName=media:content]");var o=true;for(var l=0;l<n.length;l++){if(n.eq(l).attr("width")=="285"&&(n.eq(l).attr("url").match(/\.jpe?g$/i)||n.eq(l).attr("type").match(/^jpe?g/))){var e=[];var g=l;for(var d=0;d<n.length;d++){if(n.eq(d).attr("width")=="285"&&parseInt(n.eq(d).attr("height"),10)>parseInt(n.eq(g).attr("height"),10)){g=d}e[e.length]={src:n.eq(d).attr("url"),width:parseInt(n.eq(d).attr("width"),10),height:parseInt(n.eq(d).attr("height"),10)}}for(var f=0;f<slideshow.length;f++){if(slideshow[f].src==n.eq(l).attr("url")||slideshow[f].src==n.eq(g).attr("url")){o=false;slideshow[f]=new StoryPhoto(slideshow[f].src,slideshow[f].width,slideshow[f].height,slideshow[f].caption,e)}}if(o){slideshow[slideshow.length]=new StoryPhoto(n.eq(g).attr("url"),parseInt(n.eq(g).attr("width"),10),parseInt(n.eq(g).attr("height"),10),$(this).find("title").text()+(p.length?" ("+p.text()+")":""),e);o=false}}}});slideshowInit()}})}else{return true}return false}function slideshowInit(){if(typeof slideshow=="undefined"){return}if(typeof slideshowIndex=="undefined"){slideshowIndex=0}if(slideshow.length<1){return}else{if(slideshow.length>1){$("#storyPhotos").prepend('<p id="storyPhotosNav"><a id="storyPhotosNavPrev" href="javascript:slideshowPrev();">Previous</a><a id="storyPhotosNavNext" href="javascript:slideshowNext();">Next</a><span id="storyPhotosNavText"></span></p>')}}slideshowUpdate()}function slideshowNext(){if(typeof slideshow=="undefined"){return}if(slideshow.length<=1){return}if(typeof slideshowIndex=="undefined"){slideshowIndex=0}if(slideshowIndex<slideshow.length-1){slideshowIndex++}else{slideshowIndex=0}if(slideshowIndex<slideshow.length-2){var a=new Image();a.src=slideshow[slideshowIndex+1].src}slideshowUpdate()}function slideshowPrev(){if(typeof slideshow=="undefined"){return}if(slideshow.length<=1){return}if(typeof slideshowIndex=="undefined"){slideshowIndex=0}if(slideshowIndex>0){slideshowIndex--}else{slideshowIndex=slideshow.length-1}slideshowUpdate()}function slideshowUpdate(){if(typeof slideshow=="undefined"){return}if(slideshow.length<1){return}if(typeof slideshowIndex=="undefined"){slideshowIndex=0}var a,b,c;$("#storyPhotosLink img").each(function(d){$("#storyPhotosNavText").html("Slideshow: Photo "+(slideshowIndex+1)+" of "+slideshow.length);$("#storyPhotosLink").attr("href",slideshow[slideshowIndex].versions[slideshow[slideshowIndex].biggest].src).unbind("click").click(function(){var e=slideshow[slideshowIndex].versions[slideshow[slideshowIndex].best];imgWindow(e.src,null,e.width,e.height,slideshow[slideshowIndex].caption);return false});if($(this).attr("src")!=slideshow[slideshowIndex].src){$(this).animate({opacity:0},250,function(){$(this).attr({height:slideshow[slideshowIndex].height,src:slideshow[slideshowIndex].src,title:slideshow[slideshowIndex].caption,width:slideshow[slideshowIndex].width,alt:$(this).attr("title")}).animate({opacity:1},250);$("#storyPhotosCaption").html(slideshow[slideshowIndex].caption)})}})}function StoryPhoto(f,e,b,c,a){this.src=f;this.width=e;this.height=b;this.caption=c;if(a){this.versions=a;this.biggest=0;this.best=0;for(var d=0;d<a.length;d++){if(a[this.biggest].width*a[this.biggest].height<a[d].width*a[d].height){this.biggest=d}if(a[this.best].width*a[this.best].height<a[d].width*a[d].height&&a[d].width<screen.width-170){this.best=d}}}}function imgWindow(l,e,b,k,g,m){if(!e){e="abcnewspopup"+new Date().getTime()}if(!m){m=g}var a=b+120;var d=Math.min(k+160,screen.height-120);var c=screen.width/2-a/2;var f=screen.height/2-d/2;h=[];h.push('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');h.push("<html><head><title>"+g+"</title></head><body>");h.push('<style type="text/css">* {font-family:Verdana,Arial,Helvetica,sans-serif;font-size:100%;color:white;line-height:133%;}html, body {height:100%;margin:0;padding:0;background-color:#222;border:none;}body {font-size:75%;text-align:center;}div.image {max-width:100%;padding:40px 0 30px 0;x-border-bottom:2px solid white;}div.image img {border:3px solid white;}p {margin:0 25px;padding-bottom:8px;}div.caption {padding-top:8px;}a {color:#ccc;}</style>');h.push('<div class="image"><img src="'+l+'" width="'+b+'" height="'+k+'" alt="'+g+'" title="'+g+'" /></div>');h.push('<div class="caption">');h.push("<p>"+m+"</p>");h.push('<p style="font-size:smaller;"><a href="javascript:window.parent.close();">Close Image</a></p></div>');h.push("</body></html>");var j=window.open("",e,"width="+a+",height="+d+",toolbar=0,resizable=1,scrollbars=1,left="+c+",top="+f);j.document.write(h.join("\n"));j.document.close();if(window.focus){j.focus()}return false}function resize16x9(a){$("#"+a).each(function(){w=$(this).width();h=Math.round((w/16)*9);$(this).height(h)})}function showGallery(b,a,c){if(typeof a=="undefined"){return true}else{if(typeof a=="string"){a=document.getElementById(a)}}if(typeof c=="undefined"){c=false}var e=document.createElement("DIV");e.id=inpageplayer;e.className="galleryplayer";a.parentNode.insertBefore(e,a.nextSibling);var d=new SWFObject("/news/swf/slideshowpro/slideshowpro.swf","slideshowpro","100%",510,"8","#000000",true);d.addParam("allowFullScreen","true");d.addVariable("paramXMLPath","/news/swf/slideshowpro/params.xml");d.addVariable("galleryAppearance","Hidden");d.addVariable("startup","Load Album");d.addVariable("navButtonsAppearance","Hide Gallery Button");d.addVariable("captionElements","Caption Only");if(typeof b!="undefined"){d.addVariable("xmlFilePath",b)}if(c){d.addVariable("startMode","album")}d.write(inpageplayer);return false}function showMap(a,c,e,d,b){if(!a||!e||!d){return true}if(!c){c="100%"}if(!b){b=""}if($(a).next().hasClass("map")){$(a).removeClass("active").next().remove()}else{$(a).addClass("active").after('<div id="inpagemap" class="map" style="width: '+c+'; height: 1px;"><iframe src="http://www.abc.net.au/news/maps/smallmap.htm?latitude='+encodeURIComponent(e)+"&amp;longitude="+encodeURIComponent(d)+"&amp;caption="+encodeURIComponent(b)+'" width="100%" height="100%" frameborder="0" scrolling="no"></iframe></div>');resize16x9("inpagemap")}$(a).blur();return false}var watchlistCookie="newsMyTags";function watchlistAdd(b){lbRemove();if(watchlistExists(b)){return false}var a=$.cookie(watchlistCookie);$.cookie(watchlistCookie,(a?a+";"+b:b),{expires:365,path:"/",domain:".abc.net.au"});if(!watchlistExists(b)){a=$.cookie(watchlistCookie);if(!a){alert("Sorry, this tag could not be added.\n\nPlease ensure that cookies are enabled in your web browser.")}else{alert("Sorry, this tag could not be added.\n\nYou may have too many items in My Tags.")}}else{populateWatchlist(b)}return false}function watchlistRemove(e){lbRemove();var a=$.cookie(watchlistCookie);if(!a){return false}var d=false;var c=a.split(";");for(var b=0;b<c.length;b++){if(e==c[b]){c.splice(b,1);d=true}}a=c.join(";");if(a==""){a=" "}$.cookie(watchlistCookie,a,{expires:365,path:"/",domain:".abc.net.au"});if(!d){alert("Sorry, tag could not be removed.")}else{populateWatchlist()}return false}function watchlistExists(d){var a=$.cookie(watchlistCookie);if(!a){return false}var c=a.split(";");for(var b=0;b<c.length;b++){if(d==c[b]){return true}}return false}function populateWatchlist(c){var a="environment;government-and-politics;health;indigenous;offbeat;science-and-technology;community-and-society;law-crime-and-justice";$("#my-topics").removeClass("active");var b=$.cookie(watchlistCookie);if(!b){b=a}$.cookie(watchlistCookie,b,{expires:365,path:"/",domain:".abc.net.au"});if($("#n-mytopics").length<1){$("#additional-nav").append('<li id="n-mytopics" class="dropdown"><a href="#">My Topics</a><div class="drop"><div class="bar"><a href="/news/tag/">View all topics</a> | <a href="/news/tag/cloud.htm">Topics cloud</a></div><div id="watchlist"></div></div></li>');$("#n-mytopics > a").click(function(){return false})}$("#watchlist").each(function(){$(this).html("");var d=false;var f="";if($.trim(b)!=""){var g=$.trim(b).split(";");for(var e=0;e<g.length;e++){if(c){if(c==g[e]){d=e}}f+='<li id="myt'+e+'"><a href="http://www.abc.net.au/news/tag/'+g[e]+'/">'+g[e].replace(/-/g,"-<wbr></wbr>")+"</a></li>"}if(f!=""){f="<ul>"+f+"</ul>"}}$(this).html(f);if(d!==false){$("#myt"+d).animate({fontSize:"200%"},750).animate({fontSize:"100%"},750)}tagPageMyTags()});if($("#my-topics").length){$(window).bind("scroll.my-topics evt.my-topics",function(){if($.inviewport($("#my-topics"),{threshold:200})){if(!$("#my-topics").hasClass("active")){$("#my-topics").addClass("active").load("/news/assets/v5/includes/homepage/my-topics.htm?topics="+$.trim(b),function(){processLinks();$(window).unbind(".my-topics")})}}}).trigger("evt")}processLinks()}function tagPageMyTags(){if(document.URL.match(/\/tag\/[^\.]+\//)){tagname=document.URL.replace(/^.*\/tag\//,"").replace(/\/.*$/,"");$("#watchlistAdd").each(function(){if(watchlistExists(tagname)){$(this).html("Remove from My Tags").click(function(){return watchlistRemove(tagname)})}else{$(this).html("Add to My Tags").click(function(){return watchlistAdd(tagname)})}});$("#tp").remove();$("#tl").before('<p id="tp">'+(watchlistExists(tagname)?'<a href="#" onclick="watchlistRemove(tagname);">Remove \''+tagname.replace(/-/g,"-<wbr></wbr>")+"' from My Tags</a>":'<a href="#" onclick="watchlistAdd(tagname);">Add \''+tagname.replace(/-/g,"-<wbr></wbr>")+"' to My Tags</a>")+"</p>")}}function lbRemove(){$("#linkButton").remove()}function lbStartTimeout(){lbTimeout=window.setTimeout("lbRemove();",1500)}function lbAbortTimeout(){if(window.lbTimeout){window.clearTimeout(lbTimeout)}}function processLinks(){var a=(/(news|news_dev)\/tag\/[-'A-Za-z0-9]+\/?$/);$("a").each(function(){if(a.test($(this).attr("href"))&&($.trim($(this).text())!="")&&$(this).is(":not(.button)")){myTagsLink(this)}})}function myTagsLink(a){$(a).mouseout(lbStartTimeout).mouseover(function(){if(typeof lbAbortTimeout=="function"){lbAbortTimeout()}if(typeof lbRemove=="function"){lbRemove()}var e="right";if(this.parentNode.nodeName.match(/^(li|h[1-6])$/i)){var b=$.trim(this.parentNode.innerHTML.replace(/<[^>]+>/g,""));var d=$.trim(this.innerHTML.replace(/<[^>]+>/g,""));if(b.indexOf(d)==0){e="left"}}if(this.parentNode.scrollWidth==this.scrollWidth){e="left"}var f=this.href.replace(/^.*\/tag\//,"").replace(/\/.*$/,"");var c;if(typeof watchlistExists=="function"&&watchlistExists(f)){c='<a id="linkButton" class="lb_'+e+'_remove_green" title="Remove '+f+' from My Tags" href="javascript:void(0);" onclick="watchlistRemove(\''+f.replace(/'/g,"'")+"');\"> </a>"}else{c='<a id="linkButton" class="lb_'+e+'_add_green" title="Add '+f+' to My Tags" href="javascript:void(0);" onclick="watchlistAdd(\''+f.replace(/'/g,"'")+"');\"> </a>"}if(e=="left"){$(this).before(c)}else{$(this).after(c)}$("#linkButton").mouseover(lbAbortTimeout).mouseout(lbStartTimeout)})}function storytools(){var a=$("#comments:first h2:first").text();$("#storytools").each(function(){$(this).prepend('<a class="button" href="javascript:printStory();"><span>Print</span></a> ').append(' <a class="button" href="javascript:shareStory();"><span>Share</span></a>');if(a){$(this).append(' <a class="button" href="#comments"><span>'+$("#comments:first h2:first").text()+"</span></a>")}})}function printStory(){if($("#printStoryDialog").length){return}var b=$("#storyPhotos");var d=$("#comments");var c=[];if(b.length){c[c.length]='<input type="checkbox"'+(b.hasClass("noprint")?"":' checked="checked"')+' class="checkbox" id="printsp" /> <label for="printsp">Include photo</label>'}if(d.length){c[c.length]='<input type="checkbox"'+(d.hasClass("noprint")?"":' checked="checked"')+' class="checkbox" id="printsc" /> <label for="printsc">Include comments</label>'}if(c.length){var a="";$("#storytools").after('<div style="display: none;" id="printStoryDialog" class="dialog noprint"><p><strong>Print Options</strong></p><p>'+c.join("<br />")+'</p><p><input type="button" class="button" value="OK" onclick="printStoryClose();window.print();" /> <input type="button" class="button" value="Cancel" onclick="printStoryClose();" /></p></div>');$("#printsp").click(function(){if(this.checked){b.removeClass("noprint")}else{b.addClass("noprint")}});$("#printsc").click(function(){if(this.checked){d.removeClass("noprint")}else{d.addClass("noprint")}});$("#printStoryDialog").slideDown("fast")}else{window.print()}}function printStoryClose(){$("#printStoryDialog").slideUp("fast",function(){$(this).remove()})}function shareStory(){if($("#shareStoryDialog").length){return}var a=encodeURIComponent(document.URL);var b=encodeURIComponent($("meta[name=DC.title]").attr("content"));var c=encodeURIComponent($("meta[name=DC.description]").attr("content"));$("#storytools").after('<div style="display: none;" id="shareStoryDialog" class="dialog noprint"><p><strong>Share this story</strong></p><p>Please select the social bookmarking site you wish to share this story on:</p><ul><li><a href="http://delicious.com/save?url='+a+"&amp;title="+b+"&amp;v=5&amp;notes="+c+'" onclick="return popup(this.href, 950, 600, \'deliciousuiv5\');">Delicious</a></li><li><a href="http://digg.com/remote-submit?url='+a+"&amp;title="+b+"&amp;bodytext="+c+'&amp;topic=world_news" onclick="return popup(this.href, 700, 500, \'digg\');">Digg</a></li><li><a href="http://www.facebook.com/sharer.php?u='+a+"&amp;t="+b+'" onclick="return popup(this.href, 700, 500, \'facebook\');">Facebook</a></li><li><a href="http://www.kwoff.com/submit.php?url='+a+"&amp;title="+b+'" onclick="return popup(this.href, 1020, 600, \'kwoff\');">Kwoff</a></li><li><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url='+a+"&amp;title="+b+"&amp;summary="+c+"&amp;source="+encodeURIComponent("ABC News")+'" onclick="return popup(this.href, 520, 570, \'linkedin\');">LinkedIn</a></li><li><a href="http://www.myspace.com/Modules/PostTo/Pages/?u='+a+"&amp;t="+b+"&amp;c="+c+'&amp;l=1" onclick="return popup(this.href, 850, 700, \'myspace\');">MySpace</a></li><li><a href="http://www.reddit.com/submit?url='+a+"&amp;title="+b+'" onclick="return popup(this.href, 800, 500, \'reddit\');">Reddit</a></li><li><a href="http://www.stumbleupon.com/submit?url='+a+"&amp;title="+b+'" onclick="return popup(this.href, 900, 500, \'stumbleupon\');">StumbleUpon</a></li><li><a href="http://twitter.com/home?status='+b+"%20"+a+'%20%40abcnews" onclick="return popup(this.href, 900, 600, \'twitter\');">Twitter</a></li></ul><p><input type="button" class="button" value="Cancel" onclick="shareStoryClose();" /></p></div>');$("#shareStoryDialog").slideDown("fast")}function shareStoryClose(){$("#shareStoryDialog").slideUp("fast",function(){$(this).remove()})}function processImages(){$("img[alt]:not([title])").each(function(){$(this).attr("title",$(this).attr("alt"))})}function setLayout(){if(location.search.indexOf("layout=popup")!=-1){$("html").addClass("popup")}if(preferenceGet("layout")=="liquid"||location.search.indexOf("layout=liquid")!=-1){$("html").addClass("liquid")}else{$("html").removeClass("liquid")}}setLayout();function copyfit(r,q,l,m,c){if(typeof r=="string"){r="#"+r}if(typeof q=="string"){q="#"+q}if(typeof l=="string"){l="#"+l}if(typeof l=="undefined"){l=$(r).parent().find("ul").eq(0)}if(typeof m=="undefined"){m=3}if(typeof c=="string"){c="#"+c}var o=$(r);var n=$(q);var j=$(l);var g;var e;if(contains(o,j)){g=o;e=n}else{if(contains(n,j)){g=n;e=o}else{return}}if(c){$(c).find("a").each(function(){var t=j.children();if(!contains(j,this)){var s=this.href.replace(/^https?:\/\/[^\/]+/,"").replace(/(\?.*)?^/,"");if(s.length>=7){t.filter(':has(a[href*="'+s+'"])').each(function(){$(this).remove()})}}})}var k=j.children();var d=k.length;var f=false;while(!f){if(d<=m){f=true}else{var p=k.eq(d-1);var a=g.outerHeight()-e.outerHeight();var b=a-p.outerHeight();if(Math.abs(b)<Math.abs(a)){p.hide();d--}else{f=true}}}k.filter(":lt("+d+")").show()}function popup(b,d,a,c){if(!d){d=600}if(!a){a=400}if(!c){c="abcnewspopup"+new Date().getTime()}if(b.indexOf("?")!=-1){b+="&"}else{b+="?"}b+="layout=popup";var f=screen.width/2-d/2;var e=screen.height/2-a/2;window.open(b,c,"width="+d+",height="+a+",toolbar=0,resizable=1,scrollbars=1,left="+f+",top="+e);return false}function tabLoad(d,c,b,a){if(typeof c=="string"){c=$("#"+c)}setClassUnsetSiblings(d.parentNode,"active");c.html("").addClass("ajaxLoading").load(b,function(){$(this).removeClass("ajaxLoading");a()});if(d.blur){d.blur()}return false}function highlightScrollerMoveTo(b,a){highlightScroller[b+"_current"]=a;displayThisHideSiblings(b+"_"+highlightScroller[b+"_current"]);setClassUnsetSiblings(b+"_show_"+highlightScroller[b+"_current"],"active")}function highlightScrollerMoveBy(b,a){highlightScroller[b+"_current"]+=a;if(highlightScroller[b+"_current"]>=highlightScroller[b+"_length"]){highlightScroller[b+"_current"]-=highlightScroller[b+"_length"]}else{if(highlightScroller[b+"_current"]<0){highlightScroller[b+"_current"]+=highlightScroller[b+"_length"]}}displayThisHideSiblings(b+"_"+highlightScroller[b+"_current"]);setClassUnsetSiblings(b+"_show_"+highlightScroller[b+"_current"],"active")}function highlightScrollerGenerate(a){if(!window.highlightScroller){highlightScroller=new Object()}$("#"+a).eq(0).each(function(){var g=[];var b,e;if($(this).hasClass("thumbnailscroller")){b=["c20l","c20l","c20l","c20l","c20r"]}else{b=["c50l","c50r"]}var l=$(this).find("div.section, div.headline, span.section");for(var f=0;f<l.length;f+=b.length){e=(f/b.length);highlightScroller[a+"_length"]=e+1;g[g.length]='<div id="'+a+"_"+e+'" class="subcolumns">';for(var d=0;d<b.length;d++){if(l.eq(f+d).length){g[g.length]='<div class="'+b[d]+'"><div class="'+l.eq(f+d).attr("class")+'">'+l.eq(f+d).html()+"</div></div>"}}g[g.length]="</div>"}$(this).html(g.join(""));if(l.length>b.length){g=[];g[g.length]='<div id="'+a+'_controls" class="highlightscrollercontrols"><a id="'+a+'_show_prev" href="javascript:void(0);" onclick="highlightScrollerMoveBy(\''+a+'\', -1);" class="prev"><img src="/news/assets/v5/images/common/blank.gif" width="26" height="16" /></a>';for(var c=0;c<l.length;c+=b.length){e=c/b.length;g[g.length]='<a id="'+a+"_show_"+e+'" href="javascript:void(0);" onclick="highlightScrollerMoveTo(\''+a+"', "+e+');"><img src="/news/assets/v5/images/common/blank.gif" width="16" height="16" /></a>'}g[g.length]='<a id="'+a+'_show_next" href="javascript:void(0);" onclick="highlightScrollerMoveBy(\''+a+'\', 1);" class="next"><img src="/news/assets/v5/images/common/blank.gif" width="26" height="16" /></a></div>';$(this).after(g.join(""))}highlightScrollerMoveTo(a,0)})}function formFocus(){$(":input").eq(0).focus()}function contains(d,c){d=$(d).get(0);c=$(c).get(0);while(c&&(d!=c)&&(c!=null)){c=c.parentNode}return d==c}function displayThisHideSiblings(a){if(typeof a=="undefined"){return}if(typeof a=="string"){a="#"+a}$(a).show().siblings("*").hide()}function setClassUnsetSiblings(b,a){if(typeof b=="undefined"){return}if(typeof b=="string"){b="#"+b}$(b).addClass(a).siblings("*").removeClass(a)}function setCountersSourceHit(){if(!(/(start_rank|www2b)/g).test(document.URL)){$("img#imgCounter").attr("src","http://www2b.abc.net.au/Counters/Client/Hit.aspx?"+encodeURIComponent(document.URL))}}function setActiveNav(){$("#nav").each(function(a){if(typeof activenav=="string"){setClassUnsetSiblings("n-"+activenav,"active")}else{if(getQueryStringVariable("section")!=""){setClassUnsetSiblings("n-"+getQueryStringVariable("section"),"active")}else{if(window.location.pathname=="/news/"||window.location.pathname=="/news/default.htm"){setClassUnsetSiblings("n-newshome","active")}else{var c=["justin","australia","world","business","sport","entertainment","weather","opinion","blogs","video","audio","photos","feeds","alerts"];for(var b=0;b<c.length;b++){if(window.location.pathname.indexOf("/news/"+c[b]+"/")==0){setClassUnsetSiblings("n-"+c[b],"active");return}}}}}})}function textInputHint(b,a,c){if(typeof b=="string"){b=document.getElementById(b)}if(typeof c=="undefined"){c="hint"}b.defaultText=a;b.defaultClass=c;b.blur(function(){if(this.value==""||this.value==this.defaultText){$(this).addClass(this.defaultClass);this.value=this.defaultText}});b.blur();b.focus(function(){if(this.value==this.defaultText){$(this).removeClass(this.defaultClass);this.value=""}});if(b.form){if(typeof b.form.textInputHints=="undefined"){b.form.textInputHints=new Array()}b.form.textInputHints[b.form.textInputHints.length]=b;b.form.submit(function(){for(var d=0;d<this.textInputHints.length;d++){this.textInputHints[d].onfocus()}})}}function loadCSS(a,c){var b=document.createElement("LINK");b.rel="stylesheet";b.type="text/css";b.href=a;if(typeof c!="undefined"){b.media=c}document.getElementsByTagName("HEAD")[0].appendChild(b)}function loadJS(a){var b=document.createElement("SCRIPT");b.type="text/javascript";b.src=a;document.getElementsByTagName("HEAD")[0].appendChild(b)}function autoRefresh(a){if(typeof a=="undefined"){a=10}setInterval("if (new Date().getTime() >= "+(new Date().getTime()+(1000*60*a))+") if (!document.getElementById(inpageplayer)) location.replace(document.URL)",1000*20)}function daylightSavings(a){var e;var d=a.getTime();var c=new Array("October 28, 2001","March 31, 2002","October 27, 2002","March 30, 2003","October 26, 2003","March 28, 2004","October 31, 2004","March 27, 2005","October 30, 2005","April 2, 2006","October 29, 2006","March 25, 2007","October 28, 2007","April 6, 2008","October 5, 2008","April 5, 2009","October 4, 2009","April 4, 2010","October 3, 2010","April 3, 2011","October 2, 2011","April 1, 2012","October 7, 2012","April 7, 2013","October 6, 2013","April 6, 2014","October 5, 2014","April 5, 2015","October 4, 2015","April 3, 2016","October 2, 2016","April 2, 2017");for(var b=0;b<c.length;b++){if(Date.parse(c[b]+" 02:00:00")<d){e=(b%2==0)}else{return e}}return false}function relativeTimestamps(){if(!window.servertimestamp){return}var c=new Date().getTime();if(!window.clientTimeLoad){clientTimeLoad=c}var f=c-clientTimeLoad;var a=true;if(preferenceGet("timestamp")!="relative"){a=false}var l=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];var b=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var j,d,g,k;var e;$("span.cominguptimestamp").each(function(o){if((typeof $(this).attr("ts")!="undefined"||$(this).text().match(/^[0-9]{1,2}:[0-9]{2}(am|pm)$/))){if(typeof $(this).attr("ts")=="undefined"){var r,q,n;q=parseInt($(this).text().replace(/:.*$/,""),10);if(q<12&&$(this).text().indexOf("pm")!=-1){q+=12}else{if(q==12&&$(this).text().indexOf("am")!=-1){q=0}}n=parseInt($(this).text().replace(/^.*:/,"").replace(/(am|pm)$/,""),10);e=new Date();e.setHours(q,n,0);$(this).attr("ts",e)}else{e=new Date($(this).attr("ts"))}var p=(e.getTime()-servertimestamp.getTime()-f)/1000;if(a&&p<60*31){d=Math.floor(p/60);$(this).text(d<1?"Now":d+(d==1?" min":" mins"))}else{$(this).text((e.getHours()>12?e.getHours()-12:(e.getHours()==0?12:e.getHours()))+":"+(e.getMinutes().toString().length==1?"0":"")+e.getMinutes()+(e.getHours()>11?"pm":"am"))}}});$("span.timestamp").each(function(m){if((typeof $(this).attr("ts")!="undefined"||$(this).text().match(/^[a-zA-Z]+ [0-9]+, [0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2}$/))){if(typeof $(this).attr("ts")=="undefined"){e=new Date($(this).text());$(this).attr("ts",e)}else{e=new Date($(this).attr("ts"))}var n=(servertimestamp.getTime()-e.getTime()+f)/1000;if(a&&(n<60*60*12)){var o;if(n<0){o=""}else{if(n<=60){j=Math.floor(n);o=j+" second"+(j==1?"":"s")}else{if(n<=60*60){d=Math.floor(n/60);o=d+" minute"+(d==1?"":"s")}else{if(n<=60*60*24){d=Math.floor(n/60)%60;g=Math.floor(n/60/60);o=g+" hour"+(g==1?"":"s")+" "+d+" minute"+(d==1?"":"s")}else{g=Math.floor(n/60/60)%24;k=Math.floor(n/60/60/24);o=k+" day"+(g==1?"":"s")+" "+g+" hour"+(g==1?"":"s")}}}}$(this).text(o==""?"":o+" ago")}else{$(this).text(l[e.getDay()]+" "+b[e.getMonth()]+" "+e.getDate()+", "+e.getFullYear()+" "+(e.getHours()>12?e.getHours()-12:(e.getHours()==0?12:e.getHours()))+":"+(e.getMinutes().toString().length==1?"0":"")+e.getMinutes()+(e.getHours()>11?"pm":"am")+" "+(daylightSavings(e)?"AEDT":"AEST"))}}});$("span.age").each(function(m){if(typeof $(this).attr("ts")!="undefined"||jQuery.trim($(this).text()).match(/^[a-zA-Z]+ [0-9]+, [0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2}$/)){if(typeof $(this).attr("ts")=="undefined"){e=new Date($.trim($(this).text()));$(this).attr("ts",e)}else{e=new Date($(this).attr("ts"))}var n=(servertimestamp.getTime()-e.getTime()+f)/1000;if(n<60*60*9){var o;if(n<0){o=""}else{if(n<=60){o="<1min"}else{if(n<=60*60){d=Math.floor(n/60);o=d+"min"}else{g=Math.floor(n/60/60);o=">"+g+"hr"}}}$(this).text(o)}else{$(this).text(">9hr")}}});relativeTimestampsTimeout=window.setTimeout("relativeTimestamps()",1000*60)}function lightboxCreate(a,b,c){if(typeof a=="undefined"){a=400}if(typeof b=="undefined"){b=224}if(typeof c=="undefined"){c=""}lightboxClose();$("body").append('<div id="lightbox"><div id="lb-dimmer""></div><div id="lb-dialog"><p><a href="#">Close</a>'+c+'</p><div id="lb-content"></div></div></div>');$("#lb-dimmer").click(lightboxClose).css({height:$("body").height()+"px",width:$("body").width()+"px",opacity:"0.5"});$("#lb-dialog").css({height:b+"px",width:a+"px"}).find("a").click(function(){lightboxClose();return false});lightboxPos();onscroll=function(){lightboxPos()};return $("#lb-content").get(0)}function lightboxPos(){$("#lb-dialog").css({left:(($(window).width()-$("#lb-dialog").outerWidth())/2)+$(window).scrollLeft()+"px",top:(($(window).height()-$("#lb-dialog").outerHeight())/2)+$(window).scrollTop()+"px"})}function lightboxClose(){$("#lightbox").remove();onscroll=function(){};if(typeof nowPlaying!="undefined"){delete nowPlaying}}function bestOfAbcInit(){$("#best-of-abc, #bestOfABC").find("a:flash").each(function(a){$(this).attr({flv:$(this).attr("href"),href:"/news/video/bestofabc.htm?file="+$(this).attr("href")}).click(function(){var b=lightboxCreate(420,258,"Best of abc.net.au");b.innerHTML='<div id="lb-anchor"></div>';showVideo($(this).attr("flv"),"lb-anchor");return false})}).end().find("a:mp3").each(function(a){$(this).attr({mp3:$(this).attr("href"),href:"/news/audio/bestofabc.htm?file="+$(this).attr("href")}).click(function(){var b=lightboxCreate(325,80,"Best of abc.net.au");b.innerHTML='<div style="width: 285px; height: 50px; padding: 5px 20px; background-color: #FFF;"><div id="lb-anchor" style="width:285px; height:1px; overflow:hidden;"></div></div>';showAudio($(this).attr("mp3"),"lb-anchor");return false})})}function pullquotes(){if(/news\/stories\/[0-9]{4}.*/.test(document.URL)&&typeof jQuery!="undefined"){$("#article span.pullquote").each(function(){var a=$(this).html().replace(/(^[ "']+|[ "']+$)/g,"");var e=$(this).attr("from");var c='<div class="pullquote"><p class="quote">'+a+"</p>"+(typeof e=="undefined"?"":'<p class="from">&ndash; '+e+"</p>")+"</div>";var d=$(this).attr("after");if(typeof d=="undefined"){d="media"}if(d.match(/^[0-9]+$/)){var b=parseInt($(this).attr("after"),10)-1;$p=$("#article p.first, #article p.first ~ p[class!=first][class!=tags]").filter(":eq("+b+")");if($p.length){$p.after(c)}else{d="media"}}if(d=="headline"){$("#article h1").filter(":eq(0)").after(c)}if(d=="media"){if($("#storyRelatedMedia").length==0){$("#article p.first").filter(":eq(0)").before('<div id="storyRelatedMedia"></div>')}$("#storyRelatedMedia").append(c)}})}}function createCycler(c,e,d,m,l){if(!l){l=1}var g=c.children("ol");if(g.length===0){g=c.children("ul")}var j=g.children("li").length;if(j>l){c.append('<div class="fade-left"></div><div class="fade-right"></div>').addClass("cycler");g.children("li:gt("+(l-1)+")").hide().end().children("li:first").addClass("f");if(e===true){var a=setInterval(function(){updateCycler(g,m,l)},d);c.hover(function(){clearInterval(a)},function(){clearInterval(a);a=setInterval(function(){updateCycler(g,m,l)},d)})}var k="";g.children().each(function(n){k+="<li>"+(n+1)+"</li>"});c.append('<div class="controls"><a href="#" class="prev" title="Previous">Previous</a><a href="#" class="next" title="Next">Next</a><div class="status"><span class="current">1</span> of '+j+'</div><ol class="bullets">'+k+"</ol></div>");c.find("div.controls a").click(function(){if($(this).closest("div.cycler").children("ol, ul").children("li:animated").length==0){clearInterval(a);if($(this).hasClass("prev")){updateCycler(g,m,l,"reverse")}else{updateCycler(g,m,l)}}return false});var f=c.children("div.controls");if(f.children("ol.bullets:visible").length){var b=f.children("ol.bullets").outerWidth()+56;f.width(b).css({"margin-left":"-"+(b/2)+"px"})}animateCycler(g,m,l)}else{c.addClass("non-cycler")}}function updateCycler(d,c,a,e){if($(d).is(":in-viewport")){var b;if(e=="random"){}else{if(e=="reverse"){b=getPrevInCycle(d.children("li.f:first"))}else{b=getNextInCycle(d.children("li.f:first"))}}d.children("li.f").removeClass("f");b.addClass("f");animateCycler(d,c,a,e)}}function animateCycler(f,n,l,k){f.children("li.active").removeClass("active");var a=getCycleItems(f.children("li.f:first"),l);for(var d=0;d<a.length;d++){a[d].addClass("active")}f.parent().find("div.controls div.status span.current").text(f.children("li").index(f.children("li.f"))+1).end().find("div.controls ol.bullets li.active").removeClass("active").end().end().children("li.active").each(function(){f.parent().find("div.controls ol.bullets li:eq("+f.children("li").index(this)+")").addClass("active")});if(n=="slide-horizontal"){var e=f.parent().outerWidth();var g=Math.floor(e/l);var m;var c;if(k==="reverse"){m="-"+g+"px";c=e+"px"}else{m=e+"px";c="-"+g+"px"}f.children("li.active:hidden").css({left:m}).show();f.children("li:not(.active):visible").animate({left:c,opacity:0},1500,function(){$(this).not(".active").hide()});for(var b=0;b<a.length;b++){a[b].animate({left:(b*g)+"px",opacity:1},1500)}}else{if(n=="fade"){f.children("li:not(.active):visible").stop(true,true).fadeOut("slow").end().children("li.active:hidden").fadeIn("slow")}else{f.children("li:not(.active):visible").stop(true,true).hide().end().children("li.active:hidden").show()}}}function getCycleItems(e,a){var d=[];var c=e;for(var b=0;b<a;b++){d[b]=c;c=getNextInCycle(c)}return d}function getNextInCycle(a){i=a.next();if(i.length===0){return a.parent().children(":first")}else{return i}}function getPrevInCycle(a){i=a.prev();if(i.length===0){return a.parent().children(":last")}else{return i}}function initRegionSelector(){var a=/\/news\/(\w{1,})\//i.exec(document.URL);if(a){var b=a[1];var c=preferenceGet(b+"region");if(c){updateRegion(b,c)}$("#local-news select").change(function(){$(this).children("option:selected:first").each(function(){if($(this).val()){var d=/^\/news\/(\w{1,})\/(\?region=(\w{1,})|)$/i.exec($(this).val());var e=d[3];if(e){updateRegion(b,e)}}})})}}function updateRegion(a,b){$("#local-news div.inner").children("div.local-content").load("/news/assets/v5/includes/common/tool-local-news-content.htm?state="+a+"&amp;region="+b,function(){copyfit("headlines","tools1","local-news ul",2);$("#local-news").find("a.change").click(function(){$("#local-news div.local-content").load("/news/assets/v5/includes/common/tool-local-news-map.htm?state="+a,function(){$("#local-news select").change(function(){$(this).children("option:selected:first").each(function(){if($(this).val()){var c=/^\/news\/(\w{1,})\/(\?region=(\w{1,})|)$/i.exec($(this).val());var d=c[3];if(d){updateRegion(a,d)}}})})});return false}).end().find("a.local-link").attr({href:"/"+b+"/"}).children("img").attr({src:"/news/assets/v5/images/common/local-promos/"+b+".jpg"})});preferenceSet(a+"region",b)}function chooseLocation(c,b){b=b.toLowerCase();var a=/\/news\/(\w{1,})\//i.exec(document.URL);if(b!=a[1]){preferenceSet(b+"region",c);window.location="/news/"+b+"/"}else{updateRegion(b,c)}}function initLocalNews(){$("div.local div.change a").live("click",function(){$("div.local").load("/news/assets/v5/includes/homepage/local-news-picker.htm",function(){initLocalNews()});return false});$("#local-news-picker div.state select").change(function(){var a=$(this).val();$("#local-news-picker div.weather-region select").attr({disabled:"disabled"});if($(this).children(":selected:first-child").length==0){$("#local-news-picker div.region").load("/news/assets/v5/includes/homepage/region-select.htm?state="+a,function(){$(this).children("select").change(function(){var b=$(this).val();if($(this).children(":selected:first-child").length==0){$("#local-news-picker div.weather-region").load("/news/assets/v5/includes/homepage/weather-region-select.htm?state="+a+"&region="+b,function(){$(this).children("select").change(function(){var c=$(this).val();$("div.local").load("/news/assets/v5/includes/homepage/local-news.htm?state="+a+"&region="+b+"&weatherregion="+c,function(){relativeTimestamps()});$.cookie("newsRegional",a+":"+b+":"+c,{expires:365,path:"/",domain:".abc.net.au"})})})}})})}else{$("#local-news-picker div.region select").attr({disabled:"disabled"}).children(":first-child").attr({selected:"selected"})}})}function whatsOn(k,l,c){if(typeof whatsOnData=="undefined"){whatsOnInit(function(){whatsOn(k,l,c)});return}var g={};var d=new Date().getTime();if(!window.clientTimeLoad){clientTimeLoad=d}var j=d-clientTimeLoad;var b=0;if(typeof c=="undefined"){c=servertimestamp.getTime()+j;b=1000*60*2}var a=";";var f={};f.programs=[];f.changeoverTimes=[];$(whatsOnData).find('group[id="'+k+'"]>program').each(function(){var n=false,q=false;$(this).find("on, off").each(function(){if($(this).attr("duration")!==undefined){duration=1000*60*parseInt($(this).attr("duration"),10)}else{duration=0}var r=false;if($(this).attr("date")!==undefined){if(ymdToTime($(this).attr("date"))<=c&&c-duration<ymdToTime($(this).attr("date"))+1000*60*60*24){r=true}}else{if($(this).attr("firstdate")!==undefined&&$(this).attr("lastdate")!==undefined){if(ymdToTime($(this).attr("firstdate"))<=c&&c-duration<ymdToTime($(this).attr("lastdate"))+1000*60*60*24){r=true}}else{if($(this).attr("day")!==undefined){if(parseInt($(this).attr("day"),10)%7==new Date(c-duration).getDay()){r=true}}else{if($(this).attr("firstday")!==undefined&&$(this).attr("lastday")!==undefined){var v=new Date(c-duration).getDay();var u=parseInt($(this).attr("firstday"),10)%7;var s=parseInt($(this).attr("lastday"),10)%7;if((u<=s&&u<=v&&v<=s)||(u>s&&(v<=s||u<=v))){r=true}}else{r=true}}}}if(r){todaystart=new Date(new Date(c).getFullYear(),new Date(c).getMonth(),new Date(c).getDate(),0,0,0).getTime();var x=0;var t=1000*60*60*24;if($(this).attr("time")!==undefined){x=hmsToTime($(this).attr("time"))}if($(this).attr("duration")!==undefined){t=x+duration}g["t"+(todaystart+x)]=todaystart+x;g["t"+(todaystart+t)]=todaystart+t;if(x>1000*60*60*new Date(c).getHours()+1000*60*new Date(c).getMinutes()+1000*new Date(c).getSeconds()){todaystart-=1000*60*60*24}if((todaystart+x)-b<=c&&c<(todaystart+t)-b){if(this.nodeName=="on"){n=true}else{if(this.nodeName=="off"){q=true}}}}});var p=false;if(q==true){p=false}else{if(n==true){p=true}}if(p==true){var m=$(whatsOnData).find('stream[id="'+$(this).attr("stream")+'"]').eq(0);var o=m.attr("url");if(a.indexOf(";"+o+";")==-1){a+=o+";";f.programs.push({id:$(this).attr("id"),name:$(this).attr("name"),stream:o,live:m.attr("live")!="false",heading:$(this).attr("heading"),image:$(this).attr("image")})}}});for(var e in g){f.changeoverTimes.push(g[e])}f.changeoverTimes.sort();l(f)}function whatsOnInit(a){$.get("/news/assets/v5/data/schedule.xml",function(b){whatsOnData=b;a()})}function ymdToTime(b){if(!b){return undefined}var a=b.split("-");return new Date(parseInt(a[0],10),parseInt(a[1],10)-1,parseInt(a[2],10)).getTime()}function hmsToTime(b){if(!b){return undefined}var a=b.split(":");return(parseInt(a[0],10)*60*60*1000)+(parseInt(a[1],10)*60*1000)+(parseInt((a.length>2?a[2]:0),10)*1000)}function liveMedia(){if($("#live-media div.video").length==0){$("#live-media").html('<div class="divider"></div><div class="subcolumns"><div class="c50l"><div class="video section"></div></div><div class="c50r"><div class="audio section"></div></div></div>')}whatsOn("tv",function(b){var a="";if(b.programs.length){aTag=(b.programs[0].live==true?'<a href="/news/video/stream.htm?stream='+encodeURIComponent(b.programs[0].stream)+"&name="+encodeURIComponent(b.programs[0].name)+"&image="+encodeURIComponent(b.programs[0].image)+'" onclick="return popup(this.href, 545, 800);">':'<a href="'+b.programs[0].stream+'">');a+='<div class="header"><h2>'+b.programs[0].heading+"</h2>"+aTag+b.programs[0].name+'</a></div><div class="content">'+aTag+'<img src="'+b.programs[0].image+'" alt="'+b.programs[0].name+'" height="100" width="460" /></a></div>'}if(b.programs.length>1){aTag=(b.programs[1].live==true?'<a href="/news/video/stream.htm?stream='+encodeURIComponent(b.programs[1].stream)+"&name="+encodeURIComponent(b.programs[1].name)+"&image="+encodeURIComponent(b.programs[1].image)+'" onclick="return popup(this.href, 545, 800);">':'<a href="'+b.programs[1].stream+'">');a+='<div class="footer"><h2>'+b.programs[1].heading+'</h2><span class="program-name">'+aTag+b.programs[1].name+"</a></span></div>"}$("#live-media div.video").html(a);whatsOn("radio",function(d){var c="";if(d.programs.length){aTag=(d.programs[0].live==true?'<a href="/news/audio/stream.htm?stream='+encodeURIComponent(d.programs[0].stream)+"&name="+encodeURIComponent(d.programs[0].name)+"&image="+encodeURIComponent(d.programs[0].image)+'" onclick="return popup(this.href, 545, 800);">':'<a href="'+d.programs[0].stream+'">');c+='<div class="header"><h2>'+d.programs[0].heading+"</h2>"+aTag+d.programs[0].name+'</a></div><div class="content">'+aTag+'<img src="'+d.programs[0].image+'" alt="'+d.programs[0].name+'" height="100" width="460" /></a></div>'}if(d.programs.length>1){aTag=(d.programs[1].live==true?'<a href="/news/audio/stream.htm?stream='+encodeURIComponent(d.programs[1].stream)+"&name="+encodeURIComponent(d.programs[1].name)+"&image="+encodeURIComponent(d.programs[1].image)+'" onclick="return popup(this.href, 545, 800);">':'<a href="'+d.programs[1].stream+'">');c+='<div class="footer"><h2>'+d.programs[1].heading+'</h2><span class="program-name">'+aTag+d.programs[1].name+"</a></span></div>"}$("#live-media div.audio").html(c)})});setTimeout("liveMedia()",1000*30)}$(function(){$(window).bind("hashchange",function(){var a=location.hash;$("#newshome").each(function(){if((a==""||a=="#")&&$("#topstories ul.tabs li:first-child").is(":not(.active)")){a="#tab=topstories"}if((/tab=/i).test(a)){loadFrontpageTab(a)}if((/justin=/i).test(a)){loadFrontpageJustInTab(a)}})});$(window).trigger("hashchange")});function loadFrontpageTab(a){$("#topstories").find("div.tab-content:first").html('<div class="ajaxLoading"></div>').load("/news/assets/v5/includes/homepage/tab-container.htm"+a.replace("#","?"),function(){if(a=="#tab=topstories"){relativeTimestamps()}copyfitFrontpageTopStories()}).end().find("ul.tabs a[href='"+a.replace("#","?")+"']").blur().parent().siblings(".active").removeClass("active").end().addClass("active")}function loadFrontpageJustInTab(a){$("#justin").find("div.tab-content").html('<div class="ajaxLoading"></div>').load("/news/assets/v5/includes/homepage/justin-container.htm"+a.replace("#","?"),function(){relativeTimestamps();copyfitFrontpageTopStories()}).end().find("ul.tabs a[href='"+a.replace("#","?")+"']").blur().parent().siblings(".active").removeClass("active").end().addClass("active")}function copyfitFrontpageTopStories(){var d=$("#topstory");var c=$("#topstories");var a=$("#homepage div.tools");var b;copyfit(a,d,$("#latest-from-the-drum ul"),2);if($("#wideimage").height()){b=((d.height()+$("#wideimage").height())>a.height())?d:a}else{b=(d.height()>a.height())?d:a}if($("#justin").length){copyfit(b,c,$("#justin div.tab-content ol"),3,$("#topstories div.tab-content ul"));copyfit(b,c,$("#justin div.tab-content ul"),3,$("#topstories div.tab-content ul"))}else{copyfit(b,c,$("#tab-copyfit ul"),3)}}var webtrendsQueue="";function webtrendsQueueAdd(b,f,e){var c="";if(/\.(flv|m4v)(\?.*)?$/i.test(b)){c="Flash_video"}else{if(/\.(mp3)(\?.*)?$/i.test(b)){c="Mp3"}else{if(/\.(asx|asf|wmv|wma|wmv|wpl)(\?.*)?$/i.test(b)){c="Windows_media"}else{if(/\.(rm|ra|ram)(\?.*)?$/i.test(b)){c="Real_media"}}}}var a="";if(e=="video"){a="110"}else{if(e=="audio"){a="115"}}var d=/^([^:]+):\/\/([^\/]+)([^\?]*)/.exec(b);webtrendsQueue+='dcsMultiTrack("DCS.dcssip", "'+d[2].replace(/"/g,'"')+'", "DCS.dcsuri", "'+d[3].replace(/"/g,'"')+'", "WT.ti", "'+f.replace(/"/g,'"')+'", "WT.clip_n", "'+f.replace(/"/g,'"')+'", "WT.clip_t", "'+c+'", "WT.clip_ev", "V", "WT.dl", "'+a+'", "WT.z_division", "News & Current Affairs");';webtrendsQueueInit()}function webtrendsQueueInit(){if(typeof dcsMultiTrack!="undefined"){eval(webtrendsQueue);webtrendsQueue=""}else{setTimeout("webtrendsQueueInit()",500)}}function trackVideo(a,b){webtrendsQueueAdd(a,b,"video")}function trackAudio(a,b){webtrendsQueueAdd(a,b,"audio")}function runLoadEvent(){}$(document).ready(function(){setCountersSourceHit();if(!getQueryStringVariable("site").match(/(^$|^news|^thedrum)/)){news=false}else{news=true}if(news){setActiveNav();relativeTimestamps();processImages();bestOfAbcInit();storytools();initLocalNews();populateWatchlist();enablePreferences();$("#storypage").each(function(){pullquotes()});$("#newshome, #justinpage").each(function(){autoRefresh()})}if($("div.stateline-partial").length){$("#stateline div.inner ul li:gt(1)").hide(1,function(){if($(this).is(":last-child")){copyfit("topstory","topstories","topstories4",3)}})}else{copyfit("topstory","topstories","topstories4",3)}if($("#local-news").length){initRegionSelector()}$("#stateheader ul.personalities a").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});if(jQuery().hoverIntent){$("#nav > ul > li.dropdown").hoverIntent(function(){$(this).addClass("hover").children("div.drop").css({left:"auto"}).end().each(function(){if($(this).closest("#primary-nav").length){$(this).children("div.wide").css({left:"0"})}})},function(){$(this).removeClass("hover").children("div.drop").css({left:"-9999px"})})}$("#nav > ul > li.dropdown a").focus(function(){$(this).closest("li.dropdown").addClass("hover").children("div.drop").css({left:"auto"}).end().each(function(){if($(this).closest("#primary-nav").length){$(this).children("div.wide").css({left:"0"})}})}).blur(function(){$(this).closest("li.dropdown").removeClass("hover").children("div.drop").css({left:"-9999px"})});createCycler($("#promo-rotate"),true,7*1000,"slide-horizontal");createCycler($("#personalities div.inner"),true,6*1000,"fade");createCycler($("#highlights:not(.highlights-3) div.inner"),true,10*1000,"slide-horizontal",4);createCycler($("#highlights.highlights-3 div.inner"),true,10*1000,"slide-horizontal",3);$("#newshome").each(function(){$("#topstories ul.tabs a").live("click",function(){location=location.pathname+location.search+$(this).attr("href").replace("?","#");return false});copyfit("content-sections div.local div.c37l","content-sections div.local div.c63r","content-sections div.local div.c37l ul",2);copyfit("content-sections div.world div.c37l","content-sections div.world div.c63r","content-sections div.world div.c37l ul",2);copyfit("content-sections div.business div.c37l","content-sections div.business div.c63r","content-sections div.business div.c37l ul",2);copyfit("content-sections div.entertainment div.c37l","content-sections div.entertainment div.c63r","content-sections div.entertainment div.c37l ul",2);copyfit("content-sections div.sport div.c37l","content-sections div.sport div.c63r","content-sections div.sport div.c37l ul",2);copyfitFrontpageTopStories();liveMedia()});var a=$.cookie("newsRegional");if(a){var b=a.split(":");if(b[0]&&b[1]&&b[2]&&(b[0].indexOf(";")==-1)){if($("#"+b[2]).length==0){$("div.local").load("/news/assets/v5/includes/homepage/local-news.htm?state="+b[0]+"&region="+b[1]+"&weatherregion="+b[2],function(){relativeTimestamps()})}}$.cookie("newsRegional",a,{expires:365,path:"/",domain:".abc.net.au"})}});