var gWindowCounter=Math.round(Math.random()*10000);var winModalWindow;function GetRWID(C){if(IsIe()){return C.RWID}else{var D=C.attributes==null?null:C.attributes.RWID;return D!=null?D.value:null}}function ShowSectionsByRWID(L,I,H){var G=GetElementInDocument(L);var J=document.getElementsByTagName("span");for(var K=0;K<J.length;K++){if(GetRWID(J[K])==H){if(G.value==I){J[K].style.display="none"}else{J[K].style.display=""}}}}function ShowSectionsByRWID(F,G){var H=document.getElementsByTagName("span");for(var E=0;E<H.length;E++){if(GetRWID(H[E])==F){if(!G){H[E].style.display="none"}else{H[E].style.display=""}}}}function FindControlByRWID(E,F){var G=document.getElementsByTagName(E);for(var H=0;H<G.length;H++){if(GetRWID(G[H])==F){return G[H]}}return null}function DisableControlsByRWID(M,N,O,R){var P=GetElementInDocument(M);var Q=document.getElementsByTagName("span");for(var K=0;K<Q.length;K++){if(GetRWID(Q[K])==O){var L=Q[K].getElementsByTagName("input");for(var J=0;J<L.length;J++){if(P.value==N){L[J].value=R;L[J].disabled=true}else{L[J].disabled=false}}}}}function ShowSection(I,J,H){var F=GetElementInDocument(I);var G=GetElementInDocument(H);if(G!=null){if(F.value==J){G.style.display="none"}else{G.style.display=""}}}function ToggleVisibility(G,H){var F=GetElementInDocument(G);var E=FindControlByRWID("input",H);if(F!=null){if(F.style.display=="none"){F.style.display="";if(E){E.value="true"}}else{F.style.display="none";if(E){E.value="false"}}}}function RestoreVisibility(H,I,J){var G=GetElementInDocument(H);var F=FindControlByRWID("input",I);if(G&&F){if(F.value=="true"){G.style.display=J?"none":""}else{G.style.display=J?"":"none"}}}function SWTRound(H,G){if(isNaN(H)){return H}var I;if(G>0){I=String(Math.round(H*Math.pow(10,G)))}else{I=String(Math.round(H))}var J=I.length-G;var K;if(J<=0){K="0.";for(var L=0;L<-J;L++){K+="0"}K+=I}else{if(J<I.length){K=I.substring(0,J);K+=".";K+=I.substring(J,I.length)}else{K=I}}return K}function GetSpansByName(G){if(!IsIe()){return document.getElementsByName(G)}else{var F=new Array();var E=document.getElementsByTagName("span");for(var H=0;H<E.length;H++){if(E[H].name==G){F.push(E[H])}}return F}}function ShowPicture(L,J,O,N){var P=100;var K=100;if(screen){P=(screen.availWidth-O)/2;K=(screen.availHeight-N)/2}gWindowCounter++;var I="Picture"+gWindowCounter;var M=window.open("",I,"width="+O+",height="+N+",left="+P+",top="+K+",screenX="+P+",screenY="+K+",location=no,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no");M.document.write("<html><head><title>"+J+'</title></head><body style="margin: 0px 0px 0px 0px;"><img src="'+L+'"></body></html>');return }function OpenPopupWindow(H,J,I){var F=100;var G=100;if(screen){F=(screen.availWidth-J)/2;G=(screen.availHeight-I)/2}window.open(H,"","width="+J+",height="+I+",left="+F+",top="+G+",location=no,status=no,toolbar=no,menubar=no,scrollbars,resizable");return }function ShowUrl(L,Q,K,T,P){var N=100;var R=100;if(screen){N=(screen.availWidth-K)/2;R=(screen.availHeight-T)/2}gWindowCounter++;var M=P?"yes":"no";var O="Popup"+gWindowCounter;var S=window.open(L,O,"width="+K+",height="+T+",left="+N+",top="+R+",screenX="+N+",screenY="+R+",location=no,status=no,toolbar=no,menubar=no,scrollbars="+M+",resizable=no");return }function GetElementInDocument(E){if(IsModern()){var F=document.getElementById(E);if(F==null){var D=document.getElementsByName(E);if(D.length>0){F=D[0]}}return F}else{if(IsIe()){return document.all[E]}else{return document.layers[E]}}}function IsModern(){if(document.getElementById){return true}else{return false}}function IsIe(){var B=(document.all);if(B){return true}else{return false}}function IsMac(){if(navigator.platform.toLowerCase().indexOf("mac")!=-1){return true}else{return false}}function GetParent(B){if(IsIe()){return B.parentElement}else{return B.parentNode}}function SetControlFocus(S){var W=null;if(S!=null){W=GetElementInDocument(S)}else{if(document.forms[0]!=null){for(var N=0;N<document.forms[0].elements.length;N++){var V=document.forms[0].elements[N];var P=V.tagName;var U=V.type;if(P=="INPUT"){if(U!="text"&&U!="checkbox"){continue}}else{continue}var Q=V.style;if(Q!=null){if(Q.display=="none"||Q.visibility=="hidden"){continue}}if(V.disabled==true){continue}var X=V;var R=V.clientWidth;var T=V.clientHeight;if(R==0||T==0){continue}while(X!=null){R+=X.offsetLeft;T+=X.offsetTop;X=X.offsetParent}var M=GetBodyElement();if(R>M.clientWidth||T>M.clientHeight){continue}W=V;break}}}if(W!=null){try{W.focus();if(IsIe()&&W.type=="text"){W.value=W.value;W.focus()}}catch(O){}}}function GetBodyElement(){return(document.compatMode=="CSS1Compat")?document.documentElement:document.body}function ChangeControlStateRecursive(G,E,F){if(G.tagName==E){G.disabled=!F;if(!F&&G.tagName=="A"){G.onclick=function(){return false}}}else{for(var H=0;H<G.children.length;H++){ChangeControlStateRecursive(G.children[H],E,F)}}}function ChangeControlStateRecursiveByType(H,G,F){if(IsControlOfType(H,G)){H.disabled=!F}else{for(var E=0;E<H.children.length;E++){ChangeControlStateRecursive(H.children[E],G,F)}}}function CopyControlData(V,X){var N=new Array();var Q=0;var P=0;var R=ResolveControl(V);var U=ResolveControl(X);var W=GetChildFormElements(R);for(var M=0;M<W.length;M++){var S=W[M];if(S.type=="checkbox"){N[Q]=S.checked}else{if(S.value){N[Q]=S.value}}Q++}var T=GetChildFormElements(U);for(var M=0;M<Math.min(T.length,W.length);M++){var O=T[M];if(O.type=="checkbox"){O.checked=N[P]}else{if(N[P]){O.value=N[P]}else{if(O.value){O.value=""}}}P++}}function IsControlEmpty(I){var G=ResolveControl(I);var H=GetChildFormElements(I);for(i=0;i<H.length;i++){var J=H[i];if(J.tagName=="SELECT"){var F=J.options[J.selectedIndex];if(F.value!=""&&F.innerText!=""){return false}}else{if(J.tagName=="INPUT"&&J.type=="submit"){}else{if(J.tagName=="INPUT"&&J.type=="checkbox"&&!J.checked){}else{if(J.value!=""){return false}}}}}return true}function FindChildControl(E,G,H){var F=new Array();E=ResolveControl(E);FindChildControlRecursive(F,E,G,H);if(F.length<=H){return null}return F[H]}function FindChildControlRecursive(G,L,H,J){for(var K=0;K<L.childNodes.length;K++){var I=L.childNodes[K];if(IsControlOfType(I,H)){G.push(I);if(G.length>J){return }}if(I.childNodes&&I.childNodes.length>0){FindChildControlRecursive(G,I,H)}if(G.length>J){return }}}function FindChildInputControl(E,G,H){var F=new Array();E=ResolveControl(E);FindChildInputControlRecursive(F,E,G,H);if(F.length<=H){return null}return F[H]}function FindChildInputControlRecursive(G,L,H,J){for(var K=0;K<L.childNodes.length;K++){var I=L.childNodes[K];if(IsControlOfType(I,"INPUT")&&(I.type==H)){G.push(I);if(G.length>J){return }}if(I.childNodes&&I.childNodes.length>0){FindChildInputControlRecursive(G,I,H)}if(G.length>J){return }}}function FindSummaryRows(C){var D=new Array();C=ResolveControl(C);FindSummaryRowsRecursive(D,C);return D}function FindSummaryRowsRecursive(E,H){for(var G=0;G<H.childNodes.length;G++){var F=H.childNodes[G];if(F.summaryrow){E.push(F)}if(F.childNodes&&F.childNodes.length>0){FindSummaryRowsRecursive(E,F)}}}function FindChildControlById(D,C){D=ResolveControl(D);return FindChildControlByIdRecursive(D,C)}function FindChildControlByIdRecursive(H,E){for(var G=0;G<H.childNodes.length;G++){var F=H.childNodes[G];if(F.id==E){return F}if(F.childNodes&&F.childNodes.length>0){F=FindChildControlByIdRecursive(F,E);if(F!=null){return F}}}return null}function IsControlOfType(C,D){if(C.controlType&&C.controlType==D){return true}else{if(C.tagName&&C.tagName==D){return true}}return false}function FindParentByType(F,D){var E=F;while((E!=null)&&(!IsControlOfType(E,D))){E=GetParent(E)}return E}function ResolveControl(B){if(typeof (B)=="string"){return GetElementInDocument(B)}return B}function FindChildControlByRWID(I,F,G){I=ResolveControl(I);var H=I.getElementsByTagName(F);for(var J=0;J<H.length;J++){if(GetRWID(H[J])==G){return H[J]}}return null}function GetChildFormElements(D){D=ResolveControl(D);var C=new Array();GetChildFormElementsRecursive(D,C);return C}function GetChildFormElementsRecursive(G,E){for(var H=0;H<G.childNodes.length;++H){var F=G.childNodes[H];if(F.tagName=="INPUT"||F.tagName=="SELECT"){E.push(F)}GetChildFormElementsRecursive(F,E)}}function GetDatePickerValue(B){return DatePicker_GetSelectedDate(B)}var Nav4=((navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)>=4));var dialogWin=new Object();function openDialog(J,H,L,I,K){if(!dialogWin.win||(dialogWin.win&&dialogWin.win.closed)){dialogWin.returnFunc=I;dialogWin.returnedValue="";dialogWin.args=K;dialogWin.url=J;dialogWin.width=H;dialogWin.height=L;dialogWin.name=(new Date()).getSeconds().toString();if(Nav4){dialogWin.left=window.screenX+((window.outerWidth-dialogWin.width)/2);dialogWin.top=window.screenY+((window.outerHeight-dialogWin.height)/2);var G="scrollbars,screenX="+dialogWin.left+",screenY="+dialogWin.top+",resizable=yes,width="+dialogWin.width+",height="+dialogWin.height}else{dialogWin.left=(screen.width-dialogWin.width)/2;dialogWin.top=(screen.height-dialogWin.height)/2;var G="scrollbars,left="+dialogWin.left+",top="+dialogWin.top+",resizable=yes,width="+dialogWin.width+",height="+dialogWin.height}dialogWin.win=window.open(dialogWin.url,dialogWin.name,G);dialogWin.win.focus()}else{dialogWin.win.focus()}}function deadend(){if(dialogWin.win&&!dialogWin.win.closed){dialogWin.win.focus();return false}}var IELinkClicks;function disableForms(){IELinkClicks=new Array();for(var E=0;E<frames.length;E++){for(var F=0;F<frames[E].document.forms.length;F++){for(var D=0;D<frames[E].document.forms[F].elements.length;D++){frames[E].document.forms[F].elements[D].disabled=true}}IELinkClicks[E]=new Array();for(F=0;F<frames[E].document.links.length;F++){IELinkClicks[E][F]=frames[E].document.links[F].onclick;frames[E].document.links[F].onclick=deadend}}}function enableForms(){for(var E=0;E<frames.length;E++){for(var F=0;F<frames[E].document.forms.length;F++){for(var D=0;D<frames[E].document.forms[F].elements.length;D++){frames[E].document.forms[F].elements[D].disabled=false}}for(F=0;F<frames[E].document.links.length;F++){frames[E].document.links[F].onclick=IELinkClicks[E][F]}}}function blockEvents(){if(Nav4){window.captureEvents(Event.CLICK|Event.MOUSEDOWN|Event.MOUSEUP|Event.FOCUS);window.onclick=deadend}else{disableForms()}window.onfocus=checkModal}function unblockEvents(){if(Nav4){window.releaseEvents(Event.CLICK|Event.MOUSEDOWN|Event.MOUSEUP|Event.FOCUS);window.onclick=null;window.onfocus=null}else{enableForms()}}function checkModal(){if(dialogWin.win&&!dialogWin.win.closed){dialogWin.win.focus()}}function dialogReturn(B){if(top.opener&&!top.opener.closed){if(top.opener.dialogWin.returnFunc){top.opener.dialogWin.returnFunc(B)}}else{alert("You have closed the main window.\n\nNo action will be taken on the choices in this dialog box.")}window.close()}function ArrayPush(){this[this.length]=arguments[0];return(this.length)}if(Array.push==null){Array.prototype.push=ArrayPush}String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};function CombineFunctions(C,D){return function(){if(C){C()}if(D){D()}}}function ShowDropDownPopUp(N,O,L){var I=N;if(I.value=="-1"){var M=prompt(L,"");if(!isNaN(parseInt(M))&&M!=null&&M>0&&parseInt(M)==M){var K=true;for(var P=0;P<I.options.length;P++){if(M==I.options[P].value){K=false}}if(K){var J=I.options[I.options.length-1];I.options.length=I.options.length+1;I.options[I.options.length-1]=new Option(J.text,J.value);I.options[I.options.length-2]=new Option(M,M)}for(var P=0;P<I.options.length;P++){if(M==I.options[P].value){I.selectedIndex=P}}}else{I.selectedIndex=O}}return I.selectedIndex}function GetInputValue(D){var C=GetSiblingByTagName(D,"input");return C.value}function GetSelectedValue(C){var D=GetSiblingByTagName(C,"select");return D.options[D.selectedIndex].text}function GetSiblingByTagName(D,C){while(D&&!(D.tagName&&D.tagName.toLowerCase()==C)){D=D.nextSibling}return D}function GetParentByTagName(D,C){while(D&&!(D.tagName&&D.tagName.toLowerCase()==C)){D=D.parentNode}return D}function GetShortDateString(B){return B.getDate()+"/"+(B.getMonth()+1)+"/"+B.getFullYear()}function GetShortTimeString(I){var F=I.getHours();var J=I.getMinutes();var G=F.toString().length==1?"0"+F.toString():F.toString();var H=J.toString().length==1?"0"+J.toString():J.toString();return G+":"+H}function Check(){c="&";if(document.location.href.indexOf("?")==-1){c="?"}if(document.location.href.indexOf("reloaded=true")==-1){document.location.href=document.location.href+c+"reloaded=true"}else{document.getElementById("err").style.display="block"}}function SignInButtonDisplay(E){var D=GetElementInDocument("createAccountId");var F=GetElementInDocument("loginId");if(D!=null&&F!=null){if(E){F.style.display="none";D.style.display="block"}else{D.style.display="none";F.style.display="block"}}};