"use strict";jQuery.log=function(){if(window.console){console.log.apply(this,arguments);}else{alert(arguments[0]);}};var Core=(function(){function init_comment_thanks(){function getArgs(){var args,query,pairs,i,pos,argname,value;args={};query=location.search.substring(1);pairs=query.split("&");for(i=0;i<pairs.length;i++){pos=pairs[i].indexOf('=');if(pos===-1){continue;}
argname=pairs[i].substring(0,pos);value=pairs[i].substring(pos+1);args[argname]=unescape(value);}
return args;}
var args=getArgs();if(args.c){$("div[id='commentThanks']").css("display","block").end();}}
function create_text_limiter(limit){return function(elem){var tex=$(elem).val();tex=tex.replace(/\n/g,"\n\r");var len=tex.length;var msg=$("#"+$(elem).attr('id')+" ~ .errorMsg");if(len>=limit){$(msg).css("display","block").end();}else{$(msg).css("display","none").end();}
if(len>limit){var newlen=$(elem).val().length-(len-limit);tex=tex.substring(0,newlen);$(elem).val(tex);return false;}}}
function init(){init_comment_thanks();}
return{init:init,text_limiter:create_text_limiter(1500)};}());"use strict";var RNN=(function(){function init_browser_reject(){$.reject({reject:{all:false,msie5:true,msie6:true,opera8:true,unknown:false},display:['firefox','chrome','opera','safari','msie'],browserInfo:{firefox:{text:'Firefox 3.6+',url:'http://www.mozilla.com/firefox/'},safari:{text:'Safari 4+',url:'http://www.apple.com/safari/download/'},opera:{text:'Opera 10+',url:'http://www.opera.com/download/'},chrome:{text:'Google Chrome 4+',url:'http://www.google.com/chrome/'},msie:{text:'Internet Explorer 8+',url:'http://www.microsoft.com/windows/Internet-explorer/default.aspx'},gcf:{text:'Google Chrome Frame',url:'http://code.google.com/chrome/chromeframe/',allow:{all:false,msie:true}}},header:'Did you know that your Internet Browser is out of date?',paragraph1:'Your browser is out of date, and may not be compatible with our website. A list of the most popular web browsers can be found below.',paragraph2:'Just click on the icons to get to the download page',close:true,closeMessage:'By closing this window you acknowledge that your experience on this website may be degraded',closeLink:'Close This Window',closeURL:'#',closeESC:true,closeCookie:true,imagePath:'/media/core/images/browsers/',overlayBgColor:'#000',overlayOpacity:0.8,fadeOutTime:'fast'});}
var sfHover=function(){var sfEls=document.getElementById("mainNav").getElementsByTagName("LI"),i;for(i=0;i<sfEls.length;i++){sfEls[i].onmouseover=function(){this.className+=" sfhover";};sfEls[i].onmouseout=function(){this.className=this.className.replace(new RegExp(" sfhover\\b"),"");};}};if(window.attachEvent){window.attachEvent("onload",sfHover);}
function init_main_nav(){var highlight_url,current_item,sub_item,parent_item,activeChild,activeChildList,activeChildListItem;if(typeof(current_item)==='undefined'){if(typeof(header_only)!=='undefined'){highlight_url=window.location.search.substring(1);}else{highlight_url=window.location.toString().split('?')[0].split(location.host)[1];}
if(highlight_url===''){highlight_url='/';}
current_item=$('#mainNav a[href='+highlight_url+']:last');if(!current_item.length){$('#mainNav a').each(function(){var test_url=this.href.split(location.host,2);if(test_url.length===2){test_url=test_url[1];}else{test_url=test_url[0];}
if(test_url!=='/'){if(highlight_url.length>test_url.length){if(highlight_url.substr(0,test_url.length)===test_url){if(!current_item.length){current_item=$(this);}else if(current_item.attr('href').length<this.href.length){current_item=$(this);}}}}});}
if(!current_item.length&&highlight_url.substr(0,19)==='/whats-on/tv/guide/'){current_item=$('#mainNav a[href^=/whats-on/tv/guide/]:last');}}
current_item.addClass('current');sub_item=current_item.next('ul');if(sub_item.length){sub_item.addClass('current');sub_item.find('a[href='+highlight_url+']:last').addClass('current');}else{parent_item=current_item.parent('li').parent('ul');parent_item.addClass('current');parent_item.prev('a').addClass('current');}
if($("#mainNav").is("div")){activeChild=$('#mainNav > ul > li > a.current');activeChildList=$('#mainNav > ul > li > ul.current');activeChildListItem=$('#mainNav > ul > li > ul > li > a.current');$("#mainNav").hoverIntent({timeout:1000,interval:20,over:function(){},out:function(){$("#mainNav .current").removeClass('current');activeChild.addClass('current');activeChildList.addClass('current');if(activeChildListItem.length>0){activeChildListItem.addClass('current');}}});$("#mainNav > ul > li > a").hover(function(){$("#mainNav .current").removeClass('current');$(this).addClass('current');$(this).parent().children('ul').addClass('current');},null);}}
function make_carousel($carousel,visible,scroll){var carousel_id='#'+$carousel.attr('id'),carousel_ul=carousel_id+' ul',carousel_next_id=carousel_id+'-next',carousel_prev_id=carousel_id+'-prev',carousel_length=$(carousel_ul).children().length;if($carousel.is('div')&&carousel_length>0){$carousel.jCarouselLite({btnNext:carousel_next_id,btnPrev:carousel_prev_id,visible:visible,scroll:scroll});}}
function init_carousels(){$('.carousel-v1-s1').each(function(){make_carousel($(this),1,1);});$('.carousel-v2-s1').each(function(){make_carousel($(this),2,1);});$('.carousel-v2-s2').each(function(){make_carousel($(this),2,2);});$('.carousel-v3-s1').each(function(){make_carousel($(this),3,1);});$('.carousel-v3-s2').each(function(){make_carousel($(this),3,2);});$('.carousel-v3-s3').each(function(){make_carousel($(this),3,3);});$('.carousel-v4-s1').each(function(){make_carousel($(this),4,1);});$('.carousel-v4-s2').each(function(){make_carousel($(this),4,2);});$('.carousel-v4-s3').each(function(){make_carousel($(this),4,3);});$('.carousel-v4-s4').each(function(){make_carousel($(this),4,4);});var initMarketingPromos=$('.promo-carousel ul').children().length;if($('.promo-carousel').is('div')&&initMarketingPromos>1){$('#promoController').show();$(".promo-carousel").jCarouselLite({auto:7000,speed:500,btnNext:"#nextPromo",btnPrev:"#previousPromo",visible:1,scroll:1,afterEnd:function(a){a.each(function(){$("#promoType").html($(this).find("input").attr("value"));});}});}}
function generate_carousel_paging(containerID){var itemArray=new Array();$(containerID+' ul').each(function(i){var carouselNavDivs=$(containerID+' ul.paging');$(this).children().each(function(j){itemArray[j]=containerID+" "+"."+j;var linkNum=0;linkNum=j+1;var first="";if(j==0)first="itemLinkSelected";$(carouselNavDivs[i]).append("<li class='"+j+"'><a class='"+first+"' href='#'>"+linkNum+"</a></li>");});});return itemArray;}
function init_widget_carousels(){if($('#thingsToDoList').is('div')){$('#thingsToDoList').jCarouselLite({auto:5000,speed:500,visible:1,scroll:1,btnGo:generate_carousel_paging('#thingsTab'),afterEnd:function(a){$('#thingsTab ul.paging a').removeClass('itemLinkSelected');$('#thingsTab ul.paging li.'+a.attr("id")+" a").addClass('itemLinkSelected');}});}
if($('#placesToGoList').is('div')){$('#placesToGoList').jCarouselLite({auto:5000,speed:500,visible:1,scroll:1,btnGo:generate_carousel_paging('#placesTab'),afterEnd:function(a){$('#placesTab ul.paging a').removeClass('itemLinkSelected');$('#placesTab ul.paging li.'+a.attr("id")+" a").addClass('itemLinkSelected');}});}}
function init_frost_fades(){if($('#thingsToDoList').is('div')){$('#thingsToDoList').frostFade({controller:true,controllerName:'#eventController',timer:3700});};if($('#placesToGoList').is('div')){$('#placesToGoList').frostFade({controller:true,controllerName:'#placesController',timer:2000});};}
jQuery.fn.frostTip=function(){$('<div id="tipBox"></div>').attr({id:'tipBox'}).css({position:'absolute',top:'0px',display:'none'}).appendTo('body');var $tipBox=$('#tipBox');return this.each(function(){var $container=$(this),$children=$container.children();$children.bind('mousemove',function(event){$tipBox.text($(this).text()).show().css({top:event.pageY-30,left:event.pageX-19});});$children.bind('mouseout',function(event){$(this).stop();$('#tipBox').hide();});});};function init_frost_tips(){$('#mainRest .options').frostTip();}
function init_ad_spaces(){$.pageAdCount=function(count){var adSpace0,adSpace1,adSpace2,adSpace3,adSpace4,adSpace5,adSpace6,adSpace7,adSpace8,adSpace9,adSpace10,adSpace11,adSpace12,adSpace13,adSpace14,adSpace15,adSpace16,adSpace17,adSpace18,adSpace19,adSpace20,adSpace21,adSpace22,reg,result,adZones,i,check,advertismentMarkup;adSpace0=$('#adSpace0')!==null&&$('#adSpace0').html();adSpace1=$('#adSpace1')!==null&&$('#adSpace1').html();adSpace2=$('#adSpace2')!==null&&$('#adSpace2').html();adSpace3=$('#adSpace3')!==null&&$('#adSpace3').html();adSpace4=$('#adSpace4')!==null&&$('#adSpace4').html();adSpace5=$('#adSpace5')!==null&&$('#adSpace5').html();adSpace6=$('#adSpace6')!==null&&$('#adSpace6').html();adSpace7=$('#adSpace7')!==null&&$('#adSpace7').html();adSpace8=$('#adSpace8')!==null&&$('#adSpace8').html();adSpace9=$('#adSpace9')!==null&&$('#adSpace9').html();adSpace10=$('#adSpace10')!==null&&$('#adSpace10').html();adSpace11=$('#adSpace11')!==null&&$('#adSpace11').html();adSpace12=$('#adSpace12')!==null&&$('#adSpace12').html();adSpace13=$('#adSpace13')!==null&&$('#adSpace13').html();adSpace14=$('#adSpace14')!==null&&$('#adSpace14').html();adSpace15=$('#adSpace15')!==null&&$('#adSpace15').html();adSpace16=$('#adSpace16')!==null&&$('#adSpace16').html();adSpace17=$('#adSpace17')!==null&&$('#adSpace17').html();adSpace18=$('#adSpace18')!==null&&$('#adSpace18').html();adSpace19=$('#adSpace19')!==null&&$('#adSpace19').html();adSpace20=$('#adSpace20')!==null&&$('#adSpace20').html();adSpace21=$('#adSpace21')!==null&&$('#adSpace21').html();adSpace22=$('#adSpace22')!==null&&$('#adSpace22').html();reg='/(AE[0-2]{1}|noimage)\\.gif/mig';result=eval(reg);adZones=count;for(i=0;i<adZones;i++){if($('#adSpace'+i).is('div')){check=$('#adSpace'+i).html();if(check.search(result)>0){$('#adSpace'+i).hide();}}}
advertismentMarkup='<div class="advertiseText"><span><a href="http://www.apndigital.com.au/advertise_with_us/" title="Advertise With Us" target="_blank">Advertisement</a></span></div>';if(adSpace1&&adSpace1.search(result)<0){$('#adSpace1').before(advertismentMarkup);}
if((adSpace2&&adSpace2.search(result)<0)||(adSpace3&&adSpace3.search(result)<0)||(adSpace4&&adSpace4.search(result)<0)){$('#national_microlink_ads').before(advertismentMarkup);}else{$('#national_microlink_ads').parent().hide();}
if((adSpace5&&adSpace5.search(result)<0)||(adSpace6&&adSpace6.search(result)<0)||(adSpace7&&adSpace7.search(result)<0)||(adSpace8&&adSpace8.search(result)<0)||(adSpace9&&adSpace9.search(result)<0)||(adSpace10&&adSpace10.search(result)<0)||(adSpace11&&adSpace11.search(result)<0)||(adSpace12&&adSpace12.search(result)<0)||(adSpace13&&adSpace13.search(result)<0)||(adSpace14&&adSpace14.search(result)<0)||(adSpace15&&adSpace15.search(result)<0)||(adSpace16&&adSpace16.search(result)<0)){$('#localOffers').before(advertismentMarkup);}else{$('#localOffers').parent().hide();}
if(adSpace17&&adSpace17.search(result)<0){$('#adSpace17').before(advertismentMarkup);}
if(adSpace19&&adSpace19.search(result)<0){$('#adSpace19').before(advertismentMarkup);}else{$('#adSpace19').parent().hide();}
if((adSpace20&&adSpace20.search(result)<0)||(adSpace21&&adSpace21.search(result)<0)){$('#section_advertorial_feature').before(advertismentMarkup);}else{$('#section_advertorial_feature').hide();}};}
function init_partner_centre(){if($('.partnerCenter1 .fragment').length||$('.partnerCenter2 .fragment').length||$('.partnerCenter3 .fragment').length){$('.partnerCenter1').before('<div id="partnerCenter" class="advertiseText"><span>Partner Centre</span></div>');}
if(!$('.partnerCenter1 .fragment').length){$('.partnerCenter1').hide();}
if(!$('.partnerCenter2 .fragment').length){$('.partnerCenter2').hide();}
if(!$('.partnerCenter3 .fragment').length){$('.partnerCenter3').hide();}}
function init_user_login_status(){$.getJSON("/my-account/userstatus/",function(data){if(eval(data.authenticated)){$("a[id='register']").css("display","none").end();$("a[id='myaccount']").css("display","inline").end();$("a[id='login']").css("display","none").end();$("a[id='logout']").css("display","inline").end();$("div[id='addComments']").find("h2").css("display","block").end();$("div[id='addComments']").find("h3").css("display","block").end();$("div[id='addComments']").find("div[id='commentRegisterLogin']").css("display","none").end();$("div[id='addComments']").find("div[id='commentSubmitComment']").css("display","block").end();$("p[class='commentUserInfo']").find("a[id='username']").text(data.username).end();$("span[id='username']").text(data.username).end();}else{$("div[id='addComments']").find("h2").css("display","block").end();$("div[id='addComments']").find("h3").css("display","block").end();$("div[id='addComments']").find("div[id='commentRegisterLogin']").css("display","block").end();$("div[id='addComments']").find("div[id='commentSubmitComment']").css("display","none").end();}
$("div[id='commentsFragment']").css("display","block").end();});}
function init_google_search_box(){$("#q").addClass('googlesearch');$("#q").bind('focus',function(){$(this).removeClass();});$("#q").blur(function(){$(this).addClass('googlesearch');var meValue=$(this).val();if(meValue!==""){$(this).removeClass();}});if($("#q").val()!==''&&!$("#q").focus()){$("#q").removeClass();}}
function ausreg_menu(enable){var offset,minHeight;if(enable){offset=1;if(navigator.appVersion.indexOf("MSIE 6")>-1){offset=2;}
document.getElementById('ausreg-menu').style.display="block";document.getElementById('ausreg-menu').style.top=(offset-document.getElementById('ausreg-menu').offsetHeight-1)+'px';minHeight=0;$('#ausreg-menu ul').each(function(){if($(this).height()>minHeight){minHeight=$(this).height();}});$('#ausreg-menu ul').each(function(){$(this).height(minHeight);});$('#ausreg-menu').width($('#ausreg-menu').children().size()*204);document.getElementById('ausreg-menu').style.visibility="visible";}else{document.getElementById('ausreg-menu').style.display="none";document.getElementById('ausreg-menu').style.visibility='hidden';}}
function init_text_resizing_and_printing(){var sizeLevel,tagToResize,resizeArray;if($('.optionBehaviours').is('div')){sizeLevel=4;tagToResize='.textResize';resizeArray=$(tagToResize);$('.optionBehaviours ul li a').bind('click',function(e){e.preventDefault();var articleOption,i,currentFontSize,currentFontSizeNum,newFontSize;articleOption=this.hash;for(i=0;i<resizeArray.length;i++){if(sizeLevel<7){if(articleOption==='#textlarger'){currentFontSize=$(resizeArray[i]).css('font-size');currentFontSizeNum=parseFloat(currentFontSize,10);newFontSize=currentFontSizeNum*1.1;$(resizeArray[i]).css('font-size',Math.round(newFontSize));if(i===resizeArray.length-1){sizeLevel++;}}}
if(sizeLevel>1){if(articleOption==='#textsmaller'){currentFontSize=$(resizeArray[i]).css('font-size');currentFontSizeNum=parseFloat(currentFontSize,10);newFontSize=currentFontSizeNum*0.9;$(resizeArray[i]).css('font-size',Math.round(newFontSize));if(i===resizeArray.length-1){sizeLevel--;}}}}
if(articleOption==='#print'){window.print();}});}}
jQuery.fn.superSimpleTabs=function(){return this.each(function(){var ul=jQuery(this);ul.find('a[href^=#]').each(function(i){var link=jQuery(this);if(i){jQuery(link.attr('href')).hide();}
else{link.addClass('selected');}
link.click(function(){jQuery(ul.find('a.selected').removeClass('selected').attr('href')).hide();jQuery(link.addClass('selected').attr('href')).show();return false;});});});};function init_news(){jQuery('.communityTab ul').superSimpleTabs();if($('#storyArchive').is('div')){$('.listDate').prev().css('background','none');}}
function init_tv(){var tableWidth;$('#TVcontrols li:not(.active)').hover(function(){$(this).addClass('hoverbg');},function(){$(this).removeClass('hoverbg');});$("select[name='jump']").bind('change',function(e){window.location=this.value;});$("a[name='finda']").bind('click',function(event){event.preventDefault();window.open(this.href,'');});$('.newWindow').each(function(){$(this).bind('click',function(event){window.open(this.href,'');event.preventDefault();});});if($('#programlist').is('table')){$('#programlist a').bind('click',function(e){e.preventDefault();var w=480,h=340,sWidth=screen.availWidth,sHeight=screen.availHeight,leftPos=(sWidth-w)/2,topPos=(sHeight-h)/2;topPos=topPos-130;window.open(this.href,'','menubar=no,location=no,resizable=no,scrollbars=no,status=yes,width=640,height=520,top='+topPos+',left='+leftPos+'');});}
if($('#guideDate').is('div')){tableWidth=$('#programlist').width()-1;$('#guideDate').css('width',tableWidth+'px');}
$('a.tvWidgetShow').bind('click',function(e){var match=$('#tvDay').val().match(/(.+\d+\/\d+\/\d+)\/.*?(\d)/),dayurl=match[1],phase=$('#tvPhases').val(),region=match[2];window.location=dayurl+"/"+phase+"/"+region+"/";});}
function init_mini_tv_guide(){$(".tvtabs").accessibleTabs({tabhead:'h4',fx:"fadeIn",syncheights:false});}
function init_restaurants(){$('#restList .options a').bind('click',function(event){event.preventDefault();});}
function init_things_to_do_widget(){var tabContainers=$("div.miniTabContainer > div");$('div.miniTabContainer ul.miniTabControls a').click(function(){tabContainers.removeClass('show').filter(this.hash).addClass('show');$('div.miniTabContainer ul.miniTabControls a').removeClass('selected');$(this).addClass('selected');return false;}).filter(':first').click();}
function init(){init_browser_reject();init_main_nav();init_carousels();init_frost_tips();init_ad_spaces();init_partner_centre();init_user_login_status();init_text_resizing_and_printing();init_google_search_box();init_news();init_tv();init_mini_tv_guide();init_restaurants();init_widget_carousels();init_things_to_do_widget();}
return{init:init,ausreg_menu:ausreg_menu};}());var LocalClassifieds=(function(){function cleanShortlistCookie(oldCookieValue){var cookieName='_lcsl',cookieValue=$.cookie(cookieName),ids;oldCookieValue=$.base64Decode(oldCookieValue);if(oldCookieValue===cookieValue){$('#shortlistPersonalised').css('display','inline');ids='';$('#mc input[type=checkbox]').each(function(){ids+=$(this).attr('id')+'.';});ids=ids.substring(0,ids.length-1);$.cookie(cookieName,ids,{expires:7,path:'/'});}else{$('#shortlistPersonalised').css('display','none');}}
function initialiseShortlistCheckboxes(cookieName){var cookieValue=$.cookie(cookieName),ids,selectorString,i;if(cookieValue!==null&&cookieValue!==''){ids=cookieValue.split('.');selectorString='';for(i=0;i<ids.length;++i){selectorString+='#'+ids[i]+',';}
selectorString=selectorString.substring(0,selectorString.length-1);$(selectorString).each(function(){$(this).attr('checked',true);});}}
function addAdIDToCookie(adID,cookieName){var cookieValue=$.cookie(cookieName);cookieValue=cookieValue!==null&&cookieValue!==''?cookieValue+'.'+adID:adID;$.cookie(cookieName,cookieValue,{expires:7,path:'/'});}
function removeAdIDFromCookie(adID,cookieName){var cookieValue=$.cookie(cookieName),oldIDs,newIDs,i,currentID;if(cookieValue!==null&&cookieValue!==''){oldIDs=cookieValue.split('.');newIDs='';for(i=0;i<oldIDs.length;++i){currentID=oldIDs[i];if(currentID!==adID){newIDs+=currentID+'.';}}
cookieValue=newIDs.substring(0,newIDs.length-1);}
$.cookie(cookieName,cookieValue,{expires:7,path:'/'});}
function updateShortlistLink(cookieName){var cookieValue=$.cookie(cookieName),numAdItems=0,$link,newURL,newLink;$link=$('.shortList .shortListLink a');if(cookieValue===null||cookieValue===''){if($link.length){$link.parent().html($link.html());}}else{numAdItems=cookieValue.split('.').length;newURL='/classifieds/shortlist/'+$.base64Encode(cookieValue)+'/';if($link.length){$link.attr('href',newURL);}
else{newLink='<a href="'+newURL+'">'+$('.shortList .shortListLink').html()+'</a>';$('.shortList .shortListLink').html(newLink);}}
$('.shortList .count').html(numAdItems);$('.shortlistHeaderCount .count').html(numAdItems);}
$.fn.lcCheckbox=function(){var cookieName='_lcsl';this.each(function(){var $parentWrapper,$allCheckBoxes,$allCheckBoxesByClass,titleVal,remTitleVal;$parentWrapper=$(this);$allCheckBoxes=$parentWrapper.find('input:checkbox');$allCheckBoxes.wrap('<span class="checkBoxWrapper"></span>').after('<span class="boxUnChecked"></span>').css('opacity',0);initialiseShortlistCheckboxes(cookieName);$allCheckBoxes.filter(':checked').each(function(index){$(this).next('span').removeClass().addClass('boxChecked');});titleVal=$parentWrapper.find('.boxUnChecked').siblings('input[type=checkbox]').attr('title');$parentWrapper.find('.boxUnChecked').attr('title',titleVal);remTitleVal="Remove from Short List";$parentWrapper.find('.boxChecked').attr('title',remTitleVal);$allCheckBoxesByClass=$parentWrapper.find('.boxUnChecked, .boxChecked');$allCheckBoxesByClass.bind('click',function(event){var $checkBox=$(this).prev('input:checkbox'),checked=$checkBox.attr('checked'),adID=$checkBox.attr('id');if(!checked){$(this).removeClass().addClass('boxChecked');$checkBox.attr('checked',true);$(this).attr('title',remTitleVal);addAdIDToCookie(adID,cookieName);}else{$(this).removeClass().addClass('boxUnChecked');$checkBox.attr('checked',false);$(this).attr('title',titleVal);removeAdIDFromCookie(adID,cookieName);}
updateShortlistLink(cookieName);});});$('li.shortListPageItem span.checkBoxWrapper span').bind("click",function(){if($(this).hasClass("boxUnChecked")){$(this).parent().parent().addClass("faded");}
else{$(this).parent().parent().removeClass("faded");}});};function init(){$('.fullList').bind('click',function(event){event.preventDefault();if(!$(this).hasClass('hideMe')&&!($("ul.bottom:animated").size()>0)){$(this).html('Hide &lt;&lt;').addClass('hideMe').prev('.bottom').slideDown('slow');}else{if(!($("ul.bottom:animated").size()>0)){$(this).html('Full List &gt;&gt;').removeClass('hideMe').prev('.bottom').slideUp('slow');}}});$("#locationArea").change(function(){window.location=$("#locationArea").val();});$("img:not(.promo-carousel img, .carouselBody img)").lazyload({threshold:250});}
return{init:init,updateShortlistLink:updateShortlistLink,cleanShortlistCookie:cleanShortlistCookie};}());$(document).ready(function(){jQuery.ajaxSettings.traditional=true;Core.init();RNN.init();LocalClassifieds.init();try{RNNPage.init();}catch(error){}});function popupWithSize(dest,w,h,style){var wDefault=831,hDefault=648,styleDefault='slim',sWidth=screen.availWidth,sHeight=screen.availHeight,leftPos,topPos;w=(typeof w==='undefined')?wDefault:w;h=(typeof h==='undefined')?hDefault:h;style=((typeof style==='undefined')||((style!=='slim')&&(style!=='full')))?styleDefault:style;if(typeof dest==='undefined'){alert('The function popupWithSize requires at least a destination to be supplied.');return false;}
leftPos=(sWidth-w)/2;topPos=(sHeight-h)/2;if(style==='slim'){window.open(dest,'','height='+h+',width='+w+',screenY='+topPos+',screenX='+leftPos+',top='+topPos+',left='+leftPos+'location=no,'+'menubar=no,'+'resizable=yes,'+'scrollbars=no,'+'status=no,'+'titlebar=no,'+'toolbar=no,'+'channelmode=no,'+'directories=no,'+'fullscreen=no');}else{window.open(dest,'','height='+h+',width='+w+',screenY='+topPos+',screenX='+leftPos+',top='+topPos+',left='+leftPos+'location=yes,'+'menubar=yes,'+'resizable=yes,'+'scrollbars=yes,'+'status=yes,'+'titlebar=yes,'+'toolbar=yes,'+'channelmode=no,'+'directories=no,'+'fullscreen=no');}}
var checkboxHeight="25";var radioHeight="25";var selectWidth="83";document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: '+selectWidth+'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; }</style>');var Custom={init:function(){var inputs=document.getElementsByTagName("input"),span=Array(),textnode,option,active;for(a=0;a<inputs.length;a++){if((inputs[a].type=="checkbox"||inputs[a].type=="radio")&&inputs[a].className=="styled"){span[a]=document.createElement("span");span[a].className=inputs[a].type;if(inputs[a].checked==true){if(inputs[a].type=="checkbox"){position="0 -"+(checkboxHeight*2)+"px";span[a].style.backgroundPosition=position;}else{position="0 -"+(radioHeight*2)+"px";span[a].style.backgroundPosition=position;}}
inputs[a].parentNode.insertBefore(span[a],inputs[a]);inputs[a].onchange=Custom.clear;span[a].onmousedown=Custom.pushed;span[a].onmouseup=Custom.check;document.onmouseup=Custom.clear;}}
inputs=document.getElementsByTagName("select");for(a=0;a<inputs.length;a++){if(inputs[a].className=="styled"){option=inputs[a].getElementsByTagName("option");active=option[0].childNodes[0].nodeValue;textnode=document.createTextNode(active);for(b=0;b<option.length;b++){if(option[b].selected==true){textnode=document.createTextNode(option[b].childNodes[0].nodeValue);}}
span[a]=document.createElement("span");span[a].className="select";span[a].id="select"+inputs[a].name;span[a].appendChild(textnode);inputs[a].parentNode.insertBefore(span[a],inputs[a]);inputs[a].onchange=Custom.choose;}}},pushed:function(){element=this.nextSibling;if(element.checked==true&&element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight*3+"px";}else if(element.checked==true&&element.type=="radio"){this.style.backgroundPosition="0 -"+radioHeight*3+"px";}else if(element.checked!=true&&element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight+"px";}else{this.style.backgroundPosition="0 -"+radioHeight+"px";}},check:function(){element=this.nextSibling;if(element.checked==true&&element.type=="checkbox"){this.style.backgroundPosition="0 0";element.checked=false;}else{if(element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight*2+"px";}else{this.style.backgroundPosition="0 -"+radioHeight*2+"px";group=this.nextSibling.name;inputs=document.getElementsByTagName("input");for(a=0;a<inputs.length;a++){if(inputs[a].name==group&&inputs[a]!=this.nextSibling){inputs[a].previousSibling.style.backgroundPosition="0 0";}}}
element.checked=true;}},clear:function(){inputs=document.getElementsByTagName("input");for(var b=0;b<inputs.length;b++){if(inputs[b].type=="checkbox"&&inputs[b].checked==true&&inputs[b].className=="styled"){inputs[b].previousSibling.style.backgroundPosition="0 -"+checkboxHeight*2+"px";}else if(inputs[b].type=="checkbox"&&inputs[b].className=="styled"){inputs[b].previousSibling.style.backgroundPosition="0 0";}else if(inputs[b].type=="radio"&&inputs[b].checked==true&&inputs[b].className=="styled"){inputs[b].previousSibling.style.backgroundPosition="0 -"+radioHeight*2+"px";}else if(inputs[b].type=="radio"&&inputs[b].className=="styled"){inputs[b].previousSibling.style.backgroundPosition="0 0";}}},choose:function(){option=this.getElementsByTagName("option");for(d=0;d<option.length;d++){if(option[d].selected==true){document.getElementById("select"+this.name).childNodes[0].nodeValue=option[d].childNodes[0].nodeValue;}}}}
window.onload=Custom.init;
