﻿var ZHD_COL_DELIMITER=String.fromCharCode(16);var ZHD_ROW_DELIMITER=String.fromCharCode(15);var __zhd_m_bPageLoaded=false;window.onload=__zhd_Page_OnLoad;function __zhd_ClientAPIEnabled(){return typeof(zhd)!="undefined"}function __zhd_Page_OnLoad(){if(__zhd_ClientAPIEnabled()){var sLoadHandlers=zhd.getVar("__zhd_pageload");if(sLoadHandlers!=null){eval(sLoadHandlers)}zhd.dom.attachEvent(window,"onscroll",__zhd_bodyscroll)}__zhd_m_bPageLoaded=true}function __zhd_KeyDown(iKeyCode,sFunc,e){if(e==null){e=window.event}if(e.keyCode==iKeyCode){eval(unescape(sFunc));return false}}function __zhd_bodyscroll(){var A=document.forms[0];if(__zhd_ClientAPIEnabled()&&__zhd_m_bPageLoaded){A.ScrollTop.value=document.documentElement.scrollTop?document.documentElement.scrollTop:zhd.dom.getByTagName("body")[0].scrollTop}}function __zhd_setScrollTop(C){if(__zhd_ClientAPIEnabled()){if(C==null){C=document.forms[0].ScrollTop.value}var A=zhd.getVar("ScrollToControl");if(A!=null&&A.length>0){var B=zhd.dom.getById(A);if(B!=null){C=zhd.dom.positioning.elementTop(B);zhd.setVar("ScrollToControl","")}}window.scrollTo(0,C)}}function __zhd_SetInitialFocus(A){var B=zhd.dom.getById(A);if(B!=null&&__zhd_CanReceiveFocus(B)){B.focus()}}function __zhd_CanReceiveFocus(B){if(B.style.display!="none"&&B.tabIndex>-1&&B.disabled==false&&B.style.visible!="hidden"){var A=B.parentElement;while(A!=null&&A.tagName!="BODY"){if(A.style.display=="none"||A.disabled||A.style.visible=="hidden"){return false}A=A.parentElement}return true}else{return false}}function __zhd_ContainerMaxMin_OnClick(A,H){var C=zhd.dom.getById(H);if(C!=null){var B=A.childNodes[0];var I=A.getAttribute("containerid");var G=A.getAttribute("cookieid");var J=B.src.toLowerCase().substr(B.src.lastIndexOf("/"));var K;var D;var E;if(zhd.getVar("min_icon_"+I)){E=zhd.getVar("min_icon_"+I)}else{E=zhd.getVar("min_icon")}if(zhd.getVar("max_icon_"+I)){D=zhd.getVar("max_icon_"+I)}else{D=zhd.getVar("max_icon")}K=D.toLowerCase().substr(D.lastIndexOf("/"));var F=5;if(A.getAttribute("animf")!=null){F=new Number(A.getAttribute("animf"))}if(J==K){B.src=E;zhd.dom.expandElement(C,F);B.title=zhd.getVar("min_text");if(G!=null){if(zhd.getVar("__zhd_"+I+":defminimized")=="true"){zhd.dom.setCookie(G,"true",365)}else{zhd.dom.deleteCookie(G)}}else{zhd.setVar("__zhd_"+I+"_Visible","true")}}else{B.src=D;zhd.dom.collapseElement(C,F);B.title=zhd.getVar("max_text");if(G!=null){if(zhd.getVar("__zhd_"+I+":defminimized")=="true"){zhd.dom.deleteCookie(G)}else{zhd.dom.setCookie(G,"false",365)}}else{zhd.setVar("__zhd_"+I+"_Visible","false")}}return true}return false}function __zhd_Help_OnClick(A){var B=zhd.dom.getById(A);if(B!=null){if(B.style.display=="none"){B.style.display=""}else{B.style.display="none"}return true}return false}function __zhd_SectionMaxMin(C,G){var E=zhd.dom.getById(G);if(E!=null){var D=C.getAttribute("max_icon");var F=C.getAttribute("min_icon");var A=C.getAttribute("userctr")!=null;var B;if(E.style.display=="none"){C.src=F;E.style.display="";if(A){B="True"}else{zhd.setVar(C.id+":exp",1)}}else{C.src=D;E.style.display="none";if(A){B="False"}else{zhd.setVar(C.id+":exp",0)}}if(A){zhdcore.setUserProp(C.getAttribute("userctr"),C.getAttribute("userkey"),B,null)}return true}return false}function __zhd_enableDragDrop(){var A=zhd.getVar("__zhd_dragDrop").split(";");var E;for(var B=0;B<A.length;B++){E=A[B].split(" ");if(E[0].length>0){var C=zhd.dom.getById(E[0]);var D=zhd.dom.getById(E[1]);if(C!=null&&D!=null){C.setAttribute("moduleid",E[2]);zhd.dom.positioning.enableDragAndDrop(C,D,"__zhd_dragComplete()","__zhd_dragOver()")}}}}var __zhd_oPrevSelPane;var __zhd_oPrevSelModule;var __zhd_dragEventCount=0;function __zhd_dragOver(){__zhd_dragEventCount++;if(__zhd_dragEventCount%75!=0){return}var E=zhd.dom.getById(zhd.dom.positioning.dragCtr.contID);var C=__zhd_getMostSelectedPane(zhd.dom.positioning.dragCtr);if(__zhd_oPrevSelPane!=null){__zhd_oPrevSelPane.pane.style.border=__zhd_oPrevSelPane.origBorder}if(C!=null){__zhd_oPrevSelPane=C;C.pane.style.border="4px double "+ZHD_HIGHLIGHT_COLOR;var A=__zhd_getPaneControlIndex(E,C);var F;var D;for(var B=0;B<C.controls.length;B++){if(A>B&&C.controls[B].id!=E.id){F=C.controls[B]}if(A<=B&&C.controls[B].id!=E.id){D=C.controls[B];break}}if(__zhd_oPrevSelModule!=null){zhd.dom.getNonTextNode(__zhd_oPrevSelModule.control).style.border=__zhd_oPrevSelModule.origBorder}if(D!=null){__zhd_oPrevSelModule=D;zhd.dom.getNonTextNode(D.control).style.borderTop="5px groove "+ZHD_HIGHLIGHT_COLOR}else{if(F!=null){__zhd_oPrevSelModule=F;zhd.dom.getNonTextNode(F.control).style.borderBottom="5px groove "+ZHD_HIGHLIGHT_COLOR}}}}function __zhd_dragComplete(){var E=zhd.dom.getById(zhd.dom.positioning.dragCtr.contID);var F=E.getAttribute("moduleid");if(__zhd_oPrevSelPane!=null){__zhd_oPrevSelPane.pane.style.border=__zhd_oPrevSelPane.origBorder}if(__zhd_oPrevSelModule!=null){zhd.dom.getNonTextNode(__zhd_oPrevSelModule.control).style.border=__zhd_oPrevSelModule.origBorder}var C=__zhd_getMostSelectedPane(zhd.dom.positioning.dragCtr);var A;if(C==null){var D=__zhd_Panes();for(var B=0;B<D.length;B++){if(D[B].id==E.parentNode.id){C=D[B]}}}if(C!=null){A=__zhd_getPaneControlIndex(E,C);__zhd_MoveToPane(C,E,A);zhd.callPostBack("MoveToPane","moduleid="+F,"pane="+C.paneName,"order="+A*2)}}function __zhd_MoveToPane(D,E,A){if(D!=null){var B=new Array();for(var C=A;C<D.controls.length;C++){if(D.controls[C].control.id!=E.id){B[B.length]=D.controls[C].control}zhd.dom.removeChild(D.controls[C].control)}zhd.dom.appendChild(D.pane,E);E.style.top=0;E.style.left=0;E.style.position="relative";for(var C=0;C<B.length;C++){zhd.dom.appendChild(D.pane,B[C])}__zhd_RefreshPanes()}else{E.style.top=0;E.style.left=0;E.style.position="relative"}}function __zhd_RefreshPanes(){var A=zhd.getVar("__zhd_Panes").split(";");var C=zhd.getVar("__zhd_PaneNames").split(";");__zhd_m_aryPanes=new Array();for(var B=0;B<A.length;B++){if(A[B].length>0){__zhd_m_aryPanes[__zhd_m_aryPanes.length]=new __zhd_Pane(zhd.dom.getById(A[B]),C[B])}}}var __zhd_m_aryPanes;var __zhd_m_aryModules;function __zhd_Panes(){if(__zhd_m_aryPanes==null){__zhd_m_aryPanes=new Array();__zhd_RefreshPanes()}return __zhd_m_aryPanes}function __zhd_Modules(A){if(__zhd_m_aryModules==null){__zhd_RefreshPanes()}return __zhd_m_aryModules[A]}function __zhd_getMostSelectedPane(B){var D=new zhd.dom.positioning.dims(B);var C=0;var H;var E;for(var F=0;F<__zhd_Panes().length;F++){var A=__zhd_Panes()[F];var G=new zhd.dom.positioning.dims(A.pane);H=zhd.dom.positioning.elementOverlapScore(G,D);if(H>C){C=H;E=A}}return E}function __zhd_getPaneControlIndex(E,C){if(C==null){return}var B=new zhd.dom.positioning.dims(E);var F;if(C.controls.length==0){return 0}for(var A=0;A<C.controls.length;A++){F=C.controls[A];var D=new zhd.dom.positioning.dims(F.control);if(B.t<D.t){return F.index}}if(F!=null){return F.index+1}else{return 0}}function __zhd_Pane(E,F){this.pane=E;this.id=E.id;this.controls=new Array();this.origBorder=E.style.border;this.paneName=F;var A=0;var D="";for(var B=0;B<E.childNodes.length;B++){var G=E.childNodes[B];if(zhd.dom.isNonTextNode(G)){if(__zhd_m_aryModules==null){__zhd_m_aryModules=new Array()}var C=G.getAttribute("moduleid");if(C!=null&&C.length>0){D+=C+"~";this.controls[this.controls.length]=new __zhd_PaneControl(G,A);__zhd_m_aryModules[C]=G.id;A+=1}}}this.moduleOrder=D}function __zhd_PaneControl(B,A){this.control=B;this.id=B.id;this.index=A;this.origBorder=B.style.border}function __zhdcore(){this.GetUserVal=0;this.SetUserVal=1}__zhdcore.prototype={getUserProp:function(C,B,A){this._doUserCallBack(zhdcore.GetUserVal,C,B,null,new zhdcore.UserPropArgs(C,B,A))},setUserProp:function(D,C,A,B){this._doUserCallBack(zhdcore.SetUserVal,D,C,A,new zhdcore.UserPropArgs(D,C,B))},_doUserCallBack:function(D,F,E,C,A){if(zhd&&zhd.xmlhttp){var B=D+COL_DELIMITER+F+COL_DELIMITER+E+COL_DELIMITER+C;zhd.xmlhttp.doCallBack("__Page",B,zhdcore._callBackSuccess,A,zhdcore._callBackFail,null,true,null,0)}else{alert("Client Personalization not enabled")}},_callBackSuccess:function(A,C,B){if(C.pFunc){C.pFunc(C.namingCtr,C.key,A)}},_callBackFail:function(A,B){window.status=A}};__zhdcore.prototype.UserPropArgs=function(C,B,A){this.namingCtr=C;this.key=B;this.pFunc=A};var zhdcore=new __zhdcore();