if(typeof Object.create!=="function"){Object.create=function(o){var F=function(){};F.prototype=o;return new F();};}if(typeof String.prototype.trim!=="function"){String.prototype.trim=function(){return this.replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g,"");};}if(typeof String.prototype.decodeString!=="function"){String.prototype.decodeString=function(){return this.replace(/&#\d+;/g,function(word){return String.fromCharCode(word.match(/\d+/));});};}var JA=(function(){var TEXTAREA_MAX_LENGTH=5000;var openPopWindow=function(url,width,height,options,winName){var agent=navigator.userAgent.toLowerCase();var popupWin;if(agent.indexOf("webtv")!=-1){window.location.href=url;}else{options=options||"toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=no";winName=winName||"help";popupWin=window.open(url,winName,"height="+height+",width="+width+","+options);if(window.focus){popupWin.focus();}}return false;};var openWindow=function(url,winName){if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){window.location.href=url;}else{var newWin=window.open(url,winName);if(window.focus){newWin.focus();}}return false;};var toggleModal=function(modalElement,popin,showModal){var modalID;var popinID;var displayType="none";if(typeof popin=="undefined"){modalID=".modalBackground";popinID=modalElement;}else{modalID=modalElement;popinID=popin;}if(showModal){displayType="block";}$(modalID).css({display:displayType});$(popinID).css({display:displayType});if(typeof cycler=="object"){if(showModal){cycler.stop();}else{cycler.startStaggered();}}};var updateJavascriptCheck=function(){$.ajax({type:"GET",data:{enabled:true},url:"/browsercheck/javascript.ashx",dataType:"html",contentType:"application/xml; charset=utf-8",success:function(){}});};return{showModal:function(modalElement,popin){toggleModal(modalElement,popin,true);},hideModal:function(modalElement,popin){toggleModal(modalElement,popin,false);},bindButtonHovers:function(){$(".JA_toggleButton, .JA_imageButton").bind("mouseenter focus",function(e){if($(this).attr("src")){$(this).attr("src",$(this).attr("src").replace("_off","_on"));}});$(".JA_toggleButton, .JA_imageButton").bind("mouseleave blur",function(e){if($(this).attr("src")){$(this).attr("src",$(this).attr("src").replace("_on","_off"));}});$(".JA_oneclick").live("click",function(e){$(this).fadeTo(100,0.7).css("cursor","default").unbind("click mouseenter focus mouseleave blur").click(function(){return false;});});},toggleJSElements:function(){$(".JA_javascript").show();$(".JA_noJavascript").hide();},openPopWindow:function(url,width,height,options,winName){return openPopWindow(url,width,height,options,winName);},openWindow:function(url,winName){return openWindow(url,winName);},doJavascriptUpdate:function(){if(typeof(jQuery)!="undefined"){$(document).ready(function(e){updateJavascriptCheck();});}},setupHtmlTooltips:function(){$(".JA_htmlTooltip").appendTo("body");$(".JA_htmlTooltip").each(function(i){if($(this).find(".JA_htmlTooltipClose").length==0){$(this).prepend('<img class="JA_htmlTooltipClose" height="16" width="16" src="/img/icons/red-x.gif" />');}});$(".JA_hasHtmlTooltip").each(function(i){var $tt=$("#"+this.id+"_tooltip");var $this=$(this);$this.bind("click",function(e){if($tt.is(":visible")){$tt.hide();}else{var off=$this.offset();var vpt=$(window).height()-((off.top+$this.outerHeight()+$tt.outerHeight())-$(window).scrollTop());var top=(vpt<0)?(off.top-$tt.outerHeight()-10):(off.top+$this.outerHeight()+5);if($this.hasClass("JA_tooltipTop")){top=off.top-$tt.outerHeight()-10;}var hpt;if($this.hasClass("JA_tooltipRight")){hpt=((off.left+$tt.outerWidth()+$(window).scrollLeft())-$(window).width());}else{hpt=((off.left+$this.outerWidth()-$tt.outerWidth())-$(window).scrollLeft());}var left=(hpt<0)?off.left:off.left-$tt.outerWidth()+$this.outerWidth();$tt.css({left:left,top:top});$(".JA_htmlTooltip").hide();$tt.show();}e.preventDefault();});});$(".JA_hasHtmlTooltip").css("cursor","pointer");$(".JA_hasHtmlTooltip").hover(function(e){$(this).addClass("JA_hover");$(this).removeClass("JA_hasHtmlTooltip");},function(e){$(this).removeClass("JA_hover");$(this).addClass("JA_hasHtmlTooltip");});$(".JA_htmlTooltipClose").click(function(e){$(this).parents(".JA_htmlTooltip").hide();});},addBookmark:function(url,title){if(window.sidebar){window.sidebar.addPanel(title,url,"");}else{if(window.external){window.external.AddFavorite(url,title);}else{if(window.opera&&window.print){var a=document.createElement("A");a.rel="sidebar";a.target="_search";a.title=title;a.href=url;a.click();}else{}}}},limitTextareaLength:function(textarea,maxLength){if(maxLength==null||maxLength==0){maxLength=TEXTAREA_MAX_LENGTH;}if(textarea.value.length>=maxLength){textarea.value=textarea.value.substring(0,maxLength-1);}},addHandler:function(elem,type,func){if(elem.addEventListener){elem.addEventListener(type,func,false);}else{if(elem.attachEvent){elem.attachEvent("on"+type,func);}}},registerEvents:function(){},startup:function(){$(function(){$("body").addClass("hasjs");});},legacyInit:function(){JA.toggleJSElements();JA.setupHtmlTooltips();JA.bindButtonHovers();}};})();JA.script={loadAsync:function(label,url,handler){JA.debug.log("Loading '"+label+"': "+url);JA.script.loadScript(url,handler);},loadScript:function(url,onload){JA.script.loadScriptDomElement(url,onload);},loadScripts:function(aUrls,onload){var nUrls=aUrls.length;var bDifferent=false;for(var i=0;i<nUrls;i++){if(JA.script.differentDomain(aUrls[i])){bDifferent=true;break;}}var loadFunc=JA.script.loadScriptXhrInjection;if(bDifferent){if(-1!=navigator.userAgent.indexOf("Firefox")||-1!=navigator.userAgent.indexOf("Opera")){loadFunc=JA.script.loadScriptDomElement;}else{loadFunc=JA.script.loadScriptDocWrite;}}for(var i=0;i<nUrls;i++){loadFunc(aUrls[i],(i+1==nUrls?onload:null),true);}},differentDomain:function(url){if(0===url.indexOf("http://")||0===url.indexOf("https://")){var mainDomain=document.location.protocol+"://"+document.location.host+"/";return(0!==url.indexOf(mainDomain));}return false;},loadScriptDomElement:function(url,onload){var domscript=document.createElement("script");domscript.src=url;if(onload){domscript.onloadDone=false;domscript.onload=function(){if(!domscript.onloadDone){domscript.onloadDone=true;onload();}};domscript.onreadystatechange=function(){if(("loaded"===domscript.readyState||"complete"===domscript.readyState)&&!domscript.onloadDone){domscript.onloadDone=true;domscript.onload();}};}document.getElementsByTagName("head")[0].appendChild(domscript);},loadScriptDocWrite:function(url,onload){document.write('<script src="'+url+'" type="text/javascript"><\/script>');if(onload){JA.addHandler(window,"load",onload);}},queuedScripts:new Array(),loadScriptXhrInjection:function(url,onload,bOrder){var iQueue=JA.script.queuedScripts.length;if(bOrder){var qScript={response:null,onload:onload,done:false};JA.script.queuedScripts[iQueue]=qScript;}var xhrObj=JA.script.getXHRObject();xhrObj.onreadystatechange=function(){if(xhrObj.readyState==4){if(bOrder){JA.script.queuedScripts[iQueue].response=xhrObj.responseText;JA.script.injectScripts();}else{var se=document.createElement("script");document.getElementsByTagName("head")[0].appendChild(se);se.text=xhrObj.responseText;if(onload){onload();}}}};xhrObj.open("GET",url,true);xhrObj.send("");},injectScripts:function(){var len=JA.script.queuedScripts.length;for(var i=0;i<len;i++){var qScript=JA.script.queuedScripts[i];if(!qScript.done){if(!qScript.response){break;}else{var se=document.createElement("script");document.getElementsByTagName("head")[0].appendChild(se);se.text=qScript.response;if(qScript.onload){qScript.onload();}qScript.done=true;}}}},getXHRObject:function(){var xhrObj=false;try{xhrObj=new XMLHttpRequest();}catch(e){var aTypes=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];var len=aTypes.length;for(var i=0;i<len;i++){try{xhrObj=new ActiveXObject(aTypes[i]);}catch(e){continue;}break;}}finally{return xhrObj;}}};JA.util={noop:function(){},requireFunction:function(func){return(typeof func==="function")?func:JA.util.noop;}};JA.debug={log:function(text,use_alert_fallback){if((typeof(window.console)==="object")&&(typeof(window.console.log)==="function")){console.log("[JA] "+text);}else{if(use_alert_fallback){alert("[JA] "+text);}}},explore:function(obj,label){if((typeof(window.console)==="object")&&(typeof(window.console.dir)==="function")&&obj){if(typeof(window.console.log)==="function"){var label=(label)?" ("+label+")":"";console.log("[JA] Exploring "+obj.toString()+label+":");}console.dir(obj);}}};JA.adapters={legacyAnalytics:{debug:false,_trackEvent:function(){this._wrappedPush("_trackEvent",arguments);},_trackPageview:function(){this._wrappedPush("_trackPageview",arguments);},_wrappedPush:function(command,data){var argsArr=Array().slice.call(data);argsArr.unshift(command);if(this.debug){JA.debug.log("Sending: _gaq.push("+argsArr.join(", ")+") [converted from pageTracker]",false);}_gaq.push(argsArr);}}};JA.i18n={format:function(str){for(i=1;i<arguments.length;i++){str=str.replace("{"+(i-1)+"}",arguments[i]);}return str;},numberFormat:function(nStr){var inD=".";var outD=JA.i.i18n.decDelim;var sep=JA.i.i18n.groupDelim;var GroupSize=JA.i.i18n.groupSize;nStr+="";var dpos=nStr.indexOf(inD);var nStrEnd="";if(dpos!=-1){nStrEnd=outD+nStr.substring(dpos+1,nStr.length);nStr=nStr.substring(0,dpos);}var rgx=/(\d+)(\d{GroupSize})/;while(rgx.test(nStr)){nStr=nStr.replace(rgx,"$1"+sep+"$2");}return nStr+nStrEnd;}};JA.startup();JA.doJavascriptUpdate();var jaUtils=JA;function i18nFormat(str){return JA.i18n.format.apply(str,arguments);}function i18nNumberFormat(nStr){return JA.i18n.numberFormat(nStr);}
