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 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])}}}}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 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 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){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}}}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,C){var O=0;var P=new Date();var M;var S;var F;var G;var I=0;var R=108;if(kiIsBackend){I=1;R=120}var K=1;if(C){if(C==""){S="";M="";F=""}else{if(C=="today"){S=P.getMonth();M=P.getDate();F=P.getFullYear()}else{var J=String(C).split("/");S=J[0];if(S.length>1&&S.charAt(0)=="0"){S=S.substring(1,S.length)}S=parseInt(S)-1;M=J[1];if(M.length>1&&M.charAt(0)=="0"){M=M.substring(1,M.length)}M=parseInt(M);F=J[2]}}}G=P.getFullYear();for(var N=1;N<=31;N++){var E=String(N);A.day.options[N-(1-(1*I))]=new Option(E,E)}for(var N=0;N<=31+I;N++){var Q=0;if(A.day.options[N]){Q=A.day.options[N].value}if(Q==M){A.day.options[N].selected=true;break}}for(var N=K,L=G;N<=R+K+(G-2008);N++,L--){var D=String(L);A.year.options[N]=new Option(D,D);if(D==F){A.year.options[N].selected=true}}if(!kiIsBackend){A.year.options[0].text="  --";if(kiFromRegistration){A.year.options[0].selected=true}}if(!kiIsBackend){var H=new Array();var B=A.month;H=B.options;for(var N=1;N<H.length;N++){B.options[N-1]=new Option(H[N].text,H[N].value)}B.options[B.options.length-1]=null}for(var N=I;N<=12+I;N++){if(A.month.options[N]){if(A.month.options[N].value==S){A.month.options[N].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}}};