var JsonML;if("undefined"===typeof JsonML){JsonML={};}(function(){var B={rowspan:"rowSpan",colspan:"colSpan",cellpadding:"cellPadding",cellspacing:"cellSpacing",tabindex:"tabIndex",accesskey:"accessKey",hidefocus:"hideFocus",usemap:"useMap",maxlength:"maxLength",readonly:"readOnly",contenteditable:"contentEditable"},F={enctype:"encoding",onscroll:"DOMMouseScroll"},A=(function(L){var M={};while(L.length){var N=L.shift();M["on"+N.toLowerCase()]=N;}return M;})("blur,change,click,dblclick,error,focus,keydown,keypress,keyup,load,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,resize,scroll,select,submit,unload".split(","));function H(M,N,L){if("string"===typeof L){L=new Function("event",L);}if("function"!==typeof L){return;}M[N]=L;}function G(M,O){if(O.name&&document.attachEvent){try{var N=document.createElement("<"+M.tagName+" name='"+O.name+"'>");if(M.tagName===N.tagName){M=N;}}catch(P){}}for(var Q in O){if(O.hasOwnProperty(Q)){var L=O[Q];if(Q&&L){Q=B[Q.toLowerCase()]||Q;if(Q==="style"){if("undefined"!==typeof M.style.cssText){M.style.cssText=L;}else{M.style=L;}}else{if(Q==="class"){M.className=L;}else{if(A[Q]){H(M,Q,L);if(F[Q]){H(M,F[Q],L);}}else{if("string"===typeof L||"number"===typeof L||"boolean"===typeof L){M.setAttribute(Q,L);if(F[Q]){M.setAttribute(F[Q],L);}}else{M[Q]=L;if(F[Q]){M[F[Q]]=L;}}}}}}}}return M;}function I(L,O){if(O){if(L.tagName&&L.tagName.toLowerCase()==="table"&&L.tBodies){if(!O.tagName){if(O.nodeType===11){while(O.firstChild){I(L,O.removeChild(O.firstChild));}}return;}var M=O.tagName.toLowerCase();if(M&&M!=="tbody"&&M!=="thead"){var N=L.tBodies.length>0?L.tBodies[L.tBodies.length-1]:null;if(!N){N=document.createElement(M==="th"?"thead":"tbody");L.appendChild(N);}N.appendChild(O);}else{if(L.canHaveChildren!==false){L.appendChild(O);}}}else{if(L.canHaveChildren!==false){L.appendChild(O);}else{if(L.tagName&&L.tagName.toLowerCase()==="object"&&O.tagName&&O.tagName.toLowerCase()==="param"){try{L.appendChild(O);}catch(P){}try{if(L.object){L.object[O.name]=O.value;}}catch(Q){}}}}}}function K(L){return L&&(L.nodeType===3)&&(!L.nodeValue||!/\S/.exec(L.nodeValue));}function C(L){if(L){while(K(L.firstChild)){L.removeChild(L.firstChild);}while(K(L.lastChild)){L.removeChild(L.lastChild);}}}function J(L){var N=document.createElement("div");N.innerHTML=L;C(N);if(N.childNodes.length===1){return N.firstChild;}var M=document.createDocumentFragment?document.createDocumentFragment():document.createElement("");while(N.firstChild){M.appendChild(N.firstChild);}return M;}function D(L){this.value=L;}JsonML.raw=function(L){return new D(L);};function E(N,M,L){return document.createTextNode("["+N+"]");}JsonML.onerror=null;JsonML.parse=function(P,O){try{if(!P){return null;}if("string"===typeof P){return document.createTextNode(P);}if(P instanceof D){return J(P.value);}if(!JsonML.isElement(P)){throw new SyntaxError("invalid JsonML");}var L;var N=P[0];if(!N){var R=document.createDocumentFragment?document.createDocumentFragment():document.createElement("");for(L=1;L<P.length;L++){I(R,JsonML.parse(P[L],O));}C(R);if(R.childNodes.length===1){return R.firstChild;}return R;}var S=(N.toLowerCase()==="style"&&document.createStyleSheet);var M=S?document.createStyleSheet():document.createElement(N);for(L=1;L<P.length;L++){if(P[L] instanceof Array||"string"===typeof P[L]){if(S){M.cssText=P[L];}else{I(M,JsonML.parse(P[L],O));}}else{if(P[L] instanceof D){I(M,J(P[L].value));}else{if("object"===typeof P[L]&&P[L]!==null&&M.nodeType===1){M=G(M,P[L]);}}}}if(S){return null;}C(M);return(M&&"function"===typeof O)?O(M):M;}catch(T){try{var Q=("function"===typeof JsonML.onerror)?JsonML.onerror:E;return Q(T,P,O);}catch(U){return document.createTextNode("["+U+"]");}}};JsonML.isElement=function(L){return(L instanceof Array)&&("string"===typeof L[0]);};JsonML.isFragment=function(L){return(L instanceof Array)&&(L[0]==="");};JsonML.getTagName=function(L){return L[0]||"";};JsonML.isAttributes=function(L){return !!L&&("object"===typeof L)&&!(L instanceof Array);};JsonML.hasAttributes=function(L){if(!JsonML.isElement(L)){throw new SyntaxError("invalid JsonML");}return JsonML.isAttributes(L[1]);};JsonML.getAttributes=function(O,M){if(JsonML.hasAttributes(O)){return O[1];}if(!M){return undefined;}var N=O.shift();var L={};O.unshift(L);O.unshift(N||"");return L;};JsonML.addAttributes=function(P,M){if(!JsonML.isElement(P)||!JsonML.isAttributes(M)){throw new SyntaxError("invalid JsonML");}if(!JsonML.isAttributes(P[1])){var O=P.shift();P.unshift(M);P.unshift(O||"");return;}var N=P[1];for(var L in M){if(M.hasOwnProperty(L)){N[L]=M[L];}}};JsonML.getAttribute=function(L,M){if(!JsonML.hasAttributes(L)){return undefined;}return L[1][M];};JsonML.setAttribute=function(M,N,L){JsonML.getAttributes(M,true)[N]=L;};JsonML.appendChild=function(L,M){if(M instanceof Array&&M[0]===""){M.shift();while(M.length){JsonML.appendChild(L,M.shift(),arguments[2]);}}else{if(M&&"object"===typeof M){if(M instanceof Array){if(!JsonML.isElement(L)||!JsonML.isElement(M)){throw new SyntaxError("invalid JsonML");}if("function"===typeof arguments[2]){arguments[2](L,M);}L.push(M);}else{if(M instanceof D){if(!JsonML.isElement(L)){throw new SyntaxError("invalid JsonML");}L.push(M);}else{JsonML.addAttributes(L,M);}}}else{if("undefined"!==typeof M&&M!==null){if(!(L instanceof Array)){throw new SyntaxError("invalid JsonML");}M=String(M);if(M&&L.length>1&&"string"===typeof L[L.length-1]){L[L.length-1]+=M;}else{if(M||!L.length){L.push(M);}}}}}};JsonML.getChildren=function(L){if(JsonML.hasAttributes(L)){L.slice(2);}L.slice(1);};})();var JsonML;if("undefined"===typeof JsonML){JsonML={};}JsonML.BST=(function(){var F="jbst:visible",A="jbst:oninit",B="jbst:onload";function E(J,M){var L=J[M]||null;if(L){if("function"!==typeof L){try{L=new Function(String(L));}catch(K){L=null;}}if(L){J[M.split(":").join("$")]=L;}delete J[M];}return L;}function G(J){return"["+J+"]";}function D(L,M){M=M.split(":").join("$");var J=L[M];if(J){try{delete L[M];}catch(K){L[M]=undefined;}}return J;}function C(J){var K=D(J,A);if("function"===typeof K){K.call(J);}K=D(J,B);if("function"===typeof K){setTimeout(function(){K.call(J);K=J=null;},0);}if(JsonML.BST.filter){return JsonML.BST.filter(J);}return J;}function I(K,J,O,L,P,M,N){try{K.data=("undefined"!==typeof J)?J:null;K.index=isFinite(O)?Number(O):NaN;K.count=isFinite(L)?Number(L):NaN;K.args=("undefined"!==typeof P)?P:null;return M.apply(K,N||[]);}finally{delete K.count;delete K.index;delete K.data;delete K.args;}}function H(L){if("undefined"===typeof L){throw new Error("JBST tree is undefined");}var K=this,M=JsonML.appendChild;function J(O,a,Z,N,U){try{if(O){var V;if("function"===typeof O){V=I(K,a,Z,N,U,O);if(V instanceof H){return V.dataBind(a,Z,N,U);}return V;}if(O instanceof Array){var d=("function"===typeof JsonML.BST.onbound)&&JsonML.BST.onbound,c=("function"===typeof JsonML.BST.onappend)&&JsonML.BST.onappend,S=c&&function(e,f){I(K,a,Z,N,U,c,[e,f]);};V=[];for(var X=0;X<O.length;X++){var P=J(O[X],a,Z,N,U);M(V,P,S);if(!X&&!V[0]){c=S=null;}}if(V[0]&&d){I(K,a,Z,N,U,d,[V]);}if(JsonML.hasAttributes(V)){var Q=V[1][F];if("undefined"!==typeof Q){if(!Q){return"";}delete V[1][F];}E(V[1],A);E(V[1],B);}return V;}if("object"===typeof O){V={};for(var W in O){if(O.hasOwnProperty(W)){var Y=J(O[W],a,Z,N,U);if("undefined"!==typeof Y&&Y!==null){V[W]=Y;}}}return V;}}return O;}catch(R){try{var T=("function"===typeof JsonML.BST.onerror)?JsonML.BST.onerror:G;return I(K,a,Z,N,U,T,[R]);}catch(b){return"["+b+"]";}}}K.dataBind=function(N,R,P,S){if(N instanceof Array){var Q=[""];P=N.length;for(var O=0;O<P;O++){M(Q,J(L,N[O],O,P,S));}return Q;}else{return J(L,N,R,P,S);}};K.bind=function(O,P,N,R){var Q=K.dataBind(O,P,N,R);return JsonML.parse(Q,C);};K.replace=function(O,N,R,P,S){if("string"===typeof O){O=document.getElementById(O);}if(O&&O.parentNode){var Q=K.bind(N,R,P,S);if(Q){O.parentNode.replaceChild(Q,O);}}};}return function(J){return(J instanceof H)?J:new H(J);};})();JsonML.BST.filter=null;JsonML.BST.onerror=null;JsonML.BST.onappend=null;JsonML.BST.onbound=null;
