var browserDetection=Prototype.Browser;var isIE=browserDetection.IE;var isIE6=browserDetection.IE6;var isIE64Bit=browserDetection.IE64Bit;var isOpera=browserDetection.Opera;var isFF=browserDetection.Gecko;var isSafari=browserDetection.WebKit;var isIphone=browserDetection.Iphone;var isIpad=browserDetection.Ipad;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isMac=(navigator.appVersion.toLowerCase().indexOf("macintosh")!=-1)?true:false;var startPerformanceTime=0;var performanceCounter=0;var windowWidth;var windowHeight;var bodyLoadFunctionQueue=new Array();var bodyLoadFunctionParams=new Array();var bodyLoaded=false;var kiActionLinkClicked=false;var popupOpen=false;function startPerformanceTest(){var A=new Date();startPerformanceTime=A.getTime()}function checkPerformanceTest(){var A=new Date();if(startPerformanceTime!=0){performanceCounter++;alert("time elapsed for "+performanceCounter+" : "+(A.getTime()-startPerformanceTime))}}function viewportWidth(){if(isIE||isOpera||isIphone){return document.body.clientWidth}if(isSafari){if(self.innerWidth){return self.innerWidth}else{return this.innerWidth}}return document.documentElement.clientWidth}function viewportHeight(){if(isIE){return document.body.clientHeight}if(isSafari){if(self.innerHeight){return self.innerHeight}else{return this.innerHeight}}return document.documentElement.clientHeight}function styleToInt(B){var A=B.slice(0,-2);return parseInt(A)}function focusById(A){var B=document.getElementById(A);if(B){B.focus()}}function findElementWithClass(E,D){var C=new Array();C=E.childNodes;if(C.length>0){for(var B=0;B<C.length;B++){if(C[B].className){if(C[B].className==D){return C[B]}else{var A=findElementWithClass[B];if(A){return A}}}}}return null}function findElementsWithClass(D,H){var A=new Array();var I=new Array();A=D.childNodes;var B=A.length;if(B>0){for(var F=0;F<B;F++){if(A[F].className){if(A[F].className==H){I.push(A[F])}}var C=findElementsWithClass(A[F],H);var G=C.length;for(var E=0;E<G;E++){I.push(C[E])}}}return I}function findTop(A){if(A){var C=A.offsetTop;var B=A.offsetParent;if(B){C+=findTop(B)}return C}else{return 0}}function findLeft(A){if(A){var C=A.offsetLeft;var B=A.offsetParent;if(B){C+=findLeft(B)}return C}else{return 0}}function setBodyLoad(){bodyLoaded=true;for(var A=0;A<bodyLoadFunctionQueue.length;A++){executeBodyLoadFunction(A)}}function addToBodyLoad(){var A=arguments;bodyLoadFunctionQueue.push(A[0]);var C=new Array();for(var B=1;B<A.length;B++){C.push(A[B])}bodyLoadFunctionParams.push(C);if(bodyLoaded){executeBodyLoadFunction(bodyLoadFunctionQueue.length-1)}}function executeBodyLoadFunction(A){if(bodyLoadFunctionQueue[A]){if(typeof (bodyLoadFunctionQueue[A])=="function"){if(bodyLoadFunctionParams[A].length<=0){bodyLoadFunctionQueue[A]()}else{bodyLoadFunctionQueue[A].apply(this,bodyLoadFunctionParams[A])}}}}var blankPattern=/^\s*$/;function isBlank(A){return A==null||(A.match(blankPattern))}function setCookie(C,E,A,G,D,F){if(A&&typeof A!="object"){if(A<0){A=0}else{A=new Date(A)}}var B=C+"="+escape(E)+((A)?"; expires="+A.toGMTString():"")+((G)?"; path="+G:"")+((D)?"; domain="+D:"")+((F)?"; secure":"");document.cookie=B}function getCookie(C){var B=document.cookie;var E=C+"=";var D=B.indexOf("; "+E);if(D==-1){D=B.indexOf(E);if(D!=0){return null}}else{D+=2}var A=document.cookie.indexOf(";",D);if(A==-1){A=B.length}return unescape(B.substring(D+E.length,A))}function deleteCookie(A,C,B){if(getCookie(A)){document.cookie=A+"="+((C)?"; path="+C:"")+((B)?"; domain="+B:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}function putKeyValue(D,C,E){var A="";if(isBlank(D)){A="|"+C+"="+E+"|"}else{var B=new RegExp("(\\|"+C+"=).*?\\|","g");if(String(D).match(B)){A=String(D).replace(B,"$1"+E+"|")}else{A=D+C+"="+E+"|"}}return A}function getKeyValue(D,C){var A="";var B=new RegExp("\\|"+C+"=(.*?)\\|","g");B.compile;var E=B.exec(D);if(E){A=E[1]}return A}function setMultiValueCookie(A,B,D){var C=getCookie(A);setCookie(A,putKeyValue(C,B,D),0,"/")}function getMultiValueCookie(A,B){var C=getCookie(A);return getKeyValue(C,B)}function findImgName(D){var B=new RegExp(/\//g);B.test(D);for(var A=0;A<D.length;A++){if(!B.test(D)){break}B.test(D);var C=B.lastIndex}return D.substring(C,D.length)}function selectText(B){if(document.selection){var A=document.body.createTextRange();A.moveToElementText(document.getElementById(B));A.select()}else{if(window.getSelection){var A=document.createRange();A.selectNode(document.getElementById(B));window.getSelection().addRange(A)}}}function selectOptionByValue(D,C){var B=D;if(typeof (B)=="string"){B=document.getElementById(B)}if(B&&B.nodeName=="SELECT"){for(var A=0;A<B.options.length;A++){if(B.options[A].value.toLowerCase()==C.toLowerCase()){B.options[A].selected=true;return }}}}function selectOptionValue(D,C){var B=D;if(typeof (B)=="string"){B=document.getElementById(B)}if(B&&B.nodeName=="SELECT"){for(var A=0;A<B.options.length;A++){if(B.options[A].value==C){B.options[A].selected=true;return B.options[A].selected}}}}function returnSelectedOptionValue(C){var B=C;if(typeof (B)=="string"){B=document.getElementById(B)}if(B&&B.nodeName=="SELECT"){for(var A=0;A<B.options.length;A++){if(B.options[A].selected==true){return B.options[A].value}}}}function removeOption(D,C){var B=D;if(typeof (B)=="string"){B=document.getElementById(B)}if(B&&B.nodeName=="SELECT"){for(var A=0;A<B.options.length;A++){if(B.options[A].value==C){B.remove(A);return A}}}}function insertOption(C,A,B,E){var D=document.createElement("option");D.text=E;D.value=B;C.options.add(D,A)}function returnAllOptions(D){var C=D;var A=new Array(new Array,new Array);if(typeof (C)=="string"){C=document.getElementById(C)}if(C&&C.nodeName=="SELECT"){for(var B=0;B<C.options.length;B++){A[0].push(C.options[B].text);A[1].push(C.options[B].value)}return A}}function replaceAllOptions(C,B){var E="";E=C.options.length;if(C&&C.nodeName=="SELECT"){for(var A=0;A<E;A++){C.remove(0)}}if(C&&C.nodeName=="SELECT"){for(var A=0;A<B[0].length;A++){var D=document.createElement("option");D.text=B[0][A];D.value=B[1][A];C.options.add(D)}}}function returnAllOptionIndexes(D){var C=D;var A=new Array(new Array,new Array);if(typeof (C)=="string"){C=document.getElementById(C)}if(C&&C.nodeName=="SELECT"){for(var B=0;B<C.options.length;B++){A[0].push(C.options[B].text);A[1].push(C.options[B].value)}return A}}function findElements(C,D){if(C){var B=new Array();var F=new Array();B=C.childNodes;if(B.length>0){for(var E=0;E<B.length;E++){var H=E;var I=new Array();if(B[E].style){if(B[E].style.visibility!="hidden"&&B[E].style.display!="none"){I=findElements(B[E],D)}}else{I=findElements(B[E],D)}E=H;if(I.length>0){for(var A=0;A<I.length;A++){F.push(I[A])}}var G;if(typeof D=="function"){G=D(B[E])}else{Tapestry.warn("findElements function failed because "+typeof D+" was received when a function name was expected.")}if(G){F.push(B[E])}}}return F}else{return null}}function findFormElements(A){return findElements(A,isFormElement)}function isFormElement(A){if(A){if((A.nodeName=="INPUT"&&A.type!="hidden")||A.nodeName=="SELECT"||A.nodeName=="TEXTAREA"){return true}}else{return false}}function findCheckboxes(A){return findElements(A,isCheckbox)}function isCheckbox(A){if(A){if(A.type=="checkbox"){return true}}return false}function singleCheckboxSelect(C,A){if(C.checked){var D=findCheckboxes(document.getElementById(A));for(var B=0;B<D.length;B++){if(D[B].checked){if(D[B]!=C){D[B].checked=false}}}}}function hideObjectsById(E,D,C){if(E=="hide"){for(var B=0;B<D.length;B++){var A=document.getElementById(D[B]);if(A){A.style.display="none";if(C){disableElements(findFormElements(A),true)}}}}else{if(E=="show"){for(var B=0;B<D.length;B++){var A=document.getElementById(D[B]);if(A){A.style.display="block";if(C){disableElements(findFormElements(A),false)}}}}}if(window.top!=window.self){window.top.updatePopupSize()}}function leapyear(A){if(((A%4==0)&&(A%100!=0))||(A%400==0)){return true}else{return false}}function getAge(E,D,B){var C=-1;var A="valid";if((D<1)||(D>12)||(B<1)||(B>31)||(E<1)||(D=="")||(B=="")||(E=="")||(isNaN(E))){A="Invalid"}else{if(((D==4)||(D==6)||(D==9)||(D==11))&&(B>30)){A="Invalid"}else{if(D==2){if(B>29){A="Invalid"}else{if((B>28)&&(!leapyear(E))){A="Invalid"}}}else{if((E>9999)||(E<0)){A="Invalid"}else{A=A}}}}if(A=="valid"){days=new Date();gdate=days.getDate();gmonth=days.getMonth();gyear=days.getFullYear();C=gyear-E;if((D==(gmonth+1))&&(B<=parseInt(gdate))){C=C}else{if(D<=(gmonth)){C=C}else{C=C-1}}if(C==0){C=C}}else{if(isNaN(E)||E==""){C=undefined}}return C}function singleFieldDash(K,J,G,A,P){var I=document.getElementById(K);var D=new RegExp("#?[0-9]");var H=new RegExp("#?[A-Za-z]");var N=new RegExp("-");if(P.keyCode!=8&&P.keyCode!=46){if(I){var R=I.value;var L=R.split(A);var Q=parseInt(J/G)-1;var E=J-R.length;var M=J-R.length;if(R.substr(-1)!=A){if(D.test(R)||(H.test(R)&&D.test(R))){for(var O=0;O<L.length;O++){if(L[O].length==G){if((L.length-1)==O&&R.length<J){I.value=R+A}}else{break}}}else{return }}if(M==Q&&D.test(L[O])&&!N.test(R)){var C=R.split("");var B=new Array();var F=1;for(var O=1;O<=R.length;O++){B.push(C[O-1]);if(O%G==0&&F<=E){B.push(A);F=F+1}}I.value=B.join("")}}}}function updateHidden(hiddenId,baseId,separator,count,textToStripOut){var hiddenInput=document.getElementById(hiddenId);if(!hiddenInput){return }hiddenInput.value="";for(var i=0;i<count;i++){var part=document.getElementById(baseId+separator+i);if(part){hiddenInput.value+=part.value}}if(hiddenInput.value!=""){if(textToStripOut){var statement="hiddenInput.value = String(hiddenInput.value).replace(/"+textToStripOut+"/g, '')";eval(statement)}}}function blockKeyPresses(C,B){var A;if(window.event){A=event.keyCode}else{A=C.which}if(A==B){return false}}function blockMultiKeyPresses(D,C){var A;if(window.event){A=event.keyCode}else{A=D.which}for(var B=0;B<C.length;B++){if(A==C[B]){return false}}}function toggleDiv(A){var B=document.getElementById(A);if(B.style.display=="none"){B.style.display="block"}else{B.style.display="none"}}function toggleDivs(A){if(typeof A=="object"){for(var C=0;C<A.length;C++){var B=document.getElementById(A[C]);if(B.style.display=="none"){B.style.display="block"}else{B.style.display="none"}}}}function toggleSpan(B){var A=document.getElementById(B);if(A.style.display=="none"){A.style.display="inline"}else{A.style.display="none"}}function toggleSpans(C){if(typeof C=="object"){for(var B=0;B<C.length;B++){var A=document.getElementById(C[B]);if(A.style.display=="none"){A.style.display="inline"}else{A.style.display="none"}}}}var lastFAQ=null;function toggleFAQ(A){var B=document.getElementById(A);if(B.style.display=="block"){B.style.display="none"}else{B.style.display="block"}if(A!=lastFAQ){if(lastFAQ!=null){document.getElementById(lastFAQ).style.display="none"}lastFAQ=A}else{lastFAQ=null}}function populate(A,D){var P=0;var Q=new Date();var N;var T;var G;var H;var J=0;var S=108;if(kiIsBackend){J=1;S=120}var L=1;if(D){if(D==""){T="";N="";G=""}else{if(D=="today"){T=Q.getMonth();N=Q.getDate();G=Q.getFullYear()}else{var K=String(D).split("/");T=K[0];if(T.length>1&&T.charAt(0)=="0"){T=T.substring(1,T.length)}T=parseInt(T)-1;N=K[1];if(N.length>1&&N.charAt(0)=="0"){N=N.substring(1,N.length)}N=parseInt(N);G=K[2]}}}H=Q.getFullYear();for(var O=1;O<=31;O++){var F=String(O);A.day.options[O-(1-(1*J))]=new Option(F,F)}for(var O=0;O<=31+J;O++){var R=0;if(A.day.options[O]){R=A.day.options[O].value}if(R==N){A.day.options[O].selected=true;break}}var B=S+L+(H-2008);if(G<H-B){B+=H-B-G+1}for(var O=L,M=H;O<=B;O++,M--){var E=String(M);A.year.options[O]=new Option(E,E);if(E==G){A.year.options[O].selected=true}}if(!kiIsBackend){A.year.options[0].text="  --";if(kiFromRegistration){A.year.options[0].selected=true}}if(!kiIsBackend){var I=new Array();var C=A.month;I=C.options;for(var O=1;O<I.length;O++){C.options[O-1]=new Option(I[O].text,I[O].value)}C.options[C.options.length-1]=null}for(var O=J;O<=12+J;O++){if(A.month.options[O]){if(A.month.options[O].value==T){A.month.options[O].selected=true;break}}}}var kiFlashEnabled=false;function flashMovie(A){if(isIE){if(window[A]){return window[A]}else{return document.getElementById(A)}}else{return document[A]}}function ControlVersion(){var A;var B;var C;try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");A=B.GetVariable("$version")}catch(C){}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");A="WIN 6,0,21,0";B.AllowScriptAccess="always";A=B.GetVariable("$version")}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");A=B.GetVariable("$version")}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");A="WIN 3,0,18,0"}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");A="WIN 2,0,0,11"}catch(C){A=-1}}return A}function GetSwfVer(){var G=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var F=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var A=navigator.plugins["Shockwave Flash"+F].description;var E=A.split(" ");var C=E[2].split(".");var H=C[0];var B=C[1];if(E[3]!=""){tempArrayMinor=E[3].split("r")}else{tempArrayMinor=E[4].split("r")}var D=tempArrayMinor[1]>0?tempArrayMinor[1]:0;var G=H+"."+B+"."+D}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){G=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){G=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){G=2}else{if(isIE&&isWin&&!isOpera){G=ControlVersion()}}}}}return G}function DetectFlashVer(F,D,C){versionStr=GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var E=versionArray[0];var A=versionArray[1];var B=versionArray[2];if(E>parseFloat(F)){return true}else{if(E==parseFloat(F)){if(A>parseFloat(D)){return true}else{if(A==parseFloat(D)){if(B>=parseFloat(C)){return true}}}}}return false}}}kiFlashEnabled=DetectFlashVer(9,0,0);function flashError(A){Tapestry.warn(A)}function flashWarn(A){Tapestry.warn(A)}function renderSoundPlayer(C){if(kiFlashEnabled){if(C){var A="";var B=staticJavaScriptRoot+"/themes/global/flash/SoundPlayer.swf";A+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="10" height="10" id="flashSoundPlayer" align="left" valign="top">';A+='<param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" />';A+='<param name="FlashVars" value="usingCDN='+kiCdnEnabled+'&loadFunction=soundPlayerLoadComplete" />';A+='<param name="movie" value="'+B+'" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#000000" />';A+='<embed src="'+B+'" FlashVars="usingCDN='+kiCdnEnabled+'&loadFunction=soundPlayerLoadComplete" quality="high" wmode="transparent" scale="noscale" width="10" height="10" name="flashSoundPlayer" align="left" valign="top" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" /></object>';return A}else{Tapestry.warn("Could not render sound player without a load complete function callback.")}}}function removeCDN(G){if(kiCdnEnabled){var F=window.location.href;var C=F.split("/");var E=G.split("/");var A=staticFileRoot.replace(staticJavaScriptRoot,"");var B=E[0]+"//"+C[2];var D=G.replace(A,B);return D}else{return G}}function checkOpacity(C){var B=document.getElementById(C);if(isIE){try{if(B.filters.alpha.opacity){if(B.filters.alpha.opacity!=100){return true}}else{return false}}catch(A){return false}}else{if(B){if(B.style.opacity!=1&&B.style.opacity!=""){return true}}}return false}function sc(){if(!kiActionLinkClicked){kiActionLinkClicked=true;window.top.blockButtonClicks();return true}return false}function handleConfirm(A){if(confirm(A)){return sc()}else{return false}}function clearClickBlocker(){var A=window.top.document.getElementById("backHolderOverlay");if(A){if(A.className=="preventButtonClicks"){A.className="";A.style.height="1px";A.style.width="1px"}}document.onkeydown=function(C){var B;if(window.event){B=event.keyCode}else{B=C.which}if(B==32||B==13){return true}}}function removeIphoneToolbar(){window.scrollTo(0,1)}function firefoxAddonLaunch(E){if(isFF){if(!document.getElementsByTagName("MyExtensionDataElement")[0]){var D=document.getElementById("firefoxExtShell");var C=document.createElement("div");var F=document.createElement("div");var B=document.createElement("div");D.style.color="white";C.id="firefoxProgressElement";F.id="firefoxProgressBar";B.id="firefoxProgressState";D.appendChild(C);D.appendChild(F);F.style.height="20px";F.style.width="1px";F.style.backgroundColor="#990000";D.appendChild(B);var G=document.createElement("MyExtensionDataElement");G.setAttribute("downloadPath",E);document.documentElement.appendChild(G);var A=document.createEvent("Events");A.initEvent("MyExtensionEvent",true,false);G.dispatchEvent(A)}}};