var gWindowCounter=Math.round(Math.random()*10000);var winModalWindow;function GetRWID(A){if(IsIe()){return A.RWID}else{var B=A.attributes.RWID;return B!=null?B.value:null}}function ShowSectionsByRWID(B,E,F){var A=GetElementInDocument(B);var D=document.getElementsByTagName("span");for(var C=0;C<D.length;C++){if(GetRWID(D[C])==F){if(A.value==E){D[C].style.display="none"}else{D[C].style.display=""}}}}function ShowSectionsByRWID(D,C){var B=document.getElementsByTagName("span");for(var A=0;A<B.length;A++){if(GetRWID(B[A])==D){if(!C){B[A].style.display="none"}else{B[A].style.display=""}}}}function FindControlByRWID(A,D){var C=document.getElementsByTagName(A);for(var B=0;B<C.length;B++){if(GetRWID(C[B])==D){return C[B]}}return null}function DisableControlsByRWID(A,I,H,E){var G=GetElementInDocument(A);var F=document.getElementsByTagName("span");for(var C=0;C<F.length;C++){if(GetRWID(F[C])==H){var B=F[C].getElementsByTagName("input");for(var D=0;D<B.length;D++){if(G.value==I){B[D].value=E;B[D].disabled=true}else{B[D].disabled=false}}}}}function ShowSection(C,B,D){var A=GetElementInDocument(C);var E=GetElementInDocument(D);if(E!=null){if(A.value==B){E.style.display="none"}else{E.style.display=""}}}function ToggleVisibility(C,B){var D=GetElementInDocument(C);var A=FindControlByRWID("input",B);if(D!=null){if(D.style.display=="none"){D.style.display="";if(A){A.value="true"}}else{D.style.display="none";if(A){A.value="false"}}}}function RestoreVisibility(D,C,B){var E=GetElementInDocument(D);var A=FindControlByRWID("input",C);if(E&&A){if(A.value=="true"){E.style.display=B?"none":""}else{E.style.display=B?"":"none"}}}function SWTRound(F,A){if(isNaN(F)){return F}var E;if(A>0){E=String(Math.round(F*Math.pow(10,A)))}else{E=String(Math.round(F))}var D=E.length-A;var C;if(D<=0){C="0.";for(var B=0;B<-D;B++){C+="0"}C+=E}else{if(D<E.length){C=E.substring(0,D);C+=".";C+=E.substring(D,E.length)}else{C=E}}return C}function GetSpansByName(A){return GetElementsByNameAndType(A,"span")}function GetElementsByNameAndType(C,D){var E=new Array();if(!IsIe()){var A=document.getElementsByName(C);for(var B=0;B<A.length;B++){E.push(A[B])}}else{var A=document.getElementsByTagName(D);for(var B=0;B<A.length;B++){if(A[B].name==C){E.push(A[B])}}}return E}function ShowPicture(F,H,C,D){var B=100;var G=100;if(screen){B=(screen.availWidth-C)/2;G=(screen.availHeight-D)/2}gWindowCounter++;var A="Picture"+gWindowCounter;var E=window.open("",A,"width="+C+",height="+D+",left="+B+",top="+G+",screenX="+B+",screenY="+G+",location=no,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no");E.document.write("<html><head><title>"+H+'</title></head><body style="margin: 0px 0px 0px 0px;"><img src="'+F+'"></body></html>');return }function OpenPopupWindow(D,B,C){var A=100;var E=100;if(screen){A=(screen.availWidth-B)/2;E=(screen.availHeight-C)/2}window.open(D,"","width="+B+",height="+C+",left="+A+",top="+E+",location=no,status=no,toolbar=no,menubar=no,scrollbars,resizable");return }function ShowUrl(C,H,D,E,I){var A=100;var G=100;if(screen){A=(screen.availWidth-D)/2;G=(screen.availHeight-E)/2}gWindowCounter++;var B=I?"yes":"no";var J="Popup"+gWindowCounter;var F=window.open(C,J,"width="+D+",height="+E+",left="+A+",top="+G+",screenX="+A+",screenY="+G+",location=no,status=no,toolbar=no,menubar=no,scrollbars="+B+",resizable=no");return }function GetElementInDocument(C){if(IsModern()){var B=document.getElementById(C);if(B==null){var A=document.getElementsByName(C);if(A.length>0){B=A[0]}}return B}else{if(IsIe()){return document.all[C]}else{return document.layers[C]}}}function IsModern(){if(document.getElementById){return true}else{return false}}function IsIe(){var A=(document.all);if(A){return true}else{return false}}function IsMac(){if(navigator.platform.toLowerCase().indexOf("mac")!=-1){return true}else{return false}}function GetParent(A){if(IsIe()){return A.parentElement}else{return A.parentNode}}function SetControlFocus(J){var F=null;if(J!=null){F=GetElementInDocument(J)}else{if(document.forms[0]!=null){for(var C=0;C<document.forms[0].elements.length;C++){var G=document.forms[0].elements[C];var A=G.tagName;var H=G.type;if(A=="INPUT"){if(H!="text"&&H!="checkbox"){continue}}else{continue}var L=G.style;if(L!=null){if(L.display=="none"||L.visibility=="hidden"){continue}}if(G.disabled==true){continue}var E=G;var K=G.clientWidth;var I=G.clientHeight;if(K==0||I==0){continue}while(E!=null){K+=E.offsetLeft;I+=E.offsetTop;E=E.offsetParent}var D=GetBodyElement();if(K>D.clientWidth||I>D.clientHeight){continue}F=G;break}}}if(F!=null){try{F.focus();if(IsIe()&&F.type=="text"){F.value=F.value;F.focus()}}catch(B){}}}function GetBodyElement(){return(document.compatMode=="CSS1Compat")?document.documentElement:document.body}function ChangeControlStateRecursive(C,A,D){if(C.tagName==A){C.disabled=!D;if(!D&&C.tagName=="A"){C.onclick=function(){return false}}}else{for(var B=0;B<C.children.length;B++){ChangeControlStateRecursive(C.children[B],A,D)}}}function ChangeControlStateRecursiveByType(B,C,D){if(IsControlOfType(B,C)){B.disabled=!D}else{for(var A=0;A<B.children.length;A++){ChangeControlStateRecursive(B.children[A],C,D)}}}function CopyControlData(G,E){var C=new Array();var L=0;var A=0;var K=ResolveControl(G);var H=ResolveControl(E);var F=GetChildFormElements(K);for(var D=0;D<F.length;D++){var J=F[D];if(J.type=="checkbox"){C[L]=J.checked}else{if(J.value){C[L]=J.value}}L++}var I=GetChildFormElements(H);for(var D=0;D<Math.min(I.length,F.length);D++){var B=I[D];if(B.type=="checkbox"){B.checked=C[A]}else{if(C[A]){B.value=C[A]}else{if(B.value){B.value=""}}}A++}}function IsControlEmpty(C){var E=ResolveControl(C);var D=GetChildFormElements(C);for(i=0;i<D.length;i++){var B=D[i];if(B.tagName=="SELECT"){var A=B.options[B.selectedIndex];if(A.value!=""&&A.innerText!=""){return false}}else{if(B.tagName=="INPUT"&&B.type=="submit"){}else{if(B.tagName=="INPUT"&&B.type=="checkbox"&&!B.checked){}else{if(B.value!=""){return false}}}}}return true}function FindChildControl(A,C,B){var D=new Array();A=ResolveControl(A);FindChildControlRecursive(D,A,C,B);if(D.length<=B){return null}return D[B]}function FindChildControlRecursive(A,B,F,D){for(var C=0;C<B.childNodes.length;C++){var E=B.childNodes[C];if(IsControlOfType(E,F)){A.push(E);if(A.length>D){return }}if(E.childNodes&&E.childNodes.length>0){FindChildControlRecursive(A,E,F)}if(A.length>D){return }}}function FindChildInputControl(A,C,B){var D=new Array();A=ResolveControl(A);FindChildInputControlRecursive(D,A,C,B);if(D.length<=B){return null}return D[B]}function FindChildInputControlRecursive(A,B,F,D){for(var C=0;C<B.childNodes.length;C++){var E=B.childNodes[C];if(IsControlOfType(E,"INPUT")&&(E.type==F)){A.push(E);if(A.length>D){return }}if(E.childNodes&&E.childNodes.length>0){FindChildInputControlRecursive(A,E,F)}if(A.length>D){return }}}function FindSummaryRows(A){var B=new Array();A=ResolveControl(A);FindSummaryRowsRecursive(B,A);return B}function FindSummaryRowsRecursive(A,B){for(var C=0;C<B.childNodes.length;C++){var D=B.childNodes[C];if(D.summaryrow){A.push(D)}if(D.childNodes&&D.childNodes.length>0){FindSummaryRowsRecursive(A,D)}}}function FindChildControlById(B,A){B=ResolveControl(B);return FindChildControlByIdRecursive(B,A)}function FindChildControlByIdRecursive(B,A){for(var C=0;C<B.childNodes.length;C++){var D=B.childNodes[C];if(D.id==A){return D}if(D.childNodes&&D.childNodes.length>0){D=FindChildControlByIdRecursive(D,A);if(D!=null){return D}}}return null}function IsControlOfType(A,B){if(A.controlType&&A.controlType==B){return true}else{if(A.tagName&&A.tagName==B){return true}}return false}function FindParentByType(B,A){var C=B;while((C!=null)&&(!IsControlOfType(C,A))){C=GetParent(C)}return C}function ResolveControl(A){if(typeof (A)=="string"){return GetElementInDocument(A)}return A}function GetChildFormElements(B){B=ResolveControl(B);var A=new Array();GetChildFormElementsRecursive(B,A);return A}function GetChildFormElementsRecursive(C,A){for(var B=0;B<C.childNodes.length;++B){var D=C.childNodes[B];if(D.tagName=="INPUT"||D.tagName=="SELECT"){A.push(D)}GetChildFormElementsRecursive(D,A)}}function GetDatePickerValue(A){return DatePicker_GetSelectedDate(A)}var Nav4=((navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)>=4));var dialogWin=new Object();function openDialog(D,F,B,E,C){if(!dialogWin.win||(dialogWin.win&&dialogWin.win.closed)){dialogWin.returnFunc=E;dialogWin.returnedValue="";dialogWin.args=C;dialogWin.url=D;dialogWin.width=F;dialogWin.height=B;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 A="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 A="scrollbars,left="+dialogWin.left+",top="+dialogWin.top+",resizable=yes,width="+dialogWin.width+",height="+dialogWin.height}dialogWin.win=window.open(dialogWin.url,dialogWin.name,A);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 C=0;C<frames.length;C++){for(var B=0;B<frames[C].document.forms.length;B++){for(var A=0;A<frames[C].document.forms[B].elements.length;A++){frames[C].document.forms[B].elements[A].disabled=true}}IELinkClicks[C]=new Array();for(B=0;B<frames[C].document.links.length;B++){IELinkClicks[C][B]=frames[C].document.links[B].onclick;frames[C].document.links[B].onclick=deadend}}}function enableForms(){for(var C=0;C<frames.length;C++){for(var B=0;B<frames[C].document.forms.length;B++){for(var A=0;A<frames[C].document.forms[B].elements.length;A++){frames[C].document.forms[B].elements[A].disabled=false}}for(B=0;B<frames[C].document.links.length;B++){frames[C].document.links[B].onclick=IELinkClicks[C][B]}}}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(A){if(top.opener&&!top.opener.closed){if(top.opener.dialogWin.returnFunc){top.opener.dialogWin.returnFunc(A)}}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.prototype.push==null){Array.prototype.push=ArrayPush}function AddEvent(D,A,C){if(D.addEventListener){D.addEventListener(A,C,false);return true}else{if(D.attachEvent){var B=D.attachEvent("on"+A,C);return B}else{return false}}}function TrimString(A){A=A.replace(/^\s+/g,"");return A.replace(/\s+$/g,"")}function CombineFunctions(A,B){return function(){if(A){A()}if(B){B()}}};