﻿var zhd;var ZHD_HIGHLIGHT_COLOR="#9999FF";var COL_DELIMITER=String.fromCharCode(18);var ROW_DELIMITER=String.fromCharCode(17);var QUOTE_REPLACEMENT=String.fromCharCode(19);var KEY_LEFT_ARROW=37;var KEY_UP_ARROW=38;var KEY_RIGHT_ARROW=39;var KEY_DOWN_ARROW=40;var KEY_RETURN=13;var KEY_ESCAPE=27;if(typeof(__zhd_m_aNamespaces)=="undefined"){var __zhd_m_aNamespaces=new Array()}function __zhd(){this.apiversion=0.4;this.pns="";this.ns="zhd";this.diagnostics=null;this.vars=null;this.dependencies=new Array();this.isLoaded=false;this.delay=new Array()}__zhd.prototype={getVars:function(){if(this.vars==null){this.vars=new Array();var H=zhd.dom.getById("__zhdVariable");if(H!=null){if(H.value.indexOf("__scdoff")!=-1){COL_DELIMITER="~|~";ROW_DELIMITER="~`~";QUOTE_REPLACEMENT="~!~"}var G=H.value.split(ROW_DELIMITER);for(var E=0;E<G.length;E++){var F=G[E].split(COL_DELIMITER);if(F.length==2){this.vars[F[0]]=F[1]}}}}return this.vars},getVar:function(sKey){if(this.getVars()[sKey]!=null){var re=eval("/"+QUOTE_REPLACEMENT+"/g");return this.getVars()[sKey].replace(re,'"')}},setVar:function(sKey,sVal){if(this.vars==null){this.getVars()}this.vars[sKey]=sVal;var oCtl=zhd.dom.getById("__zhdVariable");if(oCtl==null){oCtl=zhd.dom.createElement("INPUT");oCtl.type="hidden";oCtl.id="__zhdVariable";zhd.dom.appendChild(zhd.dom.getByTagName("body")[0],oCtl)}var sVals="";var s;var re=eval('/"/g');for(s in this.vars){sVals+=ROW_DELIMITER+s+COL_DELIMITER+this.vars[s].toString().replace(re,QUOTE_REPLACEMENT)}oCtl.value=sVals;return true},callPostBack:function(sAction){var sPostBack=zhd.getVar("__zhd_postBack");var sData="";if(sPostBack.length>0){sData+=sAction;for(var i=1;i<arguments.length;i++){var aryParam=arguments[i].split("=");sData+=COL_DELIMITER+aryParam[0]+COL_DELIMITER+aryParam[1]}eval(sPostBack.replace("[DATA]",sData));return true}return false},createDelegate:function(C,D){return function(){D.apply(C,arguments)}},doDelay:function(H,E,G,F){if(this.delay[H]==null){this.delay[H]=new zhd.delayObject(G,F,H);this.delay[H].num=window.setTimeout(zhd.createDelegate(this.delay[H],this.delay[H].complete),E)}},cancelDelay:function(B){if(this.delay[B]!=null){window.clearTimeout(this.delay[B].num);this.delay[B]=null}},decodeHTML:function(B){return B.toString().replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"')},encode:function(B){if(encodeURIComponent){return encodeURIComponent(B)}else{return escape(B)}},encodeHTML:function(B){return B.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/\"/g,"&quot;")},evalJSON:function(s){return eval("("+s+")")},escapeForEval:function(B){return B.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\r/g,"").replace(/\n/g,"\\n").replace(/\./,"\\.")},extend:function(D,C){for(s in C){D[s]=C[s]}return D},dependenciesLoaded:function(){return true},loadNamespace:function(){if(this.isLoaded==false){if(this.dependenciesLoaded()){zhd=this;this.isLoaded=true;this.loadDependencies(this.pns,this.ns)}}},loadDependencies:function(H,E){for(var F=0;F<__zhd_m_aNamespaces.length;F++){for(var G=0;G<__zhd_m_aNamespaces[F].dependencies.length;G++){if(__zhd_m_aNamespaces[F].dependencies[G]==H+(H.length>0?".":"")+E){__zhd_m_aNamespaces[F].loadNamespace()}}}}};__zhd.prototype.delayObject=function(F,D,E){this.num=null;this.pfunc=F;this.context=D;this.type=E};__zhd.prototype.delayObject.prototype={complete:function(){zhd.delay[this.type]=null;this.pfunc(this.context)}};__zhd.prototype.ScriptRequest=function(F,D,E){this.ctl=null;this.xmlhttp=null;this.src=null;this.text=null;if(F!=null&&F.length>0){this.src=F}if(D!=null&&D.length>0){this.text=D}this.callBack=E;this.status="init";this.timeOut=5000};__zhd.prototype.ScriptRequest.prototype={load:function(){this.status="loading";this.ctl=document.createElement("script");this.ctl.type="text/javascript";if(this.src!=null){if(zhd.dom.browser.isType(zhd.dom.browser.Safari)){this.xmlhttp=new XMLHttpRequest();this.xmlhttp.open("GET",this.src,true);this.xmlhttp.onreadystatechange=zhd.createDelegate(this,this.xmlhttpStatusChange);this.xmlhttp.send(null);return}else{if(zhd.dom.browser.isType(zhd.dom.browser.InternetExplorer)){this.ctl.onreadystatechange=zhd.createDelegate(this,this.statusChange)}else{if(zhd.dom.browser.isType(zhd.dom.browser.Opera)==false){this.ctl.onload=zhd.createDelegate(this,this.complete)}}this.ctl.src=this.src}}else{if(zhd.dom.browser.isType(zhd.dom.browser.Safari)){this.ctl.innerHTML=zhd.encodeHTML(this.text)}else{this.ctl.text=this.text}}var B=zhd.dom.getByTagName("HEAD");if(B){if(zhd.dom.browser.isType(zhd.dom.browser.Opera)==false||this.src!=null){B[0].appendChild(this.ctl)}}else{alert("Cannot load dynamic script, no HEAD tag present.")}if(this.src==null||zhd.dom.browser.isType(zhd.dom.browser.Opera)){this.complete()}else{if(this.timeOut){zhd.doDelay("loadScript_"+this.src,this.timeOut,zhd.createDelegate(this,this.reload),null)}}},xmlhttpStatusChange:function(){if(this.xmlhttp.readyState!=4){return}this.src=null;this.text=this.xmlhttp.responseText;this.load()},statusChange:function(){if((this.ctl.readyState=="loaded"||this.ctl.readyState=="complete")&&this.status!="complete"){this.complete()}},reload:function(){if(zhd.dom.scriptStatus(this.src)=="complete"){this.complete()}else{this.load()}},complete:function(){zhd.cancelDelay("loadScript_"+this.src);this.status="complete";if(typeof(this.callBack)!="undefined"){this.callBack(this)}this.dispose()},dispose:function(){this.callBack=null;if(this.ctl){if(this.ctl.onreadystatechange){this.ctl.onreadystatechange=new function(){}}else{if(this.ctl.onload){this.ctl.onload=null}}this.ctl=null}this.xmlhttp=null}};function zhd_dom(){this.pns="zhd";this.ns="dom";this.dependencies="zhd".split(",");this.isLoaded=false;this.browser=new this.browserObject();this.__leakEvts=new Array();this.scripts=[];this.scriptElements=[]}zhd_dom.prototype={appendChild:function(C,D){if(C.appendChild){return C.appendChild(D)}else{return null}},attachEvent:function(H,G,E){if(zhd.dom.browser.isType(zhd.dom.browser.InternetExplorer)==false){var F=G.substring(2);H.addEventListener(F,function(A){zhd.dom.event=new zhd.dom.eventObject(A,A.target);return E()},false)}else{H.attachEvent(G,function(){zhd.dom.event=new zhd.dom.eventObject(window.event,window.event.srcElement);return E()})}return true},createElement:function(B){if(document.createElement){return document.createElement(B.toLowerCase())}else{return null}},cursorPos:function(L){if(L.value.length==0){return 0}var K=-1;if(L.selectionStart){K=L.selectionStart}else{if(L.createTextRange){var I=window.document.selection.createRange();var N=L.createTextRange();if(N==null||I==null||((I.text!="")&&N.inRange(I)==false)){return -1}if(I.text==""){if(N.boundingLeft==I.boundingLeft){K=0}else{var M=L.tagName.toLowerCase();if(M=="input"){var J=N.text;var P=1;while(P<J.length){N.findText(J.substring(P));if(N.boundingLeft==I.boundingLeft){break}P++}}else{if(M=="textarea"){var P=L.value.length+1;var O=document.selection.createRange().duplicate();while(O.parentElement()==L&&O.move("character",1)==1){--P}if(P==L.value.length+1){P=-1}}}K=P}}else{K=N.text.indexOf(I.text)}}}return K},cancelCollapseElement:function(B){zhd.cancelDelay(B.id+"col");B.style.display="none"},collapseElement:function(H,E,F){if(E==null){E=10}H.style.overflow="hidden";var G=new Object();G.num=E;G.ctl=H;G.pfunc=F;H.origHeight=H.offsetHeight;zhd.dom.__collapseElement(G)},__collapseElement:function(G){var E=G.num;var H=G.ctl;var F=H.origHeight/E;if(H.offsetHeight-(F*2)>0){H.style.height=(H.offsetHeight-F).toString()+"px";zhd.doDelay(H.id+"col",10,zhd.dom.__collapseElement,G)}else{H.style.display="none";if(G.pfunc!=null){G.pfunc()}}},cancelExpandElement:function(B){zhd.cancelDelay(B.id+"exp");B.style.overflow="";B.style.height=""},expandElement:function(H,E,F){if(E==null){E=10}if(H.style.display=="none"&&H.origHeight==null){H.style.display="";H.style.overflow="";H.origHeight=H.offsetHeight;H.style.overflow="hidden";H.style.height="1px"}H.style.display="";var G=new Object();G.num=E;G.ctl=H;G.pfunc=F;zhd.dom.__expandElement(G)},__expandElement:function(G){var E=G.num;var H=G.ctl;var F=H.origHeight/E;if(H.offsetHeight+F<H.origHeight){H.style.height=(H.offsetHeight+F).toString()+"px";zhd.doDelay(H.id+"exp",10,zhd.dom.__expandElement,G)}else{H.style.overflow="";H.style.height="";if(G.pfunc!=null){G.pfunc()}}},deleteCookie:function(F,D,E){if(this.getCookie(F)){this.setCookie(F,"",-1,D,E);return true}return false},getAttr:function(F,E,H){if(F.getAttribute==null){return H}var G=F.getAttribute(E);if(G==null||G==""){return H}else{return G}},getById:function(C,D){if(D==null){D=document}if(D.getElementById){return D.getElementById(C)}else{if(D.all){return D.all(C)}else{return null}}},getByTagName:function(C,D){if(D==null){D=document}if(D.getElementsByTagName){return D.getElementsByTagName(C)}else{if(D.all&&D.all.tags){return D.all.tags(C)}else{return null}}},getParentByTagName:function(F,D){var E=F.parentNode;D=D.toLowerCase();while(E!=null){if(E.tagName&&E.tagName.toLowerCase()==D){return E}E=E.parentNode}return null},getCookie:function(J){var K=" "+document.cookie;var G=" "+J+"=";var H=null;var L=0;var I=0;if(K.length>0){L=K.indexOf(G);if(L!=-1){L+=G.length;I=K.indexOf(";",L);if(I==-1){I=K.length}H=unescape(K.substring(L,I))}}return(H)},getNonTextNode:function(B){if(this.isNonTextNode(B)){return B}while(B!=null&&this.isNonTextNode(B)){B=this.getSibling(B,1)}return B},__leakEvt:function(E,F,D){this.name=E;this.ctl=F;this.ptr=D},addSafeHandler:function(F,E,G,H){F[E]=this.getObjMethRef(G,H);if(zhd.dom.browser.isType(zhd.dom.browser.InternetExplorer)){if(this.__leakEvts.length==0){zhd.dom.attachEvent(window,"onunload",zhd.dom.destroyHandlers)}this.__leakEvts[this.__leakEvts.length]=new zhd.dom.__leakEvt(E,F,F[E])}},destroyHandlers:function(){var F=zhd.dom.__leakEvts.length-1;for(var E=F;E>=0;E--){var D=zhd.dom.__leakEvts[E];D.ctl.detachEvent(D.name,D.ptr);D.ctl[D.name]=null;zhd.dom.__leakEvts.length=zhd.dom.__leakEvts.length-1}},getObjMethRef:function(D,C){return(function(A){A=A||window.event;return D[C](A,this)})},getScript:function(F){if(this.scriptElements[F]){return this.scriptElements[F]}var E=zhd.dom.getByTagName("SCRIPT");for(var D=0;D<E.length;D++){if(E[D].src!=null&&E[D].src.indexOf(F)>-1){this.scriptElements[F]=E[D];return E[D]}}},getScriptPath:function(){return"js/"},getSibling:function(F,D){if(F!=null&&F.parentNode!=null){for(var E=0;E<F.parentNode.childNodes.length;E++){if(F.parentNode.childNodes[E].id==F.id){if(F.parentNode.childNodes[E+D]!=null){return F.parentNode.childNodes[E+D]}}}}return null},isNonTextNode:function(B){return(B.nodeType!=3&&B.nodeType!=8)},scriptFile:function(D){var C=D.split("/");return C[C.length-1]},loadScript:function(I,G,F){var H;if(I!=null&&I.length>0){H=this.scriptFile(I);if(this.scripts[H]!=null){return}}var J=new zhd.ScriptRequest(I,G,F);if(H){this.scripts[H]=J}J.load();return J},loadScripts:function(J,H,F){if(zhd.scripts==null){var G=function(B,A,C){return(function(){zhd.dom.loadScripts(B,A,C)})};zhd.dom.loadScript(zhd.dom.getScriptPath()+"zhd.scripts.js",null,G(J,H,F));return}var I=new zhd.scripts.ScriptBatchRequest(J,H,F);I.load()},scriptStatus:function(F){var D=this.scriptFile(F);if(this.scripts[D]){return this.scripts[D].status}var E=this.getScript(F);if(E!=null){return"complete"}else{return""}},setScriptLoaded:function(D){var C=this.scriptFile(D);if(this.scripts[C]&&zhd.dom.scripts[C].status!="complete"){zhd.dom.scripts[C].complete()}},navigate:function(D,C){if(C!=null&&C.length>0){if(C=="_blank"){window.open(D)}else{document.frames[C].location.href=D}}else{window.location.href=D}return false},removeChild:function(B){if(B.parentNode.removeChild){return B.parentNode.removeChild(B)}else{return null}},setCookie:function(N,I,K,J,L,M){var H;if(K){H=new Date();H.setTime(H.getTime()+(K*24*60*60*1000))}document.cookie=N+"="+escape(I)+((H)?"; expires="+H.toGMTString():"")+((J)?"; path="+J:"")+((L)?"; domain="+L:"")+((M)?"; secure":"");if(document.cookie.length>0){return true}},getCurrentStyle:function(C,D){if(document.defaultView){if(C.nodeType!=C.ELEMENT_NODE){return null}return document.defaultView.getComputedStyle(C,"").getPropertyValue(D.split("-").join(""))}if(C.currentStyle){return C.currentStyle[D.split("-").join("")]}if(C.style){return C.style.getAttribute(D.split("-").join(""))}return null},dependenciesLoaded:function(){return(typeof(zhd)!="undefined")},loadNamespace:function(){if(this.isLoaded==false){if(this.dependenciesLoaded()){zhd.dom=this;this.isLoaded=true;zhd.loadDependencies(this.pns,this.ns)}}},getFormPostString:function(F){var E="";if(F!=null){if(F.tagName&&F.tagName.toLowerCase()=="form"){for(var D=0;D<F.elements.length;D++){E+=this.getElementPostString(F.elements[D])}}else{E=this.getElementPostString(F);for(var D=0;D<F.childNodes.length;D++){E+=this.getFormPostString(F.childNodes[D])}}}return E},getElementPostString:function(H){var E;if(H.tagName){E=H.tagName.toLowerCase()}if(E=="input"){var G=H.type.toLowerCase();if(G=="text"||G=="password"||G=="hidden"||((G=="checkbox"||G=="radio")&&H.checked)){return H.name+"="+zhd.encode(H.value)+"&"}}else{if(E=="select"){for(var F=0;F<H.options.length;F++){if(H.options[F].selected){return H.name+"="+zhd.encode(H.options[F].value)+"&"}}}else{if(E=="textarea"){return H.name+"="+zhd.encode(H.value)+"&"}}}return""}};zhd_dom.prototype.eventObject=function(D,C){this.object=D;this.srcElement=C};zhd_dom.prototype.browserObject=function(){this.InternetExplorer="ie";this.Netscape="ns";this.Mozilla="mo";this.Opera="op";this.Safari="safari";this.Konqueror="kq";this.MacIE="macie";var G;var H=navigator.userAgent.toLowerCase();if(H.indexOf("konqueror")!=-1){G=this.Konqueror}else{if(H.indexOf("opera")!=-1){G=this.Opera}else{if(H.indexOf("netscape")!=-1){G=this.Netscape}else{if(H.indexOf("msie")!=-1){if(H.indexOf("mac")!=-1){G=this.MacIE}else{G=this.InternetExplorer}}else{if(H.indexOf("safari")!=-1){G="safari"}}}}}if(G==null){G=this.Mozilla}this.type=G;this.version=parseFloat(navigator.appVersion);var E=navigator.userAgent.toLowerCase();if(this.type==this.InternetExplorer){var F=navigator.appVersion.split("MSIE");this.version=parseFloat(F[1])}if(this.type==this.Netscape){var F=E.split("netscape");this.version=parseFloat(F[1].split("/")[1])}};zhd_dom.prototype.browserObject.prototype={toString:function(){return this.type+" "+this.version},isType:function(){for(var B=0;B<arguments.length;B++){if(zhd.dom.browser.type==arguments[B]){return true}}return false}};function zhd_controls(){this.pns="zhd";this.ns="controls";this.dependencies="zhd,zhd.dom".split(",");this.isLoaded=false;this.controls=new Array();this.toolbars=[];this.orient=new Object();this.orient.horizontal=0;this.orient.vertical=1;this.action=new Object();this.action.postback=0;this.action.expand=1;this.action.none=2;this.action.nav=3}zhd_controls.prototype={dependenciesLoaded:function(){return(typeof(zhd)!="undefined"&&typeof(zhd.dom)!="undefined")},loadNamespace:function(){if(this.isLoaded==false){if(this.dependenciesLoaded()){if(typeof(zhd_control)!="undefined"){zhd.extend(zhd_controls.prototype,new zhd_control)}zhd.controls=new zhd_controls();this.isLoaded=true;zhd.loadDependencies(this.pns,this.ns)}}}};zhd_controls.prototype.ZHDNode=function(B){if(B!=null){this.node=B;this.id=B.getAttribute("id","");this.key=B.getAttribute("key","");this.text=B.getAttribute("txt","");this.url=B.getAttribute("url","");this.js=B.getAttribute("js","");this.target=B.getAttribute("tar","");this.toolTip=B.getAttribute("tTip","");this.enabled=B.getAttribute("enabled","1")!="0";this.css=B.getAttribute("css","");this.cssSel=B.getAttribute("cssSel","");this.cssHover=B.getAttribute("cssHover","");this.cssIcon=B.getAttribute("cssIcon","");this.hasNodes=B.childNodeCount()>0;this.hasPendingNodes=(B.getAttribute("hasNodes","0")=="1"&&this.hasNodes==false);this.imageIndex=new Number(B.getAttribute("imgIdx","-1"));this.image=B.getAttribute("img","");this.level=this.getNodeLevel()}};zhd_controls.prototype.ZHDNode.prototype={childNodeCount:function(){return this.node.childNodes.length},getNodeLevel:function(){var D=0;var C=this.node;while(C!=null){C=C.parentNode();if(C==null||C.nodeName()=="root"){break}D++}return D},update:function(C){if(C!=null){var D=typeof(this[C]);if(D=="string"||D=="number"||this[C]==null){this.node.setAttribute(C,this[C])}else{if(D=="boolean"){this.node.setAttribute(C,new Number(this[C]))}}}else{for(C in this){this.update(C)}}}};function zhd_util(){this.pns="zhd";this.ns="utilities";this.dependencies="zhd,zhd.dom".split(",");this.isLoaded=false}zhd_util.prototype.dependenciesLoaded=function(){return(typeof(zhd)!="undefined"&&typeof(zhd.dom)!="undefined")};zhd_util.prototype.loadNamespace=function(){if(this.isLoaded==false){if(this.dependenciesLoaded()){if(typeof(zhd_utility)!="undefined"){zhd.extend(zhd_util.prototype,new zhd_utility)}zhd.util=new zhd_util();this.isLoaded=true;zhd.loadDependencies(this.pns,this.ns)}}};function $(){var F=new Array();for(var H=0;H<arguments.length;H++){var E=arguments[H];var G;if(typeof E=="string"){G=zhd.dom.getById(E)}else{G=E}if(G!=null&&typeof(Element)!="undefined"&&typeof(Element.extend)!="undefined"){Element.extend(G)}if(arguments.length==1){return G}F[F.length]=G}return F}__zhd_m_aNamespaces[__zhd_m_aNamespaces.length]=new zhd_util();__zhd_m_aNamespaces[__zhd_m_aNamespaces.length]=new zhd_controls();__zhd_m_aNamespaces[__zhd_m_aNamespaces.length]=new zhd_dom();__zhd_m_aNamespaces[__zhd_m_aNamespaces.length]=new __zhd();for(var i=__zhd_m_aNamespaces.length-1;i>=0;i--){__zhd_m_aNamespaces[i].loadNamespace()};
