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