var jpf={VERSION:"2.0.",CDN:"",READY:false,NODE_HIDDEN:101,NODE_VISIBLE:102,NODE_O3:103,NODE_ELEMENT:1,NODE_ATTRIBUTE:2,NODE_TEXT:3,NODE_CDATA_SECTION:4,NODE_ENTITY_REFERENCE:5,NODE_ENTITY:6,NODE_PROCESSING_INSTRUCTION:7,NODE_COMMENT:8,NODE_DOCUMENT:9,NODE_DOCUMENT_TYPE:10,NODE_DOCUMENT_FRAGMENT:11,NODE_NOTATION:12,KEYBOARD:2,KEYBOARD_MOUSE:true,SUCCESS:1,TIMEOUT:2,ERROR:3,OFFLINE:4,debug:false,includeStack:[],initialized:false,autoLoadSkin:false,crypto:{},_GET:{},basePath:"./",ns:{jpf:"http://www.javeline.com/2005/jml",jml:"http://www.javeline.com/2005/jml",xsd:"http://www.w3.org/2001/XMLSchema",xhtml:"http://www.w3.org/1999/xhtml",xslt:"http://www.w3.org/1999/XSL/Transform",xforms:"http://www.w3.org/2002/xforms",ev:"http://www.w3.org/2001/xml-events"},browserDetect:function(){if(this.$bdetect){return;}this.$bdetect=true;var h=navigator.userAgent.toLowerCase();this.isOpera=h.indexOf("opera")!=-1;this.isKonqueror=h.indexOf("konqueror")!=-1;this.isSafari=!this.isOpera&&((navigator.vendor&&navigator.vendor.match(/Apple/)?true:false)||h.indexOf("safari")!=-1||this.isKonqueror);this.isSafariOld=false;if(this.isSafari){var c=h.match(/applewebkit\/(\d+)/);if(c){this.safariRev=parseInt(c[1]);this.isSafariOld=parseInt(c[1])<420;}}this.isIphone=h.indexOf("iphone")!=-1||h.indexOf("aspen simulator")!=-1;this.isChrome=h.indexOf("chrome/")!=-1;this.isGecko=!this.isOpera&&!this.isSafari&&h.indexOf("gecko")!=-1;this.isGecko3=this.isGecko&&h.indexOf("firefox/3")!=-1;var a;this.isIE=document.all&&!this.isOpera&&!this.isSafari?true:false;this.isIE8=this.isIE&&h.indexOf("msie 8.")!=-1&&(a=true);if(this.isIE8&&document.documentMode==7){jpf.isIE7=true;jpf.isIE8=false;}this.isIE7=this.isIE&&!a&&h.indexOf("msie 7.")!=-1&&(a=true);this.isIE6=this.isIE&&!a&&h.indexOf("msie 6.")!=-1&&(a=true);this.isIE55=this.isIE&&!a&&h.indexOf("msie 5.5")!=-1&&(a=true);this.isIE50=this.isIE&&!a&&h.indexOf("msie 5.0")!=-1&&(a=true);this.isWin=h.indexOf("win")!=-1||h.indexOf("16bit")!=-1;this.isMac=h.indexOf("mac")!=-1;this.isAIR=h.indexOf("adobeair")!=-1;},setCompatFlags:function(){this.TAGNAME=jpf.isIE?"baseName":"localName";this.supportVML=jpf.isIE;this.supportCanvas=!jpf.isIE;this.supportSVG=!jpf.isIE;this.styleSheetRules=jpf.isIE?"rules":"cssRules";this.brokenHttpAbort=jpf.isIE6;this.canUseHtmlAsXml=jpf.isIE;this.supportNamespaces=!jpf.isIE;this.cannotSizeIframe=jpf.isIE;this.supportOverflowComponent=jpf.isIE;this.hasEventSrcElement=jpf.isIE;this.canHaveHtmlOverSelects=!jpf.isIE6&&!jpf.isIE5;this.hasInnerText=jpf.isIE;this.hasMsRangeObject=jpf.isIE;this.hasContentEditable=jpf.isIE||jpf.isOpera;this.descPropJs=jpf.isIE;this.hasClickFastBug=jpf.isIE;this.hasExecScript=window.execScript?true:false;this.canDisableKeyCodes=jpf.isIE;this.hasTextNodeWhiteSpaceBug=jpf.isIE;this.hasCssUpdateScrollbarBug=jpf.isIE;this.canUseInnerHtmlWithTables=!jpf.isIE;this.hasSingleResizeEvent=!jpf.isIE;this.hasStyleFilters=jpf.isIE;this.supportOpacity=!jpf.isIE;this.supportPng24=!jpf.isIE6&&!jpf.isIE5;this.cantParseXmlDefinition=jpf.isIE50;this.hasDynamicItemList=!jpf.isIE||jpf.isIE7;this.canImportNode=jpf.isIE;this.hasSingleRszEvent=!jpf.isIE;this.hasXPathHtmlSupport=!jpf.isIE;this.hasFocusBug=jpf.isIE;this.hasReadyStateBug=jpf.isIE50;this.dateSeparator=jpf.isIE?"-":"/";this.canCreateStyleNode=!jpf.isIE;this.supportFixedPosition=!jpf.isIE||jpf.isIE7;this.hasHtmlIdsInJs=jpf.isIE||jpf.isSafari;this.needsCssPx=!jpf.isIE;this.hasCSSChildOfSelector=!jpf.isIE||jpf.isIE8;this.hasAutocompleteXulBug=jpf.isGecko;this.mouseEventBuffer=jpf.isIE?20:6;this.hasComputedStyle=typeof document.defaultView!="undefined"&&typeof document.defaultView.getComputedStyle!="undefined";this.supportCSSAnim=jpf.isSafari&&(jpf.safariRev>525);this.locale=(jpf.isIE?navigator.userLanguage:navigator.language).toLowerCase();this.maxHttpRetries=jpf.isOpera?0:3;this.dynPropMatch=new RegExp();this.dynPropMatch.compile("^[{\\[].*[}\\]]$");this.percentageMatch=new RegExp();this.percentageMatch.compile("([\\-\\d\\.]+)\\%","g");if(jpf.isOpera){window.console={};["log","debug","info","warn","error"].forEach(function(a){window.console[a]=function(){if(typeof arguments==="undefined"){return null;}if(arguments.length===1){opera.postError(a+": "+arguments[0]);return a+": "+arguments[0];}var n=arguments[0],q=/%([sdifo])/g,m=0,h=null;while(h=q.exec(n)){n=n.replace(h[0],String(arguments[++m]));}var c=arguments.length;while(c>m++){if(arguments[m]){n+=" ";n+=String(arguments[m]);}}opera.postError(a+": "+n);};});}},extend:function(c,m){var n,h,a=!c.notNull;if(arguments.length==2){for(n in m){if(a||m[n]){c[n]=m[n];}}return c;}for(h=1;h<arguments.length;h++){m=arguments[h];for(n in m){if(a||m[n]){c[n]=m[n];}}}return c;},start:function(){this.started=true;var w=location.href.split("#")[0].split("?")[0];this.host=location.hostname&&w.replace(/(\/\/[^\/]*)\/.*$/,"$1");this.hostPath=w.replace(/\/[^\/]*$/,"")+"/";this.browserDetect();this.setCompatFlags();if(this.isIE){jpf.runIE();}if(this.isSafari){jpf.runSafari();}if(this.isOpera){jpf.runOpera();}if(this.isGecko||!this.isIE&&!this.isSafari&&!this.isOpera){jpf.runGecko();}for(var y,A,s,q,h,B,c=location.href.split(/[?&]/),t=c.length,u=1;u<t;u++){if(s=c[u].match(/(.*?)(\..*?|\[.*?\])?=([^#]*)/)){q=decodeURI(s[1]).toLowerCase(),h=this._GET;if(s[2]){for(A=decodeURI(s[2]).replace(/\[\s*\]/g,"[-1]").split(/[\.\[\]]/),y=0;y<A.length;y++){B=A[y],h=h[q]?h[q]:h[q]=(parseInt(B)==B)?[]:{},q=B.replace(/^["\'](.*)["\']$/,"$1");}}q!="-1"?h[q]=decodeURI(s[3]):h[h.length]=decodeURI(s[3]);}}this.oHttp=new this.http();this.Init.addConditional(this.loadIncludes,jpf,["body","xmldb"]);try{if(jpf.isIE){document.execCommand("BackgroundImageCache",false,true);}}catch(z){}this.root=true;},startDependencies:function(){if(location.protocol!="file:"){jpf.console.warn("You are serving multiple files from a (local)webserver - please consider using the file:// protocol to load your files, because that will make your application load several times faster.On a webserver, we recommend using a release or debug build of Javeline Platform.");}jpf.console.info("Loading Dependencies...");var a;for(a=0;a<this.KernelModules.length;a++){jpf.include("core/"+this.KernelModules[a],true);}for(a=0;a<this.TelePortModules.length;a++){jpf.include("elements/teleport/"+this.TelePortModules[a],true);}for(a=0;a<this.Elements.length;a++){var h=this.Elements[a];jpf.include("elements/"+h+".js",true);}jpf.Init.interval=setInterval("if (jpf.checkLoadedDeps()) {clearInterval(jpf.Init.interval);jpf.start();}",100);},nsqueue:{},namespace:function(name,oNamespace){try{eval("jpf."+name+" = oNamespace");delete this.nsqueue[name];for(var ns in this.nsqueue){if(ns.indexOf(name)>-1){this.namespace(ns,this.nsqueue[ns]);}}return true;}catch(e){this.nsqueue[name]=oNamespace;return false;}},findPrefix:function(c,m){var h;if(c.nodeType==9){if(!c.documentElement){return false;}if(c.documentElement.namespaceURI==m){return c.prefix||c.scopeName;}h=c.documentElement;}else{if(c.namespaceURI==m){return c.prefix||c.scopeName;}h=c.ownerDocument.documentElement;if(h&&h.namespaceURI==m){return c.prefix||c.scopeName;}while(c.parentNode){c=c.parentNode;if(c.namespaceURI==m){return c.prefix||c.scopeName;}}}if(h){for(var a=0;a<h.attributes.length;a++){if(h.attributes[a].nodeValue==m){return h.attributes[a][jpf.TAGNAME];}}}return false;},importClass:function(c,a,m){if(!c){throw new Error(jpf.formatErrorString(1018,null,"importing class","Could not load reference. Reference is null"));}if(!a){return jpf.exec(c.toString(),m);}var h=c.toString().replace(/^\s*function\s*\w*\s*\([^\)]*\)\s*\{/,"");h=h.replace(/\}\s*$/,"");return jpf.exec(h,m);},toString:function(){return"[Javeline (jpf)]";},all:[],implement:function(a){for(var c=0;c<arguments.length;c++){arguments[c].call(this);}return this;},makeClass:function(a){if(a.implement){return;}a.implement=this.implement;a.implement(jpf.Class);a.uniqueId=this.all.push(a)-1;},uniqueHtmlIds:0,setUniqueHtmlId:function(a){a.setAttribute("id","q"+this.uniqueHtmlIds++);},getUniqueId:function(a){return this.uniqueHtmlIds++;},register:function(h,c,a){h.tagName=c;h.nodeFunc=a||jpf.NODE_HIDDEN;h.$domHandlers={remove:[],insert:[],reparent:[],removechild:[]};h.$propHandlers={};if(a!=jpf.NODE_HIDDEN){h.$booleanProperties={visible:true,focussable:true,"disable-keyboard":true};h.$supportedProperties=["draggable","resizable","focussable","zindex","disabled","tabindex","disable-keyboard","contextmenu","visible","autosize","loadjml","actiontracker","alias"];}else{h.$booleanProperties={};h.$supportedProperties=[];}if(!h.implement){h.implement=this.implement;h.implement(jpf.Class);h.uniqueId=this.all.push(h)-1;}},lookup:function(a){return this.all[a];},findHost:function(a){while(a&&!a.host&&a.parentNode){a=a.parentNode;}return(a&&a.host&&typeof a.host!="string")?a.host:false;},setReference:function(a,c){return self[a]&&self[a].hasFeature?0:(self[a]=c);},console:{debug:function(h,a,c){},time:function(h,a,c){},log:function(h,a,c){},info:function(h,a,c){},warn:function(h,a,c){},error:function(h,a,c){},dir:function(a){this.info(jpf.vardump(a,null,false).replace(/ /g,"&nbsp;").replace(/</g,"&lt;"));}},formatErrorString:function(m,q,n,h,c,s,a){jpf.lastErrorMessage=h;return h;},include:function(m,a,q){jpf.console.info("including js file: "+m);var c=a?(jpf.basePath||"")+m:m;if(jpf.isSafariOld||jpf.isSafari&&!jpf.started){document.write('<script type="text/javascript" src="'+c+'"><\/script>');}else{var n=document.getElementsByTagName("head")[0];var h=document.createElement("script");h.defer=true;if(q){h.setAttribute("_jpf_type",q);}h.src=c;n.appendChild(h);}},Init:{queue:[],cond:{combined:[]},done:{},add:function(a,c){if(this.inited){a.call(c);}else{if(a){this.queue.push([a,c]);}}},addConditional:function(c,h,a){if(typeof a!="string"){if(this.checkCombined(a)){return c.call(h);}this.cond.combined.push([c,h,a]);}else{if(self[a]){c.call(h);}else{if(!this.cond[a]){this.cond[a]=[];}this.cond[a].push([c,h]);this.checkAllCombined();}}},checkAllCombined:function(){for(var a=0;a<this.cond.combined.length;a++){if(!this.cond.combined[a]){continue;}if(this.checkCombined(this.cond.combined[a][2])){this.cond.combined[a][0].call(this.cond.combined[a][1]);this.cond.combined[a]=null;}}},checkCombined:function(a){for(var c=0;c<a.length;c++){if(!this.done[a[c]]){return false;}}return true;},run:function(a){this.inited=this.done[a]=true;this.checkAllCombined();var h=a?this.cond[a]:this.queue;if(!h){return;}for(var c=0;c<h.length;c++){h[c][0].call(h[c][1]);}}},getJmlDocFromString:function(m){var n=m.replace(/\<\!DOCTYPE[^>]*>/,"").replace(/&nbsp;/g," ").replace(/^[\r\n\s]*/,"").replace(/<\s*\/?\s*(?:\w+:\s*)[\w-]*[\s>\/]/g,function(q){return q.toLowerCase();});if(!this.supportNamespaces){n=n.replace(/xmlns\=\"[^"]*\"/g,"");}var h=jpf.getXmlDom(n,null,jpf.debug);var a=h.selectNodes("//@*[not(contains(local-name(), '.')) and not(translate(local-name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = local-name())]");for(var c=0;c<a.length;c++){(a[c].ownerElement||a[c].selectSingleNode("..")).setAttribute(a[c].nodeName.toLowerCase(),a[c].nodeValue);}return h;},parseStrategy:0,loadIncludes:function(h){var t=false;if(t&&document.documentElement.outerHTML.split(">",1)[0].indexOf(jpf.ns.jml)==-1){return false;}if(this.parseStrategy==21||!this.parseStrategy&&!h){return jpf.oHttp.get((document.body.getAttribute("xmlurl")||location.href).split(/#/)[0],function(B,A,q){if(A!=jpf.SUCCESS){var C=new Error(jpf.formatErrorString(0,null,"Loading XML application data","Could not load XML from remote source: "+q.message));if(q.tpModule.retryTimeout(q,A,null,C)===true){return true;}throw C;}var z=jpf.getJmlDocFromString(B);if(jpf.isIE){document.body.innerHTML="";}else{var w=document.body.childNodes;for(var y=w.length-1;y>=0;y--){w[y].parentNode.removeChild(w[y]);}}return jpf.loadIncludes(z);},{ignoreOffline:true});}var n=jpf.findPrefix(h,jpf.ns.jml);if(jpf.isSafariOld||true){n="j";}jpf.AppData=jpf.supportNamespaces?h.createElementNS(jpf.ns.jml,n+":application"):h.createElement(n+":application");var m,c;var u=$xmlns(h,"head",jpf.ns.xhtml)[0];if(u){c=u.childNodes;for(m=c.length-1;m>=0;m--){if(c[m].namespaceURI&&c[m].namespaceURI!=jpf.ns.xhtml){jpf.AppData.insertBefore(c[m],jpf.AppData.firstChild);}}}var s=(h.body?h.body:$xmlns(h,"body",jpf.ns.xhtml)[0]);for(m=0;m<s.attributes.length;m++){jpf.AppData.setAttribute(s.attributes[m].nodeName,s.attributes[m].nodeValue);}c=s.childNodes;for(m=c.length-1;m>=0;m--){jpf.AppData.insertBefore(c[m],jpf.AppData.firstChild);}h.documentElement.appendChild(jpf.AppData);jpf.loadJmlIncludes(jpf.AppData);if($xmlns(jpf.AppData,"loader",jpf.ns.jml).length){jpf.loadScreen={show:function(){this.oExt.style.display="block";},hide:function(){this.oExt.style.display="none";}};if(jpf.isGecko||jpf.isSafari){document.body.innerHTML="";}if(jpf.isSafariOld){var a=jpf.getFirstElement($xmlns(jpf.AppData,"loader",jpf.ns.jml)[0]).serialize();document.body.insertAdjacentHTML("beforeend",a);jpf.loadScreen.oExt=document.body.lastChild;}else{var v=jpf.getFirstElement($xmlns(jpf.AppData,"loader",jpf.ns.jml)[0]);if(v.ownerDocument==document){jpf.loadScreen.oExt=document.body.appendChild(v.cloneNode(true));}else{document.body.insertAdjacentHTML("beforeend",v.xml||v.serialize());jpf.loadScreen.oExt=document.body.lastChild;}}}document.body.style.display="block";if(!self.ERROR_HAS_OCCURRED){jpf.Init.interval=setInterval(function(){if(jpf.checkLoaded()){jpf.initialize();}},20);}},checkForJmlNamespace:function(h){if(!h.ownerDocument.documentElement){return false;}var a=h.ownerDocument.documentElement.attributes;for(var m=false,c=0;c<a.length;c++){if(a[c].nodeValue==jpf.ns.jml){m=true;break;}}return m;},loadJmlIncludes:function(h,q){var c,a,m;var n=jpf.getDirname(h.getAttribute("filename"))||jpf.hostPath;a=$xmlns(h,"include",jpf.ns.jml);if(a.length){h.setAttribute("loading","loading");for(c=a.length-1;c>=0;c--){m=jpf.getAbsolutePath(n,a[c].getAttribute("src"));jpf.loadJmlInclude(a[c],q,m);}}else{h.setAttribute("loading","done");}a=$xmlns(h,"skin",jpf.ns.jml);for(c=0;c<a.length;c++){if(!a[c].getAttribute("src")&&!a[c].getAttribute("name")||a[c].childNodes.length){continue;}m=a[c].getAttribute("src")?jpf.getAbsolutePath(n,a[c].getAttribute("src")):jpf.getAbsolutePath(n,a[c].getAttribute("name"))+"/index.xml";jpf.loadJmlInclude(a[c],q,m,true);a[c].setAttribute("j_preparsed","9999");}if(!a.length&&!jpf.skins.skins["default"]&&jpf.autoLoadSkin){jpf.console.warn("No skin file found, attempting to autoload the default skin file: skins.xml");jpf.loadJmlInclude(null,q,"skins.xml",true);}return true;},loadJmlInclude:function(a,m,c,h){this.oHttp.get(c||jpf.getAbsolutePath(jpf.hostPath,a.getAttribute("src")),function(v,u,n){if(u!=jpf.SUCCESS){var w=new Error(jpf.formatErrorString(1007,null,"Loading Includes","Could not load Include file '"+(c||n.userdata[0].getAttribute("src"))+"'\nReason: "+n.message,a));if(n.tpModule.retryTimeout(n,u,null,w)===true){return true;}if(!a){jpf.console.warn("Could not autload skin.");jpf.includeStack[n.userdata[1]]=true;return;}throw w;}var t,q;if(!h){t=jpf.getJmlDocFromString(v).documentElement;var s=t[jpf.TAGNAME];if(s=="skin"){h=true;}else{if(s=="teleport"){q=true;}else{if(s!="application"){throw new Error(jpf.formatErrorString(0,null,"Loading Includes","Could not find handler to parse include file for '"+t[jpf.TAGNAME]+"' expected 'skin' or 'application'",a));}}}}if(h){if(v.indexOf('xmlns="http://www.w3.org/1999/xhtml"')>-1){v=v.replace('xmlns="http://www.w3.org/1999/xhtml"',"");}t=jpf.getJmlDocFromString(v).documentElement;jpf.skins.Init(t,a,c);jpf.includeStack[n.userdata[1]]=true;if(jpf.isOpera&&n.userdata[0]&&n.userdata[0].parentNode){n.userdata[0].parentNode.removeChild(n.userdata[0]);}}else{if(q){jpf.teleport.loadJml(t);jpf.includeStack[n.userdata[1]]=true;}else{jpf.includeStack[n.userdata[1]]=t;n.userdata[0].setAttribute("iid",n.userdata[1]);}}t.setAttribute("filename",n.url);jpf.loadJmlIncludes(t);},{async:!m,userdata:[a,jpf.includeStack.push(false)-1],ignoreOffline:true});},checkLoaded:function(){for(var a=0;a<jpf.includeStack.length;a++){if(!jpf.includeStack[a]){jpf.console.info("Waiting for: ["+a+"] "+jpf.includeStack[a]);return false;}}if(!document.body){return false;}jpf.console.info("Dependencies loaded");return true;},initialize:function(){jpf.console.info("Initializing...");clearInterval(jpf.Init.interval);jpf.Init.run();if(jpf.JmlParser&&jpf.AppData){jpf.JmlParser.parse(jpf.AppData);}if(jpf.loadScreen&&jpf.appsettings.autoHideLoading){jpf.loadScreen.hide();}},load_events:[],load_timer:null,load_done:false,load_init:null,addDomLoadEvent:function(n){if(!this.$bdetect){this.browserDetect();}if(jpf.load_done){return n();}if(!jpf.load_init){jpf.load_init=function(){if(jpf.load_done){return;}clearInterval(jpf.load_timer);jpf.load_timer=null;jpf.load_done=true;var q=jpf.load_events.length;while(q--){(jpf.load_events.shift())();}};}if(n&&!jpf.load_events[0]){if(document.addEventListener&&!jpf.isOpera){window.addEventListener("DOMContentLoaded",jpf.load_init,false);}else{if(jpf.isIE&&window==top){jpf.load_timer=setInterval(function(){try{document.documentElement.doScroll("left");}catch(q){setTimeout(arguments.callee,0);return;}jpf.load_init();},10);}else{if(jpf.isOpera){document.addEventListener("DOMContentLoaded",function(){jpf.load_timer=setInterval(function(){for(var q=0;q<document.styleSheets.length;q++){if(document.styleSheets[q].disabled){return;}}jpf.load_init();},10);},false);}else{if(jpf.isSafari&&!jpf.isIphone){var m=documents.getElementsByTagName("link");for(var c=m.length;c>=0;c++){if(!m[c]||m[c].getAttribute("rel")!="stylesheet"){m.splice(c,0);}}var h=m.length;jpf.load_timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)&&document.styleSheets.length==h){jpf.load_init();}},10);}else{var a=window.onload;window.onload=function(){jpf.load_init();if(a){a();}};}}}}}jpf.load_events.push(n);},destroy:function(a){this.isDestroying=true;this.popup.destroy();for(i=0;i<this.all.length;i++){if(this.all[i]&&this.all[i]!=a&&this.all[i].destroy){this.all[i].destroy(false);}}for(i=this.$jmlDestroyers.length-1;i>=0;i--){this.$jmlDestroyers[i].call(this);}this.$jmlDestroyers=undefined;jpf.teleport.destroy();if(jpf.xmldb){jpf.xmldb.unbind(jpf.window);}this.isDestroying=false;}};var $xmlns=function(c,a,m,h){if(!jpf.supportNamespaces){if(!h){h=jpf.findPrefix(c,m);}if(c.style||c==document){return c.getElementsByTagName(a);}else{if(h){(c.nodeType==9?c:c.ownerDocument).setProperty("SelectionNamespaces","xmlns:"+h+"='"+m+"'");}return c.selectNodes(".//"+(h?h+":":"")+a);}}else{return c.getElementsByTagNameNS(m,a);}};jpf.Init.run("jpf");jpf.namespace("datainstr",{call:function(m,h,n){var a=h.parsed||this.parseInstructionPart(h.instrData.join(":"),m,h.args,h);if(h.preparse){h.parsed=a;h.preparse=-1;return;}var c=self[a.name].apply(null,a.arguments);if(n){n(c,jpf.SUCCESS,h);}},"eval":function(xmlContext,options,callback){var parsed=options.parsed||this.parseInstructionPart("("+options.instrData.join(":")+")",xmlContext,options.args,options);if(options.preparse){options.parsed=parsed;options.preparse=-1;return;}try{var retvalue=eval(parsed.arguments[0]);}catch(e){}if(callback){callback(retvalue,jpf.SUCCESS,options);}},cookie:function(n,c,q){var m=c.instrData.join(":");var a=c.parsed||m.indexOf("=")>-1?this.parseInstructionPart(m.replace(/\s*=\s*/,"(")+")",n,c.args,c):{name:m,args:c.args||[n]};if(c.preparse){c.parsed=a;c.preparse=-1;return;}var h;if(c.isGetRequest){h=jpf.getcookie(a.name);h=h?jpf.unserialize(h)||"":"";}else{h=jpf.setcookie(a.name,jpf.serialize(a.args[0]));}if(q){q(h||a.args[0],jpf.SUCCESS,c);}}});jpf.saveData=function(a,m,c,n){if(!a){return false;}if(!c){c={};}c.instrData=a.split(":");c.instrType=c.instrData.shift();var h=c.instrType.indexOf("url.")==0?"url":c.instrType;c.instruction=a;this.datainstr[h].call(this,m,c,n);};jpf.getData=function(a,y,A,w){var c=a.match(/^(.*?)(?:\!\{(.*)$|$)/);var q=c[2]?c[2].splitSafe("}s*,|,|}s*"):"";var n=function(D,C,B){if(C!=jpf.SUCCESS){return w(D,C,B);}q[2]=D;if(q[0]&&D){if(typeof D=="string"){D=jpf.xmldb.getXml(D);}B.data=D;D=D.selectSingleNode(q[0]);if(!D){throw new Error(jpf.formatErrorString(0,null,"Loading new data","Could not load data by doing selection on it using xPath: '"+q[0]+"'."));}}B.userdata=q;return w(D,C,B);};if(!A){A={};}A.isGetRequest=true;A.userdata=q;if(this.saveData(c[1],y,A,n)!==false){return;}var s=a.split(":");var v=s.shift();if(v.substr(0,1)=="#"){v=v.substr(1);var u,z=self[v];if(!z){var m=new Error(jpf.formatErrorString(0,null,"Loading data","Could not find object '"+v+"' referenced in process instruction '"+a+"' with error "+e.message));if(w&&w(null,jpf.ERROR,{message:m.description||m.message,error:m}===true)){return;}throw m;}var h=z.hasFeature(__MULTISELECT__)?z.selected:z.xmlRoot;if(!h){u=null;}else{u=s[1]?h.selectSingleNode(s[1]):h;}}else{var t=jpf.nameserver.get("model",v);if(!t){var m=new Error(jpf.formatErrorString(1068,null,"Loading data","Could not find model by name: "+v));if(w&&w(null,jpf.ERROR,{message:m.description||m.message,error:m}===true)){return;}throw m;}if(!t.data){u=null;}else{u=s[1]?t.data.selectSingleNode(s[1]):t.data;}}if(w){n(u,jpf.SUCCESS,{userdata:q});}else{return u;}};jpf.setModel=function(instruction,jmlNode,isSelection){if(!instruction){return;}var data=instruction.split(":");var instrType=data[0];var model=isSelection?jmlNode.$getMultiBind().getModel():jmlNode.getModel&&jmlNode.getModel();if(model){model.unregister(jmlNode);}if(jpf.datainstr[instrType]){jmlNode.setModel(new jpf.model().loadFrom(instruction));}else{if(instrType.substr(0,1)=="#"){instrType=instrType.substr(1);if(isSelection){var sb2=jpf.isParsing?jpf.JmlParser.getFromSbStack(jmlNode.uniqueId,1):jmlNode.$getMultiBind().smartBinding;if(sb2){sb2.model=new jpf.model().loadFrom(instruction);}}else{if(!self[instrType]||!jpf.JmlParser.inited){jpf.JmlParser.addToModelStack(jmlNode,data);}else{var oConnect=eval(instrType);if(oConnect.connect){oConnect.connect(jmlNode,null,data[2],data[1]||"select");}else{jmlNode.setModel(new jpf.model().loadFrom(instruction));}}}jmlNode.connectId=instrType;}else{var instrType=data.shift();model=instrType=="@default"?jpf.globalModel:jpf.nameserver.get("model",instrType);if(isSelection){var sb2=jpf.isParsing?jpf.JmlParser.getFromSbStack(jmlNode.uniqueId,1):jmlNode.$getMultiBind().smartBinding;if(sb2){sb2.model=model;sb2.$modelXpath[jmlNode.uniqueId]=data.join(":");}}else{jmlNode.setModel(model,data.join(":"));}}}};jpf.parseInstructionPart=function(instrPart,xmlNode,arg,options){var parsed={},s=instrPart.split("(");parsed.name=s.shift();if(!arg){arg=s.join("(");function getXmlValue(xpath){var o=xmlNode?xmlNode.selectSingleNode(xpath):null;if(!o){return null;}else{if(o.nodeType>=2&&o.nodeType<=4){return o.nodeValue;}else{if(jpf.xmldb.isOnlyChild(o.firstChild,[3,4])){return o.firstChild.nodeValue;}else{return o.xml||o.serialize();}}}}arg=arg.slice(0,-1);var depth,lastpos=0,result=["["];arg.replace(/\\[\{\}\'\"]|(["'])|([\{\}])/g,function(m,chr,cb,pos){chr&&(!depth&&(depth=chr)||depth==chr&&(depth=null));if(!depth&&cb){if(cb=="{"){result.push(arg.substr(lastpos,pos-lastpos));lastpos=pos+1;}else{var str=arg.substr(lastpos,pos-lastpos);if(str.match(/[\w_]+\s*\:[^\:]/)){result.push("{"+str+"}");}else{result.push("getXmlValue('",str.replace(/([\\'])/g,"\\$1"),"')");}lastpos=pos+1;}}});result.push(arg.substr(lastpos),"]");(function(){try{with(options){arg=eval(result.join(""));}}catch(e){arg=[];}})();}parsed.arguments=arg;return parsed;};jpf.windowManager={destroy:function(a){},userdata:[],forms:new Array(),addForm:function(c){var a={jml:c,show:function(){alert("not implemented");}};this.forms.push(jpf.setReference(a.name,a,true));return a;},getForm:function(c){for(var a=0;a<this.forms.length;a++){if(this.forms[a].name==c){return this.forms[a];}}return this.forms.length?this.forms[0]:false;},closeAll:function(){for(var a=0;a<this.forms.length;a++){if(this.forms[a].name!="main"&&this.forms[a].type!="modal"){this.forms[a].hide();}}}};jpf.WindowImplementation=function(){jpf.register(this,"window",jpf.NODE_HIDDEN);this.jpf=jpf;this.toString=function(){return"[Javeline Component : "+(this.name||"")+" (jpf.window)]";};this.getActionTracker=function(){return this.$at;};this.loadCodeFile=function(t){if(self[t]){jpf.importClass(self[t],true,this.win);}else{jpf.include(t);}};this.show=function(){if(jpf.isDeskrun){jdwin.Show();}};this.hide=function(){if(jpf.isDeskrun){jdwin.Hide();}else{this.loaded=false;if(this.win){this.win.close();}}};this.focus=function(){if(jpf.isDeskrun){jdwin.SetFocus();}else{window.focus();}};this.setIcon=function(t){if(jpf.isDeskrun){jdwin.icon=parseInt(t)==t?parseInt(t):t;}};this.setTitle=function(t){this.title=t||"";if(jpf.isDeskrun){jdwin.caption=t;}else{document.title=(t||"");}};this.loadJml=function(t){if(t[jpf.TAGNAME]=="deskrun"){this.loadDeskRun(t);}else{}};this.$tabList=[];this.$addFocus=function(y,u,t){if(!t){if(y.$domHandlers){y.$domHandlers.reparent.push(n);y.$domHandlers.remove.push(m);}if(y.isWindowContainer>-1){y.addEventListener("focus",q);if(!y.$tabList){y.$tabList=[y];}y.$focusParent=y;this.$tabList.push(y);return;}}var v=a(y);var w=v.$tabList;y.$focusParent=v;if(w[u]){w.insertIndex(y,u);}else{w.push(y);}};this.$removeFocus=function(t){if(!t.$focusParent){return;}t.$focusParent.$tabList.remove(t);if(!t.isWindowContainer&&t.$domHandlers){t.$domHandlers.reparent.remove(n);t.$domHandlers.remove.remove(m);}if(t.isWindowContainer>-1){t.removeEventListener("focus",q);}};this.$focus=function(v,u,t){if(this.focussed==v&&!t){return;}this.$settingFocus=v;if(this.focussed&&this.focussed!=v){this.focussed.blur(true,u);}(this.focussed=v).focus(true,u);this.$settingFocus=null;jpf.dispatchEvent("movefocus",{toElement:this.focussed});};this.$blur=function(t){if(this.focussed!=t){return false;}jpf.window.focussed.$focusParent.$lastFocussed=null;this.focussed=null;jpf.dispatchEvent("movefocus",{fromElement:t});};var s;this.$focusDefault=function(v,u){var t=a(v);this.$focusLast(t,u);};this.$focusRoot=function(t){var u=jpf.document.documentElement;if(this.$focusLast(u,t)===false){}};this.$focusLast=function(z,y,v){var u=z.$lastFocussed;if(u&&u.parentNode&&u.$focussable===true&&(v||u.oExt.offsetHeight)){this.$focus(u,y,true);}else{var A,t,w=z;while(w){if(w.focussable!==false&&w.$focussable===true&&(v||w.oExt.offsetHeight)){this.$focus(w,y,true);break;}if(w.firstChild||w.nextSibling){w=w.firstChild||w.nextSibling;}else{do{w=w.parentNode;}while(w&&!w.nextSibling&&w!=z);if(w==z){return;}if(w){w=w.nextSibling;}}}if(!w){this.$focus(jpf.document.documentElement);}}};function q(t){if(t.srcElement==this||t.trackedChild){t.trackedChild=true;return;}this.$lastFocussed=t.srcElement;if(this.tagName.indexOf("window")>-1){t.trackedChild=true;}}function a(u){var t=u;do{t=t.parentNode;}while(t&&!t.isWindowContainer);return t||jpf.document.documentElement;}function n(){if(this.isWindowContainer){jpf.window.$tabIndex.push(this);}else{jpf.window.$addFocus(this,this.tabindex,true);}}function m(t){if(this.isWindowContainer){jpf.window.$tabList.remove(this);return;}if(!this.$focusParent){return;}this.$focusParent.$tabList.remove(this);}this.hasFocus=function(t){return this.focussed==t;};this.moveNext=function(E,y,t,D){var z,u,B;if(t&&jpf.window.focussed){var v=jpf.window.focussed.$focusParent;if(v.visible&&v.modal){return false;}}var w=y||jpf.window.focussed;var A=w?(t&&w.isWindowContainer?jpf.window:w.$focusParent):jpf.document.documentElement;var C=A.$tabList;if(w&&(t||w!=jpf.document.documentElement)){u=(C||[]).indexOf(w);if(u==-1){return;}}else{u=-1;}if(this.focussed&&this.focussed==w&&C.length==1||C.length==0){return false;}z=(E?-1:1);B=u;if(u<0){u=0;}do{B+=z;if(B>=C.length){B=0;}else{if(B<0){B=C.length-1;}}if(u==B&&w){return false;}w=C[B];}while(!w||w.disabled||w==jpf.window.focussed||(t?!w.visible:w.oExt&&!w.oExt.offsetHeight)||w.focussable===false||t&&!w.$tabList.length);if(A==jpf.window){this.$focusLast(w,{mouse:true},t);}else{this.$focus(w,D);}};this.focusDefault=function(){if(this.moveNext()===false){this.moveNext(null,jpf.document.documentElement,true);}};window.onbeforeunload=function(){return jpf.dispatchEvent("exit");};window.onunload=function(){jpf.window.isExiting=true;jpf.window.destroy();};document.oncontextmenu=function(t){if(!t){t=event;}if(jpf.appsettings.disableRightClick){return false;}};var c={INPUT:1,TEXTAREA:1,SELECT:1};document.onmousedown=function(v){v=v||window.event;var u=jpf.findHost(v.srcElement||v.target);if(jpf.popup.last&&jpf.popup.last!=u.uniqueId){jpf.popup.forceHide();}var t;if((!u||!u.$focussable||u.focussable===false)&&jpf.appsettings.allowBlur){s=null;if(jpf.window.focussed){jpf.window.focussed.blur();}}else{if((t=jpf.window.focussed&&jpf.window.focussed.$focusParent||s)&&t.visible&&t.modal&&u.$focusParent!=t){jpf.window.$focusLast(t,{mouse:true});}else{if(!u&&jpf.window.focussed){jpf.window.$focusRoot();}else{if(!u.disabled&&u.focussable!==false){if(u.$focussable===jpf.KEYBOARD_MOUSE){jpf.window.$focus(u,{mouse:true});}else{if(u.canHaveChildren==2){if(!jpf.appsettings.allowBlur||!jpf.window.focussed||jpf.window.focussed.$focusParent!=u){jpf.window.$focusLast(u,{mouse:true});}}else{jpf.window.$focusDefault(u,{mouse:true});}}}else{jpf.window.$focusDefault(u,{mouse:true});}}}}jpf.dispatchEvent("mousedown",{htmlEvent:v,jmlNode:u});if(!jpf.isIphone&&!jpf.isIE&&(jpf.JmlParser&&!jpf.appsettings.allowSelect&&(!jpf.isParsingPartial||u))&&!c[v.target.tagName]){return false;}};document.onselectstart=function(t){if(!t){t=event;}if(jpf.JmlParser&&!jpf.appsettings.allowSelect){return false;}};document.onkeyup=function(t){if(!t){t=event;}if(jpf.window.focussed&&!jpf.window.focussed.disableKeyboard&&jpf.window.focussed.dispatchEvent("keyup",{keyCode:t.keyCode,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altkey,htmlEvent:t})===false){return false;}jpf.dispatchEvent("keyup",null,t);};function h(v){if(!v){v=event;}var w=null;if(v.wheelDelta){w=v.wheelDelta/120;if(jpf.isOpera){w*=-1;}}else{if(v.detail){w=-v.detail/3;}}if(w!==null){var u={delta:w};var t=jpf.dispatchEvent("mousescroll",u);if(t===false||u.returnValue===false){if(v.preventDefault){v.preventDefault();}v.returnValue=false;}}}if(document.addEventListener){document.addEventListener("DOMMouseScroll",h,false);}window.onmousewheel=document.onmousewheel=h;document.onkeydown=function(z){if(!z){z=event;}var v={ctrlKey:z.ctrlKey,shiftKey:z.shiftKey,altKey:z.altKey,keyCode:z.keyCode,htmlEvent:z,bubbles:true};if(jpf.dispatchEvent("hotkey",v)===false||v.returnValue===false){z.returnValue=false;z.cancelBubble=true;if(jpf.canDisableKeyCodes){try{z.keyCode=0;}catch(z){}}return false;}var u=[];if(z.altKey){u.push("Alt");}if(z.ctrlKey){u.push("Ctrl");}if(z.shiftKey){u.push("Shift");}if(z.metaKey){u.push("Meta");}if(jpf.keyNames[z.keyCode]){u.push(jpf.keyNames[z.keyCode]);}if(u.length){if(z.keyCode>46){u.push(String.fromCharCode(z.keyCode));}jpf.setProperty("hotkey",u.join("-"));}if(jpf.window.focussed&&!jpf.window.focussed.disableKeyboard&&jpf.window.focussed.dispatchEvent("keydown",v)===false){z.returnValue=false;z.cancelBubble=true;if(jpf.canDisableKeyCodes){try{z.keyCode=0;}catch(z){}}return false;}else{if((!jpf.appsettings.disableTabbing||jpf.window.focussed)&&z.keyCode==9){if(z.ctrlKey&&jpf.window.focussed){var t=jpf.window.focussed.$focusParent;if(t.modal){z.returnValue=false;return false;}jpf.window.moveNext(z.shiftKey,jpf.window.focussed.$focusParent,true);var t=jpf.window.focussed.$focusParent;if(t&&t.bringToFront){t.bringToFront();}}else{if(!jpf.window.focussed||jpf.window.focussed.tagName!="menu"){jpf.window.moveNext(z.shiftKey);}}z.returnValue=false;return false;}}var y=jpf.isMac?z.metaKey:z.altKey;if(jpf.appsettings.disableBackspace&&(z.keyCode==8||y&&(z.keyCode==37||z.keyCode==39))&&!c[(z.srcElement||z.target).tagName]){if(jpf.canDisableKeyCodes){try{z.keyCode=0;}catch(z){}}z.returnValue=false;}if(jpf.appsettings.disableF5&&(z.keyCode==116||z.keyCode==117)){if(jpf.canDisableKeyCodes){try{z.keyCode=0;}catch(z){}}else{z.preventDefault();z.stopPropagation();}}if(z.keyCode==27){z.returnValue=false;}if(!jpf.appsettings.allowSelect&&z.shiftKey&&(z.keyCode>32&&z.keyCode<41)&&!c[(z.explicitOriginalTarget||z.srcElement||z.target).tagName]&&(!z.srcElement||z.srcElement.contentEditable!="true")){z.returnValue=false;}return z.returnValue;};this.destroy=function(){this.$at=null;jpf.destroy(this);jpf.windowManager.destroy(this);jpf=this.win=this.window=this.document=null;window.onfocus=window.onerror=window.onunload=window.onbeforeunload=window.onbeforeprint=window.onafterprint=window.onmousewheel=window.onblur=null;document.oncontextmenu=document.onmousedown=document.onmousemove=document.onmouseup=document.onselectstart=document.onmousewheel=document.onkeyup=document.onkeydown=null;document.body.onmousedown=document.body.onmousemove=document.body.onmouseup=null;document.body.innerHTML="";};};jpf.DocumentImplementation=function(){jpf.makeClass(this);this.implement(jpf.JmlDom);this.nodeType=jpf.NODE_DOCUMENT;this.nodeFunc=jpf.NODE_HIDDEN;this.$jmlLoaded=true;this.documentElement={uniqueId:jpf.all.push(this)-1,nodeType:1,nodeFunc:jpf.NODE_HIDDEN,tagName:"application",parentNode:this,ownerDocument:this,pHtmlNode:document.body,$jml:jpf.JmlParser.$jml,$tabList:[],$jmlLoaded:true,$focussable:jpf.KEYBOARD,focussable:true,visible:true,isWindowContainer:true,canHaveChildren:true,focus:function(){this.dispatchEvent("focus");},blur:function(){this.dispatchEvent("blur");}};this.appendChild=this.insertBefore=function(){this.documentElement.insertBefore.apply(this.documentElement,arguments);};jpf.implement.call(this.documentElement,jpf.Class);jpf.window.$addFocus(this.documentElement);jpf.implement.call(this.documentElement,jpf.JmlDom);this.getElementById=function(a){return self[a];};this.createElement=function(c){var a,n;if(c.nodeType){a=c;}else{if(c.indexOf("<")>-1){a=jpf.getXml(c);}else{var h=jpf.findPrefix(jpf.JmlParser.$jml,jpf.ns.jml);var m=jpf.JmlParser.$jml.ownerDocument;if(jpf.JmlParser.$jml&&m.createElementNS){a=m.createElementNS(jpf.ns.jml,h+":"+c);}else{a=jpf.getXml("<"+h+":"+c+" xmlns:"+h+"='"+jpf.ns.jml+"' />",true);}}}if(jpf.isIE){if(!h){h=a.prefix;}a.ownerDocument.setProperty("SelectionNamespaces","xmlns:"+h+"='"+jpf.ns.jml+"'");}c=a[jpf.TAGNAME];var q;if(typeof jpf[c]!="function"){n=new jpf.JmlDom(c,null,jpf.NODE_HIDDEN,a);if(jpf.JmlParser.handler[c]){q=n.$domHandlers.reparent.push(function(s,t){this.$domHandlers.reparent[q]=null;if(!t.$jmlLoaded){return;}n=jpf.JmlParser.handler[c](this.$jml,t,t.oInt);if(n){jpf.extend(this,n);}if(n&&this.name){jpf.nameserver.register(c,this.name,n);}if(this.name){jpf.setReference(name,n);}n.$jmlLoaded=true;})-1;}}else{n=new jpf[c](null,c,a);if(n.loadJml){q=n.$domHandlers.reparent.push(function(s,u){this.$domHandlers.reparent[q]=null;if(!u.$jmlLoaded){return;}function v(B,A){if(!B.$jmlLoaded){var z=B.childNodes.length;B.pHtmlNode=A||document.body;B.loadJml(B.$jml);B.$jmlLoaded=false;if(z){for(var y=0,w=B.childNodes.length;y<w;y++){if(B.childNodes[y].loadJml){v(B.childNodes[y],B.canHaveChildren?B.oInt:document.body);}else{B.childNodes[y].$jmlLoaded=true;}}}}if(B.$reappendToParent){B.$reappendToParent();}B.$jmlLoaded=true;B.$reappendToParent=null;}var t=jpf.isParsing;jpf.isParsing=true;jpf.JmlParser.parseFirstPass([a]);v(n,u&&u.oInt||document.body);if(u&&u.pData){jpf.layout.compileAlignment(u.pData);}if(u.pData){jpf.layout.activateRules(u.oInt||document.body);}jpf.JmlParser.parseLastPass();jpf.isParsing=t;})-1;}}if(n.name){jpf.setReference(n.name,n);}n.$jml=a;return n;};this.createDocumentFragment=function(){return new jpf.JmlDom(jpf.NODE_DOCUMENT_FRAGMENT);};this.evaluate=function(n,m,h,q,c){var a=jpf.XPath.selectNodes(n,m||this.documentElement);return{snapshotLength:a.length,snapshotItem:function(s){return a[s];}};};this.createNSResolver=function(a){return{};};};jpf.component=function(a,m){var c=function(){this.$init.apply(this,arguments);};if(m){if(typeof m=="function"){c.prototype.base=m;}else{c.prototype=m;}}c.prototype.nodeFunc=a||jpf.NODE_HIDDEN;c.prototype.implement=jpf.implement;if(typeof c.prototype["$init"]!="function"){var h=[];c.implement=function(){h=h.concat(Array.prototype.slice.call(arguments));return c;};c.prototype.$init=function(q,n){if(typeof n!="string"){throw new Error(jpf.formatErrorString(0,this,"Error creating component","Dependencies not met, please provide a component name when instantiating it (ex.: new jpf.tree(oParent, 'tree') )"));}this.tagName=n;this.pHtmlNode=q||document.body;this.pHtmlDoc=this.pHtmlNode.ownerDocument;this.uniqueId=jpf.all.push(this)-1;this.$propHandlers={};this.$domHandlers={remove:[],insert:[],reparent:[],removechild:[]};if(a!=jpf.NODE_HIDDEN){if(typeof this.$focussable=="undefined"){this.$focussable=jpf.KEYBOARD_MOUSE;}this.$booleanProperties={"disable-keyboard":true,visible:true,focussable:true};this.$supportedProperties=["draggable","resizable","focussable","zindex","disabled","tabindex","disable-keyboard","contextmenu","visible","autosize","loadjml","actiontracker","alias"];}else{this.$booleanProperties={};this.$supportedProperties=[];}this.implement(jpf.Class);this.implement.apply(this,h);this.implement(jpf.JmlElement,this.base||jpf.K);if(typeof this["init"]=="function"){this.init();}};}return c;};jpf.subnode=function(a,m){var c=function(){this.$init.apply(this,arguments);};if(m){if(typeof m=="function"){c.prototype.base=m;}else{c.prototype=m;}}c.prototype.nodeFunc=a||jpf.NODE_HIDDEN;c.prototype.implement=jpf.implement;if(typeof c.prototype["$init"]!="function"){var h=[];c.implement=function(){h=h.concat(Array.prototype.slice.call(arguments));return c;};c.prototype.$init=function(s,q,n){if(typeof q!="string"){throw new Error(jpf.formatErrorString(0,this,"Error creating component","Dependencies not met, please provide a component name when instantiating it (ex.: new jpf.tree(oParent, 'tree') )"));}this.tagName=q;this.pHtmlNode=s||document.body;this.pHtmlDoc=this.pHtmlNode.ownerDocument;this.parentNode=n;this.$domHandlers={remove:[],insert:[],reparent:[],removechild:[]};this.uniqueId=jpf.all.push(this)-1;this.implement(jpf.Class);this.implement.apply(this,h);this.implement(jpf.JmlDom,this.base||jpf.K);if(typeof this["init"]=="function"){this.init();}};}return c;};jpf.XmlDatabase=function(){this.xmlDocTag="j_doc";this.xmlIdTag="j_id";this.xmlListenTag="j_listen";this.htmlIdTag="id";var a=[];this.getElementById=function(n,m){if(!m){m=a[n.split("|")[0]];}if(!m){return false;}return m.selectSingleNode("descendant-or-self::node()[@"+this.xmlIdTag+"='"+n+"']");};this.getNode=function(m){if(!m||!m.getAttribute(this.htmlIdTag)){return false;}return this.getElementById(m.getAttribute(this.htmlIdTag).split("|",2).join("|"));};this.getNodeById=function(s,n){var m=s.split("|");m.pop();return this.getElementById(m.join("|"),n);};this.getDocumentById=function(m){return a[m];};this.getDocument=function(m){return a[m.getAttribute(this.xmlIdTag).split("|")[0]];};this.getID=function(m,n){return m.getAttribute(this.xmlIdTag)+"|"+n.uniqueId;};this.getChildNumber=function(n){var q=n.parentNode;for(var m=0;m<q.childNodes.length;m++){if(q.childNodes[m]==n){return m;}}};this.isChildOf=function(m,s,n){if(!m||!s){return false;}if(s.nodeType==2){s=s.selectSingleNode("..");}if(n&&m==s){return true;}var q=s.parentNode;while(q){if(q==m){return true;}q=q.parentNode;}return false;};this.isOnlyChild=function(u,n){if(!u||!u.parentNode||n&&n.indexOf(u.nodeType)==-1){return false;}var s,m,t,q=u.parentNode.childNodes;for(s=0,m=q.length;s<m;s++){t=q[s];if(t.nodeType==1&&t!=u){return false;}if(t.nodeType==3&&!t.nodeValue.trim()){return false;}}return true;};this.findHTMLNode=function(m,n){do{if(m.nodeType==1&&m.getAttribute(this.xmlIdTag)){return n.getNodeFromCache(m.getAttribute(this.xmlIdTag)+"|"+n.uniqueId);}if(m==n.xmlRoot){return null;}m=m.parentNode;}while(m&&m.nodeType!=9);return null;};this.findXMLNode=function(m){if(!m){return false;}while(m&&m.nodeType==1&&m.tagName.toLowerCase()!="body"&&!m.getAttribute("id")||m&&m.nodeType==1&&m.getAttribute(this.htmlIdTag)&&m.getAttribute(this.htmlIdTag).match(/^q/)){if(m.host&&m.host.oExt==m){return m.host.xmlRoot;}m=m.parentNode;}if(!m||m.nodeType!=1){return false;}if(m.tagName.toLowerCase()=="body"){return false;}return this.getNode(m);};this.getElement=function(s,t){var m=s.childNodes;for(var n=0,q=0;q<m.length;q++){if(m[q].nodeType!=1){continue;}if(n++==t){return m[q];}}};this.getModel=function(m){return jpf.nameserver.get("model",m);};this.setModel=function(m){jpf.nameserver.register("model",m.data.ownerDocument.documentElement.getAttribute(this.xmlDocTag),m);};this.findModel=function(m){return this.getModel(m.ownerDocument.documentElement.getAttribute(this.xmlDocTag));};this.getXml=function(q,m,n){return jpf.getXmlDom(q,m,n).documentElement;};this.getXmlId=function(m){return m.getAttribute(this.xmlIdTag)||this.nodeConnect(jpf.xmldb.getXmlDocId(m),m);};this.nodeCount={};this.nodeConnect=function(q,n,t,u){if(!this.nodeCount[q]){this.nodeCount[q]=0;}var s;s=n.getAttribute(this.xmlIdTag)||n.setAttribute(this.xmlIdTag,(s=q+"|"+ ++this.nodeCount[q]))||s;if(!u){return s;}var m=s+"|"+u.uniqueId;if(t){t.setAttribute(this.htmlIdTag,m);}return m;};this.addNodeListener=function(q,s){var n=q.getAttribute(this.xmlListenTag);var m=(n?n.split(";"):[]);var t=String(s.uniqueId);if(!m.contains(t)){m.push(t);q.setAttribute(this.xmlListenTag,m.join(";"));}return q;};this.removeNodeListener=function(s,u){var q=s.getAttribute(this.xmlListenTag);var m=(q?q.split(";"):[]);for(var t=[],n=0;n<m.length;n++){if(m[n]!=u.uniqueId){t.push(m[n]);}}s.setAttribute(this.xmlListenTag,t.join(";"));return s;};this.integrate=function(w,u,z){if(typeof u!="object"){u=getElementById(u);}if(z&&z.clearContents){var n,q,t,m=u.selectNodes("descendant::node()[@"+this.xmlListenTag+"]");for(t=m.length-1;t>=0;t--){var y=m[t].getAttribute(this.xmlListenTag).split(";");for(q=y.length-1;q>=0;q--){n=jpf.all[y[q]];if(n.dataParent&&n.dataParent.xpath){n.dataParent.parent.signalXmlUpdate[n.uniqueId]=true;}else{if(n.$model){n.$listenRoot=jpf.xmldb.addNodeListener(u,n);n.xmlRoot=null;}}}}var m=u.childNodes;for(var t=m.length-1;t>=0;t--){u.removeChild(m[t]);}}beforeNode=jpf.getNode(u,[0]);m=w.childNodes;if(u.ownerDocument.importNode){doc=u.ownerDocument;for(t=0,l=m.length;t<l;t++){u.insertBefore(doc.importNode(m[t],true),beforeNode);}}else{for(t=m.length-1;t>=0;t--){u.insertBefore(m[0],beforeNode);}}if(z&&z.copyAttributes){var v=w.attributes;for(t=0;t<v.length;t++){if(v[t].nodeName!=this.xmlIdTag){u.setAttribute(v[t].nodeName,v[t].nodeValue);}}}return u;};this.synchronize=function(){this.forkRoot.parentNode.replaceChild(this.root,this.forkRoot);this.parent.applyChanges("synchronize",this.root);};this.copyNode=function(m){return this.clearConnections(m.cloneNode(true));};this.setNodeValue=function(t,s,v,q){var u,m,n;if(q){u=q.undoObj;m=q.xpath;n=q.newNodes;u.extra.oldValue=q.forceNew?"":jpf.getXmlValue(t,m);u.xmlNode=t;if(m){t=jpf.xmldb.createNodeFromXpath(t,m,n,q.forceNew);}u.extra.appliedNode=t;}if(t.nodeType==1){if(!t.firstChild){t.appendChild(t.ownerDocument.createTextNode("-"));}t.firstChild.nodeValue=jpf.isNot(s)?"":s;if(v){jpf.xmldb.applyChanges("synchronize",t,u);}}else{t.nodeValue=jpf.isNot(s)?"":s;if(v){jpf.xmldb.applyChanges("synchronize",t.parentNode||t.ownerElement||t.selectSingleNode(".."),u);}}};this.getNodeValue=function(m){if(!m){return"";}return m.nodeType==1?(!m.firstChild?"":m.firstChild.nodeValue):m.nodeValue;};this.getInheritedAttribute=function(q,n,s){var m;while(q&&q.nodeType!=11&&q.nodeType!=9&&!(m=n&&q.getAttribute(n)||s&&s(q))){q=q.parentNode;}return !m&&n&&jpf.appsettings?jpf.appsettings.tags[n]:m;};this.setTextNode=function(n,s,m,t){var q;if(m){q=n.selectSingleNode(m);if(!q){return;}n=q.nodeType==1?q:null;}if(n||!q){q=n.selectSingleNode("text()");if(!q){q=n.appendChild(n.ownerDocument.createTextNode(""));}}if(t){t.extra.oldValue=q.nodeValue;}q.nodeValue=s;this.applyChanges("text",q.parentNode,t);};this.setAttribute=function(q,n,s,m,t){(m?q.selectSingleNode(m):q).setAttribute(n,s);this.applyChanges("attribute",q,t);};this.removeAttribute=function(q,n,m,s){if(s){s.name=n;}(m?q.selectSingleNode(m):q).removeAttribute(n);this.applyChanges("attribute",q,s);};this.replaceNode=function(q,n,m,s){if(m){q=q.selectSingleNode(m);}if(s){s.oldNode=q;s.xmlNode=n;}q.parentNode.replaceChild(n,q);this.copyConnections(q,n);this.applyChanges("replacechild",n,s);};this.addChildNode=function(u,t,m,n,v){var s=u.insertBefore(u.ownerDocument.createElement(t),n);for(var q=0;q<m.length;q++){s.setAttribute(m[q][0],m[q][1]);}if(v){v.extra.addedNode=s;}this.applyChanges("add",s,v);return s;};this.appendChild=function(t,s,n,v,m,u){if(v&&t.selectSingleNode(s.tagName)){return false;}if(u){this.clearConnections(s);}if(jpf.isSafari&&t.ownerDocument!=s.ownerDocument){s=t.ownerDocument.importNode(s,true);}if(m){var q=[];var t=this.createNodeFromXpath(t,m,q);if(q.length){t.appendChild(s);while(q.length){if(t==q.pop()&&q.length){t=t.parentNode;}}}}t.insertBefore(s,n);this.applyChanges("add",s,u);return s;};this.moveNode=function(s,q,n,m,t){if(!t){t={extra:{}};}t.extra.oldParent=q.parentNode;t.extra.beforeNode=q.nextSibling;t.extra.parent=(m?s.selectSingleNode(m):s);this.applyChanges("move-away",q,t);if(!jpf.isSafari&&jpf.xmldb.getXmlDocId(q)!=jpf.xmldb.getXmlDocId(s)){q.removeAttributeNode(q.getAttributeNode(this.xmlIdTag));this.nodeConnect(jpf.xmldb.getXmlDocId(s),q);}if(jpf.isSafari&&s.ownerDocument!=q.ownerDocument){q=s.ownerDocument.importNode(q,true);}t.extra.parent.insertBefore(q,n);this.applyChanges("move",q,t);};this.removeNode=function(n,m,s){if(m){n=n.selectSingleNode(m);}if(s){s.extra.parent=n.parentNode;s.extra.removedNode=n;s.extra.beforeNode=n.nextSibling;}this.applyChanges("remove",n,s);var q=n.parentNode;q.removeChild(n);this.applyChanges("redo-remove",n,null,q);};this.removeNodeList=function(m,t){for(var q=[],n=0;n<m.length;n++){if(t){q.push({pNode:m[n].parentNode,removedNode:m[n],beforeNode:m[n].nextSibling});}this.applyChanges("remove",m[n],t);var s=m[n].parentNode;s.removeChild(m[n]);this.applyChanges("redo-remove",m[n],null,s);}if(t){t.extra.removeList=q;}};var h={},c;this.applyChanges=function(u,C,E,s){if(E&&!E.xmlNode){E.xmlNode=C;}var m=s;var D=(C.nodeType==1?C:C.parentNode);var B=C.getAttribute(this.xmlIdTag);if(!this.delayUpdate&&"|remove|move-away|".indexOf("|"+u+"|")>-1){this.notifyQueued();}var t,z,y,v,w,q,n,A,F;while(D&&D.nodeType!=9){t=D.getAttribute(this.xmlListenTag);if(t){z=t.split(";");for(y=0;y<z.length;y++){w=h[z[y]];if(!w){h[z[y]]=w=[];}if("|update|attribute|text|".indexOf("|"+u+"|")>-1){F=false;for(v=0;v<w.length;v++){if(w[v]&&C==w[v][1]&&"|update|attribute|text|".indexOf("|"+w[v][0]+"|")>-1){w[v]=null;F=true;continue;}}w.push(["update",C,D,E,m]);A=true;continue;}if(!this.delayUpdate&&"|remove|move-away|add|".indexOf("|"+u+"|")>-1){n=jpf.lookup(z[y]);if(n){n.$xmlUpdate(u,C,D,E,m);}}else{w.push([u,C,D,E,m]);A=true;}}}D=D.parentNode||s;if(D==s){s=null;}}if(E&&!this.delayUpdate){jpf.xmldb.notifyQueued();}else{if(A){clearTimeout(c);c=setTimeout(function(){jpf.xmldb.notifyQueued();});}}};this.notifyQueued=function(){clearTimeout(c);for(var t in h){var u=h[t];jmlNode=jpf.lookup(t);if(!jmlNode||!u){continue;}if(jmlNode.$listenRoot){var n=jmlNode.getModel();var m=n.getXpathByJmlNode(jmlNode);var v=m?n.data.selectSingleNode(m):n.data;if(v){jpf.xmldb.removeNodeListener(jmlNode.$listenRoot,jmlNode);jmlNode.$listenRoot=null;jmlNode.load(v);}continue;}for(var s=0;s<u.length;s++){if(!u[s]){continue;}jmlNode.$xmlUpdate.apply(jmlNode,u[s]);}}h={};};this.notifyListeners=function(q){var n=q.getAttribute(jpf.xmldb.xmlListenTag);if(n){n=n.split(";");for(var m=0;m<n.length;m++){jpf.lookup(n[m]).$xmlUpdate("synchronize",q,q);}}};this.copyConnections=function(n,m){try{m.setAttribute(this.xmlListenTag,n.getAttribute(this.xmlListenTag));m.setAttribute(this.xmlIdTag,n.getAttribute(this.xmlIdTag));}catch(q){}};this.clearConnections=function(q){try{var n,m=q.selectNodes("descendant-or-self::node()[@"+this.xmlListenTag+"]");for(n=m.length-1;n>=0;n--){m[n].removeAttribute(this.xmlListenTag);}m=q.selectNodes("descendant-or-self::node()[@"+this.xmlIdTag+"]");for(n=m.length-1;n>=0;n--){m[n].removeAttribute(this.xmlIdTag);}m=q.selectNodes("descendant-or-self::node()[@"+this.xmlDocTag+"]");for(n=m.length-1;n>=0;n--){m[n].removeAttribute(this.xmlDocTag);}m=q.selectNodes("descendant-or-self::node()[@j_loaded]");for(n=m.length-1;n>=0;n--){m[n].removeAttribute("j_loaded");}}catch(s){}return q;};this.serializeNode=function(n){var m=this.clearConnections(n.cloneNode(true));return m.xml||m.serialize();};this.unbind=function(u){for(var w={},s=0;s<u.jpf.all.length;s++){if(u.jpf.all[s]&&u.jpf.all[s].unloadBindings){w[u.jpf.all[s].unloadBindings()]=true;}}for(var m=0;m<a.length;m++){if(!a[m]){continue;}var v=a[m].selectNodes("//self::node()[@"+this.xmlListenTag+"]");for(var s=0;s<v.length;s++){var q=v[s].getAttribute(this.xmlListenTag).split(";");for(var t=[],n=0;n<q.length;n++){if(!w[q[n]]){t.push(q[n]);}}if(t.length!=q.length){v[s].setAttribute(this.xmlListenTag,t.join(";"));}}}};this.selectNodes=function(n,m){if(m&&(jpf.hasXPathHtmlSupport&&m.selectSingleNode||!m.style)){return m.selectNodes(n);}return jpf.XPath.selectNodes(n,m);};this.selectSingleNode=function(n,m){if(m&&(jpf.hasXPathHtmlSupport&&m.selectSingleNode||!m.style)){return m.selectSingleNode(n);}var q=this.selectNodes(n+(jpf.isIE?"":"[1]"),m?m:null);return q.length>0?q[0]:null;};this.createNodeFromXpath=function(t,D,u,w){var B,A="",E=D.split("|")[0].split("/");if(!w&&(B=t.selectSingleNode(D))){return B;}var v=E.length-1;if(w){if(E[v].trim().match(/^\@(.*)$|^text\(\)$/)){v--;}}for(var m,y=false,q=0;q<v;q++){if(!y&&t.selectSingleNode(A+(q!=0?"/":"")+E[q])){A+=(q!=0?"/":"")+E[q];continue;}var n=E[q].match(/(\w+)\[@([\w-]+)=(\w+)\]/);if(n){E[q]=n[1];}y=true;m=t.selectSingleNode(A||".").appendChild(t.ownerDocument.createElement(E[q]));if(n){m.setAttribute(n[2],n[3]);A+=(A?"/":"")+n[0];}else{A+=(A?"/":"")+E[q];}if(u){u.push(m);}}if(!A){A=".";}var z,s=E[v];do{if(s.match(/^\@(.*)$/)){(z||t.selectSingleNode(A)).setAttributeNode(z=t.ownerDocument.createAttribute(RegExp.$1));}else{if(s.trim()=="text()"){z=(z||t.selectSingleNode(A)).appendChild(t.ownerDocument.createTextNode(""));}else{var C=s.match(/(\w+)\[@([\w-]+)=(\w+)\]/);if(C){s=C[1];}z=(z||t.selectSingleNode(A)).appendChild(t.ownerDocument.createElement(s));if(C){z.setAttribute(C[2],C[3]);}if(u){u.push(z);}}}A+=(A?"/":"")+E[v];}while((s=E[++v]));return z;};this.getXmlDocId=function(q,m){var s=q.ownerDocument.documentElement;if(!this.isChildOf(s,q)){s=q;}var n=(s||q).getAttribute(this.xmlDocTag)||a.indexOf(s||q.ownerDocument||q);if(n&&n>-1){return n;}n=a.push(s||q.ownerDocument||q)-1;if(s){s.setAttribute(this.xmlDocTag,n);}if(m){jpf.nameserver.register("model",n,m);}return a.length-1;};this.getBindXmlNode=function(m){if(typeof m!="object"){m=jpf.getXmlDom(m);}if(m.nodeType==9){m=m.documentElement;}if(m.nodeType==3||m.nodeType==4){m=m.parentNode;}if(m.nodeType==2){m=m.ownerElement||m.parentNode||m.selectSingleNode("..");}return m;};this.convertMethods={json:function(u){var y={},w=false,n=u.childNodes;for(var t=0;t<n.length;t++){if(n[t].nodeType!=1){continue;}var m=n[t].tagName;w=true;var q=u.selectNodes(x);if(q.length>1){var v=[];for(var s=0;s<q.length;s++){v.push(this.json(q[s],y));}y[m]=v;}else{y[m]=this.json(q[s],y);}}return w?y:jpf.getXmlValue(u,"text()");},cgivars:function(v,z){if(!z){z="";}var y=[],A,n=v.childNodes,t={};for(var u=0;u<n.length;u++){if(n[u].nodeType!=1){continue;}var m=n[u].tagName;if(t[m]){continue;}var q=v.selectNodes(m);if(q.length>1){t[m]=true;for(var s=0;s<q.length;s++){A=this.cgivars(q[s],z+m+"["+s+"]");if(A){y.push(A);}}}else{A=this.cgivars(n[u],z+m);if(A){y.push(A);}}}var w=v.attributes;for(u=0;u<w.length;u++){if(w[u].nodeValue){if(z){y.push(z+"["+w[u].nodeName+"]="+encodeURIComponent(w[u].nodeValue));}else{y.push(w[u].nodeName+"="+encodeURIComponent(w[u].nodeValue));}}}if(y.length){return y.join("&");}A=jpf.getXmlValue(v,"text()");if(z&&A){return z+"="+encodeURIComponent(A);}},cgiobjects:function(s,m,u){if(!m){m="";}var A=[],z,w=s.childNodes,v={};for(var E=0;E<w.length;E++){var B=w[E];if(B.nodeType!=1){continue;}var H=B.tagName;if(H=="revision"){continue;}var q=jpf.xmldb.isOnlyChild(B.firstChild,[3,4]);var t=0;if(!B.attributes.length&&!q){var F=B.childNodes;for(var n,D=0,C=F.length;D<C;D++){if(F[D].nodeType!=1){continue;}n=m+(u?"[":"")+H+(u?"]":"")+"["+t+++"]";z=this.cgiobjects(F[D],n,true);if(z){A.push(z);}if(jpf.xmldb.isOnlyChild(F[D].firstChild,[3,4])){A.push(n+"["+F[D].tagName+"]="+encodeURIComponent(F[D].firstChild.nodeValue));}var G,y=F[D].attributes;for(k=0;k<y.length;k++){if(!(G=y[k]).nodeValue){continue;}A.push(n+"["+G.nodeName+"]="+encodeURIComponent(G.nodeValue));}}}else{if(q){A.push(m+(u?"[":"")+H+(u?"]":"")+"="+encodeURIComponent(B.firstChild.nodeValue));}var G,y=B.attributes;for(D=0;D<y.length;D++){if(!(G=y[D]).nodeValue){continue;}A.push(m+(u?"[":"")+H+"_"+G.nodeName+(u?"]":"")+"="+encodeURIComponent(G.nodeValue));}}}if(!u&&s.getAttribute("id")){A.push("id="+encodeURIComponent(s.getAttribute("id")));}if(A.length){return A.join("&");}}};this.convertXml=function(m,n){return this.convertMethods[n](m);};this.getTextNode=function(m){for(var n=0;n<m.childNodes.length;n++){if(m.childNodes[n].nodeType==3||m.childNodes[n].nodeType==4){return m.childNodes[n];}}return false;};this.getBoundValue=function(n,s,q){if(!s&&!n.xmlRoot){return"";}var m=!n.nodeFunc?s.selectSingleNode(n.getAttribute("ref")):n.getNodeFromRule("value",n.xmlRoot);return m?this.getNodeValue(m):"";};this.getArrayFromNodelist=function(q){for(var m=[],n=0;n<q.length;n++){m.push(q[n]);}return m;};};jpf.getXml=function(){return jpf.xmldb.getXml.apply(jpf.xmldb,arguments);};jpf.Init.run("XmlDatabase");jpf.Class=function(){this.$jmlLoaders=[];this.$addJmlLoader=function(func){if(!this.$jmlLoaders){func.call(this,this.$jml);}else{this.$jmlLoaders.push(func);}};this.$jmlDestroyers=[];this.$regbase=0;this.hasFeature=function(test){return this.$regbase&test;};var boundObjects={};var myBoundPlaces={};if(!this.$handlePropSet){this.$handlePropSet=function(prop,value){this[prop]=value;};}this.bindProperty=function(myProp,bObject,bProp,strDynamicProp){if(!boundObjects[myProp]){boundObjects[myProp]={};}if(!boundObjects[myProp][bObject.uniqueId]){boundObjects[myProp][bObject.uniqueId]=[];}if(boundObjects[myProp][bObject.uniqueId].contains(bProp)){return;}if(strDynamicProp){boundObjects[myProp][bObject.uniqueId].push([bProp,strDynamicProp]);}else{boundObjects[myProp][bObject.uniqueId].pushUnique([bProp]);}bObject.$handlePropSet(bProp,strDynamicProp?eval(strDynamicProp):this[myProp]);};this.unbindProperty=function(myProp,bObject,bProp){boundObjects[myProp][bObject.uniqueId].remove(bProp);};this.unbindAllProperties=function(){var prop;for(prop in myBoundPlaces){if(myBoundPlaces[prop]&&typeof myBoundPlaces[prop]!="function"){for(var i=0;i<myBoundPlaces[prop].length;i++){if(!self[myBoundPlaces[prop][i][0]]){continue;}self[myBoundPlaces[prop][i][0]].unbindProperty(myBoundPlaces[prop][i][1],this,prop);}}}};this.getAvailableProperties=function(){return this.$supportedProperties.slice();};this.setDynamicProperty=function(prop,pValue){var pStart=pValue.substr(0,1);if(myBoundPlaces[prop]){for(var i=0;i<myBoundPlaces[prop].length;i++){self[myBoundPlaces[prop][i][0]].unbindProperty(myBoundPlaces[prop][i][1],this,prop);}}if(pStart=="["){var p=pValue.substr(1,pValue.length-2).split(".");if(!self[p[0]]){return;}if(!p[1]){p[1]=self[p[0]].$supportedProperties[0];}self[p[0]].bindProperty(p[1],this,prop);myBoundPlaces[prop]=[p];this.bindProperty(prop,self[p[0]],p[1]);}else{if(pStart=="{"){var o,node,bProp,p,matches={};pValue=pValue.substr(1,pValue.length-2);pValue.replace(/["'](?:\\.|[^"']+)*["']|\\(?:\\.|[^\\]+)*\/|(?:\W|^)([a-z]\w*\.\w+(?:\.\w+)*)(?!\()(?:\W|$)/gi,function(m,m1){if(m1){matches[m1]=true;}});pValue=pValue.replace(/\Wand\W/g,"&&").replace(/\Wor\W/g,"||");myBoundPlaces[prop]=[];var found=false;for(p in matches){if(typeof matches[p]=="function"){continue;}o=p.split(".");if(o.length>2){bProp=o.pop();node=eval(o.join("."));if(typeof node!="object"||!node.$regbase){bProp=o[1];node=self[o[0]];}else{o.push(bProp);}}else{bProp=o[1];node=self[o[0]];}if(!node||!node.bindProperty){continue;}node.bindProperty(bProp,this,prop,pValue);myBoundPlaces[prop].push(o);found=true;}if(!found){var value=eval(pValue);this[prop]=!value;this.setProperty(prop,value);}}else{var value=eval(pValue);this[prop]=!value;this.setProperty(prop,eval(pValue));}}};var isMultiLang={};this.setProperty=function(prop,value,reqValue,forceOnMe){if(reqValue&&!value||!jpf||this.$ignoreSignals){return;}if(!forceOnMe){if(isMultiLang[prop]){jpf.language.removeElement(isMultiLang[prop][0],isMultiLang[prop][1]);delete isMultiLang[prop];}if(/^\$(.*)\$$/.test(value)){isMultiLang[prop]=[value,jpf.language.addElement(RegExp.$1,{jmlNode:this,prop:prop})];return;}}var oldvalue=this[prop];if(String(this[prop])!==String(value)||typeof value=="object"){if(this.$handlePropSet(prop,value,forceOnMe)===false){this[prop]=oldvalue;return false;}}var nodes=boundObjects[prop];if(!nodes){return;}var id,ovalue=this[prop];for(id in nodes){if(jpf.isSafari&&(typeof nodes[id]!="object"||!nodes[id])){continue;}for(var o=jpf.lookup(id),i=nodes[id].length-1;i>=0;--i){try{value=nodes[id][i][1]?eval(nodes[id][i][1]):ovalue;}catch(e){throw new Error(jpf.formatErrorString(0,this,"Property-binding","Could not execute binding test: "+nodes[id][i][1]));}if(typeof o!="undefined"&&o[nodes[id][i][0]]!=value){o.setProperty(nodes[id][i][0],value);}}}return value;};this.getProperty=function(prop){return this[prop];};var capture_stack={},events_stack={};this.dispatchEvent=function(eventName,options,e){var arr,result,rValue;if(options&&options.name){e=options;}else{if(!e){e=new jpf.Event(eventName,options);}}if(this.disabled){result=false;}else{if(!e.originalElement){e.originalElement=this;if(arr=capture_stack[eventName]){for(var i=0;i<arr.length;i++){rValue=arr[i].call(this,e);if(rValue!=undefined){result=rValue;}}}}if(options&&options.captureOnly){return e.returnValue||rValue;}else{if(this["on"+eventName]){result=this["on"+eventName].call(this,e);}if(arr=events_stack[eventName]){for(var i=0;i<arr.length;i++){rValue=arr[i].call(this,e);if(rValue!=undefined){result=rValue;}}}}}if(e.bubbles&&!e.cancelBubble&&this!=jpf){rValue=(this.parentNode||jpf).dispatchEvent(eventName,null,e);if(rValue!=undefined){result=rValue;}}return e.returnValue!==undefined?e.returnValue:result;};this.addEventListener=function(eventName,callback,useCapture){if(eventName.indexOf("on")==0){eventName=eventName.substr(2);}var stack=useCapture?capture_stack:events_stack;if(!stack[eventName]){stack[eventName]=[];}stack[eventName].pushUnique(callback);};this.removeEventListener=function(eventName,callback,useCapture){var stack=useCapture?capture_stack:events_stack;if(stack[eventName]){stack[eventName].remove(callback);}};this.hasEventListener=function(eventName){return(events_stack[eventName]&&events_stack[eventName].length>0);};this.destroy=this.destroy||function(deep){if(!this.$jmlDestroyers){return;}if(this.$destroy){this.$destroy();}for(var i=this.$jmlDestroyers.length-1;i>=0;i--){this.$jmlDestroyers[i].call(this);}this.$jmlDestroyers=undefined;if(typeof this.uniqueId=="undefined"){return;}jpf.all[this.uniqueId]=undefined;if(!this.nodeFunc){if(this.name){self[this.name]=null;}return;}if(this.oExt&&!this.oExt.isNative&&this.oExt.nodeType==1){this.oExt.oncontextmenu=this.oExt.host=null;}if(this.oInt&&!this.oExt.isNative&&this.oInt.nodeType==1){this.oInt.host=null;}if(this.$jml&&this.$jml.parentNode){this.$jml.parentNode.removeChild(this.$jml);}this.$jml=null;if(this.parentNode){this.removeNode();}if(this.$focussable&&this.focussable){jpf.window.$removeFocus(this);}this.unbindAllProperties();if(deep&&this.childNodes){var i,nodes=this.childNodes;for(i=nodes.length-1;i>=0;i--){if(nodes[i].destroy){nodes[i].destroy(true);}}this.childNodes=null;}for(prop in isMultiLang){jpf.language.removeElement(isMultiLang[prop][0],isMultiLang[prop][1]);}if(this.name){self[this.name]=null;}};};jpf.Event=function(a,c){this.name=a;this.bubbles=false;this.cancelBubble=false;this.preventDefault=function(){this.returnValue=false;};this.stopPropagation=function(){this.cancelBubble=true;};this.stop=function(){this.returnValue=false;this.cancelBubble=true;};this.isCharacter=function(){return(this.keyCode<112||this.keyCode>122)&&(this.keyCode==32||this.keyCode>42||this.keyCode==8);};jpf.extend(this,c);};jpf.implement(jpf.Class);jpf.Init.run("class");jpf.runNonIe=function(){DocumentFragment.prototype.getElementById=function(v){return this.childNodes.length?this.childNodes[0].ownerDocument.getElementById(v):null;};if(XMLDocument.prototype.__defineGetter__){XMLDocument.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this);});XMLDocument.prototype.__defineSetter__("xml",function(){throw new Error(jpf.formatErrorString(1042,null,"XML serializer","Invalid assignment on read-only property 'xml'."));});Node.prototype.__defineGetter__("xml",function(){if(this.nodeType==3||this.nodeType==4||this.nodeType==2){return this.nodeValue;}return(new XMLSerializer()).serializeToString(this);});Element.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this);});}if(typeof HTMLElement!="undefined"){if(!HTMLElement.prototype.insertAdjacentElement){HTMLElement.prototype.insertAdjacentElement=function(v,w){switch(v.toLowerCase()){case"beforebegin":this.parentNode.insertBefore(w,this);break;case"afterbegin":this.insertBefore(w,this.firstChild);break;case"beforeend":this.appendChild(w);break;case"afterend":if(this.nextSibling){this.parentNode.insertBefore(w,this.nextSibling);}else{this.parentNode.appendChild(w);}break;}};}if(!HTMLElement.prototype.insertAdjacentHTML){HTMLElement.prototype.insertAdjacentHTML=function(w,z){var y=this.ownerDocument.createRange();y.setStartBefore(jpf.isSafari?document.body:(self.document?document.body:this));var v=y.createContextualFragment(z);this.insertAdjacentElement(w,v);};}if(jpf.isSafari||jpf.isChrome){HTMLBodyElement.prototype.insertAdjacentHTML=HTMLElement.prototype.insertAdjacentHTML;}if(!HTMLElement.prototype.insertAdjacentText){HTMLElement.prototype.insertAdjacentText=function(w,y){var v=document.createTextNode(y);this.insertAdjacentElement(w,v);};}HTMLElement.prototype.removeNode=function(){if(!this.parentNode){return;}this.parentNode.removeChild(this);};if(HTMLElement.prototype.__defineSetter__){HTMLElement.prototype.__defineSetter__("innerText",function(v){var w=""+v;this.innerHTML=w.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");});HTMLElement.prototype.__defineGetter__("innerText",function(){return this.innerHTML.replace(/<[^>]+>/g,"").replace(/\s\s+/g," ").replace(/^\s*|\s*$/g," ");});HTMLElement.prototype.__defineGetter__("outerHTML",function(){return(new XMLSerializer()).serializeToString(this);});}}var s=false;try{XMLDocument.prototype.async=true;s=true;}catch(n){}Document.prototype.onreadystatechange=null;Document.prototype.parseError=0;Array.prototype.item=function(v){return this[v];};Array.prototype.expr="";XMLDocument.prototype.$clearDOM=function(){while(this.hasChildNodes()){this.removeChild(this.firstChild);}};XMLDocument.prototype.$copyDOM=function(v){this.$clearDOM();if(v.nodeType==9||v.nodeType==11){var y=v.childNodes;for(var w=0;w<y.length;w++){this.appendChild(this.importNode(y[w],true));}}else{if(v.nodeType==1){this.appendChild(this.importNode(v,true));}}};XMLDocument.prototype.loadXML=function(y){jpf.xmldb.setReadyState(this,1);var w=this.xml||this.serialize();var v=(new DOMParser()).parseFromString(y,"text/xml");jpf.xmldb.setReadyState(this,2);this.$copyDOM(v);jpf.xmldb.setReadyState(this,3);jpf.xmldb.loadHandler(this);return w;};Node.prototype.getElementById=function(v){};HTMLElement.prototype.replaceNode=Element.prototype.replaceNode=function(v){if(!this.parentNode){return;}this.parentNode.insertBefore(v,this);this.parentNode.removeChild(this);};XMLDocument.prototype.$load=XMLDocument.prototype.load;XMLDocument.prototype.load=function(z){var v=document.implementation.createDocument("","",null);v.$copyDOM(this);this.parseError=0;jpf.xmldb.setReadyState(this,1);try{if(this.async==false&&s){var w=new XMLHttpRequest();w.open("GET",z,false);w.overrideMimeType("text/xml");w.send(null);jpf.xmldb.setReadyState(this,2);this.$copyDOM(w.responseXML);jpf.xmldb.setReadyState(this,3);}else{this.$load(z);}}catch(y){this.parseError=-1;}finally{jpf.xmldb.loadHandler(this);}return v;};jpf.getStyle=function(v,w){return window.getComputedStyle(v,"").getPropertyValue(w);};HTMLDocument.prototype.setProperty=XMLDocument.prototype.setProperty=function(v,w){};jpf.getHttpReq=function(){if(jpf.teleport.availHTTP.length){return jpf.teleport.availHTTP.pop();}return new XMLHttpRequest();};jpf.getXmlDom=function(y,v){var w;if(y){w=new DOMParser();w=w.parseFromString(y,"text/xml");if(!v){this.xmlParseError(w);}}else{w=document.implementation.createDocument("","",null);}return w;};jpf.xmlParseError=function(w){if(w.documentElement.tagName=="parsererror"){var A=w.documentElement.firstChild.nodeValue.split("\n");var y=A[2].match(/\w+ (\d+)/)[1];var z=A[0].replace(/\w+ \w+ \w+: (.*)/,"$1");var v=w.documentElement.lastChild.firstChild.nodeValue.split("\n")[0];throw new Error(jpf.formatErrorString(1050,null,"XML Parse Error on line "+y,z+"\nSource Text : "+v.replace(/\t/gi," ")));}return w;};if(jpf.XmlDatabase){jpf.XmlDatabase.prototype.htmlImport=function(F,D,C,A){if(!D){alert("No HTML node given in htmlImport:"+this.htmlImport.caller);}if(F.length!=null&&!F.nodeType){for(var B=[],y=0,w=F.length;y<w;y++){B.push(F[y].xml||F[y].serialize());}B=B.join("").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/<([^>]+)\/>/g,"<$1></$1>");(C||D).insertAdjacentHTML(C?"beforebegin":"beforeend",B);return null;}if(D.ownerDocument&&D.ownerDocument!=document&&F.ownerDocument==D.ownerDocument){return D.insertBefore(F,C);}var z=jpf.html_entity_decode(F.outerHTML||F.xml||F.nodeValue);var E=(C||D);if(E.nodeType==11){var v=F.getAttribute("id");if(!v){throw new Error(jpf.formatErrorString(1049,null,"xmldb","Inserting Cache Item in Document Fragment without an ID"));}document.body.insertAdjacentHTML(C?"beforebegin":"beforeend",z);E.appendChild(document.getElementById(v));}else{if(F.tagName.match(/tbody|td|tr/)){E.insertBefore(E.ownerDocument.createElement(F.tagName.toLowerCase()),C||null);}else{E.insertAdjacentHTML(C?"beforebegin":"beforeend",z);}}return C?C.previousSibling:D.lastChild;};jpf.XmlDatabase.prototype.setReadyState=function(v,w){v.readyState=w;if(v.onreadystatechange!=null&&typeof v.onreadystatechange=="function"){v.onreadystatechange();}};jpf.XmlDatabase.prototype.loadHandler=function(v){if(!v.documentElement||v.documentElement.tagName=="parsererror"){v.parseError=-1;}jpf.xmldb.setReadyState(v,4);};jpf.xmldb=new jpf.XmlDatabase();}jpf.Init.add(function(){var w,v=document.getElementsByTagName("form");for(w=0;w<v.length;w++){v[w].removeNode();}v=document.getElementsByTagName("xml");for(w=0;w<v.length;w++){v[w].removeNode();}v=null;});var t=3;var u=0;if(document.body){document.body.focus=function(){};}if(!document.elementFromPoint){Document.prototype.elementFromPointRemove=function(v){if(!this.RegElements){return;}this.RegElements.remove(v);};Document.prototype.elementFromPointAdd=function(v){if(!this.RegElements){this.RegElements=[];}this.RegElements.push(v);};Document.prototype.elementFromPointReset=function(v){FoundValue=[];FoundNode=null;LastFoundAbs=document.documentElement;};Document.prototype.elementFromPoint=function(H,E){document.elementFromPointReset();if(this.RegElements){for(var I=-1,w,A=0;A<this.RegElements.length;A++){var v=this.RegElements[A];if(q(v,"display")=="none"){continue;}var G=c(v);var F=a(v);var C=G+v.offsetWidth;var B=F+v.offsetHeight;if(H>G&&H<C&&E>F&&E<B){var D=m(v);if(D>I){w=[v,H,E,G,F];I=D;}}}if(w){h(w[0],w[1],w[2],0,FoundValue,w[3],w[4]);if(!FoundNode){FoundNode=w[0];LastFoundAbs=w[0];FoundValue=[I];}}}if(!this.RegElements||!this.RegElements.length){h(document.body,H,E,0,[],c(document.body),a(document.body));}return FoundNode;};function q(v,w){return document.defaultView.getComputedStyle(v,"").getPropertyValue(w);}function h(L,C,B,D,Q,F,E){var R=Q;var I=D;var K=L.childNodes;for(var J,M=0;M<L.childNodes.length;M++){J=L.childNodes[M];if(J.nodeType==1&&q(J,"display")!="none"&&J.offsetParent){var H=F+J.offsetLeft-J.offsetParent.scrollLeft;var G=E+J.offsetTop-J.offsetParent.scrollTop;var P=H+J.offsetWidth;var O=G+J.offsetHeight;var N=q(J,"position");N=(N=="absolute")||(N=="relative");var v=q(J,"overflow")=="hidden";var w=(C>H&&C<P&&B>G&&B<O);if(N&&v&&!w){continue;}D=I;Q=R.copy();var A=parseInt(q(J,"z-index"))||0;if(N&&(A||A==0)||v){if(!N){A=0;}if(A>=(FoundValue[D]||0)){if(A>(Q[D]||0)){Q[D]=A;}D++;if(w&&D>=FoundValue.length){FoundNode=J;FoundValue=Q;LastFoundAbs=J;}}else{continue;}}else{if(w&&D>=FoundValue.length){FoundNode=J;FoundValue=Q;}}h(J,C,B,D,Q,N?H:F,N?G:E);}}}function a(v){return v.offsetTop+parseInt(jpf.getStyle(v,"border-top-width"))+(v.offsetParent?a(v.offsetParent):0);}function c(v){return v.offsetLeft+parseInt(jpf.getStyle(v,"border-left-width"))+(v.offsetParent?c(v.offsetParent):0);}function m(y){var w=0,A,v=y;while(v&&v.nodeType==1){w=Math.max(w,parseInt(q(v,"z-index"))||-1);v=v.parentNode;}return w;}}jpf.getHorBorders=function(v){return Math.max(0,(parseInt(jpf.getStyle(v,"border-left-width"))||0)+(parseInt(jpf.getStyle(v,"border-right-width"))||0));};jpf.getVerBorders=function(v){return Math.max(0,(parseInt(jpf.getStyle(v,"border-top-width"))||0)+(parseInt(jpf.getStyle(v,"border-bottom-width"))||0));};jpf.getWidthDiff=function(v){return Math.max(0,(parseInt(jpf.getStyle(v,"padding-left"))||0)+(parseInt(jpf.getStyle(v,"padding-right"))||0)+(parseInt(jpf.getStyle(v,"border-left-width"))||0)+(parseInt(jpf.getStyle(v,"border-right-width"))||0));};jpf.getHeightDiff=function(v){return Math.max(0,(parseInt(jpf.getStyle(v,"padding-top"))||0)+(parseInt(jpf.getStyle(v,"padding-bottom"))||0)+(parseInt(jpf.getStyle(v,"border-top-width"))||0)+(parseInt(jpf.getStyle(v,"border-bottom-width"))||0));};jpf.getDiff=function(v){return[Math.max(0,parseInt(jpf.getStyle(v,"padding-left"))+parseInt(jpf.getStyle(v,"padding-right"))+parseInt(jpf.getStyle(v,"border-left-width"))+parseInt(jpf.getStyle(v,"border-right-width"))||0),Math.max(0,parseInt(jpf.getStyle(v,"padding-top"))+parseInt(jpf.getStyle(v,"padding-bottom"))+parseInt(jpf.getStyle(v,"border-top-width"))+parseInt(jpf.getStyle(v,"border-bottom-width"))||0)];};jpf.Init.run("xmldb");};jpf.runIE=function(){var a=hasIESecurity=false;if(self.XLMHttpRequest){try{new XLMHttpRequest();}catch(c){a=true;}}try{new ActiveXObject("microsoft.XMLHTTP");}catch(c){hasIESecurity=true;}if(hasIESecurity){jpf.importClass(function(){__CONTENT_IFRAME;},true,self);}jpf.getHttpReq=hasIESecurity?function(){if(jpf.teleport.availHTTP.length){return jpf.teleport.availHTTP.pop();}return new XMLHttpRequest();}:function(){if(jpf.teleport.availHTTP.length){return jpf.teleport.availHTTP.pop();}return new ActiveXObject("microsoft.XMLHTTP");};jpf.getXmlDom=hasIESecurity?function(n,h){var m=getDOMParser(n,h);return m;}:function(q,h,n){var m=new ActiveXObject("microsoft.XMLDOM");m.setProperty("SelectionLanguage","XPath");if(n){m.preserveWhiteSpace=true;}if(q){if(jpf.cantParseXmlDefinition){q=q.replace(/\] \]/g,"] ]").replace(/^<\?[^>]*\?>/,"");}m.loadXML(q);if(!h){this.xmlParseError(m);}}return m;};jpf.xmlParseError=function(m){var h=m.parseError;if(h!=0){throw new Error(jpf.formatErrorString(1050,null,"XML Parse error on line "+h.line,h.reason+"Source Text:\n"+h.srcText.replace(/\t/gi," ")));}return m;};jpf.getStyle=function(h,m){return h.currentStyle[m];};if(jpf.XmlDatabase){jpf.XmlDatabase.prototype.htmlImport=function(A,y,v,n,B){var h;if(A.length!=null&&!A.nodeType){var u,q,m;for(u=[],q=0,m=A.length;q<m;q++){u.push(A[q].xml);}u=u.join("");u=jpf.html_entity_decode(u).replace(/style="background-image:([^"]*)"/g,"find='$1' style='background-image:$1'");if(n){(v||y).insertAdjacentHTML(v?"beforebegin":"beforeend",n+u+B);}try{(v||y).insertAdjacentHTML(v?"beforebegin":"beforeend",u);}catch(t){document.body.insertAdjacentHTML("beforeend","<table><tr>"+u+"</tr></table>");var w=document.body.lastChild.firstChild.firstChild;for(q=w.childNodes.length-1;q>=0;q--){y.appendChild(w.childNodes[jpf.hasDynamicItemList?0:q]);}}if(!this.nodes){this.nodes=[];}h=this.nodes.push(y.getElementsByTagName("*"))-1;setTimeout("jpf.xmldb.doNodes("+h+")");return null;}if(y.ownerDocument&&y.ownerDocument!=document&&A.ownerDocument==y.ownerDocument){return y.insertBefore(A,v);}var s=jpf.html_entity_decode(A.outerHTML||A.xml||A.nodeValue);var z=(v||y);if(z.nodeType==11){h=A.getAttribute("id");if(!h){throw new Error(jpf.formatErrorString(1049,null,"xmldb","Inserting Cache Item in Document Fragment without an ID"));}document.body.insertAdjacentHTML(v?"beforebegin":"beforeend",s);z.appendChild(document.getElementById(h));}else{z.insertAdjacentHTML(v?"beforebegin":"beforeend",s);}return v?v.previousSibling:y.lastChild;};jpf.XmlDatabase.prototype.doNodes=function(n){var h=this.nodes[n];for(var m=0;m<h.length;m++){if(h[m].getAttribute("find")){h[m].style.backgroundImage=h[m].getAttribute("find");}}this.nodes[n]=null;};jpf.xmldb=new jpf.XmlDatabase();}if(!hasIESecurity){jpf.Init.run("xmldb");}jpf.getHorBorders=function(h){return Math.max(0,(parseInt(jpf.getStyle(h,"borderLeftWidth"))||0)+(parseInt(jpf.getStyle(h,"borderRightWidth"))||0));};jpf.getVerBorders=function(h){return Math.max(0,(parseInt(jpf.getStyle(h,"borderTopWidth"))||0)+(parseInt(jpf.getStyle(h,"borderBottomWidth"))||0));};jpf.getWidthDiff=function(h){return Math.max(0,(parseInt(jpf.getStyle(h,"paddingLeft"))||0)+(parseInt(jpf.getStyle(h,"paddingRight"))||0)+(parseInt(jpf.getStyle(h,"borderLeftWidth"))||0)+(parseInt(jpf.getStyle(h,"borderRightWidth"))||0));};jpf.getHeightDiff=function(h){return Math.max(0,(parseInt(jpf.getStyle(h,"paddingTop"))||0)+(parseInt(jpf.getStyle(h,"paddingBottom"))||0)+(parseInt(jpf.getStyle(h,"borderTopWidth"))||0)+(parseInt(jpf.getStyle(h,"borderBottomWidth"))||0));};jpf.getDiff=function(h){return[Math.max(0,(parseInt(jpf.getStyle(h,"paddingLeft"))||0)+(parseInt(jpf.getStyle(h,"paddingRight"))||0)+(parseInt(jpf.getStyle(h,"borderLeftWidth"))||0)+(parseInt(jpf.getStyle(h,"borderRightWidth"))||0)),Math.max(0,(parseInt(jpf.getStyle(h,"paddingTop"))||0)+(parseInt(jpf.getStyle(h,"paddingBottom"))||0)+(parseInt(jpf.getStyle(h,"borderTopWidth"))||0)+(parseInt(jpf.getStyle(h,"borderBottomWidth"))||0))];};jpf.importClass(jpf.runXpath,true,self);};jpf.runGecko=function(){if(jpf.runNonIe){jpf.runNonIe();}HTMLDocument.prototype.selectNodes=XMLDocument.prototype.selectNodes=function(h,c){var q=this.evaluate(h,(c||this),this.createNSResolver(this.documentElement),7,null);var m=new Array(q.snapshotLength);m.expr=h;for(var n=m.length-1;n>=0;n--){m[n]=q.snapshotItem(n);}return m;};Element.prototype.selectNodes=function(c){return this.ownerDocument.selectNodes(c,this);};HTMLDocument.prototype.selectSingleNode=XMLDocument.prototype.selectSingleNode=function(h,c){var m=this.selectNodes(h+"[1]",c||null);return m[0]||null;};Element.prototype.selectSingleNode=function(c){return this.ownerDocument.selectSingleNode(c,this);};function a(c,h){this.message=h;this.nr=c;}};jpf.runSafari=function(){if(!jpf.isChrome){var c=window.setTimeout;lookupSafariCall=[];window.setTimeout=function(h,m){if(typeof h=="string"){return c(h,m);}return c("lookupSafariCall["+(lookupSafariCall.push(h)-1)+"]()",m);};if(jpf.isSafariOld){HTMLHtmlElement=document.createElement("html").constructor;Node=HTMLElement={};HTMLElement.prototype=HTMLHtmlElement.__proto__.__proto__;HTMLDocument=Document=document.constructor;var a=new DOMParser();XMLDocument=a.constructor;Element=a.parseFromString("<Single />","text/xml").documentElement.constructor;a=null;}if(!XMLDocument.__defineGetter__){Document.prototype.serialize=Node.prototype.serialize=XMLDocument.prototype.serialize=function(){return(new XMLSerializer()).serializeToString(this);};}}if(jpf.isSafariOld||jpf.isSafari||jpf.isChrome){HTMLDocument.prototype.selectNodes=XMLDocument.prototype.selectNodes=function(m,h){return jpf.XPath.selectNodes(m,h||this);};Element.prototype.selectNodes=function(m,h){return jpf.XPath.selectNodes(m,h||this);};HTMLDocument.prototype.selectSingleNode=XMLDocument.prototype.selectSingleNode=function(m,h){return jpf.XPath.selectNodes(m,h||this)[0];};Element.prototype.selectSingleNode=function(m,h){return jpf.XPath.selectNodes(m,h||this)[0];};jpf.importClass(jpf.runXpath,true,self);jpf.importClass(jpf.runXslt,true,self);}if(jpf.runNonIe){jpf.runNonIe();}};jpf.runOpera=function(){var a=new DOMParser();XMLDocument=DOMParser.constructor;a=null;Node.prototype.serialize=XMLDocument.prototype.serialize=Element.prototype.serialize=function(){return(new XMLSerializer()).serializeToString(this);};Document.prototype.selectNodes=XMLDocument.prototype.selectNodes=HTMLDocument.prototype.selectNodes=function(h,c){var q=this.evaluate(h,(c?c:this),this.createNSResolver(this.documentElement),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var m=new Array(q.snapshotLength);m.expr=h;for(var n=0;n<m.length;n++){m[n]=q.snapshotItem(n);}return m;};Element.prototype.selectNodes=function(c){var h=this.ownerDocument;if(!h.selectSingleNode){h.selectSingleNode=HTMLDocument.prototype.selectSingleNode;h.selectNodes=HTMLDocument.prototype.selectNodes;}if(h.selectNodes){return h.selectNodes(c,this);}else{throw new Error(jpf.formatErrorString(1047,null,"XPath Selection","Method selectNodes is only supported by XML Nodes"));}};Document.prototype.selectSingleNode=XMLDocument.prototype.selectSingleNode=HTMLDocument.prototype.selectSingleNode=function(h,c){var m=this.selectNodes(h+"[1]",c?c:null);return m.length>0?m[0]:null;};Element.prototype.selectSingleNode=function(c){var h=this.ownerDocument;if(!h.selectSingleNode){h.selectSingleNode=HTMLDocument.prototype.selectSingleNode;h.selectNodes=HTMLDocument.prototype.selectNodes;}if(h.selectSingleNode){return h.selectSingleNode(c,this);}else{throw new Error(jpf.formatErrorString(1048,null,"XPath Selection","Method selectSingleNode is only supported by XML Nodes. \nInfo : "+e));}};if(jpf.runNonIe){jpf.runNonIe();}};jpf.tween={left:function(c,a){c.style.left=a+"px";},right:function(c,a){c.style.left="";c.style.right=a+"px";},top:function(c,a){c.style.top=a+"px";},bottom:function(c,a){c.style.top="";c.style.bottom=a+"px";},width:function(h,c,a){h.style.width=c+"px";},height:function(h,c,a){h.style.height=c+"px";},scrollTop:function(h,c,a){h.scrollTop=c;},"height-rsz":function(h,c,a){h.style.height=c+"px";if(jpf.hasSingleResizeEvent){window.onresize();}},mwidth:function(c,a,m){var h=jpf.getDiff(c);c.style.width=a+"px";c.style.marginLeft=-1*(a/2+(parseInt(jpf.getStyle(c,"borderLeftWidth"))||h[0]/2)+(m.margin||0))+"px";},mheight:function(c,a,m){var h=jpf.getDiff(c);c.style.height=a+"px";c.style.marginTop=(-1*a/2-(parseInt(jpf.getStyle(c,"borderTopWidth"))||h[1]/2)+(m.margin||0))+"px";},scrollwidth:function(c,a){c.style.width=a+"px";c.scrollLeft=c.scrollWidth;},scrollheight_old:function(c,a){try{c.style.height=a+"px";c.scrollTop=c.scrollHeight;}catch(h){alert(a);}},scrollheight:function(h,c,n){var m=jpf.getHeightDiff(h),a=n.oInt||h;h.style.height=c+"px";a.scrollTop=a.scrollHeight-a.offsetHeight-m;},scrolltop:function(c,a){c.style.height=a+"px";c.style.top=(-1*a-2)+"px";c.scrollTop=0;},clipright:function(h,c,a){h.style.clip="rect(auto, auto, auto, "+c+"px)";h.style.marginLeft=(-1*c)+"px";},fade:function(c,a){if(jpf.hasStyleFilters){c.style.filter="alpha(opacity="+parseInt(a*100)+")";}else{c.style.opacity=a;}},bgcolor:function(c,a){c.style.backgroundColor=a;},textcolor:function(c,a){c.style.color=a;},htmlcss:function(c,a,h){if(jpf.hasStyleFilters&&h.type=="filter"){c.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+a+")";}else{c.style[h.type]=a+(h.needsPx?"px":"");}},NORMAL:0,EASEIN:1,EASEOUT:2,CSSTIMING:["linear","ease-in","ease-out","ease","ease-in-out","cubic-bezier"],CSSPROPS:{left:"left",right:"right",top:"top",bottom:"bottom",width:"width",height:"height",scrollTop:false,mwidth:false,mheight:false,scrollwidth:false,scrollheight:false,fade:"opacity",bgcolor:"background-color",textcolor:"color"},queue:{},current:null,setQueue:function(a,c){if(!a.getAttribute("id")){jpf.setUniqueHtmlId(a);}if(!this.queue[a.getAttribute("id")]){this.queue[a.getAttribute("id")]=[];}this.queue[a.getAttribute("id")].push(c);if(this.queue[a.getAttribute("id")].length==1){c(0);}},nextQueue:function(c){var a=this.queue[c.getAttribute("id")];if(!a){return;}a.shift();if(a.length){a[0](0);}},clearQueue:function(h,a){var c=this.queue[h.getAttribute("id")];if(!c){return;}if(a&&this.current&&this.current.control){this.current.control.stop=true;}c.length=0;},$calcSteps:function(q,a,n,s){var h,u;var t=[a];var c=0;var m=(n-a)/((Math.pow(s,2)+2*s+1)/(4*s));for(h=0;h<s;h++){if(!q&&!u){u=(n-a)/s;}else{if(q==1){u=m*Math.pow(((s-h))/s,3);}else{if(q==2){u=m*Math.pow(h/s,3);}}}t.push(t[t.length-1]+u);}t[t.length-1]=n;return t;},$calcColorSteps:function(s,t,h,c){var q,m,n=[t,h];for(q=0;q<2;q++){if(n[q].match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/)){n[q]=[parseInt(RegExp.$1),parseInt(RegExp.$2),parseInt(RegExp.$3)];continue;}n[q]=n[q].replace(/^#/,"");if(n[q].length==3){n[q]+=n[q];}n[q]=[Math.hexToDec(n[q].substr(0,2)),Math.hexToDec(n[q].substr(2,2)),Math.hexToDec(n[q].substr(4,2))];}var a=[jpf.tween.$calcSteps(s,n[0][0],n[1][0],c),jpf.tween.$calcSteps(s,n[0][1],n[1][1],c),jpf.tween.$calcSteps(s,n[0][2],n[1][2],c)];for(m=[],q=0;q<a[0].length;q++){m.push("#"+Math.decToHex(a[0][q])+Math.decToHex(a[1][q])+Math.decToHex(a[2][q]));}return m;},single:function(n,q){q=jpf.extend({steps:3,interval:20,anim:jpf.tween.NORMAL,control:{}},q);if(n.nodeFunc>100){q.oInt=n.oInt;n=n.oExt;}if("fixed|absolute|relative".indexOf(jpf.getStyle(n,"position"))==-1){n.style.position="relative";}var m=(jpf.supportCSSAnim&&jpf.tween.CSSPROPS[q.type]);q.method=m?q.type:jpf.tween[q.type];if(m){var h=jpf.tween.CSSPROPS[q.type];if(h===false){return this;}q.type=h||q.type;n.style[q.type]=q.from+(jpf.tween.needsPix[q.type]?"px":"");setTimeout(function(){n.style[q.type]=q.to+(jpf.tween.needsPix[q.type]?"px":"");n.style.webkitTransition=q.type+" "+((q.steps*q.interval)/1000)+"s "+jpf.tween.CSSTIMING[q.anim||0];var t=function(){if(q.onfinish){q.onfinish(n,q.userdata);}n.style.webkitTransition="";n.removeEventListener("webkitTransitionEnd",t);};n.addEventListener("webkitTransitionEnd",t);});return this;}var c=q.color?jpf.tween.$calcColorSteps(q.anim,q.from,q.to,q.steps):jpf.tween.$calcSteps(q.anim,parseFloat(q.from),parseFloat(q.to),q.steps);var a=this;var s=function(t){a.current=q;if(q.control&&q.control.stop){q.control.stop=false;jpf.tween.clearQueue(n);return;}try{q.method(n,c[t],q);}catch(u){}if(q.oneach){q.oneach(n,q.userdata);}if(t<q.steps){timer=setTimeout(function(){s(t+1);},q.interval);}else{a.current=null;if(q.control){q.control.stopped=true;}if(q.onfinish){q.onfinish(n,q.userdata);}jpf.tween.nextQueue(n);}};this.setQueue(n,s);return this;},multi:function(m,D){D=jpf.extend({steps:3,interval:20,anim:jpf.tween.NORMAL,control:{}},D);if(m.nodeFunc>100){D.oInt=m.oInt;m=m.oExt;}var u=jpf.supportCSSAnim,t=false,a=((D.steps*D.interval)/1000),c=jpf.tween.CSSTIMING[D.anim||0];for(var B=[],w=[],A=0;A<D.tweens.length;A++){var E=D.tweens[A];u=(jpf.supportCSSAnim&&jpf.tween.CSSPROPS[E.type]);E.method=u?E.type:jpf.tween[E.type]||jpf.tween.htmlcss;if(u){var h=jpf.tween.CSSPROPS[E.type];E.type=h||E.type;m.style[E.type]=E.from+(jpf.tween.needsPix[E.type]?"px":"");w.push([E.type,E.to+(jpf.tween.needsPix[E.type]?"px":"")]);B.push(E.type+" "+a+"s "+c+" 0");t=true;}else{B.push(E.color?jpf.tween.$calcColorSteps(D.anim,E.from,E.to,D.steps):jpf.tween.$calcSteps(D.anim,parseFloat(E.from),parseFloat(E.to),D.steps));}}if(t){m.style.webkitTransition=B.join(",");var q=0,C=function(){q++;if(q==w.length){if(D.onfinish){D.onfinish(m,D.userdata);}m.style.webkitTransition="";m.removeEventListener("webkitTransitionEnd",C);}};m.addEventListener("webkitTransitionEnd",C);for(var y=0,z=w.length;y<z;y++){m.style[w[y][0]]=w[y][1];}return this;}var v=D.tweens;var n=this;var s=function(G){n.current=D;if(D.control&&D.control.stop){D.control.stop=false;return;}try{for(var F=0;F<B.length;F++){v[F].method(v[F].oHtml||m,B[F][G],v[F]);}}catch(H){}if(D.oneach){D.oneach(m,D.userdata);}if(G<D.steps){timer=setTimeout(function(){s(G+1);},D.interval);}else{n.current=null;if(D.control){D.control.stopped=true;}if(D.onfinish){D.onfinish(m,D.userdata);}jpf.tween.nextQueue(m);}};this.setQueue(m,s);return this;},css:function(c,v,h,t){(h=h||{}).tweens=[];if(c.nodeFunc>100){c=c.oExt;}if(t){jpf.setStyleClass(c,"",[v]);}var z=h.onfinish;h.onfinish=function(){if(t){jpf.setStyleClass(c,"",[v]);}else{jpf.setStyleClass(c,v);}for(var B=0;B<h.tweens.length;B++){if(h.tweens[B].type=="filter"){continue;}c.style[h.tweens[B].type]="";}if(z){z.apply(this,arguments);}};var A,n,u,q,m,a,y,s;for(s=0;s<document.styleSheets.length;s++){y=document.styleSheets[s][jpf.styleSheetRules];for(q=0;q<y.length;q++){var w=y[q];if(!w.style||!w.selectorText.match("."+v+"$")){continue;}for(a in w.style){if(!w.style[a]||this.cssProps.indexOf("|"+a+"|")==-1){continue;}if(a=="filter"){if(!w.style[a].match(/opacity\=([\d\.]+)/)){continue;}n=RegExp.$1;A=(jpf.getStyleRecur(c,a)||"").match(/opacity\=([\d\.]+)/);u=A?RegExp.$1:100;m=false;if(n==u){if(t){u=100;}else{n=100;}}}else{n=t&&c.style[a]||w.style[a];if(t){c.style[a]="";}u=jpf.getStyleRecur(c,a);m=a.match(/color/i)?true:false;}h.tweens.push({type:a,from:(m?String:parseFloat)(t?n:u),to:(m?String:parseFloat)(t?u:n),color:m,needsPx:jpf.tween.needsPix[a.toLowerCase()]||false});}}}if(t){jpf.setStyleClass(c,v);}return this.multi(c,h);},needsPix:{left:true,top:true,bottom:true,right:true,width:true,height:true,fontSize:true,lineHeight:true,textIndent:true},cssProps:"|backgroundColor|backgroundPosition|color|width|filter||height|left|top|bottom|right|fontSize||letterSpacing|lineHeight|textIndent|opacity||paddingLeft|paddingTop|paddingRight|paddingBottom||borderLeftWidth|borderTopWidth|borderRightWidth|borderBottomWidth||borderLeftColor|borderTopColor|borderRightColor|borderBottomColor||marginLeft|marginTop|marginRight|marginBottom|"};jpf.uirecorder={actionStack:[],playStack:[],isPlaying:false,isRecording:false,inited:false,init:function(){if(jpf.uirecorder.inited){return;}jpf.uirecorder.inited=true;document.documentElement.onselect=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onselect",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onchange=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onchange",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onsubmit=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onsubmit",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onreset=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onreset",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onfocus=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onfocus",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onblur=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onblur",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onclick=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onclick",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.ondblclick=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"ondblclick",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onmousedown=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onmousedown",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onmouseup=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onmouseup",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onmousemove=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onmousemove",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onmouseover=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onmouseover",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onmouseout=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onmouseout",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onkeyup=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onkeyup",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onkeydown=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onkeydown",c.srcElement||c.target,jpf.extend({},c)]);};document.documentElement.onkeypress=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onkeypress",c.srcElement||c.target,jpf.extend({},c)]);};var a=["DOMSubtreeModified","DOMNodeInserted","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","DOMAttrModified","DOMCharacterDataModified","DOMActivate"];if(document.addEventListener){document.addEventListener("DOMMouseScroll",function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"DOMMouseScroll",c.target,jpf.extend({},jpf.uirecorder.createMouseWheelEvent(c))]);},false);}else{document.onmousewheel=function(c){if(jpf.uirecorder.isPlaying||!jpf.uirecorder.isRecording){return;}c=c||event;jpf.uirecorder.actionStack.push([new Date().getTime(),"onmousewheel",c.srcElement,jpf.extend({},jpf.uirecorder.createMouseWheelEvent(c))]);};}},createMouseWheelEvent:function(a){var c=null;if(a.wheelDelta){c=a.wheelDelta/120;if(jpf.isOpera){c*=-1;}}else{if(a.detail){c=-a.detail/3;}}return{type:jpf.isGecko?"DOMMouseScroll":(jpf.isIE?"mousewheel":"DOMMouseScroll"),delta:c};},record:function(){jpf.uirecorder.isRecording=true;jpf.uirecorder.init();},play:function(){jpf.uirecorder.isRecording=false;jpf.uirecorder.isPlaying=true;jpf.uirecorder.playStack=jpf.uirecorder.actionStack.slice(0);if(jpf.uirecorder.playStack.length){playFrame();}},stop:function(){jpf.uirecorder.isRecording=false;jpf.uirecorder.isPlaying=false;},reset:function(){jpf.uirecorder.isRecording=false;jpf.uirecorder.isPlaying=false;jpf.uirecorder.playStack=[];jpf.uirecorder.actionStack=[];}};var timeout;function playFrame(){var n=jpf.uirecorder.playStack.shift();if(!n||!jpf.uirecorder.isPlaying){return;}var h=n[0];var a=false;var m=n[3],c;if(jpf.isIE){c=document.createEventObject();for(prop in n[3]){if(n[3][prop]){c[prop]=n[3][prop];}}c.target=n[2];switch(m.type){case"mousewheel":fireScroll(n);break;default:n[2].fireEvent(n[1],c);break;}}else{switch(m.type){case"mousemove":case"mouseup":case"mousedown":case"click":case"dblclick":case"mouseover":case"mouseout":c=document.createEvent("MouseEvents");c.initMouseEvent(m.type,m.bubbles,m.cancelable,m.view,m.detail,m.screenX,m.screenY,m.clientX,m.clientY,m.ctrlKey,m.altKey,m.shiftKey,m.metaKey,m.button,m.relatedTarget);jpf.event.layerX=m.layerX;jpf.event.layerY=m.layerY;break;case"keyup":case"keydown":case"keypress":c=document.createEvent("KeyboardEvent");c.initKeyEvent(m.type,m.bubbles,true,window,m.ctrlKey,m.altKey,m.shiftKey,m.metaKey,m.keyCode,m.charCode);break;case"select":case"change":case"submit":case"reset":c=document.createEvent("HTMLEvents");c.initEvent(m.type,m.bubbles,m.cancelable);break;case"DOMActivate":case"resize":case"focus":case"blur":c=document.createEvent("UIEvents");c.initUIEvent(m.type,m.bubbles,m.cancelable,c.view,c.detail);break;case"DOMMouseScroll":fireScroll(n);a=true;break;default:jpf.console.info("default: "+m.type);a=true;break;}if(!a){n[2].dispatchEvent(c);}}if(jpf.uirecorder.playStack.length&&jpf.uirecorder.isPlaying){timeout=setTimeout(function(){playFrame();},jpf.uirecorder.playStack[0][0]-h);}else{jpf.uirecorder.stop();clearInterval(timeout);}}function fireScroll(c){var a=c[2];while(a!=document.body&&a.scrollHeight==a.offsetHeight){a=a.parentNode||a.parentElement;}a.scrollTop=a.scrollTop-(jpf.isGecko?39:(jpf.isChrome?120:(jpf.isIE?Math.round(a.offsetHeight/6.73):20)))*c[3].delta;}jpf.printer={tagName:"printer",nodeFunc:jpf.NODE_HIDDEN,lastContent:"",inited:false,init:function(jml){this.inited=true;this.$jml=jml;this.contentShower=document.body.appendChild(document.createElement("DIV"));this.contentShower.id="print_content";with(this.contentShower.style){width="100%";height="100%";backgroundColor="white";zIndex=100000000;}jpf.importCssString(document,"#print_content{display:none}");jpf.importCssString(document,(jpf.hasCSSChildOfSelector?"body #print_content{display:block} body>*{display:none}":"body #print_content, body #print_content *{display:block} body *{display:none}"),"print");if(jml){var a,i,attr=jml.attributes;for(i=0;i<attr.length;i++){a=attr[i];if(a.nodeName.indexOf("on")==0){jpf.addEventListener(a.nodeName,new Function(a.nodeValue));}}}window.onbeforeprint=function(){jpf.dispatchEvent("beforeprint");};window.onafterprint=function(){jpf.dispatchEvent("afterprint");};},preview:function(a){if(!this.inited){this.init();}if(typeof a!="string"){a=a.outerHTML||a.xml||a.serialize();}this.lastContent=a;this.contentShower.innerHTML=a;}};jpf.print=function(a){if(!jpf.printer.inited){jpf.printer.init();}jpf.printer.preview(a);window.print();};jpf.namespace("draw",{initDriver:function(){if(!this.initLayer){var a,c=jpf.supportVML?jpf.draw.vml:jpf.draw.canvas;for(a in c){this[a]=c[a];}}},basevars:function(){return["var  _math_,v,t=0,n=(new Date()).getTime()*0.001",",e=Math.E, p=Math.PI, p2=2*p, p12=0.5*p",",x, y, z, _x,_y,_z, zt, i, j, k, _opt_;"].join("");},vars:function(m,a,c,h){return["var  _math_,vx1 = v.vx1, vy1 = v.vy1,_rseed=1",",vx2 = v.vx2, vy2 = v.vy2, vw = vx2-vx1, vh = vy1-vy2",",vz2 = v.vz2, vz1 = v.vz1, vd = vz2-vz1",",zoom = 1/v.zoom",",a=l.a,b=l.b,c=l.c,d=l.d",",dw = l.dw",m?"-"+(m+c):"",",dh = l.dh",a?"-"+(a+h):"",",dw12 = dw*0.5, dh12 = dh*0.5",",dx = ",m?m:0,",dy = ",a?a:0,",mx = m&&m.x, my = m&&m.y",",db = dy+dh, dr = dx+dw",",tw = dw/vw, th = dh/vh, ty = -vy2*th+dy, tx = -vx1*tw+dx",",v,t=0,n=(new Date()).getTime()*0.001, dt=-(l._n?l._n:n)+(l._n=n), z = 1/l.zoom",",e=Math.E, p=Math.PI, p2=2*p, p12=0.5*p",",x, y, z, _x,_y,_z, zt, i, j, k, _opt_;"].join("");},defCamVec:function(){return"var inv=1/m00*(m11*m22-m12*m21)-m01*(m10*m22-m12*m20)+m02*(m10*m21-m11*m20);var mcx = inv*(m11*m22-m12*m21)*m03 + inv*(m02*m21-m01*m22)*m13 + inv*(m01*m12-m02*m11)*m23,    mcy = inv*(m12*m20-m10*m22)*m03 + inv*(m00*m22-m02*m20)*m13 + inv*(m02*m10-m00*m12)*m23,    mcz = inv*(m10*m21-m11*m20)*m03 + inv*(m01*m20-m00*m21)*m13 + inv*(m00*m11-m01*m10)*m23;";},setMatrix3D:function(a){var c=this.l;var h=["var m00=",a[0],",m01=",a[1],",m02=",a[2],",m03=",a[3],",m10=",a[4],",m11=",a[5],",m12=",a[6],",m13=",a[7],",m20=",a[8],",m21=",a[9],",m22=",a[10],",m23=",a[11],";"];if(c.perspective<0){this.ortho=1;h.push("var persp = dw / v.perspective/-v.tz, perspd = persp / ",c.ds,";");}else{this.ortho=0;h.push("var persp = dw / v.perspective, perspd = persp / ",c.ds,";");}return h.join("");},sincos3:function(m,h,c,a){return["var ",m,"cx = __cos(",h,"),",m,"sx = __sin(",h,"),",m,"cy = __cos(",c,"),",m,"sy = __sin(",c,"),",m,"cz = __cos(",a,"),",m,"sz = __sin(",a,");"].join("");},matrix4S:function(h,c,a){return[h,0,0,0,0,c,0,0,0,0,a,0,0,0,0,1];},matrix4T:function(c,a,h){return[1,0,0,c,0,1,0,a,0,0,1,h,0,0,0,1];},matrix4RP:function(a){return this.matrix4R(a+"cx",a+"sx",a+"cy",a+"sy",a+"cz",a+"sz");},matrix4R:function(a,q,n,m,h,c){return[[n,"*",h].join(""),["(-",c,"*",n,")"].join(""),m,0,["(",h,"*",q,"*",m,"+",c,"*",a,")"].join(""),["(-",q,"*",m,"*",c,"+",a,"*",h,")"].join(""),["(-",q,"*",n,")"].join(""),0,["(-",a,"*",m,"*",h,"+",q,"*",c,")"].join(""),["(",a,"*",m,"*",c,"+",h,"*",q,")"].join(""),["(",a,"*",n,")"].join(""),0,0,0,0,1];},matrixMul:function(){var a=arguments[arguments.length-1];for(var c=arguments.length-2;c>=0;c--){a=this.matrixAB(a,arguments[c]);}return a;},matrixAB:function(s,q){var c=[],u,n,m,h,z,w;for(n=0;n<16;n+=4){for(u=0;u<4;u++){w=[];if((m=s[n])&&(h=q[u])){w[w.length]=m==1?h:(h==1?m:(m+"*"+h));}if((m=s[n+1])&&(h=q[u+4])){w[w.length]=m==1?h:(h==1?m:(m+"*"+h));}if((m=s[n+2])&&(h=q[u+8])){w[w.length]=m==1?h:(h==1?m:(m+"*"+h));}if((m=s[n+3])&&(h=q[u+12])){w[w.length]=m==1?h:(h==1?m:(m+"*"+h));}c[c.length]=w.length?((w.length>1)?"("+w.join("+")+")":w[0]):0;}}return c;},backface3D:function(w,u,v){var s=w[0],q=w[1],m=w[2],t=0,n=1,h=2;if(u){t=u[0],n=u[1],h=u[2];}return this.ortho?["-((m00*",q[t],"+m01*",q[n],"+m02*",q[h],"+m03)-(__ax=m00*",s[t],"+m01*",s[n],"+m02*",s[h],"+m03))*","((m10*",m[t],"+m11*",m[n],"+m12*",m[h],"+m13)-(__ay=m10*",s[t],"+m11*",s[n],"+m12*",s[h],"+m13))+","((m10*",q[t],"+m11*",q[n],"+m12*",q[h],"+m13)-__ay)*((m00*",m[t],"+m01*",m[n],"+m02*",m[h],"+m03)-__ax)"].join(""):["(((__by=m10*",q[t],"+m11*",q[n],"+m12*",q[h],"+m13) - (__ay=m10*",s[t],"+m11*",s[n],"+m12*",s[h],"+m13)) *","((__cz=m20*",m[t],"+m21*",m[n],"+m22*",m[h],"+m23) - (__az=m20*",s[t],"+m21*",s[n],"+m22*",s[h],"+m23)) -","((__bz=m20*",q[t],"+m21*",q[n],"+m22*",q[h],"+m23) - __az) * ((__cy=m10*",m[t],"+m11*",m[n],"+m12*",m[h],"+m13) - __ay) ) * ","(__ax=m00*",s[t],"+m01*",s[n],"+m02*",s[h],"+m03) + ","((__bz - __az) * ((__cx=m00*",m[t],"+m01*",m[n],"+m02*",m[h],"+m03) - __ax) -","((__bx=m00*",q[t],"+m01*",q[n],"+m02*",q[h],"+m03) - __ax) * (__cz - __az) ) * __ay + ","((__bx - __ax) * (__cy - __ay) - (__by - __ay) * (__cx - __ax) ) * __az "].join("");},text3D:function(E,c,n,u){var G=0,H,F,C,v=["__n=0;"],t=0,m=1,h=2,A,w,D,B,I,a;if(c){t=c[0],m=c[1],h=c[2];}return["if((__z = m20*",E[t],"+m21*",E[m],"+m22*",E[h],"+m23) < ",n,"){",this.text(["dw12+(m00*",E[t],"+m01*",E[m],"+m02*",E[h],"+m03)*",this.ortho?"persp":"(persp/__z)"].join(""),["dh12+(m10*",E[t],"+m11*",E[m],"+m12*",E[h],"+m13)*",this.ortho?"persp":"(persp/__z)"].join(""),u),"}"].join("");},poly3DClip:function(w,F,c,n,u){var G=0,H,F,D,v=["__n=0;"],t=0,m=1,h=2,B,A,E,C,I,a;if(c){t=c[0],m=c[1],h=c[2];}for(var G=0;G<w.length;G++){p=F[w[G]];v.push(["if(__n",G,"=(__z",G," = m20*",p[t],"+m21*",p[m],"+m22*",p[h],"+m23) < ",n,")__n++;"].join(""));}v.push("if(__n){","if(__n==",w.length,"){");for(var G=0;G<w.length;G++){p=F[w[G]];E=["dw12+(m00*",p[t],"+m01*",p[m],"+m02*",p[h],"+m03)*",this.ortho?"persp":"(persp/__z"+G+")"].join("");C=["dh12+(m10*",p[t],"+m11*",p[m],"+m12*",p[h],"+m13)*",this.ortho?"persp":"(persp/__z"+G+")"].join("");if(G==0){v.push(this.moveTo(E,C));}else{v.push(this.lineTo(E,C));}}if(!u){v.push(this.close());}v.push("}else{");for(var G=0;G<w.length;G++){p=F[w[G]];if(G==0){v.push(["__x0=m00*",p[t],"+m01*",p[m],"+m02*",p[h],"+m03;","__y0=m10*",p[t],"+m11*",p[m],"+m12*",p[h],"+m13;","if( __o=__n0){",this.moveTo("dw12+__x0*"+(this.ortho?"persp":"(persp/__z0)"),"dh12+__y0*"+(this.ortho?"persp":"(persp/__z0)")),"}"].join(""));}else{v.push(["__xn=dw12+(__x",G,"=m00*",p[t],"+m01*",p[m],"+m02*",p[h],"+m03)*",(this.ortho?"persp;":"(persp/__z"+G+");"),"__yn=dh12+(__y",G,"=m10*",p[t],"+m11*",p[m],"+m12*",p[h],"+m13)*",(this.ortho?"persp;":"(persp/__z"+G+");"),"if( __n",G," && !__n",G-1," || !__n",G,"&& __n",G-1,"){","__z=(__zc=(",n,"-__z",G-1,")/(__z",G,"-__z",G-1,")) * __z",G,"+(__ze=1-__zc)* __z",G-1,";","__xi=dw12+(__zc*__x",G,"+__ze* __x",G-1,")*",(this.ortho?"persp":"(persp/__z)"),";","__yi=dh12+(__zc*__y",G,"+__ze* __y",G-1,")*",(this.ortho?"persp":"(persp/__z)"),";","if(!__o){__o=true;",this.moveTo("__xi","__yi"),"}else{",this.lineTo("__xi","__yi"),"}","}","if( __n",G,"){",this.lineTo("__xn","__yn"),"}"].join(""));}if(G==w.length-1){v.push(["if(!__n0 && __n",G," || __n0 && ! __n",G,"){","__z=(__zc=(",n,"-__z",G,")/(__z0-__z",G,")) * __z0+(__ze=1-__zc)* __z",G,";",this.lineTo(["dw12+(__zc*__x0+__ze* __x",G,")*",(this.ortho?"persp":"(persp/__z)")].join(""),["dh12+(__zc*__y0+__ze* __y",G,")*",(this.ortho?"persp":"(persp/__z)")].join("")),"}",u?"":this.close()].join(""));}}v.push("}};");return v.join("").replace(/m\d\d\*\(?0\)?\+/g,"");},poly3D:function(C,F,A){var B,y=1,w,t=0,z,E,a,D=[],h=new Array(F.length),c=new Array(F.length),u,n,m;if(A){u=A[0],n=A[1],m=A[2];}else{u=0,n=1,m=2;}for(w=0;w<C.length;w++){z=C[w];if(z>=0){h[z]++;}}for(w=0;w<F.length;w++){if(h[w]>1){h[w]=t++;}else{h[w]=0;}}for(var w=0;w<C.length;w++){z=C[w];if(z>=0){E=F[z];a=[this.ortho?"":"zt = persp / (m20*"+E[u]+"+m21*"+E[n]+"+m22*"+E[m]+"+m23);","dw12+(m00*"+E[u]+"+m01*"+E[n]+"+m02*"+E[m]+"+m03)*"+(this.ortho?"persp":"zt"),"dh12+(m10*"+E[u]+"+m11*"+E[n]+"+m12*"+E[m]+"+m13)*"+(this.ortho?"persp":"zt")];z=y?0:w;if(h[z]){a[1]="__t"+h[z]+(c[z]?"":"="+a[1]),a[2]="__t"+h[z]+(c[z]++?"":"="+a[2]);}}switch(z){case -1:y=1;D.push(this.close());break;case 0:y=0;D.push(a[0],this.moveTo(a[1],a[2]));break;case C.length-1:D.push(a[0],this.lineTo(a[1],a[2]),this.close());break;default:D.push(a[0],this.lineTo(a[1],a[2]));break;}}return D.join("").replace(/m\d\d\*\(?0\)?\+/g,"");},lineTo3D:function(a,q,m,n,h,c){return this.$do3D("lineTo",a,q,m,n,h,c);},moveTo3D:function(a,q,m,n,h,c){return this.$do3D("moveTo",a,q,m,n,h,c);},$store3D:function(a,c){return a+";"+c+";";},store3D:function(a,q,m,n,h,c){return this.$do3D("$store3D",a,q,m,n,h,c);},$do3D:function(c,w,q,n,u,s,B){var t,m,h;if(typeof w=="string"&&w.match(/[\[\]\*\+\-\/]/)){w="(_x="+w+")",t="_x";}else{w="("+w+")",t=w;}if(typeof q=="string"&&q.match(/[\[\]\*\+\-\/]/)){q="(_y="+q+")",m="_y";}else{q="("+q+")",m=q;}if(typeof n=="string"&&n.match(/[\[\]\*\+\-\/]/)){n="(_z="+n+")",h="_z";}else{n="("+n+")",h=n;}if(B){var C=[w,q,n],A=[t,m,h];w=C[t=B[0]],q=C[m=B[1]],n=C[h=B[2]];t=A[t],m=A[m],h=A[h];}var a=[];if(!this.ortho){a.push("zt =persp/(m20*"+w+"+m21*"+q+"+m22*"+n+"+m23);");}a.push(this[c]((u===undefined?"":u)+"dw12+(m00*"+t+"+m01*"+m+"+m02*"+h+"+m03)*"+(this.ortho?"persp":"zt"),(s===undefined?"":s)+"dh12+(m10*"+t+"+m11*"+m+"+m12*"+h+"+m13)*"+(this.ortho?"persp":"zt")));return a.join("").replace(/m\d\d\*\(?0\)?\+/g,"");},parseStyle:function(n,y,u){var c={},m,C,w,G,F,z;var A=this;if(!(F=A.stateTransition)[262145]){G={};for(C in F){for(z=0;z<32;z++){G[C|z]=F[C]|z;}}A.stateTransition=G;}y=y?this.parseJSS(y.item?y.join(""):y,u):{};function D(M,L,J){var I,H,s,K;for(H in L){if(M[H]===undefined){M[H]=A.isDynamic(s=L[H])?A.parseJSS(s):s;}}if(I=L.inherit){D(M,n[I]||A["$"+I],I);}if(K=y[J]){for(H in K){M[H]=K[H];}}}for(w in n){if(typeof(C=n[w])=="object"&&C!==null&&C["$"]==1){D(c[w]={},C,w);}}function q(M,t,L,J){var K,I,H;do{if(!L&&!J){K=c[t];}else{K=y[t+(L?"."+L:"")+(J?":"+J:"")];}if(typeof(K)=="object"){for(H in K){if(H.indexOf("$")==-1&&M[H]===undefined){M[H]=K[H];}}}if(J){J=A.$stateInherit[I];}}while(J);}for(w in y){if(typeof(C=y[w])=="object"){F=w.match(/([\w\_-]+)\.?([\w\_-]+)?\:?([\w\_-]+)?/);var h=F[1],E=F[2],a=F[3];if(E||a){m=c[w]={};if(a){if(E){q(m,h,E,a);}q(m,h,0,a);}if(E){q(m,h,E,0);}q(m,h,0,0);m.$base=G=c[h];if(!(F=G.$cls)){F=G.$cls={};}F[E]=1;}}}logw(jpf.dump(c));function B(s){if(s.line===null||s.line=="null"||s.line==0){delete s.line;}if(s.fill===null||s.fill=="null"||s.fill==0){delete s.fill;}if(s.family===null||s.family=="null"||s.family==0){delete s.family;}if((s.isshape&&s.fill===undefined&&s.line===undefined&&s.tile===undefined)||(s.isfont&&s.family===undefined)){return false;}if(s.isshape){s.alpha=s.alpha!==undefined?s.alpha:1;s.fillalpha=s.fillalpha!==undefined?s.fillalpha:s.alpha;s.gradalpha=s.gradalpha!==undefined?s.gradalpha:s.fillalpha;s.linealpha=s.linealpha!==undefined?s.linealpha:s.alpha;s.angle=s.angle!==undefined?s.angle:0;s.weight=s.weight!==undefined?s.weight:1;}return true;}return c;},stateBit:{0:0,init:16777216,hidden:65536,deinit:33554432,hover:131072,"hover-in":16908288,"hover-out":33685504,select:196608,"select-in":16973824,"select-out":33751040,"select-hover":262144,"select-hover-in":17039360,"select-hover-out":33816576,animating:268763136},stateTransition:{16777216:0,33554432:65536,16908288:131072,33685504:0,16973824:196608,33751040:0,17039360:262144,33816576:196608,17104896:17104896},stateMask:{selected:16777216|8388608|2097152|1048576|524288,normal:536870912|134217728|67108864|33554432|262144,dynamic:536870912|268435456|67108864|33554432|8388608|4194304|1048576|524288|262144,hover:134217728|67108864|2097152|1048576},$stateInherit:{hidden:0,init:0,deinit:0,hover:0,"hover-in":"hover","hover-out":"hover",select:0,"select-in":"select","select-out":"select","select-hover":"hover","select-hover-in":"select-hover","select-hover-out":"select-hover",animating:0},$stateFallback:{init:1,hover:1,"hover-in":"hover","hover-out":1,select:1,"select-in":"select","select-out":1,"select-hover":"hover","select-hover-in":"select-hover","select-hover-out":"select",hidden:1},getXYWH:function(a,n,h){var c;if(!((c=this.$getXYWH_NT[n])||(n=this.$getXYWH_TN[c=n]))){return"0";}if(a==null){return"0";}if(typeof(a)=="object"){if(a.sort){return --n>=a.length?"0":((c=a[n])&&c.sort&&!h?c.join(""):c);}return(c=a[c])===undefined||n>1?"0":(c&&c.sort&&!h?c.join(""):c);}return n==1?a:"0";},$getXYWH_NT:{1:"x",2:"y",3:"z",4:"w"},$getXYWH_TN:{x:1,y:2,z:3,w:4},getTRBL:function(a,n,h){var c;if(!((c=this.$getTRBL_NT[n])||(n=this.$getTRBL_TN[c=n]))){return"0";}if(a==null){return"0";}if(typeof(a)=="object"){if(a.sort){return --n>=a.length?"0":((c=a[n])&&c.sort&&!h?c.join(""):c);}return(c=a[c])===undefined||n>1?"0":(c&&c.sort&&!h?c.join(""):c);}return n==1?a:"0";},$getTRBL_NT:{1:"t",2:"r",3:"b",4:"l"},$getTRBL_TN:{t:1,y1:1,r:2,x2:2,b:3,y2:3,l:4,x1:4},getFlat:function(a){if(typeof(a)=="object"&&a.sort){return a.join("");}return a;},getColor:function(h){if(h.match(/\(/)){return h;}if(h.match(/^#/)){return"'"+h+"'";}var c=h.toLowerCase();return(this.colors[c])?"'"+this.colors[c]+"'":h;},getX:function(h,n,q,c,m){var a;return(typeof(a=h[q+"-x"])=="undefined"&&(typeof(a=h[q])!="object"||typeof(a=a[0])=="undefined"))?(typeof(m)!="undefined"?m:""):(n+a+c);},getY:function(m,q,t,h,n,c){var a;return(typeof(a=m[t+"-y"])=="undefined"&&(typeof(a=m[t])!="object"||typeof(a=a[1])=="undefined"))?(typeof(n)!="undefined"?n:""):(q+a+h);},checkX:function(h,n,c,m){var a;return(typeof(a=h[n+"-x"])=="undefined"&&(typeof(a=h[n])!="object"||typeof(a=a[0])=="undefined"))?(typeof(m)=="undefined"?"":m):c;},checkY:function(h,n,c,m){var a;return(typeof(a=h[n+"-y"])=="undefined"&&(typeof(a=h[n])!="object"||typeof(a=a[1])=="undefined"))?(typeof(m)=="undefined"?"":m):c;},isDynamic:function(c){return c&&typeof(c)=="string"&&!(c.indexOf(".")!=-1&&c.match(/^[\s:a-zA-Z0-9\/\\\._-]+$/))&&c.match(/[\(+*\/-]/)!=null;},baseMacro:function(n){for(var c=n.length,h=0,a;h<c;h++){if(typeof(a=n[h])=="object"){n[h]=this.parseJSS(a[0]);}}var m=this.optimize([this.basevars(),n.join(""),]);return m;},optimize:function(q){var h,a,m=[],c={},t=0;if(typeof(q)=="object"){q=q.join("");}q.replace(/\_\_(\w+)/g,function(n,s){if(!c[s]){if(s.length<=2){m.push("__"+s);}else{m.push("__"+s+"=Math."+s);}c[s]=1;}});q=q.replace(/(__(\w+))\((\-?\d+\.?\d*)\)/g,function(s,u,n,v){if(u=="__round"){return Math.round(v);}return Math[n](v);});if(q.match("_rndtab")){m.push("_rndtab=jpf.draw.$rndtab");}q=m.length?q.replace(/\_math\_/,m.join(",")):q;c={},t=0,m=[];q=m.length?q.replace(/\_opt\_/,m.join(",")):q;q=q.replace(/__round\((d[wh])\)/g,"$1");return q;},parseJSS:function(B,h,D){if(!B){return{};}var q=0,I=0,z,F,G,n=0,L=[],m=[],u=[],K=[],A=[],H=[],y=D||{},a=0,C=[],c=this,E={1:"}",2:")",3:"]",4:")",5:"}"},w={"{":1,"(":2,"[":3},v=6;try{B=B.replace(/\/\*[\S\s]*?\*\/|\/\/.*?;/g,"");B.replace(/(["'])|([\w\.\_-]+\:?[\w\_-]*)\s*\{\s*|([\w\_-]+)\s*[:]+\s*|([\w\_-]+)\s*\(\s*|([({\[])|([)}\]])|(\\["'{}\[\](),;\:]|\s*[\<\>\=*+\%@&\/]\s*|\s*\-\s+)|([,\s]+)|(;)|$/g,function(s,P,N,t,R,M,T,S,U,O,Q){if(S){return s;}if(I||P){if(P&&!I){I=P;}else{if(I==P){I=0;}}return s;}if(U){K.push(B.slice(q,Q));m.push(K.join(""));q=Q+U.length,K=[];return s;}if(t){if(v>=5){v=6,a=t,q=Q+s.length;m=[],K=[];}return s;}if(R){H.push(v=4);if(Q>q){K.push(B.slice(q,Q));}A.push(K);u.push(m);L.push(n);n=R;m=[],K=[],q=Q+s.length;return s;}if(N){if(v<5){throw ({t:"JSS Error - object scope found inside macro",p:Q});}q=Q+s.length;H.push(v=5);C.push(y);y=(typeof(z=y[N])=="object")?z:(y[N]={});return s;}if(M){H.push(v=w[M]);if(v==1&&a){H.pop();q=Q+s.length;H.push(v=5);C.push(y);y=(typeof(z=y[a])=="object")?z:(y[a]={});}else{if(v==3){if(Q>q){K.push(B.slice(q,Q));}A.push(K);u.push(m);m=[],K=[],q=Q+M.length;}}return s;}if(T){if(!H.length||E[v=H.pop()]!=T){throw ({t:"JSS Error - closed "+v+" with "+T,p:Q});log();}switch(v){case 3:K.push(B.slice(q,Q));m.push(K.join(""));if(u.length!=1){(K=A.pop()).push("[",m.join(","),"]");m=u.pop();}else{A.pop();z=u.pop();K=[];for(F=0,G=m.length;F<G;F++){z.push(m[F]);}m=z;}q=Q+T.length;break;case 4:K.push(B.slice(q,Q));m.push(K.join(""));(K=A.pop()).push((z=c[n])?z.apply(c,m):m.join(","));m=u.pop(),n=L.pop(),q=Q+1;break;case 5:K.push(B.slice(q,Q));m.push(K.join(""));q=Q+T.length,K=[];if(a){y[a]=m.length>1?m:m[0];}m=[],a=null,y=C.pop();break;}if(!u.length){v=6;}return s;}if(v>=5){K.push(B.slice(q,Q));if((z=K.join("")).length){m.push(z);}q=Q+s.length,K=[];if(a){y[a]=m.length>1?m:m[0];}else{if(z&&H.length==0){y=m.length>1?m:m[0];}}m=[],a=null;}return s;});if(I){throw ({t:"JSS Error - Unclosed string found "+I,p:q});}if(H.length>0){throw ({t:"JSS Error - Unclosed object found "+H[H.length-1],p:q});}}catch(J){jpf.alert_r(J);if(h){h.v=J.p>=0?J.t+" at: "+J.p+" ->"+B.slice((z=J.p-4)<0?0:z,7)+"<-":J.t;}return null;}return y;},sin:function(c){return"__sin("+c+")";},cos:function(c){return"__cos("+c+")";},tan:function(c){return"__tan("+c+")";},asin:function(c){return"__asin("+c+")";},acos:function(c){return"__acos("+c+")";},atan:function(c){return"__atan("+c+")";},atan2:function(c){return"__atan2("+c+")";},floor:function(c){return"__floor("+c+")";},exp:function(c){return"__exp("+c+")";},log:function(c){return"__log("+c+")";},pow:function(h,c){return"__pow("+h+","+c+")";},random:function(c){return"__random("+c+")";},round:function(c){return"__round("+c+")";},sqrt:function(c){return"__sqrt("+c+")";},$pal:function(c,u){var q=["'#'+('000000'+(__round(","((__a=parseInt((__t=["];for(var m=2,a=arguments.length;m<a;m++){var h=arguments[m];q.push(m>2?",":"");if(jpf.draw.colors[h]){q.push("'",jpf.draw.colors[h],"'");}else{if(h.match(/\(/)){q.push(h);}else{if(h.match(/^#/)){q.push("'",h,"'");}else{q.push(h);}}}}q.push("])[ __floor( __c=(__f=(",u,")",c?"*"+(a-3):"",")<0?-__f:__f)%",a-2,"].slice(1),16))&0xff)","*(__d=1-(__c-__floor(__c)))","+((__b=parseInt(__t[ __ceil(__c)%",a-2,"].slice(1),16))&0xff)*(__e=1-__d) )","+(__round(__d*(__a&0xff00)+__e*(__b&0xff00))&0xff00)","+(__round(__d*(__a&0xff0000)+__e*(__b&0xff0000))&0xff0000)",").toString(16)).slice(-6)");return q.join("");},$lut:function(m,u){var t=["(["],h,q=2,c=arguments.length;for(;q<c;q++){h=arguments[q];t.push(q>2?",":"");if(typeof(h)=="string"&&h.match(/\(/)||h.match(/^['"]/)){t.push(h);}else{t.push("'",h,"'");}}t.push("])[__floor((__b=((",u,")",m?"*"+(c-3):"",")%",c-2,")<0?-__b:__b)]");return t.join("");},$lin:function(m,u){var t=["((__t=["],h,q=2,c=arguments.length;for(;q<c;q++){h=arguments[q];t.push(q>2?",":"");if(typeof(h)=="string"&&h.match(/\(/)||h.match(/^['"]/)){t.push(h);}else{t.push("'",h,"'");}}t.push("])[__floor( __c=(__f=(",u,")",m?"*"+(c-3):"",")<0?-__f:__f)%",c-2,"]","*(__d=1-(__c-__floor(__c)))","+__t[ __ceil(__c)%",c-2,"]*(__e=1-__d) )");return t.join("");},fixed:function(c,h,m){h="parseFloat(("+c+").toFixed("+h+"))";return parseInt(m)?this.nozero(c,h):h;},padded:function(c,h,m){h="("+c+").toFixed("+h+")";return parseInt(m)?this.nozero(c,h):h;},abs:function(c){if(parseFloat(c)==c){return Math.abs(c);}if(typeof(c)=="number"||c.match(/$[a-z0-9_]+^/)){return"("+c+"<0?-"+c+":"+c+")";}return"((__t="+c+")<0?-__t:__t)";},min:function(n,h){if(h===null){return n;}if(parseFloat(n)==n&&parseFloat(h)==h){return Math.min(n,h);}var m=n,s=h,c=n,q=h;if(typeof(n)=="string"&&!n.match(/$-?[a-z0-9\_]+^/)){m="(__a="+n+")",c="__a";}if(typeof(h)=="string"&&!h.match(/$-?[a-z0-9\_]+^/)){s="(__b="+h+")",q="__b";}return"(("+m+")<("+s+")?"+c+":"+q+")";},max:function(n,h){if(h===null){return n;}if(parseFloat(n)==n&&parseFloat(h)==h){return Math.max(n,h);}var m=n,s=h,c=n,q=h;if(typeof(n)=="string"&&!n.match(/$-?[a-z0-9\_]+^/)){m="(__c="+n+")",c="__c";}if(typeof(h)=="string"&&!h.match(/$-?[a-z0-9\_]+^/)){s="(__d="+h+")",q="__d";}return"(("+m+")>("+s+")?"+c+":"+q+")";},clamp:function(m,h,n){if(h===null||n==null){return m;}return this.max(this.min(m,n),h);},pal:function(){var a=Array.prototype.slice.call(arguments,0);a.unshift(1);return this.$pal.apply(this,a);},pali:function(){var a=Array.prototype.slice.call(arguments,0);a.unshift(0);return this.$pal.apply(this,a);},lin:function(){var a=Array.prototype.slice.call(arguments,0);a.unshift(1);return this.$lin.apply(this,a);},lini:function(){var a=Array.prototype.slice.call(arguments,0);a.unshift(0);return this.$lin.apply(this,a);},lut:function(){var a=Array.prototype.slice.call(arguments,0);a.unshift(1);return this.$lut.apply(this,a);},luti:function(){var a=Array.prototype.slice.call(arguments,0);a.unshift(0);return this.$lut.apply(this,a);},$rgbpack:function(h,c,a){return("#"+("000000"+(((h<0?0:(h>255?255:parseInt(h)))<<16)+((c<0?0:(c>255?255:parseInt(c)))<<8)+((a<0?0:(a>255?255:parseInt(a))))).toString(16)).slice(-6));},rgb:function(h,c,a){if(parseFloat(h)==h&&parseFloat(c)==c&&parseFloat(a)==a){return this.$rgbpack(h,c,a);}return["('#'+('000000'+(",(parseFloat(h)==h?((h<0?0:(h>255?255:parseInt(h)))<<16):"(((__t="+h+")<0?0:(__t>255?255:parseInt(__t)))<<16)"),"+",(parseFloat(c)==c?((c<0?0:(c>255?255:parseInt(c)))<<8):"(((__t="+c+")<0?0:(__t>255?255:parseInt(__t)))<<8)+"),"+",(parseFloat(a)==a?((a<0?0:(a>255?255:parseInt(a)))):"(((__t="+a+")<0?0:(__t>255?255:parseInt(__t))))"),").toString(16)).slice(-6))"].join("");},$hsvpack:function(u,t,c){var q,a=c*(1-t),w=c*(1-t*((q=Math.floor(((u<0?-u:u)%1)*6))?u-q:1-(u-q)));switch(q){case 6:case 0:return this.$rgbpack(c,w,a);case 1:return this.$rgbpack(w,c,a);case 2:return this.$rgbpack(a,c,w);case 3:return this.$rgbpack(a,w,c);case 4:return this.$rgbpack(w,a,c);default:case 5:return this.$rgbpack.rgb(c,a,w);}},hsv:function(m,c,a){if(parseFloat(r)==r&&parseFloat(g)==g&&parseFloat(b)==b){return this.$hsvpack(r,g,b);}return"jpf.draw.$hsvpack("+m+","+c+","+a+");";},rgbf:function(h,c,a){return this.rgb(parseFloat(h)==h?h*255:"255*("+h+")",parseFloat(c)==c?c*255:"255*("+c+")",parseFloat(a)==a?a*255:"255*("+a+")");},nozero:function(c,h,m){return"(("+c+")>-0.0000000001 && ("+c+")<0.0000000001)?"+(m!==undefined?m:"''")+":("+(h!==undefined?h:c)+")";},$rndtab:null,rnd:function(c){if(c){if(!this.$rndtab){var m,h=this.$rndtab=Array(256);for(m=-256;m<256;m++){h[m]=Math.random();}}return"_rndtab[__round(("+c+")*255)%255]";}return"((_rseed=(_rseed * 16807)%2147483647)/2147483647)";},ang:function(c){if(c==parseFloat(c)){return c*(Math.PI/180);}return"(("+c+")*p/180)";},snap:function(h,c){return"(__round(("+h+")/(__t=("+c+")))*__t)";},rnds:function(h,c){return this.rnd(this.snap(h,c));},tsin:function(c){return"(0.5+0.5*__sin("+c+"))";},tcos:function(c){return"(0.5+0.5*__cos("+c+"))";},usin:function(c){return"(0.5-0.5*__sin("+c+"))";},ucos:function(c){return"(0.5-0.5*__cos("+c+"))";},two:function(c){return"(0.5+0.5*("+c+"))";},fontz:function(h,c){return(-h/c)+(this.ortho?"*perspd":"*(perspd/__z)");},$equalStyle:function(h,c){if(h.isfont&&c.isfont){return h.family===c.family&&h.join===c.join&&h.height==c.height&&h.width==c.width&&h.align===c.align&&h.color===c.color&&h.size===c.size&&h.style===c.style;}if(h.isshape&&c.isshape){return h.line===c.line&&h.join===c.join&&h.weight==c.weight&&h.fill===c.fill&&h.fillalpha===c.fillalpha&&h.linealpha===c.linealpha&&h.angle===c.angle;}return false;},$shape:{isshape:true,line:null,fill:null,tilex:"(this.$tilex)",tiley:"(this.$tiley)"},$font:{isfont:true,height:12,family:"verdana",weight:"normal",color:"#00000",size:10},draw3D:function(a,s,q,c,m,n){return"";},beginMouseState:function(a,w,h,c){var B=[],m=this.l;this.mousestyle=a;this.mousethis=w;this.mousefunc=h;this.mousestates=[];var y=a.$statelist,q,n,A,z;if(!y||!y.length){return"";}y=this.mousestates=y.slice(0);if(y[0]!=a){y.unshift(a);}if(!m._mousestyles){m._mousestyles=[];}for(q=0,n=y.length;q<n;q++){z=(A=y[q])._mid=m._mousestyles.push(A)-1;if(A.$store){A.$store._mid=z;}}B.push("_s = l._mousestyles[",a._mid,"], _sh = _s.$statehash, _sp = _s.$speedhash;");return B.join("");},checkMouseState:function(w,y){var c=[],q,n,m,h=this.mousestates,u;if(!h||!h.length){for(n=2,m=arguments.length;n<m;n++){c.push(arguments[n]);}c.push(true);this.style=this.mousestyle;u=this.mousefunc.apply(this.mousethis,c);this.style=0;return u;}u=["t=(n-",y,")*(_sp[_t=_sh[",w,"]]||100000);"];for(n=2,m=arguments.length;n<m;n++){c.push(q="_s"+(n-1));u.push(q,"=",arguments[n],(n!=m-1)?",":";");}c.push(true);u.push("switch(_t?_t._mid:0){");for(n=0,m=h.length;n<m;n++){style=h[n];this.style=style;if(h[n]){u[u.length]=["case ",style._mid,":{","\n",this.mousefunc.apply(this.mousethis,c),"}break;"].join("");}}u.push("};");this.style=0;return u.join("");},$endMouseState:function(){this.mousestyle=0;return"";},drawPart:function(B,A,C,z,v,c,q){var F=this.style;var n="0",a="1";var E=this.getX,D=this.getY,u=this.checkX,s=this.checkY;switch(F.shape){default:case"pie":if(E(F,"","scale","","1")!="1"){v=["_x5=(",E(F,"(","offset",")+"),"(",v,")","+",E(F,"(","center",")","0.5"),"*(_x3=",c,")",E(F,"*(1-(_x4=","scale","))"),")*p2"].join("");c="_x5+(_x3*_x4)*p2";}else{v=["_x5=(",E(F,"(","offset",")+"),"(",v,")",")*p2"].join("");c="_x5+("+c+")*p2";}if(D(F,"","scale","","1")!="1"){n=[D(F,"(","offset",")+"),D(F,"(","center",")","0.5"),D(F,"*(1-(_y4=","scale","))")].join("");a="_y4";}else{n=[D(F,"(","offset",")","0")].join("");a="1";}if(n!="0"){B="_x6=__sin(_y8=((_x9="+v+")+(_y9="+c+"))*0.5)*(_x8="+n+")*(_x7="+C+")+("+B+")"+E(F,"+_x7*(","move",")");A="_y6=__cos(_y8)*_x8*(_y7="+z+")+("+A+")"+D(F,"+_y7*(","move",")");C="_x7*(_x3="+a+")";z="_y7*_x3";v="_x9";c="_y9";}else{B="_x6=("+B+")";A="_y6=("+A+")";C=a=="1"?"("+C+")":"("+C+")*(_x3="+a+")";z=a=="1"?"("+z+")":"("+z+")*_x3";}if(q){return["if( ((_x1=((",B,")-mx)/(",C,"))*_x1+(_y1=((",A,")-my)/(",z,"))*_y1) < 1 ){","_x1=(p+__atan2(_x1,_y1));","if( ((_x2=(",v,")%p2)<0?(_x2=p2-_x2):_x2) >","((_y2=(",c,")%p2)<0?(_y2=p2-_y2):_y2) ){","if(_x1 >= _x2 || _x1<=_y2 )return x;","}else{","if(_x1 >= _x2 && _x1<=_y2 )return x;","}","}"].join("");}else{return[this.moveTo(B,A),this.ellipse("_x6","_y6",C,z,v,c,1),this.close()].join("");}}},draw2D:function(v,u,z,q,a){var C=this.style;var B=this.getX,A=this.getY,n=this.checkX,c=this.checkY;function s(){if(B(C,"","scale","","1")!="1"){v=[B(C,"(","offset",")+"),"(",v,")","+",B(C,"(","center",")","0.5"),"*(_x3=",z,")",B(C,"*(1-(_x4=","scale","))"),B(C,"+_x3*(","move",")")].join("");z="_x3*_x4";}else{v=[B(C,"(","offset",")+"),"(",v,")",B(C,"+(_x3="+z+")*(","move",")")].join("");z=n(C,"move","_x3",z);}if(A(C,"","scale","","1")!="1"){u=[A(C,"(","offset",")+"),"(",u,")","+",A(C,"(","center",")","0.5"),"*(_y3=",q,")",A(C,"*(1-(_y4=","scale","))"),A(C,"+_y3*(","move",")")].join("");q="_y3*_y4";}else{u=[A(C,"(","offset",")+"),"(",u,")",A(C,"+(_y3="+q+")*(","move",")")].join("");q=c(C,"move","_y3",q);}}switch(C.shape){case"rect":default:if(!C.rotate){s();return this.rect(v,u,z,q);}else{return["_x9=(_x8=(_x6=",B(C,"(","center",")","0.5"),"*(_x3=",z,"))*(",B(C,"(1-(_x4=","scale","))","0"),"-1))+_x3",n(C,"scale","*_x4"),";","_y9=(_y8=(_y6=",A(C,"(","center",")","0.5"),"*(_y3=",q,"))*(",A(C,"(1-(_y4=","scale","))","0"),"-1))+_y3",c(C,"scale","*_y4"),";",this.moveTo("(_cr=__cos(_t="+C.rotate+"))*_x8-(_sr=__sin(_t))*_y8+(_x5="+B(C,"(","offset",")+")+v+"+_x6)","_sr*_x8+_cr*_y8+(_y5="+A(C,"(","offset",")+")+u+"+_y6)"),this.lineTo("_cr*_x9-_sr*_y8+_x5","_sr*_x9+_cr*_y8+_y5"),this.lineTo("_cr*_x9-_sr*_y9+_x5","_sr*_x9+_cr*_y9+_y5"),this.lineTo("_cr*_x8-_sr*_y9+_x5","_sr*_x8+_cr*_y9+_y5"),this.close()].join("");}case"circle":s();return C.pie?[this.moveTo("_x6="+v+"+(_x5=0.5*("+z+"))","_y6="+u+"+(_y5=0.5*("+q+"))"),this.ellipse("_x6","_y6","_x5","_y5",B(C,"","range",""),A(C,"","range","")),this.close()].join(""):[this.ellipse(v+"+(_x5=0.5*("+z+"))",u+"+(_y5=0.5*("+q+"))","_x5","_y5",B(C,"","range",""),A(C,"","range","")),this.close()].join("");break;case"polygon":if(C.frames){}else{return["_x3=((_x2=",A(C,"","range","","2*p"),")-(_x1=",B(C,"","range","","0"),"))/(",C.steps||10,");v=_x1;",this.moveTo("(_x4="+v+")+__sin(_x1)*(_x5="+z+")","(_y4="+u+")+__cos(_x1)*(_y5="+q+")"),"for(v=_x1+_x3;v<_x2;v+=_x3){",this.lineTo("_x4+__sin(_x1)*_x5","_y4+__cos(_x1)*_y5"),"}",this.close()].join("");}break;case"math":if(C.frames){}else{s();return["_x7=((_x6=",A(C,"","range","","2*p"),")-(_x5=",B(C,"","range","","0"),"))/(",C.steps||10,");v=_x5;",this.moveTo("(_x8="+v+")+"+B(C,"(","path",")","0")+"*(_x9="+z+")","(_y8="+u+")+"+A(C,"(","path",")","0")+"*(_y9="+q+")"),"for(v=_x5+_x7;v<_x6;v+=_x7){",this.lineTo("_x8"+B(C,"+(","path",")*_x9"),"_y8"+A(C,"+(","path",")*_y9")),"}",this.close()].join("");}break;}return"";},$endDraw:function(){if(this.mousemode){return this.$endMouse();}if(this.statemode){return this.$endState();}var a=this.style;if(a){if(a.isshape){return this.$endShape();}if(a.isfont){return this.$endFont();}}return"";},beginFont:function(c,u,n,a,h,t){if(!c||u===undefined){return"document.title='beginFont Failed';";}var m=this.l,q=m._htmljoin,v=[this.$endDraw()];this.style=c;c._id=m._styles.push(c)-1;n=n!==undefined?n/m.ds:0;a=a!==undefined?a/m.ds:0;h=h!==undefined?h/m.ds:0;t=t!==undefined?t/m.ds:0;if(parseInt(c.left)!=c.left){this.mx="+("+c.left+")"+(n?"-"+n:"");}else{this.mx="+"+(c.left-n);}if(parseInt(c.top)!=c.top){this.my="+("+c.top+")"+(a?"-"+a:"");}else{this.my="+"+(c.top-a);}this.dynsize=(parseInt(c.size)!=c.size);c._txtdiv=["<div style='",(c.vertical)?"filter: flipv() fliph(); writing-mode: tb-rl;":"","position:absolute;cursor:default;overflow:hidden;left:0;top:0;display:none;font-family:",c.family,";color:",c.color,";font-weight:",c.weight,";",";font-size:",this.dynsize?10:c.size,"px;",(c.line!==undefined)?"border:1px solid "+c.line+";":"",(c.fill!==undefined)?"background:"+c.fill+";":"",(c.width!==undefined)?"width:"+c.width+"px;":"",(c.height!==undefined)?"height:"+c.height+"px;":"",(c.style!==undefined)?"font-style:"+c.style+";":"",(c.align!==undefined)?"text-align:"+c.align+";":"","'>-</div>"].join("");q.push("<div onmousedown='return false' style='cursor:default;position:absolute;left:",n,"px;top:",a,"px;width:",m.width-(h+n),"px;height:",m.height-(t+a),"px;overflow:hidden;'></div>");v.push("_s=_styles[",c._id,"],_tn=_s._txtnodes,_tc = 0;\n");v.push("if((_l=(",u,")) > _tn.length-_tc)jpf.draw.$allocText(_s,_l);");return v.join("");},text:function(a,m,h){var c=((this.l.ds>1)?"/"+this.l.ds:"");return["if( (_t=_tn[_tc++]).s!=(_v=",h,") )_t.v.nodeValue=_t.s=_v;","if(_t.x!=(_v=__round(",a,")))_t.n.style.left=_t.x=(_v",c,this.mx,")+'px';","if(_t.y!=(_v=__round(",m,")))_t.n.style.top=_t.y=(_v",c,this.my,")+'px';",this.dynsize?["if(_t.sz!=(_v=__round(",this.style.size,"))&&_v>0)_t.n.style.fontSize=_t.sz=_v+'px';"].join(""):""].join("");},$allocText:function(h,n){var c,a=h._txtnode,m=h._txtnodes;if(!m.length){a.innerHTML=Array(n+1).join(h._txtdiv);}else{a.insertAdjacentHTML("beforeend",Array(n+1).join(h._txtdiv));}while(n-->0){c=a.childNodes[m.length];m.push({x:-10000000000,y:-10000000000,n:c,v:c.firstChild,sz:-1,s:null});}},$endFont:function(){this.last=this.style._id;this.style=0;this.mx="",this.my="";return"_s._txtcount = _tc;";},$finalizeFont:function(h){var c=["if((_lc=(_s=_styles[",h._id,"])._txtused)>","(_tc=_s._txtcount)){_tn=_s._txtnodes;","for(;_lc>_tc;)_tn[--_lc].n.style.display='none';","_s._txtused=_tc;","} else if(_lc<_tc) {_tn=_s._txtnodes;","for(;_lc<_tc;)_tn[_lc++].n.style.display='block';","_s._txtused=_tc;","}\n"];var a=h._txtnodes=[];h._txtused=0;h._txtcount=0;return c.join("");},colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}});jpf.offline={onLine:true};jpf.storage={modules:{},init:function(a){if(!a){a=this.autodetect();}var c=this.getProvider(a);jpf.storage=jpf.extend(c,this);jpf.storage.init=null;return c;},getProvider:function(a){var c=jpf.storage.modules[a];if(!c||typeof c!="object"){return false;}if(!c.isAvailable()){return false;}if(!c.initialized&&(!c.init||c.init()===false)){return false;}c.name=a;jpf.extend(c,this.base);return c;},autodetect:function(){for(var a in this.modules){if(a=="memory"){continue;}if(this.modules[a].isAvailable()){return a;}}return this.modules.memory?"memory":null;},base:{namespace:"default",isValidKeyArray:function(a){return(!a||!a.join)?false:/^[0-9A-Za-z_\.\-]*$/.test(a.join(""));},isValidKey:function(a){return(a===null||a===undefined)?false:/^[0-9A-Za-z_\.\-]*$/.test(a);},getAllPairs:function(m,c){var n=this.getKeys(m);if(!n.length){return;}var a=this.getMultiple(n,m);for(var h=0;h<n.length&&a;h++){if(a[h]){c[n[h]]=a[h];}}return n.length;}}};jpf.Sort=function(c){var h={};this.parseXml=function(t,q){if(q){h={};}h.order=t.getAttribute("order");h.xpath=t.getAttribute("sort");h.getNodes=self[t.getAttribute("nodes-method")];h.getValue=function(w){return jpf.getXmlValue(w,h.xpath);};h.ascending=(h.order||"").indexOf("desc")==-1;h.order=null;if(t.getAttribute("data-type")){h.method=m[t.getAttribute("data-type")];}else{if(t.getAttribute("sort-method")){h.method=self[t.getAttribute("sort-method")];}else{h.method=m.alpha;}}var u=t.getAttribute("date-format");if(u){h.sort_dateFmtStr=u;h.method=m.date;var n=u.match(/(D+|Y+|M+|h+|m+|s+)/g);if(n){for(var v={},s=0;s<n.length;s++){v[n[s].substr(0,1)]=s+1;}h.dateFormat=new RegExp(u.replace(/([^\sDYMhms])/g,"\\$1").replace(/YYYY/,"(\\d\\d\\d\\d)").replace(/(DD|YY|MM|hh|mm|ss)/g,"(\\d\\d)"));h.dateReplace="$"+v.M+"/$"+v.D+"/$"+v.Y;if(v.h){h.dateReplace+=" $"+v.h+":$"+v.m+":$"+v.s;}}}};this.set=function(q,n){if(n){h={};}jpf.extend(h,q);if(q.order&&!h.ascending){h.ascending=q.order.indexOf("desc")==-1;}h.order=null;if(q.type){h.method=m[q.type];}else{if(q.method){h.method=self[q.method];}else{if(!h.method){h.method=m.alpha;}}}if(!h.getValue){h.getValue=function(s){return jpf.getXmlValue(s,h.xpath);};}};this.get=function(){return jpf.extend({},h);};this.findSortSibling=function(t,s){var n=getNodes?getNodes(t,s):this.getTraverseNodes(t);for(var q=0;q<n.length;q++){if(!compare(s,n[q],true,sortSettings)){return n[q];}}return null;};var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000"];var m={alpha:function(q){return q.toString().toLowerCase();},number:function(n){return(n.length<a.length?a[a.length-n.length]:"")+n;},date:function(q,n){var s=h.dateFormat;var v=h.dateReplace;var w=h.sort_dateFmtStr;if(!s||(n&&w!=n[0])){sort_dateFmt(n?n[0]:"*");}var u;if(w=="*"){u=Date.parse(q);}else{u=(new Date(q.replace(s,v))).getTime();}q=""+parseInt(u);if(q=="NaN"){q="0";}return(q.length<a.length?a[a.length-q.length]:"")+q;}};this.apply=function(s,A,t,q,y){var B=[],w=s.length;while(w--){var C=h.getValue(s[w]);if(s){B[B.length]={toString:function(){return this.v;},xmlNode:s[w],v:(h.method||m.alpha)(C||"",A,s[w])};}}B.sort();var u=y?Math.min(B.length,q+y):B.length;if(!q){q=0;}if(t){if(h.ascending){for(w=q;w<u;w++){f(w,u,B[w].xmlNode,B[w].v);}}else{for(w=u-1;w>=q;w--){f(u-w-1,u,B[w].xmlNode,B[w].v);}}}else{var z=[];if(h.ascending){for(w=q;w<u;w++){z[z.length]=B[w].xmlNode;}}else{for(w=u-1;w>=q;w--){z[z.length]=B[w].xmlNode;}}return z;}};if(c){this.parseXml(c);}};jpf.layout={layouts:{},addParent:function(c,a){if(!c.getAttribute("id")){jpf.setUniqueHtmlId(c);}return this.layouts[c.getAttribute("id")]={layout:new jpf.layoutParser(c,a),controls:[]};},get:function(h,a){var c=this.layouts[h.getAttribute("id")];if(!c){c=this.addParent(h,a);}return c;},isLoadedXml:function(m){var a=m.childNodes;var n=m.selectSingleNode(".//node[@name]");var q=n?self[n.getAttribute("name")]:null;var h=q.oExt.parentNode;var c=this.getHtmlId(h);return(this.loadedXml[c]==m);},loadFrom:function(a){jpf.setModel(a,{load:function(c){if(!c||this.isLoaded){return;}jpf.layout.loadXml(c);this.isLoaded=true;},setModel:function(h,c){if(typeof h=="string"){h=jpf.nameserver.get("model",h);}h.register(this,c);}});},loadedXml:{},cacheXml:{},loadXml:function(n){var a=n.childNodes;var s=n.selectSingleNode(".//node[@name]");var t=s?self[s.getAttribute("name")]:null;var m=t.oExt.parentNode;var q=this.get(m,jpf.getBox(n.getAttribute("margin")||""));var h=this.getHtmlId(m);this.metadata=[];for(var c=0;c<a.length;c++){if(a[c].nodeType!=1){continue;}q.root=this.parseXml(a[c],q);break;}this.compile(m);if(jpf.JmlParser.inited){this.activateRules(m);}this.loadedXml[h]=n;},metadata:[],getData:function(a,c){return{vbox:(a=="vbox"),hbox:(a=="hbox"),node:"vbox|hbox".indexOf(a)==-1,children:[],isRight:false,isBottom:false,edgeMargin:0,splitter:null,minwidth:0,minheight:0,weight:1,pHtml:c.parentNode,size:[300,200],position:[0,0],last:{},copy:function(){var m=jpf.extend({},this);if(!this.node){m.children=[];for(var h=0;h<this.children.length;h++){m.children[h]=this.children[h].copy();m.children[h].parent=m;}}return m;},hidden:false,hiddenChildren:[],prehide:function(n){if(this.hidden==3){this.hidden=true;if(this.hid){jpf.lookup(this.hid).visible=false;}if(this.oHtml){this.oHtml.style.display="none";}return;}if(this.hidden&&!n){return;}if(!this.parent){return;}this.hidepos={prev:this.parent.children[this.stackId-1],next:this.parent.children[this.stackId+1]};this.hidden=true;var m,u,t=0,q,h,s=["children","hiddenChildren"];while(s.length){m=this.parent[s.pop()];for(q=0,h=m.length;q<h;q++){u=m[q];if(u!=this&&!u.hidden){t=1;break;}}}if(!t){this.parent.prehide(n);}if(n){return this.hide(true);}if(jpf.layout.dlist.contains(this)){jpf.layout.dlist.remove(this);return false;}else{jpf.layout.dlist.pushUnique(this);}},preshow:function(h){if(!this.hidden){return;}this.hidden=false;if(h){return this.show(true);}if(this.parent.hidden){this.parent.preshow();}if(jpf.layout.dlist.contains(this)){jpf.layout.dlist.remove(this);return false;}else{jpf.layout.dlist.pushUnique(this);}},hide:function(m){var h=this.parent.children;h.removeIndex(this.stackId);for(var n=0;n<h.length;n++){h[n].stackId=n;}this.parent.hiddenChildren.push(this);if(m){return;}if(this.hidden!=3){if(this.hid){jpf.lookup(this.hid).visible=false;}if(this.oHtml){this.oHtml.style.display="none";}}},show:function(m){var h=this.parent.children;if(this.hidepos.prev&&this.hidepos.prev.parent==this.parent&&!this.hidepos.prev.hidden&&!jpf.layout.dlist.contains(this.hidepos.prev)){if(h.length<this.hidepos.prev.stackId+1){h.push(this);}else{h.insertIndex(this,this.hidepos.prev.stackId+1);}}else{if(this.hidepos.next&&this.hidepos.next.parent==this.parent&&!this.hidepos.next.hidden&&!jpf.layout.dlist.contains(this.hidepos.next)){if(this.hidepos.next.stackId==0){h.unshift(this);}else{if(h.length<this.hidepos.next.stackId-1){h.push(this);}else{h.insertIndex(this,this.hidepos.next.stackId-1);}}}else{if(!this.hidepos.prev){h.unshift(this);}else{if(!this.hidepos.next){h.push(this);}else{if(this.stackId<h.length){h.insertIndex(this,this.stackId);}else{h.push(this);}}}}}for(var n=0;n<h.length;n++){if(h[n]){h[n].stackId=n;}}this.parent.hiddenChildren.remove(this);if(!m){if(this.hidden!=3){if(this.hid){jpf.lookup(this.hid).visible=true;}if(this.oHtml){this.oHtml.style.display="block";}}}this.hidden=false;this.hidepos=null;},remove:function(){var n=this.parent;if(!n){return;}if(this.hidden||n.hiddenChildren.contains(this)){n.hiddenChildren.remove(this);jpf.layout.dlist.remove(this);}else{var h=n.children;h.remove(this);for(var m=0;m<h.length;m++){h[m].stackId=m;}}for(var q in this.last){if(q=="splitter"){if(n.originalMargin){if(n.parent.pOriginalMargin){n.parent.splitter=null;n.parent.edgeMargin=n.parent.pOriginalMargin[0];n.parent.pOriginalMargin=null;delete n.last.splitter;}n.splitter=null;n.edgeMargin=n.originalMargin[0];n.originalMargin=null;}}this[q]=n[q]||this.last[q];}this.last={};if(!n.children.length&&!n.hiddenChildren.length){n.remove();}this.parent=null;},add:function(n){this.parent=n;if(this.hidden){var h=n.hiddenChildren;h.push(this);}else{var h=n.children;h.push(this);for(var m=0;m<h.length;m++){if(h[m]){h[m].stackId=m;}}}}};},parseXml:function(x,layout,jmlNode,norecur){var aData=this.getData(typeof jmlNode=="string"?jmlNode:x[jpf.TAGNAME],layout.layout);if(aData.node){if(!jmlNode){jmlNode=self[x.getAttribute("name")];}aData.oHtml=jmlNode.oExt;jmlNode.aData=aData;if(!jmlNode.hasFeature(__ALIGNMENT__)){jmlNode.implement(jpf.Alignment);if(jmlNode.hasFeature(__ANCHORING__)){jmlNode.disableAnchoring();}}var jml=jmlNode.$jml;if(jml.getAttribute("width")){aData.fwidth=jml.getAttribute("width");}if(jml.getAttribute("height")){aData.fheight=jml.getAttribute("height");}if(!this.getHtmlId(aData.oHtml)){jpf.setUniqueHtmlId(aData.oHtml);}aData.id=this.getHtmlId(aData.oHtml);if(aData.oHtml.style){aData.oHtml.style.position="absolute";}aData.hid=jmlNode.uniqueId;}else{aData.id=this.metadata.push(aData)-1;}if(x.getAttribute("align")){aData.template=x.getAttribute("align");}if(x.getAttribute("lean")){aData.isBottom=x.getAttribute("lean").match(/bottom/);}if(x.getAttribute("lean")){aData.isRight=x.getAttribute("lean").match(/right/);}if(x.getAttribute("edge")&&x.getAttribute("edge")!="splitter"){aData.edgeMargin=x.getAttribute("edge");}if(x.getAttribute("weight")){aData.weight=parseFloat(x.getAttribute("weight"));}if(x.getAttribute("splitter")||x.getAttribute("edge")=="splitter"){aData.splitter=x.getAttribute("splitter")||(x.getAttribute("edge")=="splitter"?5:false);}if(x.getAttribute("width")){aData.fwidth=String(jpf.parseExpression(x.getAttribute("width")));}if(x.getAttribute("height")){aData.fheight=String(jpf.parseExpression(x.getAttribute("height")));}if(x.getAttribute("minwidth")){aData.minwidth=x.getAttribute("minwidth");}if(x.getAttribute("lastsplitter")){aData.lastsplitter=x.getAttribute("lastsplitter");}if(x.getAttribute("hidden")){aData.hidden=(x.getAttribute("hidden")==3)?x.getAttribute("hidden"):jpf.isTrue(x.getAttribute("hidden"));}if(x.getAttribute("state")){aData.state=x.getAttribute("state");}if(x.getAttribute("stack")){aData.stackId=parseInt(x.getAttribute("stack"));}if(x.getAttribute("position")){aData.position=x.getAttribute("position").split(",");}if(x.getAttribute("size")){aData.size=x.getAttribute("size").split(",");}if(aData.fwidth&&aData.fwidth.indexOf("/")>-1){aData.fwidth=eval(aData.fwidth);if(aData.fwidth<=1){aData.fwidth=(aData.fwidth*100)+"%";}}if(aData.fheight&&aData.fheight.indexOf("/")>-1){aData.fheight=eval(aData.fheight);if(aData.fheight<=1){aData.fheight=(aData.fheight*100)+"%";}}aData.edgeMargin=Math.max(aData.splitter||0,aData.edgeMargin||0);aData.xml=x;return aData;},checkInheritance:function(h){for(var c=0;c<h.children.length;c++){if(!h.children[c].node){this.checkInheritance(h.children[c]);}}var m=h.children[0];if(m&&h.parent){if(h.vbox){if(!h.fwidth&&m.fwidth||m.last.fwidth&&m.fwidth!==null&&m.last.fwidth==h.fwidth){m.last.fwidth=h.fwidth=m.fwidth;m.fwidth=null;}var a=h.parent;if((a&&!a.fheight&&m.fheight||m.last.fheight&&m.fheight!==null&&m.last.fheight==a.fheight)&&h.children.length==1){m.last.fheight=a.fheight=m.fheight;m.fheight=null;}}else{if((!h.fheight&&m.fheight||m.last.fheight&&m.fheight!==null&&m.last.fheight==h.fheight)&&h.children.length==1){m.last.fheight=h.fheight=m.fheight;m.fheight=null;}}if(m.weight||m.last.weight&&m.last.weight==h.weight){m.last.weight=h.weight=m.weight;}}},compileAlignment:function(c){if(!c.children.length){this.removeRule(c.pHtml,"layout");var a=this.layouts[c.pHtml.getAttribute("id")];if(a){jpf.layout.clearSplitters(a.layout);}return;}var a=this.layouts[c.pHtml.getAttribute("id")];a.layout.compile(c.copy());a.layout.reset();},compile:function(h){var c=this.layouts[h.getAttribute("id")];if(!c){return false;}var a=c.root.copy();c.layout.compile(a);c.layout.reset();},removeAll:function(c){c.children.length=null;this.compileAlignment(c);var a=this.getHtmlId(c.pHtml);if(!this.rules[a]){delete this.qlist[a];}},timer:null,qlist:{},dlist:[],queue:function(c,h,a){if(this.qlist[c.getAttribute("id")]){if(h){this.qlist[c.getAttribute("id")][2].push(h);}if(a){this.qlist[c.getAttribute("id")][1]=a;}return;}this.qlist[c.getAttribute("id")]=[c,a,[h]];if(!this.timer){this.timer=setTimeout("jpf.layout.processQueue()");}},processQueue:function(){clearTimeout(this.timer);this.timer=null;var c,n,a,m,h;for(c=0;c<this.dlist.length;c++){if(this.dlist[c].hidden){this.dlist[c].hide();}else{this.dlist[c].show();}}for(n in this.qlist){m=this.qlist[n];if(m[1]){jpf.layout.compileAlignment(m[1]);}h=m[2];for(c=0,a=h.length;c<a;c++){if(h[c]){h[c].$updateLayout();}}jpf.layout.activateRules(m[0]);}if(jpf.hasSingleRszEvent){jpf.layout.forceResize();}this.qlist={};this.dlist=[];},rules:{},onresize:{},getHtmlId:function(a){return a.getAttribute?a.getAttribute("id"):1;},setRules:function(h,n,m,c){if(!this.getHtmlId(h)){jpf.setUniqueHtmlId(h);}if(!this.rules[this.getHtmlId(h)]){this.rules[this.getHtmlId(h)]={};}var a=this.rules[this.getHtmlId(h)][n];if(!c&&a){this.rules[this.getHtmlId(h)][n]=m+"\n"+a;}else{this.rules[this.getHtmlId(h)][n]=m;}},getRules:function(a,c){return c?this.rules[this.getHtmlId(a)][c]:this.rules[this.getHtmlId(a)];},removeRule:function(c,m){if(!this.rules[this.getHtmlId(c)]){return;}var a=this.rules[this.getHtmlId(c)][m]||false;delete this.rules[this.getHtmlId(c)][m];var h;for(h in this.rules[this.getHtmlId(c)]){}if(!h){delete this.rules[this.getHtmlId(c)];}return a;},activateRules:function(n,u){if(!n){var a,q;for(a in this.rules){q=document.getElementById(a);if(!q||q.onresize){continue;}this.activateRules(q);}if(jpf.hasSingleRszEvent&&window.onresize){window.onresize();}return;}var s,m,v,z,y=[];if(!jpf.hasSingleRszEvent){z=this.rules[this.getHtmlId(n)];if(!z){n.onresize=null;return false;}for(m in z){if(typeof z[m]!="string"){continue;}y.push(z[m]);}s=jpf.needsCssPx?new Function(y.join("\n")):new Function(y.join("\n").replace(/ \+ 'px'|try\{\}catch\(e\)\{\}\n/g,""));n.onresize=s;if(!u){s();}}else{var h=this.getHtmlId(n);z=this.rules[h];if(!z){return false;}for(m in z){if(typeof z[m]!="string"){continue;}y.push(z[m]);}var c=n.parentNode;while(c&&c.nodeType==1&&!this.onresize[c.getAttribute("id")]){c=c.parentNode;}var t=new Function(y.join("\n"));if(this.onresize[h]){t.children=this.onresize[h].children;}if(c&&c.nodeType==1){var w=this.onresize[c.getAttribute("id")];(w.children||(w.children={}))[h]=t;}else{this.onresize[h]=t;}if(!u){t();}if(!window.onresize){var s=function(C){var D=[];for(var A in C){D.unshift(C[A]);}for(var B=0;B<D.length;B++){D[B]();if(D[B].children){s(D[B].children);}}};window.onresize=function(){s(jpf.layout.onresize);};}}},forceResize:function(c){if(jpf.hasSingleRszEvent){return window.onresize&&window.onresize();}var a=c.onresize;if(a){a();}},paused:{},pause:function(c,h){if(jpf.hasSingleRszEvent){var a=this.getHtmlId(c);this.paused[a]=this.onresize[a]||true;if(h){this.onresize[a]=h;this.onresize[a].children=this.paused[a].children;h();}else{delete this.onresize[a];}}else{this.paused[this.getHtmlId(c)]=c.onresize||true;if(h){c.onresize=h;h();}else{c.onresize=null;}}},play:function(c){if(!this.paused[this.getHtmlId(c)]){return;}if(jpf.hasSingleRszEvent){var a=this.getHtmlId(c);var h=this.paused[a];if(typeof h=="function"){this.onresize[a]=h;}else{delete this.onresize[a];}if(window.onresize){window.onresize();}this.paused[this.getHtmlId(c)]=null;}else{var h=this.paused[this.getHtmlId(c)];if(typeof h=="function"){c.onresize=h;h();}else{c.onresize=null;}this.paused[this.getHtmlId(c)]=null;}}};jpf.getWindowWidth=function(){return jpf.isIE?document.documentElement.offsetWidth:window.innerWidth;};jpf.getWindowHeight=function(){return jpf.isIE?document.documentElement.offsetHeight:window.innerHeight;};jpf.layoutParser=function(a,h){h=(h&&h.length==4)?h:[0,0,0,0];this.pMargin=h;this.RULES=[];this.parentNode=a;if(!this.parentNode.getAttribute("id")){jpf.setUniqueHtmlId(this.parentNode);}var q={};var m=0;var n=0;this.createSplitters=true;this.setMargin=function(s){h=s;};this.reset=function(){this.RULES=[];q={};this.lastType=this.globalEdge=this.globalSplitter=null;};this.compile=function(s,t){this.addRule("var v = jpf.layout.vars");this.globalSplitter=s.splitter;this.globalEdge=s.edgeMargin;if(this.globalSplitter||this.globalEdge){this.setglobals(s);}this.preparse(s);this.parserules(s);if(this.createSplitters){jpf.layout.clearSplitters(this);this.parsesplitters(s);}this.RULES=new c().calc(this.RULES);var u=("try{"+this.RULES.join("}catch(e){}\ntry{")+"}catch(e){}\n").replace(/([^=]+\.style[^=]+) = (.*?)\}/g,"$1 = ($2) + 'px'}");if(!jpf.hasHtmlIdsInJs){u=u.replace(/q([\w|]+)\.(offset|style)/g,'document.getElementById("q$1").$2');}this.lastRoot=s;if(!t){jpf.layout.setRules(this.parentNode,"layout",u,true);}else{return u;}return false;};this.addRule=function(s){this.RULES.push(s);};this.setglobals=function(t){if(this.globalEdge&&!t.edgeMargin){if(!t.splitter){t.splitter=this.globalSplitter;}t.edgeMargin=Math.max(this.globalSplitter,this.globalEdge);}if(t.node){return;}for(var s=0;s<t.children.length;s++){this.setglobals(t.children[s]);}};this.preparse=function(t){if(t.node){return;}else{var D=t.vbox?"height":"width";var w=0;var C=0;var I=0;t.childweight=0;t.childminwidth=0;t.childminheight=0;var H=["v."+D+"_"+t.id],u=[];var s=t.children;for(var z=0;z<s.length;z++){if(z<s.length-1){H.push(" - "+s[z].edgeMargin);}var B=s[z]["f"+D];if(B){u.push((B.indexOf("%")>-1)?" - ("+(s[z]["calc"+D]="v.innerspace_"+t.id+" * "+parseFloat(B)/100)+")":" - ("+B+")");}else{t.childweight+=s[z].weight;s[z]["calc"+D]="Math."+(z%2==0?"ceil":"floor")+"(v.restspace_"+t.id+" * ("+s[z].weight+"/v.weight_"+t.id+"))";}var A=(t.vbox?"width":"height");var F=s[z]["f"+A];if(!F){s[z]["calc"+A]=(t.vbox?"v.width_":"v.height_")+t.id;}else{s[z]["calc"+A]=F.indexOf("%")>-1?"v.innerspace_"+t.id+" * "+parseFloat(F)/100:F;}if(s[z].node){s[z].oHtml.style.display="block";}else{this.preparse(s[z]);}if(t.vbox){t.childminheight+=Math.max(s[z].childminheight||0,s[z].minheight||0,10)+s[z].edgeMargin;t.childminwidth=Math.max(t.childminwidth,s[z].minwidth||s[z].childminwidth||10);}else{t.childminwidth+=Math.max(s[z].minwidth||0,s[z].childminwidth||0,10)+s[z].edgeMargin;t.childminheight=Math.max(t.childminheight,s[z].minheight||s[z].childminheight||10);}}t.innerspace=H.join("");t.restspace=t.innerspace+" "+u.join("");if(!t.parent){var y=0,K=0;if(this.parentNode.tagName.toLowerCase()!="body"){var E=jpf.getDiff(this.parentNode);K=E[0];y=E[1];}var J=(this.parentNode.tagName.toLowerCase()=="body"?"jpf.getWindowWidth()":"document.getElementById('"+this.parentNode.id+"').offsetWidth");var G=(this.parentNode.tagName.toLowerCase()=="body"?"jpf.getWindowHeight()":"document.getElementById('"+this.parentNode.id+"').offsetHeight");t.calcwidth="Math.max("+m+", "+J+" - "+(h[1])+" - "+h[3]+" - "+y+")";t.calcheight="Math.max("+n+", "+G+" - "+(h[2])+" - "+h[0]+" - "+K+")";}}};this.parserules=function(y){if(!y.node){this.addRule("v.width_"+y.id+" = Math.max("+y.childminwidth+","+y.minwidth+","+(y.calcwidth||y.fwidth)+")");this.addRule("v.height_"+y.id+" = Math.max("+y.childminheight+","+y.minheight+","+(y.calcheight||y.fheight)+")");this.addRule("v.weight_"+y.id+" = "+y.childweight);this.addRule("v.innerspace_"+y.id+" = "+y.innerspace);this.addRule("v.restspace_"+y.id+" = "+y.restspace);var t=jpf.layout.metadata[y.id];t.calcData=y;y.original=t;if(!y.parent){this.addRule("v.left_"+y.id+" = "+h[3]);this.addRule("v.top_"+y.id+" = "+h[0]);for(var v=0;v<y.children.length;v++){this.parserules(y.children[v]);}return;}else{var B=["v.top_"+y.id," = "];var D=["v.left_"+y.id," = "];}}else{var B=[y.id,".style.top = "];var D=[y.id,".style.left = "];if(y.hid){var t=jpf.lookup(y.hid).aData;t.calcData=y;y.original=t;}var w=y.oHtml;var A=jpf.getDiff(w);var C=A[1];var u=A[0];if(y.calcwidth){this.addRule(y.id+".style.width = -"+u+" + Math.max( "+y.calcwidth+", "+y.minwidth+")");}else{w.style.width=Math.max(0,y.fwidth-u)+"px";}if(y.calcheight){this.addRule(y.id+".style.height = -"+C+" + Math.max( "+y.calcheight+", "+y.minheight+")");}else{w.style.height=Math.max(0,y.fheight-C)+"px";}}var s=y.parent.children[y.stackId-1];var z=y.parent.children[y.stackId+1];if(y.parent.vbox){if(y.parent.isBottom){if(!z){B.push("v.top_",y.parent.id," + v.height_",y.parent.id," - ",y.id,".offsetHeight");}else{if(z.node){B.push(z.id,".offsetTop - ",z.edgeMargin," - ",y.id,".offsetHeight");}else{B.push("v.top_"+z.id," - ",z.edgeMargin," - ",(y.node?y.id+".offsetHeight":"v.height_"+y.id));}}}else{if(!y.stackId){B.push("v.top_"+y.parent.id);}else{if(s){if(s.node){B.push(s.id,".offsetTop + ",s.id,".offsetHeight + ",s.edgeMargin);}else{B.push("v.top_",s.id," + v.height_",s.id," + ",s.edgeMargin);}}}}}else{B.push("v.top_"+y.parent.id);}if(y.parent.hbox){if(y.parent.isRight){if(!z){D.push("v.left_",y.parent.id," + v.width_",y.parent.id," - ",y.id,".offsetWidth",null);}else{if(z.node){D.push(z.id,".offsetLeft - ",z.edgeMargin," - ",y.id,".offsetWidth");}else{D.push("v.left_"+z.id," - ",z.edgeMargin," - ",(y.node?y.id+".offsetWidth":"v.width_"+y.id));}}}else{if(!y.stackId){D.push("v.left_"+y.parent.id);}else{if(s){if(s.node){D.push(s.id,".offsetLeft + ",s.id,".offsetWidth + ",s.edgeMargin);}else{D.push("v.left_",s.id," + v.width_",s.id," + ",s.edgeMargin);}}}}}else{D.push("v.left_"+y.parent.id);}if(D.length>2){this.addRule(D.join(""));}if(B.length>2){this.addRule(B.join(""));}if(!y.node){for(var v=0;v<y.children.length;v++){this.parserules(y.children[v]);}}};this.parsesplitters=function(t){if(t.parent&&t.splitter>0){jpf.layout.getSplitter(this).init(t.splitter,t.hid,t);}if(!t.node){for(var s=0;s<t.children.length;s++){this.parsesplitters(t.children[s]);}}};function c(){this.parselookup={};this.nRules=[];this.doneRules={};this.maskText=function(v,u,t,s){return u+".offset"+t.toUpperCase();};this.handleVar=function(v,u,t,s){var w="a"+u.replace(/\|/g,"_")+"_style_"+t.toLowerCase();return q[w]?w:v;};this.parseRule=function(w){var t=w.split(" = ");var z=t[0].replace(/^([_\w\d\|]+)\.style\.(\w)/,this.maskText);var v="a"+t[0].replace(/[\.\|]/g,"_");q[v]=true;var u=t[1].split(/[ \(\)]/);var y=[];for(var s=0;s<u.length;s++){if(u[s].match(/^([_\w\d\|]+)\.offset(\w+)$/)&&!u[s].match(/PNODE/)){y.push(u[s]);}}if(v.match(/width|height/i)){t[1]=t[1].replace(/^(\s*[\-\d]+[\s\-\+]+)/,"");ruleB=t[0]+" = "+RegExp.$1+v;}else{ruleB=t[0]+" = "+v;}if(w.match(/^v\./)){return{id:z,rule_p1:t[0]+" = ",rule_p2:t[1],ruleb:null,deps:y,processed:false};}return{id:z,rule_p1:"var "+v+" = ",rule_p2:t[1],ruleb:ruleB,deps:y,processed:false};};this.calc=function(u){var w="";for(var t=0;t<u.length;t++){if(u[t].match(/^var/)){this.nRules.push(u[t]);continue;}var v=this.parseRule(u[t],t);this.parselookup[v.id]=v;}for(prop in this.parselookup){this.processNode(this.parselookup[prop]);}for(prop in this.parselookup){var s=this.parselookup[prop];this.walkRules(s);}for(prop in this.parselookup){this.nRules.push(this.parselookup[prop].ruleb);}return this.nRules;};this.walkRules=function(s){if(this.doneRules[s.id]){return;}for(var t=0;t<s.deps.length;t++){if(s.deps[t]&&!s.deps[t].walked&&!this.doneRules[s.deps[t].id]){s.deps[t].walked=true;this.walkRules(s.deps[t]);}}this.doneRules[s.id]=true;this.nRules.push(s.rule_p1+s.rule_p2.replace(/([_\w\d\|]+)\.offset(\w+)/g,this.handleVar));};this.processNode=function(u){for(var t=0;t<u.deps.length;t++){var s=typeof u.deps[t]=="string"?this.parselookup[u.deps[t]]:u.deps[t];if(!s){u.deps[t]=null;continue;}u.deps[t]=s;if(!s.processed){s.processed=true;this.processNode(s);}}};}};jpf.history={inited:false,page:null,init:function(a){this.inited=true;this.hasChanged(a);if(jpf.isIE){var c="<style>BODY, HTML{margin : 0;}h1{height : 100px;margin : 0;padding : 0;}</style><body><h1 id='"+a+"'>0</h1></body><script>var lastURL = -1;if(document.all){document.body.onscroll = checkUrl;}else{setInterval('checkUrl()', 200);}function checkUrl(){var nr=Math.round((document.all ? document.body : document.documentElement).scrollTop/100);top.jpf.history.hasChanged(document.getElementsByTagName('h1')[nr].id);lastURL = document.body.scrollTop;}checkUrl();<\/script>";if(top==self){document.body.insertAdjacentHTML("beforeend","<iframe name='nav' style2='position:absolute;left:10px;top:10px;height:100px;width:100px;z-index:1000'style='width:1px;height:1px;' src='about:blank'></iframe>");document.frames.nav.document.open();document.frames.nav.document.write(c);document.frames.nav.document.close();}this.iframe=document.frames.nav;this.timer2=setInterval(function(){if(!jpf.history.changingHash&&location.hash!="#"+jpf.history.page){jpf.history.hasChanged(location.hash.replace(/^#/,""));}},jpf.history.delay||200);}else{jpf.history.lastUrl=location.href;this.timer2=setInterval(function(){if(jpf.history.lastUrl==location.href){return;}jpf.history.lastUrl=location.href;var h=location.hash.replace("#","");jpf.history.hasChanged(decodeURI(h));},20);}},to_name:null,setHash:function(c,a){if(this.changing||this.page==c||location.hash=="#"+c){this.to_name=c;return;}if(jpf.isIE&&!a){this.to_name=c;return setTimeout(function(){jpf.history.setHash(jpf.history.to_name,true);},200);}this.changePage(c);if(!this.inited){return this.init(c);}this.changePage(c);if(!this.inited){return this.init(c);}if(jpf.isIE){var m=this.iframe.document.body.appendChild(this.iframe.document.createElement("h1"));m.id=c;m.innerHTML=this.length;}(jpf.isIE?this.iframe:window).location.href="#"+c;if(!jpf.isIE){jpf.history.lastUrl=location.href;}},timer:null,changePage:function(a){if(jpf.isIE){this.page=a;this.changingHash=true;clearTimeout(this.timer);this.timer=setTimeout(function(){location.hash=a;jpf.history.changingHash=false;},1);}},hasChanged:function(a){if(a==this.page){return;}this.changePage(a);this.changing=true;jpf.dispatchEvent("hashchange",{page:a});this.changing=false;}};jpf.dragmode={};if(typeof isFinite=="undefined"){function isFinite(a){return a+1!=a;}}Array.prototype.dataType="array";Number.prototype.dataType="number";Date.prototype.dataType="date";Boolean.prototype.dataType="boolean";String.prototype.dataType="string";RegExp.prototype.dataType="regexp";Function.prototype.dataType="function";jpf.getCgiString=function(a,m,h){var q=[];function n(u,s){var v;if(jpf.isArray(u)){for(var t=0;t<u.length;t++){n(u[t],s+"%5B%5D");}}else{if(typeof u=="object"){for(v in u){if(jpf.isSafariOld&&(!u[v]||typeof p[v]!="object")){continue;}if(typeof u[v]=="function"){continue;}n(u[v],s+"%5B"+encodeURIComponent(v)+"%5D");}}else{q.push(s+"="+encodeURIComponent(u));}}}if(m){q.push("func="+h);for(var c=0;c<a[0].length;c++){n(a[0][c],"f%5B"+c+"%5D");}}else{for(prop in a){if(jpf.isSafariOld&&(!a[prop]||typeof a[prop]=="function")){continue;}n(a[prop],prop);}}return q.join("&");};jpf.fromCgiString=function(c){if(!c){return false;}var s={};c=c.split("&");for(var n,m=0;m<c.length;m++){n=c[m].split("=");n[0]=decodeURIComponent(n[0]);var q=n[0].replace(/\]/g,"").split("[");var h=s;for(var a=0;a<q.length;a++){if(h[q[a]]){h=h[q[a]];}else{if(q.length==a+1){if(q[a]){h[q[a]]=decodeURIComponent(n[1]);}else{h.push(decodeURIComponent(n[1]));}break;}else{h[q[a]]=!q[a+1]?[]:{};h=h[q[a]];}}}}return s;};Function.prototype.extend=function(){jpf.extend.apply(this,[this].concat(Array.prototype.slice.call(arguments)));return this;};Function.prototype.bindWithEvent=function(){var a=this,c=Array.prototype.slice.call(arguments),m=c.shift(),h=c.shift();return function(n){if(!n){n=window.event;}if(h!==false){n=new jpf.AbstractEvent(n,window);}return a.apply(m,[n].concat(c).concat(Array.prototype.slice.call(arguments)));};};Array.prototype.copy=function(){var a=[];for(var h=0,c=this.length;h<c;h++){a[h]=this[h]&&this[h].copy?this[h].copy():this[h];}return a;};Array.prototype.merge=function(){for(var m=0,c=arguments.length;m<c;m++){for(var h=0,a=arguments[m].length;h<a;h++){this.push(arguments[m][h]);}}};Array.prototype.arrayAdd=function(){var n=this.copy();for(var m=0,c=arguments.length;m<c;m++){for(var h=0,a=n.length;h<a;h++){n[h]+=arguments[m][h];}}return n;};Array.prototype.equals=function(h){for(var c=0,a=this.length;c<a;c++){if(this[c]!=h[c]){return false;}}return true;};Array.prototype.makeUnique=function(){var a,h,c=[];for(a=0,h=this.length;a<h;a++){if(c.indexOf(this[a])==-1){c.push(this[a]);}}this.length=0;for(a=0,h=c.length;a<h;a++){this.push(c[a]);}return this;};Array.prototype.contains=function(a,c){return this.indexOf(a,c)!=-1;};Array.prototype.indexOf=Array.prototype.indexOf||function(h,m){var a=this.length;for(var c=(m<0)?Math.max(0,a+m):m||0;c<a;c++){if(this[c]===h){return c;}}return -1;};Array.prototype.lastIndexOf=Array.prototype.lastIndexOf||function(h,m){var a=this.length;for(var c=(m>=a)?a-1:(m<0)?m+a:a-1;c>=0;c--){if(this[c]===h){return c;}}return -1;};Array.prototype.pushUnique=function(a){if(this.indexOf(a)==-1){this.push(a);}return this;};Array.prototype.search=function(){for(var c=0,h=arguments.length;c<h;c++){if(typeof this[c]!="array"){continue;}for(var a=0;a<h;a++){if(this[c][a]!=arguments[a]){break;}else{if(a==(h-1)){return this[c];}}}}};Array.prototype.each=Array.prototype.forEach=Array.prototype.forEach||function(h){for(var c=0,a=this.length;c<a;c++){h.call(this,this[c],c,this);}return this;};Array.prototype.remove=function(c){for(var a=this.length-1;a>=0;a--){if(this[a]!=c){continue;}this.splice(a,1);}return this;};Array.prototype.removeIndex=function(a){if(!this.length){return;}return this.splice(a,1);};Array.prototype.insertIndex=function(c,a){this.splice(a,0,c);};Array.prototype.invert=Array.prototype.reverse=Array.prototype.reverse||function(){var a=this.length-1;for(var c,h=0;h<Math.ceil(0.5*a);h++){c=this[h];this[h]=this[a-h];this[a-h]=c;}return this;};Number.prototype.toPrettyDigit=Number.prototype.toPrettyDigit||function(){var a=this.toString();return(a.length==1)?"0"+a:a;};Array.prototype.filter=Array.prototype.filter||function(m,n){var h=[];for(var c=0,a=this.length;c<a;c++){if(m.call(n,this[c],c,this)){h.push(this[c]);}}return h;};Array.prototype.every=Array.prototype.every||function(h,m){for(var c=0,a=this.length;c<a;c++){if(!h.call(m,this[c],c,this)){return false;}}return true;};Array.prototype.map=Array.prototype.map||function(m,n){var h=[];for(var c=0,a=this.length;c<a;c++){h[c]=m.call(n,this[c],c,this);}return h;};Array.prototype.some=Array.prototype.some||function(h,m){for(var c=0,a=this.length;c<a;c++){if(h.call(m,this[c],c,this)){return true;}}return false;};Math.hexlist="0123456789ABCDEF";Math.decToHex=function(c){var a=this.floor(c/16);a=(a>15?this.decToHex(a):this.hexlist.charAt(a));return a+""+this.hexlist.charAt(this.floor(c%16));};Math.hexToDec=function(a){if(!/(.)(.)/.exec(a.toUpperCase())){return false;}return this.hexlist.indexOf(RegExp.$1)*16+this.hexlist.indexOf(RegExp.$2);};RegExp.prototype.getNativeFlags=function(){return(this.global?"g":"")+(this.ignoreCase?"i":"")+(this.multiline?"m":"")+(this.extended?"x":"")+(this.sticky?"y":"");};RegExp.prototype.addFlags=function(a){return new RegExp(this.source,(a||"")+this.getNativeFlags());};String.prototype.uCaseFirst=function(){return this.substr(0,1).toUpperCase()+this.substr(1);};String.prototype.trim=function(){return this.replace(/[\s\n\r]*$/,"").replace(/^[\s\n\r]*/,"");};String.prototype.repeat=function(a){return Array(a+1).join(this);};String.prototype.count=function(a){return this.split(a).length-1;};String.prototype.stripTags=function(){return this.replace(/<\/?[^>]+>/gi,"");};String.prototype.escape=function(){return escape(this);};if(typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement=="function"){String.prototype.escapeHTML=function(){this.escapeHTML.text.data=this;return this.escapeHTML.div.innerHTML;};String.prototype.unescapeHTML=function(){var h=document.createElement("div");h.innerHTML=this.stripTags();if(h.childNodes[0]){if(h.childNodes.length>1){var a=[];for(var c=0;c<h.childNodes.length;c++){a.push(h.childNodes[c].nodeValue);}return a.join("");}else{return h.childNodes[0].nodeValue;}}return"";};String.prototype.escapeHTML.div=document.createElement("div");String.prototype.escapeHTML.text=document.createTextNode("");String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);if("<\n>".escapeHTML()!=="&lt;\n&gt;"){String.prototype.escapeHTML=null;}if("&lt;\n&gt;".unescapeHTML()!=="<\n>"){String.prototype.unescapeHTML=null;}}if(!String.prototype.escapeHTML){String.prototype.escapeHTML=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");};}if(!String.prototype.unescapeHTML){String.prototype.unescapeHTML=function(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");};}String.prototype.truncate=function(c,a){return this.length>=c?this.substring(0,c-(a?4:1))+(a?"...":""):this;};String.prototype.pad=function(a,h,c){return c?(this+Array(a).join(h)).slice(0,a):(Array(a).join(h)+this).slice(-a);};jpf.PAD_LEFT=false;jpf.PAD_RIGHT=true;String.prototype.splitSafe=function(h,a,c){return(c&&this.toLowerCase()||this).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+h+"[\\s ]*","g"),a||999);};var _oldSplit=String.prototype.split;String.prototype.appendRandomNumber=function(c){var h=this.toString();for(var a=1;a<=c;a++){h+=jpf.randomGenerator.generate(1,9);}return h;};String.prototype.prependRandomNumber=function(c){var h=this.toString();for(var a=1;a<=c;a++){h=jpf.randomGenerator.generate(1,9)+h;}return h;};String.prototype.sprintf=function(){var m=this.toString();var a=0,h=m.indexOf("%s");while(h>=0){var c=arguments[a++]||" ";m=m.substr(0,h)+c+m.substr(h+2);h=m.indexOf("%s");}return m;};jpf.hotkeys={};jpf.keyMods={ctrl:1,alt:2,shift:4,meta:8};jpf.keyNames={"32":"Spacebar","13":"Enter","9":"Tab","27":"Esc","46":"Del","36":"Home","35":"End","107":"+","37":"Left Arrow","38":"Up Arrow","39":"Right Arrow","40":"Down Arrow","33":"Page Up","34":"Page Down","112":"F1","113":"F2","114":"F3","115":"F4","116":"F5","117":"F6","118":"F7","119":"F8","120":"F9","121":"F10","122":"F11","123":"F12"};jpf.registerHotkey=function(a,m){var s=0,h;var q=a.splitSafe("\\-|\\+| ",null,true),n=false,t=false;for(var c=0;c<q.length;c++){if(jpf.keyMods[q[c]]){s=s|jpf.keyMods[q[c]];if(jpf.isMac){n=(jpf.keyMods[q[c]]===jpf.keyMods.ctrl);t=(jpf.keyMods[q[c]]===jpf.keyMods.meta);}}else{h=q[c];}}if(n&&!t){s=s|jpf.keyMods.meta;}(jpf.hotkeys[s]||(jpf.hotkeys[s]={}))[h]=m;if(!jpf.initHotkey){jpf.initHotkey=true;jpf.addEventListener("hotkey",function(y){if(jpf.isMac&&y.metaKey){y.ctrlKey=true;}var w=0|(y.ctrlKey?1:0)|(y.shiftKey?2:0)|(y.shiftKey?4:0)|(y.metaKey?8:0);var u=jpf.keyNames[y.keyCode];if(!w&&!u){return;}var v=(jpf.hotkeys[w]||{})[(u||String.fromCharCode(y.keyCode)).toLowerCase()];if(v){v();y.returnValue=false;}});}};jpf.removeHotkey=function(a){jpf.registerHotkey(a,null);};jpf.AbstractEvent=function(a,m){m=m||window;var h=m.document;a=a||m.event;if(a.$extended){return a;}this.$extended=true;this.event=a;this.type=a.type;this.target=a.target||a.srcElement;while(this.target&&this.target.nodeType==3){this.target=this.target.parentNode;}if(this.type.indexOf("key")!=-1){this.code=a.which||a.keyCode;}else{if(this.type.match(/(click|mouse|menu)/i)){h=(!h.compatMode||h.compatMode=="CSS1Compat")?h.html:h.body;this.page={x:a.pageX||a.clientX+(h?h.scrollLeft:0),y:a.pageY||a.clientY+(h?h.scrollTop:0)};this.client={x:(a.pageX)?a.pageX-m.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-m.pageYOffset:a.clientY};if(this.type.match(/DOMMouseScroll|mousewheel/)){this.wheel=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;}this.rightClick=(a.which==3)||(a.button==2);this.relatedTarget=null;if(this.type.match(/over|out/)){if(this.type=="mouseover"){this.relatedTarget=a.relatedTarget||a.fromElement;}else{if(this.type=="mouseout"){this.relatedTarget=a.relatedTarget||a.toElement;}else{try{while(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode;}}catch(c){}}}}}}this.shift=Boolean(a.shiftKey);this.control=Boolean(a.ctrlKey);this.alt=Boolean(a.altKey);this.meta=Boolean(a.metaKey);this.stop=function(){return this.stopPropagation().preventDefault();};this.stopPropagation=function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;};this.preventDefault=function(){if(this.event.preventDefault){this.event.preventDefault();}else{this.event.returnValue=false;}return this;};};jpf.AbstractEvent.KEYS={enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46,fromCode:function(c){for(var a in this){if(this[a]==c){return a;}return null;}}};jpf.AbstractEvent.stop=function(a){return(new jpf.AbstractEvent(a)).stop();};jpf.AbstractEvent.addListener=function(h,c,a){if(h.addEventListener){h.addEventListener(c,a,false);}else{if(h.attachEvent){h.attachEvent("on"+c,a);}}return this;};jpf.AbstractEvent.removeListener=function(h,c,a){if(h.removeEventListener){h.removeEventListener(c,a,false);}else{if(h.detachEvent){h.detachEvent("on"+c,a);}}return this;};jpf.setStyleRule=function(c,t,u,a,q){if(!a){var n=(q||self).document.styleSheets;for(var h=n.length-1;h>=0;h--){try{var v=n[h][jpf.styleSheetRules];for(var m=0;m<v.length;m++){if(v.item(m).selectorText==c){v.item(m).style[t]=u;return true;}}}catch(s){}}}else{var v=(q||self).document.styleSheets[a||0][jpf.styleSheetRules];for(var m=0;m<v.length;m++){if(v.item(m).selectorText==c){v.item(m).style[t]=u;return true;}}}return false;};jpf.getStyleRule=function(c,t,a,q){if(!a){var n=(q||self).document.styleSheets;for(var h=n.length-1;h>=0;h--){try{var u=n[h][jpf.styleSheetRules];for(var m=0;m<u.length;m++){if(u.item(m).selectorText==c){return u.item(m).style[t];}}}catch(s){}}}else{var u=(q||self).document.styleSheets[a||0][jpf.styleSheetRules];for(var m=0;m<u.length;m++){if(u.item(m).selectorText==c){return u.item(m).style[t];}}}return false;};jpf.setStyleClass=function(m,h,n,a){if(!m||this.disabled){return;}if(!h){h=" ";}if(n){n.push(h);}else{n=[h];}var c=new RegExp("(?:(^| +)"+n.join("|")+"($| +))","gi");m.className!=null?(m.className=m.className.replace(c," ")+" "+h):m.setAttribute("class",(m.getAttribute("class")||"").replace(c," ")+" "+h);return m;};jpf.importCssString=function(n,c,m){n=n||document;var h=n.getElementsByTagName("head")[0];if(!jpf.supportOpacity){c=c.replace(/opacity[ \s]*\:[ \s]*([\d\.]+)/g,function(q,s){return"filter:progid:DXImageTransform.Microsoft.Alpha(opacity="+(s*100)+")";});}if(jpf.canCreateStyleNode){var a=n.createElement("style");a.appendChild(n.createTextNode(c));if(m){a.setAttribute("media",m);}h.appendChild(a);}else{h.insertAdjacentHTML("beforeend",".<style media='"+(m||"all")+"'>"+c+"</style>");}};jpf.getStyleRecur=function(a,h){var c=jpf.hasComputedStyle?document.defaultView.getComputedStyle(a,"").getPropertyValue(h.replace(/([A-Z])/g,function(n,q){return"-"+q.toLowerCase();})):a.currentStyle[h];return((!c||c=="transparent"||c=="inherit")&&a.parentNode&&a.parentNode.nodeType==1)?this.getStyleRecur(a.parentNode,h):c;};jpf.isInRect=function(c,a,m){var h=this.getAbsolutePosition(c);if(a<h[0]||m<h[1]||a>c.offsetWidth+h[0]-10||m>c.offsetHeight+h[1]-10){return false;}return true;};jpf.getOverflowParent=function(a){a=a.offsetParent;while(a&&(this.getStyle(a,"overflow")!="hidden"||"absolute|relative".indexOf(this.getStyle(a,"position"))==-1)){a=a.offsetParent;}return a||document.documentElement;};jpf.getPositionedParent=function(a){a=a.offsetParent;while(a&&a.tagName.toLowerCase()!="body"&&"absolute|relative".indexOf(this.getStyle(a,"position"))==-1){a=a.offsetParent;}return a||document.documentElement;};jpf.getAbsolutePosition=function(s,c,q){var a=q?0:s.offsetLeft,m=q?0:s.offsetTop;s=q?s:s.offsetParent;var t,h;while(s&&s!=c){t=jpf.isOpera||jpf.isIE8?0:this.getStyle(s,jpf.descPropJs?"borderLeftWidth":"border-left-width");a+=(jpf.isIE&&s.currentStyle.borderLeftStyle!="none"&&t=="medium"?2:parseInt(t)||0)+s.offsetLeft;h=jpf.isOpera||jpf.isIE8?0:this.getStyle(s,jpf.descPropJs?"borderTopWidth":"border-top-width");m+=(jpf.isIE&&s.currentStyle.borderTopStyle!="none"&&h=="medium"?2:parseInt(h)||0)+s.offsetTop;if(s!=c&&(s.tagName!="HTML"||s.ownerDocument!=document)){a-=s.scrollLeft;m-=s.scrollTop;}if(s.tagName.toLowerCase()=="table"){m-=parseInt(s.border||0)+parseInt(s.cellSpacing||0);a-=parseInt(s.border||0)+parseInt(s.cellSpacing||0)*2;}else{if(s.tagName.toLowerCase()=="tr"){var n;m-=(n=parseInt(s.parentNode.parentNode.cellSpacing));while(s.previousSibling){m-=(s=s.previousSibling).offsetHeight+n;}}}if(jpf.isIE&&!s.offsetParent&&s.parentNode.nodeType==1){a-=s.parentNode.scrollLeft;m-=s.parentNode.scrollTop;}s=s.offsetParent;}return[a,m];};jpf.plane={init:function(){if(!this.plane){this.plane=document.createElement("DIV");document.body.appendChild(this.plane);this.plane.style.background="url(images/spacer.gif)";this.plane.style.position="absolute";this.plane.style.zIndex=100000000;this.plane.style.left=0;this.plane.style.top=0;}},lastCursor:null,show:function(s,m,h){this.init();var c=this.plane;this.current=s;if(!m){this.lastZ=this.current.style.zIndex;this.current.style.zIndex=100000;}else{this.plane.appendChild(s);}var a=(c.parentNode==document.body?(jpf.isIE?c.offsetParent.offsetWidth:window.innerWidth):c.parentNode.offsetWidth);var n=(c.parentNode==document.body?(jpf.isIE?c.offsetParent.offsetHeight:window.innerHeight):c.parentNode.offsetHeight);if(h){if(this.lastCursor===null){this.lastCursor=document.body.style.cursor;}document.body.style.cursor=jpf.getStyle(s,"cursor");}this.plane.style.display="block";var q=jpf.getDiff(c.parentNode);this.plane.style.width=(a-q[0])+"px";this.plane.style.height=(n-q[1])+"px";return c;},hide:function(){var a=jpf.xmldb.isChildOf(this.plane,document.activeElement);if(this.lastZ){if(this.current.style.zIndex==100000){this.current.style.zIndex=this.lastZ;}this.lastZ=null;}if(this.current.parentNode==this.plane){this.plane.parentNode.appendChild(this.current);}this.plane.style.display="none";if(a){if(!jpf.isIE){document.activeElement.focus();}jpf.window.focussed.$focus();}this.current=null;if(this.lastCursor!==null){document.body.style.cursor=this.lastCursor;this.lastCursor=null;}return this.plane;}};jpf.flash=(function(){function B(){var I,J,K;try{J=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");I=J.GetVariable("$version");}catch(K){}if(!I){try{J=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");I="WIN 6,0,21,0";J.AllowScriptAccess="always";I=J.GetVariable("$version");}catch(K){}}if(!I){try{J=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");I=J.GetVariable("$version");}catch(K){}}if(!I){try{J=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");I="WIN 3,0,18,0";}catch(K){}}if(!I){try{J=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");I="WIN 2,0,0,11";}catch(K){I=-1;}}return I;}function q(){var M=-1;var K=navigator.userAgent.toLowerCase();if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var O=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var L=navigator.plugins["Shockwave Flash"+O].description;var I=L.split(" ");var P=I[2].split(".");var J=P[0];var Q=P[1];var N=I[3];if(N==""){N=I[4];}if(N[0]=="d"){N=N.substring(1);}else{if(N[0]=="r"){N=N.substring(1);if(N.indexOf("d")>0){N=N.substring(0,N.indexOf("d"));}}}var M=J+"."+Q+"."+N;}}else{if(K.indexOf("webtv/2.6")!=-1){M=4;}else{if(K.indexOf("webtv/2.5")!=-1){M=3;}else{if(K.indexOf("webtv")!=-1){M=2;}else{if(jpf.isIE&&!jpf.isOpera){M=B();}}}}}return M;}function F(I,N,K){var O=q();if(O==-1){return false;}else{if(O!=0){var P;if(jpf.isIE&&!jpf.isOpera){var Q=O.split(" ");var L=Q[1];P=L.split(",");}else{P=O.split(".");}var J=P[0];var R=P[1];var M=P[2];if(J>parseFloat(I)){return true;}else{if(J==parseFloat(I)){if(R>parseFloat(N)){return true;}else{if(R==parseFloat(N)){if(M>=parseFloat(K)){return true;}}}}}return false;}}}function G(O,N,J,I){if(I=="undefined"){I=false;}var M=[];if(jpf.isIE&&!jpf.isOpera){M.push("<object ");for(var K in O){M.push(K,'="',O[K],'" ');}M.push(">");for(var K in N){M.push('<param name="',K,'" value="',N[K],'" /> ');}M.push("</object>");}else{M.push("<embed ");for(var K in J){M.push(K,'="',J[K],'" ');}M.push("> </embed>");}var L=M.join("");if(I===true){document.write(L);}return L;}function C(){var I=H(arguments,"movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");return G(I.objAttrs,I.params,I.embedAttrs);}function u(){var J=w(),I=Array.prototype.slice.call(arguments);if(v()&&!J){return A.apply(null,I);}if(J){return C.apply(null,I);}return'This content requires the <a href="http://www.adobe.com/go/getflash/">Adobe Flash Player</a>.';}function A(){var J=H(arguments,"movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash"),K=(jpf.isIE==true)?"ActiveX":"PlugIn",L=window.location;document.title=document.title.slice(0,47)+" - Flash Player Installation";var I=document.title;return C("src","playerProductInstall","FlashVars","MMredirectURL="+L+"&MMplayerType="+K+"&MMdoctitle="+I+"","width","100%","height","100%","align","middle","id",J.embedAttrs.name,"quality","high","bgcolor","#000000","name",J.embedAttrs.name,"allowScriptAccess","always","type","application/x-shockwave-flash","pluginspage","http://www.adobe.com/go/getflashplayer");}function H(J,N,L,O){var I={};I.embedAttrs={};I.params={};I.objAttrs={};for(var K=0;K<J.length;K=K+2){var M=J[K].toLowerCase();switch(M){case"classid":break;case"pluginspage":I.embedAttrs[J[K]]=J[K+1];break;case"src":case"movie":I.embedAttrs.src=J[K+1];I.params[N]=J[K+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":I.objAttrs[J[K]]=J[K+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":I.embedAttrs[J[K]]=I.objAttrs[J[K]]=J[K+1];break;default:I.embedAttrs[J[K]]=I.params[J[K]]=J[K+1];}}I.objAttrs.classid=L;if(O){I.embedAttrs.type=O;}return I;}function t(J){var I;if(typeof J=="object"){return J;}if(jpf.isIE){return window[J];}else{I=document[J]?document[J]:document.getElementById(J);if(!I){I=jpf.lookup(J);}return I;}}var a={};var c=1;function s(I){a[++c]=I;return c;}function z(I){return a[I];}function m(M,I){var L=a[M];if(L==null){throw new Error(jpf.formatErrorString(0,this,"Player with id: "+M+" not found"));}if(L[I]==null){throw new Error(jpf.formatErrorString(0,this,"Method "+I+" Not found"));}var J=[];for(var K=2;K<arguments.length;K++){J.push(y(arguments[K]));}L[I].apply(L,J);}function n(I){if(!I||typeof I!="string"){return I;}I=I.replace(/\&([^;]*)\;/g,"&amp;$1;");I=I.replace(/</g,"&lt;");I=I.replace(/>/g,"&gt;");I=I.replace("\\","&custom_backslash;");I=I.replace(/\0/g,"\\0");I=I.replace(/\"/g,"&quot;");return I;}function y(I){if(I&&I.length&&typeof I!="string"){I=I[0];}if(!I||typeof I!="string"){return I;}I=I.replace(/\&custom_lt\;/g,"<");I=I.replace(/\&custom_gt\;/g,">");I=I.replace(/\&custom_backslash\;/g,"\\");I=I.replace(/\\0/g,"\0");return I;}var D={};function v(J){if(typeof J!="string"){J="6.0.65";}var I=J.split(".");while(I.length<3){I.push("0");}if(typeof D[J]=="undefined"){D[J]=F(parseInt(I[0]),parseInt(I[1]),parseInt(I[2]));}return D[J];}function w(){return v("8.0.0");}var h={remote:"remote (domain-based) rules",localwithfile:"local with file access (no internet access)",localwithnetwork:"local with network (internet access only, no local access)",localtrusted:"local, trusted (local + internet access)"};function E(J){var I={type:null,description:null,noRemote:false,noLocal:false,error:null};I.type=J.toLowerCase();I.description=h[(typeof h[I.type]!="undefined"?I.type:"unknown")];if(I.type=="localwithfile"){I.noRemote=true;I.noLocal=false;I.error="Flash security note: Network/internet URLs will not load due to security restrictions.Access can be configured via Flash Player Global SecuritySettings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";}else{if(I.type=="localwithnetwork"){I.noRemote=false;I.noLocal=true;}else{if(I.type=="localtrusted"){I.noRemote=false;I.noLocal=false;}}}return I;}return{isAvailable:v,isEightAvailable:w,buildContent:u,encode:n,decode:y,getElement:t,addPlayer:s,getPlayer:z,callMethod:m,getSandbox:E};})();jpf.setcookie=function(h,n,c,s,m,q){var a=h+"="+escape(n)+";";if(c){a+="expires="+new Date(c+new Date().getTimezoneOffset()*60).toGMTString()+";";}if(s){a+="path="+s+";";}if(m){a+="domain="+m;}if(q){a+="secure";}document.cookie=a;return n;};jpf.getcookie=function(h){var c=document.cookie.split("; ");for(var m=0;m<c.length;m++){var a=c[m].split("=");if(h==a[0]){return unescape(a[1]);}}return"";};jpf.delcookie=function(a,c){document.cookie=a+"=blah; expires=Fri, 31 Dec 1999 23:59:59 GMT;"+(c?"domain="+c:"");};jpf.formatXml=function(m){if(!m){return"";}m=m.trim();var a=m.split("\n");for(var c=0;c<a.length;c++){a[c]=a[c].trim();}a=a.join("\n").replace(/\>\n/g,">").replace(/\>/g,">\n").replace(/\n\</g,"<").replace(/\</g,"\n<").split("\n");a.removeIndex(0);a.removeIndex(a.length);for(var h=0,c=0;c<a.length;c++){a[c]="\t".repeat((a[c].match(/^\s*\<\//)?--h:(a[c].match(/^\s*\<[^\?][^>]+[^\/]\>/)?h++:h)))+a[c];}return a.join("\n");};jpf.highlightXml=function(a){return a.replace(/^[\r\n]/g,"").replace(/</g,"_@A@_").replace(/>/g,"_@B@_").replace(/(\s[\w-]+)(\s*=\s*)("[^"]*")/g,'<span style="color:#e61414">$1</span>$2<span style="color:black">$3</span>').replace(/(\s[\w-]+)(\s*=\s*)('[^']*')/g,"<span style='color:#e61414'>$1</span>$2<span style='color:black'>$3</span>").replace(/\t/g,"&nbsp;&nbsp;&nbsp;").replace(/\n/g,"<br />").replace(/_@B@_/g,"<span style='color:#0866ab'>&gt;</span>").replace(/_@A@_([\-\!\[\\/\w:\.]+)?/g,"<span style='color:#0866ab'>&lt;$1</span>");};jpf.highlightCode=function(a){return a.replace(/^[\r\n]/g,"").replace(/</g,"_@A@_").replace(/>/g,"_@B@_").replace(/((?:\s|^)[\w-]+)(\s*=\s*)("[^"]*")/g,'<span style="color:red">$1</span>$2<span style="color:black">$3</span>').replace(/((?:\s|^)[\w-]+)(\s*=\s*)('[^']*')/g,"<span style='color:red'>$1</span>$2<span style='color:black'>$3</span>").replace(/(_@A@_[\s\S]*?_@B@_|<[\s\S]*?>)|(\/\/.*)$|("(?:[^"]+|\\.)*")|('(?:[^']+|\\.)*')|(\W)(break|continue|do|for|import|new|this|void|case|default|else|function|in|return|typeof|while|comment|delete|export|if|label|switch|var|with|abstract|implements|protected|boolean|instanceOf|public|byte|int|short|char|interface|static|double|long|synchronized|false|native|throws|final|null|transient|float|package|true|goto|private|catch|enum|throw|class|extends|try|const|finally|debugger|super)(\W)|(\W)(\w+)(\s*\()/gm,function(c,z,w,q,n,t,u,h,v,s,y){if(z){return z;}else{if(s){return v+'<span style="color:#ff8000">'+s+"</span>"+y;}else{if(w){return'<span style="color:green">'+w+"</span>";}else{if(q||n){return'<span style="color:#808080">'+(q||n)+"</span>";}else{if(t){return t+'<span style="color:#127ac6">'+u+"</span>"+h;}}}}}}).replace(/_@A@_(!--[\s\S]*?--)_@B@_/g,'<span style="color:green">&lt;$1&gt;</span>').replace(/\t/g,"&nbsp;&nbsp;&nbsp;").replace(/\n/g,"<br />").replace(/_@B@_/g,"<span style='color:#127ac6'>&gt;</span>").replace(/_@A@_([\-\!\[\\/\w:\.]+)?/g,"<span style='color:#127ac6'>&lt;$1</span>");};jpf.highlightCode2=function(a){var c=[];return a.replace(/(\/\*[\s\S]*?\*\/|\/\/.*)/g,function(h){c.push(h);return"###n"+(c.length-1)+"###";}).replace(/(\<)|(\>)/g,function(q,m,h){return"<span stylecolorwhite>"+(m?"@lt@":"@gt@")+"</span>";}).replace(/(\'.*?\'|\".*?\")/g,"<span stylecolorgray>$1</span>").replace(/(\W)-?([\d\.]+)(\W)/g,"$1<span stylecolor#127ac6>$2</span>$3").replace(/([\|\&\=\;\,\:\?\+\*\-]+)/g,"<span stylecolorwhite>$1</span>").replace(/(\W)(break|continue|do|for|import|new|this|void|case|default|else|function|in|return|typeof|while|comment|delete|export|if|label|switch|var|with|abstract|implements|protected|boolean|instanceOf|public|byte|int|short|char|interface|static|double|long|synchronized|false|native|throws|final|null|transient|float|package|true|goto|private|catch|enum|throw|class|extends|try|const|finally|debugger|super)(\W)/g,"$1<span stylecolorgreen>$2</span>$3").replace(/([\(\)\{\}\[\]])/g,"<span stylecoloryellow>$1</span>").replace(/###n(\d+)###/g,function(m,h){return"<span stylecolorpurple>"+c[h]+"</span>";}).replace(/stylecolor(.*?)\>/g,"style='color:$1'>").replace(/@(.*?)@/g,"&$1;");};jpf.formatJS=function(c){var h=0,a=0;var m=[];return c.replace(/(\/\*[\s\S]*?\*\/|\/\/.*)/g,function(n){m.push(n);return"###n"+(m.length-1)+"###";}).replace(/;+/g,";").replace(/{;/g,"{").replace(/({)|(})|(\()|(\))|(;)/g,function(n,w,y,s,t,u){if(w){h++;}if(y){h--;}if(s){a++;return s;}if(t){a--;return t;}var v="";for(var q=0;q<h;q++){v+="\t";}if(w){return"{\n"+v;}if(y){return"\n"+v+"}";}if(u){return(a>0)?u:(";\n"+v);}}).replace(/;\s*\n\s*\n/g,";\n").replace(/}var/g,"}\nvar").replace(/([\n\s]*)###n(\d+)###[\n\s]*/g,function(q,n,s){return n+m[s]+n;});};jpf.pasteWindow=function(c){var a=window.open("about:blank");a.document.write(c);};jpf.xmlEntityMap={quot:"34",amp:"38",apos:"39",lt:"60",gt:"62",nbsp:"160",iexcl:"161",cent:"162",pound:"163",curren:"164",yen:"165",brvbar:"166",sect:"167",uml:"168",copy:"169",ordf:"170",laquo:"171",not:"172",shy:"173",reg:"174",macr:"175",deg:"176",plusmn:"177",sup2:"178",sup3:"179",acute:"180",micro:"181",para:"182",middot:"183",cedil:"184",sup1:"185",ordm:"186",raquo:"187",frac14:"188",frac12:"189",frac34:"190",iquest:"191",Agrave:"192",Aacute:"193",Acirc:"194",Atilde:"195",Auml:"196",Aring:"197",AElig:"198",Ccedil:"199",Egrave:"200",Eacute:"201",Ecirc:"202",Euml:"203",Igrave:"204",Iacute:"205",Icirc:"206",Iuml:"207",ETH:"208",Ntilde:"209",Ograve:"210",Oacute:"211",Ocirc:"212",Otilde:"213",Ouml:"214",times:"215",Oslash:"216",Ugrave:"217",Uacute:"218",Ucirc:"219",Uuml:"220",Yacute:"221",THORN:"222",szlig:"223",agrave:"224",aacute:"225",acirc:"226",atilde:"227",auml:"228",aring:"229",aelig:"230",ccedil:"231",egrave:"232",eacute:"233",ecirc:"234",euml:"235",igrave:"236",iacute:"237",icirc:"238",iuml:"239",eth:"240",ntilde:"241",ograve:"242",oacute:"243",ocirc:"244",otilde:"245",ouml:"246",divide:"247",oslash:"248",ugrave:"249",uacute:"250",ucirc:"251",uuml:"252",yacute:"253",thorn:"254",yuml:"255",OElig:"338",oelig:"339",Scaron:"352",scaron:"353",Yuml:"376",fnof:"402",circ:"710",tilde:"732",Alpha:"913",Beta:"914",Gamma:"915",Delta:"916",Epsilon:"917",Zeta:"918",Eta:"919",Theta:"920",Iota:"921",Kappa:"922",Lambda:"923",Mu:"924",Nu:"925",Xi:"926",Omicron:"927",Pi:"928",Rho:"929",Sigma:"931",Tau:"932",Upsilon:"933",Phi:"934",Chi:"935",Psi:"936",Omega:"937",alpha:"945",beta:"946",gamma:"947",delta:"948",epsilon:"949",zeta:"950",eta:"951",theta:"952",iota:"953",kappa:"954",lambda:"955",mu:"956",nu:"957",xi:"958",omicron:"959",pi:"960",rho:"961",sigmaf:"962",sigma:"963",tau:"964",upsilon:"965",phi:"966",chi:"967",psi:"968",omega:"969",thetasym:"977",upsih:"978",piv:"982",ensp:"8194",emsp:"8195",thinsp:"8201",zwnj:"8204",zwj:"8205",lrm:"8206",rlm:"8207",ndash:"8211",mdash:"8212",lsquo:"8216",rsquo:"8217",sbquo:"8218",ldquo:"8220",rdquo:"8221",bdquo:"8222",dagger:"8224",Dagger:"8225",bull:"8226",hellip:"8230",permil:"8240",prime:"8242",Prime:"8243",lsaquo:"8249",rsaquo:"8250",oline:"8254",frasl:"8260",euro:"8364",image:"8465",weierp:"8472",real:"8476",trade:"8482",alefsym:"8501",larr:"8592",uarr:"8593",rarr:"8594",darr:"8595",harr:"8596",crarr:"8629",lArr:"8656",uArr:"8657",rArr:"8658",dArr:"8659",hArr:"8660",forall:"8704",part:"8706",exist:"8707",empty:"8709",nabla:"8711",isin:"8712",notin:"8713",ni:"8715",prod:"8719",sum:"8721",minus:"8722",lowast:"8727",radic:"8730",prop:"8733",infin:"8734",ang:"8736",and:"8743",or:"8744",cap:"8745",cup:"8746","int":"8747",there4:"8756",sim:"8764",cong:"8773",asymp:"8776",ne:"8800",equiv:"8801",le:"8804",ge:"8805",sub:"8834",sup:"8835",nsub:"8836",sube:"8838",supe:"8839",oplus:"8853",otimes:"8855",perp:"8869",sdot:"8901",lceil:"8968",rceil:"8969",lfloor:"8970",rfloor:"8971",lang:"9001",rang:"9002",loz:"9674",spades:"9824",clubs:"9827",hearts:"9829",diams:"9830"};jpf.htmlentities=function(a){return a.escapeHTML();};jpf.xmlentities=function(a){return a.replace(/&([a-z]+);/gi,function(h,c){if(jpf.xmlEntityMap[c]){return"&#"+jpf.xmlEntityMap[c]+";";}return h;});};jpf.html_entity_decode=function(a){return(a||"").replace(/\&\#38;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&nbsp;/g," ");};jpf.randomGenerator={d:new Date(),seed:null,A:48271,M:2147483647,Q:null,R:null,oneOverM:null,generate:function(c,a){if(this.seed==null){this.seed=2345678901+(this.d.getSeconds()*16777215)+(this.d.getMinutes()*65535);}this.Q=this.M/this.A;this.R=this.M%this.A;this.oneOverM=1/this.M;return Math.floor((a-c+1)*this.next()+c);},next:function(){var a=this.seed/this.Q;var c=this.seed%this.Q;var h=this.A*c-this.R*a;if(h>0){this.seed=h;}else{this.seed=h+this.M;}return(this.seed*this.oneOverM);}};jpf.getNoCacheUrl=function(a){return a+(a.indexOf("?")==-1?"?":"&")+"nocache="+new Date().getTime();};jpf.parseExpression=function(str){if(!jpf.parseExpression.regexp.test(str)){return str;}return eval(RegExp.$1);};jpf.parseExpression.regexp=/^\{(.*)\}$/;jpf.formatNumber=function(a,h){var c=parseFloat(a);if(!c){return a;}var m=new String(Math.round(c*100)/100).replace(/(\.\d?\d?)$/,function(n){return n.pad(3,"0",jpf.PAD_RIGHT);});if(m.indexOf(".")==-1){m+=".00";}return h+m;};jpf.JSONSerialize={object:function(c){if(c.nodeType&&c.cloneNode){return"jpf.xmldb.getXml("+this.string(jpf.xmldb.serializeNode(c))+")";}var a=[];for(var h in c){a.push('"'+h.replace(/(["\\])/g,"\\$1")+'": '+jpf.serialize(c[h]));}return"{"+a.join(", ")+"}";},string:function(a){a='"'+a.replace(/(["\\])/g,"\\$1")+'"';return a.replace(/(\n)/g,"\\n").replace(/\r/g,"");},number:function(a){return a.toString();},"boolean":function(a){return a.toString();},date:function(t){var w=function(h,m){h=m+h;return h.substring(h.length-m.length);};var v=w(t.getUTCFullYear(),"0000");var c=w(t.getUTCMonth()+1,"00");var a=w(t.getUTCDate(),"00");var q=w(t.getUTCHours(),"00");var n=w(t.getUTCMinutes(),"00");var z=w(t.getUTCSeconds(),"00");var u=v+c+a+"T"+q+":"+n+":"+z;return'{"jsonclass":["sys.ISODate", ["'+u+'"]]}';},array:function(c){for(var m=[],h=0;h<c.length;h++){m.push(jpf.serialize(c[h]));}return"["+m.join(", ")+"]";}};jpf.serialize=function(a){if(typeof a=="function"||jpf.isNot(a)){return"null";}return jpf.JSONSerialize[a.dataType||"object"](a);};jpf.unserialize=function(str,secure){if(!str){return str;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str.replace(/\\./g,"@").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,""))){return str;}return eval("("+str+")");};jpf.exec=function(str,win){if(!str){return str;}if(!win){win=self;}if(jpf.hasExecScript){win.execScript(str);}else{var head=win.document.getElementsByTagName("head")[0];if(head){var script=win.document.createElement("script");script.setAttribute("type","text/javascript");script.text=str;head.appendChild(script);head.removeChild(script);}else{eval(str,win);}}return str;};jpf.K=function(){};jpf.isNull=function(a){if(a){return false;}return(a==null||!String(a).length);};jpf.isNumber=function(a){return parseFloat(a)==a;};jpf.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]";};jpf.isTrue=function(a){return(a===true||a==="true"||a==="on"||typeof a=="number"&&a>0||a==="1");};jpf.isFalse=function(a){return(a===false||a==="false"||a==="off"||a===0||a==="0");};jpf.isNot=function(a){return(!a&&typeof a!="string"&&a!==0||(typeof a=="number"&&!isFinite(a)));};jpf.getDirname=function(a){return((a||"").match(/^(.*\/)[^\/]*$/)||{})[1];};jpf.getFilename=function(a){return((a||"").split("?")[0].match(/(?:\/|^)([^\/]+)$/)||{})[1];};jpf.getAbsolutePath=function(c,a){return !a||a.match(/^\w+\:\/\//)?a:c+a;};jpf.removePathContext=function(c,a){if(!a){return"";}if(a.indexOf(c)>-1){return a.substr(c.length);}return a;};jpf.cancelBubble=function(a,c){a.cancelBubble=true;if(c.$focussable&&!c.disabled){jpf.window.$focus(c);}};jpf.getXmlValue=function(c,a){if(!c){return"";}c=c.selectSingleNode(a);if(c&&c.nodeType==1){c=c.firstChild;}return c?c.nodeValue:"";};jpf.getXmlValues=function(q,c){var h=[];if(!q){return h;}var a=q.selectNodes(c);if(!a.length){return h;}for(var m=0;m<a.length;m++){var s=a[m];if(s.nodeType==1){s=s.firstChild;}h.push(s.nodeValue||"");}return h;};jpf.removeNode=function(a){if(!a){return;}if(!jpf.isIE||a.ownerDocument!=document){if(a.parentNode){a.parentNode.removeChild(a);}return;}var c=document.getElementById("IELeakGarbageBin");if(!c){c=document.createElement("DIV");c.id="IELeakGarbageBin";c.style.display="none";document.body.appendChild(c);}c.appendChild(a);c.innerHTML="";};jpf.getRules=function(c){var h={};for(var a=c.firstChild;a;a=a.nextSibling){if(a.nodeType!=1){continue;}else{if(!h[a[jpf.TAGNAME]]){h[a[jpf.TAGNAME]]=[];}h[a[jpf.TAGNAME]].push(a);}}return h;};jpf.getBox=function(m,h){if(!h){h=0;}if(m==null||(!parseInt(m)&&parseInt(m)!=0)){return[0,0,0,0];}var a=m.split(" ");for(var c=0;c<a.length;c++){a[c]=parseInt(a[c])||0;}switch(a.length){case 1:a[1]=a[0];a[2]=a[0];a[3]=a[0];break;case 2:a[2]=a[0];a[3]=a[1];break;case 3:a[3]=a[1];break;}return a;};jpf.getNode=function(h,a){var m=0;if(h!=null){for(var c=0;c<h.childNodes.length;c++){if(h.childNodes[c].nodeType==1){if(m==a[0]){h=h.childNodes[c];if(a.length>1){a.shift();h=this.getNode(h,a);}return h;}m++;}}}return null;};jpf.getFirstElement=function(a){return a.firstChild.nodeType==1?a.firstChild:a.firstChild.nextSibling;};jpf.getLastElement=function(a){return a.lastChild.nodeType==1?a.lastChild:a.lastChild.previousSibling;};jpf.selectTextHtml=function(c){if(!jpf.hasMsRangeObject){return;}var a=document.selection.createRange();try{a.moveToElementText(c);}catch(h){}a.select();};jpf.popup={cache:{},focusFix:{INPUT:1,TEXTAREA:1,SELECT:1},setContent:function(n,m,h,c,a){if(!this.popup){this.init();}this.cache[n]={content:m,style:h,width:c,height:a};m.style.position="absolute";m.onmousedown=function(q){if(!q){q=event;}(q||event).cancelBubble=true;};return m.ownerDocument;},removeContent:function(a){this.cache[a]=null;delete this.cache[a];},init:function(){this.popup={};jpf.addEventListener("hotkey",function(a){if(a.keyCode=="27"||a.altKey){jpf.popup.forceHide();}});},show:function(v,w){w=jpf.extend({x:0,y:0,animate:false,ref:null,width:null,height:null,callback:null,draggable:false,resizable:false,allowTogether:false,autoCorrect:true},w);if(!this.popup){this.init();}if((!w.allowTogether||w.allowTogether!=this.last)&&this.last!=v){this.hide();}var h=this.cache[v];h.options=w;var a=h.content;if(!h.content.style.zIndex){h.content.style.zIndex=10000000;}if(h.content.style.display&&h.content.style.display.indexOf("none")>-1){h.content.style.display="";}if(w.ref){var s=jpf.getAbsolutePosition(w.ref,h.content.offsetParent||h.content.parentNode),t=(w.y||0)+s[1],c=jpf.getOverflowParent(h.content);if(w.width||h.width){a.style.width=((w.width||h.width)-3)+"px";}var n=w.autoCorrect&&(t+(w.height||h.height||h.content.offsetHeight))>(c==document.documentElement?(jpf.isIE?c.offsetHeight:(window.innerHeight+window.pageYOffset)):c.offsetHeight+c.scrollTop);a.style.top=(n?(t-(w.height||h.height||h.content.offsetHeight)):t)+"px";a.style.left=((w.x||0)+s[0])+"px";}if(w.animate){if(w.animate=="fade"){jpf.tween.single(a,{type:"fade",from:0,to:1,anim:jpf.tween.NORMAL,steps:jpf.isIE?5:10});}else{var u,q=jpf.isIE8?5:7,m=0;u=setInterval(function(){var y=++m*((w.height||h.height)/q);a.style.height=y+"px";if(n){a.style.top=(t-y-w.y)+"px";}else{a.scrollTop=10000;}a.style.display="block";if(m>=q){clearInterval(u);if(w.callback){w.callback(a);}}},10);}}else{if(w.height||h.height){a.style.height=(w.height||h.height)+"px";}if(w.callback){w.callback(a);}}setTimeout(function(){jpf.popup.last=v;});if(w.draggable){w.id=v;this.makeDraggable(w);}},hide:function(){if(this.isDragging){return;}var a=this.cache[this.last];if(a){if(a.content){a.content.style.display="none";}if(a.options.onclose){a.options.onclose(jpf.extend(a.options,{htmlNode:a.content}));a.options.onclose=false;}}},isShowing:function(a){return this.last&&this.last==a&&this.cache[this.last]&&this.cache[this.last].content.style.display!="none";},isDragging:false,makeDraggable:function(a){if(!jpf.Interactive||this.cache[a.id].draggable){return;}var c=this.cache[a.id].content;this.cache[a.id].draggable=true;var h={$propHandlers:{},minwidth:10,minheight:10,maxwidth:10000,maxheight:10000,dragOutline:false,resizeOutline:false,draggable:true,resizable:a.resizable,oExt:c,oDrag:c.firstChild};c.onmousedown=c.firstChild.onmousedown=function(m){if(!m){m=event;}(m||event).cancelBubble=true;};jpf.implement.call(h,jpf.Interactive);h.$propHandlers.draggable.call(h,true);h.$propHandlers.resizable.call(h,true);},forceHide:function(){if(this.last&&!jpf.plane.current&&this.isShowing(this.last)){var a=jpf.lookup(this.last);if(!a){this.last=null;}else{if(a.dispatchEvent("popuphide")!==false){this.hide();}}}},destroy:function(){for(var a in this.cache){if(this.cache[a]){this.cache[a].content.onmousedown=null;jpf.removeNode(this.cache[a].content);this.cache[a].content=null;this.cache[a]=null;}}if(!this.popup){return;}}};jpf.namespace("nameserver",{lookup:{},add:function(a,c){if(!this.lookup[a]){this.lookup[a]=[];}return this.lookup[a].push(c)-1;},register:function(a,h,c){if(!this.lookup[a]){this.lookup[a]={};}return(this.lookup[a][h]=c);},get:function(a,c){return this.lookup[a]?this.lookup[a][c]:null;},getAll:function(h){var c,a=[];for(c in this.lookup[h]){if(jpf.isSafariOld&&(!this.lookup[h][c]||typeof this.lookup[h][c]!="object")){continue;}a.push(this.lookup[h][c]);}return a;},getAllNames:function(h){var c,a=[];for(c in this.lookup[h]){if(parseInt(c)==c){continue;}a.push(c);}return a;}});jpf.registry=jpf.extend({put:function(a,h,c){this.register(c,a,h);},getNamespaces:function(){},getKeys:function(a){return this.getAllNames(a);},remove:function(a,c){delete this.lookup[c][a];},clear:function(a){this.lookup={};},$export:function(h){var c,a;for(c in this.lookup){for(a in this.lookup[c]){h.put(a,this.lookup[a][c],c);}}}},jpf.nameserver);jpf.registry.lookup={};jpf.registry.get=function(a,c){return this.lookup[c]?this.lookup[c][a]:null;};jpf.JmlParser={sbInit:{},stateStack:[],modelInit:[],parse:function(a){this.$jml=a;jpf.isParsing=true;jpf.window=new jpf.WindowImplementation();jpf.document=new jpf.DocumentImplementation();jpf.window.document=jpf.document;jpf.window.$at=new jpf.actiontracker();jpf.window.$at.name="default";jpf.nameserver.register("actiontracker","default",jpf.window.$at);for(var h=[a],c=0;c<jpf.includeStack.length;c++){if(jpf.includeStack[c].nodeType){h.push(jpf.includeStack[c]);}}this.docs=h;this.parseSettings(h);if(!this.shouldWait){this.continueStartup();}},continueStartup:function(){this.parseFirstPass(this.docs);jpf.JmlParser.parseChildren(this.$jml,document.body,jpf.document.documentElement);if(jpf.appsettings.layout){jpf.layout.loadFrom(jpf.appsettings.layout);}setTimeout("jpf.JmlParser.parseLastPass();",1);this.inited=true;},parseSettings:function(c){for(var a=0;a<c.length;a++){this.preLoadRef(c[a],["appsettings"]);}},parseFirstPass:function(c){for(var a=0;a<c.length;a++){this.preLoadRef(c[a],["teleport","settings","skin[not(@j_preparsed=9999)]","bindings[@id]","actions[@id]","dragdrop[@id]","remote"]);}for(var a=0;a<c.length;a++){this.preLoadRef(c[a],["model[@id]","smartbinding[@id]","iconmap"],true);}},preparsed:[],preLoadRef:function(w,m,s){var u=jpf.findPrefix(w,jpf.ns.jml);if(u){u+=":";}var c=jpf.xmldb.selectNodes(".//"+u+m.join("|.//"+u)+(s?"|"+u+"model":""),w);var t,h,a,n,v,q;for(t=0,q=c.length;t<q;t++){v=c[t];if(jpf.xmldb.getInheritedAttribute(v,"render")=="runtime"){continue;}var n=v[jpf.TAGNAME];if(this.handler[n]){h=this.handler[n](v);a=v.getAttribute("id");if(h&&a){jpf.nameserver.register(n,a,h);}if(!h||!h.nodeFunc){h=new jpf.JmlDom(n,null,jpf.NODE_HIDDEN,v,h);}h.$jmlLoaded=true;if(a){jpf.setReference(a,h);}v.setAttribute("j_preparsed",this.preparsed.push(h)-1);}else{if(v.parentNode){v.parentNode.removeChild(v);}}}},parseMoreJml:function(t,a,n,u,s,q){var m=jpf.isParsing;jpf.isParsing=true;if(!jpf.window){jpf.window=new jpf.WindowImplementation();jpf.document=new jpf.DocumentImplementation();jpf.window.document=jpf.document;jpf.window.$at=new jpf.actiontracker();jpf.nameserver.register("actiontracker","default",jpf.window.$at);}if(!n){n=jpf.document.documentElement;}this.parseFirstPass([t]);if(s){if(n.loadJml){n.loadJml(t,n.parentNode);}n.$jmlLoaded=true;if(n&&n.pData){jpf.layout.compileAlignment(n.pData);}if(n.pData||n.tagName=="grid"){jpf.layout.activateRules(pNode.oInt||document.body);}}else{var c=a.lastChild;this.parseChildren(t,a,n,false,u);if(q){var h=a.lastChild;while(c!=h){a.insertBefore(h,q);h=a.lastChild;}}}jpf.layout.activateRules();this.parseLastPass();jpf.isParsing=m;},reWhitespaces:/[\t\n\r]+/g,parseChildren:function(a,u,n,t,s){if(u==n.oInt&&n.childNodes.length&&n!=jpf.document.documentElement){return u;}if(t&&n&&n.hasFeature(__DELAYEDRENDER__)&&n.$checkDelay(a)){return u;}if(n){n.isRendered=true;}if(a.namespaceURI==jpf.ns.jml||a.tagUrn==jpf.ns.jml){this.lastNsPrefix=a.prefix||a.scopeName;}for(var c=0,h=0;h<a.childNodes.length;h++){var m=a.childNodes[h];if(m.nodeType==8){continue;}if(m.nodeType!=1){if(!u){continue;}if(jpf.isIE&&!m.nodeValue.trim()){continue;}if(m.nodeType==3||u.style&&m.nodeType==4){u.appendChild(u.ownerDocument.createTextNode(!jpf.hasTextNodeWhiteSpaceBug?m.nodeValue:m.nodeValue.replace(this.reWhitespaces," ")));}else{if(m.nodeType==4){u.appendChild(u.ownerDocument.createCDataSection(m.nodeValue));}}continue;}if(!this.nsHandler[m.namespaceURI||m.tagUrn||jpf.ns.xhtml]){continue;}this.nsHandler[m.namespaceURI||m.tagUrn||jpf.ns.xhtml].call(this,m,u,n,s);}if(u){if(n&&n.pData){jpf.layout.compileAlignment(n.pData);}if(!jpf.hasSingleRszEvent){jpf.layout.activateRules(u);}}return u;},addNamespaceHandler:function(c,a){this.nsHandler[c]=a;},nsHandler:{"http://www.javeline.com/2005/jml":function(t,c,s,u){var n=t[jpf.TAGNAME];if(n=="include"){var v=jpf.includeStack[t.getAttribute("iid")];this.parseChildren(v,c,s,null,true);}else{if(this.handler[n]){var m,h,a;if(h=t.getAttribute("j_preparsed")){t.removeAttribute("j_preparsed");m=this.preparsed[h];delete this.preparsed[h];if(m&&!m.parentNode){if(s.hasFeature&&s.hasFeature(__WITH_JMLDOM__)){m.$setParent(s);}else{m.parentNode=s;s.childNodes.push(m);}}return m;}m=this.handler[n](t,(u?null:s),c);a=t.getAttribute("id");if(m&&a){jpf.nameserver.register(n,a,m);}if(!m||!m.nodeFunc){m=new jpf.JmlDom(n,s,jpf.NODE_HIDDEN,t,m);}else{if(u){m.$setParent(s);}}m.$jmlLoaded=true;if(a){jpf.setReference(a,m);}}else{if(c){if(!jpf[n]){throw new Error("Could not find class "+n);}var q=n;var m=new jpf[q](c,n,t);if(t.getAttribute("id")){jpf.setReference(t.getAttribute("id"),m);}if(m.loadJml){m.loadJml(t,s);}m.$jmlLoaded=true;}}}return m;},"http://www.w3.org/1999/xhtml":function(w,a,v,y){var m=w.tagName.match(/table|object|embed/i)?true:false;if(w.tagName=="script"){return;}else{if(w.tagName=="option"){var c=a.appendChild(a.ownerDocument.createElement("option"));if(w.getAttribute("value")){c.setAttribute("value",w.getAttribute("value"));}}else{if(jpf.isIE){var c=(w.ownerDocument==a.ownerDocument)?a.appendChild(w.cloneNode(false)):jpf.xmldb.htmlImport(w.cloneNode(m),a);}else{if(jpf.isSafari){var c=(w.ownerDocument==a.ownerDocument)?a.appendChild(w):jpf.xmldb.htmlImport(w.cloneNode(m),a);}else{var c=(w.ownerDocument==a.ownerDocument)?a.appendChild(w.cloneNode(false)):jpf.xmldb.htmlImport(w.cloneNode(false),a);}}}}var h;var t=this.lastNsPrefix||jpf.findPrefix(w.parentNode,jpf.ns.jml)||"";if(t&&!w.style){if(!jpf.supportNamespaces){w.ownerDocument.setProperty("SelectionNamespaces","xmlns:"+t+"='"+jpf.ns.jml+"'");}t+=":";}var n={},u=!w.style&&w.selectNodes("@"+t+"*")||[];for(var q=0;q<u.length;q++){h=u[q][jpf.TAGNAME];if(h.match(/^(left|top|right|bottom|width|height|align)$/)){if(n.position){continue;}n.position=true;var s=new jpf.HtmlWrapper(a,c,t);if(w.getAttribute(t+"align")||w.getAttribute(t+"align-position")){s.enableAlignment();}else{if(w.getAttribute(t+"width")||w.getAttribute(t+"height")||w.getAttribute(t+"left")||w.getAttribute(t+"top")||w.getAttribute(t+"right")||w.getAttribute(t+"bottom")||w.getAttribute(t+"anchoring")=="true"){s.getDiff();s.setHorizontal(w.getAttribute(t+"left"),w.getAttribute(t+"right"),w.getAttribute(t+"width"));s.setVertical(w.getAttribute(t+"top"),w.getAttribute(t+"bottom"),w.getAttribute(t+"height"));}}}}if((jpf.canUseInnerHtmlWithTables||!m)&&w.tagName.toUpperCase()!="IFRAME"){this.parseChildren(w,c,v);}else{}return c;}},invalidJml:function(a,c){},handler:{script:function(c){if(c.getAttribute("src")){if(jpf.isOpera){setTimeout(function(){jpf.window.loadCodeFile(jpf.hostPath+c.getAttribute("src"));},1000);}else{jpf.window.loadCodeFile(jpf.hostPath+c.getAttribute("src"));}}else{if(c.firstChild){var a=c.firstChild.nodeValue;jpf.exec(a);}}},"state-group":function(a,y){var c=a.getAttribute("name")||"stategroup"+jpf.all.length;var m=jpf.StateServer.addGroup(c,null,y);var h=a.childNodes,w=a.attributes,v=w.length;for(var t,u=0,s=h.length;u<s;u++){var n=h[u];if(n.nodeType!=1||n[jpf.TAGNAME]!="state"){continue;}for(t=0;t<v;t++){if(!n.getAttribute(w[t].nodeName)){n.setAttribute(w[t].nodeName,w[t].nodeValue);}}n.setAttribute("group",c);new jpf.state(y?y.pHtmlNode:document.body,"state",n).loadJml(n,m);}return m;},iconmap:function(h,c){var a=h.getAttribute("id");return jpf.skins.addIconMap({name:a,src:h.getAttribute("src"),type:h.getAttribute("type"),size:parseInt(h.getAttribute("size")),width:parseInt(h.getAttribute("width")),height:parseInt(h.getAttribute("height")),offset:(h.getAttribute("offset")||"0,0").splitSafe(",")});},window:function(c,a,m){var h=new jpf.modalwindow(m,"window",c);h.loadJml(c,a);return h;},style:function(a){jpf.importCssString(document,a.firstChild.nodeValue);},comment:function(a){},presentation:function(h){var a="skin"+Math.round(Math.random()*100000);h.parentNode.setAttribute("skin",a);jpf.skins.skins[a]={name:a,templates:{}};var c=h.parentNode[jpf.TAGNAME];var m=h.ownerDocument.createElement("skin");m.appendChild(h);jpf.skins.skins[a].templates[c]=m;},skin:function(h,c){if(c){var a="skin"+Math.round(Math.random()*100000);h.parentNode.setAttribute("skin",a);jpf.skins.skins[a]={name:a,templates:{}};jpf.skins.skins[a].templates[h.parentNode[jpf.TAGNAME]]=h;}else{if(h.childNodes.length){jpf.skins.Init(h);}else{var m=h.getAttribute("src")?jpf.getAbsolutePath(jpf.hostPath,h.getAttribute("src")):jpf.getAbsolutePath(jpf.hostPath,h.getAttribute("name"))+"/index.xml";jpf.loadJmlInclude(h,true,m);}}},model:function(h,c){var a=new jpf.model().loadJml(h,c);if(c&&c.hasFeature(__DATABINDING__)){modelId="model"+c.uniqueId;c.$jml.setAttribute("model",modelId);a.register(c);jpf.nameserver.register("model",modelId,a);}return a;},smartbinding:function(c,a){var h=new jpf.smartbinding(c.getAttribute("id"),c,a);if(a&&a.hasFeature(__DATABINDING__)){jpf.JmlParser.addToSbStack(a.uniqueId,h);}return h;},ref:function(c,a){if(!a||!a.hasFeature(__DATABINDING__)){return jpf.JmlParser.invalidJml(c);}jpf.JmlParser.getFromSbStack(a.uniqueId).addBindRule(c,a);},bindings:function(c,a){if(a&&a.hasFeature(__DATABINDING__)){jpf.JmlParser.getFromSbStack(a.uniqueId).addBindings(jpf.getRules(c),c);}return c;},action:function(c,a){if(!a||!a.hasFeature(__DATABINDING__)){return jpf.JmlParser.invalidJml(c);}jpf.JmlParser.getFromSbStack(a.uniqueId).addActionRule(c,a);},actions:function(c,a){if(a&&a.hasFeature(__DATABINDING__)){jpf.JmlParser.getFromSbStack(a.uniqueId).addActions(jpf.getRules(c),c);}return c;},actiontracker:function(h,c){var a=new jpf.actiontracker(c);a.loadJml(h);if(c){c.$at=a;}return a;},teleport:function(c,a){return jpf.teleport.loadJml(c,a);},appsettings:function(c,a){return jpf.appsettings.loadJml(c,a);},loader:function(a){}},getSmartBinding:function(a){return jpf.nameserver.get("smartbinding",a);},getActionTracker:function(c){var a=jpf.nameserver.get("actiontracker",c);if(a){return a;}if(self[c]){return self[c].getActionTracker();}},replaceNode:function(h,m){var a=m.childNodes;for(var c=a.length-1;c>=0;c--){if(a[c].host){a[c].host.pHtmlNode=h;}h.insertBefore(a[c],h.firstChild);}h.onresize=m.onresize;return h;},parseLastPass:function(){jpf.parsingFinalPass=true;while(this.hasNewSbStackItems){var sbInit=this.sbInit;this.sbInit={};this.hasNewSbStackItems=false;for(var uniqueId in sbInit){if(parseInt(uniqueId)!=uniqueId){continue;}var jNode=jpf.lookup(uniqueId);if(sbInit[uniqueId][0]){jNode.$propHandlers.smartbinding.call(jNode,sbInit[uniqueId][0],true);}if(sbInit[uniqueId][1]){jNode.$setMultiBind(sbInit[uniqueId][1]);}}}this.sbInit={};var s=this.stateStack;for(var i=0;i<s.length;i++){s[i].node.setDynamicProperty(s[i].name,s[i].value);}this.stateStack=[];while(this.hasNewModelStackItems){var jmlNode,modelInit=this.modelInit;this.modelInit={};this.hasNewModelStackItems=false;for(var data,i=0;i<modelInit.length;i++){data=modelInit[i][1];data[0]=data[0].substr(1);jmlNode=eval(data[0]);if(jmlNode.connect){jmlNode.connect(modelInit[i][0],null,data[2],data[1]||"select");}else{jmlNode.setModel(new jpf.model().loadFrom(data.join(":")));}}}this.modelInit=[];if(!jpf.loaded){jpf.dispatchEvent("load");}jpf.loaded=true;jpf.layout.activateRules();if(!this.loaded){if(!jpf.window.focussed){jpf.window.focusDefault();}this.loaded=true;}jpf.isParsing=false;jpf.parsingFinalPass=false;},addToSbStack:function(h,a,c){this.hasNewSbStackItems=true;return((this.sbInit[h]||(this.sbInit[h]=[]))[c||0]=a);},getFromSbStack:function(h,c,a){this.hasNewSbStackItems=true;if(c){if(!a){return(this.sbInit[h]||{})[c];}return this.sbInit[h]&&(this.sbInit[h][c]||(this.sbInit[h][c]=new jpf.smartbinding()))||((this.sbInit[h]=[])[c]=new jpf.smartbinding());}return !this.sbInit[h]&&(this.sbInit[h]=[new jpf.smartbinding()])[0]||this.sbInit[h][0]||(this.sbInit[h][0]=new jpf.smartbinding());},stackHasBindings:function(a){return(this.sbInit[a]&&this.sbInit[a][0]&&this.sbInit[a][0].bindings);},addToModelStack:function(c,a){this.hasNewModelStackItems=true;this.modelInit.push([c,a]);}};jpf.Init.run("jpf.JmlParser");jpf.JsltImplementation=function(){var bigRegExp=/([\w_\.]+)|(\s*,\s*)|(\s*;\s*)|((?:\s*)[\$\@\#\%\^\&\*\?\!](?:\s*))|(\s*[\+\-\<\>\|\=]+\s*)|(\s*\:\s*)|(\\[\\\{\}\[\]\"\'\/])|(\[)|(\])|(\s*\(\s*)|(\s*\)\s*)|(\s*\{\s*)|(\s*\}\s*)|(\')|(\")|(\/)|(\s+)/g;function isString(){if(typeof arguments[0]=="string"){return true;}if(typeof arguments[0]=="object"&&arguments[0].constructor){return(arguments[0].constructor.toString().match(/string/i)!=null);}return false;}function jesc(s,esc){if(!esc){return s;}if(!s){return"";}if(esc.toLowerCase()=="q"){return s.replace(/&/g,"&amp;").replace(/\'/g,"\\&squot").replace(/\"/g,"\\&quot").replace(/\r?\n/g,"\\n");}return s;}function jcpy(s,n,p){if(!n){return;}if(p){var t=n.selectNodes(p);if(!t||t.length==0){return;}for(var i=0;i<t.length;i++){s[s.length]=t[i].xml;}}else{s[s.length]=n.xml;}}function jxml(n,p){if(!n){return;}if(p){var o=[];var t=n.selectNodes(p);if(!t||t.length==0){return;}for(var i=0;i<t.length;i++){o[o.length]=t[i].xml;}}else{return n.xml;}return o.join("");}function jval(n,p){if(!n){return"";}if(p){n=n.selectSingleNode(p);}if(!n){return"";}if(n.nodeType==1){n=n.firstChild;}return n?n.nodeValue:"";}function jloc(n,f,p){if(!n||!p){return;}n=isString(p)?n.selectSingleNode(p):p;if(!n){return;}f(n);}function jdbg(a){jpf.console.info(a);}function jnod(n,p){if(!n){return"";}if(p){n=n.selectSingleNode(p);}if(!n){return null;}return n;}function jnds(n,p){if(!n){return"";}if(p){n=n.selectNodes(p);}if(!n){return null;}return n;}function jexs(n,p){if(!n){return false;}if(p){n=n.selectSingleNode(p);}return n!=null;}function jemp(n,p){if(!n){return false;}if(p){n=n.selectSingleNode(p);}if(!n){return true;}if(n.nodeType==1){n=n.firstChild;}return(n?n.nodeValue:"").match(/^[\s\r\n\t]*$/)!=null;}function jcnt(n,p){if(!n){return 0;}var t=n.selectNodes(p);return t?t.length:0;}function jpak(n,f,p){var s=[];f(s,n);return s.join("");}function jstore(n,pk,f,p){if(!p){p="def";}if(!pk[p]){pk[p]=[];}f(pk[p],n);return;}function jfetch(pk,p){if(!p){p="def";}if(pk[p]){return pk[p].join("");}return"";}function jfra(f,t,sp,ep){if(!t){return;}var end=ep==null?t.length:Math.min(t.length,(sp+ep));for(var i=(sp==null)?0:sp;i<end;i++){f(i,end,t[i]);}}function jvls(n,p){var r=[];if(!n){return r;}var t=n.selectNodes(p);if(!t){return r;}for(var i=0;i<t.length;i++){n=t[i];if(n.nodeType==1){n=n.firstChild;}r[i]=n?n.nodeValue:"";}return r;}function jpar(f,str){f((typeof str!="string")?str:parseXML(str).documentElement);}function jfor(n,f,p,sp,ep){if(!n){return;}var t=n.selectNodes(p);var end=ep==null?t.length:Math.min(t.length,(sp+ep));for(var i=(sp==null)?0:sp;i<end;i++){f(i,end,t[i]);}}var sort_intmask=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000"];var sort_dateFmtStr;var sort_dateFormat;var sort_dateReplace;function sort_dateFmt(str){sort_dateFmtStr=str;var result=str.match(/(D+|Y+|M+|h+|m+|s+)/g);if(!result){return;}for(var pos={},i=0;i<result.length;i++){pos[result[i].substr(0,1)]=i+1;}sort_dateFormat=new RegExp(str.replace(/[^\sDYMhms]/g,"\\$1").replace(/YYYY/,"(\\d\\d\\d\\d)").replace(/(DD|YY|MM|hh|mm|ss)/g,"(\\d\\d)"));sort_dateReplace="$"+pos.M+"/$"+pos.D+"/$"+pos.Y;if(pos.h){sort_dateReplace+=" - $"+pos.h+":$"+pos.m+":$"+pos.s;}}function sort_alpha(n){if(!n){return"";}if(n.nodeType==1){n=n.firstChild;}return n?n.nodeValue:"";}function sort_number(n){var t=sort_alpha(n);return(t.length<sort_intmask.length?sort_intmask[sort_intmask.length-t.length]:"")+t;}function sort_date(n,args){if(!sort_dateFormat||(args&&sort_dateFmtStr!=args[0])){sort_dateFmt(args?args[0]:"*");}var t=sort_alpha(n),d;if(sort_dateFmtStr=="*"){d=Date.parse(t);}else{d=(new Date(t.replace(sort_dateFormat,sort_dateReplace))).getTime();}t=""+parseInt(d);if(t=="NaN"){t="0";}return(t.length<sort_intmask.length?sort_intmask[sort_intmask.length-t.length]:"")+t;}function jsort(n,f,p,ps,sm,desc,sp,ep){sm=sm?sm:sort_alpha;var sa=[],t=n.selectNodes(p),i=t.length,args=null;if(typeof sm!="function"){var m=sm.shift();args=sm;sm=m;}while(i--){n=t[i].selectSingleNode(ps);if(n){sa[sa.length]={toString:function(){return this.v;},pn:t[i],v:sm(n,args)};}else{sa[sa.length]={toString:function(){return this.v;},pn:t[i],v:""};}}sa.sort();var end=ep==null?sa.length:Math.min(sa.length,(sp+ep));var start=(sp==null)?0:sp;if(desc){for(i=end-1;i>=start;i--){f(end-i-1,end,sa[i].pn,sa[i].v);}}else{for(i=start;i<end;i++){f(i,end,sa[i].pn,sa[i].v);}}}function japl(s,n,ma,p){if(!n){return;}var m=n.selectNodes(p||"node()");for(var i=0;i<m.length;i++){n=m[i];var f=ma[0][n.tagName];if(f){f(s,n);}else{for(var k=1;k<ma.length;k++){var sn=n.selectSingleNode(ma[k][0]);if(sn){ma[k][1](s,sn);break;}}}}}function jmat(ma,f,p){var s=p.split(/\|/),all=true;for(var i=0;i<s.length;i++){if(!s[i].match(/^[\w_]+$/)){all=false;}ma[0][s[i]]=f;}if(!all){p="self::"+p.replace(/\|/g,"|self::");ma[ma.length]=[p,f];}}function joff(n){for(var p=n.parentNode.childNodes,i=p.length-1;i>=0;i--){if(p[i]==n){return i;}}return"";}var types=["[","{","(","text","xpath","word","sep","ws","semi","sh","op","col","str","regex"];var closes=["]","}",")"];var func={last:[0,"(i==len-1)"],first:[0,"(i==0)"],offset:[0,"joff(n)"],out:[0,"s[s.length]"],apply:[1,";japl(s,n,ma,",");"],copy:[1,";jcpy(s,n,",");"],xml:[1,"jxml(n,",")"],value:[1,"jval(n,",")"],exists:[1,"jexs(n,",")"],empty:[1,"jemp(n,",")"],values:[1,"jvls(n,",")"],node:[1,"jnod(n,",")"],nodes:[1,"jnds(n,",")"],count:[1,"jcnt(n,",")"],context:[1,"(n=n.selectSingleNode(","))"],foreach:[2,";jfor(n,function(i,len,n){","},",");"],sort:[2,";jsort(n,function(i,len,n,sv){","},",");"],local:[2,";jloc(n,function(n){","},",");"],match:[2,";jmat(ma,function(s,n){","},",");"],pack:[2,"jpak(n,function(s,n){","},",")"],store:[2,"jstore(n,os,function(s,n){","},",");"],fetch:[1,"jfetch(os,",")"],parse:[2,"jpar(function(n){","},",");"],forarray:[3],macro:[4],pragma:[5],_:[6]};var short_0={"%":"s[s.length]="};var short_1={"$":["jval(n,",")"],"&":["jnod(n,",")"],"@":["(n=n.selectSingleNode(","))"],"~":["jexs(n,",")"],"!":["!jexs(n,",")"],"#":["jcnt(n,",")"],"^":[";japl(s,n,ma,",");"]};var short_2={"*":[";jfor(n,function(i,len,n){","},",")"]};function dump_tree(n,s,w){for(var i=0;i<n.length;i++){var m=n[i],t=m[0];if(t<3){s.push(w+types[t]);dump_tree(m[1],s,"&nbsp;&nbsp;"+w);s.push(closes[t]);s.push("\n");}else{s.push(w+types[t]+": "+m[1]+"\n");}}}this.jslt_inline=[];this.compile=function(str,trim_startspace){var pre;if(pre=str.match(/^var s\=\[(\d*)\]/)){if(pre[1]!=""){return[this.jslt_inline[pre[1]],str];}eval("var f = function(n){"+str+"};");return[f,str];}var err=[];var tree=[];var stack=[];var node=tree;var blevel=0,tpos=0;var istr=0,icc=0;var lm=0;var macros={};str=str.replace(/\/\*[\s\S]*?\*\//gm,"");str.replace(bigRegExp,function(m,word,sep,semi,sh,op,col,bs1,bo,bc,po,pc,co,cc,q1,q2,re,ws,pos){function add_track(t){var txt=trim_startspace?str.substr(tpos,pos-tpos).replace(/[\r\n]\s*/,"").replace(/^\s*[\r\n]/,"").replace(/\\s/g," ").replace(/[\r\n\t]/g,""):str.substr(tpos,pos-tpos).replace(/[\r\n\t]/g,"");if(txt.length>0){node[node.length]=[t,txt,tpos,pos];}}function add_node(t,data){node[node.length]=[t,data,pos];}function add_sub(t){var n=[];node[node.length]=[t,n,pos];stack[stack.length]=node;node=n;}function pop_sub(t){if(stack.length==0){err[err.length]=["extra "+closes[t],pos];}else{node=stack.pop();var ot=node[node.length-1][0];if(ot!=t){err[err.length]=["scope mismatch "+types[ot]+" with "+types[t],pos];}}}if(blevel==0||(bc&&blevel==1&&!istr)){if(icc==0){if(bo){add_track(3);blevel++;}if(bc){if(blevel==0){err[err.length]=["extra ]",pos];}else{blevel--;tpos=pos+1;}}}if(co){pos+=co.indexOf("{");add_track(3);tpos=pos+1;icc++;}if(cc){add_track(4);tpos=pos+cc.indexOf("}")+1;icc--;if(icc<0){err[err.length]=["extra }",pos];}}}else{if(!istr){if(word){add_node(5,m);if(m=="macro"){lm=1;}else{if(lm){macros[m]=1,lm=0;}}}if(sep){add_node(6,",");}if(ws){add_node(7,m);}if(semi){add_node(8,m);}if(sh){add_node(9,m);}if(op){add_node(10,m);}if(col){add_node(11,m);}if(bo){blevel++;add_sub(0);}if(bc){blevel--;pop_sub(0);}if(co){add_sub(1);}if(cc){pop_sub(1);}if(po){add_sub(2);}if(pc){pop_sub(2);}}if(q1){if(istr==0){istr=1;tpos=pos;}else{if(istr==1){istr=0;pos+=1;add_track(12);}}}if(q2){if(istr==0){istr=2;tpos=pos;}else{if(istr==2){istr=0;pos+=1;add_track(12);}}}if(re){if(istr==0){if(node.length==0||node[node.length-1][0]==6){istr=3;tpos=pos;}else{add_node(10,m);}}else{if(istr==3){istr=0;pos+=1;add_track(13);}}}}return m;});if(blevel==0){var txt=str.substr(tpos,str.length-tpos).replace(/[\r\n\t]/g,"");if(txt.length>0){node[node.length]=[3,txt,tpos,str.length];}}if(stack.length>0){for(var i=stack.length-1;i>=0;i--){var j=stack[i][stack[i].length-1];err[err.length]=["unclosed tag "+types[j[0]],j[2]];}}var s=["var s=[],ma=[{}],os={};"];var pragma_trace=0;function line_pos(cpos){var l=0;str.replace(/\n/g,function(m,pos){if(pos<cpos){l++;}return m;});return l;}function compile_recur(s,n,offset){var k=n.length;var d,e;for(var i=((offset==null)?0:offset);i<k;i++){var t=n[i][0];if(t==5){var nt1=(i<k-1)?n[i+1][0]:-1,nt2=(i<k-2)?n[i+2][0]:-1;var m=n[i][1];var d=func[m];if(d){switch(d[0]){case 0:s[s.length]=d[1];break;case 1:if(nt1!=2){err[err.length]=["Function "+m+" syntax error",n[i][2]];}else{s[s.length]=d[1];if(!compile_recur(s,n[i+1][1])){s[s.length]="null";}s[s.length]=d[2];i++;}break;case 2:if(nt1!=2||nt2!=1){err[err.length]=["Function "+m+" syntax error",n[i][2]];}else{s[s.length]=d[1];compile_recur(s,n[i+2][1]);s[s.length]=d[2];if(!compile_recur(s,n[i+1][1])){s[s.length]="null";}s[s.length]=d[3];i+=2;}break;case 3:var o,ok;if(i>k-3||n[i+1][0]!=2||n[i+2][0]!=1||(o=n[i+1][1])[0][0]!=5||(ok=o.length)<5||o[1][0]!=7||o[2][0]!=5||o[2][1]!="in"){err[err.length]=["forarray syntax error",n[i][2]];}else{s[s.length]=";jfra(function(i,len,"+o[0][1]+"){";compile_recur(s,n[i+2][1]);s[s.length]="},";compile_recur(s,o,3);s[s.length]=");";i+=2;}break;case 4:if(i>=k-4||n[i+1][0]!=7||n[i+2][0]!=5||n[i+3][0]!=2||n[i+4][0]!=1){err[err.length]=["macro syntax error at",n[0][2]];}else{s[s.length]="function "+n[i+2][1]+"(s,n,";if(!compile_recur(s,n[i+3][1])){s[s.length]="null";}s[s.length]="){";compile_recur(s,n[i+4][1]);s[s.length]="}";i+=4;}break;case 5:if(i>=k-3||n[i+1][0]!=7||n[i+2][0]!=5||n[i+3][0]!=2){err[err.length]=["macro syntax error at",n[0][2]];}else{switch(n[i+2][1]){case"trace":var ts=[];compile_recur(ts,n[i+3][1]);pragma_trace=eval(ts.join(""));break;}}i+=3;case 6:s[s.length]=';alert("Trace: '+line_pos(n[i][2])+'");';}}else{if(macros[m]&&nt1==2){s[s.length]=m+"(s,n,";if(!compile_recur(s,n[i+1][1])){s[s.length]="null";}s[s.length]=")";i++;}else{s[s.length]=m;}}}else{if(t==9){var nt1=(i<k-1)?n[i+1][0]:-1,nt2=(i<k-2)?n[i+2][0]:-1;var m=n[i][1];if(nt1==12){if(nt2==1){if(d=short_2[m]){s[s.length]=d[0];compile_recur(s,n[i+2][1]);s[s.length]=d[1]+n[i+1][1]+d[2];i+=2;lt=1;}else{s[s.length]=m;}}else{if(d=short_1[m]){if(nt2==11){s[s.length]=m;}else{s[s.length]=d[0]+n[i+1][1]+d[1];i++;}}else{if(d=short_0[m]){s[s.length]=d;}else{s[s.length]=m;}}}}else{if(d=short_0[m]){s[s.length]=d;}else{s[s.length]=m;}}}else{if(t<3){s[s.length]=types[t];compile_recur(s,n[i][1]);s[s.length]=closes[t];if((t==1&&i<k-1&&n[i+1][0]==5&&n[i+1][1]!="else")||(t==2&&i<k-1&&n[i+1][0]==5&&!n[i+1][1].match(/^\./)&&(i==0||n[i-1][0]!=5||!n[i-1][1].match(/^(if|for)$/)))){s[s.length]=";";}}else{if(t==3){s[s.length]=';s[s.length]="'+n[i][1].replace(/\"/g,'\\"').replace(/\n/g,"\\n")+'";';}else{if(t==4){var m=n[i][1].match(/^\^([\w])\s?/);if(m){s[s.length]=';s[s.length]=jesc(jval(n,"'+n[i][1].substr(2).replace(/"/g,'\\"')+'"),"'+m[1]+'");';}else{s[s.length]=';s[s.length]=jval(n,"'+n[i][1].replace(/"/g,'\\"')+'");';}}else{s[s.length]=n[i][1];}}}}}}return k;}if(err.length==0){compile_recur(s,tree);}if(err.length>0){var e=[];for(var i=0;i<err.length;i++){e[e.length]="Parse error("+line_pos(err[i][1])+"): "+err[i][0]+"\n";}throw new Error("Could not parse JSLT with: "+e.join("")+"\n");}s[s.length]=";return s.join('');";var strJS=s.join("");try{eval("var f = function(n){"+strJS+"};");}catch(e){throw new Error("Could not parse JSLT with: "+e.message);}return[f,strJS];};this.cache=[];this.apply=function(jsltNode,xmlNode){var jsltFunc,cacheId,jsltStr,doTest;xmlNode=jpf.xmldb.getBindXmlNode(xmlNode);if(typeof jsltNode=="object"){cacheId=jsltNode.getAttribute("cache");jsltFunc=this.cache[cacheId];if(!jsltFunc){var jsltStr=[],textNodes=jsltNode.selectNodes("text()");for(var i=0;i<textNodes.length;i++){jsltStr=textNodes[i].nodeValue;if(jsltStr.trim()){break;}}}}else{cacheId=jsltNode;jsltFunc=this.cache[cacheId];if(!jsltFunc){jsltStr=jsltNode;cacheId=null;}}if(!jsltFunc){jsltFunc=this.compile(jsltStr);}this.lastJslt=jsltStr;this.lastJs=jsltFunc[0];if(!jsltFunc[0]){return false;}if(!cacheId){if(typeof jsltNode=="object"){cacheId=this.cache.push(jsltFunc)-1;jsltNode.setAttribute("cache",cacheId);}else{this.cache[jsltStr]=jsltFunc;}}try{if(!xmlNode){return"";}return jsltFunc[0](xmlNode);}catch(e){jpf.console.info(jpf.formatJS(jsltFunc[1]));throw new Error(jpf.formatErrorString(0,null,"JSLT parsing","Could not execute JSLT with: "+e.message));}};};jpf.JsltInstance=new jpf.JsltImplementation();jpf.JSImplementation=function(){var a=["[","{","(","text","xpath","word","sep","ws","semi","sh","op","col","str","regex","comment"];var h=["]","}",")"];var c=new RegExp();c.compile("([\\w_\\.]+)|([\\s]*,[\\s]*)|([\\s]*;[\\s]*)|(\\/\\*)|(\\*\\/)|(\\/\\/)|([\\r\\n])|((?:[\\s]*)[\\$\\@\\#\\%\\^\\&\\*\\?\\!](?:[\\s]*))|([\\s]*[\\+\\-\\<\\>\\|\\=]+[\\s]*)|(\\s*\\:\\s*)|(\\s+)|(\\\\[\\\\\\{\\}\\[\\]\\\"\\'\\/])|(\\[)|(\\])|([\\s]*\\([\\s]*)|([\\s]*\\)[\\s]*)|([\\s]*\\{[\\s]*)|([\\s]*\\}[\\s]*)|(\\')|(\\\")|(\\/)","g");this.dump_tree=function(A,z,u){for(var y=0;y<A.length;y++){var q=A[y],v=q[0];if(v<3){z.push(u+a[v]);this.dump_tree(q[1],z,"  "+u);z.push(h[v]);z.push("\n");}else{z.push(u+a[v]+": "+q[1]+"\n");}}return z;};this.parse=function(B,q){var u=[];var D=[];var C=[];var s=D;var n=0,y=0;var t=0,m=0;var A=0;var z=[0,0,0];B.replace(c,function(Y,aa,T,ab,X,V,U,H,ac,Q,K,G,M,ae,J,Z,F,O,S,R,P,W,L){function N(ag){var af=q?B.substr(y,L-y).replace(/[\r\n]\s*/,"").replace(/^\s*[\r\n]/,"").replace(/[\r\n\t]/g,""):B.substr(y,L-y).replace(/[\r\n\t]/g,"");if(af.length>0){s[s.length]=[ag,af,y,L];}}function ad(af,ag){s[s.length]=[af,ag,L];}function I(af){z[af]++;var ag=[];s[s.length]=[af,ag,L];C[C.length]=s;s=ag;}function E(af){z[af]--;if(C.length==0){u[u.length]=["extra "+h[af],L];}else{s=C.pop();var ag=s[s.length-1][0];if(ag!=af){u[u.length]=["scope mismatch "+a[ag]+" with "+a[af],L];}}}if(!t){if(aa){ad(5,Y);if(Y=="macro"){A=1;}else{if(A){macros[Y]=1,A=0;}}}if(T){ad(6,",");}if(G){ad(7,Y);}if(ab){ad(8,Y);}if(ac){ad(9,Y);}if(Q){ad(10,Y);}if(K){ad(11,Y);}if(ae){I(0);}if(J){E(0);}if(O){I(1);}if(S){E(1);}if(Z){I(2);}if(F){E(2);}}if(U){if(t==0){t=5;y=L+2;}}if(H){if(t==5){t=0;L+=1;N(14);}}if(R){if(t==0){t=1;y=L;}else{if(t==1){t=0;L+=1;N(12);}}}if(P){if(t==0){t=2;y=L;}else{if(t==2){t=0;L+=1;N(12);}}}if(X){if(t==0){t=4;y=L+2;}}if(V){if(t==4){t=0;N(14);}}if(W){if(t==0){if(s.length==0||s[s.length-1][0]==6){t=3;y=L;}else{ad(10,Y);}}else{if(t==3){t=0;L+=1;N(13);}}}return Y;});if(C.length>0){for(var w=C.length-1;w>=0;w--){var v=C[w][C[w].length-1];u[u.length]=["unclosed tag "+a[v[0]],v[2]];}}return{tree:D,stack:C,err:u,count:z};};};jpf.JavascriptParser=new jpf.JSImplementation();jpf.url=function(s){var n;if(s.indexOf(":")==-1&&(n=window.location.toString()).indexOf(":")!=-1){n=new jpf.url(n);s=jpf.getAbsolutePath("http://"+n.host+"/"+(n.directory.charAt(n.directory.length-1)=="/"?n.directory:n.directory+"/"),s);}var q=jpf.url.options,c=q.parser[q.strictMode?"strict":"loose"].exec(s),h=14;this.uri=s.toString();while(h--){this[q.key[h]]=c[h]||"";}this[q.q.name]={};var a=this;this[q.key[12]].replace(q.q.parser,function(t,m,u){if(m){a[q.q.name][m]=u;}});this.isSameLocation=function(){if(this.uri.length&&this.uri.charAt(0)=="#"){return false;}if(!this.protocol&&!this.port&&!this.host){return true;}if(!this.protocol&&this.host&&this.port&&window.location.hostname==this.host&&window.location.port==this.port){return true;}if(!this.protocol&&this.host&&!this.port&&window.location.hostname==this.host&&window.location.port==80){return true;}return window.location.protocol==(this.protocol+":")&&window.location.hostname==this.host&&(window.location.port==this.port||!window.location.port&&!this.port);};};jpf.url.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};jpf.runXpath=function(){jpf.XPath={cache:{},getSelf:function(htmlNode,tagName,info,count,num,sResult){var numfound=0,result=null,data=info[count];if(data){data[0](htmlNode,data[1],info,count+1,numfound++,sResult);}else{sResult.push(htmlNode);}},getChildNode:function(htmlNode,tagName,info,count,num,sResult){var numfound=0,result=null,data=info[count];var nodes=htmlNode.childNodes;if(!nodes){return;}for(var i=0;i<nodes.length;i++){if(nodes[i].nodeType!=1){continue;}if(tagName&&(tagName!=nodes[i].tagName)&&(nodes[i].style?nodes[i].tagName.toLowerCase():nodes[i].tagName)!=tagName){continue;}htmlNode=nodes[i];if(data){data[0](nodes[i],data[1],info,count+1,numfound++,sResult);}else{sResult.push(nodes[i]);}}},doQuery:function(htmlNode,qData,info,count,num,sResult){var result=null,data=info[count];var query=qData[0];var returnResult=qData[1];try{var qResult=eval(query);}catch(e){return;}if(returnResult){return sResult.push(qResult);}if(!qResult||qResult.dataType=="array"&&!qResult.length){return;}if(data){data[0](htmlNode,data[1],info,count+1,0,sResult);}else{sResult.push(htmlNode);}},getTextNode:function(htmlNode,empty,info,count,num,sResult){var result=null,data=info[count];var nodes=htmlNode.childNodes;for(var i=0;i<nodes.length;i++){if(nodes[i].nodeType!=3&&nodes[i].nodeType!=4){continue;}if(data){data[0](nodes[i],data[1],info,count+1,i,sResult);}else{sResult.push(nodes[i]);}}},getAnyNode:function(htmlNode,empty,info,count,num,sResult){var result=null,data=info[count];var sel=[],nodes=htmlNode.getElementsByTagName("*");for(var i=0;i<nodes.length;i++){if(data){data[0](nodes[i],data[1],info,count+1,i,sResult);}else{sResult.push(nodes[i]);}}},getAttributeNode:function(htmlNode,attrName,info,count,num,sResult){if(!htmlNode||htmlNode.nodeType!=1){return;}if(attrName=="*"){var nodes=htmlNode.attributes;for(var i=0;i<nodes.length;i++){arguments.callee.call(this,htmlNode,nodes[i].nodeName,info,count,i,sResult);}return;}var result=null,data=info[count];var value=htmlNode.getAttributeNode(attrName);if(data){data[0](value,data[1],info,count+1,0,sResult);}else{if(value){sResult.push(value);}}},getAllNodes:function(htmlNode,x,info,count,num,sResult){var result=null,data=info[count];var tagName=x[0];var inclSelf=x[1];var prefix=x[2];if(inclSelf&&(htmlNode.tagName==tagName||tagName=="*")){if(data){data[0](htmlNode,data[1],info,count+1,0,sResult);}else{sResult.push(htmlNode);}}if(tagName=="node()"){tagName="*";prefix="";if(jpf.isIE){var nodes=htmlNode.getElementsByTagName("*");}else{var nodes=[];(function recur(x){for(var n,i=0;i<x.childNodes.length;i++){n=x.childNodes[i];if(n.nodeType!=1){continue;}nodes.push(n);if(n.tagName!="skin"&&n.tagName!="jslt"&&n.tagName!="ref"&&n.parentNode.tagName!="bindings"){recur(n);}}})(htmlNode);}}else{var nodes=htmlNode.getElementsByTagName((prefix&&(jpf.isGecko||jpf.isOpera)?prefix+":":"")+tagName);}for(var i=0;i<nodes.length;i++){if(data){data[0](nodes[i],data[1],info,count+1,i,sResult);}else{sResult.push(nodes[i]);}}},getAllAncestorNodes:function(htmlNode,x,info,count,num,sResult){var result=null,data=info[count];var tagName=x[0];var inclSelf=x[1];var prefix=x[2];var i=0,s=inclSelf?htmlNode:htmlNode.parentNode;while(s&&s.nodeType==1){if(s.tagName==tagName||tagName=="*"||tagName=="node()"){if(data){data[0](s,data[1],info,count+1,++i,sResult);}else{sResult.push(s);}}s=s.parentNode;}},getParentNode:function(htmlNode,empty,info,count,num,sResult){var result=null,data=info[count];var node=htmlNode.parentNode;if(data){data[0](node,data[1],info,count+1,0,sResult);}else{if(node){sResult.push(node);}}},getPrecedingSibling:function(htmlNode,tagName,info,count,num,sResult){var result=null,data=info[count];var node=htmlNode.previousSibling;while(node){if(tagName!="node()"&&(node.style?node.tagName.toLowerCase():node.tagName)!=tagName){node=node.previousSibling;continue;}if(data){data[0](node,data[1],info,count+1,0,sResult);}else{if(node){sResult.push(node);break;}}}},getFollowingSibling:function(htmlNode,tagName,info,count,num,sResult){var result=null,data=info[count];var node=htmlNode.nextSibling;while(node){if(tagName!="node()"&&(node.style?node.tagName.toLowerCase():node.tagName)!=tagName){node=node.nextSibling;continue;}if(data){data[0](node,data[1],info,count+1,0,sResult);}else{if(node){sResult.push(node);break;}}}},multiXpaths:function(contextNode,list,info,count,num,sResult){for(var i=0;i<list.length;i++){info=list[i][0];var rootNode=(info[3]?contextNode.ownerDocument.documentElement:contextNode);info[0](rootNode,info[1],list[i],1,0,sResult);}sResult.makeUnique();},compile:function(sExpr){var isAbsolute=sExpr.match(/^\//);sExpr=sExpr.replace(/\[(\d+)\]/g,"/##$1");sExpr=sExpr.replace(/\|\|(\d+)\|\|\d+/g,"##$1");sExpr=sExpr.replace(/\.\|\|\d+/g,".");sExpr=sExpr.replace(/\[([^\]]*)\]/g,function(match,m1){return"/##"+m1.replace(/\|/g,"_@_");});if(sExpr=="/"||sExpr=="."){return sExpr;}sExpr=sExpr.replace(/\/\//g,"descendant::");return this.processXpath(sExpr,isAbsolute);},processXpath:function(sExpr,isAbsolute){var results=new Array();sExpr=sExpr.replace(/'[^']*'/g,function(m){return m.replace("|","_@_");});sExpr=sExpr.split("|");for(var i=0;i<sExpr.length;i++){sExpr[i]=sExpr[i].replace(/_\@\_/g,"|");}if(sExpr.length==1){sExpr=sExpr[0];}else{for(var i=0;i<sExpr.length;i++){sExpr[i]=this.processXpath(sExpr[i]);}results.push([this.multiXpaths,sExpr]);return results;}var sections=sExpr.split("/");for(var i=0;i<sections.length;i++){if(sections[i]=="."||sections[i]==""){continue;}else{if(sections[i]==".."){results.push([this.getParentNode,null]);}else{if(sections[i].match(/^[\w-_\.]+(?:\:[\w-_\.]+){0,1}$/)){results.push([this.getChildNode,sections[i]]);}else{if(sections[i].match(/^\#\#(\d+)$/)){results.push([this.doQuery,["num+1 == "+parseInt(RegExp.$1)]]);}else{if(sections[i].match(/^\#\#(.*)$/)){var query=RegExp.$1;var m=[query.match(/\(/g),query.match(/\)/g)];if(m[0]||m[1]){while(!m[0]&&m[1]||m[0]&&!m[1]||m[0].length!=m[1].length){if(!sections[++i]){break;}query+="/"+sections[i];m=[query.match(/\(/g),query.match(/\)/g)];}}results.push([this.doQuery,[this.compileQuery(query)]]);}else{if(sections[i]=="*"){results.push([this.getChildNode,null]);}else{if(sections[i].substr(0,2)=="[]"){results.push([this.getAllNodes,["*",false]]);}else{if(sections[i].match(/descendant-or-self::node\(\)$/)){results.push([this.getAllNodes,["*",true]]);}else{if(sections[i].match(/descendant-or-self::([^\:]*)(?:\:(.*)){0,1}$/)){results.push([this.getAllNodes,[RegExp.$2||RegExp.$1,true,RegExp.$1]]);}else{if(sections[i].match(/descendant::([^\:]*)(?:\:(.*)){0,1}$/)){results.push([this.getAllNodes,[RegExp.$2||RegExp.$1,false,RegExp.$1]]);}else{if(sections[i].match(/ancestor-or-self::([^\:]*)(?:\:(.*)){0,1}$/)){results.push([this.getAllAncestorNodes,[RegExp.$2||RegExp.$1,true,RegExp.$1]]);}else{if(sections[i].match(/ancestor::([^\:]*)(?:\:(.*)){0,1}$/)){results.push([this.getAllAncestorNodes,[RegExp.$2||RegExp.$1,false,RegExp.$1]]);}else{if(sections[i].match(/^\@(.*)$/)){results.push([this.getAttributeNode,RegExp.$1]);}else{if(sections[i]=="text()"){results.push([this.getTextNode,null]);}else{if(sections[i]=="node()"){results.push([this.getChildNode,null]);}else{if(sections[i].match(/following-sibling::(.*)$/)){results.push([this.getFollowingSibling,RegExp.$1.toLowerCase()]);}else{if(sections[i].match(/preceding-sibling::(.*)$/)){results.push([this.getPrecedingSibling,RegExp.$1.toLowerCase()]);}else{if(sections[i]=="self::node()"){results.push([this.getSelf,null]);}else{if(sections[i].match(/self::(.*)$/)){results.push([this.doQuery,["jpf.XPath.doXpathFunc(htmlNode, 'local-name') == '"+RegExp.$1+"'"]]);}else{var query=sections[i];var m=[query.match(/\(/g),query.match(/\)/g)];if(m[0]||m[1]){while(!m[0]&&m[1]||m[0]&&!m[1]||m[0].length!=m[1].length){if(!sections[++i]){break;}query+="/"+sections[i];m=[query.match(/\(/g),query.match(/\)/g)];}}results.push([this.doQuery,[this.compileQuery(query),true]]);}}}}}}}}}}}}}}}}}}}}results[0][3]=isAbsolute;return results;},compileQuery:function(code){var c=new jpf.CodeCompilation(code);return c.compile();},doXpathFunc:function(contextNode,type,nodelist,arg2,arg3,xmlNode){if(!nodelist||nodelist.length==0){nodelist="";}if(type=="not"){return !nodelist;}if(typeof nodelist=="object"||nodelist.dataType=="array"){if(nodelist&&!nodelist.length){nodelist=[nodelist];}var res=false,value,xmlNode;for(var i=0;i<nodelist.length;i++){xmlNode=nodelist[i];if(!xmlNode||typeof xmlNode=="string"){value=xmlNode;}else{if(xmlNode.nodeType==1&&xmlNode.firstChild&&xmlNode.firstChild.nodeType!=1){xmlNode=xmlNode.firstChild;}value=xmlNode.nodeValue;}if(res=arguments.callee.call(this,contextNode,type,value,arg2,arg3,xmlNode)){return res;}}return res;}else{arg1=nodelist;}switch(type){case"position":return jpf.xmldb.getChildNumber(contextNode)+1;case"format-number":return jpf.formatNumber(arg1);case"floor":return Math.floor(arg1);case"ceiling":return Math.ceil(arg1);case"starts-with":return arg1?arg1.substr(0,arg2.length)==arg2:false;case"string-length":return arg1?arg1.length:0;case"count":return arg1?arg1.length:0;case"last":return arg1?arg1[arg1.length-1]:null;case"local-name":return xmlNode?xmlNode.tagName:contextNode.tagName;case"substring":return arg1&&arg2?arg1.substring(arg2,arg3||0):"";case"contains":return arg1&&arg2?arg1.indexOf(arg2)>-1:false;case"concat":for(var str="",i=1;i<arguments.length;i++){if(typeof arguments[i]=="object"){str+=getNodeValue(arguments[i][0]);continue;}str+=arguments[i];}return str;case"translate":for(var i=0;i<arg2.length;i++){arg1=arg1.replace(arg2.substr(i,1),arg3.substr(i,1));}return arg1;}},selectNodeExtended:function(sExpr,contextNode,match){var sResult=this.selectNodes(sExpr,contextNode);if(sResult.length==0){return null;}if(!match){return sResult;}for(var i=0;i<sResult.length;i++){if(getNodeValue(sResult[i])==match){return[sResult[i]];}}return null;},getRoot:function(xmlNode){while(xmlNode.parentNode&&xmlNode.parentNode.nodeType==1){xmlNode=xmlNode.parentNode;}return xmlNode;},selectNodes:function(sExpr,contextNode){if(!this.cache[sExpr]){this.cache[sExpr]=this.compile(sExpr);}if(typeof this.cache[sExpr]=="string"){if(this.cache[sExpr]=="."){return[contextNode];}if(this.cache[sExpr]=="/"){return[(contextNode.nodeType==9?contextNode.documentElement:this.getRoot(contextNode))];}}if(typeof this.cache[sExpr]=="string"&&this.cache[sExpr]=="."){return[contextNode];}var info=this.cache[sExpr][0];var rootNode=(info[3]?(contextNode.nodeType==9?contextNode.documentElement:this.getRoot(contextNode)):contextNode);var sResult=[];info[0](rootNode,info[1],this.cache[sExpr],1,0,sResult);return sResult;}};function getNodeValue(sResult){if(sResult.nodeType==1){return sResult.firstChild?sResult.firstChild.nodeValue:"";}if(sResult.nodeType>1||sResult.nodeType<5){return sResult.nodeValue;}return sResult;}jpf.CodeCompilation=function(code){this.data={F:[],S:[],I:[],X:[]};this.compile=function(){code=code.replace(/ or /g," || ");code=code.replace(/ and /g," && ");code=code.replace(/!=/g,"{}");code=code.replace(/=/g,"==");code=code.replace(/\{\}/g,"!=");this.tokenize();this.insert();code=code.replace(/, \)/g,", htmlNode)");return code;};this.tokenize=function(){var data=this.data.F;code=code.replace(/(translate|format-number|contains|substring|local-name|last|position|round|starts-with|string|string-length|sum|floor|ceiling|concat|count|not)\s*\(/g,function(d,match){return(data.push(match)-1)+"F_";});var data=this.data.S;code=code.replace(/'([^']*)'/g,function(d,match){return(data.push(match)-1)+"S_";});code=code.replace(/"([^"]*)"/g,function(d,match){return(data.push(match)-1)+"S_";});var data=this.data.X;code=code.replace(/(^|\W|\_)([\@\.\/A-Za-z\*][\*\.\@\/\w\-]*(?:\(\)){0,1})/g,function(d,m1,m2){return m1+(data.push(m2)-1)+"X_";});code=code.replace(/(\.[\.\@\/\w]*)/g,function(d,m1,m2){return(data.push(m1)-1)+"X_";});var data=this.data.I;code=code.replace(/(\d+)(\W)/g,function(d,m1,m2){return(data.push(m1)-1)+"I_"+m2;});};this.insert=function(){var data=this.data;code=code.replace(/(\d+)X_\s*==\s*(\d+S_)/g,function(d,nr,str){return"jpf.XPath.selectNodeExtended('"+data.X[nr].replace(/'/g,"\\'")+"', htmlNode, "+str+")";});code=code.replace(/(\d+)([FISX])_/g,function(d,nr,type){var value=data[type][nr];if(type=="F"){return"jpf.XPath.doXpathFunc(htmlNode, '"+value+"', ";}else{if(type=="S"){return"'"+value+"'";}else{if(type=="I"){return value;}else{if(type=="X"){return"jpf.XPath.selectNodeExtended('"+value.replace(/'/g,"\\'")+"', htmlNode)";}}}}});};};};jpf.runXslt=function(){jpf.XSLTProcessor=function(){this.templates={};this.p={"value-of":function(h,n,m,a){var c=jpf.XPath.selectNodes(n.getAttribute("select"),h)[0];if(!c){value="";}else{if(c.nodeType==1){value=c.firstChild?c.firstChild.nodeValue:"";}else{value=typeof c=="object"?c.nodeValue:c;}}a.appendChild(this.xmlDoc.createTextNode(value));},"copy-of":function(h,n,m,a){var c=jpf.XPath.selectNodes(n.getAttribute("select"),h)[0];if(c){a.appendChild(jpf.canImportNode?a.ownerDocument.importNode(c,true):c.cloneNode(true));}},"if":function(c,m,h,a){if(jpf.XPath.selectNodes(m.getAttribute("test"),c)[0]){this.parseChildren(c,m,h,a);}},"for-each":function(m,q,n,a){var c=jpf.XPath.selectNodes(q.getAttribute("select"),m);for(var h=0;h<c.length;h++){this.parseChildren(c[h],q,n,a);}},choose:function(m,q,n,a){var c=q.childNodes;for(var h=0;h<c.length;h++){if(!c[h].tagName){continue;}if(c[h][jpf.TAGNAME]=="otherwise"||c[h][jpf.TAGNAME]=="when"&&jpf.XPath.selectNodes(c[h].getAttribute("test"),m)[0]){return this.parseChildren(m,c[h],n[h][2],a);}}},output:function(c,m,h,a){},param:function(c,m,h,a){},attribute:function(h,n,m,a){var c=this.xmlDoc.createDocumentFragment();this.parseChildren(h,n,m,c);a.setAttribute(n.getAttribute("name"),c.xml);},"apply-templates":function(h,B,A,F){if(!B){var D=this.templates["/"]||this.templates[h.tagName];if(D){this.parseChildren(D==this.templates["/"]?h.ownerDocument:h,D[0],D[1],F);}}else{if(B.getAttribute("select")){var D=this.templates[B.getAttribute("select")];if(D){if(B.getAttribute("select")=="/"){return alert("Something went wrong. The / template was executed as a normal template");}var a=h.selectNodes(B.getAttribute("select"));for(var z=0;z<a.length;z++){this.parseChildren(a[z],D[0],D[1],F);}}}else{if(B.getAttribute("name")){var D=this.templates[B.getAttribute("name")];if(D){this.parseChildren(h,D[0],D[1],F);}}else{var q=h.cloneNode(true);var C=this.xmlDoc.createDocumentFragment();var a=q.childNodes;for(var w,z=a.length-1;z>=0;z--){if(a[z].nodeType==3||a[z].nodeType==4){continue;}if(!a[z].nodeType==1){continue;}var m=a[z];for(w in this.templates){if(w=="/"){continue;}var D=this.templates[w];var v=m.selectNodes("self::"+w);for(var y=v.length-1;y>=0;y--){var E=v[y],c=E.parentNode;this.parseChildren(E,D[0],D[1],C);if(C.childNodes){for(var u=C.childNodes.length-1;u>=0;u--){c.insertBefore(C.childNodes[u],E);}}c.removeChild(E);}}if(m.parentNode){var c=m.parentNode;this.p["apply-templates"].call(this,m,B,A,C);if(C.childNodes){for(var u=C.childNodes.length-1;u>=0;u--){c.insertBefore(C.childNodes[u],m);}}c.removeChild(m);}}for(var z=q.childNodes.length-1;z>=0;z--){F.insertBefore(q.childNodes[z],F.firstChild);}}}}},cache:{},"import":function(h,q,n,a){var c=q.getAttribute("href");if(!this.cache[c]){var m=new jpf.http().get(c);this.cache[c]=m;}},include:function(c,m,h,a){},when:function(){},otherwise:function(){},"copy-clone":function(m,q,n,a){a=a.appendChild(jpf.canImportNode?a.ownerDocument.importNode(q,false):q.cloneNode(false));if(a.nodeType==1){for(var h=0;h<a.attributes.length;h++){var c=a.attributes[h].nodeValue;if(!jpf.isSafariOld&&a.attributes[h].nodeName.match(/^xmlns/)){continue;}a.attributes[h].nodeValue=a.attributes[h].nodeValue.replace(/\{([^\}]+)\}/g,function(s,t){var u=jpf.XPath.selectNodes(t,m)[0];if(!u){value="";}else{if(u.nodeType==1){value=u.firstChild?u.firstChild.nodeValue:"";}else{value=typeof u=="object"?u.nodeValue:u;}}return value;});a.attributes[h].nodeValue;}}this.parseChildren(m,q,n,a);}};this.parseChildren=function(h,n,m,a){if(!m){return;}for(var c=0;c<m.length;c++){m[c][0].call(this,h,m[c][1],m[c][2],a);}};this.compile=function(n){var c=n.childNodes;for(var a=[],h=0;h<c.length;h++){if(c[h].nodeType!=1&&c[h].nodeType!=3&&c[h].nodeType!=4){continue;}if(c[h][jpf.TAGNAME]=="template"){this.templates[c[h].getAttribute("match")||c[h].getAttribute("name")]=[c[h],this.compile(c[h])];}else{if(c[h][jpf.TAGNAME]=="stylesheet"){this.compile(c[h]);}else{if(c[h].prefix=="xsl"){var m=this.p[c[h][jpf.TAGNAME]];if(!m){alert("xsl:"+c[h][jpf.TAGNAME]+" is not supported at this time on this platform");}else{a.push([m,c[h],this.compile(c[h])]);}}else{a.push([this.p["copy-clone"],c[h],this.compile(c[h])]);}}}}return a;};this.importStylesheet=function(a){this.xslDoc=a.nodeType==9?a.documentElement:a;xslStack=this.compile(a);this.xslStack=[[this.p["apply-templates"],null]];};this.transformToFragment=function(m,c){this.xmlDoc=c.nodeType!=9?c.ownerDocument:c;var h=this.xmlDoc.createDocumentFragment();if(!jpf.isSafariOld&&m.nodeType==9){m=m.documentElement;}var a=this.parseChildren(m,this.xslDoc,this.xslStack,h);return h;};};self.XSLTProcessor=jpf.XSLTProcessor;};var __DOCKING__=1<<18;var __PRESENTATION__=1<<9;jpf.skins={skins:{},css:[],events:["onmousemove","onmousedown","onmouseup","onmouseout","onclick","ondragmove","ondragstart"],Init:function(t,q,u){var a=(q?q.getAttribute("id"):null)||t.getAttribute("id");var h=(q?q.getAttribute("src").match(/\//)||u:"")?(u||q.getAttribute("src")).replace(/\/[^\/]*$/,"")+"/":"";var m=(t.getAttribute("media-path")?jpf.getAbsolutePath(h||jpf.hostPath,t.getAttribute("media-path")):(q?q.getAttribute("media-path"):null));var s=(t.getAttribute("icon-path")?jpf.getAbsolutePath(h||jpf.hostPath,t.getAttribute("icon-path")):(q?q.getAttribute("icon-path"):null));if(!a){a="default";}if(t.getAttribute("id")){document.body.className+=" "+t.getAttribute("id");}if(!this.skins[a]||a=="default"){this.skins[a]={base:h,name:a,iconPath:(s===null)?"icons/":s,mediaPath:(m===null)?"images/":m,templates:{},originals:{},xml:t};}if(!this.skins["default"]){this.skins["default"]=this.skins[a];}var c=t.childNodes;for(var n=c.length-1;n>=0;n--){if(c[n].nodeType!=1){continue;}this.skins[a].templates[c[n].getAttribute("name")]=c[n];if(c[n].ownerDocument){this.importSkinDef(c[n],h,a);}}this.purgeCss(m||h+"images/",s||h+"icons/");},loadStylesheet:function(filename,title){with(o=document.getElementsByTagName("head")[0].appendChild(document.createElement("LINK"))){rel="stylesheet";type="text/css";href=filename;title=title;}return o;},importSkinDef:function(xmlNode,basepath,name){var i,l,nodes=$xmlns(xmlNode,"style",jpf.ns.jml),tnode,node;for(i=0,l=nodes.length;i<l;i++){node=nodes[i];if(node.getAttribute("src")){this.loadStylesheet(node.getAttribute("src").replace(/src/,basepath+"/src"));}else{var test=true;if(node.getAttribute("condition")){try{test=eval(node.getAttribute("condition"));}catch(e){test=false;}}if(test){tnode=node.firstChild;while(tnode){this.css.push(tnode.nodeValue);tnode=tnode.nextSibling;}}}}nodes=$xmlns(xmlNode,"alias",jpf.ns.jpf);for(i=0;i<nodes.length;i++){if(!nodes[i].firstChild){continue;}this.skins[name].templates[nodes[i].firstChild.nodeValue.toLowerCase()]=xmlNode;}},loadedCss:"",purgeCss:function(a,h){if(!this.css.length){return;}var c=this.css.join("\n").replace(/images\//g,a).replace(/icons\//g,h);jpf.importCssString(document,c);this.css=[];},loadCssInWindow:function(a,t,h,q){this.css=[];var c=a.split(":");var s=this.skins[c[0]];var m=s.templates[c[1]];this.importSkinDef(m,s.base,s.name);var n=this.css.join("\n").replace(/images\//g,h).replace(/icons\//g,q);jpf.importCssString(t.document,n);this.css=[];},setSkinPaths:function(a,m){a=a.split(":");var c=a[0];var h=a[1];m.iconPath=this.skins[c].iconPath;m.mediaPath=this.skins[c].mediaPath;},getTemplate:function(h,c){h=h.split(":");var n=h[0];var s=h[1];if(!this.skins[n].templates[s]){return false;}var t=this.skins[n].templates[s];var a=this.skins[n].originals[s];if(!a){a=this.skins[n].originals[s]={};var m=$xmlns(t,"presentation",jpf.ns.jml)[0].childNodes;for(var q=0;q<m.length;q++){if(m[q].nodeType!=1){continue;}a[m[q].baseName||m[q][jpf.TAGNAME]]=m[q];}}return a;},getCssString:function(a){return jpf.getXmlValue($xmlns(this.skins[a.split(":")[0]].xml,"style",jpf.ns.jml)[0],"text()");},changeSkinset:function(c){var a=jpf.document.documentElement;while(a){if(a&&a.nodeFunc==jpf.NODE_VISIBLE&&a.hasFeature(__PRESENTATION__)&&!a.skinset){a.$propHandlers.skinset.call(a,c);a.skinset=null;}if(a.firstChild||a.nextSibling){a=a.firstChild||a.nextSibling;}else{do{a=a.parentNode;}while(a&&!a.nextSibling);if(a){a=a.nextSibling;}}}},iconMaps:{},addIconMap:function(a){this.iconMaps[a.name]=a;if(a.size){a.width=a.height=a.size;}else{if(!a.width){a.width=1;}if(!a.height){a.height=1;}}},setIcon:function(h,t,a){if(!t){h.style.backgroundImage="";return;}if(h.tagName.toLowerCase()=="img"){h.setAttribute("src",t?(a||"")+t:"");return;}var s=t.split(":");var q=this.iconMaps[s[0]];if(q){var n,m,c=s[1].split(",");if(q.type=="vertical"){n=(c[1]||0)*q.width;m=(c[0]||0)*q.height;}else{n=(c[0]||0)*q.width;m=(c[1]||0)*q.height;}h.style.backgroundImage="url("+(a||"")+q.src+")";h.style.backgroundPosition=((-1*n)-q.offset[0])+"px "+((-1*m)-q.offset[1])+"px";}else{h.style.backgroundImage="url("+(a||"")+t+")";}}};jpf.Presentation=function(){var q,m;this.$regbase=this.$regbase|__PRESENTATION__;this.skinName=null;var a=this;var n;this.$supportedProperties.push("skin");this.$propHandlers.skinset=this.$propHandlers.skin=function(s){if(!this.$jmlLoaded){return;}if(!n){clearTimeout(n);n=setTimeout(function(){c.call(a);n=null;});}};this.$propHandlers.style=function(s){if(!jpf.isParsing){this.oExt.setAttribute("style",s);}};var h;this.$propHandlers["class"]=function(s){this.$setStyleClass(this.oExt,s,[h||""]);};this.$forceSkinChange=function(t,s){c.call(this,t,s);};function c(H,u){clearTimeout(n);var C=(u||this.skinset||jpf.appsettings.skinset)+":"+(H||this.skin||this.tagName);if(this.selectable){var z=this.getSelection();}var y=this.oExt;var G=y.nextSibling;var v=this.oExt.getAttribute("id");var w=this.baseCSSname;if(y.parentNode){y.parentNode.removeChild(y);}if(this.$destroy){this.$destroy(true);}this.$loadSkin(C);this.$draw();if(v){this.oExt.setAttribute("id",v);}if(G){this.oExt.parentNode.insertBefore(this.oExt,G);}var D,B,E=[],A=(y.className||"").splitSafe("s+");for(D=0;D<A;D++){if(A[D]&&A[D]!=w){E.push(A[D].replace(w,this.baseCSSname));}}jpf.setStyleClass(this.oExt,E.join(" "));var t,F=jpf.skins.events;for(D=0,B=F.length;D<B;D++){t=F[D];if(typeof y[t]=="function"&&!this.oExt[t]){this.oExt[t]=y[t];}}this.oExt.style.left=y.style.left;this.oExt.style.top=y.style.top;this.oExt.style.width=y.style.width;this.oExt.style.height=y.style.height;this.oExt.style.right=y.style.right;this.oExt.style.bottom=y.style.bottom;this.oExt.style.zIndex=y.style.zIndex;this.oExt.style.position=y.style.position;this.oExt.style.display=y.style.display;if(this.$loadJml){this.$loadJml(this.$jml);}if(this.disabled){this.$disable();}if(this.$focussable&&jpf.window.focussed==this){this.$focus();}if(this.hasFeature(__DATABINDING__)&&this.xmlRoot){this.reload();}else{if(this.value){this.$propHandlers.value.call(this,this.value);}}if(this.hasFeature(__MULTISELECT__)){if(this.selectable){this.selectList(z,true);}}if(this.hasFeature(__ALIGNMENT__)){if(this.aData){this.aData.oHtml=this.oExt;}if(this.pData){this.pData.oHtml=this.oExt;this.pData.pHtml=this.oInt;var s=this.pData.childNodes;for(D=0;D<s.length;D++){s[D].pHtml=this.oInt;}}}if(this.draggable){this.$propHandlers.draggable.call(this,this.draggable);}if(this.resizable){this.$propHandlers.resizable.call(this,this.resizable);}if(this.$skinchange){this.$skinchange();}}this.$setStyleClass=jpf.setStyleClass;this.$loadSkin=function(s){this.baseSkin=s||this.skinName||(this.skinset||this.$jml&&this.$jml.getAttribute("skinset")||jpf.appsettings.skinset)+":"+(this.skin||this.$jml&&this.$jml.getAttribute("skin")||this.tagName);if(this.skinName){this.$blur();this.baseCSSname=null;}this.skinName=this.baseSkin;q={};m=jpf.skins.getTemplate(this.skinName,this.$jml);if(!m){this.baseName=this.skinName="default:"+this.tagName;m=jpf.skins.getTemplate(this.skinName,this.$jml);if(!m){throw new Error(jpf.formatErrorString(1077,this,"Presentation","Could not load skin: "+this.skinName,this.$jml));}}if(m){jpf.skins.setSkinPaths(this.skinName,this);}};this.$getNewContext=function(s,t){q[s]=m[s].cloneNode(true);};this.$hasLayoutNode=function(s){return m[s]?true:false;};this.$getLayoutNode=function(s,v,u){var t=q[s]||m[s];if(!t){return false;}if(!v){return jpf.getFirstElement(t);}var w=t.selectSingleNode("@"+v);if(!w){return null;}return(u?jpf.xmldb.selectSingleNode(w.nodeValue,u):jpf.getFirstElement(t).selectSingleNode(w.nodeValue));};this.$getOption=function(t,v){t=t.toLowerCase();var u=q[t]||m[t];if(!v){return u;}var s=u.selectSingleNode("@"+v);return s?s.nodeValue:"";};this.$getExternal=function(s,u,v,t){if(!u){u=this.pHtmlNode;}if(!s){s="main";}if(!t){t=this.$jml;}s=s.toLowerCase();this.$getNewContext(s);var w=this.$getLayoutNode(s);if(t&&t.getAttributeNode("style")){w.setAttribute("style",t.getAttribute("style"));}if(t&&(t.getAttributeNode("class")||t.className)){this.$setStyleClass(w,(h=t.getAttribute("class")||t.className));}if(v){v.call(this,w);}w=jpf.xmldb.htmlImport(w,u);w.host=this;if(t&&t.getAttribute("bgimage")){w.style.backgroundImage="url("+jpf.getAbsolutePath(this.mediaPath,t.getAttribute("bgimage"))+")";}if(!this.baseCSSname){this.baseCSSname=w.className.trim().split(" ")[0];}return w;};this.$focus=function(){if(!this.oExt){return;}this.$setStyleClass(this.oFocus||this.oExt,this.baseCSSname+"Focus");};this.$blur=function(){if(!this.oExt){return;}this.$setStyleClass(this.oFocus||this.oExt,"",[this.baseCSSname+"Focus"]);};if(jpf.hasCssUpdateScrollbarBug){this.$fixScrollBug=function(){if(this.oInt!=this.oExt){this.oFocus=this.oInt;}else{this.oFocus=this.oInt=this.oExt.appendChild(document.createElement("div"));this.oInt.style.height="100%";}};}if(this.hasFeature(__MULTISELECT__)){this.$select=function(s){if(!s||!s.style){return;}return this.$setStyleClass(s,"selected");};this.$deselect=function(s){if(!s){return;}return this.$setStyleClass(s,"",["selected","indicate"]);};this.$indicate=function(s){if(!s){return;}return this.$setStyleClass(s,"indicate");};this.$deindicate=function(s){if(!s){return;}return this.$setStyleClass(s,"",["indicate"]);};}};var __MULTIBINDING__=1<<7;var __ANCHORING__=1<<13;jpf.Anchoring=function(){this.$regbase=this.$regbase|__ANCHORING__;this.$anchors=[];var v=1;var h=2;var m=jpf.layout,D=false,t=0,s,C,q="",B="",z,c,D,y,n;this.disableAnchoring=function(E){if(!y||!D||n){return;}m.removeRule(this.pHtmlNode,this.uniqueId+"_anchors");if(m.queue){m.queue(this.pHtmlNode);}this.$propHandlers.anchors=this.$propHandlers.left=this.$propHandlers.width=this.$propHandlers.right=this.$propHandlers.top=this.$propHandlers.height=this.$propHandlers.bottom=null;this.$domHandlers.remove.remove(u);this.$domHandlers.reparent.remove(a);if(this.right){this.oExt.style.left=this.oExt.offsetLeft;}if(this.bottom){this.oExt.style.top=this.oExt.offsetTop;}this.$hide=null;this.$show=null;D=false;n=true;};this.enableAnchoring=function(){if(D){return;}this.$supportedProperties.push("right","bottom","width","left","top","height");this.$propHandlers.anchors=function(E){this.$anchors=E.splitSafe("(?:, *| )");if(!t&&jpf.loaded){m.queue(this.pHtmlNode,this);}t=t|h|v;};this.$propHandlers.left=this.$propHandlers.width=this.$propHandlers.right=function(E){if(!t&&(!jpf.isParsing||jpf.parsingFinalPass)){m.queue(this.pHtmlNode,this);}t=t|h;};this.$propHandlers.top=this.$propHandlers.height=this.$propHandlers.bottom=function(E){if(!t&&(!jpf.isParsing||jpf.parsingFinalPass)){m.queue(this.pHtmlNode,this);}t=t|v;};this.$domHandlers.remove.push(u);this.$domHandlers.reparent.push(a);this.$hide=function(){if(!(z||q||B)){return;}m.removeRule(this.pHtmlNode,this.uniqueId+"_anchors");m.queue(this.pHtmlNode);};this.$show=function(){if(!(z||q||B)){return;}if(q||B){rules=z+"\n"+q+"\n"+B;m.setRules(this.pHtmlNode,this.uniqueId+"_anchors",rules);this.oExt.style.display="none";m.queue(this.pHtmlNode,this);}m.processQueue();};D=true;};function u(E){if(E){return;}if(m.queue){m.removeRule(this.pHtmlNode,this.uniqueId+"_anchors");m.queue(this.pHtmlNode);}}function a(E,H,G,F){if(!this.$jmlLoaded){return;}if(!G&&!n&&y){this.$moveAnchoringRules(F);}}this.$moveAnchoringRules=function(E,F){var G=m.removeRule(E,this.uniqueId+"_anchors");if(G){m.queue(E);}if(!q&&!B){return;}z=A.call(this);G=z+"\n"+q+"\n"+B;this.oExt.style.display="none";m.setRules(this.pHtmlNode,this.uniqueId+"_anchors",G);m.queue(this.pHtmlNode,this);};this.$hasAnchorRules=function(){return q||B?true:false;};this.$setAnchoringEnabled=function(){n=false;};function A(){return"try{var oHtml = "+(jpf.hasHtmlIdsInJs?this.oExt.getAttribute("id"):"document.getElementById('"+this.oExt.getAttribute("id")+"')")+";var pWidth = "+(this.pHtmlNode==this.pHtmlDoc.body?(jpf.isIE?"document.documentElement.offsetWidth":"window.innerWidth"):"oHtml.parentNode.offsetWidth")+";var pHeight = "+(this.pHtmlNode==this.pHtmlDoc.body?(jpf.isIE?"document.documentElement.offsetHeight":"window.innerHeight"):"oHtml.parentNode.offsetHeight")+";}catch(e){}";}function w(F,E){return String(F).replace(jpf.percentageMatch,"(("+E+" * $1)/100)");}this.$updateLayout=function(){if(!y){if(!this.oExt.getAttribute("id")){jpf.setUniqueHtmlId(this.oExt);}var K=jpf.getDiff(this.oExt);s=K[0];C=K[1];z=A.call(this);y=true;}if(!t){if(this.visible){this.oExt.style.display="block";}return;}if(this.left||this.top||this.right||this.bottom||this.$anchors.length){this.oExt.style.position="absolute";}var L;if(t&h){L=[];var J=this.left||this.$anchors[3];var G=this.right||this.$anchors[1];var H=this.width;if(G&&typeof G=="string"){G=w(G,"pWidth");}if(J){if(parseInt(J)!=J){J=w(J,"pWidth");L.push("oHtml.style.left = ("+J+") + 'px'");}else{this.oExt.style.left=J+"px";}}if(!J&&G){if(parseInt(G)!=G){G=w(G,"pWidth");L.push("oHtml.style.right = ("+G+") + 'px'");}else{this.oExt.style.right=G+"px";}}if(H){if(parseInt(H)!=H){H=w(H,"pWidth");L.push("oHtml.style.width = ("+H+" - "+s+") + 'px'");}else{this.oExt.style.width=(H-s)+"px";}}if(G!=null&&J!=null){L.push("oHtml.style.width = (pWidth - ("+G+") - ("+J+") - "+s+") + 'px'");}B=(L.length?"try{"+L.join(";}catch(e){};try{")+";}catch(e){};":"");}if(t&v){L=[];var I=this.top||this.$anchors[0];var F=this.bottom||this.$anchors[2];var E=this.height;if(F&&typeof F=="string"){F=w(F,"pHeight");}if(I){if(parseInt(I)!=I){I=w(I,"pHeight");L.push("oHtml.style.top = ("+I+") + 'px'");}else{this.oExt.style.top=I+"px";}}if(!I&&F){if(parseInt(F)!=F){L.push("oHtml.style.bottom = ("+F+") + 'px'");}else{this.oExt.style.bottom=F+"px";}}if(E){if(parseInt(E)!=E){E=w(E,"pHeight");L.push("oHtml.style.height = ("+E+" - "+C+") + 'px'");}else{this.oExt.style.height=(E-C)+"px";}}if(F!=null&&I!=null){L.push("oHtml.style.height = (pHeight - ("+F+") - ("+I+") - "+C+") + 'px'");}q=(L.length?"try{"+L.join(";}catch(e){};try{")+";}catch(e){};":"");}if(q||B){m.setRules(this.pHtmlNode,this.uniqueId+"_anchors",z+"\n"+q+"\n"+B,true);}else{m.removeRule(this.pHtmlNode,this.uniqueId+"_anchors");}t=0;n=false;};this.$addJmlLoader(function(){if(t){this.$updateLayout();}});this.$jmlDestroyers.push(function(){this.disableAnchoring();});};var __WITH_JMLDOM__=1<<14;jpf.JmlDom=function(n,c,h,m,q){this.nodeType=jpf.NODE_ELEMENT;this.$regbase=this.$regbase|__WITH_JMLDOM__;this.childNodes=[];var a=this;if(!this.$domHandlers){this.$domHandlers={remove:[],insert:[],reparent:[],removechild:[]};}if(jpf.document){this.ownerDocument=jpf.document;}if(n){if(typeof n=="number"){if(n==jpf.NODE_DOCUMENT_FRAGMENT){this.nodeType=jpf.NODE_DOCUMENT_FRAGMENT;this.hasFeature=function(){return false;};}}else{this.parentNode=c;this.$jml=m;this.nodeFunc=h;this.tagName=n;this.name=m&&m.getAttribute("id");this.content=q;}}this.appendChild=this.insertBefore=function(u,A){if(u.nodeType==jpf.NODE_DOCUMENT_FRAGMENT){var s=u.childNodes.slice(0);for(var w=0,v=s.length;w<v;w++){this.insertBefore(s[w],A);}return;}var t=u.parentNode==this;var z=u.pHtmlNode;if(u.parentNode){u.removeNode(t);}u.parentNode=this;var y;if(A){y=this.childNodes.indexOf(A);if(y<0){return false;}u.nextSibling=A;u.previousSibling=A.previousSibling;A.previousSibling=u;if(u.previousSibling){u.previousSibling.nextSibling=u;}}if(y){this.childNodes=this.childNodes.slice(0,y).concat(u,this.childNodes.slice(y));}else{y=this.childNodes.push(u)-1;u.nextSibling=null;if(y>0){u.previousSibling=this.childNodes[y-1];u.previousSibling.nextSibling=u;}else{u.previousSibling=null;}}this.firstChild=this.childNodes[0];this.lastChild=this.childNodes[this.childNodes.length-1];function B(){u.pHtmlNode=a.canHaveChildren?a.oInt:document.body;var C,D=u.$domHandlers.reparent;for(C=0,v=D.length;C<v;C++){if(D[C]){D[C].call(u,A,a,t,z);}}D=a.$domHandlers.insert;for(C=0,v=D.length;C<v;C++){if(D[C]){D[C].call(a,u,A,t);}}var E=u.oExt.getElementsByTagName("iframe").length>0;if(u.oExt&&!jpf.isGecko&&!E){u.pHtmlNode.insertBefore(u.oExt,A&&A.oExt||null);}}if(!this.$jmlLoaded){u.$reappendToParent=B;return;}B();};this.removeNode=function(u){if(!this.parentNode||!this.parentNode.childNodes){return;}this.parentNode.childNodes.remove(this);if(this.$jmlLoaded&&!jpf.isDestroying){if(this.oExt&&this.oExt.parentNode){this.oExt.parentNode.removeChild(this.oExt);}var t,s,v=this.$domHandlers.remove;if(v){for(t=0,s=v.length;t<s;t++){v[t].call(this,u);}}v=(this.parentNode.$domHandlers||{})["removechild"];if(v){for(t=0,s=v.length;t<s;t++){v[t].call(this.parentNode,this,u);}}}if(this.parentNode.firstChild==this){this.parentNode.firstChild=this.nextSibling;}if(this.parentNode.lastChild==this){this.parentNode.lastChild=this.previousSibling;}if(this.nextSibling){this.nextSibling.previousSibling=this.previousSibling;}if(this.previousSibling){this.previousSibling.nextSibling=this.nextSibling;}this.pHtmlNode=this.parentNode=this.previousSibling=this.nextSibling=null;return this;};this.removeChild=function(s){s.removeNode();};this.getElementsByTagName=function(u,v){u=u.toLowerCase();for(var s=[],t=0;t<this.childNodes.length;t++){if(this.childNodes[t].tagName==u||u=="*"){s.push(this.childNodes[t]);}if(!v){s=s.concat(this.childNodes[t].getElementsByTagName(u));}}return s;};this.cloneNode=function(s){var t=this.serialize(true,true,!s);return jpf.document.createElement(t);};this.serialize=function(A,z,w){var y=this.$jml.cloneNode(false);for(var u,v=0;v<(this.$supportedProperties||[]).length;v++){u=this.$supportedProperties[v];if(this.getProperty(u)!==undefined){y.setAttribute(u,String(this.getProperty(u)).toString());}}if(!w){var s,t=this.childNodes;for(v=0,s=t.length;v<s;v++){y.appendChild(t[v].serialize(true));}}return A?y:(z?y.xml||y.serialize():jpf.formatXml(y.xml||y.serialize()));};this.setAttribute=function(s,t){if(this.$jml){this.$jml.setAttribute(s,(t||"").toString());}if(s.indexOf("on")===0){if(this.$events[s]){this.removeEventListener(s.replace(/^on/,""),this.$events[s]);}this.addEventListener(s,(this.$events[s]=(typeof t=="string"?new Function("event",t):t)));return;}if(this.nodeFunc==jpf.NODE_VISIBLE&&!this.oExt){return;}if(jpf.dynPropMatch.test(t)){this.setDynamicProperty(s,t);}else{if(this.setProperty){this.setProperty(s,t);}else{this[s]=t;}}};this.removeAttribute=function(s){this.setProperty(s,null);};this.getAttribute=this.getProperty||function(s){return this[s];};this.getAttributeNode=function(s){return this.attributes.getNamedItem(s);};this.selectNodes=function(t,s){return jpf.XPath.selectNodes(t,s||(this.nodeType==9?this.documentElement:this));};this.selectSingleNode=function(t,s){return jpf.XPath.selectNodes(t,s||(this.nodeType==9?this.documentElement:this))[0];};this.attributes={getNamedItem:function(s){return{nodeType:2,nodeName:s,nodeValue:a[s]||""};},setNamedItem:function(s){a.setAttribute(s.name,s.value);},removeNamedItem:function(s){a.removeAttribute(s);},length:function(){return a.$jml&&a.$jml.attributes.length||(a.$supportedProperties||{length:0}).length;},item:function(s){if(a.$jml&&a.$jml.attributes){return a.$jml.attributes[s];}var t=a.$supportedProperties;if(!t[s]){return false;}return this.getNamedItem(t[s]);}};this.nodeValue="";this.namespaceURI=jpf.ns.jml;this.$setParent=function(t){if(t&&t.childNodes.indexOf(this)>-1){return;}this.parentNode=t;var s=this.parentNode.childNodes;var v=s.push(this)-1;if(v===0){this.parentNode.firstChild=this;}else{var u=s[v-1];if(u){u.nextSibling=this;this.previousSibling=u||null;}this.parentNode.lastChild=this;}};if(this.parentNode&&this.parentNode.hasFeature&&this.parentNode.hasFeature(__WITH_JMLDOM__)){this.$setParent(this.parentNode);}};var __XFORMS__=1<<17;var __MEDIA__=1<<20;jpf.Media=function(){this.$regbase=this.$regbase|__MEDIA__;this.muted=false;this.$booleanProperties.paused=true;this.$booleanProperties.muted=true;this.$booleanProperties.seeking=true;this.$booleanProperties.autoplay=true;this.$booleanProperties.controls=true;this.$booleanProperties.ready=true;this.$supportedProperties.push("position","networkState","readyState","progress","buffered","bufferedBytes","totalBytes","currentTime","paused","seeking","volume","type","src","autoplay","controls");this.mainBind="src";this.$propHandlers.readyState=function(n){if(this.readyState!==n){this.readyState=n;}if(n==jpf.Media.HAVE_NOTHING){var q=this.MediaError("Unable to open medium with URL '"+this.src+"'. Please check if the URL you entered as src is pointing to a valid resource.");if(this.dispatchEvent("havenothing",{error:q,bubbles:true})===false){throw q;}}else{if(n==jpf.Media.HAVE_CURRENT_DATA){this.dispatchEvent("havecurrentdata");}else{if(n==jpf.Media.HAVE_FUTURE_DATA){this.dispatchEvent("havefuturedata");}else{if(n==jpf.Media.HAVE_ENOUGH_DATA){this.dispatchEvent("haveenoughdata");this.setProperty("ready",true);}}}}};this.$propHandlers.bufferedBytes=function(n){this.setProperty("progress",this.totalBytes?n.end/this.totalBytes:0);};this.$propHandlers.position=function(n){if(this.duration>0&&this.seek){if(n>=this.progress){n=this.progress-0.05;}var q=!this.paused;if(q){this.pause();}if(n<0){n=0;}else{if(n>1){n=1;}}this.seek(Math.round(n*this.duration));this.setProperty("paused",!q);}};this.$propHandlers.currentTime=function(n){if(n>=0&&this.seek){this.seek(n);}};this.$propHandlers.volume=function(n){if(!this.player){return;}if(n<1&&n>0){n=n*100;}if(this.setVolume){this.setVolume(n);}if(n>0&&this.muted){this.setProperty("muted",false);}};var a=null;this.$propHandlers.muted=function(n){if(!this.player||!this.setVolume){return;}if(n){a=this.volume;this.setVolume(0);}else{this.setVolume(a||20);}};this.$propHandlers.paused=function(n){if(!this.player){return;}this.paused=jpf.isTrue(n);if(this.paused){this.player.pause();}else{this.player.play();}};var m=null;this.$propHandlers.type=function(q){if(m){return;}var n=this;m=window.setTimeout(function(){c.call(n);});};this.$propHandlers.src=function(t){if(m||!t){return;}var s=new jpf.url(t);this.src=s.uri;if(this.src!=this.currentSrc&&this.networkState!==jpf.Media.LOADING){var q=this.$guessType(this.src);if(q==this.type){h.call(this);this.loadMedia();}else{this.type=q;var n=this;m=window.setTimeout(function(){c.call(n);});}}};this.$propHandlers.ID3=function(n){if(!this.player){return;}if(typeof this.player.setID3=="function"){this.player.setID3(n);}};this.$domHandlers.remove.push(function(n){h.call(this);});this.$domHandlers.reparent.push(function(n,s,q){if(!this.$jmlLoaded){return;}this.$draw();c.call(this,true);});function h(){this.setProperty("networkState",jpf.Media.NETWORK_EMPTY);this.setProperty("ready",false);this.buffered={start:0,end:0,length:0};this.bufferedBytes={start:0,end:0,length:0};this.totalBytes=0;this.setProperty("progress",0);this.setProperty("seeking",false);this.setProperty("paused",true);this.setProperty("position",0);this.currentTime=this.duration=0;this.played=this.seekable=null;this.ended=false;this.start=this.end=this.loopStart=this.loopEnd=this.playCount=this.currentLoop=0;this.controls=this.muted=false;}function c(n){window.clearTimeout(m);m=null;if(!n){h.call(this);}this.$destroy(true);this.playerType=this.$getPlayerType(this.type);if(!this.playerType||!this.$isSupported()){this.oExt.innerHTML=this.notSupported;return;}this.$initPlayer();}this.MediaError=function(n){return new Error(jpf.formatErrorString(0,this,"Media",n));};this.src=this.currentSrc=null;this.networkState=jpf.Media.NETWORK_EMPTY;this.bufferingRate=0;this.bufferingThrottled=false;this.buffered={start:0,end:0,length:0};this.bufferedBytes={start:0,end:0,length:0};this.totalBytes=0;this.volume=100;this.loadMedia=function(){};this.readyState=jpf.Media.HAVE_NOTHING;this.seeking=false;this.currentTime=this.duration=0;this.paused=true;this.defaultPlaybackRate=this.playbackRate=0;this.played=null;this.seekable=null;this.ended=this.autoplay=false;this.canPlayType=function(q){if(this.$getPlayerType){var n=this.$getPlayerType(q);if(!n||!this.$isSupported(n)){return"no";}if(n.indexOf("Wmp")!=-1){return"maybe";}return"probably";}return"no";};this.play=function(){this.setProperty("paused",false);};this.pause=function(){this.setProperty("paused",true);};this.start=this.end=this.loopStart=this.loopEnd=this.playCount=this.currentLoop=0;this.addCueRange=function(s,u,q,n,w,v,t){};this.removeCueRanges=function(n){};this.getCounter=function(t,q,v){if(v){t=t-this.duration;}var n=Math.round(Math.abs(t/1000)),u=String(Math.round(Math.abs(n/60/60))).pad(2,"0"),s=String(Math.round(Math.abs(n/60))).pad(2,"0"),y=String(n).pad(2,"0"),w=String(Math.round(Math.abs(t%1000))).pad(3,"0");return(v?"- ":"")+q.replace(/\%T/g,"%H:%M:%S").replace(/\%[a-zA-Z\%]/g,function(z){switch(z){case"%H":return u;case"%M":return s;case"%S":return y;case"%Q":return w;case"%n":return"\n";case"%t":return"\t";case"%%":return"%";}});};this.setSource=function(u){u=u||this.$jml;var q=$xmlns(u,"nomedia",jpf.ns.jml);if(!q.length){this.notSupported=(u.firstChild&&u.firstChild.nodeType==3)?u.firstChild.nodeValue:"Unable to playback, medium not supported.";}else{this.notSupported=q[0].innerHTML;}if(!this.src){var w,v,n=$xmlns(u,"source",jpf.ns.jml);for(var t=0,s=n.length;t<s;t++){w=n[t].getAttribute("src");if(!w){continue;}v=n[t].getAttribute("type");if(!v){v=this.$guessType(w);}if(this.canPlayType(v)!="no"){this.src=w;this.type=v;break;}}}else{if(!this.type){this.type=this.$guessType(this.src);if(this.canPlayType(this.type)=="no"){return false;}}}return(this.src&&this.type);};};jpf.Media.NETWORK_EMPTY=0;jpf.Media.NETWORK_IDLE=1;jpf.Media.NETWORK_LOADING=2;jpf.Media.NETWORK_LOADED=3;jpf.Media.HAVE_NOTHING=0;jpf.Media.HAVE_METADATA=1;jpf.Media.HAVE_SOME_DATA=2;jpf.Media.HAVE_CURRENT_DATA=3;jpf.Media.HAVE_FUTURE_DATA=4;jpf.Media.HAVE_ENOUGH_DATA=5;var __VALIDATION__=1<<6;jpf.Validation=function(){this.isActive=true;this.$regbase=this.$regbase|__VALIDATION__;this.isValid=function(checkRequired){var value=typeof this.getValue=="function"?this.getValue(null,true):null;if(checkRequired&&this.required){if(!value||value.toString().trim().length==0){return false;}}var isValid=(vRules.length?eval("!value || ("+vRules.join(") && (")+")"):true);return isValid;};this.showMe=function(){var p=this.parentNode;while(p){if(p.show){p.show();}p=p.parentNode;}};this.validate=function(ignoreReq,nosetError,force){if(force||!this.isValid(!ignoreReq)&&!nosetError){this.setError();return false;}else{this.clearError();return true;}};this.setError=function(value){if(!this.$validgroup){this.$propHandlers.validgroup.call(this,"vg"+this.parentNode.uniqueId);}var errBox=this.$validgroup.getErrorBox(this);if(!this.$validgroup.allowMultipleErrors){this.$validgroup.hideAllErrors();}errBox.setMessage(this.invalidmsg);jpf.setStyleClass(this.oExt,this.baseCSSname+"Error");this.showMe();errBox.display(this);if(jpf.window.focussed&&jpf.window.focussed!=this){this.focus(null,{mouse:true});}};this.clearError=function(value){if(this.$setStyleClass){this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Error"]);}if(this.$validgroup){var errBox=this.$validgroup.getErrorBox(null,true);if(!errBox||errBox.host!=this){return;}errBox.hide();}};this.$jmlDestroyers.push(function(){if(this.$validgroup){this.$validgroup.remove(this);}});var vRules=["true"];var vIds={};this.addValidationRule=function(rule){vRules.push(rule);};this.$addJmlLoader(function(x){if(!this.form){var y=this.$jml;do{y=y.parentNode;}while(y&&y.tagName&&!y.tagName.match(/submitform|xforms$/)&&y.parentNode&&y.parentNode.nodeType!=9);if(y&&y.tagName&&y.tagName.match(/submitform|xforms$/)){this.form=eval(y.getAttribute("id"));this.form.addInput(this);}}if(!this.form&&!x.getAttribute("validgroup")){var vgroup=jpf.xmldb.getInheritedAttribute(x,"validgroup");if(vgroup){this.$propHandlers.validgroup.call(this,vgroup);}}});this.$booleanProperties.required=true;this.$supportedProperties.push("validgroup","required","datatype","pattern","min","max","maxlength","minlength","valid-test","notnull","checkequal","invalidmsg","requiredmsg");this.$fValidate=function(){this.validate(true);};this.addEventListener("blur",this.$fValidate);this.$propHandlers.validgroup=function(value){if(value){var vgroup;if(typeof value!="string"){this.$validgroup=value.name;vgroup=value;}else{vgroup=jpf.nameserver.get("validgroup",value);}this.$validgroup=vgroup||new jpf.ValidationGroup(value);this.$validgroup.add(this);}else{this.$validgroup.remove(this);this.$validgroup=null;}};this.$setRule=function(type,rule){var vId=vIds[type];if(!rule){if(vId){vRules[vId]="";}return;}if(!vId){vIds[type]=vRules.push(rule)-1;}else{vRules[vId]=rule;}};this.$propHandlers.pattern=function(value){if(!value){return this.$setRule("pattern");}if(value.match(/^\/.*\/(?:[gim]+)?$/)){this.reValidation=eval(value);}this.$setRule("pattern",this.reValidation?"value.match(this.reValidation)":"("+value+")");};this.$propHandlers.min=function(value){this.$setRule("min",value?"parseInt(value) >= "+value:null);};this.$propHandlers.max=function(value){this.$setRule("max",value?"parseInt(value) <= "+value:null);};this.$propHandlers.maxlength=function(value){this.$setRule("maxlength",value?"value.toString().length <= "+value:null);};this.$propHandlers.minlength=function(value){this.$setRule("minlength",value?"value.toString().length >= "+value:null);};this.$propHandlers.notnull=function(value){this.$setRule("notnull",value?"value.toString().length > 0":null);};this.$propHandlers.checkequal=function(value){if(!this.required){this.required=2;}else{if(!value&&this.required==2){this.required=false;}}this.$setRule("checkequal",value?"!"+value+".isValid() || "+value+".getValue() == value":null);};this.$propHandlers["valid-test"]=function(value){var _self=this,rvCache={};this.removeValidationCache=function(){rvCache={};};this.$checkRemoteValidation=function(){var value=this.getValue();if(typeof rvCache[value]=="boolean"){return rvCache[value];}if(rvCache[value]==-1){return true;}rvCache[value]=-1;var instr=this.$jml.getAttribute("valid-test").split("==");jpf.getData(instr[0],this.xmlRoot,{value:this.getValue()},function(data,state,extra){if(state!=jpf.SUCCESS){if(state==jpf.TIMEOUT&&extra.retries<jpf.maxHttpRetries){return extra.tpModule.retry(extra.id);}else{var commError=new Error(jpf.formatErrorString(0,_self,"Validating entry at remote source","Communication error: \n\n"+extra.message));if(_self.dispatchEvent("error",jpf.extend({error:commError,state:status},extra))!==false){throw commError;}return;}}rvCache[value]=instr[1]?data==instr[1]:jpf.isTrue(data);if(!rvCache[value]){if(!_self.hasFocus()){_self.setError();}}else{_self.clearError();}});return true;};this.$setRule("valid-test",value?"this.$checkRemoteValidation()":null);};};jpf.ValidationGroup=function(name){jpf.makeClass(this);this.validateVisibleOnly=false;this.allowMultipleErrors=false;this.childNodes=[];this.add=function(o){this.childNodes.push(o);};this.remove=function(o){this.childNodes.remove(o);};if(name){jpf.setReference(name,this);}this.name=name||"validgroup"+this.uniqueId;jpf.nameserver.register("validgroup",this.name,this);this.toString=function(){return"[Javeline Validation Group]";};var errbox;this.getErrorBox=function(o,no_create){if(this.allowMultipleErrors||!errbox&&!no_create){errbox=new jpf.errorbox(null,"errorbox");errbox.pHtmlNode=o.oExt.parentNode;var cNode=o.$jml.ownerDocument.createElement("errorbox");errbox.loadJml(cNode);}return errbox;};this.hideAllErrors=function(){if(errbox&&errbox.host){errbox.host.clearError();}};function checkValidChildren(oParent,ignoreReq,nosetError){var found;for(var v,i=0;i<oParent.childNodes.length;i++){var oEl=oParent.childNodes[i];if(!oEl){continue;}if(!oEl.disabled&&(!this.validateVisibleOnly&&oEl.visible||!oEl.oExt||oEl.oExt.offsetHeight)&&(oEl.hasFeature(__VALIDATION__)&&oEl.isValid&&!oEl.isValid(!ignoreReq))){if(!nosetError){if(!found){oEl.validate(true,null,true);found=true;if(!this.allowMultipleErrors){return true;}}else{if(oEl.errBox&&oEl.errBox.host==oEl){oEl.errBox.hide();}}}else{if(!this.allowMultipleErrors){return true;}}}if(oEl.canHaveChildren&&oEl.childNodes.length){found=checkValidChildren.call(this,oEl,ignoreReq,nosetError)||found;if(found&&!this.allowMultipleErrors){return true;}}}return found;}this.validate=this.isValid=function(ignoreReq,nosetError,page){var found=checkValidChildren.call(this,page||this,ignoreReq,nosetError);if(page){if(page.validation&&!eval(page.validation)){alert(page.invalidmsg);found=true;}}if(!found){found=this.dispatchEvent("validation");}return !found;};};var __JMLNODE__=1<<15;var __VALIDATION__=1<<6;jpf.JmlElement=function(){this.$regbase=this.$regbase|__JMLNODE__;var a=this;if(this.nodeFunc==jpf.NODE_VISIBLE){this.setWidth=function(c){this.setProperty("width",c);};this.setHeight=function(c){this.setProperty("height",c);};this.setLeft=function(c){this.setProperty("left",c);};this.setTop=function(c){this.setProperty("top",c);};this.$noAlignUpdate=false;if(!this.show){this.show=function(c){this.$noAlignUpdate=c;this.setProperty("visible",true);this.$noAlignUpdate=false;};}if(!this.hide){this.hide=function(c){this.$noAlignUpdate=c;this.setProperty("visible",false);this.$noAlignUpdate=false;};}this.getWidth=function(){return(this.oExt||{}).offsetWidth;};this.getHeight=function(){return(this.oExt||{}).offsetHeight;};this.getLeft=function(){return(this.oExt||{}).offsetLeft;};this.getTop=function(){return(this.oExt||{}).offsetTop;};this.enable=function(){this.setProperty("disabled",false);};this.disable=function(){this.setProperty("disabled",true);};this.sendToBack=function(){this.setProperty("zindex",0);};this.bringToFront=function(){this.setProperty("zindex",jpf.all.length+1);};this.sendBackwards=function(){this.setProperty("zindex",this.zindex-1);};this.bringForward=function(){this.setProperty("zindex",this.zindex+1);};if(this.$focussable){this.setTabIndex=function(c){jpf.window.$removeFocus(this);jpf.window.$addFocus(this,c);};this.focus=function(c,m,h){if(!c){if(this.isWindowContainer){jpf.window.$focusLast(this,m,true);}else{jpf.window.$focus(this,m);}return;}if(this.$focus){this.$focus(m);}this.dispatchEvent("focus",{srcElement:this,bubbles:true});};this.blur=function(c,h){if(jpf.popup.isShowing(this.uniqueId)){jpf.popup.forceHide();}if(this.$blur){this.$blur(h);}if(!c){jpf.window.$blur(this);}this.dispatchEvent("blur",{srcElement:this,bubbles:!h||!h.cancelBubble});};this.hasFocus=function(){return jpf.window.focussed==this||this.isWindowContainer&&(jpf.window.focussed||{}).$focusParent==this;};}}if(!this.hasFeature(__WITH_JMLDOM__)){this.implement(jpf.JmlDom);}this.$events={};this.loadJml=function(y,q,u,h){this.name=y.getAttribute("id");if(this.name){jpf.setReference(this.name,this);}if(!y){y=this.$jml;}if(this.parentNode||q){this.$setParent(this.parentNode||q);}this.$jml=y;if(this.nodeFunc!=jpf.NODE_HIDDEN){if(this.$loadSkin){this.$loadSkin();}if(this.$draw){this.$draw();}if(h){this.oExt.setAttribute("id",h);}var s=y.parentNode&&y.parentNode[jpf.TAGNAME]||"";if(y.getAttribute("align")||y.parentNode&&y.parentNode.nodeType==1&&"vbox|hbox".indexOf(s)>-1){this.implement(jpf.Alignment);this.oExt.style.display="none";this.enableAlignment();}else{if(this.$positioning!="basic"){this.implement(jpf.Anchoring);this.enableAnchoring();}}if(this.visible===undefined&&!y.getAttribute("visible")){this.visible=true;}this.$drawn=true;}else{if(this.$draw){this.$draw();}}if(!u){if(!this.hasFeature(__DATABINDING__)&&y.getAttribute("smartbinding")){this.implement(jpf.DataBinding);this.$xmlUpdate=this.$load=function(){};}}this.$noAlignUpdate=true;var z,c,v,m,w,n,t=y.attributes;for(n=0,m=t.length;n<m;n++){w=t[n];z=w.nodeValue;c=w.nodeName;if(/^\$(.*)\$$/.test(z)){jpf.language.addElement(RegExp.$1,{jmlNode:this,prop:c});}else{if(z&&jpf.dynPropMatch.test(z)){jpf.JmlParser.stateStack.push({node:this,name:c,value:z});}else{if(c=="disabled"){jpf.JmlParser.stateStack.push({node:this,name:c,value:z});}if(w.nodeName.indexOf("on")===0){this.addEventListener(c,(this.$events[c]=new Function("event",z)));continue;}if(!z){z=this.defaults&&this.defaults[c]||z;}if(this.$booleanProperties[c]){z=jpf.isTrue(z);}this[c]=z;(this.$propHandlers&&this.$propHandlers[c]||jpf.JmlElement.propHandlers[c]||jpf.K).call(this,z);}}}if(jpf.appsettings.defaults[this.tagName]){d=jpf.appsettings.defaults[this.tagName];for(n=0,m=d.length;n<m;n++){c=d[n][0],z=d[n][1];if(this[c]===undefined){if(this.$booleanProperties[c]){z=jpf.isTrue(z);}this[c]=z;(this.$propHandlers&&this.$propHandlers[c]||jpf.JmlElement.propHandlers[c]||jpf.K).call(this,z,c);}}}this.$noAlignUpdate=false;if(this.$focussable&&this.focussable===undefined){jpf.JmlElement.propHandlers.focussable.call(this);}if(this.$loadJml&&!this.$isSelfLoading){this.$loadJml(y);}for(n=this.$jmlLoaders.length-1;n>=0;n--){this.$jmlLoaders[n].call(this,y);}this.$jmlLoaded=true;return this;};this.$handlePropSet=function(m,h,c){if(!c&&!this.hasFeature(__MULTISELECT__)&&this.xmlRoot&&this.bindingRules&&this.bindingRules[m]&&!this.ruleTraverse){return jpf.xmldb.setNodeValue(this.getNodeFromRule(m.toLowerCase(),this.xmlRoot,null,null,true),h,!this.$onlySetXml);}if(this.$booleanProperties[m]){h=jpf.isTrue(h);}this[m]=h;if(this.$onlySetXml){return;}return(this.$propHandlers&&this.$propHandlers[m]||jpf.JmlElement.propHandlers[m]||jpf.K).call(this,h,c,m);};this.replaceJml=function(t,s,q,n){for(var m=0;m<this.childNodes.length;m++){var u=this.childNodes[m];var h=u.childNodes;for(var c=0;c<h.length;c++){if(h[c].destroy){h[c].destroy();}}if(u.$jml&&u.$jml.parentNode){u.$jml.parentNode.removeChild(u.$jml);}u.destroy();if(u.oExt!=this.oInt){jpf.removeNode(u.oExt);}}this.childNodes.length=0;this.oExt.innerHTML="";this.insertJml(t,s,q,n);};this.insertJml=function(n,m,c,h){var q=function(w,v,s){if(v!=jpf.SUCCESS){var y;y=new Error(jpf.formatErrorString(1019,a,"Loading extra jml from datasource","Could not load JML from remote resource \n\n"+s.message));if(s.tpModule.retryTimeout(s,v,a,y)===true){return true;}throw y;}var u=c||a.$jml;if(u.insertAdjacentHTML){u.insertAdjacentHTML(u.getAttribute("insert")||"beforeend",(typeof w!="string"&&w.length)?w[0]:w);}else{if(typeof w=="string"){w=jpf.xmldb.getXml("<j:jml xmlns:j='"+jpf.ns.jml+"'>"+w+"</j:jml>");}if(u.ownerDocument.importNode){doc=u.ownerDocument;for(var t=w.childNodes.length-1;t>=0;t--){u.insertBefore(doc.importNode(w.childNodes[t],true),u.firstChild);}}else{for(var t=w.childNodes.length-1;t>=0;t--){u.insertBefore(w.childNodes[t],u.firstChild);}}}jpf.JmlParser.parseMoreJml(u,m||a.oInt,a,(h&&(m||a.oInt).style.offsetHeight)?true:false);};if(typeof n=="string"){if(jpf.datainstr[n]){return jpf.getData(n,null,{ignoreOffline:true},q);}else{n=jpf.xmldb.getXml(n);}}return q(n,jpf.SUCCESS);};if(this.hasFeature(__DATABINDING__)&&!this.hasFeature(__MULTISELECT__)&&!this.change){this.change=function(c){if(this.errBox&&this.errBox.visible&&this.isValid()){this.clearError();}if((!this.createModel||!this.$jml.getAttribute("ref"))&&!this.xmlRoot){if(c===this.value||this.dispatchEvent("beforechange",{value:c})===false){return;}this.setProperty("value",c);return this.dispatchEvent("afterchange",{value:c});}if(this.value===c){return false;}this.executeActionByRuleSet("change",this.mainBind,this.xmlRoot,c);};}if(this.setValue&&!this.clear){this.clear=function(c){if(this.$setClearMessage){if(!c){this.$setClearMessage(this.emptyMsg,"empty");}else{if(this.$removeClearMessage){this.$removeClearMessage();}}}this.value=-99999;this.$propHandlers&&this.$propHandlers.value?this.$propHandlers.value.call(this,""):this.setValue("");};}};jpf.JmlElement.propHandlers={id:function(a){if(this.name==a){return;}if(self[this.name]==this){self[this.name]=null;}jpf.setReference(a,this);this.name=a;},focussable:function(a){if(typeof a=="undefined"){this.focussable=true;}if(this.focussable){jpf.window.$addFocus(this,this.tabindex||this.$jml.getAttribute("tabindex"));}else{jpf.window.$removeFocus(this);}},zindex:function(a){this.oExt.style.zIndex=a;},visible:function(a){if(this.tagName=="modalwindow"){return;}if(jpf.isFalse(a)||typeof a=="undefined"){this.oExt.style.display="none";if(this.$hide&&!this.$noAlignUpdate){this.$hide();}if(jpf.window.focussed==this||this.canHaveChildren&&jpf.xmldb.isChildOf(this,jpf.window.focussed,false)){if(jpf.appsettings.allowBlur){this.blur();}else{jpf.window.moveNext();}}}else{if(jpf.isTrue(a)){this.oExt.style.display="block";if(this.$show&&!this.$noAlignUpdate){this.$show();}if(jpf.hasSingleRszEvent){jpf.layout.forceResize();}}}},disabled:function(a){if(this.canHaveChildren){a=this.disabled=jpf.isTrue(a);function c(m){for(var q,n=0,h=m.length;n<h;n++){q=m[n];if(q.nodeFunc==jpf.NODE_VISIBLE){if(a&&q.disabled!=-1){q.$disabled=q.disabled||false;}q.setProperty("disabled",a?-1:null);}if(q.childNodes.length){c(q.childNodes);}}}c(this.childNodes);return;}if(a==-1){}else{if(typeof this.$disabled=="boolean"){if(a===null){a=this.$disabled;this.$disabled=null;}else{this.$disabled=a||false;return;}}}if(jpf.isTrue(a)||a==-1){this.disabled=false;if(jpf.window.focussed==this){jpf.window.moveNext(true);if(jpf.window.focussed==this){this.$blur();}}if(this.hasFeature(__PRESENTATION__)){this.$setStyleClass(this.oExt,this.baseCSSname+"Disabled");}if(this.$disable){this.$disable();}this.disabled=a;}else{if(this.hasFeature(__DATABINDING__)&&jpf.appsettings.autoDisable&!this.isBoundComplete()){return false;}this.disabled=false;if(jpf.window.focussed==this){this.$focus();}if(this.hasFeature(__PRESENTATION__)){this.$setStyleClass(this.oExt,null,[this.baseCSSname+"Disabled"]);}if(this.$enable){this.$enable();}}},enabled:function(a){this.setProperty("disabled",!a);},"disable-keyboard":function(a){this.disableKeyboard=jpf.isTrue(a);},left:function(a){this.oExt.style.position="absolute";this.oExt.style.left=a+"px";},top:function(a){this.oExt.style.position="absolute";this.oExt.style.top=a+"px";},right:function(a){this.oExt.style.position="absolute";this.oExt.style.right=a+"px";},bottom:function(a){this.oExt.style.position="absolute";this.oExt.style.bottom=a+"px";},width:function(a){this.oExt.style.width=Math.max(0,a-jpf.getWidthDiff(this.oExt))+"px";},height:function(a){this.oExt.style.height=Math.max(0,a-jpf.getHeightDiff(this.oExt))+"px";},align:function(a){if(this.disableAnchoring){this.disableAnchoring();}if(!this.hasFeature(__ALIGNMENT__)){this.implement(jpf.Alignment);this.oExt.style.display="none";this.enableAlignment();}},contextmenu:function(a){this.contextmenus=[a];},resizable:function(a){this.implement(jpf.Interactive);this.$propHandlers.resizable.apply(this,arguments);},draggable:function(a){this.implement(jpf.Interactive);this.$propHandlers.draggable.apply(this,arguments);},actiontracker:function(a){if(!a){this.$at=null;}else{if(a.tagName=="actiontracker"){this.$at=a;}else{this.$at=typeof a=="string"&&self[a]?jpf.JmlParser.getActionTracker(a):jpf.setReference(a,jpf.nameserver.register("actiontracker",a,new jpf.actiontracker()));}}},jml:function(a){this.insertJml(a);this.$isSelfLoading=true;}};var __TRANSACTION__=1<<3;var __VIRTUALVIEWPORT__=1<<19;var __MULTISELECT__=1<<8;jpf.MultiSelect=function(){var m;var h;var c=[];var q=[];var a=this;this.$regbase=this.$regbase|__MULTISELECT__;this.selected=null;this.$selected=null;this.indicator=null;this.$indicator=null;this.useindicator=true;this.remove=function(u){if(!u){u=c;}if(u.nodeType){u=[u];}if(!u||!u.length){return;}var t;if(u.length>1&&(!this.actionRules||this.actionRules.removegroup||!this.actionRules.remove)){t=this.executeAction("removeNodeList",u,"removegroup",u[0]);}else{for(var v=0;v<u.length;v++){t=this.executeAction("removeNode",[u[v]],"remove",u[v],null,null,true);if(t===false){return false;}}}return t;};this.add=function(A,B,z){var u;if(this.actionRules){if(A&&A.nodeType){u=this.getNodeFromRule("add",A,true);}else{if(typeof A=="string"){if(A.trim().charAt(0)=="<"){A=jpf.getXml(A);u=this.getNodeFromRule("add",A,true);}else{var D=this.actionRules.add;for(var w=0,v=D.length;w<v;w++){if(D[w].getAttribute("type")==A){A=null;u=D[w];break;}}}}}if(!u&&this.actionRules.add){u=this.actionRules.add[0];}}else{u=null;}var y=this.isTreeArch?this.selected||this.xmlRoot:this.xmlRoot;var t=this;var C=function(G,H,E){if(H!=jpf.SUCCESS){var I;I=new Error(jpf.formatErrorString(1032,t,"Loading xml data","Could not add data for control "+t.name+"["+t.tagName+"] \nUrl: "+E.url+"\nInfo: "+E.message+"\n\n"+A));if(E.tpModule.retryTimeout(E,H,t,I)===true){return true;}throw I;}if(typeof G!="object"){G=jpf.getXmlDom(G).documentElement;}if(G.getAttribute(jpf.xmldb.xmlIdTag)){G.setAttribute(jpf.xmldb.xmlIdTag,"");}var F=t.getNodeFromRule("add",t.isTreeArch?t.selected:t.xmlRoot,true,true);if(!B){if(F&&F.getAttribute("parent")){B=t.xmlRoot.selectSingleNode(F.getAttribute("parent"));}else{B=t.isTreeArch?t.selected||t.xmlRoot:t.xmlRoot;}}if(!B){B=t.xmlRoot;}if(jpf.isSafari&&B.ownerDocument!=G.ownerDocument){G=B.ownerDocument.importNode(G,true);}if(t.executeAction("appendChild",[B,G,z],"add",G)!==false&&t.autoselect){t.select(G);}return G;};if(A){return C(A,jpf.SUCCESS);}else{if(u.getAttribute("get")){return jpf.getData(u.getAttribute("get"),y,null,C);}else{if(u.firstChild){var u=jpf.getNode(u,[0]);if(jpf.supportNamespaces&&u.namespaceURI==jpf.ns.xhtml){u=jpf.getXml(u.xml.replace(/xmlns\=\"[^"]*\"/g,""));}else{u=u.cloneNode(true);}return C(u,jpf.SUCCESS);}}}return addXmlNode;};if(!this.setValue){this.setValue=function(u,t){m=t;this.setProperty("value",u);m=false;};}this.findXmlNodeByValue=function(w){var u=this.getTraverseNodes();var t=this.bindingRules&&this.bindingRules[this.mainBind]?this.mainBind:(this.valuerule?"value":"caption");for(var v=0;v<u.length;v++){if(this.applyRuleSetOnNode(t,u[v])==w){return u[v];}}};if(!this.getValue){this.getValue=function(u,t){if(!this.bindingRules&&!this.caption){return false;}return this.applyRuleSetOnNode(this.mainBind,u||this.selected,null,true)||this.applyRuleSetOnNode("caption",u||this.selected,null,true);};}this.reselect=function(){if(this.selected){this.select(this.selected,null,this.ctrlselect,null,true);}};var n=null;this.select=function(H,u,E,z,v,C){if(!this.selectable||this.disabled){return;}if(this.ctrlselect&&!E){u=true;}if(!this.xmlRoot){n=[arguments,this.autoselect];this.autoselect=true;return;}if(n){var F=n;n=null;if(this.autoselect){this.autoselect=F[1];}return this.select.apply(this,F[0]);}var G;if(!H){return false;}if(typeof H!="object"){var D=H;H=jpf.xmldb.getNodeById(H);if(!H){H=this.findXmlNodeByValue(D);if(!H){this.clearSelection(null,C);return;}}}if(!H.style){G=this.caching?this.getNodeFromCache(H.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId):document.getElementById(H.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);}else{var t=(G=H).getAttribute(jpf.xmldb.htmlIdTag);while(!t&&G.parentNode){t=(G=G.parentNode).getAttribute(jpf.xmldb.htmlIdTag);}H=jpf.xmldb.getNodeById(t,this.xmlRoot);}if(this.dispatchEvent("beforeselect",{xmlNode:H,htmlNode:G,ctrlKey:u,shiftKey:E,captureOnly:C})===false){return false;}var w=this.indicator;this.indicator=H;if(E&&this.multiselect){var B=this.$calcSelectRange(c[0]||w,H);if(this.$indicator){this.$deindicate(this.$indicator);}this.selectList(B);this.$selected=this.$indicator=this.$indicate(G);}else{if(u&&this.multiselect){if(c.contains(H)){if(!z){q.remove(G);c.remove(H);}if(this.selected==H){var y=this.$indicator;this.clearSelection(true,true);this.$deindicate(y);if(c.length&&!z){this.selected=c[0];}}else{this.$deselect(G,H);}if(G!=this.$indicator){this.$deindicate(this.$indicator);}this.$selected=this.$indicator=this.$indicate(G);}else{if(this.$indicator){this.$deindicate(this.$indicator);}this.$indicator=this.$indicate(G);this.$selected=this.$select(G);this.selected=H;if(!z){q.push(G);c.push(H);}}}else{if(G&&q.contains(G)&&z){return;}else{if(!v&&G&&this.$selected==G&&c.length<=1&&!this.reselectable&&q.contains(G)){return;}if(this.$selected){this.$deselect(this.$selected);}if(this.$indicator){this.$deindicate(this.$indicator);}if(this.selected){this.clearSelection(null,true);}this.$indicator=this.$indicate(G,H);this.$selected=this.$select(G,H);this.selected=H;q.push(G);c.push(H);}}}if(this.delayedselect&&(typeof u=="boolean")){var A=this;setTimeout(function(){A.dispatchEvent("afterselect",{list:c,xmlNode:H,captureOnly:C});},10);}else{this.dispatchEvent("afterselect",{list:c,xmlNode:H,captureOnly:C});}return true;};this.choose=function(t){if(!this.selectable||this.disabled){return;}if(this.dispatchEvent("beforechoose",{xmlNode:t})===false){return false;}if(t&&!t.style){this.select(t);}if(this.hasFeature(__DATABINDING__)&&this.dispatchEvent("afterchoose",{xmlNode:this.selected})!==false){this.setConnections(this.selected,"choice");}};this.clearSelection=function(v,u){if(!this.selectable||this.disabled){return;}var y=v?this.selected:c;if(!u&&this.dispatchEvent("beforedeselect",{xmlNode:y})===false){return false;}var w;if(this.selected){w=this.caching?this.getNodeFromCache(this.selected.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId):document.getElementById(this.selected.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);this.$deselect(w);}this.$selected=this.selected=null;if(!v){for(var t=c.length-1;t>=0;t--){w=this.caching?this.getNodeFromCache(c[t].getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId):document.getElementById(c[t].getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);this.$deselect(w);}q=[];c=[];}if(this.indicator){w=this.caching?this.getNodeFromCache(this.indicator.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId):document.getElementById(this.indicator.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);this.$selected=this.$indicator=this.$indicate(w);}if(!u){this.dispatchEvent("afterdeselect",{xmlNode:y});if(this.value){this.setProperty("value","");}}};this.selectList=function(t,w,y){if(!this.selectable||this.disabled){return;}if(this.dispatchEvent("beforeselect",{xmlNode:y,captureOnly:w})===false){return false;}this.clearSelection(null,true);for(var z,v=0;v<t.length;v++){if(!t[v]||t[v].nodeType!=1){continue;}var u=t[v];if(typeof u!="object"){u=jpf.xmldb.getNodeById(u);}if(!u.style){htmlNode=this.$findNode(null,u.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);}else{htmlNode=u;u=jpf.xmldb.getNodeById(htmlNode.getAttribute(jpf.xmldb.htmlIdTag));}if(!u){continue;}if(htmlNode){if(!z&&y==htmlNode){z=htmlNode;}this.$select(htmlNode);q.push(htmlNode);}c.push(u);}this.$selected=z||q[0];this.selected=y||c[0];this.dispatchEvent("afterselect",{list:c,xmlNode:this.selected,captureOnly:w});};this.setIndicator=function(t){if(!t){if(this.$indicator){this.$deindicate(this.$indicator);}this.indicator=this.$indicator=null;return;}var u;if(typeof t!="object"){t=jpf.xmldb.getNodeById(t);}if(!t.style){u=this.caching?this.getNodeFromCache(t.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId):document.getElementById(t.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);}else{var v=(u=t).getAttribute(jpf.xmldb.htmlIdTag);while(!v&&u.parentNode){v=(u=u.parentNode).getAttribute(jpf.xmldb.htmlIdTag);}t=jpf.xmldb.getNodeById(v);}if(this.$indicator){this.$deindicate(this.$indicator);}this.indicator=t;this.$indicator=this.$indicate(u);this.dispatchEvent("indicate");};this.setTempSelected=function(u,v,t){clearTimeout(this.timer);if(v||this.ctrlselect){if(this.$tempsel){this.select(this.$tempsel);this.$tempsel=null;}this.setIndicator(u);}else{if(t){if(this.$tempsel){this.$deselect(this.$tempsel);this.$tempsel=null;}this.select(u,null,t);}else{if(!this.bufferselect){this.select(u);}else{var w=jpf.xmldb.getID(u,this);this.$deselect(this.$tempsel||this.$selected);this.$deindicate(this.$tempsel||this.$indicator);this.$tempsel=this.$indicate(document.getElementById(w));this.$select(this.$tempsel);this.timer=setTimeout(function(){a.selectTemp();},400);}}}};this.selectTemp=function(){if(!this.$tempsel){return;}clearTimeout(this.timer);this.select(this.$tempsel);this.$tempsel=null;this.timer=null;};this.selectAll=function(){if(!this.multiselect||!this.selectable||this.disabled||!this.$selected){return;}var t=this.getTraverseNodes();this.selectList(t);};this.getSelection=function(t){var u,v;if(t){v=this.xmlRoot?this.xmlRoot.ownerDocument.createDocumentFragment():jpf.getXmlDom().createDocumentFragment();for(u=0;u<c.length;u++){jpf.xmldb.clearConnections(v.appendChild(c[u].cloneNode(true)));}}else{for(v=[],u=0;u<c.length;u++){v.push(c[u]);}}return v;};this.defaultSelectNext=function(u,t){var v=this.getNextTraverseSelected(u);if(v||!t){this.select(v?v:this.getTraverseParent(u));}else{this.clearSelection(null,true);}};this.selectNext=function(){var t=this.getNextTraverse();if(t){this.select(t);}};this.selectPrevious=function(){var t=this.getNextTraverse(null,-1);if(t){this.select(t);}};this.getDefaultNext=function(u,t){var v=this.getNextTraverseSelected(u);return(v&&v!=u)?v:(t?this.getTraverseParent(u):null);};this.isSelected=function(u){if(!u){return false;}for(var t=0;t<c.length;t++){if(c[t]==u){return true;}}return false;};this.$checkSelection=function(u){if(c.length>1){for(var t=[],w=0,v=c.length;w<v;w++){if(jpf.xmldb.isChildOf(this.xmlRoot,c[w])){t.push(c[w]);}}if(t.length>1){this.selectList(t);if(this.indicator&&!jpf.xmldb.isChildOf(this.xmlRoot,this.indicator)){this.setIndicator(u||this.selected);}return;}else{if(t.length){u=t[0];}}}if(!u){if(this.selected&&!jpf.xmldb.isChildOf(this.xmlRoot,this.selected)){u=this.getFirstTraverseNode();}else{if(this.selected&&this.indicator&&!jpf.xmldb.isChildOf(this.xmlRoot,this.indicator)){this.setIndicator(this.selected);}else{if(!this.selected){u=this.xmlRoot?this.getFirstTraverseNode():null;}else{return;}}}}if(u){if(this.autoselect){this.select(u);}else{if(!this.multiselect){this.clearSelection();}this.setIndicator(u);}}else{this.clearSelection();}};this.selectable=true;if(this.ctrlselect===undefined){this.ctrlselect=false;}if(this.multiselect===undefined){this.multiselect=true;}if(this.autoselect===undefined){this.autoselect=true;}if(this.delayedselect===undefined){this.delayedselect=true;}if(this.allowdeselect===undefined){this.allowdeselect=true;}this.reselectable=false;this.$booleanProperties.selectable=true;this.$booleanProperties.multiselect=true;this.$booleanProperties.autoselect=true;this.$booleanProperties.delayedselect=true;this.$booleanProperties.allowdeselect=true;this.$booleanProperties.reselectable=true;this.$supportedProperties.push("selectable","ctrlselect","multiselect","autoselect","delayedselect","allowdeselect","reselectable","value","default");this.$propHandlers.value=function(u){if(!this.bindingRules&&!this.caption||!this.xmlRoot){return;}if(jpf.isNot(u)){return this.clearSelection(null,m);}if(!this.xmlRoot){return this.select(u);}var t=this.findXmlNodeByValue(u);if(t){this.select(t,null,null,null,null,m);}else{return this.clearSelection(null,m);}};this.$propHandlers.allowdeselect=function(u){if(u){var t=this;this.oInt.onmousedown=function(w){if(!w){w=event;}if(w.ctrlKey||w.shiftKey){return;}var v=w.srcElement||w.target;if(t.allowdeselect&&(v==this||v.getAttribute(jpf.xmldb.htmlIdTag))){t.clearSelection();}};}else{this.oInt.onmousedown=null;}};this.$propHandlers.ctrlselect=function(t){if(t!="enter"){this.ctrlselect=jpf.isTrue(t);}};function s(){this.selectAll();}this.$propHandlers.autoselect=function(t){if(t=="all"&&this.multiselect){this.addEventListener("afterload",s);}else{this.removeEventListener("afterload",s);}};this.$propHandlers.multiselect=function(t){if(!t&&c.length>1){this.select(this.selected);}if(t){this.bufferselect=false;}};this.addEventListener("beforeselect",function(t){if(this.applyRuleSetOnNode("select",t.xmlNode,".")===false){return false;}},true);this.addEventListener("afterselect",function(t){if(this.bindingRules&&(this.bindingRules.value||this.bindingRules.caption)||this.caption){this.value=this.applyRuleSetOnNode(this.bindingRules&&this.bindingRules.value||this.valuerule?"value":"caption",t.xmlNode);this.setProperty("value",this.value);}if(this.sellength!=c.length){this.setProperty("sellength",c.length);}},true);};jpf.MultiSelectServer={objects:{},register:function(h,c,m,a){if(!this.uniqueId){this.uniqueId=jpf.all.push(this)-1;}this.objects[h]={xml:c,list:m,jNode:a};},$xmlUpdate:function(s,h,q,n){if(s!="attribute"){return;}var m=this.objects[h.getAttribute(jpf.xmldb.xmlIdTag)];if(!m){return;}var a=h.attributes;for(var c=0;c<m.list.length;c++){jpf.xmldb.setAttribute(m.list[c],n.name,h.getAttribute(n.name));}}};var __EDITMODE__=1<<15;var __MULTILANG__=1<<16;var __DATABINDING__=1<<1;jpf.DataBinding=function(){var loadqueue;var cXmlOnLoad=[];var cXmlSelect=[];var cXmlChoice=[];this.$regbase=this.$regbase|__DATABINDING__;this.mainBind="value";var _self=this;this.getMainBindXpath=function(){if(this.hasFeature(__MULTIBINDING__)){return this.$getMultiBind().getMainBindXpath();}var m=this.getModel(true);return(m&&m.connect?m.connect.select+"/":(this.dataParent?this.dataParent.xpath+"/":""))+this.smartBinding.bindings[this.mainBind][0].getAttribute("select");};this.isBoundComplete=function(){if(!this.smartBinding){return true;}if(!this.xmlRoot){return false;}if(this.hasFeature(__MULTIBINDING__)&&!this.$getMultiBind().xmlRoot){return false;}return true;};this.queryValue=function(xpath,type){return jpf.getXmlValue(this[type||"xmlRoot"],xpath);};this.queryValues=function(xpath,type){return jpf.getXmlValues(this[type||"xmlRoot"],xpath);};this.queryNode=function(xpath,type){var n=this[type||"xmlRoot"];return n?n.selectSingleNode(xpath):null;};this.queryNodes=function(xpath,type){var n=this[type||"xmlRoot"];return n?n.selectNodes(xpath):null;};this.loadBindings=function(rules,node){if(this.bindingRules){this.unloadBindings();}this.bindingRules=rules;if(this.$loaddatabinding){this.$loaddatabinding();}if(this.bindingRules.traverse){this.parseTraverse(this.bindingRules.traverse[0]);}this.$checkLoadQueue();};this.$checkLoadQueue=function(){if(loadqueue){var q=this.load(loadqueue[0],loadqueue[1]);if(!q||q.dataType!="array"||q!=loadqueue){loadqueue=null;}}};this.unloadBindings=function(){if(this.$unloaddatabinding){this.$unloaddatabinding();}var node=this.xmlBindings;if(!node||!node.getAttribute("connect")){return;}try{var o=eval(node.getAttribute("connect"));o.disconnect(this,node.getAttribute("type"));}catch(e){}this.bindingRules=null;return this.uniqueId;};this.loadActions=function(rules,node){if(this.actionRules){this.unloadActions();}this.actionRules=rules;};this.getActionTracker=function(ignoreMe){if(!jpf.JmlDom){return jpf.window.$at;}var pNode=this,tracker=ignoreMe?null:this.$at;if(!tracker&&this.connectId){tracker=self[this.connectId].$at;}while(!tracker){if(!pNode.parentNode){return jpf.window.$at;}tracker=(pNode=pNode.parentNode).$at;}return tracker;};this.unloadActions=function(){this.xmlActions=null;this.actionRules=null;if(this.$at){this.$at=null;}};var actions={};this.$startAction=function(name,xmlContext,fRollback){if(this.disabled){return false;}var actionRule=this.getNodeFromRule(name,xmlContext,true);if(jpf.appsettings.autoDisableActions&&!this.actionRules||this.actionRules&&!actionRule){return false;}var bHasOffline=typeof jpf.offline!="undefined";if(this.dispatchEvent(name+"start",{xmlContext:xmlContext})===false){return false;}actions[name]=xmlContext;return true;};this.$stopAction=function(name,isCancelled,curLock){delete actions[name];};this.executeAction=function(atAction,args,action,xmlNode,noevent,contextNode,multiple){if(this.disabled){return;}var rules=this.actionRules?this.actionRules[action]:(!action.match(/change|select/)&&jpf.appsettings.autoDisableActions?false:[]);if(!rules){return false;}for(var node,i=0;i<(rules.length||1);i++){if(!rules[i]||!rules[i].getAttribute("select")||xmlNode.selectSingleNode(rules[i].getAttribute("select"))){var ev=new jpf.Event("before"+action.toLowerCase(),{action:atAction,args:args,xmlActionNode:rules[i],jmlNode:this,selNode:contextNode,multiple:multiple||false});if(!noevent){if(this.dispatchEvent(ev.name,null,ev)===false){return false;}}var UndoObj=this.getActionTracker().execute(ev);ev.xmlNode=UndoObj.xmlNode;ev.undoObj=UndoObj;if(!noevent){ev.name="after"+action.toLowerCase();ev.cancelBubble=false;delete ev.returnValue;this.dispatchEvent(ev.name,null,ev);}return UndoObj;}}return false;};this.executeActionByRuleSet=function(atName,setName,xmlNode,value){var xpath,args,selInfo=this.getSelectFromRule(setName,xmlNode);var shouldLoad=false,atAction,node=selInfo[1];if(node){if(jpf.xmldb.getNodeValue(node)==value){return;}atAction=(node.nodeType==1||node.nodeType==3||node.nodeType==4)?"setTextNode":"setAttribute";args=(node.nodeType==1)?[node,value]:(node.nodeType==3||node.nodeType==4?[node.parentNode,value]:[node.ownerElement||node.selectSingleNode(".."),node.nodeName,value]);}else{if(!this.createModel){return false;}atAction="setValueByXpath";xpath=selInfo[0];if(!xmlNode){var model=this.getModel();if(model){if(model.connect){xmlNode=model.connect.node.selected||model.connect.node.xmlRoot;xpath=(model.connect.select||".")+(xpath&&xpath!="."?"/"+xpath:"");shouldLoad=true;}else{if(!model.data){model.load("<data />");}xpath=(model.getXpathByJmlNode(this)||".")+(xpath&&xpath!="."?"/"+xpath:"");xmlNode=model.data;}}else{if(!this.dataParent){return false;}xmlNode=this.dataParent.parent.selected||this.dataParent.parent.xmlRoot;if(!xmlNode){return false;}xpath=(this.dataParent.xpath||".")+(xpath&&xpath!="."?"/"+xpath:"");shouldLoad=true;}}args=[xmlNode,value,xpath];}this.executeAction(atAction,args,atName,xmlNode);if(shouldLoad){this.load(xmlNode.selectSingleNode(xpath));}};this.connect=function(o,dataOnly,xpath,type,noselect){if(o.dataParent){o.dataParent.parent.disconnect(o);}if(!this.signalXmlUpdate){this.signalXmlUpdate={};}o.dataParent={parent:this,xpath:xpath};if(dataOnly){if(cXmlOnLoad){return cXmlOnLoad.push([o,xpath]);}else{return o.load(xpath?this.xmlRoot.selectSingleNode(xpath):this.selected);}}if(!dataOnly){(!type||type=="select")?cXmlSelect.push({o:o,xpath:xpath}):cXmlChoice.push({o:o,xpath:xpath});}if(type!="choice"&&!noselect){if(this.selected||!this.traverse&&this.xmlRoot){var xmlNode=this.selected||this.xmlRoot;if(xpath){xmlNode=xmlNode.selectSingleNode(xpath);if(!xmlNode){this.addEventListener("xmlupdate",function(){this.connect(o,false,xpath,type);this.removeEventListener("xmlupdate",arguments.callee);});}}if(xmlNode){o.load(xmlNode);}}else{if(o.clear&&!o.hasFeature(__MULTIBINDING__)){o.clear();}if(o.disable&&o.createModel){o.setProperty("disabled",true);}}}};this.disconnect=function(o,type){var ar=(!type||type=="select")?cXmlSelect:cXmlChoice;if(this.signalXmlUpdate){this.signalXmlUpdate[o.uniqueId]=null;delete this.signalXmlUpdate[o.uniqueId];}o.dataParent=null;for(var i=0;i<ar.length;i++){if(ar[i].o!=o){continue;}for(var j=i;j<ar.length;j++){ar[j]=ar[j+1];}ar.length--;i--;}};this.setConnections=function(xmlNode,type){var a=type=="both"?cXmlChoice.concat(cXmlSelect):(type=="choice"?cXmlChoice:cXmlSelect);for(var x,o,i=0;i<a.length;i++){o=a[i].o;xpath=a[i].xpath;o.load((xpath&&xmlNode)?xmlNode.selectSingleNode(xpath):xmlNode);if(xmlNode&&o.disabled&&o.createModel){o.setProperty("disabled",false);}}if(!cXmlOnLoad){return;}for(var i=0;i<cXmlOnLoad.length;i++){cXmlOnLoad[i][0].load(cXmlOnLoad[i][1]?this.xmlRoot.selectSingleNode(cXmlOnLoad[i][1]):this.selected);}cXmlOnLoad=null;};this.importConnections=function(x){cXmlSelect=x;};this.getConnections=function(){return cXmlSelect;};this.removeConnections=function(){cXmlSelect=[];};this.applyRuleSetOnNode=function(setname,cnode,def){if(!cnode){return"";}var returnValue;var rules=typeof setname=="string"?(this.bindingRules||{})[setname]:setname;if(!rules){if(setname=="value"){setname="valuerule";}returnValue=typeof this[setname]=="string"&&setname!="value"&&jpf.getXmlValue(cnode,this[setname])||def&&cnode.selectSingleNode(def)||false;return returnValue;}var node=null,sel,i,o,v,rule;for(i=0;i<rules.length;i++){rule=rules[i];sel=jpf.parseExpression(rule.getAttribute("select"))||".";o=cnode.selectSingleNode(sel);if(o){this.lastRule=rule;if(v=rule.getAttribute("value")){returnValue=v;break;}else{if(rule.childNodes.length){var xsltNode;if(v=rule.getAttribute("cacheId")){xsltNode=jpf.nameserver.get("xslt",v);}else{var prefix=jpf.findPrefix(rule,jpf.ns.xslt);var xsltNode;if(rule.getElementsByTagNameNS){xsltNode=rule.getElementsByTagNameNS(jpf.ns.xslt,"*")[0];}else{var prefix=jpf.findPrefix(rule,jpf.ns.xslt,true);if(prefix){if(!jpf.supportNamespaces){rule.ownerDocument.setProperty("SelectionNamespaces","xmlns:"+prefix+"='"+jpf.ns.xslt+"'");}xsltNode=rule.selectSingleNode(prefix+":*");}}if(xsltNode){if(xsltNode[jpf.TAGNAME]!="stylesheet"){var baseXslt=jpf.nameserver.get("base","xslt");if(!baseXslt){baseXslt=jpf.getXmlDom('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="node()"></xsl:template></xsl:stylesheet>').documentElement;jpf.nameserver.register("base","xslt",xsltNode);}var xsltNode=baseXslt.cloneNode(true);for(var j=rule.childNodes.length;j>=0;j++){xsltNode.firstChild.appendChild(rule.childNodes[j]);}rule.setAttribute("cacheId",jpf.nameserver.add("xslt",xsltNode));}}}if(xsltNode){var x=o.transformNode(xsltNode).replace(/^<\?xml version="1\.0" encoding="UTF-16"\?>/,"").replace(/\&lt\;/g,"<").replace(/\&gt\;/g,">").replace(/\&amp\;/g,"&");}else{var x=jpf.JsltInstance.apply(rule,o);}returnValue=rule.getAttribute("method")?self[rule.getAttribute("method")](x,this):x;break;}else{if(v=rule.getAttribute("method")){if(!self[v]){return false;}returnValue=self[v](o,this);break;}else{var value;if(o.nodeType==2){try{value=unescape(decodeURI(o.nodeValue));}catch(e){value=unescape(o.nodeValue);}}else{if(o.nodeType==1){if(!o.firstChild||o.firstChild.nodeType==1||o.firstChild.nodeType>4){return"";}value=o.firstChild.nodeValue;}else{value=o.nodeValue;}}returnValue=value;break;}}}}}if(returnValue){return returnValue;}return false;};this.setSmartBinding=function(sb){this.$propHandlers.smartbinding.call(this,sb);};this.removeSmartBinding=function(){this.setProperty("smartbinding",null);};this.getSmartBinding=function(){return this.smartBinding;};this.getModel=function(doRecur){if(doRecur&&!this.$model){return this.dataParent?this.dataParent.parent.getModel(true):null;}return this.$model;};this.setModel=function(model,xpath){if(this.$model){this.$model.unregister(this);}if(typeof model=="string"){model=jpf.nameserver.get("model",model);}this.$model=model;model.register(this,xpath);};this.getNodeFromRule=function(setname,cnode,isAction,getRule,createNode){var rules=((isAction?this.actionRules:this.bindingRules)||{})[setname];if(!rules){if(setname=="value"){setname="valuerule";}if(!isAction&&!getRule&&typeof this[setname]=="string"){return cnode.selectSingleNode(this[setname])||(createNode?jpf.xmldb.createNodeFromXpath(cnode,this[setname]):false);}return false;}for(var i=0;i<rules.length;i++){if(!rules[i]){continue;}var sel=jpf.parseExpression(rules[i].getAttribute("select"))||".";if(!sel){return getRule?rules[i]:false;}if(!cnode){return false;}var o=cnode.selectSingleNode(sel);if(o){return getRule?rules[i]:o;}if(createNode||rules[i].getAttribute("create")=="true"){var o=jpf.xmldb.createNodeFromXpath(cnode,sel);return getRule?rules[i]:o;}}return false;};this.getSelectFromRule=function(setname,cnode){var rules=this.bindingRules&&this.bindingRules[setname];if(!rules||!rules.length){if(setname=="value"){setname="valuerule";}return typeof this[setname]=="string"&&[this[setname]]||["."];}for(var first,i=0;i<rules.length;i++){var sel=jpf.parseExpression(rules[i].getAttribute("select"))||".";if(!cnode){return[sel];}if(i==0){first=sel;}var o=cnode.selectSingleNode(sel);if(o){return[sel,o];}}return[first];};this.reload=function(){var sb=this.getSmartBinding();if(sb&&sb.$isMarkedForUpdate(this)){sb.$updateMarkedItems();}else{this.load(this.xmlRoot,this.cacheID,true);}};this.load=function(xmlRootNode,cacheID,forceNoCache,noClearMsg){if(jpf.popup.isShowing(this.uniqueId)){jpf.popup.forceHide();}if((!this.bindingRules&&this.$jml&&(!this.smartBinding&&!this.traverse||jpf.JmlParser.stackHasBindings(this.uniqueId)))||(this.$canLoadData&&!this.$canLoadData())){return loadqueue=[xmlRootNode,cacheID];}if(xmlRootNode){xmlRootNode=jpf.xmldb.getBindXmlNode(xmlRootNode);}if(this.dataParent&&this.dataParent.xpath){this.dataParent.parent.signalXmlUpdate[this.uniqueId]=!xmlRootNode;}if(!xmlRootNode&&(!cacheID||!this.isCached(cacheID))){this.clear(noClearMsg,true);if(jpf.appsettings.autoDisable&&!this.createModel){this.setProperty("disabled",true);}this.setConnections();return;}var disabled=this.disabled;this.disabled=false;if(this.$listenRoot){jpf.xmldb.removeNodeListener(this.$listenRoot,this);this.$listenRoot=null;}if(this.dispatchEvent("beforeload",{xmlNode:xmlRootNode})===false){return false;}if(this.caching&&!forceNoCache&&xmlRootNode&&xmlRootNode==this.xmlRoot){return;}if(!cacheID){cacheID=xmlRootNode.getAttribute(jpf.xmldb.xmlIdTag)||jpf.xmldb.nodeConnect(jpf.xmldb.getXmlDocId(xmlRootNode),xmlRootNode);}if(this.$removeClearMessage){this.$removeClearMessage();}var fromCache;if(this.caching&&!forceNoCache&&(fromCache=this.getCache(cacheID,xmlRootNode))){if(fromCache==-1){return;}if(!this.hasFeature(__MULTISELECT__)){this.setConnections(this.xmlRoot,"select");}else{var nodes=this.getTraverseNodes();if(nodes.length&&this.autoselect){this.select(nodes[0],null,null,null,true);}else{this.setConnections();}if(!nodes.length){this.$setClearMessage(this.emptyMsg,"empty");}}if(this.hasFeature(__MULTISELECT__)&&nodes.length!=this.length){this.setProperty("length",nodes.length);}this.dispatchEvent("afterload",{XMLRoot:xmlRootNode});return;}else{this.clear(true);}this.documentId=jpf.xmldb.getXmlDocId(xmlRootNode);this.cacheID=cacheID;this.xmlRoot=xmlRootNode;this.$load(xmlRootNode);this.$loadSubData(xmlRootNode);if(!this.createModel){this.disabled=true;this.setProperty("disabled",false);}else{this.disabled=disabled;}if(!this.hasFeature(__MULTISELECT__)){this.setConnections(this.xmlRoot);}this.dispatchEvent("afterload",{xmlNode:xmlRootNode});};this.$loadSubData=function(xmlRootNode){if(this.hasLoadStatus(xmlRootNode)){return;}var loadNode,rule=this.getNodeFromRule("load",xmlRootNode,false,true);var sel=(rule&&rule.getAttribute("select"))?rule.getAttribute("select"):".";if(rule&&(loadNode=xmlRootNode.selectSingleNode(sel))){this.setLoadStatus(xmlRootNode,"loading");if(this.$setClearMessage){this.$setClearMessage(this.loadingMsg,"loading");}var mdl=this.getModel(true);var jmlNode=this;if(mdl.insertFrom(rule.getAttribute("get"),loadNode,{insertPoint:xmlRootNode,jmlNode:this},function(){jmlNode.setConnections(xmlRootNode);})===false){this.clear(true);if(jpf.appsettings.autoDisable){this.setProperty("disabled",true);}this.setConnections(null,"select");}}};this.setLoadStatus=function(xmlNode,state,remove){var ostatus=xmlNode.getAttribute("j_loaded");ostatus=ostatus?ostatus.replace(new RegExp("\\|\\w+\\:"+this.uniqueId+"\\|","g"),""):"";if(!remove){ostatus+="|"+state+":"+this.uniqueId+"|";}xmlNode.setAttribute("j_loaded",ostatus);};this.removeLoadStatus=function(xmlNode){this.setLoadStatus(xmlNode,null,true);};this.hasLoadStatus=function(xmlNode,state){var ostatus=xmlNode.getAttribute("j_loaded");if(!ostatus){return false;}return(ostatus.indexOf((state||"")+":"+this.uniqueId+"|")!=-1);};this.insert=function(XMLRoot,parentXMLElement,options){if(typeof XMLRoot!="object"){XMLRoot=jpf.getXmlDom(XMLRoot).documentElement;}if(!parentXMLElement){parentXMLElement=this.xmlRoot;}if(this.dispatchEvent("beforeinsert",{xmlParentNode:parentXMLElement})===false){return false;}var newNode=jpf.xmldb.integrate(XMLRoot,parentXMLElement,jpf.extend(options,{copyAttributes:true}));jpf.xmldb.applyChanges("insert",parentXMLElement);if(this.selectable&&this.autoselect){if(this.xmlRoot==newNode){this.$selectDefault(this.xmlRoot);}}else{if(this.xmlRoot==newNode){this.setConnections(this.xmlRoot,"select");}}if(this.hasLoadStatus(parentXMLElement,"loading")){this.setLoadStatus(parentXMLElement,"loaded");}this.dispatchEvent("afterinsert");};this.implement(this.hasFeature(__MULTISELECT__)?jpf.MultiselectBinding:jpf.StandardBinding);function findModel(x,isSelection){return x.getAttribute((isSelection?"ref":"")+"model")||jpf.xmldb.getInheritedAttribute(x,null,function(xmlNode){if(isSelection&&x==xmlNode){return false;}if(xmlNode.getAttribute("model")){return xmlNode.getAttribute("model");}if(xmlNode.getAttribute("smartbinding")){var bclass=x.getAttribute("smartbinding").split(" ")[0];if(jpf.nameserver.get("model",bclass)){return bclass+":select";}}return false;});}var initModelId=[];this.$addJmlLoader(function(x){if(initModelId[0]){jpf.setModel(initModelId[0],this);}if(initModelId[1]){jpf.setModel(initModelId[1],this,true);}var hasModel=initModelId.length;if((!this.ref||this.hasFeature(__MULTISELECT__))&&!this.xmlRoot){var sb=jpf.JmlParser.sbInit[this.uniqueId]&&jpf.JmlParser.sbInit[this.uniqueId][0];if(this.traverse&&(sb&&!sb.model||!sb&&this.hasFeature(__MULTISELECT__))||!initModelId[0]&&sb){initModelId=findModel(x);if(initModelId){if(!sb){this.smartBinding=true;}jpf.setModel(initModelId,this,0);}}}initModelId=null;if(this.hasFeature(__MULTISELECT__)||this.$hasStateMessages){var defProps=["empty-message","loading-message","offline-message"];for(var i=0,l=defProps.length;i<l;i++){if(!x.getAttribute(defProps[i])){this.$propHandlers[defProps[i]].call(this);}}}if(!x.getAttribute("create-model")){this.$propHandlers["create-model"].call(this);}var hasInitSb=jpf.JmlParser.sbInit[this.uniqueId]?true:false;if((!hasInitSb||!hasModel)&&this.$setClearMessage&&(!loadqueue&&!this.xmlRoot&&(this.hasFeature(__MULTISELECT__)||this.ref||hasInitSb))){this.$setClearMessage(this.emptyMsg,"empty");}});this.$jmlDestroyers.push(function(){if(this.dataParent){this.dataParent.parent.disconnect(this);}if(this.hasFeature(__DATABINDING__)){this.unloadBindings();this.unloadActions();}});this.$booleanProperties["render-root"]=true;this.$supportedProperties.push("empty-message","loading-message","offline-message","render-root","smartbinding","create-model","bindings","actions","dragdrop");this.$propHandlers["render-root"]=function(value){this.renderRoot=value;};this.$propHandlers["empty-message"]=function(value){this.emptyMsg=value||jpf.xmldb.getInheritedAttribute(this.$jml,"empty-message")||"No items";if(!jpf.isParsing){this.$updateClearMessage(this.emptyMsg,"empty");}};this.$propHandlers["loading-message"]=function(value){this.loadingMsg=value||jpf.xmldb.getInheritedAttribute(this.$jml,"loading-message")||"Loading...";if(!jpf.isParsing){this.$updateClearMessage(this.loadingMsg,"loading");}};this.$propHandlers["offline-message"]=function(value){this.offlineMsg=value||jpf.xmldb.getInheritedAttribute(this.$jml,"offline-message")||"You are currently offline...";if(!jpf.isParsing){this.$updateClearMessage(this.offlineMsg,"offline");}};this.$propHandlers["create-model"]=function(value){this.createModel=!jpf.isFalse(jpf.xmldb.getInheritedAttribute(this.$jml,"create-model"));var mb;if(this.getMultibinding&&(mb=this.getMultibinding())){mb.createModel=this.createModel;}};this.$propHandlers.smartbinding=function(value,forceInit){var sb;if(value&&typeof value=="string"){sb=jpf.JmlParser.getSmartBinding(value);}else{sb=value;}if(this.smartBinding&&this.smartBinding.deinitialize){this.smartBinding.deinitialize(this);}if(jpf.isParsing){if(forceInit===true){this.smartBinding=sb.initialize(this);this.$checkLoadQueue();return this.smartBinding;}return jpf.JmlParser.addToSbStack(this.uniqueId,sb);}return(this.smartBinding=sb.markForUpdate(this));};this.$propHandlers.bindings=function(value){var sb=this.smartBinding||(jpf.isParsing?jpf.JmlParser.getFromSbStack(this.uniqueId):this.$propHandlers.smartbinding.call(this,new jpf.smartbinding()));if(!value){throw new Error("Not Implemented");return;}var xmlNode=jpf.nameserver.get("bindings",value);sb.addBindings(jpf.getRules(xmlNode),xmlNode);};this.$propHandlers.actions=function(value){var sb=this.smartBinding||(jpf.isParsing?jpf.JmlParser.getFromSbStack(this.uniqueId):this.$propHandlers.smartbinding.call(this,new jpf.smartbinding()));if(!value){throw new Error("Not Implemented");return;}var xmlNode=jpf.nameserver.get("actions",value);sb.addActions(jpf.getRules(xmlNode),xmlNode);};function refModelPropSet(strBindRef){var isSelection=this.hasFeature(__MULTISELECT__)?1:0;var o=isSelection?this.$getMultiBind():this;var sb=hasRefBinding&&o.smartBinding||(jpf.isParsing?jpf.JmlParser.getFromSbStack(this.uniqueId,isSelection,true):this.$propHandlers.smartbinding.call(this,new jpf.smartbinding()));if(!hasRefBinding){if(o.bindingRules){o.unloadBindings();}o.bindingRules={};}var bindRule=(o.bindingRules[o.mainBind]||(o.bindingRules[o.mainBind]=[jpf.getXml("<"+(o.mainBind||"value")+" />")]))[0];((sb.bindings||(sb.bindings=o.bindingRules))[o.mainBind])||(sb.bindings[o.mainBind]=[bindRule]);var model,modelId;if(!jpf.isParsing){model=o.getModel();}if(!model){modelId=o.lastModelId=o.model||findModel(this.$jml,isSelection);if(!modelId){if(jpf.globalModel){modelId="@default";}}}strBindRef.match(/^(.*?)((?:\@[\w-_\:]+|text\(\))(\[.*?\])?|[\w-_\:]+\[.*?\])?$/);var valuePath=RegExp.$1;var valueSelect=RegExp.$2||".";if(valuePath===null){return;}if(modelId){if(modelId=="@default"){valueSelect=strBindRef;}else{if(valuePath){var modelIdParts=modelId.split(":",3);modelId=modelIdParts.shift();if(modelId.indexOf("#")==0){modelId+=(modelIdParts[0]?":"+modelIdParts.shift():":select");}modelId+=":"+((modelIdParts[0]?modelIdParts[0]+"/":"")+(valuePath||".")).replace(/\/$/,"").replace(/\/\/+/,"/");}}if(jpf.isParsing&&initModelId){initModelId[isSelection]=modelId;}else{setModelQueue(modelId,isSelection);}}else{var m=(o.lastModelId||"").split(":");var modelIdPart=((m.shift().indexOf("#")==0&&m.shift()&&m.shift()||m.shift())||"");model.$register(this,((modelIdPart?modelIdPart+"/":"")+(valuePath||".")).replace(/\/$/,"").replace(/\/\/+/,"/"));sb.markForUpdate(this,"model");}bindRule.setAttribute("select",valueSelect);}var timer=[];function setModelQueue(modelId,isSelection){clearTimeout(timer[isSelection?1:0]);timer[isSelection?1:0]=setTimeout(function(){jpf.setModel(modelId,_self,isSelection);});}this.$propHandlers.model=function(value){if(this.$modelIgnoreOnce){delete this.$modelIgnoreOnce;return;}if(!value){this.clear();this.$model.unregister(this);this.$model=null;this.lastModelId="";return;}this.lastModelId=value;if(!this.hasFeature(__MULTISELECT__)){if(jpf.isParsing&&this.$jml.getAttribute("ref")){return;}if(this.ref){refModelPropSet.call(this,this.ref);return;}}if(jpf.isParsing){initModelId[0]=value;}else{setModelQueue(value,this.hasFeature(__MULTISELECT__));}};var hasRefBinding;this.$propHandlers.ref=function(value){if(!value){this.unloadBindings();hasRefBinding=false;return;}refModelPropSet.call(this,value);hasRefBinding=value?true:false;};};jpf.StandardBinding=function(){if(!this.defaultValue){this.defaultValue="";}this.$load=function(a){jpf.xmldb.addNodeListener(a,this);var c,h;for(h in this.bindingRules){c=h.toLowerCase();if(this.$supportedProperties.contains(c)){this.setProperty(c,this.applyRuleSetOnNode(h,this.xmlRoot)||"",null,true);}}if(this.errBox&&this.isValid()){this.clearError();}};this.$xmlUpdate=function(h,v,a,s){if(h=="redo-remove"){var c=false,n=this.getModel(true);if(n){var q=n.getXpathByJmlNode(this);if(q){var v=n.data.selectSingleNode(q);if(v!=this.xmlRoot){c=true;}}}if(c||this.xmlRoot==v){return n.loadInJmlNode(this,q);}}if(s&&!s.xmlNode){s.xmlNode=this.xmlRoot;}var m,t;for(t in this.bindingRules){m=t.toLowerCase();if(this.$supportedProperties.contains(m)){var u=this.applyRuleSetOnNode(t,this.xmlRoot)||"";if(this[m]!=u){this.setProperty(m,u,null,true);}}}if(this.errBox&&this.isValid()){this.clearError();}};if(!this.clear){this.clear=function(c,a){this.documentId=this.xmlRoot=this.cacheID=null;if(this.$clear){this.$clear(c,a);}};}};jpf.MultiselectBinding=function(){this.length=0;this.parseTraverse=function(n){this.traverse=n.getAttribute("select");this.$sort=n.getAttribute("sort")?new jpf.Sort(n):null;};this.resort=function(s,n,q){if(!this.$sort){this.$sort=new jpf.Sort();}this.$sort.set(s,n);this.clearAllCache();if(q){return;}(function t(w,A){var y=a.$sort.apply(jpf.xmldb.getArrayFromNodelist(w.selectNodes(a.traverse)));for(var v=0;v<y.length;v++){if(a.isTreeArch||a.$withContainer){var z=jpf.xmldb.findHTMLNode(y[v],a);var u=a.$findContainer(z);A.appendChild(z);if(!jpf.xmldb.isChildOf(z,u,true)){A.appendChild(u);}t(y[v],u);}else{A.appendChild(jpf.xmldb.findHTMLNode(y[v],a));}}})(this.xmlRoot,this.oInt);return s;};this.toggleSortOrder=function(){return this.resort({ascending:!this.$sort.get().ascending}).ascending;};this.getSortSettings=function(){return this.$sort.get();};this.getTraverseNodes=function(q){if(this.$sort){var n=jpf.xmldb.getArrayFromNodelist((q||this.xmlRoot).selectNodes(this.traverse));return this.$sort.apply(n);}return(q||this.xmlRoot).selectNodes(this.traverse);};this.getFirstTraverseNode=function(q){if(this.$sort){var n=jpf.xmldb.getArrayFromNodelist((q||this.xmlRoot).selectNodes(this.traverse));return this.$sort.apply(n)[0];}return(q||this.xmlRoot).selectSingleNode(this.traverse);};this.getLastTraverseNode=function(q){var n=this.getTraverseNodes(q||this.xmlRoot);return n[n.length-1];};this.isTraverseNode=function(s){var n=this.getTraverseNodes(this.isTreeArch?this.getTraverseParent(s)||this.xmlRoot:this.xmlRoot);for(var q=0;q<n.length;q++){if(n[q]==s){return true;}}return false;};this.getNextTraverseSelected=function(t,n,v){if(!t){t=this.selected;}if(!v){v=1;}var s=0;var q=this.getTraverseNodes(this.getTraverseParent(t)||this.xmlRoot);while(q[s]&&q[s]!=t){s++;}var u=(n==null)?q[s+v]||q[s-v]:(n?q[s+v]:q[s-v]);return u||arguments[2]&&(s<v||(s+1)>Math.floor(q.length/v)*v)?u:(n?q[q.length-1]:q[0]);};this.getNextTraverse=function(t,n,u){if(!u){u=1;}if(!t){t=this.selected;}var s=0;var q=this.getTraverseNodes(this.getTraverseParent(t)||this.xmlRoot);while(q[s]&&q[s]!=t){s++;}return q[s+(n?-1*u:u)];};this.getTraverseParent=function(s){if(!s.parentNode||s==this.xmlRoot){return false;}var n,u=s.getAttribute(jpf.xmldb.xmlIdTag);if(!u){s.setAttribute(jpf.xmldb.xmlIdTag,"temp");u="temp";}if(jpf.isSafari){var t=this.traverse.split("|");for(var q=0;q<t.length;q++){n=s.selectSingleNode("ancestor::node()[("+t[q]+"/@"+jpf.xmldb.xmlIdTag+"='"+u+"')]");break;}}else{n=s.selectSingleNode("ancestor::node()[(("+this.traverse+")/@"+jpf.xmldb.xmlIdTag+")='"+u+"']");}if(u=="temp"){s.removeAttribute(jpf.xmldb.xmlIdTag);}return n;};this.$load=function(n){jpf.xmldb.addNodeListener(n,this);var t=this.getTraverseNodes(n).length;if(!this.renderRoot&&!t){return this.clearAllTraverse();}var q=this.$addNodes(n,null,null,this.renderRoot);this.$fill(q);if(this.selectable){if(this.autoselect){if(this.value){var u=this.value;this.value=!this.value;this.setProperty("value",u);}if(!this.selected){if(this.renderRoot){this.select(n);}else{if(q.length){this.$selectDefault(n);}else{this.setConnections();}}}}else{this.clearSelection(null,true);var s=this.renderRoot?this.xmlRoot:this.getFirstTraverseNode();if(s){this.setIndicator(s);}this.setConnections(null,"both");}}if(this.focussable){jpf.window.focussed==this?this.$focus():this.$blur();}if(t!=this.length){this.setProperty("length",t);}};var c={},a=this;var h={insert:127,add:123,remove:47,"redo-remove":79,synchronize:127,"move-away":105,move:77};this.$xmlUpdate=function(I,u,z,E,H){if(!this.xmlRoot){return;}var C,K=u,w;if(!z){z=this.xmlRoot;}if(I=="redo-remove"){H.appendChild(u);var t=this.isTraverseNode(u);H.removeChild(u);if(!t){u=H;}}do{if(I=="add"&&this.isTraverseNode(u)&&K==u){break;}if(u.getAttribute(jpf.xmldb.xmlIdTag)){var A=this.getNodeFromCache(u.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);if(A&&(K!=u||u==this.xmlRoot)&&h[I]&1){I="update";}if(u==z){if(u==this.xmlRoot&&I!="insert"){return;}break;}if(A&&h[I]&2&&!this.isTraverseNode(u)){I="remove";}if(!A&&h[I]&4&&this.isTraverseNode(u)){I="add";break;}if(A||I=="move"){break;}}else{if(h[I]&8&&this.isTraverseNode(u)){I="add";break;}}if(u==z){break;}u=u.parentNode;}while(u&&u.nodeType!=9);var s=u;if(u&&u.nodeType==9){u=K;}if(I=="replacechild"&&(E?E.args[0]==this.xmlRoot:!this.xmlRoot.parentNode)){return this.load(E?E.args[1]:z);}if(E&&u&&!E.xmlNode){E.xmlNode=u;}if(I=="move"&&s==K){var D=jpf.xmldb.isChildOf(this.xmlRoot,u.parentNode,true);var y=jpf.xmldb.isChildOf(this.xmlRoot,E.extra.parent,true);if(D&&y){this.$moveNode(u,A);}else{if(D){I="add";}else{if(y){I="remove";}}}}else{if(I=="move-away"){var F=jpf.xmldb.isChildOf(this.xmlRoot,E.extra.parent,true);if(!F){I="remove";}}}if(this.$removeClearMessage&&this.$setClearMessage){if(this.getFirstTraverseNode()){this.$removeClearMessage();}else{this.$setClearMessage(this.emptyMsg,"empty");}}if(I=="insert"&&(this.isTreeArch||u==this.xmlRoot)){if(this.hasLoadStatus(u)&&this.$removeLoading){this.$removeLoading(A);}if(this.oInt.firstChild&&!jpf.xmldb.getNode(this.oInt.firstChild)){this.oInt.innerHTML="";if(!this.renderRoot){w=this.getTraverseNodes().length;if(!w){this.clearAllTraverse();}}}C=this.$addNodes(u,(this.$getParentNode?this.$getParentNode(A):A),true,false);this.$fill(C);if(this.selectable&&(w===0||!this.xmlRoot.selectSingleNode(this.traverse))){return;}}else{if(I=="add"){var J=u.parentNode==this.xmlRoot?this.oInt:this.getNodeFromCache(u.parentNode.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);if(!J){J=this.getCacheItem(u.parentNode.getAttribute(jpf.xmldb.xmlIdTag)||(u.parentNode.getAttribute(jpf.xmldb.xmlDocTag)?"doc"+u.parentNode.getAttribute(jpf.xmldb.xmlDocTag):false))||this.oInt;}if(J||jpf.xmldb.isChildOf(this.xmlRoot,u)){J=(this.$findContainer&&J?this.$findContainer(J):J)||this.oInt;C=this.$addNodes(u,J,true,true,this.getNodeByXml(this.getNextTraverse(u)));if(J){this.$fill(C);}}}else{if((I=="remove")&&(!u||s==u&&u.parentNode)){if(!u){return;}if(A){this.$deInitNode(u,A);}else{if(u==this.xmlRoot){return this.load(null,null,null,!this.dataParent||!this.dataParent.autoselect);}}}else{if(A){this.$updateNode(u,A);if(I=="replacechild"&&this.hasFeature(__MULTISELECT__)&&this.selected&&u.getAttribute(jpf.xmldb.xmlIdTag)==this.selected.getAttribute(jpf.xmldb.xmlIdTag)){this.selected=u;}}else{if(I=="redo-remove"){var q=this.xmlRoot;while(q&&q.nodeType!=9){q=q.parentNode;}if(!q){var v=this.getModel(true);return v.loadInJmlNode(this,v.getXpathByJmlNode(this));}}}}}}var n=u?u.parentNode:H;if(this.isTreeArch&&n&&n.nodeType==1){do{var A=this.getNodeFromCache(n.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);if(A){this.$updateNode(n,A);}}while((n=this.getTraverseParent(n))&&n.nodeType==1);}if(h[I]&32&&this.selectable&&K==u&&(I!="insert"||u==this.xmlRoot)){clearTimeout(c.timer);if(I=="remove"&&jpf.xmldb.isChildOf(u,this.selected,true)||u==c.nextNode){c.nextNode=this.getDefaultNext(u);}c.timer=setTimeout(function(){a.$checkSelection(c.nextNode);c.nextNode=null;});}if(h[I]&64){if(!w){w=this.xmlRoot.selectNodes(this.traverse).length;}if(w!=this.length){this.setProperty("length",w);}}if(this.signalXmlUpdate&&h[I]&16){var B;for(B in this.signalXmlUpdate){if(parseInt(B)!=B){continue;}var G=jpf.lookup(B);if(!this.selected){continue;}var u=this.selected.selectSingleNode(G.dataParent.xpath);if(!u){continue;}G.load(u);}}this.dispatchEvent("xmlupdate",{action:I,xmlNode:u,result:C,UndoObj:E});};this.$addNodes=function(D,C,t,s,w){var B,n;s=(s&&(this.renderRoot&&D==this.xmlRoot||this.isTraverseNode(D)));var q=s?[D]:this.getTraverseNodes(D);var z=q.length&&(this.bindingRules||{})["insert"]?this.applyRuleSetOnNode("insert",D):false;for(var u=0;u<q.length;u++){if(q[u].nodeType!=1){continue;}if(t){B=this.getNodeFromCache(q[u].getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);}if(!B){var y=jpf.xmldb.nodeConnect(this.documentId,q[u],null,this);var A=s?w:(n?n.nextSibling:null);var v=this.$add(q[u],y,s?D.parentNode:D,A?C||this.oInt:C,A,!A&&u==q.length-1);if(v===false){for(var u=u;u<q.length;u++){jpf.xmldb.nodeConnect(this.documentId,q[u],null,this);}break;}}if(t){n=B;}}return q;};this.addEventListener("beforeselect",function(y){var w=null;if(this.indicator==this.selected||y.list&&y.list.length>1&&this.getConnections().length){if(y.list&&y.list.length>1&&this.getConnections().length){var u=this.xmlRoot.ownerDocument.createElement(this.selected.tagName);var q={};var s=y.list[0].attributes;for(var t=0;t<s.length;t++){q[s[t].nodeName]=s[t].nodeValue;}for(var v=1;v<y.list.length;v++){for(prop in q){if(typeof q[prop]!="string"){continue;}if(!y.list[v].getAttributeNode(prop)){q[prop]=undefined;}else{if(y.list[v].getAttribute(prop)!=q[prop]){q[prop]="";}}}}for(prop in q){if(typeof q[prop]!="string"){continue;}u.setAttribute(prop,q[prop]);}u.setAttribute(jpf.xmldb.xmlIdTag,this.uniqueId);jpf.MultiSelectServer.register(u.getAttribute(jpf.xmldb.xmlIdTag),u,y.list,this);jpf.xmldb.addNodeListener(u,jpf.MultiSelectServer);w=u;}}this.$chained=true;if(!this.dataParent||!this.dataParent.parent.$chained){var n=this;setTimeout(function(){n.setConnections(w||n.selected);delete n.$chained;},10);}else{this.setConnections(w||this.selected);delete this.$chained;}});this.addEventListener("afterdeselect",function(){var n=this;setTimeout(function(){n.setConnections(null);},10);});this.$loadInlineData=function(n){if(!$xmlns(n,"item",jpf.ns.jml).length){return jpf.JmlParser.parseChildren(n,null,this);}var q=n;var s=jpf.findPrefix(n,jpf.ns.jml);if(jpf.isIE){n.ownerDocument.setProperty("SelectionNamespaces","xmlns:"+s+"='"+jpf.ns.jpf+"'");}this.icon="@icon";this.image="@image";this.caption="label/text()|text()|@caption";this.valuerule="value/text()|@value|text()";this.traverse=s+":item";this.load(n);};var m;this.$handleBindingRule=function(q,n,s){if(!q){this[s]=null;}if(this.xmlRoot&&!m&&!jpf.isParsing){m=setTimeout(function(){a.reload();m=null;});}};this.$propHandlers.traverse=this.$propHandlers.caption=this.$propHandlers.valuerule=this.$propHandlers.icon=this.$propHandlers.tooltip=this.$propHandlers.select=this.$handleBindingRule;};var __INTERACTIVE__=1<<21;jpf.Interactive=function(){var v,u,W,U,c,J=null,V,P,F,Q,L,Y,m,aa,a,A,n,E,O,N,X,y=this,Z,T,S,H,R,z;this.$regbase=this.$regbase|__INTERACTIVE__;this.$propHandlers.draggable=function(t){if(jpf.isFalse(t)){this.draggable=t=false;}else{if(jpf.isTrue(t)){this.draggable=t=true;}}var w=this.oDrag||this.oExt;if(w.interactive&1){return;}var h=w.onmousedown;w.onmousedown=function(){if(h&&h.apply(this,arguments)===false){return;}q.apply(this,arguments);};w.interactive=(w.interactive||0)+1;};this.$propHandlers.resizable=function(w){if(jpf.isFalse(w)){this.resizable=w=false;}else{if(jpf.isTrue(w)){this.resizable=w=true;}}var ae=this.oResize||this.oExt;if(ae.interactive&2){return;}var h=ae.onmousedown;var t=ae.onmousemove;ae.onmousedown=function(){if(h&&h.apply(this,arguments)===false){return;}I.apply(this,arguments);};ae.onmousemove=function(){if(t&&t.apply(this,arguments)===false){return;}D.apply(this,arguments);};ae.interactive=(ae.interactive||0)+2;n=this.$getOption&&parseInt(this.$getOption("Main","resize-border"))||3;E=this.$getOption&&parseInt(this.$getOption("Main","resize-corner"))||12;O=jpf.getBox(jpf.getStyle(this.oExt,jpf.isIE?"borderWidth":"border-width"));};function q(t){if(!t){t=event;}if(!y.draggable||jpf.dragmode.isDragging){return;}R=!(y.dragOutline==false||!jpf.appsettings.dragOutline);jpf.dragmode.isDragging=true;H=false;jpf.popup.forceHide();Z="absolute|fixed".indexOf(jpf.getStyle(y.oExt,"position"))>-1;if(!Z){y.oExt.style.position="relative";}if(Z&&!y.aData){jpf.plane.show(R?K:y.oExt);}var w=Z?jpf.getAbsolutePosition(y.oExt,y.oExt.offsetParent):[parseInt(y.oExt.style.left)||y.oExt.offsetLeft||0,parseInt(y.oExt.style.top)||y.oExt.offsetTop||0];v=w[0]-(T=t.clientX);u=w[1]-(S=t.clientY);if(y.hasFeature&&y.hasFeature(__ANCHORING__)){y.disableAnchoring();}if(Z&&R){K.className="drag";var h=jpf.getDiff(K);y.oExt.parentNode.appendChild(K);K.style.left=w[0]+"px";K.style.top=w[1]+"px";K.style.width=(y.oExt.offsetWidth-h[0])+"px";K.style.height=(y.oExt.offsetHeight-h[1])+"px";}document.onmousemove=s;document.onmouseup=function(){document.onmousemove=document.onmouseup=null;if(Z&&!y.aData){jpf.plane.hide();}if(H){if(y.setProperty){if(V){y.setProperty("left",V);}if(P){y.setProperty("top",P);}}else{if(R){y.oExt.style.left=V+"px";y.oExt.style.top=P+"px";}}}if(!Z){y.oExt.style.position="relative";}if(y.showdragging){jpf.setStyleClass(y.oExt,"",["dragging"]);}if(Z&&R){K.style.display="none";}jpf.dragmode.isDragging=false;if(y.dispatchEvent){y.dispatchEvent("drag");}};if(jpf.isIE){document.onmousedown();}return false;}function s(ae){if(!ae){ae=event;}if(!H&&y.showdragging){jpf.setStyleClass(y.oExt,"dragging");}var t=ae.clientX-T,h=ae.clientY-S,af;if(!H&&(af=t*t>h*h?t:h)*af<2){return;}else{if(!H&&R&&K.style.display!="block"){K.style.display="block";}}var w=R?K:y.oExt;w.style.left=(V=ae.clientX+v)+"px";w.style.top=(P=ae.clientY+u)+"px";H=true;}function I(ae){if(!ae){ae=event;}if(!y.resizable){return;}z=!(y.resizeOutline==false||!jpf.appsettings.resizeOutline);if(!z){var aj=jpf.getDiff(y.oExt);X=aj[0];N=aj[1];}c=jpf.getAbsolutePosition(y.oExt);c.push(y.oExt.offsetWidth);c.push(y.oExt.offsetHeight);var af=document.documentElement.scrollLeft;var ah=document.documentElement.scrollTop;var ai=(T=ae.clientX)-c[0]+af;var ag=(S=ae.clientY)-c[1]+ah;var w=M.call(y.oExt,ai,ag);W=ai;U=ag;if(!w){return;}if(y.dispatchEvent&&y.dispatchEvent("resizestart",{type:w})===false){return;}jpf.popup.forceHide();if(y.hasFeature&&y.hasFeature(__ANCHORING__)){y.disableAnchoring();}jpf.dragmode.isDragging=true;H=false;var h="|"+w+"|";m="|w|nw|sw|".indexOf(h)>-1;aa="|n|ne|nw|".indexOf(h)>-1;a="|e|se|ne|".indexOf(h)>-1;A="|s|se|sw|".indexOf(h)>-1;if(!y.minwidth){y.minwidth=0;}if(!y.minheight){y.minheight=0;}if(!y.maxwidth){y.maxwidth=10000;}if(!y.maxheight){y.maxheight=10000;}if(Z){F=c[0]+c[2]-y.minwidth;Q=c[1]+c[3]-y.minheight;lMin=c[0]+c[2]-y.maxwidth;tMin=c[1]+c[3]-y.maxheight;}if(Z){jpf.plane.show(z?K:y.oExt);}if(z){K.className="resize";var t=jpf.getDiff(K);X=t[0];N=t[1];K.style.left=c[0]+"px";K.style.top=c[1]+"px";K.style.width=(y.oExt.offsetWidth-X)+"px";K.style.height=(y.oExt.offsetHeight-N)+"px";K.style.display="block";}if(J===null){J=document.body.style.cursor;}document.body.style.cursor=w+"-resize";document.onmousemove=C;document.onmouseup=function(al){document.onmousemove=document.onmouseup=null;if(Z){jpf.plane.hide();}if(z){var ak=jpf.getDiff(y.oExt);X=ak[0];N=ak[1];}ac(al||event,true);if(y.setProperty){if(Z){if(V){y.setProperty("left",V);}if(P){y.setProperty("top",P);}}if(L){y.setProperty("width",L+X);}if(Y){y.setProperty("height",Y+N);}}V=P=L=Y=null;document.body.style.cursor=J;J=null;if(z){K.style.display="none";}jpf.dragmode.isDragging=false;if(y.dispatchEvent){y.dispatchEvent("resize");}};if(jpf.isIE){document.onmousedown();}return false;}var ab=Math.min,B=Math.max,ad;function C(h){if(!h){h=event;}if(ad&&new Date().getTime()-ad<(z?6:jpf.mouseEventBuffer)){return;}ad=new Date().getTime();ac(h);}function ac(af,ae){var w=z&&!ae?K:y.oExt;var t=document.documentElement.scrollLeft;var h=document.documentElement.scrollTop;if(m){w.style.left=(V=B(lMin,ab(F,af.clientX-W+t)))+"px";w.style.width=(L=ab(y.maxwidth-X,B(X,y.minwidth,c[2]-(af.clientX-c[0])+W+t)-X)+t)+"px";}if(aa){w.style.top=(P=B(tMin,ab(Q,af.clientY-U+h)))+"px";w.style.height=(Y=ab(y.maxheight-N,B(N,y.minheight,c[3]-(af.clientY-c[1])+U+h)-N))+"px";}if(a){w.style.width=(L=ab(y.maxwidth-X,B(X,y.minwidth,af.clientX-c[0]+(c[2]-W)+t)-X))+"px";}if(A){w.style.height=(Y=ab(y.maxheight-N,B(N,y.minheight,af.clientY-c[1]+(c[3]-U)+h)-N))+"px";}if(jpf.hasSingleRszEvent){jpf.layout.forceResize(y.oInt);}}function M(h,ae){var w="",t="";Z="absolute|fixed".indexOf(jpf.getStyle(y.oExt,"position"))>-1;if(y.resizable==true||y.resizable=="vertical"){if(ae<n+O[0]){w=Z?"n":"";}else{if(ae>this.offsetHeight-n){w="s";}else{if(ae>this.offsetHeight-E){t="s";}}}}if(y.resizable==true||y.resizable=="horizontal"){if(h<(w?E:n)+O[0]){w+=t+(Z?"w":"");}else{if(h>this.offsetWidth-(w||t?E:n)){w+=t+"e";}}}return w;}var G;function D(ae){if(!ae){ae=event;}if(!y.resizable||document.onmousemove){return;}var ah=jpf.getAbsolutePosition(y.oExt);var w=document.documentElement.scrollLeft;var t=document.documentElement.scrollTop;var h=ae.clientX-ah[0]+w;var ag=ae.clientY-ah[1]+t;if(!G){G=jpf.getStyle(this,"cursor");}var af=M.call(y.oExt,h,ag);this.style.cursor=af?af+"-resize":G||"default";}if(!this.pHtmlDoc){this.pHtmlDoc=window.document;}var K=this.pHtmlDoc.getElementById("jpf_outline");if(!K){K=this.pHtmlDoc.body.appendChild(this.pHtmlDoc.createElement("div"));K.refCount=0;K.setAttribute("id","jpf_outline");K.style.position="absolute";K.style.display="none";K.style.zIndex=100000000;}K.refCount++;};var __DELAYEDRENDER__=1<<11;jpf.DelayedRender=function(){this.$regbase=this.$regbase|__DELAYEDRENDER__;this.isRendered=false;var a=false;this.$checkDelay=function(c){if(c.getAttribute("render")=="runtime"){c.setAttribute("render-status","withheld");if(!jpf.JmlParser.renderWithheld){jpf.JmlParser.renderWithheld=[];}jpf.JmlParser.renderWithheld.push(this);a=true;return true;}this.isRendered=true;return false;};this.$render=function(c){if(this.isRendered||this.$jml.getAttribute("render-status")!="withheld"){return;}this.dispatchEvent("beforerender");if(jpf.isNull(this.usedelay)){this.usedelay=jpf.xmldb.getInheritedAttribute(this.$jml,"use-render-delay")=="true";}if(this.usedelay||c){setTimeout("jpf.lookup("+this.uniqueId+").$renderparse()",10);}else{this.$renderparse();}};this.$renderparse=function(){if(this.isRendered){return;}jpf.JmlParser.parseMoreJml(this.$jml,this.oInt,this);this.$jml.setAttribute("render-status","done");this.$jml.removeAttribute("render");this.isRendered=true;a=false;this.dispatchEvent("afterrender");};};var __RENAME__=1<<10;var __CACHE__=1<<2;jpf.Cache=function(){var c={};var a;this.caching=true;this.$regbase=this.$regbase|__CACHE__;this.getCache=function(s,n){if(s==this.cacheID){return -1;}if(n&&this.hasFeature(__MULTISELECT__)){var h=this.getCacheItemByHtmlId(n.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);if(h&&!c[s]){this.clear(true);var q=this.getNodeFromCache(n.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);a={oHtml:q,parentNode:q.parentNode,beforeNode:q.nextSibling,cacheItem:h};this.documentId=jpf.xmldb.getXmlDocId(n);this.cacheID=s;this.xmlRoot=n;if(this.renderRoot){this.oInt.appendChild(q);}else{while(q.childNodes.length){this.oInt.appendChild(q.childNodes[0]);}}return true;}}if(!c[s]){return false;}if(this.cacheID){this.clear(true);}var m=c[s];this.documentId=m.documentId;this.cacheID=s;this.xmlRoot=m.xmlRoot;this.clearCacheItem(s);this.$setCurrentFragment(m);return true;};this.setCache=function(m,h){if(!this.caching){return;}c[m]=h;};this.getNodeFromCache=function(n){var h=this.$findNode(null,n);if(h){return h;}for(var m in c){if(c[m]&&c[m].nodeType){h=this.$findNode(c[m],n);if(h){return h;}}}return null;};this.$findNode=function(h,m){if(!h){return this.pHtmlDoc.getElementById(m);}return h.getElementById(m);};this.getNodeByXml=function(h){return h?(this.getNodeFromCache((typeof h=="object"?h.getAttribute(jpf.xmldb.xmlIdTag):h)+"|"+this.uniqueId)):null;};this.getCacheItemByHtmlId=function(n){var h=this.$findNode(null,n);if(h){return this.oInt;}for(var m in c){if(c[m]&&c[m].nodeType){h=this.$findNode(c[m],n);if(h){return c[m];}}}return null;};this.clear=function(n,q){if(this.clearSelection){this.clearSelection(null,!q);}if(this.caching){if(this.hasFeature(__MULTISELECT__)&&a&&a.oHtml){if(this.renderRoot){a.parentNode.insertBefore(a.oHtml,a.beforeNode);}else{while(this.oInt.childNodes.length){a.oHtml.appendChild(this.oInt.childNodes[0]);}}this.documentId=this.xmlRoot=this.cacheID=a=null;}else{if(this.loadedWhenOffline){this.loadedWhenOffline=false;}else{var m=this.$getCurrentFragment();if(!m){return;}m.documentId=this.documentId;m.xmlRoot=this.xmlRoot;}}}else{if(this.$clear){this.$clear();}else{this.oInt.innerHTML="";}}if(typeof n=="string"){var h=n;n=false;}if(!n){this.$setClearMessage(h?this[h+"Msg"]:this.emptyMsg,h||"empty");}else{if(this.$removeClearMessage){this.$removeClearMessage();}}if(this.caching&&(this.cacheID||this.xmlRoot)){this.setCache(this.cacheID||this.xmlRoot.getAttribute(jpf.xmldb.xmlIdTag)||"doc"+this.xmlRoot.getAttribute(jpf.xmldb.xmlDocTag),m);}this.documentId=this.xmlRoot=this.cacheID=null;if(!n&&this.hasFeature(__MULTISELECT__)){this.setProperty("length",0);}};this.clearAllTraverse=function(m,h){if(this.clearSelection){this.clearSelection(null,true);}this.oInt.innerHTML="";this.$setClearMessage(m||this.emptyMsg,h||"empty");this.setConnections();this.setProperty("length",0);};this.clearCacheItem=function(m,h){c[m].documentId=c[m].cacheID=c[m].xmlRoot=null;if(h){jpf.removeNode(c[m]);}c[m]=null;};this.clearAllCache=function(){for(var h in c){if(c[h]){this.clearCacheItem(h,true);}}};this.getCacheItem=function(h){return c[h];};this.isCached=function(h){return c[h]||this.cacheID==h?true:false;};this.$booleanProperties.caching=true;this.$supportedProperties.push("caching");if(this.hasFeature(__MULTISELECT__)){this.implement(jpf.MultiselectCache);}this.$jmlDestroyers.push(function(){this.clearAllCache();});};jpf.MultiselectCache=function(){this.$getCurrentFragment=function(){var c=this.oInt.ownerDocument.createDocumentFragment();while(this.oInt.childNodes.length){c.appendChild(this.oInt.childNodes[0]);}return c;};this.$setCurrentFragment=function(c){this.oInt.appendChild(c);if(!jpf.window.hasFocus(this)){this.blur();}};this.$findNode=function(c,h){if(!c){return this.pHtmlDoc.getElementById(h);}return c.getElementById(h);};var a;this.$setClearMessage=function(n,h){if(!a){this.$getNewContext("empty");var c=this.$getLayoutNode("empty");if(!c){return;}a=jpf.xmldb.htmlImport(c,this.oInt);}else{this.oInt.appendChild(a);}var m=this.$getLayoutNode("empty","caption",a);if(m){jpf.xmldb.setNodeValue(m,n||"");}a.setAttribute("id","empty"+this.uniqueId);jpf.setStyleClass(a,h,["loading","empty","offline"]);};this.$updateClearMessage=function(m,c){if(!a||a.parentNode!=this.oInt||a.className.indexOf(c)==-1){return;}var h=this.$getLayoutNode("empty","caption",a);if(h){jpf.xmldb.setNodeValue(h,m||"");}};this.$removeClearMessage=function(){if(!a){a=document.getElementById("empty"+this.uniqueId);}if(a&&a.parentNode){a.parentNode.removeChild(a);}};};var __ALIGNMENT__=1<<12;jpf.Alignment=function(){this.$regbase=this.$regbase|__ALIGNMENT__;var l=jpf.layout;this.dock=false;this.dockable=false;this.$booleanProperties.dock=true;this.$booleanProperties.dockable=true;this.$supportedProperties.push("dock","dockable");this.$propHandlers.width=this.$propHandlers.height=function(value){};this.$domHandlers.remove.push(remove);this.$domHandlers.reparent.push(reparent);this.$hide=function(){this.oExt.style.display="block";this.aData.prehide();this.purgeAlignment();};this.$show=function(){if(this.aData.preshow()!==false){this.oExt.style.display="none";}this.purgeAlignment();};this.disableAlignment=function(purge){if(!this.aData){return;}remove.call(this);};this.enableAlignment=function(purge){var buildParent="vbox|hbox".indexOf(this.parentNode.tagName)==-1&&!this.parentNode.pData;var layout=l.get(this.pHtmlNode,buildParent?jpf.getBox(this.parentNode.margin||this.pHtmlNode.getAttribute("margin")||""):null);if(buildParent){this.parentNode.pData=l.parseXml(this.parentNode.$jml||jpf.getXml("<vbox />"),layout,"vbox",true);layout.root=this.parentNode.pData;}if(!this.aData){this.aData=l.parseXml(this.$jml,layout,this,true);}var pData=this.parentNode.aData||this.parentNode.pData;this.aData.stackId=pData.children.push(this.aData)-1;this.aData.parent=pData;};this.purgeAlignment=function(){var layout=l.get(this.pHtmlNode);l.queue(this.pHtmlNode,null,layout.root);};function remove(doOnlyAdmin){if(doOnlyAdmin){return;}if(this.aData){this.aData.remove();this.purgeAlignment();if(this.parentNode.pData&&!this.parentNode.pData.children.length){l.removeAll(this.parentNode.pData);this.parentNode.pData=null;}this.oExt.style.display="none";}}function reparent(beforeNode,pNode,withinParent,oldParent){if(!this.$jmlLoaded){return;}if(!withinParent&&this.aData){this.aData.pHtml=this.pHtmlNode;this.enableAlignment();}}this.$addJmlLoader(function(){this.$supportedProperties.push("align","lean","edge","weight","splitter","width","height","minwidth","minheight");this.$propHandlers.lean=function(value){this.aData.isBottom=(value||"").indexOf("bottom")>-1;this.aData.isRight=(value||"").indexOf("right")>-1;this.purgeAlignment();};this.$propHandlers.edge=function(value){this.aData.edgeMargin=Math.max(this.aData.splitter||0,value!="splitter"?value:0);this.aData.splitter=value=="splitter"?5:false;this.purgeAlignment();};this.$propHandlers.weight=function(value){this.aData.weight=parseFloat(value);this.purgeAlignment();};this.$propHandlers.splitter=function(value){this.aData.splitter=value?5:false;this.aData.edgeMargin=Math.max(this.aData.splitter||0,this.edge||0);if(!value&&this.align&&this.align.indexOf("-splitter")){this.align=this.aData.template=this.align.replace("-splitter","");}this.purgeAlignment();};this.$propHandlers.width=function(value){this.width=null;this.aData.fwidth=value||false;if(this.aData.fwidth&&this.aData.fwidth.indexOf("/")>-1){this.aData.fwidth=eval(this.aData.fwidth);if(this.aData.fwidth<=1){this.aData.fwidth=(this.aData.fwidth*100)+"%";}}this.purgeAlignment();};this.$propHandlers.height=function(value){this.height=null;this.aData.fheight=String(value)||false;if(this.aData.fheight&&this.aData.fheight.indexOf("/")>-1){this.aData.fheight=eval(this.aData.fheight);if(this.aData.fheight<=1){this.aData.fheight=(this.aData.fheight*100)+"%";}}this.purgeAlignment();};this.$propHandlers.minwidth=function(value){this.aData.minwidth=value;this.purgeAlignment();};this.$propHandlers.minheight=function(value){this.aData.minheight=value;this.purgeAlignment();};});this.$jmlDestroyers.push(function(){this.disableAlignment();});};var __DRAGDROP__=1<<5;jpf.profiler={stackTrace:{},previousStack:null,isRunning:false,pointers:{},hasPointers:false,precision:3,runs:0,sortMethod:2,startBusy:false,startQueue:[],startQueueTimer:null,endBusy:false,endQueue:[],endQueueTimer:null,init:function(){var m,c,h,s,w,n;for(m=0;m<arguments.length;m+=2){if(typeof arguments[m]=="object"){h=arguments[m];if(h==this){continue;}if(!h||(typeof h.__profilerId!="undefined"&&(!h.prototype||h.prototype.$profilerId!=h.$profilerId))){continue;}if(h.nodeType){continue;}h.$profilerId=this.recurDetect.push(h)-1;s=arguments[(m+1)];if(s.indexOf("contentDocument")>-1){alert(1);}for(c in h){w=s+"."+c;n=false;try{var q=typeof h[c];n=true;}catch(t){}if(n===false){continue;}if(typeof h[c]=="function"&&typeof h[c]["nameSelf"]=="undefined"){h[c].nameSelf=w;this.pointers["pointer_to_"+w]=h[c];var a,v={};for(a in h[c]){v[a]=h[c][a];}var u=h[c].prototype?h[c].prototype:null;h[c]=Profiler_functionTemplate();for(a in v){h[c][a]=v[a];}if(u){h[c].prototype=u;this.init(u,w+".prototype");}h[c].nameSelf=w;if(!this.hasPointers){this.hasPointers=true;}}else{if(typeof h[c]=="object"){this.init(h[c],w);}}}}}},recurDetect:[],uniqueNumber:0,wrapFunction:function(c){var a="anonymous"+this.uniqueNumber++;c.nameSelf=a;this.pointers["pointer_to_"+a]=c;c=Profiler_functionTemplate();c.nameSelf=a;},reinit:function(){this.stackTrace={};this.previousStack=null;this.isRunning=false;this.startBusy=this.endBusy=false;this.startQueue=[];this.endQueue=[];this.endQueueTimer=this.startQueueTimer=null;this.init.apply(this,arguments);},isInitialized:function(){return(this.hasPointers===true);},registerStart:function(h){if(this.isRunning){if(this.startBusy){if(h){this.startQueue.push(h);}this.startQueueTimer=setTimeout("jpf.profiler.registerStart()",200);}else{this.startBusy=true;clearTimeout(this.startQueueTimer);var a=(this.startQueue.length)?this.startQueue:[];this.startQueue=[];if(h){a.push(h);}for(var c=0;c<a.length;c++){if(!this.stackTrace[a[c]]){this.stackTrace[a[c]]={called:1,fullName:h,internalExec:0,executions:[[new Date(),null]]};}else{this.stackTrace[a[c]].called++;this.stackTrace[a[c]].executions.push([new Date(),null]);}}this.startBusy=false;}}},registerEnd:function(h){if(this.isRunning){if(!this.stackTrace[h]){return;}if(this.endBusy){if(h){this.endQueue.push([h,arguments.callee.caller.caller?arguments.callee.caller.caller.nameSelf:null]);}this.endQueueTimer=setTimeout("jpf.profiler.registerEnd()",200);}else{this.endBusy=true;clearTimeout(this.endQueueTimer);var a=(this.endQueue.length)?this.endQueue:[];this.endQueue=[];if(h){a.push([h,arguments.callee.caller.caller?arguments.callee.caller.caller.nameSelf:null]);}for(var c=0;c<a.length;c++){iLength=this.stackTrace[a[c][0]].executions.length-1;if(this.stackTrace[a[c][0]].executions[iLength][1]==null){this.stackTrace[a[c][0]].executions[iLength][1]=new Date();if(a[c][1]&&this.stackTrace[a[c][1]]){this.stackTrace[a[c][1]].internalExec+=this.stackTrace[a[c][0]].executions[iLength][1]-this.stackTrace[a[c][0]].executions[iLength][0];}}}this.endBusy=false;}}},start:function(){this.reset();this.isRunning=true;},stop:function(){if(this.isRunning){this.runs++;}this.isRunning=false;return this.report();},reset:function(){delete this.stackTrace;this.stackTrace={};this.isRunning=false;},report:function(){var h,c,n,a,q,m;this.stackTrace.totalCalls=this.stackTrace.totalAvg=this.stackTrace.totalDur=0;for(h in this.stackTrace){if(!this.stackTrace[h].fullName){continue;}a=this.stackTrace[h];m=a.executions.length;a.time=a.max=0;a.min=Infinity;for(c=0;c<a.executions.length;c++){q=a.executions[c];n=(q[1]-q[0]);if(isNaN(n)||!isFinite(n)||n<0){n=0;}if(a.max<n){a.max=n;}if(a.min>n){a.min=n;}else{if(a.min==Infinity&&a.max>0){a.min=a.max;}}a.time+=n;}a.avg=a.time/m;a.avg=parseFloat(((isNaN(a.avg)||!isFinite(a.avg))?0:a.avg).toFixed(this.precision));a.min=parseFloat(((isNaN(a.min)||!isFinite(a.min))?0:a.min).toFixed(this.precision));a.max=parseFloat(a.max.toFixed(this.precision));this.stackTrace.totalCalls+=m;this.stackTrace.totalDur+=a.time;}this.stackTrace.totalDur=parseFloat(this.stackTrace.totalDur.toFixed(this.precision));this.stackTrace.totalAvg=parseFloat(this.stackTrace.totalDur/this.stackTrace.totalCalls);this.stackTrace.totalAvg=parseFloat(this.stackTrace.totalAvg.toFixed(this.precision));return this.buildReport(this.stackTrace);},buildReport:function(q,m){if(typeof wihContainer=="undefined"){m=true;}var h=m?['<div id="profiler_report_'+this.runs+'">']:[""];var u="#fff";var t="#f5f5f5";var a="#006400";var c="background: url(./core/debug/resources/tableHeaderSorted.gif) repeat-x top left;";h.push('<table border="0" style="border: 1px solid #d7d7d7; width: 100%; margin: 0 4px 0 0; padding: 0;" cellpadding="2" cellspacing="0"><tr style="background:#d9d9d9 url(./core/debug/resources/tableHeader.gif) repeat-x top left;height: 16px;cursor: hand;cursor: pointer;"><th style="border-right: 1px solid #9c9c9c;border-left: 1px solid #d9d9d9;border-bottom: 1px solid #9c9c9c;padding: 0; margin: 0;',(this.sortMethod==jpf.profiler.SORT_BY_FUNCTIONNAME?c:""),'" rel="3" onclick="jpf.debugwin.resortResult(this);" title="" width="110">Function</th><th style="border-right: 1px solid #9c9c9c;border-left: 1px solid #d9d9d9;border-bottom: 1px solid #9c9c9c;padding: 0; margin: 0;',(this.sortMethod==jpf.profiler.SORT_BY_CALLS?c:""),'" rel="1" onclick="jpf.debugwin.resortResult(this);"title="Number of times function was called.">Calls</th><th style="border-right: 1px solid #9c9c9c;border-left: 1px solid #d9d9d9;border-bottom: 1px solid #9c9c9c;padding: 0; margin: 0;',(this.sortMethod==jpf.profiler.SORT_BY_PERCENTAGE?c:""),'" rel="2" onclick="jpf.debugwin.resortResult(this);" title="Percentage of time spent on this function.">Percentage</th><th style="border-right: 1px solid #9c9c9c;border-left: 1px solid #d9d9d9;border-bottom: 1px solid #9c9c9c;padding: 0; margin: 0;',(this.sortMethod==jpf.profiler.SORT_BY_OWNTIME?c:""),'" rel="8" onclick="jpf.debugwin.resortResult(this);" title="Time spent in function, excluding nested calls.">Own Time</th><th style="border-right: 1px solid #9c9c9c;border-left: 1px solid #d9d9d9;border-bottom: 1px solid #9c9c9c;padding: 0; margin: 0;',(this.sortMethod==jpf.profiler.SORT_BY_TIME?c:""),'" rel="4" onclick="jpf.debugwin.resortResult(this);" title="Time spent in function, including nested calls.">Time</th><th style="border-right: 1px solid #9c9c9c;border-left: 1px solid #d9d9d9;border-bottom: 1px solid #9c9c9c;padding: 0; margin: 0;',(this.sortMethod==jpf.profiler.SORT_BY_AVERAGE?c:""),'" rel="5" onclick="jpf.debugwin.resortResult(this);" title="Average time, including function calls.">Avg</th><th style="border-right: 1px solid #9c9c9c;border-left: 1px solid #d9d9d9;border-bottom: 1px solid #9c9c9c;padding: 0; margin: 0;',(this.sortMethod==jpf.profiler.SORT_BY_MINIMUM?c:""),'" rel="6" onclick="jpf.debugwin.resortResult(this);" title="Minimum time, including function calls.">Min</th><th style="border-right: 1px solid #9c9c9c;border-left: 1px solid #d9d9d9;border-bottom: 1px solid #9c9c9c;padding: 0; margin: 0;',(this.sortMethod==jpf.profiler.SORT_BY_MAXIMUM?c:""),'" rel="7" onclick="jpf.debugwin.resortResult(this);" title="Maximum time, including function calls.">Max</th></tr>');var n,s=this.sortStack(q);for(i=0;i<s.length;i++){stack=q[s[i][0]];n=(i%2==0)?u:t;h.push('<tr style="background-color: ',n,'; padding: 0; margin: 0; "><td class="functionname" style="color: ',a,';font-family: Monaco, Courier New;font-size: 10px;">'+stack.fullName+'</td><td class="callscount">'+stack.executions.length+'</td><td class="duration_percentage">'+stack.perc+'%</td><td class="duration_owntime">'+(stack.time-stack.internalExec)+'ms</td><td class="duration_time">'+stack.time+'ms</td><td class="duration_average">'+stack.avg+'ms</td><td class="duration_min">'+stack.min+'ms</td><td class="duration_max">'+stack.max+"ms</td></tr>");}h.push("</table>");if(m){h.push("</div>");}this.previousStack=q;return{html:h.join(""),total:q.totalCalls,duration:q.totalDur};},sortStack:function(h){var m,c,a=[];for(m in h){if(!h[m].fullName){continue;}c=h[m];c.perc=100-Math.round((Math.abs(c.time-h.totalDur)/h.totalDur)*100);switch(this.sortMethod){case jpf.profiler.SORT_BY_CALLS:a.push([m,(c.executions.length-1)]);break;default:case jpf.profiler.SORT_BY_PERCENTAGE:a.push([m,c.perc]);break;case jpf.profiler.SORT_BY_FUNCTIONNAME:a.push([m,c.fullName.toLowerCase()]);break;case jpf.profiler.SORT_BY_TIME:a.push([m,c.time]);break;case jpf.profiler.SORT_BY_AVERAGE:a.push([m,c.avg]);break;case jpf.profiler.SORT_BY_MINIMUM:a.push([m,c.min]);break;case jpf.profiler.SORT_BY_MAXIMUM:a.push([m,c.max]);break;case jpf.profiler.SORT_BY_OWNTIME:a.push([m,(c.time-c.internalExec)]);break;}}return a.sort((this.sortMethod==jpf.profiler.SORT_BY_FUNCTIONNAME)?this.sortingHelperAsc:this.sortingHelperDesc);},resortStack:function(a){if(this.previousStack){this.sortMethod=parseInt(a);return this.buildReport(this.previousStack,false);}return"";},sortingHelperAsc:function(h,c){if(h[1]<c[1]){return -1;}else{if(h[1]>c[1]){return 1;}else{return 0;}}},sortingHelperDesc:function(h,c){if(h[1]>c[1]){return -1;}else{if(h[1]<c[1]){return 1;}else{return 0;}}},getFunctionName:function(a){var c=a.toString().match(/function(\s*)(\w*)/);if(c&&c.length>=2&&c[2]){return c[2];}return"anonymous";}};jpf.profiler.SORT_BY_CALLS=1;jpf.profiler.SORT_BY_PERCENTAGE=2;jpf.profiler.SORT_BY_FUNCTIONNAME=3;jpf.profiler.SORT_BY_TIME=4;jpf.profiler.SORT_BY_AVERAGE=5;jpf.profiler.SORT_BY_MINIMUM=6;jpf.profiler.SORT_BY_MAXIMUM=7;jpf.profiler.SORT_BY_OWNTIME=8;jpf.profiler.BLACKLIST={"jpf.profiler":1};var Profiler_functionTemplate=function(){return function(){jpf.profiler.registerStart(arguments.callee.nameSelf);var a=jpf.profiler.pointers["pointer_to_"+arguments.callee.nameSelf].apply(this,arguments);jpf.profiler.registerEnd(arguments.callee.nameSelf);return a;};};jpf.BaseButton=function(q){var c=0;var n=0;var m=false;var h=false;var a=this;this.$propHandlers.background=function(t){var u=this.$getLayoutNode("main","background",this.oExt);if(!u){return;}if(t){var s=t.split("|");this.$background=s.concat(["vertical",2,16].slice(s.length-1));u.style.backgroundImage="url("+this.mediaPath+s[0]+")";u.style.backgroundRepeat="no-repeat";}else{u.style.backgroundImage="";u.style.backgroundRepeat="";this.$background=null;}};this.addEventListener("keydown",function(u){var t=u.keyCode;var v=u.ctrlKey;var s=u.shiftKey;switch(t){case 13:if(this.tagName!="checkbox"){this.oExt.onmouseup(u.htmlEvent,true);}break;case 32:if(!u.htmlEvent.repeat){c++;return this.$updateState(u.htmlEvent);}else{return false;}}},true);this.addEventListener("keyup",function(t){var s=t.keyCode;switch(s){case 32:c--;if(c<0){c=0;return;}if(c+n==0&&!this.disabled){this.oExt.onmouseup(t,true);}return this.$updateState(t);}},true);this.states={Out:1,Over:2,Down:3};this.$updateState=function(t,s){if(this.disabled||t.reset){c=0;n=0;m=false;return false;}if(c>0||(n>0&&m)||(this.isBoolean&&this.value)){this.$setState("Down",t,s);}else{if(m){this.$setState("Over",t,s);}else{this.$setState("Out",t,s);}}};this.$setupEvents=function(){this.oExt.onmousedown=function(s){s=s||window.event;if(a.$notfromext&&(s.srcElement||s.target)==this){return;}n=1;h=false;a.$updateState(s,"mousedown");};this.oExt.onmouseup=function(t,s){t=t||window.event;if(!s&&(!m||!n)){return;}n=0;a.$updateState(t,"mouseup");if(a.disabled||(t&&t.type=="click"&&h==true)){return false;}if(n+a.refKeyDown){return false;}if(a.$clickHandler&&a.$clickHandler()){a.$updateState(t||event,"click");}else{a.dispatchEvent("click",{htmlEvent:t});}return false;};this.oExt.onmousemove=function(s){if(!m){s=s||window.event;if(a.$notfromext&&(s.srcElement||s.target)==this){return;}m=true;a.$updateState(s,"mouseover");}};this.oExt.onmouseout=function(t){t=t||window.event;var s=t.explicitOriginalTarget||t.toElement;if(this==s||jpf.xmldb.isChildOf(this,s)){return;}m=false;n=0;h=true;a.$updateState(t,"mouseout");};if(jpf.hasClickFastBug){this.oExt.ondblclick=this.oExt.onmouseup;}};this.$doBgSwitch=function(t){if(this.bgswitch&&(this.$background[2]>=t||t==4)){if(t==4){t=this.$background[2]+1;}var s=this.$background[1]=="vertical"?"0 -"+(parseInt(this.$background[3])*(t-1))+"px":"-"+(parseInt(this.$background[3])*(t-1))+"px 0";this.$getLayoutNode("main","background",this.oExt).style.backgroundPosition=s;}};this.$focus=function(){if(!this.oExt){return;}this.$setStyleClass(this.oExt,this.baseCSSname+"Focus");};this.$blur=function(s){if(!this.oExt){return;}this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Focus"]);if(s){this.$updateState(s);}};this.$destroy=function(s){if(!s){this.oExt.onmousedown=this.oExt.onmouseup=this.oExt.onmouseover=this.oExt.onmouseout=this.oExt.onclick=this.oExt.ondblclick=null;}};};jpf.BaseTab=function(){this.isPaged=true;this.$focussable=jpf.KEYBOARD;this.canHaveChildren=true;this.set=function(m,h){if(h){return this.$propHandlers.activepage.call(this,m,h);}return this.setProperty("activepage",m);};var a=false;var c=false;this.$supportedProperties.push("activepage","activepagenr");this.$propHandlers.activepagenr=this.$propHandlers.activepage=function(n,m){if(!a){return;}var q,s={};q=this.$findPage(n,s);if(!q){return false;}if(q.parentNode!=this){return false;}if(!q.visible||q.disabled){return false;}if(n.tagName){n=s.position;this.activepage=q.name||n;}if(!m){var h={previous:this.activepage,previousId:this.activepagenr,previousPage:this.$activepage,next:n,nextId:s.position,nextpage:q};if(this.dispatchEvent("beforeswitch",h)===false){if(this.hideLoader){this.hideLoader();}return false;}}this.activepagenr=s.position;this.setProperty("activepagenr",s.position);if(this.$activepage){this.$activepage.$deactivate();}q.$activate();this.$activepage=q;if(this.hideLoader){if(q.isRendered){this.hideLoader();}else{q.addEventListener("afterrender",function(){this.parentNode.hideLoader();});}}if(!m){if(q.isRendered){this.dispatchEvent("afterswitch",h);}else{q.addEventListener("afterrender",function(){this.parentNode.dispatchEvent("afterswitch",h);});}}return true;};this.getPages=function(){var q=[],m=this.childNodes;for(var n=0,h=m.length;n<h;n++){if(m[n].tagName=="page"){q.push(m[n]);}}return q;};this.getPage=function(h){return !jpf.isNot(h)&&this.$findPage(h)||this.$activepage;};this.add=function(h,m){var n=jpf.document.createElement("page");if(m){n.setAttribute("id",m);}n.setAttribute("caption",h);this.appendChild(n);return n;};this.remove=function(h){var m=this.$findPage(h);if(!m){return false;}m.removeNode();return m;};this.$domHandlers.removechild.push(function(m,h){if(h){return;}if(this.firstChild==m&&m.nextSibling){m.nextSibling.$first();}if(this.lastChild==m&&m.previousSibling){m.previousSibling.$last();}if(this.$activepage==m){if(m.nextSibling||m.previousSibling){this.set(m.nextSibling||m.previousSibling);}else{this.$activepage=this.activepage=this.activepagenr=null;}}else{this.setScrollerState();}});this.$domHandlers.insert.push(function(q,h,m){if(q.tagName!="page"){return;}if(!h){if(this.lastChild){this.lastChild.$last(true);}q.$last();}if(!this.firstChild||h==this.firstChild){if(this.firstChild){this.firstChild.$first(true);}q.$first();}if(this.$activepage){var n={};this.$findPage(this.$activepage,n);if(this.activepagenr!=n.position){if(parseInt(this.activepage)==this.activepage){this.activepage=n.position;this.setProperty("activepage",n.position);}this.activepagenr=n.position;this.setProperty("activepagenr",n.position);}}else{if(!this.$activepage){this.set(q);}}});this.$findPage=function(u,v){var s,m=this.childNodes;for(var q=0,n=0,h=m.length;n<h;n++){s=m[n];if(s.tagName=="page"&&(q++==u||(u.tagName&&s||s.name)==u)){if(v){v.position=q-1;}return s;}}return null;};this.$enable=function(){var m=this.childNodes;for(var n=0,h=m.length;n<h;n++){if(m[n].enable){m[n].enable();}}};this.$disable=function(){var m=this.childNodes;for(var n=0,h=m.length;n<h;n++){if(m[n].disable){m[n].disable();}}};this.addEventListener("keydown",function(s){if(!this.$hasButtons){return;}var q=s.keyCode,h,n,m;switch(q){case 9:break;case 13:break;case 32:break;case 37:h=this.getPages();n=this.activepagenr-1;while(n>=0&&!h[n].visible){n--;}if(n>=0){this.setProperty("activepage",n);}break;case 39:h=this.getPages();m=this.activepagenr+1;while(m<h.length&&!h[m].visible){m++;}if(m<h.length){this.setProperty("activepage",m);}break;default:return;}},true);this.implement(jpf.Presentation);this.$loadChildren=function(v){var u=false,t=false,q,h=this;a=true;if(this.$hasButtons){this.oButtons=this.$getLayoutNode("main","buttons",this.oExt);this.oButtons.setAttribute("id",this.uniqueId+"_buttons");}this.oPages=this.$getLayoutNode("main","pages",this.oExt);if(this.oInt){this.oInt=this.oPages;u=true;var s,m=this.childNodes;for(q=0;q<m.length;q++){s=m[q];s.$draw(true);s.$skinchange();s.$loadJml();}}else{this.oInt=this.oPages;if(this.childNodes.length){c=true;return;}var s,m=this.$jml.childNodes;for(q=0;q<m.length;q++){s=m[q];if(s.nodeType!=1){continue;}var n=s[jpf.TAGNAME];if("page|case".indexOf(n)>-1){u=new jpf.page(this.oPages,n).loadJml(s,this);if(!t){u.$first(t=u);}if(v){v.call(u,s);}}else{if(n=="comment"){}else{if(v){v(n,s);}}}}if(u!==t){u.$last();}}if(u){this.activepage=(this.activepage!==undefined?this.activepage:this.activepagenr)||0;this.$propHandlers.activepage.call(this,this.activepage);}else{jpf.JmlParser.parseChildren(this.$jml,this.oExt,this);this.isPages=false;}c=true;};};jpf.page=jpf.component(jpf.NODE_HIDDEN,function(){this.visible=true;this.canHaveChildren=2;this.$focussable=false;this.setCaption=function(c){this.setProperty("caption",c);};this.addEventListener("beforerender",function(){this.parentNode.dispatchEvent("beforerender",{page:this});});this.addEventListener("afterrender",function(){this.parentNode.dispatchEvent("afterrender",{page:this});});this.$booleanProperties.visible=true;this.$booleanProperties.fake=true;this.$supportedProperties.push("fake","caption","icon","type");this.$propHandlers.caption=function(h){if(!this.parentNode){return;}var c=this.parentNode.$getLayoutNode("button","caption",this.oButton);if(c.nodeType==1){c.innerHTML=h;}else{c.nodeValue=h;}};this.$propHandlers.visible=function(n){if(!this.parentNode){return;}if(n){this.oExt.style.display="";if(this.parentNode.$hasButtons){this.oButton.style.display="block";}if(!this.parentNode.$activepage){this.parentNode.set(this);}}else{if(this.$active){this.$deactivate();var m=this.parentNode.activepagenr+1;var h=this.parentNode.getPages();var c=h.length;while(m<c&&!h[m].visible){m++;}if(m==c){m=this.parentNode.activepagenr-1;while(m>=0&&c&&!h[m].visible){m--;}}if(m>=0){this.parentNode.set(m);}else{this.parentNode.activepage=this.parentNode.activepagenr=this.parentNode.$activepage=null;}}this.oExt.style.display="none";if(this.parentNode.$hasButtons){this.oButton.style.display="none";}}};this.$propHandlers.fake=function(c){if(this.oExt){jpf.removeNode(this.oExt);this.oInt=this.oExt=null;}};this.$propHandlers.type=function(c){this.setProperty("fake",true);this.relPage=this.parentNode.getPage(c);if(this.$active){this.$activate();}};this.$domHandlers.remove.push(function(c){if(this.oButton){if(a&1){this.parentNode.$setStyleClass(this.oButton,"",["firstbtn","firstcurbtn"]);}if(a&2){this.parentNode.$setStyleClass(this.oButton,"",["lastbtn"]);}}if(!c){if(this.oButton){this.oButton.parentNode.removeChild(this.oButton);}if(this.parentNode.$activepage==this){if(this.oButton){this.parentNode.$setStyleClass(this.oButton,"",["curbtn"]);}this.parentNode.$setStyleClass(this.oExt,"",["curpage"]);}}});this.$domHandlers.reparent.push(function(c,m,h){if(!this.$jmlLoaded){return;}if(!h&&this.skinName!=m.skinName){this.$draw();this.$skinchange();this.$loadJml();}else{if(this.oButton&&m.$hasButtons){m.oButtons.insertBefore(this.oButton,c&&c.oButton||null);}}});var a=0;this.$first=function(c){if(c){a-=1;this.parentNode.$setStyleClass(this.oButton,"",["firstbtn","firstcurbtn"]);}else{a=a|1;this.parentNode.$setStyleClass(this.oButton,"firstbtn"+(this.parentNode.$activepage==this?" firstcurbtn":""));}};this.$last=function(c){if(c){a-=2;this.parentNode.$setStyleClass(this.oButton,"",["lastbtn"]);}else{a=a|2;this.parentNode.$setStyleClass(this.oButton,"lastbtn");}};this.$deactivate=function(c){if(this.disabled){return false;}this.$active=false;if(this.parentNode.$hasButtons){if(a>0){this.parentNode.$setStyleClass(this.oButton,"",["firstcurbtn"]);}this.parentNode.$setStyleClass(this.oButton,"",["curbtn"]);}if((!this.fake||this.relPage)&&!c){this.parentNode.$setStyleClass(this.fake?this.relPage.oExt:this.oExt,"",["curpage"]);}};this.$activate=function(){if(this.disabled){return false;}if(this.parentNode.$hasButtons){if(a>0){this.parentNode.$setStyleClass(this.oButton,"firstcurbtn");}this.parentNode.$setStyleClass(this.oButton,"curbtn");}if(!this.fake||this.relPage){this.parentNode.$setStyleClass(this.fake?this.relPage.oExt:this.oExt,"curpage");if(jpf.layout){jpf.layout.forceResize(this.fake?this.relPage.oInt:this.oInt);}}this.$active=true;this.$render();if(!this.fake&&jpf.isIE){var c=this.oExt.className;this.oExt.className="rnd"+Math.random();this.oExt.className=c;}};this.$skinchange=function(){if(this.caption){this.$propHandlers.caption.call(this,this.caption);}if(this.icon){this.$propHandlers.icon.call(this,this.icon);}};this.$draw=function(c){this.skinName=this.parentNode.skinName;var m=this.$jml.getAttribute("type");if(m){this.fake=true;this.relPage=this.parentNode.getPage(m)||null;}if(this.parentNode.$hasButtons){this.parentNode.$getNewContext("button");var h=this.parentNode.$getLayoutNode("button");h.setAttribute(this.parentNode.$getOption("main","select")||"onmousedown","jpf.lookup("+this.parentNode.uniqueId+").set(jpf.lookup("+this.uniqueId+"));if(!jpf.isSafariOld) this.onmouseout()");h.setAttribute("onmouseover","var o = jpf.lookup("+this.parentNode.uniqueId+");if(jpf.lookup("+this.uniqueId+') != o.$activepage) o.$setStyleClass(this, "over");');h.setAttribute("onmouseout","var o = jpf.lookup("+this.parentNode.uniqueId+'); o.$setStyleClass(this, "", ["over"]);');this.oButton=jpf.xmldb.htmlImport(h,this.parentNode.oButtons);if(!c&&this.nextSibling&&this.nextSibling.oButton){this.oButton.parentNode.insertBefore(this.oButton,this.nextSibling.oButton);}this.oButton.host=this;}if(this.fake){return;}if(this.oExt){this.oExt.parentNode.removeChild(this.oExt);}this.oExt=this.parentNode.$getExternal("page",this.parentNode.oPages,null,this.$jml);this.oExt.host=this;};this.$loadJml=function(c){if(this.fake){return;}if(this.oInt){var h=this.parentNode.$getLayoutNode("page","container",this.oExt);h.setAttribute("id",this.oInt.getAttribute("id"));this.oInt=jpf.JmlParser.replaceNode(h,this.oInt);}else{this.oInt=this.parentNode.$getLayoutNode("page","container",this.oExt);jpf.JmlParser.parseChildren(this.$jml,this.oInt,this,true);}};this.$destroy=function(){if(this.oButton){this.oButton.host=null;this.oButton=null;}};}).implement(jpf.DelayedRender);jpf.BaseSimple=function(){this.implement(jpf.Presentation);this.implement(jpf.DataBinding);this.getValue=function(){return this.value;};};jpf.BaseList=function(){this.implement(jpf.Validation);this.dynCssClasses=[];this.$focussable=true;this.multiselect=true;this.$propHandlers.fill=function(c){if(c){this.loadFillData(this.$jml.getAttribute("fill"));}else{this.clear();}};this.$keyHandler=function(w){var E=w.keyCode,h=w.ctrlKey,A=w.shiftKey,z=this.$selected||this.$indicator;if(!z||this.renaming){return;}var C=this.indicator||this.selected,m=this.oExt,n,q,y,F,B,u,t;switch(E){case 13:if(this.$tempsel){this.selectTemp();}if(this.ctrlselect=="enter"){this.select(this.indicator,true);}this.choose(z);break;case 32:this.select(this.indicator,true);break;case 109:case 46:if(this.disableremove){return;}if(this.$tempsel){this.selectTemp();}this.remove(this.mode!="normal"?this.indicator:null);break;case 36:this.select(this.getFirstTraverseNode(),false,A);this.oInt.scrollTop=0;break;case 35:this.select(this.getLastTraverseNode(),false,A);this.oInt.scrollTop=this.oInt.scrollHeight;break;case 107:if(this.more){this.startMore();}break;case 37:if(!C&&!this.$tempsel){return;}n=this.$tempsel?jpf.xmldb.getNode(this.$tempsel):C;q=jpf.getBox(jpf.getStyle(z,"margin"));y=Math.floor((m.offsetWidth-(B?15:0))/(z.offsetWidth+q[1]+q[3]));q=jpf.getBox(jpf.getStyle(z,"margin"));n=this.getNextTraverseSelected(n,false);if(n){this.setTempSelected(n,h,A);}else{return;}z=jpf.xmldb.findHTMLNode(n,this);if(z.offsetTop<m.scrollTop){m.scrollTop=Array.prototype.indexOf.call(this.getTraverseNodes(),n)<y?0:z.offsetTop-q[0];}break;case 38:if(!C&&!this.$tempsel){return;}n=this.$tempsel?jpf.xmldb.getNode(this.$tempsel):C;q=jpf.getBox(jpf.getStyle(z,"margin"));B=m.scrollHeight>m.offsetHeight;y=Math.floor((m.offsetWidth-(B?15:0))/(z.offsetWidth+q[1]+q[3]));n=this.getNextTraverseSelected(n,false,y);if(n){this.setTempSelected(n,h,A);}else{return;}z=jpf.xmldb.findHTMLNode(n,this);if(z.offsetTop<m.scrollTop){m.scrollTop=Array.prototype.indexOf.call(this.getTraverseNodes(),n)<y?0:z.offsetTop-q[0];}break;case 39:if(!C&&!this.$tempsel){return;}n=this.$tempsel?jpf.xmldb.getNode(this.$tempsel):C;q=jpf.getBox(jpf.getStyle(z,"margin"));n=this.getNextTraverseSelected(n,true);if(n){this.setTempSelected(n,h,A);}else{return;}z=jpf.xmldb.findHTMLNode(n,this);if(z.offsetTop+z.offsetHeight>m.scrollTop+m.offsetHeight){m.scrollTop=z.offsetTop-m.offsetHeight+z.offsetHeight+q[0];}break;case 40:if(!C&&!this.$tempsel){return;}n=this.$tempsel?jpf.xmldb.getNode(this.$tempsel):C;q=jpf.getBox(jpf.getStyle(z,"margin"));B=m.scrollHeight>m.offsetHeight;y=Math.floor((m.offsetWidth-(B?15:0))/(z.offsetWidth+q[1]+q[3]));n=this.getNextTraverseSelected(n,true,y);if(n){this.setTempSelected(n,h,A);}else{return;}z=jpf.xmldb.findHTMLNode(n,this);if(z.offsetTop+z.offsetHeight>m.scrollTop+m.offsetHeight){m.scrollTop=z.offsetTop-m.offsetHeight+z.offsetHeight+q[0];}break;case 33:if(!C&&!this.$tempsel){return;}n=this.$tempsel?jpf.xmldb.getNode(this.$tempsel):C;q=jpf.getBox(jpf.getStyle(z,"margin"));t=m.scrollHeight>m.offsetHeight;u=m.scrollWidth>m.offsetWidth;y=Math.floor((m.offsetWidth-(t?15:0))/(z.offsetWidth+q[1]+q[3]));F=Math.floor((m.offsetHeight-(u?15:0))/(z.offsetHeight+q[0]+q[2]));n=this.getNextTraverseSelected(n,false,y*F);if(!n){n=this.getFirstTraverseNode();}if(n){this.setTempSelected(n,h,A);}else{return;}z=jpf.xmldb.findHTMLNode(n,this);if(z.offsetTop<m.scrollTop){m.scrollTop=Array.prototype.indexOf.call(this.getTraverseNodes(),n)<y?0:z.offsetTop-q[0];}break;case 34:if(!C&&!this.$tempsel){return;}n=this.$tempsel?jpf.xmldb.getNode(this.$tempsel):C;q=jpf.getBox(jpf.getStyle(z,"margin"));t=m.scrollHeight>m.offsetHeight;u=m.scrollWidth>m.offsetWidth;y=Math.floor((m.offsetWidth-(t?15:0))/(z.offsetWidth+q[1]+q[3]));F=Math.floor((m.offsetHeight-(u?15:0))/(z.offsetHeight+q[0]+q[2]));n=this.getNextTraverseSelected(C,true,y*F);if(!n){n=this.getLastTraverseNode();}if(n){this.setTempSelected(n,h,A);}else{return;}z=jpf.xmldb.findHTMLNode(n,this);if(z.offsetTop+z.offsetHeight>m.scrollTop+m.offsetHeight){m.scrollTop=z.offsetTop-m.offsetHeight+z.offsetHeight+q[0];}break;default:if(E==65&&h){this.selectAll();}else{if(this.caption||(this.bindingRules||{})["caption"]){if(!this.xmlRoot||this.autorename){return;}if(!this.lookup||new Date().getTime()-this.lookup.date.getTime()>300){this.lookup={str:"",date:new Date()};}this.lookup.str+=String.fromCharCode(E);var c=this.getTraverseNodes();for(var D,s=0;s<c.length;s++){D=this.applyRuleSetOnNode("caption",c[s]);if(D&&D.substr(0,this.lookup.str.length).toUpperCase()==this.lookup.str){if(!this.isSelected(c[s])){if(this.mode=="check"){this.setIndicator(c[s]);}else{this.select(c[s]);}}if(z){this.oInt.scrollTop=z.offsetTop-(this.oInt.offsetHeight-z.offsetHeight)/2;}return;}}return;}}break;}this.lookup=null;return false;};this.$deInitNode=function(c,h){if(!h){return;}h.parentNode.removeChild(h);};this.$updateNode=function(m,s,n){var h=this.$getLayoutNode("item","icon",s);if(h){if(h.nodeType==1){h.style.backgroundImage="url("+jpf.getAbsolutePath(this.iconPath,this.applyRuleSetOnNode("icon",m))+")";}else{h.nodeValue=jpf.getAbsolutePath(this.iconPath,this.applyRuleSetOnNode("icon",m));}}else{var q=this.$getLayoutNode("item","image",s);if(q){if(q.nodeType==1){q.style.backgroundImage="url("+jpf.getAbsolutePath(this.mediaPath,this.applyRuleSetOnNode("image",m))+")";}else{q.nodeValue=jpf.getAbsolutePath(this.mediaPath,this.applyRuleSetOnNode("image",m));}}}var t=this.$getLayoutNode("item","caption",s);if(t){if(t.nodeType==1){t.innerHTML=this.applyRuleSetOnNode("caption",m);}else{t.nodeValue=this.applyRuleSetOnNode("caption",m);}}s.title=this.applyRuleSetOnNode("title",m)||"";var c=this.applyRuleSetOnNode("css",m);if(c||this.dynCssClasses.length){this.$setStyleClass(s,c,this.dynCssClasses);if(c&&!this.dynCssClasses.contains(c)){this.dynCssClasses.push(c);}}if(!n&&this.$updateModifier){this.$updateModifier(m,s);}};this.$moveNode=function(n,q){if(!q){return;}var c=q.parentNode;var m=this.getNextTraverse(n);var h=m?jpf.xmldb.findHTMLNode(m,this):null;c.insertBefore(q,h);};var a=[];this.$add=function(y,s,u,z,v){this.$getNewContext("item");var m=this.$getLayoutNode("item");var n=this.$getLayoutNode("item","select");var t=this.$getLayoutNode("item","icon");var c=this.$getLayoutNode("item","image");var w=this.$getLayoutNode("item","caption");m.setAttribute("id",s);n.setAttribute("onmouseover",'jpf.setStyleClass(this, "hover");');n.setAttribute("onmouseout",'jpf.setStyleClass(this, "", ["hover"]);');if(this.hasFeature(__RENAME__)){n.setAttribute("ondblclick","var o = jpf.lookup("+this.uniqueId+");  o.choose()");n.setAttribute(this.itemSelectEvent||"onmousedown","var o = jpf.lookup("+this.uniqueId+");if(!o.renaming && o.hasFocus() && jpf.xmldb.isChildOf(o.$selected, this, true) && o.selected) this.dorename = true;if (!o.hasFeature(__DRAGDROP__) || !event.ctrlKey)o.select(this, event.ctrlKey, event.shiftKey)");n.setAttribute("onmouseup","var o = jpf.lookup("+this.uniqueId+');if(this.dorename && o.mode == "normal")this.dorename = false;if (o.hasFeature(__DRAGDROP__) && event.ctrlKey)o.select(this, event.ctrlKey, event.shiftKey)');}else{n.setAttribute("ondblclick","var o = jpf.lookup("+this.uniqueId+"); o.choose()");n.setAttribute(this.itemSelectEvent||"onmousedown","var o = jpf.lookup("+this.uniqueId+"); o.select(this, event.ctrlKey, event.shiftKey)");}if(t){if(t.nodeType==1){t.setAttribute("style","background-image:url("+jpf.getAbsolutePath(this.iconPath,this.applyRuleSetOnNode("icon",y))+")");}else{t.nodeValue=jpf.getAbsolutePath(this.iconPath,this.applyRuleSetOnNode("icon",y));}}else{if(c){if(c.nodeType==1){c.setAttribute("style","background-image:url("+jpf.getAbsolutePath(this.mediaPath,this.applyRuleSetOnNode("image",y))+")");}else{if(jpf.isSafariOld){var h=c.ownerElement.parentNode;var q=h.appendChild(h.ownerDocument.createElement("img"));q.setAttribute("src",jpf.getAbsolutePath(this.mediaPath,this.applyRuleSetOnNode("image",y)));}else{c.nodeValue=jpf.getAbsolutePath(this.mediaPath,this.applyRuleSetOnNode("image",y));}}}}if(w){jpf.xmldb.setNodeValue(w,this.applyRuleSetOnNode("caption",y));if(this.lastRule&&this.lastRule.getAttribute("parse")=="jml"){this.doJmlParsing=true;}}m.setAttribute("title",this.applyRuleSetOnNode("tooltip",y)||"");var A=this.applyRuleSetOnNode("css",y);if(A){this.$setStyleClass(m,A);if(A){this.dynCssClasses.push(A);}}if(this.$addModifier){this.$addModifier(y,m);}if(z){jpf.xmldb.htmlImport(m,z,v);}else{a.push(m);}};this.$fill=function(){if(this.more&&!this.moreItem){this.$getNewContext("item");var m=this.$getLayoutNode("item");var n=this.$getLayoutNode("item","caption");var h=this.$getLayoutNode("item","select");m.setAttribute("class","more");h.setAttribute("onmousedown","var o = jpf.lookup("+this.uniqueId+');o.clearSelection();o.$setStyleClass(this, "more_down");');h.setAttribute("onmouseout","jpf.lookup("+this.uniqueId+').$setStyleClass(this, "", ["more_down"]);');h.setAttribute("onmouseup","jpf.lookup("+this.uniqueId+").startMore(this)");if(n){jpf.xmldb.setNodeValue(n,this.more.match(/caption:(.*)(;|$)/i)[1]);}a.push(m);}jpf.xmldb.htmlImport(a,this.oInt);a.length=0;if(this.doJmlParsing){var c=document.createElement("div");while(this.oExt.childNodes.length){c.appendChild(this.oExt.childNodes[0]);}Application.loadSubNode(c,this.oExt,null,null,true);}if(this.more&&!this.moreItem){this.moreItem=this.oInt.lastChild;}};this.startMore=function(s){this.$setStyleClass(s,"",["more_down"]);var m;if(!this.actionRules||!this.actionRules.add){if(this.traverse&&!this.traverse.match(/[\/\[]/)){m="<"+this.traverse+(this.traverse.match(/^j:/)?" xmlns:j='"+jpf.ns.jml+"'":"")+" custom='1' />";}else{return false;}}var c=this.add(m);this.select(c,null,null,null,null,true);this.oInt.appendChild(this.moreItem);var h=function(){this.getActionTracker().undo(this.autoselect?2:1);this.removeEventListener("stoprename",h);this.removeEventListener("beforerename",q);this.removeEventListener("afterrename",n);};var n=function(){this.removeEventListener("afterrename",n);};var q=function(u){this.removeEventListener("stoprename",h);this.removeEventListener("beforerename",q);var t=this.findXmlNodeByValue(u.args[1]);if(t||!u.args[1]){if(u.args[1]&&this.dispatchEvent("notunique",{value:u.args[1]})===false){this.startRename();this.addEventListener("stoprename",h);this.addEventListener("beforerename",q);}else{this.removeEventListener("afterrename",n);this.getActionTracker().undo();if(!this.isSelected(t)){this.select(t);}}return false;}};this.addEventListener("stoprename",h);this.addEventListener("beforerename",q);this.addEventListener("afterrename",n);};this.$calcSelectRange=function(m,c){var q=[],h=this.getTraverseNodes(),s,n;for(s=false,n=0;n<h.length;n++){if(h[n]==m){s=true;}if(s){q.push(h[n]);}if(h[n]==c){s=false;}}if(!q.length||s){q=[];for(s=false,n=h.length-1;n>=0;n--){if(h[n]==m){s=true;}if(s){q.push(h[n]);}if(h[n]==c){s=false;}}}return q;};this.$selectDefault=function(c){this.select(this.getTraverseNodes()[0]);};this.implement(jpf.MultiSelect,jpf.Cache,jpf.Presentation,jpf.DataBinding);this.loadFillData=function(s){var n=s.split("-");var t=parseInt(n[0]);var h=parseInt(n[1]);var q=[];for(var m=t;m<h+1;m++){q.push("<item>"+(m+"").pad(Math.max(n[0].length,n[1].length),"0")+"</item>");}if(q.length){var c=new jpf.smartbinding(null,jpf.getXmlDom("<smartbindings xmlns='"+jpf.ns.jml+"'><bindings><caption select='text()' /><value select='text()'/><traverse select='item' /></bindings><model><items>"+q.join("")+"</items></model></smartbindings>").documentElement);jpf.JmlParser.addToSbStack(this.uniqueId,c);}};};jpf.template=jpf.component(jpf.NODE_HIDDEN,function(){this.canHaveChildren=true;this.$focussable=false;var a=[];this.render=function(q,n){if(!a.length||n){a.push(this.childNodes=[]);}else{var h=this.childNodes=a[0];for(var m=0,c=h.length;m<c;m++){q.appendChild(h[m].oExt);}return h;}jpf.JmlParser.parseMoreJml(this.$jml,q,this,true);return this.childNodes;};this.detach=function(){var h=this.childNodes;var n=h[0].oExt.parentNode;if(!n||n.nodeType!=1){return;}for(var m=0,c=h.length;m<c;m++){n.removeChild(h[m].oExt);}};this.$loadJml=function(c){if(this.autoinit){jpf.JmlParser.parseChildren(this.$jml,document.body,this);this.detach();a.push(this.childNodes);}};});jpf.WinServer={count:9000,wins:[],setTop:function(h,c){var a;if(!c&&this.wins.length){var a=this.wins[this.wins.length-1];if(!a.modal||!a.visible){a=null;}}this.count+=2;h.setProperty("zindex",this.count);this.wins.remove(h);this.wins.push(h);if(a){this.setTop(a,true);}return h;},setNext:function(){if(this.wins.length<2){return;}var a,c=this.wins.shift();do{if(this.setTop(a||c).visible){break;}a=this.wins.shift();}while(c!=a);},setPrevious:function(){if(this.wins.length<2){return;}this.wins.unshift(this.wins.pop());var a,c=this.wins.pop();do{if(this.setTop(a||c).visible){break;}a=this.wins.pop();}while(c!=a);},remove:function(a){this.wins.remove(a);}};jpf.modalwindow=jpf.component(jpf.NODE_VISIBLE,function(){this.isWindowContainer=true;this.canHaveChildren=2;this.animate=true;this.visible=false;this.showdragging=false;this.buttons=jpf.isIphone?"":"min|max|close";this.$focussable=jpf.KEYBOARD;this.state="normal";this.edit=false;var t=this;this.setTitle=function(A){this.setProperty("title",A);};this.setIcon=function(A){this.setProperty("icon",A);};this.close=function(){this.setProperty("state",this.state.split("|").pushUnique("closed").join("|"));};this.minimize=function(){this.setProperty("state",this.state.split("|").remove("maximized").remove("normal").pushUnique("minimized").join("|"));};this.maximize=function(){this.setProperty("state",this.state.split("|").remove("minimized").remove("normal").pushUnique("maximized").join("|"));};this.restore=function(){this.setProperty("state",this.state.split("|").remove("minimized").remove("maximized").pushUnique("normal").join("|"));};this.slideIn=function(E,C){if(!E){E="bottom";}var H=this.center;this.center=false;this.setProperty("visible",true);this.center=H;var B=0,K=0,G=(jpf.isIE?this.oExt.offsetParent.offsetWidth:window.innerWidth),D=(jpf.isIE?this.oExt.offsetParent.offsetHeight:window.innerHeight),J=Math.max(0,((G-this.oExt.offsetWidth)/2)),I=Math.max(0,((D-this.oExt.offsetHeight)/3)),A="top",F=10;switch(E){case"top":B=-(this.oExt.offsetHeight)-F;K=C?0:I;break;case"left":B=-(this.oExt.offsetWidth)-F;K=C?0:J;A="left";break;case"bottom":B=D+this.oExt.offsetHeight+F;K=C?D-this.oExt.offsetHeight:I;break;case"right":B=G+this.oExt.offsetLeft+F;K=C?G-this.oExt.offsetWidth:J;A="left";break;}jpf.tween.single(this.oExt,{steps:30,interval:10,from:B,to:K,type:A,anim:jpf.tween.EASEIN});};this.slideOut=function(A){if(!A){A="bottom";}var E=0,D=0,C="top",B=10;switch(A){case"top":E=this.oExt.offsetTop;D=-(this.oExt.offsetHeight)-B;break;case"left":E=this.oExt.offsetLeft;D=-(this.oExt.offsetWidth)-B;C="left";break;case"bottom":E=this.oExt.offsetTop;D=(jpf.isIE?this.oExt.offsetParent.offsetHeight:window.innerHeight)+this.oExt.offsetHeight+B;break;case"right":E=this.oExt.offsetLeft;D=(jpf.isIE?this.oExt.offsetParent.offsetWidth:window.innerWidth)+this.oExt.offsetLeft+B;C="left";break;}jpf.tween.single(this.oExt,{steps:30,interval:10,from:E,to:D,type:C,anim:jpf.tween.EASEOUT,onfinish:function(){t.setProperty("visible",false);}});};this.edit=function(A){this.setProperty("state",this.state.split("|").pushUnique("edit").join("|"));};this.closeedit=function(A){this.setProperty("state",this.state.split("|").remove("edit").join("|"));};this.bringToFront=function(){jpf.WinServer.setTop(this);};var n={min:["minimized","minimize","restore"],max:["maximized","maximize","restore"],edit:["edit","edit","closeedit"],close:["closed","close","show"]};this.$toggle=function(A){var B=n[A][0];this[n[A][this.state.indexOf(B)>-1?2:1]]();};this.syncAlignment=function(A){if(A.hidden==3){jpf.WinServer.setTop(this);}if(A.state>0){this.$setStyleClass(this.oExt,this.baseCSSname+"Min",[this.baseCSSname+"Edit",this.baseCSSname+"Max"]);}else{this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Min",this.baseCSSname+"Edit",this.baseCSSname+"Max"]);}};this.$booleanProperties.modal=true;this.$booleanProperties.center=true;this.$booleanProperties.transaction=true;this.$booleanProperties.hideselects=true;this.$booleanProperties.animate=true;this.$booleanProperties.showdragging=true;this.$supportedProperties.push("title","icon","modal","minwidth","minheight","hideselects","center","buttons","state","maxwidth","maxheight","animate","showdragging","transaction");this.$propHandlers.modal=function(B){if(B&&!this.oCover){var A=this.$getLayoutNode("cover");if(A){this.oCover=jpf.xmldb.htmlImport(A,this.pHtmlNode);if(!this.visible){this.oCover.style.display="none";}if(this.zindex){this.oCover.style.zIndex=this.zindex;}}}if(!B&&this.oCover){this.oCover.style.display="none";}};this.$propHandlers.center=function(A){this.oExt.style.position="absolute";};this.$propHandlers.title=function(A){this.oTitle.nodeValue=A;};this.$propHandlers.icon=function(A){if(!this.oIcon){return;}this.oIcon.style.display=A?"block":"none";jpf.skins.setIcon(this.oIcon,A,this.iconPath);};var h=[],y;this.$propHandlers.visible=function(F){if(jpf.isTrue(F)){this.$render();if(this.oCover){this.oCover.style.display="block";}this.state=this.state.split("|").remove("closed").join("|");this.oExt.style.display="block";if(jpf.layout&&this.oInt){jpf.layout.forceResize(this.oInt);}if(this.center){var E=this.oExt.offsetParent.tagName=="BODY"?[jpf.getWindowWidth(),jpf.getWindowHeight()]:[this.oExt.offsetParent.offsetWidth,this.oExt.offsetParent.offsetHeight];this.oExt.style.left=Math.max(0,((E[0]-this.oExt.offsetWidth)/2))+"px";this.oExt.style.top=Math.max(0,((E[1]-this.oExt.offsetHeight)/3))+"px";}if(!this.isRendered){this.addEventListener("afterrender",function(){this.dispatchEvent("display");this.removeEventListener("display",arguments.callee);});}else{this.dispatchEvent("display");}if(!jpf.canHaveHtmlOverSelects&&this.hideselects){h=[];var C=document.getElementsByTagName("select");for(var D=0;D<C.length;D++){var B=jpf.getStyle(C[D],"display");h.push([C[D],B]);C[D].style.display="none";}}if(y!=true&&this.$show){this.$show();}if(this.modal){this.bringToFront();if(!jpf.isParsing){this.focus(false,{mouse:true});}}if(jpf.isIE){var A=this.oExt.className;this.oExt.className="rnd"+Math.random();this.oExt.className=A;}}else{if(jpf.isFalse(F)){if(this.oCover){this.oCover.style.display="none";}this.oExt.style.display="none";if(!jpf.canHaveHtmlOverSelects&&this.hideselects){for(var D=0;D<h.length;D++){h[D][0].style.display=h[D][1];}}if(this.$hide){this.$hide();}if(this.hasFocus()){jpf.window.moveNext(true,this,true);}this.dispatchEvent("close");}}y=F;};this.$propHandlers.zindex=function(A){this.oExt.style.zIndex=A+1;if(this.oCover){this.oCover.style.zIndex=A;}};var q=null;var u=null;var s=null;var a={normal:1};this.$propHandlers.state=function(G,B){var C,A={},J=G.split("|");for(C=0;C<J.length;C++){A[J[C]]=true;}var E=[];if(!A.maximized&&!A.minimized){A.normal=true;}if(A.closed==this.visible){this.setProperty("visible",!A.closed);}if(A.normal!=a.normal||!A.normal&&(A.minimized!=a.minimized||A.maximized!=a.maximized)){if(q){this.oExt.style.height=(q-jpf.getHeightDiff(this.oExt))+"px";}if(u){if(this.animate&&!B){t.animstate=1;jpf.tween.multi(this.oExt,{steps:5,interval:10,tweens:[{type:"left",from:this.oExt.offsetLeft,to:u[0]},{type:"top",from:this.oExt.offsetTop,to:u[1]},{type:"width",from:this.oExt.offsetWidth,to:u[2]},{type:"height",from:this.oExt.offsetHeight,to:u[3]}],oneach:function(){if(jpf.hasSingleRszEvent){jpf.layout.forceResize(t.oInt);}},onfinish:function(){t.$propHandlers.state.call(t,G,true);}});return;}this.oExt.style.left=u[0]+"px";this.oExt.style.top=u[1]+"px";this.oExt.style.width=u[2]+"px";this.oExt.style.height=u[3]+"px";var H=(this.oExt.parentNode==document.body?this.oExt.offsetParent||document.documentElement:this.oExt.offsetParent);H.style.overflow=u[4];}if(this.aData&&this.aData.restore){this.aData.restore();}if(jpf.layout){jpf.layout.play(this.pHtmlNode);}if(s){this.oExt.style.zIndex=s[0];if(this.oCover){this.oCover.style.zIndex=s[1];}}q=u=s=null;if(A.normal){E.push("",this.baseCSSname+"Max",this.baseCSSname+"Min");}}if(A.minimized!=a.minimized){if(A.minimized){E.unshift(this.baseCSSname+"Min",this.baseCSSname+"Max",this.baseCSSname+"Edit");if(this.aData&&this.aData.minimize){this.aData.minimize(this.collapsedHeight);}if(!this.aData||!this.aData.minimize){q=this.oExt.offsetHeight;this.oExt.style.height=Math.max(0,this.collapsedHeight-jpf.getHeightDiff(this.oExt))+"px";}if(this.hasFocus()){jpf.window.moveNext(null,this,true);}}else{E.push(this.baseCSSname+"Min");setTimeout(function(){jpf.window.$focusLast(t);});}}if(A.maximized!=a.maximized){if(A.maximized){E.unshift(this.baseCSSname+"Max",this.baseCSSname+"Min",this.baseCSSname+"Edit");var H=(this.oExt.parentNode==document.body?this.oExt.offsetParent||document.documentElement:this.oExt.parentNode);u=[this.oExt.offsetLeft,this.oExt.offsetTop,this.oExt.offsetWidth-m,this.oExt.offsetHeight-z,H.style.overflow];H.style.overflow="hidden";t.animstate=0;var D=false,F=this.oExt;function I(){var K=!jpf.isIE&&H==document.documentElement?window.innerWidth:H.offsetWidth;var L=!jpf.isIE&&H==document.documentElement?window.innerHeight:H.offsetHeight;if(t.animate&&!D){t.animstate=1;D=true;jpf.tween.multi(F,{steps:5,interval:10,tweens:[{type:"left",from:F.offsetLeft,to:-1*w[3]},{type:"top",from:F.offsetTop,to:-1*w[0]},{type:"width",from:F.offsetWidth,to:(K-m+w[1]+w[3])},{type:"height",from:F.offsetHeight,to:(L-z+w[0]+w[2])}],oneach:function(){if(jpf.hasSingleRszEvent){jpf.layout.forceResize(t.oInt);}},onfinish:function(){t.animstate=0;}});}else{if(!t.animstate){F.style.left=(-1*w[3])+"px";F.style.top=(-1*w[0])+"px";F.style.width=(K-m+w[1]+w[3])+"px";F.style.height=(L-z+w[0]+w[2])+"px";}}}if(jpf.layout){jpf.layout.pause(this.pHtmlNode,I);}s=[this.oExt.style.zIndex||1,this.oCover&&this.oCover.style.zIndex||1];if(this.oCover){this.oCover.style.zIndex=jpf.WinServer.count+1;}this.oExt.style.zIndex=jpf.WinServer.count+2;}else{E.push(this.baseCSSname+"Max");}}if(A.edit!=a.edit){if(A.edit){E.unshift(this.baseCSSname+"Edit",this.baseCSSname+"Max",this.baseCSSname+"Min");if(this.btnedit){c.edit.innerHTML="close";}this.dispatchEvent("editstart");}else{if(this.dispatchEvent("editstop")===false){return false;}E.push(this.baseCSSname+"Edit");if(E.length==1){E.unshift("");}if(this.btnedit){c.edit.innerHTML="edit";}}}if(E.length){this.$setStyleClass(this.oExt,E.shift(),E);this.dispatchEvent("statechange",A);a=A;if(this.aData&&!A.maximized){this.purgeAlignment();}if(!this.animate&&jpf.hasSingleRszEvent&&jpf.layout){jpf.layout.forceResize(t.oInt);}}};var c={};this.$propHandlers.buttons=function(H){var F=H.split("|");var A=this.oButtons.childNodes;var E=new RegExp("("+H+")");var G={};var D=[];for(var C=0;C<A.length;C++){if(A[C].nodeType!=1||A[C].tagName!="DIV"){continue;}if(!A[C].className||!A[C].className.match(E)){A[C].style.display="none";this.$setStyleClass(A[C],"",["min","max","close","edit"]);D.push(A[C]);}else{G[RegExp.$1]=A[C];}}for(C=0;C<F.length;C++){if(G[F[C]]){this.oButtons.insertBefore(G[F[C]],this.oButtons.firstChild);continue;}var B=D.pop();if(!B){this.$getNewContext("button");B=this.$getLayoutNode("button");v(B);B=jpf.xmldb.htmlImport(B,this.oButtons);}this.$setStyleClass(B,F[C],["min","max","close","edit"]);B.onclick=new Function("jpf.lookup("+this.uniqueId+").$toggle('"+F[C]+"')");B.style.display="block";c[F[C]]=B;this.oButtons.insertBefore(B,this.oButtons.firstChild);}};this.addEventListener("keydown",function(C){var B=C.keyCode;var D=C.ctrlKey;var A=C.shiftKey;if(B>36&&B<41){if(t.hasFeature&&t.hasFeature(__ANCHORING__)){t.disableAnchoring();}}switch(B){case 27:if(this.buttons.indexOf("close")>-1&&!this.aData){this.close();}return;case 38:if(A&&this.resizable){this.setProperty("height",Math.max(this.minheight||0,this.oExt.offsetHeight-(D?50:10)));}else{if(this.draggable){this.setProperty("top",this.oExt.offsetTop-(D?50:10));}}break;case 37:if(A&&this.resizable){this.setProperty("width",Math.max(this.minwidth||0,this.oExt.offsetWidth-(D?50:10)));}else{if(this.draggable){this.setProperty("left",this.oExt.offsetLeft-(D?50:10));}}break;case 39:if(A&&this.resizable){this.setProperty("width",Math.min(this.maxwidth||10000,this.oExt.offsetWidth+(D?50:10)));}else{if(this.draggable){this.setProperty("left",this.oExt.offsetLeft+(D?50:10));}}break;case 40:if(A&&this.resizable){this.setProperty("height",Math.min(this.maxheight||10000,this.oExt.offsetHeight+(D?50:10)));}else{if(this.draggable){this.setProperty("top",this.oExt.offsetTop+(D?50:10));}}break;default:return;}if(jpf.hasSingleRszEvent){jpf.layout.forceResize(this.oInt);}},true);function v(A){A.setAttribute("onmousedown","jpf.setStyleClass(this, 'down');event.cancelBubble = true; jpf.findHost(this).oExt.onmousedown(event);document.onmousedown(event);");A.setAttribute("onmouseup","jpf.setStyleClass(this, '', ['down'])");A.setAttribute("onmouseover","jpf.setStyleClass(this, 'hover')");A.setAttribute("onmouseout","jpf.setStyleClass(this, '', ['hover', 'down'])");}var w,m,z;this.$draw=function(){this.popout=jpf.isTrue(this.$jml.getAttribute("popout"));if(this.popout){this.pHtmlNode=document.body;}this.oExt=this.$getExternal(null,null,function(F){var E=this.$getLayoutNode("main","buttons",F);if(!E||jpf.isIphone){return;}var B=(this.$jml.getAttribute("buttons")||"").split("|").length;for(var D,C=0;C<B;C++){this.$getNewContext("button");D=E.appendChild(this.$getLayoutNode("button"));v(D);}});this.oTitle=this.$getLayoutNode("main","title",this.oExt);this.oIcon=this.$getLayoutNode("main","icon",this.oExt);this.oDrag=this.$getLayoutNode("main","drag",this.oExt);this.oButtons=this.$getLayoutNode("main","buttons",this.oExt);this.oDrag.host=this;if(this.oIcon){this.oIcon.style.display="none";}this.oDrag.onmousedown=function(B){if(!B){B=event;}if(!t.isWidget&&(!t.aData||!t.dockable||t.aData.hidden==3)){jpf.WinServer.setTop(t);}if(a.maximized){return false;}if(t.aData&&t.dockable){if(a.normal){t.startDocking(B);}return false;}};this.oExt.onmousedown=function(){var B=jpf.window.focussed;if(B&&B.$focusParent!=t&&B.$focusParent.modal){return false;}if(!t.isWidget&&(!t.aData||!t.dockable||t.aData.hidden==3)){jpf.WinServer.setTop(t);}if(!a.normal){return false;}};this.oExt.onmousemove=function(){if(!a.normal){return false;}};var A=jpf.getDiff(this.oExt);m=A[0];z=A[1];w=jpf.getBox(jpf.getStyle(this.oExt,"borderWidth"));};this.$loadJml=function(A){jpf.WinServer.setTop(this);var B=this.$getLayoutNode("main","container",this.oExt);this.oInt=this.oInt?jpf.JmlParser.replaceNode(B,this.oInt):jpf.JmlParser.parseChildren(this.$jml,B,this,true);(this.oTitle.nodeType!=1?this.oTitle.parentNode:this.oTitle).ondblclick=function(C){if(t.state.indexOf("normal")==-1){t.restore();}else{if(t.buttons.indexOf("max")>-1){t.maximize();}else{if(t.buttons.indexOf("min")>-1){t.minimize();}}}};if(this.draggable===undefined){(this.$propHandlers.draggable||jpf.JmlElement.propHandlers.draggable).call(this,true);this.draggable=true;}if(this.modal===undefined&&this.oCover){this.$propHandlers.modal.call(this,true);this.modal=true;}if(!this.visible){this.oExt.style.display="none";if(this.oCover){this.oCover.style.display="none";}}else{if(this.modal){this.focus(false,{mouse:true});}}this.collapsedHeight=this.$getOption("Main","collapsed-height");if(this.minwidth===undefined){this.minwidth=this.$getOption("Main","min-width");}if(this.minheight===undefined){this.minheight=this.$getOption("Main","min-height");}if(this.maxwidth===undefined){this.maxwidth=this.$getOption("Main","max-width");}if(this.maxheight===undefined){this.maxheight=this.$getOption("Main","max-height");}if(this.center&&this.visible){this.visible=false;this.oExt.style.display="none";jpf.JmlParser.stateStack.push({node:this,name:"visible",value:"true"});}};this.$skinchange=function(){if(this.title){this.$propHandlers.title.call(this,this.title);}if(this.icon){this.$propHandlers.icon.call(this,this.icon);}};this.$destroy=function(B){if(this.oDrag){this.oDrag.host=null;this.oDrag.onmousedown=null;jpf.removeNode(this.oDrag);this.oDrag=null;}this.oTitle=this.oIcon=this.oCover=null;for(var A in c){c[A].onclick=null;}if(this.oExt&&!B){this.oExt.onmousedown=null;this.oExt.onmousemove=null;}};}).implement(jpf.DelayedRender,jpf.Presentation);jpf.actiontracker=function(m){jpf.makeClass(this);var h=this;var n=[];var c=[];var q=[];var a;this.realtime=true;this.undolength=0;this.redolength=0;this.tagName="actiontracker";if(m){this.parentNode=m;}this.implement(jpf.JmlDom);this.$booleanProperties={};this.$booleanProperties.realtime=true;this.$supportedProperties=["realtime","undolength","redolength","alias"];this.$handlePropSet=function(v,u,t){switch(v){case"undolength":this.undolength=n.length;break;case"redolength":this.redolength=c.length;break;default:this[v]=u;}};this.loadJml=function(u){this.$jml=u;var y,v,w,t=u.attributes;for(w=0;w<t.length;w++){v=t[w];if(v.nodeName.indexOf("on")==0){this.addEventListener(v.nodeName,new Function(v.nodeValue));}else{y=this.$booleanProperties[v.nodeName]?jpf.isTrue(v.nodeValue):v.nodeValue;this.setProperty(v.nodeName,y);}}};this.define=function(u,t){jpf.actiontracker.actions[u]=t;};this.getParent=function(){return this.parentNode&&this.parentNode.getActionTracker?this.parentNode.getActionTracker(true):(jpf.window.$at!=this?jpf.window.$at:null);};this.execute=function(t){if(this.dispatchEvent("beforechange",t)===false){return;}var u=new jpf.UndoData(t,this);if(t.action){jpf.actiontracker.actions[t.action](u,false,this);}u.id=n.push(u)-1;this.setProperty("undolength",n.length);this.$addToQueue(u,false);c.length=0;this.setProperty("redolength",c.length);return u;};this.$addActionGroup=function(t,v){var u=new jpf.UndoData("group",null,[jpf.copyArray(t,UndoData),jpf.copyArray(v,UndoData)]);n.push(u);this.setProperty("undolength",n.length);this.dispatchEvent("afterchange",{action:"group",done:t});};this.purge=function(u,t){if(true){if(q.length){q[0].undoObj.saveChange(q[0].undo,this);a=q[q.length-1];}}else{if(parent){this.reset();}}};this.reset=function(){n.length=c.length=0;this.setProperty("undolength",0);this.setProperty("redolength",0);this.dispatchEvent("afterchange",{action:"reset"});};this.undo=function(v,u,t){s.call(this,v,u,true,t);};this.redo=function(v,u,t){s.call(this,v,u,false,t);};function s(B,A,u,t){var v=u?n:c;var z=u?c:n;if(!v.length){return;}if(A){var y=v[B];if(!y){return;}v.length--;z.push(y);if(y.action){jpf.actiontracker.actions[y.action](y,u,this);}if(!t){this.$addToQueue(y,u);}this.setProperty("undolength",n.length);this.setProperty("redolength",c.length);return y;}if(B==-1){B=v.length;}if(!B){B=1;}var w=0;while(w<B&&v.length>0){if(!v[v.length-1]){v.length--;n=[];c=[];return false;}else{s.call(this,v.length-1,true,u);w++;}}this.dispatchEvent("afterchange",{action:u?"undo":"redo",rollback:t});}this.$receive=function(w,v,t,u,y){if(v==jpf.TIMEOUT&&t.tpModule.retryTimeout(t,v,this)===true){return true;}if(v!=jpf.SUCCESS){if(this.dispatchEvent("actionfail",jpf.extend(t,{state:v,message:"Could not sent Action RPC request for control "+this.name+"["+this.tagName+"] \n\n"+t.message,bubbles:true}))===false){return true;}if(typeof jpf.offline!="undefined"&&!jpf.offline.reloading){this.undo(u.id,t.userdata,true);}if(y){y(!t.userdata);}if(!t.userdata){q=[];throw new Error(jpf.formatErrorString(0,this,"Executing action","Error sending action to the server:\n"+(t.url?"Url:"+t.url+"\n\n":"")+t.message));return;}}else{this.dispatchEvent("actionsuccess",jpf.extend(t,{state:v,bubbles:true},t));u.processRsbQueue();if(y){y();}}this.$queueNext(u,y);};this.$addToQueue=function(v,t,y){if(q.length&&!v.state&&q[q.length-1].undoObj==v){q.length--;v.clearRsbQueue();return;}if(y){var w=q.shift();for(var u=0;u<v.length;u++){q.unshift({undoObj:v[u],undo:t});}if(w){q.unshift(w);}return;}var w={undoObj:v.preparse(t,this),undo:t};q.push(w)-1;if(q.length==1&&this.realtime){v.saveChange(t,this);}};this.$queueNext=function(u,v){if(q[0].undoObj!=u){throw new Error(jpf.formatErrorString(0,this,"Executing Next action in queue","The execution stack was corrupted. This is a fatal error. The application should be restarted. You will lose all your changes. Please contact the administrator."));}u.state=null;var t=q.shift();if(!q[0]||t==a){return;}q[0].undoObj.saveChange(q[0].undo,this,v);};};jpf.UndoData=function(m,c){this.tagName="UndoData";this.extra={};jpf.extend(this,m);if(c){this.at=c;}else{if(m&&m.tagName=="UndoData"){this.args=m.args.slice();this.rsbArgs=m.rsbArgs.slice();}else{this.selNode=this.selNode||(this.action=="removeNode"?this.args[0]:(this.jmlNode?this.jmlNode.selected:null));}}var h,a=this;this.processRsbQueue=function(){if(this.rsbModel){this.rsbModel.rsb.processQueue(this);}};this.clearRsbQueue=function(){this.rsbQueue=null;this.rsbModel=null;};this.saveChange=function(q,n,u){if(this.action=="group"){var t=this.args[1];n.$addToQueue(t,q,true);return n.$queueNext(this);}var s;if(this.xmlActionNode){s=this.xmlActionNode.getAttribute(q?"undo":"set");}if(!s){return n.$queueNext(this);}this.state=q?"restoring":"saving";h.preparse=false;jpf.saveData(s,null,h,function(y,w,v){return n.$receive(y,w,v,a,u);},{ignoreOffline:true});};this.preparse=function(q,n,s){var t;if(this.xmlActionNode){t=this.xmlActionNode.getAttribute(q?"undo":"set");}if(!t){return this;}h=jpf.extend({userdata:jpf.isTrue(this.xmlActionNode.getAttribute("ignore-fail")),multicall:s,preparse:true},this.extra);jpf.saveData(t,this.selNode||this.xmlNode,h);return this;};};jpf.actiontracker.actions={setTextNode:function(h,a){var c=h.args;if(!a){jpf.xmldb.setTextNode(c[0],c[1],c[2],h);}else{jpf.xmldb.setTextNode(c[0],h.extra.oldValue,c[2]);}},setAttribute:function(h,a){var c=h.args;if(!a){h.extra.name=c[1];h.extra.oldValue=c[0].getAttribute(c[1]);jpf.xmldb.setAttribute(c[0],c[1],c[2],c[3],h);}else{if(!h.extra.oldValue){jpf.xmldb.removeAttribute(c[0],c[1]);}else{jpf.xmldb.setAttribute(c[0],c[1],h.extra.oldValue,c[3]);}}},removeAttribute:function(h,a){var c=h.args;if(!a){h.extra.name=c[1];h.extra.oldValue=c[0].getAttribute(c[1]);jpf.xmldb.removeAttribute(c[0],c[1],c[2],h);}else{jpf.xmldb.setAttribute(c[0],c[1],h.extra.oldValue,c[2]);}},setAttributes:function(m,c){var n,h=m.args;if(!c){var a={};for(n in h[1]){a[n]=h[0].getAttribute(n);h[0].setAttribute(n,h[1][n]);}m.extra.oldValues=a;jpf.xmldb.applyChanges("attribute",h[0],m);}else{for(n in m.oldValues){if(!m.extra.oldValues[n]){h[0].removeAttribute(n);}else{h[0].setAttribute(n,m.extra.oldValues[n]);}}jpf.xmldb.applyChanges("attribute",h[0],m);}},replaceNode:function(h,a){var c=h.args;if(!a){jpf.xmldb.replaceNode(c[0],c[1],c[2],h);}else{jpf.xmldb.replaceNode(c[1],c[0],c[2],h);}},addChildNode:function(h,a){var c=h.args;if(!a){jpf.xmldb.addChildNode(c[0],c[1],c[2],c[3],h);}else{jpf.xmldb.removeNode(h.extra.addedNode);}},appendChild:function(h,a){var c=h.args;if(!a){jpf.xmldb.appendChild(c[0],c[1],c[2],c[3],c[4],h);}else{jpf.xmldb.removeNode(c[1]);}},moveNode:function(h,a){var c=h.args;if(!a){jpf.xmldb.moveNode(c[0],c[1],c[2],c[3],h);}else{jpf.xmldb.moveNode(h.extra.parent,c[1],h.extra.beforeNode,c[3]);}},removeNode:function(h,a){var c=h.args;if(!a){jpf.xmldb.removeNode(c[0],c[1],h);}else{jpf.xmldb.appendChild(h.extra.parent,h.extra.removedNode,h.extra.beforeNode);}},removeNodeList:function(h,a){if(a){var m=h.extra.removeList;for(var c=m.length-1;c>=0;c--){jpf.xmldb.appendChild(m[c].pNode,m[c].removedNode,m[c].beforeNode);}}else{jpf.xmldb.removeNodeList(h.args,h);}},setUndoObject:function(h,a){var c=h.args;h.xmlNode=c[0];},group:function(m,h,a){if(!m.stackDone){var c=m.args[0];m.stackDone=c;m.stackUndone=[];}a[h?"undo":"redo"](m.stackDone.length,false,m.stackDone,m.stackUndone);},setValueByXpath:function(m,a){var h=m.args;if(!a){if(m.extra.newNode){jpf.xmldb.appendChild(m.extra.parentNode,m.extra.newNode);}else{var c=[];jpf.xmldb.setNodeValue(h[0],h[1],true,{undoObj:m,xpath:h[2],newNodes:c,forceNew:h[3]});m.extra.newNode=c[0];}}else{if(m.extra.newNode){m.extra.parentNode=m.extra.newNode.parentNode;jpf.xmldb.removeNode(m.extra.newNode);}else{jpf.xmldb.setNodeValue(m.extra.appliedNode,m.extra.oldValue,true);}}},multicall:function(s,c,a){var t,n=s.args;var m=jpf.xmldb.delayUpdate;jpf.xmldb.delayUpdate=true;if(!c){for(var h=0;h<n.length;h++){if(!n[h].extra){n[h].extra={};}jpf.actiontracker.actions[n[h].func](n[h],false,a);}}else{for(var h=n.length-1;h>=0;h--){jpf.actiontracker.actions[n[h].func](n[h],true,a);}}jpf.xmldb.delayUpdate=m;},addRemoveNodes:function(m,a){var h=m.args;if(!a){for(var c=0;c<h[1].length;c++){jpf.xmldb.appendChild(h[0],h[1][c],null,null,null,m);}for(var c=0;c<h[2].length;c++){jpf.xmldb.removeNode(h[2][c],null,m);}}else{for(var c=0;c<h[2].length;c++){jpf.xmldb.appendChild(h[0],h[2][c]);}for(var c=0;c<h[1].length;c++){jpf.xmldb.removeNode(h[1][c]);}}}};jpf.convertIframe=function(c,a){var m=c.contentWindow;var h=m.document;var n;if(!jpf.isIE){jpf.importClass(jpf.runNonIe,true,m);}if(this.isSafari){this.importClass(jpf.runSafari,true,m);}if(this.isOpera){this.importClass(jpf.runOpera,true,m);}if(this.isGecko||!this.isIE&&!this.isSafari&&!this.isOpera){this.importClass(jpf.runGecko,true,m);}h.onkeydown=function(q){if(!q){q=m.event;}if(document.onkeydown){return document.onkeydown.call(document,q);}};h.onmousedown=function(t){if(!t){t=m.event;}if(!n){n=jpf.getAbsolutePosition(c);}var s={offsetX:t.offsetX,offsetY:t.offsetY,x:t.x+n[0],y:t.y+n[1],button:t.button,clientX:t.x+n[0],clientY:t.y+n[1],srcElement:c,target:c,targetElement:c};if(document.body.onmousedown){document.body.onmousedown(s);}if(document.onmousedown){document.onmousedown(s);}if(a&&!jpf.isIE){return false;}};if(a){h.onselectstart=function(q){return false;};}h.onmouseup=function(q){if(!q){q=m.event;}if(document.body.onmouseup){document.body.onmouseup(q);}if(document.onmouseup){document.onmouseup(q);}};h.onclick=function(q){if(!q){q=m.event;}if(document.body.onclick){document.body.onclick(q);}if(document.onclick){document.onclick(q);}};h.documentElement.oncontextmenu=function(t){if(!t){t=m.event;}if(!n){n=jpf.getAbsolutePosition(c);}var s={offsetX:t.offsetX,offsetY:t.offsetY,x:t.x+n[0],y:t.y+n[1],button:t.button,clientX:t.x+n[0],clientY:t.y+n[1],srcElement:t.srcElement,target:t.target,targetElement:t.targetElement};if(document.body.oncontextmenu){document.body.oncontextmenu(s);}if(document.oncontextmenu){document.oncontextmenu(s);}return false;};h.documentElement.onmouseover=function(q){n=jpf.getAbsolutePosition(c);};h.documentElement.onmousemove=function(t){if(!t){t=m.event;}if(!n){n=jpf.getAbsolutePosition(c);}var s={offsetX:t.offsetX,offsetY:t.offsetY,x:t.x+n[0],y:t.y+n[1],button:t.button,clientX:t.x+n[0],clientY:t.y+n[1],srcElement:t.srcElement,target:t.target,targetElement:t.targetElement};if(c.onmousemove){c.onmousemove(s);}if(document.body.onmousemove){document.body.onmousemove(s);}if(document.onmousemove){document.onmousemove(s);}return t.returnValue;};return h;};jpf.video=jpf.component(jpf.NODE_VISIBLE,function(){this.$booleanProperties.fullscreen=true;var a=null;this.$propHandlers.fullscreen=function(q){if(!this.player){return;}if(typeof this.player.setFullscreen=="function"){this.player.setFullscreen(q);}else{if(this.parentNode&&this.parentNode.tagName!="application"&&this.parentNode.setWidth){var m,n,s=this.parentNode.oExt;if(q){a={width:this.parentNode.getWidth(),height:this.parentNode.getHeight(),top:this.parentNode.getTop(),left:this.parentNode.getLeft(),position:jpf.getStyle(s,"position"),zIndex:jpf.getStyle(s,"z-index"),resizable:this.parentNode.resizable,nodes:[]};if(s!=document.body){while(s.parentNode!=document.body){var n=s.parentNode;m=a.nodes.push({pos:jpf.getSyle(n,"position")||"",top:jpf.getSyle(n,"top")||n.offsetTop+"px",left:jpf.getSyle(n,"left")||n.offsetLeft+"px",node:n})-1;n.style.position="absolute";n.style.top="0";n.style.left="0";}}this.parentNode.oExt.style.position="absolute";this.parentNode.oExt.style.zIndex="1000000";this.parentNode.setWidth("100%");this.parentNode.setHeight("100%");this.parentNode.setTop("0");this.parentNode.setLeft("0");if(this.parentNode.resizable){this.parentNode.setAttribute("resizable",false);}}else{if(a){var h;if(a.nodes.length){for(m=a.nodes.length-1;m>=0;m--){h=a.nodes[m];n=h.node;n.style.position=h.pos;n.style.top=h.top;n.style.left=h.left;}}this.parentNode.oExt.style.zIndex=a.zIndex;this.parentNode.oExt.style.position=a.position;this.parentNode.setWidth(a.width);this.parentNode.setHeight(a.height);this.parentNode.setTop(a.top);this.parentNode.setLeft(a.left);if(a.resizable){this.parentNode.setAttribute("resizable",true);}a=null;delete a;}}if(this.player.onAfterFullscreen){this.player.onAfterFullscreen(q);}var c=this;window.setTimeout(function(){jpf.layout.forceResize(c.parentNode.oExt);},100);}}};this.addEventListener("keydown",function(c){switch(c.keyCode){case 13&&(c.ctrlKey||c.altKey):case 70:this.setPropery("fullscreen",true);return false;break;case 80:this.setProperty("paused",!this.paused);return false;break;case 27:this.setProperty("fullscreen",false);return false;break;default:break;}},true);this.mainBind="src";this.loadMedia=function(){if(!arguments.length){if(this.player){this.setProperty("currentSrc",this.src);this.setProperty("networkState",jpf.Media.NETWORK_LOADING);this.player.load(this.src);}}else{dbLoad.apply(this,arguments);}return this;};this.seek=function(c){if(this.player&&c>=0&&c<=this.duration){this.player.seek(c);}};this.setVolume=function(c){if(this.player){this.player.setVolume(c);}};this.$guessType=function(m){var h=m.substr(m.lastIndexOf(".")+1);var c="";switch(h){case"mov":c="video/quicktime";break;case"flv":c="video/flv";break;case"asf":case"asx":case"avi":case"wmv":c="video/wmv";break;case"3gp":case"3gpp":case"3g2":case"3gpp2":case"divx":case"mp4":case"mpg4":case"mpg":case"mpeg":case"mpe":case"ogg":case"vob":c="video/vlc";break;}if(h=="mpg"||h=="mpeg"||h=="mpe"){c=jpf.isMac?"video/quicktime":"video/wmv";}if(!jpf.isWin&&!jpf.isMac&&c=="video/wmv"){c="video/vlc";}return c;};this.$getPlayerType=function(n){if(!n){return null;}var m=null;var h=n.splitSafe(",");if(h.length==1){h=h[0].splitSafe(";");}for(var c=0;c<h.length;c++){n=h[c];if(n.indexOf("flv")>-1){m="TypeFlv";}else{if(n.indexOf("quicktime")>-1){m="TypeQT";}else{if(n.indexOf("wmv")>-1){m="TypeWmp";}else{if(n.indexOf("silverlight")>-1){m="TypeSilverlight";}else{if(n.indexOf("vlc")>-1){m="TypeVlc";}}}}}if(m=="TypeWmp"){if(!jpf.isIE&&typeof jpf.video.TypeVlc!="undefined"&&jpf.video.TypeVlc.isSupported()){m="TypeVlc";}else{if(jpf.isMac){m="TypeQT";}}}if(m&&jpf.video[m]&&jpf.video[m].isSupported()){this.$lastMimeType=c;return m;}}this.$lastMimeType=-1;return null;};this.$isSupported=function(c){c=c||this.playerType;return(jpf.video[c]&&jpf.video[c].isSupported());};this.$initPlayer=function(){this.player=new jpf.video[this.playerType](this,this.oExt,{src:this.src.splitSafe(",")[this.$lastMimeType]||this.src,width:this.width,height:this.height,autoLoad:true,autoPlay:this.autoplay,showControls:this.controls,volume:this.volume,mimeType:this.type});return this;};this.$initHook=function(){this.loadMedia();};this.$cuePointHook=function(){};this.$playheadUpdateHook=function(){};this.$errorHook=function(c){jpf.console.error(c.error);};this.$progressHook=function(h){this.setProperty("bufferedBytes",{start:0,end:h.bytesLoaded});this.setProperty("totalBytes",h.totalBytes);var c=Math.abs(h.bytesLoaded-h.totalBytes);if(c<=20){this.setProperty("readyState",jpf.Media.HAVE_ENOUGH_DATA);}};this.$stateChangeHook=function(c){if(c.state=="loading"){this.setProperty("networkState",this.networkState=jpf.Media.NETWORK_LOADING);}else{if(c.state=="connectionError"){this.$propHandlers.readyState.call(this,this.networkState=jpf.Media.HAVE_NOTHING);}else{if(c.state=="playing"||c.state=="paused"){if(c.state=="playing"){this.$readyHook({type:"ready"});}this.paused=Boolean(c.state=="paused");this.setProperty("paused",this.paused);}else{if(c.state=="seeking"){this.seeking=true;this.setProperty("seeking",true);}}}}};this.$changeHook=function(c){if(typeof c.volume!="undefined"){this.volume=c.volume;if(!this.muted){this.setProperty("volume",this.volume);}}else{this.duration=this.player.getTotalTime();this.position=c.playheadTime/this.duration;if(isNaN(this.position)){return;}this.setProperty("position",this.position);this.currentTime=c.playheadTime;this.setProperty("currentTime",this.currentTime);}};this.$completeHook=function(c){this.paused=true;this.setProperty("paused",true);};this.$readyHook=function(c){this.setProperty("networkState",jpf.Media.NETWORK_LOADED);this.setProperty("readyState",jpf.Media.HAVE_FUTURE_DATA);this.setProperty("duration",this.player.getTotalTime());this.seeking=false;this.seekable=true;this.setProperty("seeking",false);return this;};this.$metadataHook=function(c){this.oVideo.setProperty("readyState",jpf.Media.HAVE_METADATA);};this.stopListening=function(){if(!this.player){return this;}return this;};this.$draw=function(){this.oExt=this.$getExternal();};this.$loadJml=function(c){this.oInt=this.$getLayoutNode("main","container",this.oExt);this.width=parseInt(this.width)||null;this.height=parseInt(this.height)||null;if(this.setSource()){this.$propHandlers.type.call(this,this.type);}else{jpf.JmlParser.parseChildren(this.$jml,null,this);}};this.$destroy=function(c){if(this.player&&this.player.$destroy){this.player.$destroy();}delete this.player;this.player=null;if(c){this.oExt.innerHTML="";}};}).implement(jpf.DataBinding,jpf.Presentation,jpf.Media);jpf.video.TypeInterface={properties:["src","width","height","volume","showControls","autoPlay","totalTime","mimeType"],setOptions:function(a){if(a==null){return this;}var h=this.properties;for(var c=0;c<h.length;c++){var m=h[c];if(a[m]==null){continue;}this[m]=a[m];}return this;},getElement:function(c){var a;if(typeof c=="object"){return c;}if(jpf.isIE){return window[c];}else{a=document[c]?document[c]:document.getElementById(c);if(!a){a=jpf.lookup(c);}return a;}}};jpf.model=function(data,caching){jpf.register(this,"model",jpf.NODE_HIDDEN);this.data=data;this.caching=caching;this.cache={};var _self=this;if(!jpf.globalModel){jpf.globalModel=this;}this.saveOriginal=true;this.$supportedProperties=["submission","load"];this.$handlePropSet=function(prop,value,force){if(prop=="submission"){defSubmission=value;}};this.loadInJmlNode=function(jmlNode,xpath){if(this.data&&xpath){if(!jpf.supportNamespaces&&(this.data.prefix||this.data.scopeName)){(this.data.nodeType==9?this.data:this.data.ownerDocument).setProperty("SelectionNamespaces","xmlns:"+(this.data.prefix||this.data.scopeName)+"='"+this.data.namespaceURI+"'");}var xmlNode=this.data.selectSingleNode(xpath);if(!xmlNode){jmlNode.$listenRoot=jpf.xmldb.addNodeListener(this.data,jmlNode);}}else{xmlNode=this.data||null;}jmlNode.load(xmlNode);};var jmlNodes={};this.register=function(jmlNode,xpath){if(!jmlNode){return this;}jmlNodes[jmlNode.uniqueId]=[jmlNode,xpath];jmlNode.$model=this;if(this.connect){if(this.connect.type){this.connect.node.connect(jmlNode,null,this.connect.select,this.connect.type);}else{this.connect.node.connect(jmlNode,true,this.connect.select);}}else{if(this.data){this.loadInJmlNode(jmlNode,xpath);}}return this;};this.$register=function(jmlNode,xpath){jmlNodes[jmlNode.uniqueId][1]=xpath;};this.unregister=function(jmlNode){if(jmlNode.dataParent){jmlNode.dataParent.parent.disconnect(jmlNode);}delete jmlNodes[jmlNode.uniqueId];};this.getXpathByJmlNode=function(jmlNode){var n=jmlNodes[jmlNode.uniqueId];if(!n){return false;}return n[1];};this.toString=function(){var xml=jpf.xmldb.clearConnections(this.data.cloneNode(true));return this.data?jpf.formatXml(xml.xml||xml.serialize()):"Model has no data.";};this.getXml=function(){return this.data?jpf.xmldb.clearConnections(this.data.cloneNode(true)):false;};this.setQueryValue=function(xpath,value){var node=jpf.xmldb.createNodeFromXpath(this.data,xpath);if(!node){return null;}jpf.xmldb.setTextNode(node,value);return node;};this.queryValue=function(xpath){return jpf.getXmlValue(this.data,xpath);};this.queryValues=function(xpath){return jpf.getXmlValue(this.data,xpath);};this.queryNode=function(xpath){return this.data&&this.data.selectSingleNode(xpath);};this.queryNodes=function(xpath){return this.data.selectNodes(xpath);};this.appendXml=function(xmlNode){if(typeof xmlNode=="string"){xmlNode=jpf.getXml(xmlNode);}xmlNode=!model.nodeType?model.getXml():jpf.xmldb.copyNode(xmlNode);if(!xmlNode){return;}jpf.xmldb.appendChild(this.data,xmlNode);};this.clear=function(){this.load(null);doc=null;};this.reset=function(){this.load(this.copy);};this.savePoint=function(){this.copy=jpf.xmldb.copyNode(this.data);};this.reloadJmlNode=function(uniqueId){if(!this.data){return;}var xmlNode=jmlNodes[uniqueId][1]?this.data.selectSingleNode(jmlNodes[uniqueId][1]):this.data;jmlNodes[uniqueId][0].load(xmlNode);};var bindValidation=[],defSubmission,submissions={},loadProcInstr,loadProcOptions;this.loadJml=function(x,parentNode){this.name=x.getAttribute("id");this.$jml=x;this.parentNode=parentNode;this.implement(jpf.JmlDom);var attr=x.attributes;for(var i=0,l=attr.length;i<l;i++){if(attr[i].nodeName.indexOf("on")==0){this.addEventListener(attr[i].nodeName,new Function(attr[i].nodeValue));}}if(x.getAttribute("save-original")=="true"){this.saveOriginal=true;}var oSub;if(!defSubmission){defSubmission=x.getAttribute("submission");}this.submitType=x.getAttribute("submittype");this.useComponents=x.getAttribute("useComponents");this.session=x.getAttribute("session");var instanceNode;loadProcInstr=jpf.parseExpression(x.getAttribute("load")||x.getAttribute("get"));if(!loadProcInstr){var prefix=jpf.findPrefix(x,jpf.ns.jml);if(!jpf.supportNamespaces){if(prefix){(x.nodeType==9?x:x.ownerDocument).setProperty("SelectionNamespaces","xmlns:"+prefix+"='"+jpf.ns.jml+"'");}}if(prefix){prefix+=":";}var loadNode=x.selectSingleNode(prefix+"load");if(loadNode){loadProcInstr=loadNode.getAttribute("get");}}if(!oSub&&!loadProcInstr){var xmlNode=instanceNode||x;if(xmlNode.childNodes.length&&jpf.getNode(xmlNode,[0])){this.load((xmlNode.xml||xmlNode.serialize()).replace(new RegExp("^<"+xmlNode.tagName+"[^>]*>"),"").replace(new RegExp("</s*"+xmlNode.tagName+"[^>]*>$"),"").replace(/xmlns=\"[^"]*\"/g,""));}}if(oSub&&!this.data&&!instanceNode){this.load("<data />");}if(!jpf.isFalse(x.getAttribute("init"))){this.init();}if(x.getAttribute("remote")){this.rsb=jpf.nameserver.get("remote",x.getAttribute("remote"));this.rsb.models.push(this);}return this;};this.setConnection=function(jmlNode,type,select){if(!this.connect){this.connect={};}var oldNode=this.connect.node;this.connect.type=type;this.connect.node=jmlNode;this.connect.select=select;for(var uniqueId in jmlNodes){if(oldNode){oldNode.disconnect(jmlNodes[uniqueId][0]);}this.register(jmlNodes[uniqueId][0]);}};this.init=function(callback){if(this.session){this.loadFrom(this.session,null,{isSession:true});}else{if(loadProcInstr){this.loadFrom(loadProcInstr,null,{callback:callback});}}};this.loadFrom=function(instruction,xmlContext,options,callback){var data=instruction.split(":");var instrType=data.shift();if(!options||!options.isSession){loadProcInstr=instruction;loadProcOptions=[instruction,xmlContext,options,callback];}if(!callback&&options){callback=options.callback;}if(instrType.substr(0,1)=="#"){instrType=instrType.substr(1);try{eval(instrType).test;}catch(e){throw new Error(jpf.formatErrorString(1031,null,"Model Creation","Could not find object reference to connect databinding: '"+instrType+"'",dataNode));}this.setConnection(eval(instrType),data[0]||"select",data[1]);return this;}this.dispatchEvent("beforeretrieve");jpf.getData(instruction,xmlContext,options,function(data,state,extra){_self.dispatchEvent("afterretrieve");if(state!=jpf.SUCCESS){var oError;oError=new Error(jpf.formatErrorString(1032,_self,"Inserting xml data","Could not load data Instruction:"+instruction+"\nUrl: "+extra.url+"\nInfo: "+extra.message+"\n\n"+data));if(callback&&callback.apply(this,arguments)===true){return true;}if(extra.tpModule.retryTimeout(extra,state,_self,oError)===true){return true;}throw oError;}if(options&&options.isSession&&!data){if(loadProcInstr){return _self.loadFrom(loadProcInstr);}}else{if(options&&options.cancel){return;}_self.load(data);_self.dispatchEvent("receive",{data:data});if(callback){callback.apply(this,arguments);}}});return this;};this.reload=function(){if(!this.data){return;}if(loadProcOptions){this.loadFrom.apply(this,loadProcOptions);}else{if(loadProcInstr){this.loadFrom(loadProcInstr);}}};var doc;this.load=function(xmlNode,nocopy){if(this.dispatchEvent("beforeload",{xmlNode:xmlNode})===false){return false;}if(typeof xmlNode=="string"){xmlNode=jpf.getXmlDom(xmlNode).documentElement;}doc=xmlNode?xmlNode.ownerDocument:null;if(xmlNode){jpf.xmldb.nodeConnect(jpf.xmldb.getXmlDocId(xmlNode,this),xmlNode,null,this);if(!nocopy&&this.saveOriginal){this.copy=jpf.xmldb.copyNode(xmlNode);}}this.data=xmlNode;var uniqueId;for(uniqueId in jmlNodes){if(!jmlNodes[uniqueId]||!jmlNodes[uniqueId][0]){continue;}this.loadInJmlNode(jmlNodes[uniqueId][0],jmlNodes[uniqueId][1]);}this.dispatchEvent("afterload",{xmlNode:xmlNode});return this;};this.insertFrom=function(instruction,xmlContext,options,callback){if(!instruction){return false;}this.dispatchEvent("beforeretrieve");jpf.getData(instruction,xmlContext,options,function(data,state,extra){_self.dispatchEvent("afterretrieve");if(state!=jpf.SUCCESS){var oError;if(extra.tpModule.retryTimeout(extra,state,options.jmlNode||_self,oError)===true){return true;}throw oError;}if(typeof options.insertPoint=="string"){insertPoint=_self.data.selectSingleNode(options.insertPoint);}(options.jmlNode||_self).insert(data,options.insertPoint,jpf.extend({clearContents:jpf.isTrue(extra.userdata[1])},options));if(callback){callback.call(this,extra.data);}});};this.insert=function(XMLRoot,parentXMLNode,options,jmlNode){if(typeof XMLRoot!="object"){XMLRoot=jpf.getXmlDom(XMLRoot).documentElement;}if(!parentXMLNode){parentXMLNode=this.data;}var newNode=jpf.xmldb.integrate(XMLRoot,parentXMLNode,jpf.extend({copyAttributes:true},options));jpf.xmldb.applyChanges("insert",parentXMLNode);return XMLRoot;};this.getJsonObject=function(){var data={};for(var p in this.elements){var name=this.elements[p].$jml.getAttribute("name")||this.elements[p].name;if(name){data[name]=this.elements[p].getValue();}}return data;};this.getCgiString=function(){var uniqueId,k,sel,oJmlNode,name,value,str=[];for(uniqueId in jmlNodes){oJmlNode=jmlNodes[uniqueId][0];if(oJmlNode.disabled||!oJmlNode.change&&!oJmlNode.hasFeature(__MULTISELECT__)){continue;}if(oJmlNode.tagName=="MultiBinding"){oJmlNode=oJmlNode.getHost();}if(oJmlNode.multiselect){sel=oJmlNode.getSelection();for(k=0;k<sel.length;k++){name=oJmlNode.$jml.getAttribute("name");if(!name&&oJmlNode.$jml.getAttribute("ref")){name=oJmlNode.$jml.getAttribute("ref").replace(/[\/\]\[@]/g,"_");}if(!name){name=sel[k].tagName;}if(!name.match(/\]$/)){name+="[]";}value=oJmlNode.applyRuleSetOnNode("value",sel[k])||oJmlNode.applyRuleSetOnNode("caption",sel[k]);if(value){str.push(name+"="+encodeURIComponent(value));}}}else{name=oJmlNode.$jml.getAttribute("name")||oJmlNode.$jml.getAttribute("id");if(!name&&oJmlNode.$jml.getAttribute("ref")){name=oJmlNode.$jml.getAttribute("ref").replace(/[\/\]\[@]/g,"_");}if(!name&&oJmlNode.xmlRoot){name=oJmlNode.xmlRoot.tagName;}if(!name){continue;}value=oJmlNode.getValue();if(value){str.push(name+"="+encodeURIComponent(value));}}}return str.join("&");};this.submit=function(instruction,xmlNode,type,useComponents,xSelectSubTree){if(!instruction&&!defSubmission){return false;}if(!xmlNode){xmlNode=this.data;}if(!instruction&&typeof defSubmission=="string"){instruction=defSubmission;}var sub;if(submissions[instruction]||!instruction&&defSubmission){sub=submissions[instruction]||defSubmission;useComponents=false;type=sub.getAttribute("method").match(/^(?:urlencoded-post|get)$/)?"native":"xml";xSelectSubTree=sub.getAttribute("ref")||"/";instruction=(sub.getAttribute("method").match(/post/)?"url.post:":"url:")+sub.getAttribute("action");var file=sub.getAttribute("action");}else{if(instruction){if(!type){type=this.submitType||"native";}if(!useComponents){useComponents=this.useComponents;}}else{}}if(this.dispatchEvent("beforesubmit",{instruction:instruction})===false){return false;}var model=this;function cbFunc(data,state,extra){if((state==jpf.TIMEOUT||(_self.retryOnError&&state==jpf.ERROR))&&extra.retries<jpf.maxHttpRetries){return extra.tpModule.retry(extra.id);}else{if(state!=jpf.SUCCESS){model.dispatchEvent("submiterror",extra);}else{model.dispatchEvent("submitsuccess",jpf.extend({data:data},extra));}}}if(type=="array"||type=="xml"){var data=type=="array"?this.getJsonObject():jpf.xmldb.serializeNode(xmlNode);jpf.saveData(instruction,xmlNode,{args:[data]},cbFunc);}else{var data=useComponents?this.getCgiString():jpf.xmldb.convertXml(jpf.xmldb.copyNode(xmlNode),type!="native"?type:"cgivars");if(instruction.match(/^rpc\:/)){rpc=rpc.split(".");var oRpc=self[rpc[0]];oRpc.callWithString(rpc[1],data,cbFunc);}else{if(instruction.match(/^url/)){instruction+=(instruction.match(/\?/)?"&":"?")+data;}jpf.saveData(instruction,xmlNode,null,cbFunc);}}this.dispatchEvent("aftersubmit");};this.$destroy=function(){if(this.session&&this.data){jpf.saveData(this.session,this.getXml());}};};jpf.thumbnail=jpf.select=jpf.select1=jpf.list=jpf.component(jpf.NODE_VISIBLE,function(){var a=this;this.$supportedProperties.push("appearance","mode","more");this.$propHandlers.appearance=function(h){};this.mode="normal";this.$propHandlers.mode=function(h){this.mode=h||"normal";if("check|radio".indexOf(this.mode)>-1){this.allowdeselect=false;this.addEventListener("afterrename",c);if(this.mode=="check"){this.autoselect=false;this.ctrlselect=true;}else{if(this.mode=="radio"){this.multiselect=false;}}}else{this.ctrlselect=false;this.removeEventListener("afterrename",c);}};function c(){var h=this.$getMultiBind();if(!h){return;}h.$updateSelection();}this.addEventListener("keydown",this.$keyHandler,true);this.$draw=function(){this.appearance=this.$jml.getAttribute("appearance")||"compact";var h=this.$jml.getAttribute("mode");if(this.tagName=="select"&&(this.appearance=="full"||this.appearance=="minimal")||h=="check"){this.$jml.setAttribute("mode","check");if(!this.$jml.getAttribute("skin")){this.$loadSkin("default:checklist");}}else{if(this.tagName=="select1"&&this.appearance=="full"||h=="radio"){this.$jml.setAttribute("mode","radio");if(!this.$jml.getAttribute("skin")){this.$loadSkin("default:radiolist");}}else{if(this.tagName=="select1"&&this.appearance=="compact"){this.multiselect=false;}}}this.oExt=this.$getExternal();this.oInt=this.$getLayoutNode("main","container",this.oExt);if(jpf.hasCssUpdateScrollbarBug&&!this.mode){this.$fixScrollBug();}this.oExt.onclick=function(m){a.dispatchEvent("click",{htmlEvent:m||event});};this.listtype=parseInt(this.$getOption("main","type"))||1;this.behaviour=parseInt(this.$getOption("main","behaviour"))||1;};this.$loadJml=function(h){if(this.$jml.childNodes.length){this.$loadInlineData(this.$jml);}};this.$destroy=function(){this.oExt.onclick=null;jpf.removeNode(this.oDrag);this.oDrag=null;};}).implement(jpf.BaseList);jpf.errorbox=jpf.component(jpf.NODE_VISIBLE,function(){var a=this;this.$positioning="basic";this.display=function(n){this.host=n;var h=n.oExt;document.body.appendChild(this.oExt);var s=jpf.getAbsolutePosition(h,document.body);if(document!=h.ownerDocument){var m=jpf.getAbsolutePosition(h.ownerDocument.parentWindow.frameElement,document.body);s[0]+=m[0];s[1]+=m[1];}var c=(s[0]+parseFloat(n.$getOption("main","erroffsetx")||0));var q=(s[1]+parseFloat(n.$getOption("main","erroffsety")||0));this.show();jpf.popup.show(this.uniqueId,{x:c,y:q,animate:false,ref:this.oExt.offsetParent});this.$setStyleClass(this.oExt,c+this.oExt.offsetWidth>this.oExt.offsetParent.offsetWidth?"rightbox":"leftbox",["leftbox","rightbox"]);};this.setMessage=function(c){if(c&&c.indexOf(";")>-1){c=c.split(";");c="<strong>"+c[0]+"</strong>"+c[1];}this.oInt.innerHTML=c||"";};this.$draw=function(){this.oExt=this.$getExternal();this.oInt=this.$getLayoutNode("main","container",this.oExt);this.oClose=this.$getLayoutNode("main","close",this.oExt);if(this.oClose){this.oClose.onclick=function(){a.hide();if(a.host){a.host.focus(null,{mouse:true});}};}this.oExt.onmousedown=function(c){(c||event).cancelBubble=true;};this.hide();jpf.popup.setContent(this.uniqueId,this.oExt,"",null,null);};this.$loadJml=function(c){jpf.JmlParser.parseChildren(this.$jml,this.oInt,this);};this.$destroy=function(){if(this.oClose){this.oClose.onclick=null;}this.oExt.onmousedown=null;jpf.popup.removeContent(this.uniqueId);};}).implement(jpf.Presentation);jpf.jslt=jpf.component(jpf.NODE_VISIBLE,function(){this.$hasStateMessages=true;this.mainBind="contents";this.focussable=false;this.parse=function(c){this.setProperty("value",c);};this.$focus=function(){if(!this.oExt){return;}jpf.setStyleClass(this.oExt,this.baseCSSname+"Focus");};this.$blur=function(){if(!this.oExt){return;}jpf.setStyleClass(this.oExt,"",[this.baseCSSname+"Focus"]);};this.getValue=function(){return this.value;};this.$clear=function(h,c){this.setProperty("value","");};var a;this.$setClearMessage=this.$updateClearMessage=function(c){jpf.setStyleClass(this.oExt,this.baseCSSname+"Empty");if(c){this.oInt.innerHTML=c;a=this.oInt.innerHTML;}};this.$removeClearMessage=function(){jpf.setStyleClass(this.oExt,"",[this.baseCSSname+"Empty"]);if(this.oInt.innerHTML==a){this.oInt.innerHTML="";}};this.$booleanProperties.selectable=true;this.$supportedProperties.push("value");this.$propHandlers.value=function(c){if(c){this.$removeClearMessage();}if(this.createJml){if(typeof code=="string"){code=jpf.xmldb.getXml(code);}jpf.JmlParser.parseChildren(c,this.oInt,this);if(jpf.JmlParser.inited){jpf.JmlParser.parseLastPass();}}else{this.oInt.innerHTML=c;}};this.$propHandlers.selectable=function(c){this.oExt.onselectstart=c?function(){event.cancelBubble=true;}:null;};this.$draw=function(){this.oInt=this.oExt=jpf.isParsing&&jpf.xmldb.isOnlyChild(this.$jml)?this.pHtmlNode:this.pHtmlNode.appendChild(document.createElement("div"));this.oExt.host=this;if(this.$jml.getAttribute("class")){this.oExt.className=this.$jml.getAttribute("class");}};this.$loadJml=function(h){this.createJml=jpf.isTrue(h.getAttribute("jml"));var n,q,c=h.attributes;for(q=0;q<c.length;q++){n=c[q];if(n.nodeName.indexOf("on")==0){this.addEventListener(n.nodeName,new Function(n.nodeValue));}}if(h.firstChild){var s=h.getAttribute("ref")||".";h.removeAttribute("ref");var m="<smartbinding><bindings><value select='"+s+"'><![CDATA["+h.firstChild.nodeValue+"]]></value></bindings></smartbinding>";jpf.JmlParser.addToSbStack(this.uniqueId,new jpf.smartbinding(null,jpf.xmldb.getXml(m)));}};}).implement(jpf.DataBinding);jpf.splitter=function(q){jpf.register(this,"splitter",jpf.NODE_VISIBLE);this.pHtmlNode=q||document.body;this.pHtmlDoc=this.pHtmlNode.ownerDocument;var n=this;this.$focussable=true;this.implement(jpf.Presentation);this.update=function(){var N=(this.type=="vertical")?{fsize:"fwidth",size:"width",offsetPos:"offsetLeft",offsetSize:"offsetWidth",pos:"left"}:{fsize:"fheight",size:"height",offsetPos:"offsetTop",offsetSize:"offsetHeight",pos:"top"};var s=this.refNode;var B=this.refHtml;var D=jpf.layout.vars;var H=this.oItem;var M=false;var L=B?B[N.offsetPos]:D[N.pos+"_"+H.id];var A=B?B[N.offsetSize]:D[N.size+"_"+H.id];var w=H.parent.children;for(var C=0,J=0;J<w.length;J++){if(!w[J][N.fsize]){C++;}}if(!H[N.fsize]&&C>1){for(var u=0,t=0,J=H.stackId+1;J<w.length;J++){if(!w[J][N.fsize]){u+=w[J].weight||1;t+=(w[J].node?w[J].oHtml[N.offsetSize]:D[N.size+"_"+w[J].id]);}}var E=this.oExt[N.offsetPos]-L-A;var K=(t-E)/u;for(var J=0;J<H.stackId;J++){if(!w[J][N.fsize]){w[J].original.weight=(w[J].node?w[J].oHtml[N.offsetSize]:D[N.size+"_"+w[J].id])/K;}}H.original.weight=(A+E)/K;M=true;}else{var F=H[N.fsize]?H[N.fsize].match(/^\d+$/):false;var P=H[N.fsize]?H[N.fsize].match(/^([\d\.]+)\%$/):false;if(F||P||!H[N.fsize]){var E=this.oExt[N.offsetPos]-L-A;var I=this.oExt[N.offsetPos]-L;for(var Q=0,G=0,J=H.stackId+1;J<w.length;J++){if(!w[J][N.fsize]){Q+=w[J].weight||1;G+=(w[J].node?w[J].oHtml[N.offsetSize]:D[N.size+"_"+w[J].id]);}}if(Q>0){var y=((G-E)/Q)/(G/Q);for(var J=H.stackId+1;J<w.length;J++){w[J].original.weight=y*(w[J].weight||1);}}else{for(var J=H.stackId+1;J<w.length;J++){if(w[J][N.fsize].match(/^\d+$/)){var O=(w[J].node?w[J].oHtml[N.offsetSize]:D[N.size+"_"+w[J].id])-E;w[J].original[N.fsize]=""+Math.max(0,O,w[J].minheight||0);if(w[J][N.fsize]-O!=0){E=w[J][N.fsize]-O;}else{break;}}else{if(w[J][N.fsize].match(/^([\d\.]+)\%$/)){var O=(w[J].node?w[J].oHtml[N.offsetSize]:D[N.size+"_"+w[J].id])-E;w[J].original[N.fsize]=Math.max(0,((parseFloat(RegExp.$1)/(w[J].node?w[J].oHtml[N.offsetSize]:D[N.size+"_"+w[J].id]))*O))+"%";break;}}}}if(H.original[N.fsize]){H.original[N.fsize]=P?((parseFloat(P[1])/A)*I)+"%":""+I;}M=true;}}if(M){jpf.layout.compile(this.oExt.parentNode);jpf.layout.activateRules(this.oExt.parentNode);if(jpf.hasSingleRszEvent){jpf.layout.forceResize();}return;}jpf.layout.forceResize(this.oExt.parentNode);};this.onmouseup=function(){n.$setStyleClass(n.oExt,"",["moving"]);jpf.plane.hide();n.update();n.$setStyleClass(document.body,"",["n-resize","w-resize"]);jpf.dragmode.clear();};this.onmousemove=function(s){if(!s){s=event;}if(n.type=="vertical"){if(s.clientX>=0){var t=jpf.getAbsolutePosition(n.oExt.offsetParent);n.oExt.style.left=(Math.min(n.max,Math.max(n.min,(s.clientX-t[0])-n.tx)))+"px";}}else{if(s.clientY>=0){var t=jpf.getAbsolutePosition(n.oExt.offsetParent);n.oExt.style.top=(Math.min(n.max,Math.max(n.min,(s.clientY-t[1])-n.ty)))+"px";}}s.returnValue=false;s.cancelBubble=true;};var a,m,c,h;this.init=function(E,A,F){this.min=0;this.max=1000000;this.size=parseInt(E)||3;this.refNode=null;this.refHtml=null;var t;if(A){if(typeof A!="object"){A=jpf.lookup(A);}this.refNode=A;this.refHtml=this.refNode.oExt;t=this.refHtml.parentNode;F=A.aData.calcData;}else{t=F.pHtml;}this.oItem=F;if(t&&t!=this.oExt.parentNode){t.appendChild(this.oExt);}var D=jpf.getDiff(this.oExt);c=D[0];h=D[1];m=[];this.type=F.parent.vbox?"horizontal":"vertical";var J=jpf.layout.get(this.oExt.parentNode).layout;var K="splitter"+this.uniqueId;J.addRule("var "+K+" = jpf.lookup("+this.uniqueId+").oExt");var s=[K+".style.left = "];var v=[K+".style.top = "];var w=[K+".style.width = -"+h+" + "];var C=[K+".style.height = -"+c+" + "];var B=F.parent.children[F.stackId+1];if(this.type=="horizontal"){w.push("Math.max(");if(F.node){s.push(F.id+".offsetLeft");v.push(F.id+".offsetTop + "+F.id+".offsetHeight");w.push(F.id+".offsetWidth");}else{s.push("v.left_"+F.id);v.push("v.top_"+F.id+" + v.height_"+F.id);w.push("v.width_"+F.id);}w.push(",",B?(B.node?B.id+".offsetWidth":"v.width_"+B.id):0,")");J.addRule(w.join(""));this.oExt.style.height=(F.splitter-h)+"px";}else{C.push("Math.max(");if(F.node){s.push(F.id+".offsetLeft + "+F.id+".offsetWidth");v.push(F.id+".offsetTop");C.push(F.id+".offsetHeight");}else{s.push("v.left_"+F.id+" + v.width_"+F.id);v.push("v.top_"+F.id);C.push("v.height_"+F.id);}C.push(",",B?(B.node?B.id+".offsetHeight":"v.height_"+B.id):0,")");J.addRule(C.join(""));this.oExt.style.width=(F.splitter-h)+"px";}J.addRule(s.join(""));J.addRule(v.join(""));var y=F.parent.children;if(this.type=="vertical"){J.addRule(K+".host.min = "+(F.node?"document.getElementById('"+F.id+"').offsetLeft":"v.left_"+F.id)+" + "+parseInt(F.minwidth||F.childminwidth||10));var G=[],u=[];for(var z=false,H=F.stackId+1;H<y.length;H++){if(!y[H].fwidth){z=true;}}for(var I,H=F.stackId+1;H<y.length;H++){I=y[H];if(I.minwidth||I.childminheight){G.push(parseInt(I.minwidth||I.childminheight));}else{if(I.fwidth){if(!z&&H==F.stackId+1){G.push(10);}else{if(I.fwidth.indexOf("%")!=-1){G.push("("+I.parent.innerspace+") * "+(parseFloat(I.fwidth)/100));}else{G.push(I.fwidth);}}}else{G.push(10);}}G.push(I.edgeMargin);}J.addRule(K+".host.max = v.left_"+F.parent.id+" + v.width_"+F.parent.id+" - ("+(G.join("+")||0)+")");}else{J.addRule(K+".host.min = "+(F.node?"document.getElementById('"+F.id+"').offsetTop":"v.top_"+F.id)+" + "+parseInt(F.minheight||F.childminheight||10));var G=[],u=[];for(var z=false,H=F.stackId+1;H<y.length;H++){if(!y[H].fheight){z=true;}}if(!z&&B&&B.state>0){return this.oExt.parentNode.removeChild(this.oExt);}for(var I,H=F.stackId+1;H<y.length;H++){I=y[H];if(I.minheight||I.childminheight){G.push(parseInt(I.minheight||I.childminheight));}else{if(I.fheight){if(!z&&H==F.stackId+1){G.push(10);}else{if(I.fheight.indexOf("%")!=-1){G.push("("+I.parent.innerspace+") * "+(parseFloat(I.fheight)/100));}else{G.push(I.fheight);}}}else{G.push(10);}}if(I.edgeMargin){G.push(I.edgeMargin);}}J.addRule(K+".host.max = v.top_"+F.parent.id+" + v.height_"+F.parent.id+" - ("+(G.join("+")||0)+")");}this.$setStyleClass(this.oExt,this.type,[this.type=="horizontal"?"vertical":"horizontal"]);if(this.type=="vertical"){this.$setStyleClass(this.oExt,"w-resize",["n-resize"]);}else{this.$setStyleClass(this.oExt,"n-resize",["w-resize"]);}return this;};this.$draw=function(){this.oExt=this.$getExternal();this.oExt.onmousedown=function(s){if(!s){s=event;}var t=jpf.getAbsolutePosition(this);if(n.type=="vertical"){n.tx=s.clientX-t[0];}else{n.ty=s.clientY-t[1];}n.startPos=n.type=="vertical"?this.offsetLeft:this.offsetTop;s.returnValue=false;s.cancelBubble=true;jpf.plane.show(this);n.$setStyleClass(this,"moving");n.$setStyleClass(document.body,n.type=="vertical"?"w-resize":"n-resize",[n.type=="vertical"?"n-resize":"w-resize"]);jpf.dragmode.setMode("splitter"+n.uniqueId);};};this.$loadJml=function(s){if(s.getAttribute("left")||s.getAttribute("top")){var v=s.getAttribute("left")||s.getAttribute("top");var u=s.getAttribute("right")||s.getAttribute("bottom");v=v.split(/\s*,\s*/);u=u.split(/\s*,\s*/);for(var t=0;t<v.length;t++){v[t]=v[t];}for(var t=0;t<u.length;t++){u[t]=u[t];}setTimeout(function(){n.init(s.getAttribute("type"),s.getAttribute("size"),s.getAttribute("min"),s.getAttribute("max"),s.getAttribute("change"),v,u);});}};jpf.plane.init();jpf.dragmode.defineMode("splitter"+this.uniqueId,this);this.$destroy=function(){jpf.dragmode.removeMode("splitter"+this.uniqueId);};};jpf.input=jpf.secret=jpf.textarea=jpf.textbox=jpf.component(jpf.NODE_VISIBLE,function(){this.$focussable=true;var c=false;var a=this;this.value="";this.isContentEditable=true;this.multiline=this.tagName=="textarea"?true:false;this.$booleanProperties.focusselect=true;this.$booleanProperties.realtime=true;this.$supportedProperties.push("value","mask","initial","focusselect","realtime","type");this.$propHandlers.value=function(n,m){if(this.isHTMLBox){if(this.oInt.innerHTML!=n){this.oInt.innerHTML=n;}}else{if(this.oInt.value!=n){this.oInt.value=n;}}if(this.oButton){this.oButton.style.display=n&&!m?"block":"none";}};this.$propHandlers.maxlength=function(m){this.$setRule("maxlength",m?"value.toString().length <= "+m:null);if(this.oInt.tagName.toLowerCase().match(/input|textarea/)){this.oInt.maxLength=parseInt(m)||null;}};this.$propHandlers.mask=function(m){if(this.mask.toLowerCase()=="password"){return;}if(!m){throw new Error("Not Implemented");}if(!c){c=true;this.implement(jpf.textbox.masking);this.focusselect=false;this.realtime=false;}this.setMask(this.mask);};this.$propHandlers["initial-message"]=function(m){this.initialMsg=m||jpf.xmldb.getInheritedAttribute(this.$jml,"initial-message");if(this.initialMsg){this.oInt.onblur();this.$propHandlers.value.call(this,this.initialMsg,true);}};this.$propHandlers.realtime=function(m){this.realtime=typeof m=="boolean"?m:jpf.isTrue(jpf.xmldb.getInheritedAttribute(this.$jml,"realtime"))||false;};this.$propHandlers.focusselect=function(m){this.oInt.onmousedown=function(){a.focusselect=false;};this.oInt.onmouseup=this.oInt.onmouseout=function(){a.focusselect=m;};};this.$propHandlers.type=function(m){if(m&&"password|username".indexOf(m)>-1&&typeof this.focusselect=="undefined"){this.focusselect=true;this.$propHandlers.focusselect.call(this,true);}};this.setValue=function(m){return this.setProperty("value",m);};this.getValue=function(){var m=this.isHTMLBox?this.oInt.innerHTML:this.oInt.value;return m==this.initialMsg?"":m.replace(/\r/g,"");};this.select=function(){this.oInt.select();};this.deselect=function(){this.oInt.deselect();};this.$enable=function(){this.oInt.disabled=false;};this.$disable=function(){this.oInt.disabled=true;};this.$insertData=function(m){return this.setValue(m);};this.insert=function(q){if(jpf.hasMsRangeObject){try{this.oInt.focus();}catch(n){}var m=document.selection.createRange();if(this.oninsert){q=this.oninsert(q);}m.pasteHTML(q);m.collapse(true);m.select();}else{this.oInt.value+=q;}};this.$clear=function(){this.value="";if(this.initialMsg&&jpf.window.focussed!=this){this.$propHandlers.value.call(this,this.initialMsg,true);jpf.setStyleClass(a.oExt,a.baseCSSname+"Initial");}else{this.$propHandlers.value.call(this,"");}if(!this.oInt.tagName.toLowerCase().match(/input|textarea/i)){if(jpf.hasMsRangeObject){try{var m=document.selection.createRange();m.moveStart("sentence",-1);m.select();}catch(n){}}}this.dispatchEvent("clear");};this.$keyHandler=function(q,v,n,s,t){if(this.dispatchEvent("keydown",{keyCode:q,ctrlKey:v,shiftKey:n,altKey:s,htmlEvent:t})===false){return false;}if(false&&jpf.isIE&&(q==86&&v||q==45&&n)){var u=window.clipboardData.getData("Text");if((u=this.dispatchEvent("keydown",{text:this.onpaste(u)})===false)){return false;}if(!u){u=window.clipboardData.getData("Text");}this.oInt.focus();var m=document.selection.createRange();m.text="";m.collapse();m.pasteHTML(u.replace(/\n/g,"<br />").replace(/\t/g,"&nbsp;&nbsp;&nbsp;"));return false;}};var h;this.$focus=function(n){if(!this.oExt||this.oExt.disabled){return;}this.$setStyleClass(this.oExt,this.baseCSSname+"Focus");if(this.initialMsg&&this.oInt.value==this.initialMsg){this.$propHandlers.value.call(this,"",true);jpf.setStyleClass(this.oExt,"",[this.baseCSSname+"Initial"]);}function m(){try{if(!h||document.activeElement!=a.oInt){a.oInt.focus();}else{clearInterval(h);return;}}catch(q){}if(c){a.setPosition();}if(a.focusselect){a.select();}}if((!n||n.mouse)&&jpf.isIE){clearInterval(h);h=setInterval(m,1);}else{m();}};this.$blur=function(m){if(!this.oExt){return;}if(!this.realtime){this.change(this.getValue());}this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Focus"]);if(this.initialMsg&&this.oInt.value==""){this.$propHandlers.value.call(this,this.initialMsg,true);jpf.setStyleClass(this.oExt,this.baseCSSname+"Initial");}try{if(jpf.isIE||!m||m.srcElement!=jpf.window){this.oInt.blur();}}catch(m){}if(this.oContainer){setTimeout("var o = jpf.lookup("+this.uniqueId+");o.oContainer.style.display = 'none'",100);}clearInterval(h);};this.$draw=function(){this.oExt=this.$getExternal(null,null,function(q){var n=this.$jml.getAttribute("mask");if((typeof n=="string"&&n.toLowerCase()=="password")||"secret|password".indexOf(this.tagName)>-1||this.$jml.getAttribute("type")=="password"){this.$jml.removeAttribute("mask");this.$getLayoutNode("main","input").setAttribute("type","password");}q.setAttribute("onmousedown","this.host.dispatchEvent('mousedown', {htmlEvent : event});");q.setAttribute("onmouseup","this.host.dispatchEvent('mouseup', {htmlEvent : event});");q.setAttribute("onclick","this.host.dispatchEvent('click', {htmlEvent : event});");});this.oInt=this.$getLayoutNode("main","input",this.oExt);this.oButton=this.$getLayoutNode("main","button",this.oExt);if(!jpf.hasContentEditable&&"input|textarea".indexOf(this.oInt.tagName.toLowerCase())==-1){var m=this.oInt;this.oInt=m.parentNode.insertBefore(document.createElement("textarea"),m);m.parentNode.removeChild(m);this.oInt.className=m.className;if(this.oExt==m){this.oExt=this.oInt;}}if(this.oInt.tagName.toLowerCase()=="textarea"){this.addEventListener("focus",function(n){});}this.oInt.onselectstart=function(n){if(!n){n=event;}n.cancelBubble=true;};this.oInt.host=this;this.oInt.onkeydown=function(t){if(this.disabled){return false;}t=t||window.event;if(!a.realtime){var q=a.getValue();if(t.keyCode==13&&q!=this.value){a.change(q);}}else{if(jpf.isSafari&&a.xmlRoot&&a.getValue()!=this.value){setTimeout("var o = jpf.lookup("+a.uniqueId+");o.change(o.getValue())");}}if(a.multiline=="optional"&&t.keyCode==13&&!t.ctrlKey){return false;}if(t.ctrlKey&&(t.keyCode==66||t.keyCode==73||t.keyCode==85)){return false;}if(a.oContainer){var n=a;var s=t.keyCode;setTimeout(function(){n.fillAutocomplete(s);});}if(!a.mask){return a.$keyHandler(t.keyCode,t.ctrlKey,t.shiftKey,t.altKey,t);}};this.oInt.onkeyup=function(q){if(!q){q=event;}var n=q.keyCode;if(a.oButton){a.oButton.style.display=this.value?"block":"none";}if(a.realtime){setTimeout(function(){if(!a.mask&&a.getValue()!=a.value){a.change(a.getValue());}a.dispatchEvent("keyup",{keyCode:n});});}else{a.dispatchEvent("keyup",{keyCode:n});}if(a.isValid()&&q.keyCode!=13&&q.keyCode!=17){a.clearError();}};this.oInt.onfocus=function(){};this.oInt.onblur=function(){};if(jpf.hasAutocompleteXulBug){this.oInt.setAttribute("autocomplete","off");}if(!this.oInt.tagName.toLowerCase().match(/input|textarea/)){this.isHTMLBox=true;this.oInt.unselectable="Off";this.oInt.contentEditable=true;this.oInt.style.width="1px";this.oInt.select=function(){var n=document.selection.createRange();n.moveToElementText(this);n.select();};}this.oInt.deselect=function(){if(!document.selection){return;}var n=document.selection.createRange();n.collapse();n.select();};};this.$loadJml=function(m){var n=$xmlns(m,"autocomplete",jpf.ns.jml)[0];if(n){this.implement(jpf.textbox.autocomplete);this.initAutocomplete(n);}if(this.ref){this.oInt.setAttribute("name",this.ref.split("/").pop().split("::").pop().replace(/[\@\.\(\)]*/g,""));}if(typeof this.realtime=="undefined"){this.$propHandlers.realtime.call(this);}if(jpf.xmldb.isOnlyChild(m.firstChild,[3,4])){this.$handlePropSet("value",m.firstChild.nodeValue.trim());}else{if(!n){jpf.JmlParser.parseChildren(this.$jml,null,this);}}};this.$destroy=function(){this.oInt.onkeypress=this.oInt.onmouseup=this.oInt.onmouseout=this.oInt.onmousedown=this.oInt.onkeydown=this.oInt.onkeyup=this.oInt.onselectstart=null;};}).implement(jpf.DataBinding,jpf.Validation,jpf.Presentation);jpf.tree=jpf.component(jpf.NODE_VISIBLE,function(){this.isTreeArch=true;this.$focussable=true;this.multiselect=false;this.bufferselect=true;this.startcollapsed=true;this.animType=jpf.tween.NORMAL;this.animOpenStep=3;this.animCloseStep=1;this.animSpeed=10;this.dynCssClasses=[];var m=1<<1;var t=1<<2;var s=1<<3;var n=1<<4;var u=this;var q={};this.nodes=[];q[0]="";q[m]="min";q[m|t]="plus";q[s]="last";q[s|m]="minlast";q[s|m|t]="pluslast";q[n]="root";this.$booleanProperties.openadd=true;this.$booleanProperties.startcollapsed=true;this.$booleanProperties.nocollapse=true;this.$booleanProperties.singleopen=true;this.$booleanProperties.prerender=true;this.openadd=true;this.startcollapsed=1;this.prerender=true;this.mode="normal";this.$propHandlers.mode=function(v){this.mode=v||"normal";if("check|radio".indexOf(this.mode)>-1){this.allowdeselect=false;this.addEventListener("afterrename",h);if(this.mode=="check"){this.autoselect=false;this.ctrlselect=true;this.bufferselect=false;this.multiselect=true;this.delayedselect=false;this.addEventListener("afterselect",function(D){var z=this.getTraverseParent(D.xmlNode);if(z!=this.xmlRoot){var w=this.getTraverseNodes(z);var C=D.list;var A=0;for(var y=0;y<w.length;y++){if(C.contains(w[y])){A++;}}if(A){var B=jpf.xmldb.findHTMLNode(this.getTraverseParent(D.xmlNode),this);jpf.setStyleClass(B,A==w.length?"selected":"partial",["partial","selected"]);if(!this.isSelected(z)){this.select(z,null,null,null,null,true);}}else{var B=jpf.xmldb.findHTMLNode(z,this);jpf.setStyleClass(B,"",["partial","selected"]);if(this.isSelected(z)){this.select(z);}}}var E=this.isSelected(D.xmlNode);w=this.getTraverseNodes(D.xmlNode);if(w.length){for(var y=0;y<w.length;y++){if(E!=this.isSelected(w[y])){this.select(w[y]);}}jpf.setStyleClass(jpf.xmldb.findHTMLNode(D.xmlNode,this),E?"selected":"",["partial","selected"]);}this.setIndicator(D.xmlNode);});}else{if(this.mode=="radio"){this.multiselect=false;}}}else{this.ctrlselect=false;this.bufferselect=true;this.multiselect=false;this.removeEventListener("afterrename",h);}};function h(){var v=this.$getMultiBind();if(!v){return;}v.$updateSelection();}this.openAll=function(){};this.closeAll=function(){};this.selectPath=function(v){};this.slideToggle=function(y,w){if(this.nocollapse){return;}if(!y){y=this.$selected;}var z=y.getAttribute(jpf.xmldb.htmlIdTag);while(!z&&y.parentNode){z=(y=y.parentNode).getAttribute(jpf.xmldb.htmlIdTag);}var v=this.$getLayoutNode("item","container",y);if(jpf.getStyle(v,"display")=="block"){if(w==1){return;}y.className=y.className.replace(/min/,"plus");this.slideClose(v,jpf.xmldb.getNode(y));}else{if(w==2){return;}y.className=y.className.replace(/plus/,"min");this.slideOpen(v,jpf.xmldb.getNode(y));}};var c={};this.slideOpen=function(v,z,w){if(!z){z=this.selected;}var A=jpf.xmldb.findHTMLNode(z,this);if(!v){v=this.$findContainer(A);}if(this.singleopen){var y=this.getTraverseParent(z);var B=(y||this.xmlRoot).getAttribute(jpf.xmldb.xmlIdTag);if(c[B]&&c[B][1]!=z&&this.getTraverseParent(c[B][1])==y){this.slideToggle(c[B][0],2);}c[B]=[A,z];}v.style.display="block";if(w){v.style.height="auto";return;}jpf.tween.single(v,{type:"scrollheight",from:0,to:v.scrollHeight,anim:this.animType,steps:this.animOpenStep,interval:this.animSpeed,onfinish:function(C){if(z&&u.hasLoadStatus(z,"potential")){setTimeout(function(){u.$extend(z,C);});C.style.height="auto";}else{C.style.height="auto";}}});};this.slideClose=function(v,w){if(this.nocollapse){return;}if(!w){w=this.selected;}if(this.singleopen){var y=(this.getTraverseParent(w)||this.xmlRoot).getAttribute(jpf.xmldb.xmlIdTag);c[y]=null;}v.style.height=v.offsetHeight;v.style.overflow="hidden";jpf.tween.single(v,{type:"scrollheight",from:v.scrollHeight,to:0,anim:this.animType,steps:this.animCloseStep,interval:this.animSpeed,onfinish:function(z,A){z.style.display="none";}});};this.$add=function(I,D,F,K,G,A){var E=this.bindingRules&&this.bindingRules.insert?this.getNodeFromRule("insert",I):false;var z=I.selectSingleNode(this.traverse)?true:false;var C=E||z;var y=this.startcollapsed;var w=(C?m:0)|(y&&C||E?t:0)|(A?s:0);var H=this.$initNode(I,w,D);var v=this.$getLayoutNode("item","container");if(!y&&!this.nocollapse){v.setAttribute("style","overflow:visible;height:auto;display:block;");}var J=(!this.removecontainer||C);if(!C||E){v.setAttribute("style","display:none;");}if(!this.prerender){var B=this.getTraverseNodes(I).length;}if(E&&(!this.hasLoadStatus(I)||this.hasLoadStatus(I,"potential"))||C&&!this.prerender&&B>2){this.$setLoading(I,v);}else{if(!z&&this.applyRuleSetOnNode("empty",I)){this.$setClearMessage(v);}}if((!K||K==this.oInt)&&F==this.xmlRoot&&!G){this.nodes.push(H);if(!jpf.xmldb.isChildOf(H,v,true)&&J){this.nodes.push(v);}this.$setStyleClass(H,"root");this.$setStyleClass(v,"root");}else{if(!K){K=jpf.xmldb.findHTMLNode(I.parentNode,this);K=K?this.$getLayoutNode("item","container",K):this.oInt;}if(K==this.oInt){this.$setStyleClass(H,"root");this.$setStyleClass(v,"root");}if(!G&&this.getNextTraverse(I)){G=jpf.xmldb.findHTMLNode(this.getNextTraverse(I),this);}if(G&&G.parentNode!=K){G=null;}if(K.style&&this.getTraverseNodes(I.parentNode).length==1){this.$removeClearMessage(K);}if(K.style){jpf.xmldb.htmlImport(H,K,G);if(!jpf.xmldb.isChildOf(H,v,true)&&J){var v=jpf.xmldb.htmlImport(v,K,G);}}else{K.insertBefore(H,G);if(!jpf.xmldb.isChildOf(K,v,true)&&J){K.insertBefore(v,G);}}if(K.style){if(!y&&this.openadd&&K!=this.oInt&&K.style.display!="block"){this.slideOpen(K,F,true);}this.$fixItem(F,jpf.xmldb.findHTMLNode(F,this));if(this.getNextTraverse(I,true)){this.$fixItem(this.getNextTraverse(I,true),jpf.xmldb.findHTMLNode(this.getNextTraverse(I,true),this));}}}if(this.prerender||B<3){this.$addNodes(I,v,false);}return v;};this.$fill=function(){jpf.xmldb.htmlImport(this.nodes,this.oInt);this.nodes.length=0;};this.$getParentNode=function(v){return v?this.$getLayoutNode("item","container",v):this.oInt;};this.$fixItem=function(H,F,E,G,z){if(!F){return;}if(E){if(prevSib=this.getNextTraverse(H,true)){this.$fixItem(prevSib,this.getNodeFromCache(prevSib.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId),null,true);}if(!this.emptyMessage&&H.parentNode.selectNodes(this.traverse).length==1){this.$fixItem(H.parentNode,this.getNodeFromCache(H.parentNode.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId),null,false,true);}}else{var w=this.$getLayoutNode("item","container",F);var C=false;if(z){C=false;}else{if(H.selectNodes(this.traverse).length>0){C=true;}else{if(this.hasLoadStatus(H,"potential")){C=true;}else{C=false;}}}var y=C&&w.style.display!="block";var B=this.getNextTraverse(H,null,G?2:1)?false:true;var v=(C?m:0)|(y?t:0)|(B?s:0);this.$setStyleClass(this.$getLayoutNode("item","class",F),q[v],["min","plus","last","minlast","pluslast"]);this.$setStyleClass(this.$getLayoutNode("item","container",F),q[v],["min","plus","last","minlast","pluslast"]);if(!C&&w){w.style.display="none";}if(v&m){var A=this.$getLayoutNode("item","openclose",F);if(A){A.onmousedown=new Function("e","if(!e) e = event;if (e.button == 2) return;var o = jpf.lookup("+this.uniqueId+");o.slideToggle(this);if (o.onmousedown) o.onmousedown(e, this);jpf.cancelBubble(e, o);");}var D=this.$getLayoutNode("item","icon",F);if(D){D[this.opencloseaction||"ondblclick"]=new Function("var o = jpf.lookup("+this.uniqueId+");  o.slideToggle(this);o.choose();");}this.$getLayoutNode("item","select",F)[this.opencloseaction||"ondblclick"]=new Function("var o = jpf.lookup("+this.uniqueId+");  this.dorename=false;o.slideToggle(this);o.choose();");}}};this.$initNode=function(I,v,D){this.$getNewContext("item");var z=v&m||this.emptyMessage&&this.applyRuleSetOnNode("empty",I);var C=this.$getLayoutNode("item");C.setAttribute("onmouseover","var o = jpf.lookup("+this.uniqueId+");if (o.onmouseover) o.onmouseover(event, this);jpf.setStyleClass(this, 'hover');");C.setAttribute("onmouseout","var o = jpf.lookup("+this.uniqueId+");if (o.onmouseout) o.onmouseout(event, this);jpf.setStyleClass(this, '', ['hover']);");C.setAttribute("onmousedown","var o = jpf.lookup("+this.uniqueId+");if (o.onmousedown) o.onmousedown(event, this);");this.$setStyleClass(this.$getLayoutNode("item","class"),q[v]).setAttribute(jpf.xmldb.htmlIdTag,D);this.$setStyleClass(this.$getLayoutNode("item","container"),q[v]);var y=this.$getLayoutNode("item","openclose");if(z&&y){y.setAttribute(this.opencloseaction||"onmousedown","var o = jpf.lookup("+this.uniqueId+");o.slideToggle(this);if (o.onmousedown) o.onmousedown(event, this);jpf.cancelBubble(event, o);");}var E=this.$getLayoutNode("item","icon");if(E){if(z){var G="var o = jpf.lookup("+this.uniqueId+");o.choose()o.slideToggle(this);jpf.cancelBubble(event,o);";if(this.opencloseaction!="onmousedown"){E.setAttribute(this.opencloseaction||"ondblclick",G);}}E.setAttribute("onmousedown","jpf.lookup("+this.uniqueId+").select(this, event.ctrlKey, event.shiftKey);"+(G&&this.opencloseaction=="onmousedown"?G:""));if(!E.getAttribute("ondblclick")){E.setAttribute("ondblclick","var o = jpf.lookup("+this.uniqueId+");o.choose();");}}var w=this.$getLayoutNode("item","select");if(z){var H="var o = jpf.lookup("+this.uniqueId+");o.choose();o.slideToggle(this);jpf.cancelBubble(event,o);";if(this.opencloseaction!="onmousedown"){w.setAttribute(this.opencloseaction||"ondblclick",H);}}w.setAttribute("onmousedown","var o = jpf.lookup("+this.uniqueId+");if (!o.renaming && o.hasFocus() && jpf.xmldb.isChildOf(o.$selected, this) && o.selected)this.dorename = true;o.select(this, event.ctrlKey, event.shiftKey);if (o.onmousedown)o.onmousedown(event, this);"+(H&&this.opencloseaction=="onmousedown"?H:""));if(!w.getAttribute("ondblclick")){w.setAttribute("ondblclick","var o = jpf.lookup("+this.uniqueId+");o.choose();");}if(E){var B=this.applyRuleSetOnNode("icon",I);if(B){if(E.tagName.match(/^img$/i)){E.setAttribute("src",this.iconPath+B);}else{E.setAttribute("style","background-image:url("+this.iconPath+B+")");}}}var F=this.$getLayoutNode("item","caption");if(F){jpf.xmldb.setNodeValue(F,this.applyRuleSetOnNode("caption",I));}var A=this.applyRuleSetOnNode("tooltip",I);if(A){C.setAttribute("title",A);}var J=this.applyRuleSetOnNode("css",I);if(J){this.$setStyleClass(this.$getLayoutNode("item",null,C),J);this.$setStyleClass(this.$getLayoutNode("item","container",C),J);this.dynCssClasses.push(J);}return C;};this.$deInitNode=function(w,z){var v=this.$getLayoutNode("item","container",z);var y=z.parentNode;v.parentNode.removeChild(v);y.removeChild(z);if(w.parentNode!=this.xmlRoot){this.$fixItem(w,z,true);}if(this.emptyMessage&&!y.childNodes.length){this.$setClearMessage(y);}this.$fixItem(w,z,true);};this.$moveNode=function(C,B){if(!self.jpf.debug&&!B){return;}if(this.hasLoadStatus(C.parentNode,"potential")){var y=this.$getLayoutNode("item","container",B);B.parentNode.removeChild(B);y.parentNode.removeChild(y);this.$extend(C.parentNode);return;}var D=B.parentNode;var w=jpf.xmldb.findHTMLNode(C.parentNode,this);var E=this.getNextTraverse(C);var A=E?jpf.xmldb.findHTMLNode(E,this):null;var z=w?this.$getLayoutNode("item","container",w):this.oInt;var y=this.$getLayoutNode("item","container",B);if(z!=D&&this.getTraverseNodes(C.parentNode).length==1){this.$removeClearMessage(z);}z.insertBefore(B,A);z.insertBefore(y,A);if(this.emptyMessage&&!D.childNodes.length){this.$setClearMessage(D);}if(this.openadd&&w!=this.oInt&&z.style.display!="block"){this.slideOpen(z,w,true);}this.$fixItem(C,B);var v=this.getTraverseParent(C);this.$fixItem(v,jpf.xmldb.findHTMLNode(v,this));if(this.getNextTraverse(C,true)){this.$fixItem(this.getNextTraverse(C,true),jpf.xmldb.findHTMLNode(this.getNextTraverse(C,true),this));}};this.$updateNode=function(y,A){var w=this.$getLayoutNode("item","icon",A);var z=this.applyRuleSetOnNode("icon",y);if(w&&z){if(w.tagName&&w.tagName.match(/^img$/i)){w.src=this.iconPath+z;}else{w.style.backgroundImage="url("+this.iconPath+z+")";}}var C=this.$getLayoutNode("item","caption",A);if(C){if(C.nodeType!=1){C=C.parentNode;}C.innerHTML=this.applyRuleSetOnNode("caption",y);}var B=this.applyRuleSetOnNode("tooltip",y);if(B){A.setAttribute("title",B);}var v=this.applyRuleSetOnNode("css",y);if(v||this.dynCssClasses.length){this.$setStyleClass(A,v,this.dynCssClasses);if(v&&!this.dynCssClasses.contains(v)){this.dynCssClasses.push(v);}}};this.$setLoading=function(w,v){this.setLoadStatus(w,"potential");if(!this.getTraverseNodes(w).length){this.$getNewContext("loading");jpf.xmldb.htmlImport(this.$getLayoutNode("loading"),v);}};this.$removeLoading=function(v){if(!v){return;}this.$getLayoutNode("item","container",v).innerHTML="";};this.$extend=function(y,w){var B=this.getNodeFromRule("insert",y,null,true);var A=B?y.selectSingleNode(B.getAttribute("select")||"."):null;if(B&&A){this.setLoadStatus(y,"loading");if(B.getAttribute("get")){this.getModel().insertFrom(B.getAttribute("get"),A,{insertPoint:A,jmlNode:this});}else{var z=this.applyRuleSetOnNode("insert",y);if(z){this.insert(z,A);}}}else{if(!this.prerender){this.setLoadStatus(y,"loading");this.$removeLoading(jpf.xmldb.findHTMLNode(y,this));var v=this.$addNodes(y,w,true);a.call(this,{action:"insert",xmlNode:y,result:v,anim:true});}}};function a(y){if(y.action=="move-away"){this.$fixItem(y.xmlNode,jpf.xmldb.findHTMLNode(y.xmlNode,this),true);}if(y.action!="insert"){return;}var w=this.getNodeFromCache(y.xmlNode.getAttribute(jpf.xmldb.xmlIdTag)+"|"+this.uniqueId);if(!w){return;}if(this.hasLoadStatus(y.xmlNode,"loading")&&y.result.length>0){var v=this.$getLayoutNode("item","container",w);this.slideOpen(v,y.xmlNode,y.anim?false:true);}else{this.$fixItem(y.xmlNode,w);}if(this.hasLoadStatus(y.xmlNode,"loading")){this.setLoadStatus(y.xmlNode,"loaded");}}this.addEventListener("xmlupdate",a);this.addEventListener("keydown",function(D){var I=D.keyCode;var y=D.ctrlKey;var F=D.shiftKey;var E=this.$indicator||this.$selected;if(!E||this.renaming){return;}var G=this.indicator||this.selected;var z=this.oExt;switch(I){case 13:if(this.$tempsel){this.selectTemp();}if(this.ctrlselect=="enter"){this.select(this.indicator,true);}this.choose(E);break;case 32:this.select(this.indicator,true);break;case 46:if(this.$tempsel){this.selectTemp();}this.remove(this.mode?this.indicator:null);break;case 109:case 37:if(this.$tempsel){this.selectTemp();}if(this.indicator.selectSingleNode(this.traverse)){this.slideToggle(this.$indicator||this.$selected,2);}break;case 107:case 39:if(this.$tempsel){this.selectTemp();}if(this.indicator.selectSingleNode(this.traverse)){this.slideToggle(this.$indicator||this.$selected,1);}break;case 187:if(F){arguments.callee(39);}break;case 189:if(!F){arguments.callee(37);}break;case 38:if(!G&&!this.$tempsel){return;}var A=this.$tempsel?jpf.xmldb.getNode(this.$tempsel):G;var C=this.getNextTraverse(A,true);if(C){var w=this.getTraverseNodes(C);do{var v=this.$getLayoutNode("item","container",this.getNodeFromCache(jpf.xmldb.getID(C,this)));if(v&&jpf.getStyle(v,"display")=="block"&&w.length){C=w[w.length-1];}else{break;}}while(C&&(w=this.getTraverseNodes(C)).length);}else{if(this.getTraverseParent(A)==this.xmlRoot){this.dispatchEvent("selecttop");return;}else{C=this.getTraverseParent(A);}}if(C&&C.nodeType==1){this.setTempSelected(C,y,F);}if(this.$tempsel&&this.$tempsel.offsetTop<z.scrollTop){z.scrollTop=this.$tempsel.offsetTop;}return false;break;case 40:if(!G&&!this.$tempsel){return;}var A=this.$tempsel?jpf.xmldb.getNode(this.$tempsel):G;var C=this.getFirstTraverseNode(A);if(C){var v=this.$getLayoutNode("item","container",this.getNodeFromCache(jpf.xmldb.getID(A,this)));if(v&&jpf.getStyle(v,"display")!="block"){C=null;}}while(!C){var H=this.getTraverseParent(A);if(!H){break;}var B=0;var w=this.getTraverseNodes(H);while(w[B]&&w[B]!=A){B++;}C=w[B+1];A=H;}if(C&&C.nodeType==1){this.setTempSelected(C,y,F);}if(this.$tempsel&&this.$tempsel.offsetTop+this.$tempsel.offsetHeight>z.scrollTop+z.offsetHeight){z.scrollTop=this.$tempsel.offsetTop-z.offsetHeight+this.$tempsel.offsetHeight+10;}return false;break;case 33:break;case 34:break;case 36:break;case 35:break;}},true);this.$calcSelectRange=function(y,v){var A=[];var w=this.getTraverseNodes();for(var B=false,z=0;z<w.length;z++){if(w[z]==y){B=true;}if(B){A.push(w[z]);}if(w[z]==v){B=false;}}if(!A.length||B){A=[];for(var B=false,z=w.length-1;z>=0;z--){if(w[z]==y){B=true;}if(B){A.push(w[z]);}if(w[z]==v){B=false;}}}return A;};this.$findContainer=function(v){return this.$getLayoutNode("item","container",v);};this.$selectDefault=function(y){if(this.select(this.getFirstTraverseNode(y))){return true;}else{var v=this.getTraverseNodes(y);for(var w=0;w<v.length;w++){if(this.$selectDefault(v[w])){return true;}}}};this.$draw=function(){if(!this.$jml.getAttribute("skin")){var v=this.$jml.getAttribute("mode");if(v=="check"){this.$loadSkin("default:checktree");}else{if(v=="radio"){this.$loadSkin("default:radiotree");}}}this.oExt=this.$getExternal();this.oInt=this.$getLayoutNode("main","container",this.oExt);this.opencloseaction=this.$getOption("main","openclose");if(jpf.hasCssUpdateScrollbarBug&&!this.mode){this.$fixScrollBug();}this.oExt.onclick=function(w){u.dispatchEvent("click",{htmlEvent:w||event});};};this.$loadJml=function(v){if(this.nocollapse){this.startcollapsed=false;}else{if(this.startcollapsed===1){this.startcollapsed=!jpf.isFalse(this.$getOption("main","startcollapsed"));}}if(this.$jml.childNodes.length){this.$loadInlineData(this.$jml);}};this.$destroy=function(){this.oExt.onclick=null;jpf.removeNode(this.oDrag);this.oDrag=null;};}).implement(jpf.Validation,jpf.MultiSelect,jpf.Cache,jpf.Presentation,jpf.DataBinding);jpf.panel=jpf.bar=jpf.component(jpf.NODE_VISIBLE,function(){this.canHaveChildren=true;this.$focussable=false;this.$domHandlers.reparent.push(function(c,m,h){if(!this.$jmlLoaded){return;}if(a&&!h&&this.skinName!=m.skinName||!a&&this.parentNode.$hasLayoutNode&&this.parentNode.$hasLayoutNode(this.tagName)){a=true;this.$forceSkinChange(this.parentNode.skinName.split(":")[0]+":"+skinName);}});var a=false;this.$draw=function(){if(this.parentNode&&this.parentNode.$hasLayoutNode&&this.parentNode.$hasLayoutNode(this.tagName)){a=true;if(this.skinName!=this.parentNode.skinName){this.$loadSkin(this.parentNode.skinName);}}else{if(a){a=false;this.$loadSkin();}}this.oExt=this.$getExternal(a?this.tagName:"main");if(this.oDrag){this.oDrag.parentNode.removeChild(this.oDrag);}this.oDrag=this.$getLayoutNode(a?this.tagName:"main","dragger",this.oExt);};this.$loadJml=function(c){var h=this.$getLayoutNode(a?this.tagName:"main","container",this.oExt);this.oInt=this.oInt?jpf.JmlParser.replaceNode(h,this.oInt):jpf.JmlParser.parseChildren(c,h,this);};this.$skinchange=function(){};}).implement(jpf.Presentation);jpf.radiogroup=jpf.component(jpf.NODE_HIDDEN,function(){this.radiobuttons=[];this.visible=true;this.$supportedProperties.push("value","visible","zindex","disabled");this.$propHandlers.value=function(c){for(var a=0;a<this.radiobuttons.length;a++){if(this.radiobuttons[a].value==c){return this.setCurrent(this.radiobuttons[a]);}}};this.$propHandlers.zindex=function(c){for(var a=0;a<this.radiobuttons.length;a++){this.radiobuttons[a].setZIndex(c);}};this.$propHandlers.visible=function(c){if(c){for(var a=0;a<this.radiobuttons.length;a++){this.radiobuttons[a].show();}}else{for(var a=0;a<this.radiobuttons.length;a++){this.radiobuttons[a].hide();}}};this.$propHandlers.disabled=function(c){this.disabled=c;if(c){for(var a=0;a<this.radiobuttons.length;a++){this.radiobuttons[a].disable();}}else{for(var a=0;a<this.radiobuttons.length;a++){this.radiobuttons[a].enable();}}};this.addRadio=function(a){var c=this.radiobuttons.push(a)-1;if(!this.visible){a.hide();}if(!a.value){a.value=String(c);}if(this.value&&a.value==this.value){this.setCurrent(a);}};this.removeRadio=function(a){this.radiobuttons.remove(a);};this.setValue=function(h){for(var a=0;a<this.radiobuttons.length;a++){if(this.radiobuttons[a].value==h){var c=this.radiobuttons[a];if(this.current&&this.current!=c){this.current.$uncheck();}c.check(true);this.current=c;break;}}return this.setProperty("value",h);};this.setCurrent=function(a){if(this.current&&this.current!=a){this.current.$uncheck();}this.value=a.value;a.check(true);this.current=a;};this.getValue=function(){return this.current?this.current.value:"";};}).implement(jpf.DataBinding,jpf.Validation);jpf.radiobutton=jpf.component(jpf.NODE_VISIBLE,function(){this.$focussable=true;var a=this;this.$booleanProperties.checked=true;this.$supportedProperties.push("value","background","group","label","checked","tooltip","icon");this.$propHandlers.group=function(h){if(this.radiogroup){this.radiogroup.removeRadio(this);}this.radiogroup=jpf.nameserver.get("radiogroup",h);if(!this.radiogroup){var c=new jpf.radiogroup(this.pHtmlNode,"radiogroup");c.errBox=this.errBox;c.parentNode=this.parentNode;jpf.nameserver.register("radiogroup",h,c);jpf.setReference(h,c);c.$jml=this.$jml;c.loadJml(this.$jml);this.radiogroup=c;}if(this.oInput){this.oInput.setAttribute("name",this.group||"radio"+this.radiogroup.uniqueId);}if(!this.value&&this.$jml){this.value=this.$jml.getAttribute("value");}this.radiogroup.addRadio(this);if(this.checked){this.radiogroup.setValue(this.value);}};this.$propHandlers.tooltip=function(c){this.oExt.setAttribute("title",c);};this.$propHandlers.icon=function(c){if(!this.oIcon){return;}if(c){this.$setStyleClass(this.oExt,this.baseCSSname+"Icon");}else{this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Icon"]);}jpf.skins.setIcon(this.oIcon,c,this.iconPath);};this.$propHandlers.label=function(c){if(c){this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Empty"]);}else{this.$setStyleClass(this.oExt,this.baseCSSname+"Empty");}if(this.oLabel){this.oLabel.innerHTML=c;}};this.$propHandlers.checked=function(c){if(!this.radiogroup){return;}if(c){this.radiogroup.setValue(this.value);}else{}};this.$propHandlers.background=function(h){var m=this.$getLayoutNode("main","background",this.oExt);if(h){var c=h.split("|");this.$background=c.concat(["vertical",2,16].slice(c.length-1));m.style.backgroundImage="url("+this.mediaPath+c[0]+")";m.style.backgroundRepeat="no-repeat";}else{m.style.backgroundImage="";m.style.backgroundRepeat="";this.$background=null;}};this.setValue=function(c){this.setProperty("value",c);};this.getValue=function(){return this.value;};this.setError=function(c){this.$setStyleClass(this.oExt,this.baseCSSname+"Error");};this.clearError=function(c){this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Error"]);};this.check=function(c){if(c){this.$setStyleClass(this.oExt,this.baseCSSname+"Checked");this.checked=true;if(this.oInput){this.oInput.checked=true;}this.doBgSwitch(2);}else{this.radiogroup.change(this.value);}};this.$uncheck=function(){this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Checked"]);this.checked=false;if(this.oInput){this.oInput.checked=false;}this.doBgSwitch(1);};this.$enable=function(){if(this.oInput){this.oInput.disabled=false;}this.oExt.onclick=function(c){if(!c){c=event;}if((c.srcElement||c.target)==this){return;}a.dispatchEvent("click",{htmlEvent:c});a.radiogroup.change(a.value);};this.oExt.onmousedown=function(c){if(!c){c=event;}if((c.srcElement||c.target)==this){return;}jpf.setStyleClass(this,a.baseCSSname+"Down");};this.oExt.onmouseover=function(c){if(!c){c=event;}if((c.srcElement||c.target)==this){return;}jpf.setStyleClass(this,a.baseCSSname+"Over");};this.oExt.onmouseout=this.oExt.onmouseup=function(){jpf.setStyleClass(this,"",[a.baseCSSname+"Down",a.baseCSSname+"Over"]);};};this.$disable=function(){if(this.oInput){this.oInput.disabled=true;}this.oExt.onclick=null;this.oExt.onmousedown=null;};this.doBgSwitch=function(h){if(this.bgswitch&&(this.bgoptions[1]>=h||h==4)){if(h==4){h=this.bgoptions[1]+1;}var c=this.bgoptions[0]=="vertical"?"0 -"+(parseInt(this.bgoptions[2])*(h-1))+"px":"-"+(parseInt(this.bgoptions[2])*(h-1))+"px 0";this.$getLayoutNode("main","background",this.oExt).style.backgroundPosition=c;}};this.$focus=function(){if(!this.oExt){return;}if(this.oInput&&this.oInput.disabled){return false;}this.$setStyleClass(this.oExt,this.baseCSSname+"Focus");};this.$blur=function(){if(!this.oExt){return;}this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Focus"]);};this.addEventListener("keydown",function(m){var c=m.keyCode;if(c==13||c==32){this.radiogroup.change(this.value);return false;}else{if(c==38){var h=this;while(h&&h.previousSibling){h=h.previousSibling;if(h.tagName=="radiobutton"&&!h.disabled&&h.radiogroup==this.radiogroup){h.check();h.focus();return;}}}else{if(c==40){var h=this;while(h&&h.nextSibling){h=h.nextSibling;if(h.tagName=="radiobutton"&&!h.disabled&&h.radiogroup==this.radiogroup){h.check();h.focus();return;}}}}}},true);this.$draw=function(){this.oExt=this.$getExternal();this.oInput=this.$getLayoutNode("main","input",this.oExt);this.oLabel=this.$getLayoutNode("main","label",this.oExt);this.oIcon=this.$getLayoutNode("main","icon",this.oExt);this.enable();};this.$loadJml=function(c){if(c.firstChild){var h=c.innerHTML;if(!h){h=(c.xml||c.serialize()).replace(/^<[^>]*>/,"").replace(/<\/\s*[^>]*>$/,"");}this.$handlePropSet("label",h);}if(!this.radiogroup){this.$propHandlers.group.call(this,"radiogroup"+this.parentNode.uniqueId);}if(this.checked&&!this.radiogroup.value){this.$propHandlers.checked.call(this,this.checked);}};}).implement(jpf.Presentation);jpf["switch"]=jpf.pages=jpf.tab=jpf.component(jpf.NODE_VISIBLE,function(){this.$hasButtons=this.tagName=="tab";this.$focussable=jpf.KEYBOARD;this.$draw=function(a){this.oExt=this.$getExternal();};this.$loadJml=function(a){this.switchType=a.getAttribute("switchtype")||"incremental";this.$loadChildren();};this.$destroy=function(){jpf.layout.removeRule(this.oExt,this.uniqueId+"_tabscroller");};}).implement(jpf.BaseTab);jpf.teleport={tagName:"teleport",nodeFunc:jpf.NODE_HIDDEN,modules:new Array(),named:{},register:function(c){var h=false,a={obj:c};return this.modules.push(a)-1;},getModules:function(){return this.modules;},getModuleByName:function(a){return this.named[a];},loadJml:function(c,a){this.$jml=c;this.parentNode=a;jpf.implement.call(this,jpf.JmlDom);var q,n,h=this.$jml.childNodes;for(var m=0;m<h.length;m++){if(h[m].nodeType!=1){continue;}n=new jpf.BaseComm(h[m]);if(q=h[m].getAttribute("id")){jpf.setReference(q,n);}}this.loaded=true;if(this.onload){this.onload();}return this;},availHTTP:[],releaseHTTP:function(a){if(jpf.brokenHttpAbort){return;}if(self.XMLHttpRequestUnSafe&&a.constructor==XMLHttpRequestUnSafe){return;}a.onreadystatechange=function(){};a.abort();this.availHTTP.push(a);},destroy:function(){for(var a=0;a<this.availHTTP.length;a++){this.availHTTP[a]=null;}}};jpf.BaseComm=function(a){jpf.makeClass(this);this.uniqueId=jpf.all.push(this)-1;this.$jml=a;this.toString=function(){return"[Javeline Teleport Component : "+(this.name||"")+" ("+this.type+")]";};if(this.$jml){this.name=a.getAttribute("id");this.type=a[jpf.TAGNAME];if(!jpf[this.type]){throw new Error(jpf.formatErrorString(1023,null,"Teleport baseclass","Could not find Javeline Teleport Component '"+this.type+"'",this.$jml));}this.implement(jpf[this.type]);if(this.useHTTP){if(!jpf.http){throw new Error(jpf.formatErrorString(1024,null,"Teleport baseclass","Could not find Javeline Teleport HTTP Component",this.$jml));}this.implement(jpf.http);}if(this.$jml.getAttribute("protocol")){var c=this.$jml.getAttribute("protocol").toLowerCase();if(!jpf[c]){throw new Error(jpf.formatErrorString(1025,null,"Teleport baseclass","Could not find Javeline Teleport RPC Component '"+c+"'",this.$jml));}this.implement(jpf[c]);}}if(this.$jml){this.load(this.$jml);}};jpf.Init.run("Teleport");jpf.label=jpf.component(jpf.NODE_VISIBLE,function(){var a=this;this.$focussable=false;var c;this.setValue=function(h){this.setProperty("value",h);};this.getValue=function(){return this.value;};this.$supportedProperties.push("value","for");this.$propHandlers.value=function(h){this.oInt.innerHTML=h;};this.$propHandlers["for"]=function(h){c=typeof h=="string"?self[h]:h;};this.$draw=function(){this.oExt=this.$getExternal();this.oInt=this.$getLayoutNode("main","caption",this.oExt);if(this.oInt.nodeType!=1){this.oInt=this.oInt.parentNode;}this.oExt.onmousedown=function(){if(c&&c.$focussable&&c.focussable){c.focus();}};};this.$loadJml=function(h){if(jpf.xmldb.isOnlyChild(h.firstChild,[3,4])){this.setProperty("value",h.firstChild.nodeValue.trim());}else{jpf.JmlParser.parseChildren(this.$jml,this.oInt,this);}};}).implement(jpf.DataBinding,jpf.BaseSimple);jpf.slideshow=jpf.component(jpf.NODE_VISIBLE,function(){this.pHtmlNode=document.body;this.title="number";this.thumbheight=50;this.loadmsg="Loading...";this.defaultthumb=null;this.defaultimage=null;this.defaulttitle="No description";this.delay=5;this.init=false;this.scalewidth=false;this.$supportedProperties.push("model","thumbheight","title","loadmsg","defaultthumb","defaulttitle","defaultimage","scalewidth");var m=this;var h,y,z,s;var F=0,G=0,v=false,D=false,a=true,q=30,w=210,C=150;var t=[];this.$positioning="basic";this.$booleanProperties.scalewidth=true;this.$propHandlers.thumbheight=function(H){if(parseInt(H)){this.thumbheight=parseInt(H);}};this.$propHandlers.delay=function(H){if(parseInt(H)){this.delay=parseInt(H);}};var B;var E;var c=function(L){L=(L||event);var J=L.keyCode,H=z,K=m.getNextTraverse(z),I=m.getNextTraverse(z,true);y=K?K:m.getFirstTraverseNode();h=I?I:m.getLastTraverseNode();z=J==39?y:(J==37?h:z);m.addSelection(J==39?-1:(J==37?1:0));if(z!==H){clearInterval(B);B=setInterval(function(){m.$refresh();clearInterval(B);},550);}return false;};this.addEventListener("onkeydown",c);function u(){var I=m.getNextTraverse(z),H=m.getNextTraverse(z,true);y=I?I:m.getFirstTraverseNode();h=H?H:m.getLastTraverseNode();}this.select=function(H){z=H;};this.operaWidth=0;this.operaHeight=0;this.$paint=function(){z=m.getFirstTraverseNode();this.oInt.style.display="block";this.oBody.style.display="";this.oImage.style.display="";this.oImage.src="about:blank";this.oLoading.innerHTML=this.loadmsg;this.lastOverflow=document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";if(z){this.addSelection();}else{this.oConsole.style.display="none";this.otPrevious.style.visibility="hidden";this.otNext.style.visibility="hidden";}jpf.tween.single(this.oCurtain,{steps:3,type:"fade",from:0,to:0.7,onfinish:function(){m.oImage.onload=function(){s=z;m.oBody.style.display="block";m.oImageBase.style.display="block";m.oImageBase.src=m.oImage.src;this.style.display="block";var N=m.oImageBase.offsetWidth||m.oImageBase.width;var Q=m.oImageBase.offsetHeight||m.oImageBase.height;var R=m.oBody;var O=m.oImage;this.style.display="none";if(jpf.isOpera){m.operaWidth=N;m.operaHeight=Q;}m.oImageBase.style.display="none";m.oThumbnails.style.height=m.otBody.style.height=m.otPrevious.style.height=m.otNext.style.height=m.thumbheight+"px";if(z){m.addSelection();}clearTimeout(m.timer);var K=jpf.isIE?document.documentElement.offsetWidth:window.innerWidth;var H=jpf.isIE?document.documentElement.offsetHeight:window.innerHeight;m.otBody.style.height=m.thumbheight+"px";var P=m.$getPanelSize();var T=jpf.getDiff(R);var U=[false,false];var J=H-P/2-w,M=K-C;var L=Q,S=N;if(L>J){S=parseInt(S*(J/L));L=J;}if(S>M){L=parseInt(L*(M/S));S=M;}m.viewPortHeight=L;m.viewPortWidth=S;jpf.tween.single(R,{steps:jpf.isGecko?20:(Math.abs(N-R.offsetWidth)>40?10:3),anim:jpf.tween.EASEIN,type:"mwidth",from:R.offsetWidth-T[0],to:S,onfinish:function(){U[0]=true;}});jpf.tween.single(R,{steps:jpf.isGecko?20:(Math.abs(Q-R.offsetHeight)>40?10:3),anim:jpf.tween.EASEIN,type:"mheight",margin:-1*(P/2-10),from:R.offsetHeight-T[1],to:L,onfinish:function(){U[1]=true;}});var I;I=setInterval(function(){if(U[0]&&U[1]){if(z){u();}m.oTitle.style.visibility="visible";m.oConsole.style.visibility="visible";m.oTitle.style.display="block";m.$checkThumbSize();if(a){m.oThumbnails.style.visibility="visible";}O.style.display="block";O.style.width=S+"px";O.style.height=L+"px";jpf.tween.single(O,{steps:5,type:"fade",from:0,to:1});jpf.tween.single(m.oTitle,{steps:10,type:"fade",from:0,to:1});clearInterval(I);v=false;m.addSelection();if(D){m.$play();}}},30);};m.oImage.onerror=function(){v=false;};m.oImage.onabort=function(){v=false;};m.oImage.src=(m.applyRuleSetOnNode("src",z)||m.defaultimage||"about:blank");m.oContent.innerHTML=m.title=="text"?m.applyRuleSetOnNode("title",z):(m.title=="number+text"?"<b>Image "+(m.getPos()+1)+" of "+m.getTraverseNodes().length+"</b><br />"+(m.applyRuleSetOnNode("title",z)||m.defaulttitle):"Image "+(m.getPos()+1)+" of "+m.getTraverseNodes().length);m.init=true;}});};this.getPos=function(){return Array.prototype.indexOf.call(m.getTraverseNodes(),z);};this.addSelection=function(I){var O=jpf.xmldb.findHTMLNode(z,this),N=jpf.isIE?document.documentElement.offsetWidth:window.innerWidth,H=jpf.getDiff(m.otPrevious),J=jpf.getDiff(m.otNext),L=parseInt(jpf.getStyle(m.otPrevious,"width")),M=parseInt(jpf.getStyle(m.otNext,"width")),K=parseInt(jpf.getStyle(O,"width"));if(O.offsetLeft+K+5>N-L-M-H[0]-J[0]){if(I){if(I>0){this.$tPrevious();}else{if(I<0){this.$tNext();}}this.addSelection(I);}}if(this.$selected){this.$selected.className="sspictureBox";}if(O){O.className="sspictureBox ssselected";}this.$selected=O;};this.$Next=function(){z=y;this.addSelection(-1);this.$refresh();};this.$Previous=function(){z=h;this.addSelection(1);this.$refresh();};this.$tNext=function(){m.otBody.appendChild(m.otBody.childNodes[0]);};this.$tPrevious=function(){m.otBody.insertBefore(m.otBody.childNodes[m.otBody.childNodes.length-1],m.otBody.firstChild);};this.$showLast=function(){var H;clearInterval(H);H=setInterval(function(){if(!v){if(t.length){z=t.pop();t=[];m.$refresh();}clearInterval(H);}},100);};this.$refresh=function(){if(v){t.push(z);this.$showLast();return;}if(D){clearInterval(A);}var H=m.oImage;u();v=true;jpf.tween.single(H,{steps:3,type:"fade",from:1,to:0});jpf.tween.single(m.oTitle,{steps:3,type:"fade",from:1,to:0,onfinish:function(){m.oTitle.style.visibility="hidden";H.style.left="0px";H.style.top="0px";var J=(m.applyRuleSetOnNode("src",z)||m.defaultimage||m.defaultthumb);var I=H.src;H.src=J;if(H.src==I&&(jpf.isChrome||jpf.isSafari)){v=false;jpf.tween.single(H,{steps:3,type:"fade",from:0,to:1});jpf.tween.single(m.oTitle,{steps:3,type:"fade",from:0,to:1});m.oTitle.style.visibility="visible";}m.oContent.innerHTML=m.title=="text"?m.applyRuleSetOnNode("title",z):(m.title=="number+text"?"<b>Image "+(m.getPos()+1)+" of "+m.getTraverseNodes().length+"</b><br />"+(m.applyRuleSetOnNode("title",z)||m.defaulttitle):"Image "+(m.getPos()+1)+" of "+m.getTraverseNodes().length);}});clearTimeout(m.timer);};var A;this.$play=function(){A=setInterval(function(){D=true;if(v){return;}m.$Next();},m.delay*1000);};this.$stop=function(){clearInterval(A);A=null;D=false;};this.$draw=function(){this.oExt=this.$getExternal();this.oInt=this.$getLayoutNode("main","container",this.oExt);this.oCurtain=this.$getLayoutNode("main","curtain",this.oExt);this.oMove=this.$getLayoutNode("main","move",this.oExt);this.oBody=this.$getLayoutNode("main","body",this.oExt);this.oContent=this.$getLayoutNode("main","content",this.oExt);this.oImage=this.$getLayoutNode("main","image",this.oExt);this.oImageBase=this.$getLayoutNode("main","image_base",this.oExt);this.oClose=this.$getLayoutNode("main","close",this.oExt);this.oBeam=this.$getLayoutNode("main","beam",this.oExt);this.oTitle=this.$getLayoutNode("main","title",this.oExt);this.oThumbnails=this.$getLayoutNode("main","thumbnails",this.oExt);this.otBody=this.$getLayoutNode("main","tbody",this.oExt);this.otPrevious=this.$getLayoutNode("main","tprevious",this.oExt);this.otNext=this.$getLayoutNode("main","tnext",this.oExt);this.oLoading=this.$getLayoutNode("main","loading",this.oExt);this.oEmpty=this.$getLayoutNode("main","empty",this.oExt);this.oConsole=this.$getLayoutNode("main","console",this.oExt);this.oPrevious=this.$getLayoutNode("main","previous",this.oExt);this.oPlay=this.$getLayoutNode("main","play",this.oExt);this.oNext=this.$getLayoutNode("main","next",this.oExt);var K="jpf.lookup("+this.uniqueId+").$resize()";jpf.layout.setRules(this.pHtmlNode,this.uniqueId+"_scaling",K,true);this.oPrevious.onclick=this.oNext.onclick=function(M){if((this.className||"").indexOf("ssprevious")!=-1){m.$Previous();}else{if((this.className||"").indexOf("ssnext")!=-1){m.$Next();}}};var I;this.otPrevious.onmousedown=function(M){I=setInterval(function(){m.$tPrevious();},50);};this.otNext.onmousedown=function(M){I=setInterval(function(){m.$tNext();},50);};this.otNext.onmouseover=function(M){m.$setStyleClass(m.otNext,"ssnhover");};this.otPrevious.onmouseover=function(M){m.$setStyleClass(m.otPrevious,"ssphover");};this.otNext.onmouseout=function(M){m.$setStyleClass(m.otNext,"",["ssnhover"]);};this.otPrevious.onmouseout=function(M){m.$setStyleClass(m.otPrevious,"",["ssphover"]);};this.oPlay.onclick=function(M){if(A){m.$stop();m.$setStyleClass(m.oPlay,"",["ssstop"]);m.$setStyleClass(m.oPlay,"ssplay");m.oNext.style.visibility="visible";m.oPrevious.style.visibility="visible";m.oThumbnails.style.display="block";}else{m.$play();m.$setStyleClass(m.oPlay,"",["ssplay"]);m.$setStyleClass(m.oPlay,"ssstop");m.oNext.style.visibility="hidden";m.oPrevious.style.visibility="hidden";m.oThumbnails.style.display="none";}};document.onmouseup=function(M){clearInterval(I);clearInterval(L);document.onmousemove=null;return false;};var H,J=false;E=function(P){if(!m.xmlRoot||m.oExt.style.display=="none"){return;}P=P||event;if(jpf.isChrome||jpf.isSafari){J=J?false:true;if(!J){return;}}var Q=P.delta;var M=z;var O=m.getNextTraverse(z);var N=m.getNextTraverse(z,true);y=O?O:m.getFirstTraverseNode();h=N?N:m.getLastTraverseNode();z=Q<0?y:h;m.addSelection(Q);if(z!==M){clearInterval(H);H=setInterval(function(){m.$refresh();clearInterval(H);},400);}return false;};jpf.addEventListener("mousescroll",E);this.oClose.onclick=function(){m.hide();};var L;this.oImage.onmousedown=function(R){R=R||event;var Q=jpf.isIE?document.documentElement.offsetWidth:window.innerWidth,M=jpf.isIE?document.documentElement.offsetHeight:window.innerHeight,S=m.oBody,T=jpf.getDiff(S),W=S.offsetWidth-T[0]-m.oImage.offsetWidth,V=S.offsetHeight-T[1]-m.oImage.offsetHeight;var U=parseInt(m.oImage.style.top),O=parseInt(m.oImage.style.left);var N=R.clientY,P=R.clientX;if(R.preventDefault){R.preventDefault();}document.onmousemove=function(X){X=X||event;if(W<0){if(O+X.clientX-P>=W&&O+X.clientX-P<=0){m.oImage.style.left=(O+X.clientX-P)+"px";}}if(V<0){if(U+X.clientY-N>=V&&U+X.clientY-N<=0){m.oImage.style.top=(U+X.clientY-N)+"px";}}return false;};};this.oImage.onmouseover=function(M){v=true;};this.oImage.onmouseout=function(M){v=false;};};this.$xmlUpdate=function(){};this.$getPanelSize=function(){var H=this.oTitle.offsetHeight||parseInt(jpf.getStyle(this.oTitle,"height"))+jpf.getDiff(this.oTitle)[1];return Math.max(this.oBeam.offsetHeight,H+(this.thumbnails?this.thumbheight:0)+this.oConsole.offsetHeight);};this.$IEResizeCounter=0;this.tmrIsResized=null;this.$resize=function(){if(!this.init){return;}if(jpf.isIE||jpf.isChrome){this.$IEResizeCounter++;if(this.$IEResizeCounter==2){this.$IEResizeCounter=0;return;}}var L=this;L.oImage.style.display="none";var I=jpf.isIE?document.documentElement.offsetWidth:window.innerWidth,H=jpf.isIE?document.documentElement.offsetHeight:window.innerHeight;var O=L.oImageBase.offsetWidth||L.oImageBase.width||this.operaWidth;var Q=L.oImageBase.offsetHeight||L.oImageBase.height||this.operaHeight;var N=jpf.getDiff(this.oBody);var P=this.$getPanelSize();var J=H-P/2-w;var M=I-C;var K=Q;var R=O;if(K>J){R=parseInt(R*(J/K));K=J;}if(R>M){K=parseInt(K*(M/R));R=M;}this.viewPortHeight=K;this.viewPortWidth=R;var S=[false,false];jpf.tween.single(L.oBody,{steps:10,anim:jpf.tween.EASEIN,type:"mwidth",from:L.oBody.offsetWidth-N[0],to:R,onfinish:function(){S[0]=true;}});jpf.tween.single(L.oBody,{steps:10,anim:jpf.tween.EASEIN,type:"mheight",margin:-1*(P/2-10),from:L.oBody.offsetHeight-N[1],to:K,onfinish:function(){S[1]=true;}});clearInterval(L.tmrIsResized);L.tmrIsResized=setInterval(function(){if(S[0]&&S[1]){clearInterval(L.tmrIsResized);L.oImage.style.display="block";L.oImage.style.width=R+"px";L.oImage.style.height=K+"px";jpf.tween.single(L.oImage,{steps:2,type:"fade",from:0,to:1});}},30);};this.$clickThumb=function(H){z=jpf.xmldb.getNode(H);this.addSelection();this.$refresh();};this.$checkThumbSize=function(){var J=this.getTraverseNodes(),K=J.length;var O=0;for(var M=0,Q,I,R,N,P,L;M<K;M++){R=this.otBody.childNodes[M];I=this.applyRuleSetOnNode("thumb",J[M]);Q=jpf.getDiff(R);L=this.thumbheight-10-Q[1];img=new Image();document.body.appendChild(img);img.src=I?I:this.defaultthumb;if(this.scalewidth){N=L;if(img.height<L){P=img.width;}else{img.setAttribute("height",L);P=img.width;}}else{N=P=L;}O+=P+Q[0]+(parseInt(jpf.getStyle(R,"margin-left")||jpf.getStyle(R,"marginLeft")))+(parseInt(jpf.getStyle(R,"margin-right")||jpf.getStyle(R,"marginRight")));document.body.removeChild(img);R.style.width=P+"px";}var H=jpf.getDiff(this.otBody);this.otPrevious.style.visibility=this.otNext.style.visibility=O<this.oThumbnails.offsetWidth-H[0]?"hidden":"visible";};this.$load=function(K){jpf.xmldb.addNodeListener(K,this);var I=this.getTraverseNodes(),J=I.length;for(var M=0,P,H,Q,N,O,L;M<J;M++){Q=this.otBody.appendChild(document.createElement("div"));H=this.applyRuleSetOnNode("thumb",I[M]);Q.style.backgroundImage="url("+(H?H:this.defaultthumb)+")";this.$setStyleClass(Q,"sspictureBox");P=jpf.getDiff(Q);L=this.thumbheight-10-P[1];img=new Image();document.body.appendChild(img);img.src=H?H:this.defaultthumb;if(this.scalewidth){N=L;if(img.height<L){O=img.width;}else{img.setAttribute("height",L);O=img.width;}}else{N=O=L;}document.body.removeChild(img);Q.style.height=N+"px";Q.style.width=O+"px";Q.style.marginTop=Q.style.marginBottom="5px";jpf.xmldb.nodeConnect(this.documentId,I[M],Q,this);Q.onclick=function(R){m.$clickThumb(this);};}if(J!=this.length){this.setProperty("length",J);}this.$paint();};this.$show=function(){this.lastOverflow=document.documentElement.style.overflow=="hidden"?"auto":document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";m.oExt.style.display="block";m.oInt.style.display="block";m.oBody.style.display="block";jpf.tween.single(m.oCurtain,{steps:10,type:"fade",from:0,to:0.7,onfinish:function(){}});this.$refresh();};this.$hide=function(){document.documentElement.style.overflow=this.lastOverflow;m.oExt.style.display="block";m.oBody.style.display="none";jpf.tween.single(m.oCurtain,{steps:10,type:"fade",from:0.7,to:0,onfinish:function(){m.oInt.style.display="none";m.oExt.style.display="none";m.oBody.style.display="none";}});};this.$destroy=function(){this.otNext.onmouseover=this.otPrevious.onmouseover=this.otNext.onmouseout=this.otPrevious.onmouseout=this.oExt.onresize=this.oImage.onmousedown=this.otNext.onmousedown=this.otPrevious.onmousedown=this.oNext.onclick=this.oPrevious.onclick=null;this.removeEventListener("onkeydown",c);this.removeEventListener("mousescroll",E);this.x=null;};this.$loadJml=function(H){var I=H.childNodes;jpf.JmlParser.parseChildren(H,null,this);};var n;this.$setClearMessage=function(M,I){var L=jpf.isIE?document.documentElement.offsetWidth:window.innerWidth;var J=parseInt(jpf.getStyle(m.otPrevious,"width"));var K=parseInt(jpf.getStyle(m.otNext,"width"));var H=parseInt(jpf.getStyle(m.oEmpty,"width"));n=this.oCurtain.appendChild(this.oEmpty.cloneNode(true));jpf.xmldb.setNodeValue(n,M||"");n.setAttribute("id","empty"+this.uniqueId);n.style.display="block";n.style.left=((L-H)/2-J-K)+"px";jpf.setStyleClass(n,I,["ssloading","ssempty","offline"]);};this.$removeClearMessage=function(){if(!n){n=document.getElementById("empty"+this.uniqueId);}if(n&&n.parentNode){n.parentNode.removeChild(n);}};this.$setCurrentFragment=function(H){this.otBody.appendChild(H);this.dataset=H.dataset;if(!jpf.window.hasFocus(this)){this.blur();}};this.$getCurrentFragment=function(){var H=document.createDocumentFragment();while(this.otBody.childNodes.length){H.appendChild(this.otBody.childNodes[0]);}H.dataset=this.dataset;return H;};}).implement(jpf.Presentation,jpf.DataBinding,jpf.Cache,jpf.MultiselectBinding);jpf.submit=jpf.trigger=jpf.reset=jpf.button=jpf.component(jpf.NODE_VISIBLE,function(){var h;var c=this;this.$focussable=true;this.value=null;this.$booleanProperties["default"]=true;this.$supportedProperties.push("icon","value","tooltip","state","color","caption","action","target","default","submenu");this.$propHandlers.icon=function(u){if(!this.oIcon){return;}if(u){this.$setStyleClass(this.oExt,this.baseCSSname+"Icon");}else{this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Icon"]);}jpf.skins.setIcon(this.oIcon,u,this.iconPath);};this.$propHandlers.value=function(u){if(u===undefined){u=!this.value;}this.value=u;if(this.value){this.$setState("Down",{});}else{this.$setState("Out",{});}};this.$propHandlers.tooltip=function(u){this.oExt.setAttribute("title",u);};this.$propHandlers.state=function(u){this.$setStateBehaviour(u==1);};this.$propHandlers.color=function(u){if(this.oCaption){this.oCaption.parentNode.style.color=u;}};this.$propHandlers.caption=function(u){if(u){this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Empty"]);}else{this.$setStyleClass(this.oExt,this.baseCSSname+"Empty");}if(this.oCaption){this.oCaption.nodeValue=String(u||"").trim();}};var t;this.$propHandlers["default"]=function(u){if(!this.focussable&&u||t){this.setAttribute("focussable",t=u);}this.parentNode.removeEventListener("focus",q);this.parentNode.removeEventListener("blur",m);if(!u){return;}this.parentNode.addEventListener("focus",q);this.parentNode.addEventListener("blur",m);};function q(u){if(u.defaultButtonSet||u.returnValue===false){return;}u.defaultButtonSet=true;if(h){c.oExt.appendChild(jpf.button.$extradiv);}c.$setStyleClass(c.oExt,c.baseCSSname+"Default");if(u.srcElement!=c&&c.$focusParent){c.$focusParent.addEventListener("keydown",n);}}function m(u){if(h&&jpf.button.$extradiv.parentNode==c.oExt){c.oExt.removeChild(jpf.button.$extradiv);}c.$setStyleClass(c.oExt,"",[c.baseCSSname+"Default"]);if(u.srcElement!=c&&c.$focusParent){c.$focusParent.removeEventListener("keydown",n);}}function n(v){var w;var u=jpf.window.focussed;if(u){if(u.hasFeature(__MULTISELECT__)){return;}w=u.multiline;}if(w&&w!="optional"&&v.keyCode==13&&v.ctrlKey||(!w||w=="optional")&&v.keyCode==13&&!v.ctrlKey&&!v.shiftKey&&!v.altKey){c.oExt.onmouseup(v.htmlEvent,true);}}this.addEventListener("focus",q);this.addEventListener("blur",m);this.setValue=function(u){this.setProperty("value",u);};this.setCaption=function(u){this.setProperty("caption",u);};this.setIcon=function(u){this.setProperty("icon",u);};this.$enable=function(){if(this["default"]){q({});if(jpf.window.focussed){jpf.window.focussed.focus(true);}}if(this.state&&this.value){this.$setState("Down",{});}this.$doBgSwitch(1);};this.$disable=function(){if(this["default"]){m({});}this.$doBgSwitch(4);this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Over",this.baseCSSname+"Down"]);};this.$setStateBehaviour=function(u){this.value=u||false;this.isBoolean=true;this.$setStyleClass(this.oExt,this.baseCSSname+"Bool");if(this.value){this.$setStyleClass(this.oExt,this.baseCSSname+"Down");this.$doBgSwitch(this.states.Down);}};this.$setNormalBehaviour=function(){this.value=null;this.isBoolean=false;this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Bool"]);};this.$setState=function(v,y,w){if(this.disabled){return;}if(w&&this.dispatchEvent(w,{htmlEvent:y})===false){return;}this.$doBgSwitch(this.states[v]);var u=this.baseCSSname;this.$setStyleClass(this.oExt,(v!="Out"?u+v:""),[(this.value?"":u+"Down"),u+"Over"]);if(this.submenu){u=this.baseCSSname+"menu";this.$setStyleClass(this.oExt,(v!="Out"?u+v:""),[(this.value?"":u+"Down"),u+"Over"]);}};this.$clickHandler=function(){if(this.isBoolean&&!this.submenu){this.setProperty("value",!this.value);return true;}};this.$domHandlers.reparent.push(function(v,y,w){if(!this.$jmlLoaded){return;}var u;if(s&&!w&&this.skinName!=y.skinName||!s&&(u=this.parentNode.$getOption&&this.parentNode.$getOption("main","button-skin"))){s=true;this.$forceSkinChange(this.parentNode.skinName.split(":")[0]+":"+u);}});var a=false,s=false;this.$draw=function(){if(typeof this.focussable=="undefined"){if(this.parentNode.parentNode&&this.parentNode.parentNode.tagName=="toolbar"&&!this.$jml.getAttribute("focussable")){this.focussable=false;}}var u;if(this.parentNode&&(u=this.parentNode.$getOption&&this.parentNode.$getOption("main","button-skin"))){s=true;u=this.parentNode.skinName.split(":")[0]+":"+u;if(this.skinName!=u){this.$loadSkin(u);}this.$focussable=jpf.KEYBOARD;}else{if(s){s=false;this.$loadSkin();this.$focussable=true;}}this.oExt=this.$getExternal();this.oIcon=this.$getLayoutNode("main","icon",this.oExt);this.oCaption=this.$getLayoutNode("main","caption",this.oExt);h=jpf.isTrue(this.$getOption("main","extradiv"));if(!jpf.button.$extradiv&&h){(jpf.button.$extradiv=document.createElement("div")).className="extradiv";}if(this.tagName=="submit"){this.action="submit";}else{if(this.tagName=="reset"){this.action="reset";}}this.$setupEvents();};this.$skinchange=function(){if(this.caption){this.$propHandlers.caption.call(this,this.caption);}if(this.icon){this.$propHandlers.icon.call(this,this.icon);}this.$updateState({reset:1});};this.$loadJml=function(u){if(!this.caption&&u.firstChild){this.setProperty("caption",u.firstChild.nodeValue);}else{if(typeof this.caption=="undefined"){this.$propHandlers.caption.call(this,"");}}if(!a){jpf.JmlParser.parseChildren(this.$jml,null,this);a=true;}};this.addEventListener("click",function(v){var u=this.action;if(!u){u=this.tagName;}setTimeout(function(){(jpf.button.actions[u]||jpf.K).call(c);});});}).implement(jpf.Presentation,jpf.BaseButton);jpf.button.actions={undo:function(m){var h;if(this.target&&self[this.target]){h=self[this.target].getActionTracker();}else{var a,c=this;while(c.parentNode){a=(c=c.parentNode).$at;}}(h||jpf.window.$at)[m||"undo"]();},redo:function(){jpf.button.actions.undo.call(this,"redo");},remove:function(){if(this.target&&self[this.target]){self[this.target].remove();}},add:function(){if(this.target&&self[this.target]){self[this.target].add();}},rename:function(){if(this.target&&self[this.target]){self[this.target].startRename();}},submit:function(n){var a,c;var h=this.target&&self[this.target]?self[this.target]:this.parentNode;if(h.tagName=="model"){c=h;}else{if(!h.$validgroup){h.$validgroup=h.validgroup?self[h.validgroup]:new jpf.ValidationGroup();}a=h.$validgroup;if(!a.childNodes.length){a.childNodes=h.childNodes.slice();}function m(s){for(var u,t=0,q=s.length;t<q;t++){u=s[t];if(u.getModel){c=u.getModel();if(c){return false;}}if(u.childNodes.length){if(m(u.childNodes)===false){return false;}}}}m(h.childNodes);if(!c){return;}}if(n){c.reset();return;}if(a&&!a.isValid()){return;}c.submit();},reset:function(){jpf.button.actions.submit.call(this,true);},close:function(){var a=this.target&&self[this.target]?self[this.target]:this.parentNode;while(a&&!a.close){a=a.parentNode;}if(a&&a.close){a.close();}}};jpf.smartbinding=function(m,n,h){this.xmlbindings=null;this.xmlactions=null;this.xmldragdrop=null;this.bindings=null;this.actions=null;this.dragdrop=null;this.jmlNodes={};this.$modelXpath={};this.name=m;var c=this;this.tagName="smartbinding";this.nodeFunc=jpf.NODE_HIDDEN;this.parentNode=h;jpf.implement.call(this,jpf.JmlDom);var s={bindings:"loadBindings",actions:"loadActions",dragdrop:"loadDragDrop"};this.initialize=function(v,u){this.jmlNodes[v.uniqueId]=v;if(u){return v[s[u]](this[u],this["xml"+u]);}if(v.$jml&&this.name){v.$jml.setAttribute("smartbinding",this.name);}for(u in s){if(typeof s[u]!="string"){continue;}if(!this[u]){continue;}v[s[u]](this[u],this["xml"+u]);}if(this.model){this.model.register(v,this.$modelXpath[v.getHost?v.getHost().uniqueId:v.uniqueId]||this.modelBaseXpath);}else{if(v.$model&&(v.smartBinding&&v.smartBinding!=this)){v.$model.reloadJmlNode(v.uniqueId);}}return this;};this.deinitialize=function(u){this.jmlNodes[u.uniqueId]=null;delete this.jmlNodes[u.uniqueId];for(part in s){if(typeof s[part]!="string"){continue;}if(!this[part]){continue;}u["un"+s[part]]();}if(this.model){this.model.unregister(u);}};var t,a={};this.markForUpdate=function(v,u){(a[v.uniqueId]||(a[v.uniqueId]={}))[u||"all"]=v;if(!this.jmlNodes[v.uniqueId]){this.jmlNodes[v.uniqueId]=v;}if(!t){t=setTimeout(function(){c.$updateMarkedItems();});}return this;};this.$isMarkedForUpdate=function(u){return a[u.uniqueId]?true:false;};this.$updateMarkedItems=function(){clearTimeout(t);var w,u,v=a;t=null;a={};for(var y in v){if(!this.jmlNodes[y]){continue;}if(v[y]["all"]){w=v[y]["all"];for(part in s){if(!this[part]){continue;}w[s[part]](this[part],this["xml"+part]);}u=w.getModel();if(u){u.reloadJmlNode(w.uniqueId);}else{w.reload();}}else{for(part in v[y]){w=v[y][part];if(part=="model"){w.getModel().reloadJmlNode(w.uniqueId);continue;}w[s[part]](this[part],this["xml"+part]);if(part=="bindings"){w.reload();}}}}};this.addBindRule=function(u,v){var w=u[jpf.TAGNAME]=="ref"?v?v.mainBind:"value":u.tagName;if(!this.bindings){this.bindings={};}if(!this.bindings[w]){this.bindings[w]=[u];}else{this.bindings[w].push(u);}};this.addBindings=function(u){this.bindings=u;this.xmlbindings=n;if(!jpf.isParsing){}};this.addActionRule=function(u){var v=u[jpf.TAGNAME]=="action"?"Change":u.tagName;if(!this.actions){this.actions={};}if(!this.actions[v]){this.actions[v]=[u];}else{this.actions[v].push(u);}};this.addActions=function(v,u){this.actions=v;this.xmlactions=u;};this.addDropRule=this.addDragRule=function(u){if(!this.dragdrop){this.dragdrop={};}if(!this.dragdrop[u[jpf.TAGNAME]]){this.dragdrop[u[jpf.TAGNAME]]=[u];}else{this.dragdrop[u[jpf.TAGNAME]].push(u);}};this.addDragDrop=function(v,u){this.dragdrop=v;this.xmldragdrop=u;};this.setModel=function(v,u){if(typeof v=="string"){v=jpf.nameserver.get("model",v);}this.model=jpf.nameserver.register("model",this.name,v);this.modelBaseXpath=u;for(var w in this.jmlNodes){this.model.unregister(this.jmlNodes[w]);this.model.register(jmlNode,this.$modelXpath[jmlNode.getHost?jmlNode.getHost().uniqueId:jmlNode.uniqueId]||this.modelBaseXpath);}};this.load=function(u){this.setModel(new jpf.model().load(u));};var q={actions:"addActions",bindings:"addBindings",dragdrop:"addDragDrop"};this.loadJml=function(B){this.name=B.getAttribute("id");this.$jml=B;var z,u=B.attributes,v=u.length;for(var A=0;A<v;A++){z=u[A].nodeName;if(z=="model"){continue;}if(!q[z]){continue;}var y=jpf.nameserver.get(z,u[A].nodeValue);this[q[z]](jpf.getRules(y),y);}var C,w=B.childNodes;for(var A=0;A<w.length;A++){if(w[A].nodeType!=1){continue;}switch(w[A][jpf.TAGNAME]){case"model":C=w[A];break;case"bindings":this.addBindings(jpf.getRules(w[A]),w[A]);break;case"actions":this.addActions(jpf.getRules(w[A]),w[A]);break;case"dragdrop":this.addDragDrop(jpf.getRules(w[A]),w[A]);break;case"ref":this.addBindRule(w[A]);break;case"action":this.addActionRule(w[A]);break;default:throw new Error(jpf.formatErrorString(1039,this,"setSmartBinding Method","Could not find handler for '"+w[A].tagName+"' node."));break;}}if(C){this.setModel(new jpf.model().loadJml(C));}else{if(B.getAttribute("model")){jpf.setModel(B.getAttribute("model"),this);}}};if(n){this.loadJml(n);}};jpf.text=jpf.component(jpf.NODE_VISIBLE,function(){this.$focussable=true;this.focussable=false;this.$hasStateMessages=true;var a=this;this.$booleanProperties.scrolldown=true;this.$booleanProperties.secure=true;this.$supportedProperties.push("behavior","scrolldown","secure","value");this.$propHandlers.behavior=function(h){this.addOnly=h=="addonly";};this.$propHandlers.value=function(m){var h=false;if(m){this.$removeClearMessage();}if(typeof m!="string"){m=m?m.toString():"";}if(this.secure){m=m.replace(/<a /gi,"<a target='_blank' ").replace(/<object.*?\/object>/g,"").replace(/<script.*?\/script>/g,"").replace(new RegExp("ondblclick|onclick|onmouseover|onmouseout|onmousedown|onmousemove|onkeypress|onkeydown|onkeyup|onchange|onpropertychange","g"),"ona");}if(this.addOnly){if(h){h.contents+=m;}else{this.oInt.insertAdjacentHTML("beforeend",m);}}else{m=m.replace(/\<\?xml version="1\.0" encoding="UTF-16"\?\>/,"");if(h){h.contents=m;}else{this.oInt.innerHTML=m;}}if(jpf.cannotSizeIframe&&this.oIframe){this.oIframe.style.width=this.oIframe.offsetWidth+"px";}if(this.scrolldown&&this.$scrolldown){this.oScroll.scrollTop=this.oScroll.scrollHeight;}};this.setValue=function(h){this.setProperty("value",h);};this.getValue=function(){return this.oInt.innerHTML;};this.addEventListener("keydown",function(n){var m=n.keyCode;var q=n.ctrlKey;var h=n.shiftKey;switch(m){case 33:this.oInt.scrollTop-=this.oInt.offsetHeight;break;case 34:this.oInt.scrollTop+=this.oInt.offsetHeight;break;case 35:this.oInt.scrollTop=this.oInt.scrollHeight;break;case 36:this.oInt.scrollTop=0;break;case 38:this.oInt.scrollTop-=10;break;case 40:this.oInt.scrollTop+=10;break;default:return;}return false;},true);this.$xmlUpdate=function(s,m,q,n){if(this.addOnly&&s!="add"){return;}if(n){n.xmlNode=this.addOnly?m:this.xmlRoot;}if(this.addOnly){jpf.xmldb.nodeConnect(this.documentId,m,null,this);var h=this.getNodeFromCache(q.getAttribute("id")+"|"+this.uniqueId);this.$propHandlers.value.call(this,this.applyRuleSetOnNode("value",m)||"");}else{this.$propHandlers.value.call(this,this.applyRuleSetOnNode("value",this.xmlRoot)||"");}};this.$load=function(m){jpf.xmldb.addNodeListener(m,this);var n=this.applyRuleSetOnNode("value",m);if(n||typeof n=="string"){if(this.caching){var h=this.getNodeFromCache(m.getAttribute("id")+"|"+this.uniqueId);if(h){h.contents=n;}}this.$propHandlers.value.call(this,n);}else{this.$propHandlers.value.call(this,"");}};this.$getCurrentFragment=function(){return{nodeType:1,contents:this.oInt.innerHTML};};this.$setCurrentFragment=function(h){this.oInt.innerHTML=h.contents;if(this.scrolldown){this.oInt.scrollTop=this.oInt.scrollHeight;}};this.$findNode=function(h,m){m=m.split("|");if((h?h:this).xmlRoot.selectSingleNode("descendant-or-self::node()[@id='"+(m[0]+"|"+m[1])+"']")){return(h?h:null);}return false;};var c;this.$setClearMessage=this.$updateClearMessage=function(h){this.$setStyleClass(this.oExt,this.baseCSSname+"Empty");if(h){this.oInt.innerHTML=h;c=this.oInt.innerHTML;}};this.$removeClearMessage=function(){this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Empty"]);if(this.oInt.innerHTML==c){this.oInt.innerHTML="";}};this.$clear=function(){this.setProperty("value","");};this.caching=false;this.$draw=function(){this.oExt=this.$getExternal();this.oInt=this.$getLayoutNode("main","container",this.oExt);if(jpf.hasCssUpdateScrollbarBug&&!jpf.getStyle(this.oInt,"padding")){this.$fixScrollBug();}this.oScroll=this.oFocus?this.oFocus.parentNode:this.oInt;this.$scrolldown=true;this.oScroll.onscroll=function(){a.$scrolldown=this.scrollTop>=this.scrollHeight-this.offsetHeight+jpf.getVerBorders(this);};setInterval(function(){if(a.$scrolldown&&a.scrolldown){a.oScroll.scrollTop=a.oScroll.scrollHeight;}},60);if(this.oInt.tagName.toLowerCase()=="iframe"){if(jpf.isIE){this.oIframe=this.oInt;var m=this.skin.selectSingleNode("iframe_style");this.oIframe.contentWindow.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><head><style>'+(m?m.firstChild.nodeValue:"")+"</style><script>document.onkeydown = function(e){if (!e) e = event;if (top.jpf.disableF5 && e.keyCode == 116) {e.keyCode = 0;return false;}}<\/script></head><body oncontextmenu='return false'></body>");this.oInt=this.oIframe.contentWindow.document.body;}else{var h=document.createElement("div");this.oExt.parentNode.replaceChild(h,this.oExt);h.className=this.oExt.className;this.oExt=this.oInt=h;}}else{this.oInt.onselectstart=function(n){(n?n:event).cancelBubble=true;};this.oInt.oncontextmenu=function(n){if(!this.host.contextmenus){(n?n:event).cancelBubble=true;}};this.oInt.style.cursor="";this.oInt.onmouseover=function(n){if(!self.STATUSBAR){return;}if(!n){n=event;}if(n.srcElement.tagName.toLowerCase()=="a"){if(!this.lastStatus){this.lastStatus=STATUSBAR.getStatus();}STATUSBAR.status("icoLink.gif",n.srcElement.getAttribute("href"));}else{if(this.lastStatus){STATUSBAR.status(this.lastStatus[0],this.lastStatus[1]);this.lastStatus=false;}}};}};this.$loadJml=function(h){this.caching=false;if(this.emptyMsg&&!this.childNodes.length){this.$setClearMessage(this.emptyMsg);}if(jpf.xmldb.isOnlyChild(h.firstChild,[3,4])){this.$handlePropSet("value",h.firstChild.nodeValue.trim());}else{jpf.JmlParser.parseChildren(this.$jml,null,this);}};this.$destroy=function(){jpf.removeNode(this.oDrag);this.oDrag=null;this.oIframe=null;this.oScroll.onscoll=null;this.oScroll=null;this.oFocus=null;};}).implement(jpf.Cache,jpf.BaseSimple);jpf.range=jpf.slider=jpf.component(jpf.NODE_VISIBLE,function(){this.$focussable=true;var a=this;var c=false;this.disabled=false;this.realtime=true;this.value=0;this.mask="%";this.min=0;this.max=1;this.$supportedProperties.push("step","mask","min","max","slide","value");this.$booleanProperties.realtime=true;this.$propHandlers.step=function(s){this.step=parseInt(s)||0;if(!this.$hasLayoutNode("marker")){return;}var u=this.oMarkers.childNodes;for(var n=u.length-1;n>=0;n--){if(u[n].nodeType==1){jpf.removeNode(u[n]);}}if(this.step){var m,q=(this.max-this.min)/this.step;for(var t,h=[],n=0;n<q+1;n++){this.$getNewContext("marker");t=this.$getLayoutNode("marker");m=Math.max(0,(n*(1/q)*100)-1);t.setAttribute("style","left:"+m+"%");h.push(t);}jpf.xmldb.htmlImport(h,this.oMarkers);}};this.$propHandlers.mask=function(h){if(!h){this.mask="%";}if(!this.mask.match(/^(%|#)$/)){this.mask=h.split("|");}};this.$propHandlers.progress=function(h){if(!this.oProgress){this.oProgress=jpf.xmldb.htmlImport(this.$getLayoutNode("progress"),this.$getLayoutNode("main","progress",this.oExt));}this.oProgress.style.width=((h||0)*100)+"%";};this.$propHandlers.min=function(h){this.min=parseInt(h)||0;};this.$propHandlers.max=function(h){this.max=parseInt(h)||1;};this.$propHandlers.slide=function(h){this.slideDiscreet=h=="discrete";this.slideSnap=h=="snap";};this.$propHandlers.value=function(s,q,v,m){if(!this.$dir){return;}if(c&&!q){return;}this.value=Math.max(this.min,Math.min(this.max,s))||0;var h,n,t,u=(this.value-this.min)/(this.max-this.min);if(this.$dir=="horizontal"){h=(this.oContainer.offsetWidth-jpf.getWidthDiff(this.oContainer))-this.oKnob.offsetWidth;n=parseInt(jpf.getBox(jpf.getStyle(this.oContainer,"padding"))[3]);t=(((h-n)*u)+n);if(m){jpf.tween.single(this.oKnob,{type:"left",steps:5,interval:10,from:this.oKnob.offsetLeft,to:t,anim:jpf.tween.NORMAL,oneach:function(w){if(a.oFill){a.oFill.style.width=(w.offsetLeft+3)+"px";}}});}else{this.oKnob.style.left=t+"px";if(this.oFill){this.oFill.style.width=(t+3)+"px";}}}else{h=(this.oContainer.offsetHeight-jpf.getHeightDiff(this.oContainer))-this.oKnob.offsetHeight;n=parseInt(jpf.getBox(jpf.getStyle(this.oContainer,"padding"))[0]);t=(((h-n)*(1-u))+n);if(m){jpf.tween.single(this.oKnob,{type:"top",steps:5,interval:10,from:this.oKnob.offsetTop,to:t,anim:jpf.tween.NORMAL,oneach:function(w){if(a.oFill){a.oFill.style.height=(w.offsetTop+3)+"px";}}});}else{this.oKnob.style.top=t+"px";if(this.oFill){this.oFill.style.height=(t+3)+"px";}}}if(this.oLabel){if(this.mask=="%"){this.oLabel.nodeValue=Math.round(u*100)+"%";}else{if(this.mask=="#"){this.oLabel.nodeValue=this.step?(Math.round(this.value/this.step)*this.step):this.value;}else{this.oLabel.nodeValue=this.mask[Math.round(this.value-this.min)/(this.step||1)];}}}};this.setValue=function(h,m){this.$onlySetXml=m;this.setProperty("value",h);this.$onlySetXml=false;};this.getValue=function(){return this.step?Math.round(parseInt(this.value)/this.step)*this.step:this.value;};this.addEventListener("keydown",function(n){var m=n.keyCode;var q=n.ctrlKey;var h=n.shiftKey;switch(m){case 37:if(this.$dir!="horizontal"){return;}this.setValue(this.value-(q?0.01:0.1));break;case 38:if(this.$dir!="vertical"){return;}this.setValue(this.value+(q?0.01:0.1));break;case 39:if(this.$dir!="horizontal"){return;}this.setValue(this.value+(q?0.01:0.1));break;case 40:if(this.$dir!="vertical"){return;}this.setValue(this.value-(q?0.01:0.1));break;default:return;}return false;},true);this.$draw=function(){this.oExt=this.$getExternal();this.oLabel=this.$getLayoutNode("main","status",this.oExt);this.oMarkers=this.$getLayoutNode("main","markers",this.oExt);this.oKnob=this.$getLayoutNode("main","slider",this.oExt);this.oFill=this.$getLayoutNode("main","fill",this.oExt);this.oInt=this.oContainer=this.$getLayoutNode("main","container",this.oExt);this.$dir=this.$getOption("main","direction")||"horizontal";this.oKnob.style.left=(parseInt(jpf.getBox(jpf.getStyle(this.oExt,"padding"))[3]))+"px";function m(n){this.x=(n.clientX||n.x);this.y=(n.clientY||n.y);this.stX=this.offsetLeft;this.siX=this.offsetWidth;this.stY=this.offsetTop;this.siY=this.offsetheight;this.startValue=a.value;if(a.$dir=="horizontal"){this.max=parseInt(jpf.getStyle(a.oContainer,"width"))-this.offsetWidth;this.min=parseInt(jpf.getBox(jpf.getStyle(a.oContainer,"padding"))[3]);}else{this.max=parseInt(jpf.getStyle(a.oContainer,"height"))-this.offsetHeight;this.min=parseInt(jpf.getBox(jpf.getStyle(a.oContainer,"padding"))[0]);}}function h(s,q,u){var t=(a.$dir=="horizontal")?(q.clientX||q.x)-s.x+s.stX:(q.clientY||q.y)-s.y+s.stY;t=(t>s.max?s.max:(t<s.min?s.min:t));var n=(((t-s.min)*100/(s.max-s.min)/100)*(a.max-a.min))+a.min;n=u?(Math.round(n/u)*u):n;n=(a.$dir=="horizontal")?n:1-n;return n;}this.oKnob.onmousedown=function(n){if(a.disabled){return false;}n=n||window.event;document.dragNode=this;m.call(this,n);a.$setStyleClass(this,"btndown",["btnover"]);jpf.dragmode.mode=true;c=true;document.onmousemove=function(q){q=q||window.event;var s=this.dragNode;if(!s){jpf.dragmode.mode=document.onmousemove=document.onmouseup=null;return;}if(a.realtime){a.value=-1;a.setValue(h(s,q,a.slideDiscreet));}a.$propHandlers.value.call(a,h(s,q,a.slideDiscreet),true);};document.onmouseup=function(q){var s=this.dragNode;this.dragNode=null;s.onmouseout();c=false;a.$ignoreSignals=a.realtime;a.setValue(h(s,q||window.event,a.slideDiscreet||a.slideSnap));a.$ignoreSignals=false;jpf.dragmode.mode=document.onmousemove=document.onmouseup=null;};return false;};this.oKnob.onmouseup=this.oKnob.onmouseover=function(){if(document.dragNode!=this){a.$setStyleClass(this,"btnover",["btndown"]);}};this.oKnob.onmouseout=function(){if(document.dragNode!=this){a.$setStyleClass(this,"",["btndown","btnover"]);}};this.oExt.onmousedown=function(s){s=s||window.event;var t=a.oKnob;if((s.srcElement||s.target)!=t){var q=jpf.getAbsolutePosition(t);m.call(t,{x:q[0]+t.offsetWidth/2,y:q[1]+t.offsetHeight/2});var n=h(t,s,a.slideDiscreet||a.slideSnap);a.$propHandlers.value.call(a,h(t,s,a.slideDiscreet),true,null,true);a.setValue(n);}};jpf.layout.setRules(this.oExt,"knob","var o = jpf.all["+this.uniqueId+"];o.$propHandlers.value.call(o, o.value);",true);};this.$loadJml=function(h){this.$propHandlers.value.call(this,this.value);jpf.JmlParser.parseChildren(this.$jml,null,this);};this.$destroy=function(){this.oKnob.onmousedown=this.oKnob.onmouseup=this.oKnob.onmouseover=this.oKnob.onmouseout=null;};}).implement(jpf.DataBinding,jpf.Validation,jpf.Presentation);jpf.StateServer={states:{},groups:{},locs:{},removeGroup:function(a,c){this.groups[a].remove(c);if(!this.groups[a].length){if(self[a]){self[a].destroy();self[a]=null;}delete this.groups[a];}},addGroup:function(c,m,h){if(!this.groups[c]){this.groups[c]=[];var a=new jpf.state(null,"state");a.parentNode=h;a.implement(jpf.JmlDom);a.name=c;a.toggle=function(){for(var q=0,n=0;n<jpf.StateServer.groups[c].length;n++){if(jpf.StateServer.groups[c][n].active){q=n+1;break;}}jpf.StateServer.groups[c][(q==jpf.StateServer.groups[c].length)?0:q].activate();};this.groups[c].pState=self[c]=a;}if(m){this.groups[c].push(m);}return this.groups[c].pState;},removeState:function(a){delete this.states[a.name];},addState:function(a){this.states[a.name]=a;}};jpf.state=jpf.component(jpf.NODE_HIDDEN,function(){this.$supportedProperties.push("active");this.$propHandlers.active=function(n){if(jpf.isTrue(n)){if(this.group){var c=jpf.StateServer.groups[this.group];for(var h=0;h<c.length;h++){if(c[h]!=this&&c[h].active!==false){c[h].deactivate();}}}var m=this.$signalElements;for(var h=0;h<m.length;h++){if(!self[m[h][0]]||!self[m[h][0]].setProperty){continue;}self[m[h][0]].setProperty(m[h][1],this[m[h].join(".")]);}if(this.group){var a=this.$jml.attributes;for(var h=0;h<a.length;h++){if(a[h].nodeName.match(/^on|^(?:group|id)$|^.*\..*$/)){continue;}self[this.group].setProperty(a[h].nodeName,a[h].nodeValue);}}this.dispatchEvent("change");}else{this.setProperty("active",false);this.dispatchEvent("change");}};this.setValue=function(a){this.active=9999;this.setProperty("active",a);};this.activate=function(){this.active=9999;this.setProperty("active",true);};this.deactivate=function(){this.setProperty("active",false);};this.$signalElements=[];this.$loadJml=function(c){jpf.StateServer.addState(this);this.group=c.getAttribute("group");if(this.group){jpf.StateServer.addGroup(this.group,this);}if(c.getAttribute("location")){jpf.StateServer.locs[c.getAttribute("location")]=this;}var a=c.attributes;for(var m,h=0;h<a.length;h++){if(a[h].nodeName.match(/^on|^(?:group|id)$/)){continue;}m=a[h].nodeName.split(".");if(m.length==2){this.$signalElements.push(m);}this[a[h].nodeName]=a[h].nodeValue;}};this.$destroy=function(){this.$signalElements=null;jpf.StateServer.removeState(this);if(this.group){jpf.StateServer.removeGroup(this.group,this);}};});jpf.checkbox=jpf.component(jpf.NODE_VISIBLE,function(){this.$notfromext=true;this.$focussable=true;this.checked=false;this.$booleanProperties.checked=true;this.$supportedProperties.push("value","checked","label","values");this.$propHandlers.value=function(a){a=(typeof a=="string"?a.trim():a);this.checked=(a!==undefined&&a.toString()==this.$values[0].toString());if(!jpf.isNull(a)&&a.toString()==this.$values[0].toString()){this.$setStyleClass(this.oExt,this.baseCSSname+"Checked");}else{this.$setStyleClass(this.oExt,"",[this.baseCSSname+"Checked"]);}};this.$propHandlers.checked=function(a){if(!this.$values){if(this.$jml.getAttribute("values")){this.$propHandler.values.call(this,this.$jml.getAttribute("values"));}else{this.$values=[false,true];}}this.setProperty("value",this.$values[a?0:1]);};this.$propHandlers.label=function(a){jpf.xmldb.setNodeValue(this.$getLayoutNode("main","label",this.oExt),a);};this.$propHandlers.values=function(a){this.$values=typeof a=="string"?a.split("|"):(a||[1,0]);};this.setValue=function(a){if(!this.$values){return;}this.setProperty("value",a);};this.getValue=function(){return this.xmlRoot?this.$values[this.checked?0:1]:this.value;};this.check=function(){this.setProperty("value",this.$values[0]);};this.uncheck=function(){this.setProperty("value",this.$values[1]);};this.$clear=function(){this.setProperty("value",this.$values[1]);};this.$enable=function(){if(this.oInt){this.oInt.disabled=false;}this.$doBgSwitch(1);};this.$disable=function(){if(this.oInt){this.oInt.disabled=true;}this.$doBgSwitch(4);};this.$setState=function(a,h,c){if(this.disabled){return;}this.$doBgSwitch(this.states[a]);this.$setStyleClass(this.oExt,(a!="Out"?this.baseCSSname+a:""),[this.baseCSSname+"Down",this.baseCSSname+"Over"]);this.state=a;this.dispatchEvent(c,h);};this.$clickHandler=function(){this.change(this.$values[(!this.checked)?0:1]);this.validate(true);return true;};this.$draw=function(){this.oExt=this.$getExternal();this.oInt=this.$getLayoutNode("main","input",this.oExt);this.$setupEvents();};this.$loadJml=function(a){if(!this.label&&a.firstChild){this.setProperty("label",a.firstChild.nodeValue);}if(this.$values===undefined){this.$values=[1,0];}};this.$skinchange=function(){if(this.label){this.$propHandlers.label.call(this,this.label);}};}).implement(jpf.Validation,jpf.DataBinding,jpf.Presentation,jpf.BaseButton);jpf.appsettings={tagName:"appsettings",nodeType:jpf.NODE_ELEMENT,nodeFunc:jpf.NODE_HIDDEN,disableRightClick:false,allowSelect:false,allowBlur:false,autoDisableActions:false,autoDisable:false,disableF5:true,autoHideLoading:true,disableSpace:true,disableBackspace:true,useUndoKeys:false,outline:false,dragOutline:false,resizeOutline:false,disableTabbing:false,resourcePath:null,skinset:"default",name:"",tags:{},defaults:{},baseurl:"",init:function(){},getDefault:function(c,m){var h=this.defaults[c];if(!h){return;}for(var a=h.length-1;a>=0;a--){if(h[a][0]==m){return h[a][1];}}},setProperty:function(a,c){if(a=="outline"){this.dragOutline=this.resizeOutline=this.outline=c;}else{if(a=="skinset"){this.skinset=c;jpf.skins.changeSkinset(c);}}},loadJml:function(w,s){this.$jml=w;this.parentNode=s;jpf.implement.call(this,jpf.JmlDom);jpf.debug=jpf.isTrue(w.getAttribute("debug"));if(w.getAttribute("debug-type")){jpf.debugType=w.getAttribute("debug-type");}var a=w.attributes;for(var q=0,m=a.length;q<m;q++){this.tags[a[q].nodeName]=a[q].nodeValue;}this.name=w.getAttribute("name")||window.location.href.replace(/[^0-9A-Za-z_]/g,"_");this.baseurl=jpf.parseExpression(w.getAttribute("baseurl")||"");this.resourcePath=jpf.parseExpression(w.getAttribute("resource-path")||"").replace(/resources\/?/,"");if(this.resourcePath&&this.resourcePath.charAt(this.resourcePath.length-1)!="/"){this.resourcePath=this.resourcePath+"/";}this.disableRightClick=jpf.isTrue(w.getAttribute("disable-right-click"));this.allowSelect=jpf.isTrue(w.getAttribute("allow-select"));this.allowBlur=!jpf.isFalse(w.getAttribute("allow-blur"));this.autoDisableActions=jpf.isTrue(w.getAttribute("auto-disable-actions"));this.autoDisable=jpf.isTrue(w.getAttribute("auto-disable"));this.disableF5=jpf.isTrue(w.getAttribute("disable-f5"));this.autoHideLoading=!jpf.isFalse(w.getAttribute("auto-hide-loading"));this.disableSpace=!jpf.isFalse(w.getAttribute("disable-space"));this.disableBackspace=jpf.isTrue(w.getAttribute("disable-backspace"));this.useUndoKeys=jpf.isTrue(w.getAttribute("undokeys"));this.queryAppend=w.getAttribute("query-append");if(w.getAttribute("outline")){this.dragOutline=this.resizeOutline=this.outline=jpf.isTrue(jpf.parseExpression(w.getAttribute("outline")));}else{this.dragOutline=w.getAttribute("drag-outline")?jpf.isTrue(jpf.parseExpression(w.getAttribute("drag-outline"))):false;this.resizeOutline=w.getAttribute("resize-outline")?!jpf.isFalse(jpf.parseExpression(w.getAttribute("resize-outline"))):false;}this.layout=w.getAttribute("layout")||null;this.skinset=w.getAttribute("skinset")||"default";this.storage=w.getAttribute("storage")||null;if(this.storage){jpf.storage.init(this.storage);}var v,t,u,n,q,m,h,a=w.childNodes;for(q=0,m=a.length;q<m;q++){h=a[q];if(h.nodeType!=1){continue;}var c=h[jpf.TAGNAME];switch(c){case"printer":jpf.printer.init(h);break;case"defaults":v=h.getAttribute("for");t=h.attributes;u=this.defaults[v]=[];for(n=t.length-1;n>=0;n--){u.push([t[n].nodeName,t[n].nodeValue]);}break;default:break;}}return this;}};jpf.fieldset=jpf.frame=jpf.component(jpf.NODE_VISIBLE,function(){this.canHaveChildren=true;this.$focussable=false;this.$supportedProperties.push("caption");this.$propHandlers.caption=function(a){if(this.oCaption){this.oCaption.nodeValue=a;}};this.setTitle=function(a){this.setProperty("title",a);};this.$draw=function(){this.oExt=this.$getExternal();this.oCaption=this.$getLayoutNode("main","caption",this.oExt);var a=this.$getLayoutNode("main","container",this.oExt);this.oInt=this.oInt?jpf.JmlParser.replaceNode(a,this.oInt):jpf.JmlParser.parseChildren(this.$jml,a,this);};this.$loadJml=function(a){};}).implement(jpf.Presentation);jpf.modalwindow.widget=function(){var s,q,c,n,h;var a=this;this.dragStart=function(y){if(!y){y=event;}s=a.oExt.offsetLeft-y.clientX;q=a.oExt.offsetTop-y.clientY;var u=a.oExt;var w=a.positionHolder;w.className="position_holder";u.parentNode.insertBefore(w,u);w.style.height=(u.offsetHeight-(jpf.isIE6?0:13))+"px";var v=jpf.getDiff(u);var t=[u.style.width,u.style.height];u.style.width=(u.offsetWidth-v[0])+"px";u.style.left=(y.clientX-s)+"px";u.style.top=(y.clientY-q)+"px";u.style.position="absolute";u.style.zIndex=u.parentNode.style.zIndex=100000;u.parentNode.style.position="relative";u.parentNode.style.left="0";jpf.Animate.fade(u,0.8);jpf.dragmode.mode=true;h=[u,w];document.onmousemove=a.dragMove;document.onmouseup=function(){document.onmousemove=document.onmouseup=null;u.style.position="";u.style.left=0;u.style.top=0;u.style.width=t[0];u.style.zIndex=u.parentNode.style.zIndex=1;w.parentNode.insertBefore(u,w);w.parentNode.removeChild(w);jpf.Animate.fade(u,1);var A=a.getElementsByTagName("datagrid");for(var z=0;z<A.length;z++){A[z].updateWindowSize(true);}jpf.dragmode.mode=null;};y.cancelBubble=true;return false;};function m(v,B){var C=jpf.getAbsolutePosition(v);var y=B-C[1];var t=v.childNodes;for(var u=0,A=0,z=t.length;A<z;A++){var w=t[A];if(w.nodeType!=1||jpf.getStyle(w,"position")=="absolute"){continue;}u=w.offsetTop+w.offsetHeight;if(u>y){v.insertBefore(h[1],u-(w.offsetHeight/2)>y?w:w.nextSibling);}}if(A==t.length){v.appendChild(h[1]);}}this.dragMove=function(w){if(!w){w=event;}a.oExt.style.top="10000px";var u=w.clientX+document.documentElement.scrollLeft;var t=w.clientY+document.documentElement.scrollTop;var v=document.elementFromPoint(u,t);if(v.isColumn){m(v,t);}else{while(v.parentNode&&!v.isColumn){v=v.parentNode;}if(v.isColumn){m(v,t);}}a.oExt.style.left=(w.clientX-s)+"px";a.oExt.style.top=(w.clientY-q)+"px";w.cancelBubble=true;};this.$loadJml=function(t){jpf.WinServer.setTop(this);var z=jpf.getDiff(this.oExt);n=z[0];c=z[1];var w=this.$getLayoutNode("main","container",this.oExt);var y=this.$getLayoutNode("main","settings_content",this.oExt);this.positionHolder=document.body.appendChild(document.createElement("div"));var v=$xmlns(this.$jml,"config",jpf.ns.jml)[0];if(v){v.parentNode.removeChild(v);}var u=$xmlns(this.$jml,"body",jpf.ns.jml)[0];u.parentNode.removeChild(u);jpf.JmlParser.parseChildren(this.$jml,null,this);if(v){this.$jml.appendChild(v);}this.$jml.appendChild(u);if(y&&v){this.oSettings=this.oSettings?jpf.JmlParser.replaceNode(y,this.oSettings):jpf.JmlParser.parseChildren(v,y,this,true);}this.oInt=this.oInt?jpf.JmlParser.replaceNode(w,this.oInt):jpf.JmlParser.parseChildren(u,w,this,true);if(u.getAttribute("class")){this.$setStyleClass(this.oInt,u.getAttribute("class"));}this.oDrag.onmousedown=this.dragStart;if(this.resizable){this.resizable=false;}if(this.draggable===undefined){this.draggable=true;}this.minwidth=this.$getOption("Main","min-width");this.minheight=this.$getOption("Main","min-height");};};jpf.textbox.masking=function(){var n=9128748732;var C={"0":"\\d","1":"[12]","9":"[\\d ]","#":"[\\d +-]",L:"[A-Za-z]","?":"[A-Za-z ]",A:"[A-Za-z0-9]",a:"[A-Za-z0-9 ]",X:"[0-9A-Fa-f]",x:"[0-9A-Fa-f ]","&":"[^s]",C:"."};var w=-1;var c=false;var h=this.oExt;var u,v=[],a,A,B,m;this.setPosition=function(D){z(D||w||0);};this.$clear=function(){this.value="";if(this.mask){return this.setValue("");}};this.$propHandlers.value=function(F){var E="";if(this.includeNonTypedChars){for(var D=0;D<u.length;D++){if(u.substr(D,1)!=F.substr(D,1)){E+=F.substr(D,1);}}}this.$insertData(E||F);};this.addEventListener("keydown",function(G){var E=G.keyCode,D=false;switch(E){case 39:z(w+1);D=true;break;case 37:z(w-1);D=true;break;case 35:case 34:z(a.length);D=true;break;case 33:case 36:z(0);D=true;break;case 8:t(w-1);z(w-1);D=true;break;case 46:t(w);z(w);D=true;break;default:if(E==67&&G.ctrlKey){window.clipboardData.setData("Text",this.getValue());D=true;}break;}var F=String.fromCharCode(E);if(y(F)){z(w+1);}if(G.isCharacter()||D){return false;}},true);this.$initMasking=function(){this.$keyHandler=null;c=true;this.oInt[jpf.isIphone?"onclick":"onmouseup"]=function(D){var E=Math.min(s(),a.length);z(E);return false;};this.oInt.onpaste=function(D){D=D||window.event;D.returnValue=false;this.host.setValue(window.clipboardData.getData("Text")||"");setTimeout(function(){z(w);},1);};this.getValue=function(){if(this.includeNonTypedChars){return u==this.oInt.value?"":this.oInt.value.replace(new RegExp(m,"g"),"");}else{return a.join("");}};this.setValue=function(F){if(this.includeNonTypedChars){for(var E="",D=0;D<u.length;D++){if(u.substr(D,1)!=F.substr(D,1)){E+=F.substr(D,1);}}}this.$insertData(E);};};this.setMask=function(G){if(!c){this.$initMasking();}G=G.split(";");m=G.pop();this.includeNonTypedChars=parseInt(G.pop())!==0;var M=G.join("");var H="",D="",F="-",L=false,E=false,I;v=[],A="",B="";for(var K=-1,J=0;J<M.length;J++){I=M.substr(J,1);if(!I.match(/[\!\'\"\>\<\\]/)){K++;}else{if(I=="!"){E=true;}else{if(I=="<"||I==">"){F=I;}else{if(I=="'"||I=='"'){L=!L;}}}continue;}if(!L&&C[I]){v.push(K);D+=m;A+=I;B+=F;H+=C[I];}else{D+=I;}}this.oInt.value=D;u=D;a=[];m=m;};function q(D,F){var E=A.substr(F,1);var G=B.substr(F,1);if(D.match(new RegExp(C[E]))==null){return n;}if(G==">"){return D.toUpperCase();}if(G=="<"){return D.toLowerCase();}return D;}function z(E){if(E<0){E=0;}if(jpf.hasMsRangeObject){var D=h.createTextRange();D.expand("textedit");D.select();if(v[E]==null){D.collapse(false);D.select();w=v.length;return false;}D.collapse();D.moveStart("character",v[E]);D.moveEnd("character",1);D.select();}else{if(typeof v[E]=="undefined"){h.selectionStart=h.selectionEnd=v[v.length-1]+1;w=v.length;return false;}h.selectionStart=v[E];h.selectionEnd=v[E]+1;}w=E;}function y(F){if(v[w]==null){return false;}F=q(F,w);if(F==n){return false;}if(jpf.hasMsRangeObject){var E=h.createTextRange();E.expand("textedit");E.collapse();E.moveStart("character",v[w]);E.moveEnd("character",1);E.text=F;if(jpf.window.focussed==this){E.select();}}else{var G=h.value,H=h.selectionStart,D=h.selectionEnd;h.value=G.substr(0,H)+F+G.substr(D);h.selectionStart=H;h.selectionEnd=D;}a[w]=F;return true;}function t(F){if(v[F]==null){return false;}if(jpf.hasMsRangeObject){var E=h.createTextRange();E.expand("textedit");E.collapse();E.moveStart("character",v[F]);E.moveEnd("character",1);E.text=m;E.select();}else{var G=h.value,H=v[F],D=v[F]+1;h.value=G.substr(0,H)+m+G.substr(D);h.selectionStart=H;h.selectionEnd=D;}a[F]=" ";}this.$insertData=function(I){if(I==this.getValue()){return;}var F,D;try{if(!jpf.hasMsRangeObject&&h.selectionStart==h.selectionEnd){z(0);}}catch(E){if(!I){return;}var G,H;for(F=0,D=I.length;F<D;F++){w=F;if(v[w]==null){continue;}G=q(I.substr(F,1),F);if(G==n){continue;}H=h.value;h.value=H.substr(0,v[F])+G+H.substr(v[F]+1);}if(I.length){w++;}return;}I=this.dispatchEvent("insert",{data:I})||I;if(!I){if(!this.getValue()){return;}for(F=this.getValue().length-1;F>=0;F--){t(F);}z(0);return;}for(F=0,D=I.length;F<D;F++){w=F;y(I.substr(F,1));if(!jpf.hasMsRangeObject){z(F+1);}}if(I.length){w++;}};function s(){var F,D=0;if(!jpf.hasMsRangeObject){D=h.selectionStart;}else{F=document.selection.createRange();var E=F.duplicate();E.expand("textedit");E.setEndPoint("EndToStart",F);D=E.text.length;}for(var G=0;G<v.length;G++){if(v[G]>D){return(G==0)?0:G-1;}}return a.length;}};jpf.textbox.autocomplete=function(){var a={};this.initAutocomplete=function(c){c.parentNode.removeChild(c);a.nodeset=c.getAttribute("nodeset").split(":");a.method=c.getAttribute("method");a.value=c.getAttribute("value");a.count=parseInt(c.getAttribute("count"))||5;a.sort=c.getAttribute("sort");a.lastStart=-1;this.oContainer=jpf.xmldb.htmlImport(this.$getLayoutNode("container"),this.oExt.parentNode,this.oExt.nextSibling);};this.fillAutocomplete=function(v){if(v){switch(v){case 9:case 27:case 13:return this.oContainer.style.display="none";case 40:if(a.suggestData&&a.lastStart<a.suggestData.length){this.clear();var t=a.suggestData[a.lastStart++];this.oInt.value=t;this.change(t);this.oContainer.style.display="none";return;}break;case 38:if(a.lastStart>0){if(a.lastStart>=a.suggestData.length){a.lastStart=a.suggestData.length-1;}this.clear();var t=a.suggestData[a.lastStart--];this.oInt.value=t;this.change(t);this.oContainer.style.display="none";return;}break;}if(v>10&&v<20){return;}}if(a.method){var h=0,u=self[a.method]();a.count=u.length;}else{if(this.oInt.value.length==0){this.oContainer.style.display="none";return;}if(!a.suggestData){var c=self[a.nodeset[0]].data.selectNodes(a.nodeset[1]);for(var t,u=[],n=0;n<c.length;n++){t=jpf.getXmlValue(c[n],a.value);if(t){u.push(t.toLowerCase());}}if(a.sort){u.sort();}a.suggestData=u;}else{u=a.suggestData;}var t=this.oInt.value.toUpperCase();for(var h=u.length-a.count,n=0;n<u.length;n++){if(t<=u[n].toUpperCase()){h=n;break;}}a.lastStart=h;}this.oContainer.innerHTML="";this.oContainer.style.left=this.oInt.offsetLeft+"px";this.oContainer.style.top=this.oInt.offsetTop+"px";for(var q=[],m=h;m<Math.min(h+a.count,u.length);m++){this.$getNewContext("item");var s=this.$getLayoutNode("item");jpf.xmldb.setNodeValue(this.$getLayoutNode("item","caption"),u[m]);s.setAttribute("onmouseover",'this.className = "hover"');s.setAttribute("onmouseout",'this.className = ""');s.setAttribute("onmousedown","event.cancelBubble = true");s.setAttribute("onclick","var o = jpf.lookup("+this.uniqueId+");o.oInt.value = this.innerHTML;o.change(this.innerHTML);o.oInt.select();o.oInt.focus();o.oContainer.style.display = 'none';");q.push(this.$getLayoutNode("item"));}jpf.xmldb.htmlImport(q,this.oContainer);this.oContainer.style.display="block";};this.setAutocomplete=function(c,m,h){a.lastStart=-1;a.suggestData=null;a.nodeset=[c,m];a.value=h;this.oContainer.style.display="none";};};jpf.video.TypeQTCompat=(function(){var z=null;var h="qt_event_source";var s=true;function w(){return jpf.isIE?'<object id="'+h+'" classid="clsid:CB927D12-4FF7-4a9e-A169-56E4B8A75598" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=7,3,0,0"></object>':"";}function u(K,G){var H=false;var I=document.getElementsByTagName("object");for(var F=0,J;J=I[F];F++){if(J.getAttribute("classid")=="clsid:CB927D12-4FF7-4a9e-A169-56E4B8A75598"){if(J.getAttribute("id")==h){H=false;}break;}}return H;}function D(){var F=false;if(s&&jpf.isIE&&!u()){F=true;}return F;}function A(I,F,G){var H;H=z[I+F];if(null==H){H=z[F];}if(null!=H){if(0==F.indexOf(I)&&(null==G)){G=F.substring(I.length);}if(null==G){G=F;}return" "+G+'="'+H+'"';}else{return"";}}function C(F,G){if(0==F.indexOf("emb#")){return"";}if(0==F.indexOf("obj#")&&(null==G)){G=F.substring(4);}return A("obj#",F,G);}function E(F,G){if(0==F.indexOf("obj#")){return"";}if(0==F.indexOf("emb#")&&(null==G)){G=F.substring(4);}return A("emb#",F,G);}function t(F,I){var J;var H="";var G=(I)?" />":">";if(-1==F.indexOf("emb#")){J=z["obj#"+F];if(null==J){J=z[F];}if(0==F.indexOf("obj#")){F=F.substring(4);}if(null!=J){H='<param name="'+F+'" value="'+J+'"'+G;}}return H;}function n(){for(var F=0;F<arguments.length;F++){var G=arguments[F];delete z[G];delete z["emb#"+G];delete z["obj#"+G];}}function y(G,H,K){z={src:K[0],width:K[1],height:K[2],classid:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",pluginspage:"http://www.apple.com/quicktime/download/"};var F=K[3];if((null==F)||(""==F)){F="7,3,0,0";}z.codebase="http://www.apple.com/qtactivex/qtplugin.cab#version="+F;var L,J;for(var N=4;N<K.length;N+=2){L=K[N].toLowerCase();J=K[N+1];z[L]=J;if(("postdomevents"==L)&&(J.toLowerCase()!="false")){s=true;if(jpf.isIE){z["obj#style"]="behavior:url(#"+h+")";}}}var M=["<object ",C("classid"),C("width"),C("height"),C("codebase"),C("name"),C("id"),C("tabindex"),C("hspace"),C("vspace"),C("border"),C("align"),C("class"),C("title"),C("accesskey"),C("noexternaldata"),C("obj#style"),">",t("src",H)];var I=["<embed ",E("src"),E("width"),E("height"),E("pluginspage"),E("name"),E("id"),E("align"),E("tabindex")];n("src","width","height","pluginspage","classid","codebase","name","tabindex","hspace","vspace","border","align","noexternaldata","class","title","accesskey","id","style");for(var L in z){J=z[L];if(null!=J){I.push(E(L));M.push(t(L,H));}}return M.join("")+I.join("")+"></embed></object>";}function m(){var F=y("QT_GenerateOBJECTText_XHTML",true,arguments);if(D()){F=w()+F;}return F;}function c(){var F=false;if(navigator.plugins&&navigator.plugins.length){for(var H=0;H<navigator.plugins.length;H++){var G=navigator.plugins[H];if(G.name.indexOf("QuickTime")>-1){F=true;}}}else{qtObj=false;execScript('on error resume next: qtObj = IsObject(CreateObject("QuickTimeCheckObject.QuickTimeCheck.1"))',"VBScript");F=qtObj;}return F;}function v(){var G="0";if(navigator.plugins&&navigator.plugins.length){for(var I=0;I<navigator.plugins.length;I++){var H=navigator.plugins[I];var J=H.name.match(/quicktime\D*([\.\d]*)/i);if(J&&J[1]){G=J[1];}}}else{ieQTVersion=null;execScript('on error resume next: ieQTVersion = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1").QuickTimeVersion',"VBScript");if(ieQTVersion){var F="";G=(ieQTVersion).toString(16)/1000000+"";F+=parseInt(G)+".";F+=((parseFloat(G)-parseInt(G))*1000)/100+"";G=F;}}return G;}function q(I,G){function J(L,N){var M=parseInt(L[0],10);if(isNaN(M)){M=0;}var K=parseInt(N[0],10);if(isNaN(K)){K=0;}if(M===K){if(L.length>1){return J(L.slice(1),N.slice(1));}else{return true;}}else{return(M<K);}}var H=I.split(/\./);var F=G?G.split(/\./):v().split(/\./);return J(H,F);}var B={};function a(F){if(typeof F=="undefined"){F="7.2.1";}if(typeof B[F]=="undefined"){B[F]=c()&&q(F);}return B[F];}return{generateOBJECTText:m,isAvailable:a};})();jpf.video.TypeQT=function(c,m,h){this.oVideo=c;this.name="QT_"+this.oVideo.uniqueId;this.htmlElement=m;this.videoWidth=this.videoHeight=this.totalTime=this.bytesLoaded=this.totalBytes=0;this.state=null;this.autoPlay=this.autoLoad=this.showControls=true;this.volume=50;this.mimeType="video/quicktime";this.firstLoad=true;this.pluginError=false;this.pollTimer=null;this.videoPath=h.src;this.player=null;jpf.extend(this,jpf.video.TypeInterface);this.setOptions(h);var a=this;window.setTimeout(function(){a.oVideo.$initHook({state:1});},1);};jpf.video.TypeQT.isSupported=function(){return jpf.video.TypeQTCompat.isAvailable();};jpf.video.TypeQT.prototype={load:function(a){this.videoPath=a.splitSafe(",")[this.oVideo.$lastMimeType]||a;return this.$draw().attachEvents();},play:function(){if(this.player){try{this.player.Play();if(jpf.isIE){this.handleEvent({type:"qt_play"});}}catch(a){this.oVideo.$stateChangeHook({type:"stateChange",state:"connectionError"});}}return this;},pause:function(){if(this.player){try{this.player.Stop();if(jpf.isIE){this.handleEvent({type:"qt_pause"});}}catch(a){this.oVideo.$stateChangeHook({type:"stateChange",state:"connectionError"});}}return this;},stop:function(){return this.pause();},seek:function(c){if(!this.player){return;}try{this.player.SetTime(c);}catch(a){this.oVideo.$stateChangeHook({type:"stateChange",state:"connectionError"});}return this;},setVolume:function(a){if(this.player){try{this.player.SetVolume(Math.round((a/100)*256));}catch(c){this.oVideo.$stateChangeHook({type:"stateChange",state:"connectionError"});}}return this;},getTotalTime:function(){if(!this.player){return 0;}return this.player.GetDuration();},$draw:function(){if(this.player){this.stopPlayPoll();delete this.player;this.player=null;}this.htmlElement.innerHTML=jpf.video.TypeQTCompat.generateOBJECTText(this.videoPath,"100%","100%","","autoplay",jpf.isIE?"false":this.autoPlay.toString(),"controller",this.showControls.toString(),"kioskmode","true","showlogo","true","bgcolor","black","scale","aspect","align","middle","EnableJavaScript","True","postdomevents","True","target","myself","cache","false","qtsrcdontusebrowser","true","type",this.mimeType.splitSafe(",")[this.oVideo.$lastMimeType]||this.mimeType,"obj#id",this.name,"emb#NAME",this.name,"emb#id",this.name+"emb");this.player=document[this.name];return this;},events:["qt_begin","qt_abort","qt_canplay","qt_canplaythrough","qt_durationchange","qt_ended","qt_error","qt_load","qt_loadedfirstframe","qt_loadedmetadata","qt_pause","qt_play","qt_progress","qt_stalled","qt_timechanged","qt_volumechange","qt_waiting"],attachEvents:function(){var c=document.getElementById(this.name);if(!c){c=document.getElementById(this.name+"emb");}var a=this;function h(q){if(!q){q=window.event;}a.handleEvent(q);}var m=c.addEventListener?"addEventListener":"attachEvent";var n=c.addEventListener?"":"on";this.events.forEach(function(q){c[m](n+q,h,false);});if(jpf.isIE&&this.autoPlay){this.handleEvent({type:"qt_play"});}return this;},handleEvent:function(a){switch(a.type){case"qt_play":this.oVideo.$stateChangeHook({type:"stateChange",state:"playing"});this.startPlayPoll();break;case"qt_pause":this.oVideo.$stateChangeHook({type:"stateChange",state:"paused"});this.stopPlayPoll();break;case"qt_volumechange":this.oVideo.$changeHook({type:"change",volume:Math.round((this.player.GetVolume()/256)*100)});break;case"qt_timechanged":this.oVideo.$changeHook({type:"change",playheadTime:this.player.GetTime()});break;case"qt_stalled":this.oVideo.$completeHook({type:"complete"});this.stopPlayPoll();break;case"qt_canplay":this.oVideo.$readyHook({type:"ready"});break;case"qt_load":case"qt_canplaythrough":this.oVideo.setProperty("readyState",jpf.Media.HAVE_ENOUGH_DATA);if(this.autoPlay&&jpf.isIE){this.player.Play();}break;}return this;},startPlayPoll:function(){clearTimeout(this.pollTimer);var a=this;this.pollTimer=setTimeout(function(){if(!a.player){return;}try{a.handleEvent({type:"qt_timechanged"});var c=a.player.GetMaxBytesLoaded();var m=a.player.GetMovieSize();a.oVideo.$progressHook({bytesLoaded:c,totalBytes:m});if(!a.oVideo.ready&&Math.abs(c-m)<=20){a.handleEvent({type:"qt_load"});}}catch(h){}a.startPlayPoll();},100);return this;},stopPlayPoll:function(){clearTimeout(this.pollTimer);return this;},$destroy:function(){this.stopPlayPoll();if(this.player){try{this.player.Stop();}catch(a){}this.player=null;delete this.player;}this.oVideo=this.htmlElement=null;delete this.oVideo;delete this.htmlElement;}};jpf.video.TypeWmpCompat=(function(){var m=false;function h(){var z=false,w=false;if(jpf.isWin&&jpf.isIE){var u;try{u=new ActiveXObject("MediaPlayer.MediaPlayer.1");m=true;z=true;}catch(y){m=false;z=false;}if(m){try{u=new ActiveXObject("WMPlayer.OCX");w=true;}catch(y){w=false;}}}else{for(var v=0,t=navigator.plugins.length;v<t;v++){if(navigator.plugins[v].name.indexOf("Windows Media Player")!=-1){m=true;z=true;w=true;u={versionInfo:"7.3"};}}}var s;if(w){s=u.versionInfo;u=null;}else{s="6.4";}return parseFloat(s);}function c(s,t){if(!s||!t){return"";}return'<param name="'+s+'" value="'+t+'" />';}function a(A,v,w,s,z){z.URL=v;z.src=v;z.SendPlayStateChangeEvents="true";z.StretchToFit="true";var u=['<object id="',A,'" width="',w,'" height="',s,'" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">'];var t=['<embed id="',A,'emb" width="',w,'" height="',s,'"'];for(var y in z){if(!y||!z[y]){continue;}u.push('<param name="',y,'" value="',z[y],'" />');t.push(" ",y,'="',z[y],'"');}return u.join("")+t.join("")+" /></object>";}var q=null;function n(){if(q===null){q=h()>=7&&m;}return q;}return{isAvailable:n,generateOBJECTText:a};})();jpf.video.TypeWmp=function(c,m,h){this.oVideo=c;this.name="WMP_"+this.oVideo.uniqueId;this.htmlElement=m;this.player=this.pollTimer=null;this.volume=50;this.videoPath=h.src;jpf.extend(this,jpf.video.TypeInterface);this.setOptions(h);var a=this;window.setTimeout(function(){a.oVideo.$initHook({state:1});},1);};jpf.video.TypeWmp.isSupported=function(){return jpf.video.TypeWmpCompat.isAvailable();};jpf.video.TypeWmp.prototype={load:function(a){this.videoPath=a.splitSafe(",")[this.oVideo.$lastMimeType]||a;return this.$draw();},play:function(){if(this.player){this.player.controls.play();}return this;},pause:function(){if(this.player){this.player.controls.pause();}return this;},stop:function(){if(this.player){this.player.controls.stop();}return this;},seek:function(a){if(this.player){this.player.controls.pause();this.player.controls.currentPosition=a/1000;if(!this.oVideo.paused){this.player.controls.play();}}return this;},fullscreen:function(a){this.player.fullscreen=a?true:false;},setVolume:function(a){if(this.player){this.player.settings.volume=a;}return this;},getTotalTime:function(){if(!this.player){return 0;}return Math.round(this.player.controls.currentItem.duration*1000);},$draw:function(){if(this.player){this.stopPlayPoll();delete this.player;this.player=null;}var c=this.name+"_Player";this.htmlElement.innerHTML=jpf.video.TypeWmpCompat.generateOBJECTText(c,this.videoPath,"100%","100%",{AutoStart:this.autoPlay.toString(),uiMode:this.showControls?"mini":"none",PlayCount:1});this.player=this.getElement(c);var a=this;try{this.player[window.addEventListener?"addEventListener":"attachEvent"]("PlayStateChange",function(m){a.handleEvent(m);});}catch(h){this.player.onplaystatechange=function(m){a.handleEvent(m);};}return this;},handleEvent:function(a){switch(a){case 1:case 8:this.oVideo.$completeHook({type:"complete"});this.stopPlayPoll();break;case 2:this.oVideo.$stateChangeHook({type:"stateChange",state:"paused"});this.stopPlayPoll();break;case 3:this.oVideo.$stateChangeHook({type:"stateChange",state:"playing"});if(!this.oVideo.ready){this.oVideo.setProperty("readyState",jpf.Media.HAVE_ENOUGH_DATA);}this.startPlayPoll();break;case 10:this.oVideo.$stateChangeHook({type:"ready"});break;case 4:case 5:case 6:case 7:case 9:case 11:break;}return this;},startPlayPoll:function(){clearTimeout(this.pollTimer);var a=this;this.pollTimer=setTimeout(function(){if(!a.player||!a.player.controls){return;}a.oVideo.$changeHook({type:"change",playheadTime:Math.round(a.player.controls.currentPosition*1000)});a.startPlayPoll();},200);return this;},stopPlayPoll:function(){clearTimeout(this.pollTimer);return this;},$destroy:function(){this.stopPlayPoll();if(this.player){try{this.player.controls.stop();}catch(a){}this.player=null;delete this.player;}this.htmlElement.innerHTML="";this.oVideo=this.htmlElement=null;delete this.oVideo;delete this.htmlElement;}};jpf.video.TypeSilverlight=function(a,h,c){this.oVideo=a;if(!jpf.video.TypeSilverlight.INITED){jpf.silverlight.startup();jpf.video.TypeSilverlight.INITED=true;}this.DEFAULT_PLAYER=(jpf.appsettings.resourcePath||jpf.basePath)+"resources/wmvplayer.xaml";this.htmlElement=h;this.options={backgroundcolor:"000000",windowless:"false",file:"",image:"",backcolor:"000000",frontcolor:"FFFFFF",lightcolor:"FFFFFF",screencolor:"FFFFFF",width:"100%",height:"100%",logo:"",overstretch:"true",shownavigation:"false",showstop:"false",showdigits:"true",usefullscreen:"true",usemute:"false",autostart:"true",bufferlength:"3",duration:"0",repeat:"false",sender:"",start:"0",volume:"90",link:"",linkfromdisplay:"false",linktarget:"_self"};this.options.file=c.src;for(var m in this.options){if(c[m]!=undefined){if(m.indexOf("color")>0){this.options[m]=c[m].substr(c[m].length-6);}else{this.options[m]=c[m];}}}jpf.silverlight.createObjectEx({id:this.oVideo.uniqueId+"_Player",source:this.DEFAULT_PLAYER,parentElement:h,properties:{width:"100%",height:"100%",version:"1.0",inplaceInstallPrompt:true,isWindowless:this.options.windowless,background:"#"+this.options.backgroundcolor},events:{onLoad:this.onLoadHandler,onError:jpf.silverlight.default_error_handler},context:this});jpf.layout.setRules(this.oVideo.oExt,this.oVideo.uniqueId+"_silverlight","jpf.all["+this.oVideo.uniqueId+"].player.resizePlayer()");};jpf.video.TypeSilverlight.isSupported=function(){return jpf.silverlight.isAvailable("1.0");};jpf.video.TypeSilverlight.INITED=false;jpf.video.TypeSilverlight.prototype={load:function(a){this.video.Source=this.options.file;this.oVideo.$readyHook({type:"ready"});if(this.options.usemute=="true"){this.setVolume(0);}else{this.setVolume(this.options.volume);}if(this.options.autostart=="true"){this.play();}else{this.pause();}return this;},play:function(){if(this.state=="buffering"||this.state=="playing"){if(this.options.duration==0){this.stop();}else{this.pause();}}else{this.video.Visibility="Visible";this.preview.Visibility="Collapsed";if(this.state=="closed"){this.video.Source=this.options.file;}else{this.video.play();}}return this;},pause:function(){if(!this.video){return this;}this.video.pause();return this;},stop:function(){if(!this.video){return;}this.stopPlayPoll();this.video.Visibility="Collapsed";this.preview.Visibility="Visible";this.pause().seek(0);this.video.Source="null";return this;},seek:function(c){if(!this.video){return;}this.stopPlayPoll();if(c<2){c=0;}else{if(c>this.options.duration-4){c=this.options.duration-4;}}if(!isNaN(c)){try{this.video.Position=this.oVideo.getCounter(c,"%H:%M:%S");}catch(a){}}if(this.state=="buffering"||this.state=="playing"){this.play();}else{this.pause();}return this;},setVolume:function(a){if(!this.video){return;}this.video.Volume=a/100;return this;},getTotalTime:function(){if(!this.video){return 0;}return this.options.duration||0;},spanstring:function(a){var h=Math.floor(a/3600);var c=Math.floor(a%3600/60);var m=Math.round(a%60*10)/10;var n=h+":"+c+":"+m;return n;},onLoadHandler:function(h,a,c){a.options.sender=c;a.video=a.options.sender.findName("VideoWindow");a.preview=a.options.sender.findName("PlaceholderImage");var m={"true":"UniformToFill","false":"Uniform",fit:"Fill",none:"None"};a.state=a.video.CurrentState.toLowerCase();a.pollTimer;a.video.Stretch=m[a.options.overstretch];a.preview.Stretch=m[a.options.overstretch];a.display=c.findName("PlayerDisplay");a.display.Visibility="Visible";a.video.BufferingTime=a.spanstring(a.options.bufferlength);a.video.AutoPlay=true;a.video.AddEventListener("CurrentStateChanged",function(){a.handleState("CurrentStateChanged");});a.video.AddEventListener("MediaEnded",function(){a.handleState("MediaEnded");});a.video.AddEventListener("DownloadProgressChanged",function(n){a.oVideo.$progressHook({bytesLoaded:Math.round(n.downloadProgress*100),totalBytes:100});});if(a.options.image!=""){a.preview.Source=a.options.image;}a.resizePlayer();a.oVideo.$initHook({state:a.state});},handleState:function(c){var a=this.video.CurrentState.toLowerCase();if(c=="MediaEnded"){this.stopPlayPoll();this.oVideo.$changeHook({type:"change",playheadTime:Math.round(this.video.Position.Seconds*1000)});if(this.options.repeat=="true"){this.seek(0).play();}else{this.state="completed";this.video.Visibility="Collapsed";this.preview.Visibility="Visible";this.seek(0).pause().oVideo.$completeHook({type:"complete"});}}else{if(a!=this.state){this.state=a;this.options.duration=Math.round(this.video.NaturalDuration.Seconds*1000);if(a!="playing"&&a!="buffering"&&a!="opening"){this.oVideo.$stateChangeHook({type:"stateChange",state:"paused"});this.stopPlayPoll();}else{this.oVideo.$stateChangeHook({type:"stateChange",state:"playing"});this.startPlayPoll();}}}},startPlayPoll:function(){clearTimeout(this.pollTimer);var a=this;this.pollTimer=setTimeout(function(){if(a.oVideo&&!a.oVideo.ready&&a.video.CanSeek){a.oVideo.setProperty("readyState",jpf.Media.HAVE_ENOUGH_DATA);}a.oVideo.$changeHook({type:"change",playheadTime:Math.round(a.video.Position.Seconds*1000)});a.startPlayPoll();},100);return this;},stopPlayPoll:function(){clearTimeout(this.pollTimer);return this;},resizePlayer:function(){var m=this.options.sender;if(!m){return;}var h=this.display.getHost().content;var c=h.actualWidth;var a=h.actualHeight;this.stretchElement("PlayerDisplay",c,a).stretchElement("VideoWindow",c,a).stretchElement("PlaceholderImage",c,a).centerElement("BufferIcon",c,a).centerElement("BufferText",c,a);this.display.findName("OverlayCanvas")["Canvas.Left"]=c-this.display.findName("OverlayCanvas").Width-10;this.display.Visibility="Visible";return this;},centerElement:function(c,a,h){var m=this.options.sender.findName(c);m["Canvas.Left"]=Math.round(a/2-m.Width/2);m["Canvas.Top"]=Math.round(h/2-m.Height/2);return this;},stretchElement:function(c,a,h){var m=this.options.sender.findName(c);m.Width=a;if(h!=undefined){m.Height=h;}return this;},$destroy:function(){jpf.layout.removeRule(this.oVideo.oExt,this.oVideo.uniqueId+"_silverlight");this.stopPlayPoll();if(this.player){this.player=this.video=this.preview=null;delete this.player;delete this.video;delete this.preview;}this.htmlElement.innerHTML="";this.oVideo=this.htmlElement=null;delete this.oVideo;delete this.htmlElement;}};jpf.video.TypeFlv=function(a,h,c){this.oVideo=a;this.DEFAULT_SWF_PATH=(jpf.appsettings.resourcePath||jpf.basePath)+"resources/FAVideo.swf";this.id=jpf.flash.addPlayer(this);this.inited=false;this.resizeTimer=null;this.divName=this.oVideo.uniqueId;this.htmlElement=h;this.name="FAVideo_"+this.oVideo.uniqueId;this.videoPath=c.src;this.width="100%";this.height="100%";this.player=null;jpf.extend(this,jpf.video.TypeInterface);this.initProperties().setOptions(c).createPlayer();};jpf.video.TypeFlv.isSupported=function(){return jpf.flash.isAvailable();};jpf.video.TypeFlv.prototype={load:function(c,a){c=c.splitSafe(",")[this.oVideo.$lastMimeType]||c;if(a!=null){this.setTotalTime(a);}if(c!=null){this.videoPath=c;}if(this.videoPath==null&&!this.firstLoad){return this.oVideo.$errorHook({type:"error",error:"FAVideo::play - No videoPath has been set."});}if(c==null&&this.firstLoad&&!this.autoLoad){c=this.videoPath;}this.firstLoad=false;if(this.autoPlay){this.callMethod("playVideo",c,a);}else{this.callMethod("loadVideo",this.videoPath);}return this;},play:function(){return this.pause(false);},pause:function(a){if(typeof a=="undefined"){a=true;}this.callMethod("pause",a);return this;},stop:function(){this.callMethod("stop");return this;},seek:function(a){this.callMethod("seek",a/1000);return this;},setVolume:function(a){this.callMethod("setVolume",a);return this;},onResize:function(){clearTimeout(this.resizeTimer);var a=this;this.resizeTimer=window.setTimeout(function(){a.setSize();},20);},setSize:function(){this.callMethod("setSize",this.htmlElement.offsetWidth,this.htmlElement.offsetHeight);return this;},getPlayheadTime:function(){return this.playheadTime;},setPlayheadTime:function(a){return this.setProperty("playheadTime",a);},getTotalTime:function(){return this.totalTime;},setTotalTime:function(a){return this.setProperty("totalTime",a);},callMethod:function(h,c,a){if(this.inited&&this.player&&this.player.callMethod){this.player.callMethod(h,c,a);}else{this.delayCalls.push(arguments);}},makeDelayCalls:function(){for(var a=0;a<this.delayCalls.length;a++){this.callMethod.apply(this,this.delayCalls[a]);}return this;},update:function(a){for(var c in a){if(c.indexOf("Time")!=-1&&typeof a[c]=="number"){a[c]=a[c]*1000;}this[c]=a[c];}a.type="change";this.oVideo.$changeHook(a);},event:function(c,a){switch(c){case"progress":this.bytesLoaded=a.bytesLoaded;this.totalBytes=a.bytesTotal;this.oVideo.$progressHook({type:"progress",bytesLoaded:this.bytesLoaded,totalBytes:this.totalBytes});break;case"playheadUpdate":this.playheadTime=a.playheadTime*1000;this.totalTime=a.totalTime*1000;this.oVideo.$playheadUpdateHook({type:"playheadUpdate",playheadTime:this.playheadTime,totalTime:this.totalTime});break;case"stateChange":this.state=a.state;this.oVideo.$stateChangeHook({type:"stateChange",state:this.state});break;case"change":this.oVideo.$changeHook({type:"change"});break;case"complete":this.oVideo.$completeHook({type:"complete"});break;case"ready":this.oVideo.$readyHook({type:"ready"});break;case"metaData":this.oVideo.$metadataHook({type:"metadata",infoObject:a});break;case"cuePoint":this.oVideo.$cuePointHook({type:"cuePoint",infoObject:a});break;case"fullscreen":jpf.console.log("fullscreen: ",a.state);this.oVideo.fullscreen=false;case"init":this.inited=true;this.invalidateProperty("clickToTogglePlay","skinVisible","skinAutoHide","autoPlay","autoLoad","volume","bufferTime","videoScaleMode","videoAlign","playheadUpdateInterval","previewImagePath").validateNow().makeDelayCalls();this.oVideo.$initHook({type:"init"});this.onResize();var h=this.oVideo.oInt;setTimeout(function(){jpf.layout.forceResize(h);},1000);break;}},initProperties:function(){this.delayCalls=[];this.videoWidth=this.videoHeight=this.totalTime=this.bytesLoaded=this.totalBytes=0;this.state=null;this.clickToTogglePlay=this.autoPlay=this.autoLoad=this.skinVisible=true;this.volume=50;this.skinVisible=false;this.skinAutoHide=false;this.playheadTime=null;this.bufferTime=0.1;this.videoScaleMode="maintainAspectRatio";this.videoAlign="center";this.playheadUpdateInterval=1000;this.previewImagePath=this.themeColor=null;this.firstLoad=true;this.pluginError=false;this.properties=["volume","skinAutoHide","showControls","autoPlay","clickToTogglePlay","autoLoad","playHeadTime","totalTime","bufferTime","videoScaleMode","videoAlign","playheadUpdateInterval","previewImagePath"];jpf.layout.setRules(this.oVideo.oExt,this.oVideo.uniqueId+"_favideo","(jpf.all["+this.oVideo.uniqueId+"].player && jpf.all["+this.oVideo.uniqueId+"].player.onResize ? jpf.all["+this.oVideo.uniqueId+"].player : {onResize:jpf.K}).onResize()");jpf.layout.activateRules(this.oVideo.oExt);return this;},createPlayer:function(){var a=jpf.flash.buildContent("src",this.DEFAULT_SWF_PATH,"width","100%","height","100%","align","middle","id",this.name,"quality","high","bgcolor","#000000","allowFullScreen","true","name",this.name,"flashvars","playerID="+this.id+"&volume="+this.volume,"allowScriptAccess","always","type","application/x-shockwave-flash","pluginspage","http://www.adobe.com/go/getflashplayer","menu","true");if(this.htmlElement==null){return this;}this.pluginError=false;this.htmlElement.innerHTML=a;this.player=this.getElement(this.name);this.container=this.getElement(this.name+"_Container");return this;},invalidateProperty:function(){if(this.invalidProperties==null){this.invalidProperties={};}for(var a=0;a<arguments.length;a++){this.invalidProperties[arguments[a]]=true;}if(this.validateInterval==null&&this.inited){var c=this;this.validateInterval=setTimeout(function(){c.validateNow();},100);}return this;},validateNow:function(){this.validateInterval=null;var a={};for(var c in this.invalidProperties){a[c]=this[c];}this.invalidProperties={};this.callMethod("update",a);return this;},setProperty:function(c,a){this[c]=a;if(this.inited){this.invalidateProperty(c);}return this;},$destroy:function(){jpf.layout.removeRule(this.oVideo.oExt,this.oVideo.uniqueId+"_favideo");if(this.player){try{this.stop();}catch(a){}this.player=this.container=null;delete this.player;delete this.container;}this.htmlElement.innerHTML="";this.oVideo=this.htmlElement=null;delete this.oVideo;delete this.htmlElement;}};jpf.http=function(){this.queue=[null];this.callbacks={};this.cache={};this.timeout=10000;this.autoroute=false;this.routeServer=null;if(!this.uniqueId){this.uniqueId=jpf.all.push(this)-1;}var a=this;jpf.teleport.register(this);this.toString=this.toString||function(){return"[Javeline TelePort Component : (HTTP)]";};var c=jpf.appsettings.name+".jpf.http";this.saveCache=function(){var h=jpf.serialize(comm.cache);jpf.storage.put("cache_"+a.name,h,jpf.appsettings.name+".jpf.http");};this.loadCache=function(){var h=jpf.storage.get("cache_"+a.name,jpf.appsettings.name+".jpf.http");if(!h){return false;}this.cache=jpf.unserialize(h);return true;};this.clearCache=function(){jpf.storage.remove("cache_"+a.name,jpf.appsettings.name+".jpf.http");};this.getXml=function(m,n,h){if(!h){h={};}h.useXML=true;return this.get(m,n,h);};this.get=function(m,C,D,n){if(!D){D={};}var s=D.async||typeof D.async=="undefined"||jpf.isOpera;if(jpf.isSafari){m=jpf.html_entity_decode(m);}var u=D.data||"";if(jpf.isNot(n)){if(this.cache[m]&&this.cache[m][u]){var B={responseText:this.cache[m][u],responseXML:{},status:200,isCaching:true};}else{var B=jpf.getHttpReq();}n=this.queue.push({http:B,url:m,callback:C,retries:0,options:D})-1;if(B.isCaching){if(s){return setTimeout("jpf.lookup("+this.uniqueId+").receive("+n+");",50);}else{return this.receive(n);}}}else{var B=this.queue[n].http;if(B.isCaching){B=jpf.getHttpReq();}else{B.abort();}}if(s){if(jpf.hasReadyStateBug){this.queue[n].starttime=new Date().getTime();this.queue[n].timer=setInterval(function(){var E=new Date().getTime()-a.queue[n].starttime;if(E>a.timeout){a.$timeout(n);return;}if(a.queue[n].http.readyState==4){clearInterval(a.queue[n].timer);a.receive(n);}},20);}else{B.onreadystatechange=function(){if(!a.queue[n]||B.readyState!=4){return;}a.receive(n);};}}var w=this.autoroute&&jpf.isOpera?true:(D.autoroute||this.shouldAutoroute);var z=w?this.routeServer:m;var q=false;try{if(D.nocache){z=jpf.getNoCacheUrl(z);}if(jpf.appsettings.queryAppend){z+=(z.indexOf("?")==-1?"?":"&")+jpf.appsettings.queryAppend;}B.open(this.method||D.method||"GET",z,s,D.username||null,D.password||null);if(!jpf.isSafari){B.setRequestHeader("User-Agent","Javeline TelePort 2.0");}B.setRequestHeader("X-Requested-With","XMLHttpRequest");B.setRequestHeader("Content-type",this.contentType||(this.useXML||D.useXML?"text/xml":"text/plain"));if(w){B.setRequestHeader("X-Route-Request",m);B.setRequestHeader("X-Proxy-Request",m);B.setRequestHeader("X-Compress-Response","gzip");}}catch(v){q=true;}if(q){var y=false;if(!y&&this.autoroute&&!w){if(!jpf.isNot(n)){clearInterval(this.queue[n].timer);}this.shouldAutoroute=true;D.autoroute=true;return this.get(m,C,D,n);}if(!y){var A=C?C(null,jpf.ERROR,{userdata:D.userdata,http:B,url:m,tpModule:this,id:n,message:"Permission denied accessing remote resource: "+m}):false;if(!A){this.clearQueueItem(n);}return;}}if(this.$HeaderHook){this.$HeaderHook(B);}if(D.headers){for(var h in D.headers){B.setRequestHeader(h,D.headers[h]);}}function t(F){var E;if(F){B.send(u);}else{try{B.send(u);}catch(H){E=true;}}if(E){var J=window.navigator.onLine?"File or Resource not available "+m:"Browser is currently working offline";var G=window.navigator.onLine?jpf.ERROR:jpf.TIMEOUT;var I=C?C(null,G,{userdata:D.userdata,http:B,url:m,tpModule:this,id:n,message:J}):false;if(!I){this.clearQueueItem(n);}return;}}if(!s){t.call(this);return this.receive(n);}else{if(jpf.isIE&&location.protocol=="file:"&&m.indexOf("http://")==-1){setTimeout(function(){t.call(a,true);});}else{t.call(a);}return n;}};this.receive=function(v){if(!this.queue[v]){return false;}var u=this.queue[v];var n=u.http;var t=u.callback;clearInterval(u.timer);if(window.navigator.onLine===false&&(location.protocol!="file:"||u.url.indexOf("http://")>-1)){return false;}try{if(n.status){}}catch(s){return setTimeout(function(){a.receive(v);},10);}var m=[];var h={tpModule:this,http:n,url:u.url,callback:t,id:v,retries:u.retries||0,userdata:u.options.userdata};if(n.status>600){return this.$timeout(v);}h.data=n.responseText;if(n.status>=400&&n.status<600||n.status==3){m.push("HTTP error ["+v+"]:"+n.status+"\n"+n.responseText);}if(u.options.useXML||this.useXML){if((n.responseText||"").replace(/^[\s\n\r]+|[\s\n\r]+$/g,"")==""){m.push("Received an empty XML document (0 bytes)");}else{try{var q=(n.responseXML&&n.responseXML.documentElement)?jpf.xmlParseError(n.responseXML):jpf.getXmlDom(n.responseText);if(!jpf.supportNamespaces){q.setProperty("SelectionLanguage","XPath");}h.data=q.documentElement;}catch(s){m.push("Received invalid XML\n\n"+s.message);}}}if(m.length){h.message=m.join("\n");if(!t||!t(null,jpf.ERROR,h)){this.clearQueueItem(v);}return;}if(u.options.caching){if(!this.cache[u.url]){this.cache[u.url]={};}this.cache[u.url][u.options.data]=n.responseText;}if(!t||!t(h.data,jpf.SUCCESS,h)){this.clearQueueItem(v);}return h.data;};this.$timeout=function(t){if(!this.queue[t]){return false;}var s=this.queue[t];var h=s.http;clearInterval(s.timer);try{if(h.status){}}catch(m){return setTimeout(function(){a.$timeout(t);},10);}var q=s.callback;h.abort();var n=q?q(null,jpf.TIMEOUT,{userdata:s.options.userdata,http:h,url:s.url,tpModule:this,id:t,message:"HTTP Call timed out",retries:s.retries||0}):false;if(!n){this.clearQueueItem(t);}};this.retryTimeout=function(h,m,n,s,q){if(m==jpf.TIMEOUT&&h.retries<(q||jpf.maxHttpRetries)){return h.tpModule.retry(h.id);}s=s||new Error(jpf.formatErrorString(0,this,"Communication "+(m==jpf.TIMEOUT?"timeout":"error"),"Url: "+h.url+"\nInfo: "+h.message));if((n||jpf).dispatchEvent("error",jpf.extend({error:s,state:m,bubbles:true},h))===false){return true;}};this.clearQueueItem=function(h){if(!this.queue[h]){return false;}clearInterval(this.queue[h].timer);jpf.teleport.releaseHTTP(this.queue[h].http);this.queue[h]=null;delete this.queue[h];return true;};this.retry=function(m){if(!this.queue[m]){return false;}var h=this.queue[m];clearInterval(h.timer);h.retries++;this.get(h.url,h.callback,h.options,m);return true;};this.cancel=function(h){if(h===null){h=this.queue.length-1;}if(!this.queue[h]){return false;}this.clearQueueItem(h);};if(!this.load){this.load=function(h){var s=h.getAttribute("receive");for(var q=0;q<h.childNodes.length;q++){if(h.childNodes[q].nodeType!=1){continue;}var n=h.childNodes[q].getAttribute("url");var t=self[h.childNodes[q].getAttribute("receive")||s];var m={useXML:h.childNodes[q].getAttribute("type")=="XML",async:!jpf.isFalse(h.childNodes[q].getAttribute("async"))};this[h.childNodes[q].getAttribute("name")]=function(v,u){m.userdata=u;m.data=v;return this.get(n,t,m);};}};this.instantiate=function(h){var q=h.getAttribute("src");var n={async:h.getAttribute("async")!="false",nocache:true};this.getURL=function(t,s){n.data=t;n.userdata=s;return this.get(q,this.callbacks.getURL,n);};var m="http"+Math.round(Math.random()*100000);jpf.setReference(m,this);return m+".getURL()";};this.call=function(m,h){this[m].call(this,h);};}};jpf.Init.run("http");jpf.Init.run("XmlDatabase");jpf.rpc=function(){if(!this.supportMulticall){this.multicall=false;}this.stack={};this.urls={};this.tagName="rpc";this.useHTTP=true;this.TelePortModule=true;this.routeServer=jpf.host+"/cgi-bin/rpcproxy.cgi";this.autoroute=false;this.namedArguments=false;var a=this;this.addMethod=function(h,t,q,m,s,n,c){this[h]=function(){return this.call(h,arguments);};this[h].async=m;this[h].caching=s;this[h].names=q;this[h].ignoreOffline=n;this[h].methodName=c;if(t){this[h].callback=t;}return true;};this.setCallback=function(c,h){this[c].callback=h;};this.$convertArgs=function(q,n){if(!this.namedArguments){return Array.prototype.slice.call(n);}var h=this[q].names;if(!h||!h.length){return{};}var q,t,c={};for(var m=0,s=0;s<h.length;s++){q=h[s].getAttribute("name");if(h[s].getAttribute("value")){t=jpf.parseExpression(h[s].getAttribute("value"));}else{t=n[m++];if(jpf.isNot(t)&&h[s].getAttribute("default")){t=jpf.parseExpression(h[s].getAttribute("default"));}}t=jpf.isTrue(h[s].getAttribute("encoded"))?encodeURIComponent(t):t;c[q]=t;}return c;};this.call=function(q,n,m){n=this.$convertArgs(q,n);if(this.multicall){if(!this.stack[this.url]){this.stack[this.url]=this.getMulticallObject?this.getMulticallObject():new Array();}this.getSingleCall(q,n,this.stack[this.url]);return true;}var u=(typeof this[q].callback=="string"?self[this[q].callback]:this[q].callback)||function(){};var s=this.serialize(this[q].methodName||q,n);function c(y,w,v){v.data=y;if(w!=jpf.SUCCESS){u(null,w,v);}else{if(a.isValid&&!a.isValid(v)){u(null,jpf.ERROR,v);}else{u(a.unserialize(v.data),w,v);}}}var h=jpf.getAbsolutePath(this.baseurl,this.url);var t=this.get(h,c,jpf.extend({async:this[q].async,userdata:this[q].userdata,nocache:true,data:s,useXML:this.useXML,caching:this[q].caching,ignoreOffline:this[q].ignoreOffline},m));return t;};this.purge=function(u,t,m,v){var n=this.serialize("multicall",[this.stack[this.url]]);var c=jpf.getAbsolutePath(this.baseurl,this.url);if(v){for(var s=[],q=0;q<v.length;q++){s.push(encodeURIComponent(v[q][0])+"="+encodeURIComponent(v[q][1]||""));}c=c+(c.match(/\?/)?"&":"?")+s.join("&");}var h=this.get(c,u,{async:m,userdata:t,nocache:true,data:n,useXML:this.useXML});this.stack[this.url]=this.getMulticallObject?this.getMulticallObject():[];};this.revert=function(c){this.stack[c.url]=this.getMulticallObject?this.getMulticallObject():[];};this.getStackLength=function(){return this.stack[this.url]?this.stack[this.url].length:0;};this.load=function(c){this.$jml=c;this.timeout=parseInt(c.getAttribute("timeout"))||this.timeout;this.url=jpf.parseExpression(c.getAttribute("url"));this.baseurl=jpf.parseExpression(jpf.xmldb.getInheritedAttribute(this.$jml,"baseurl"))||"";this.multicall=jpf.isTrue(c.getAttribute("multicall"));this.autoroute=jpf.isTrue(c.getAttribute("autoroute"));this.routeServer=c.getAttribute("route-server")||this.routeServer;if(this.url){this.server=this.url.replace(/^(.*\/\/[^\/]*)\/.*$/,"$1")+"/";}if(this.$load){this.$load(c);}var n=c.childNodes;for(var h,m=0;m<n.length;m++){if(n[m].nodeType!=1){continue;}h=jpf.parseExpression(n[m].getAttribute("url"));if(h){this.urls[n[m].getAttribute("name")]=h;}this.addMethod(n[m].getAttribute("name"),n[m].getAttribute("receive")||c.getAttribute("receive"),n[m].getElementsByTagName("*"),!jpf.isFalse(n[m].getAttribute("async")),jpf.isTrue(n[m].getAttribute("caching")),jpf.isTrue(n[m].getAttribute("ignore-offline")),n[m].getAttribute("method-name"));}};};jpf.datainstr.rpc=function(xmlContext,options,callback){var parsed=options.parsed||this.parseInstructionPart(options.instrData.join(":"),xmlContext,options.args,options);if(options.preparse){options.parsed=parsed;options.preparse=-1;return;}var args=parsed.arguments;var q=parsed.name.split(".");var obj=eval(q[0]);var method=q[1];if(options.multicall){obj.forceMulticall=true;}if(options.userdata){obj[method].userdata=options.userdata;}if(!obj.multicall){obj[method].callback=callback;}var retvalue=obj.call(method,args,options);if(obj.multicall){return obj.purge(callback,"&@^%!@");}else{if(options.multicall){obj.forceMulticall=false;return obj;}}if(!obj.multicall&&!obj[method].async&&callback){callback(retvalue);}};jpf.xmlrpc=function(){this.supportMulticall=true;this.multicall=false;this.mcallname="system.multicall";this.method="POST";this.useXML=true;this.namedArguments=false;jpf.teleport.register(this);if(!this.uniqueId){jpf.makeClass(this);this.implement(jpf.BaseComm,jpf.http,jpf.rpc);}var a={host:this,object:function(h){var c=h;retstr="<struct>";for(prop in c){if(typeof c[prop]!="function"&&prop!="type"){retstr+="<member><name>"+prop+"</name><value>"+this.host.doSerialize(c[prop])+"</value></member>";}}retstr+="</struct>";return retstr;},string:function(c){return"<string><![CDATA["+c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+"]]></string>";return str;},number:function(c){if(c==parseInt(c)){return"<int>"+c+"</int>";}else{if(c==parseFloat(c)){return"<double>"+c+"</double>";}else{return this["boolean"](false);}}},"boolean":function(c){if(c==true){return"<boolean>1</boolean>";}else{return"<boolean>0</boolean>";}},date:function(h){return"<dateTime.iso8601>"+c(h.getUTCYear())+m(h.getMonth())+m(h.getUTCDate())+"T"+m(h.getHours())+":"+m(h.getMinutes())+":"+m(h.getSeconds())+"</dateTime.iso8601>";function m(n){n=String("0"+n);return n.substr(n.length-2,2);}function c(n){if(n>9999||n<0){XMLRPC.handleError(new Error(jpf.formatErrorString(1085,null,"XMLRPC serialization","Unsupported year: "+n)));}n=String("0000"+n);return n.substr(n.length-4,4);}},array:function(h){var c="<array><data>";for(var m=0;m<h.length;m++){c+="<value>";c+=this.host.doSerialize(h[m]);c+="</value>";}return c+"</data></array>";}};this.getSingleCall=function(h,c,m){m.push({m:h,p:c});};this.doSerialize=function(c){if(typeof c=="function"){throw new Error(jpf.formatErrorString(1086,null,"XMLRPC serialization","Cannot Parse functions"));}else{if(jpf.isNot(c)){return a["boolean"](false);}}return a[c.dataType||"object"](c);};this.serialize=function(n,c){var m='<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>'+n+"</methodName><params>";for(var h=0;h<c.length;h++){m+="<param><value>"+this.doSerialize(c[h])+"</value></param>";}m+="</params></methodCall>";return m;};this.unserialize=function(m){var c,h;switch(m.tagName){case"string":if(jpf.isGecko){m=(new XMLSerializer()).serializeToString(m);m=m.replace(/^\<string\>/,"");m=m.replace(/\<\/string\>$/,"");m=m.replace(/\&lt;/g,"<");m=m.replace(/\&gt;/g,">");return m;}return(m.firstChild)?m.firstChild.nodeValue:"";break;case"int":case"i4":case"double":return(m.firstChild)?new Number(m.firstChild.nodeValue):0;break;case"dateTime.iso8601":var n=jpf.dateSeparator;if(/^(\d{4})(\d{2})(\d{2})T(\d{2}):(\d{2}):(\d{2})/.test(m.firstChild.nodeValue)){return new Date(RegExp.$2+n+RegExp.$3+n+RegExp.$1+" "+RegExp.$4+":"+RegExp.$5+":"+RegExp.$6);}else{return new Date();}break;case"array":m=jpf.getNode(m,[0]);if(m&&m.tagName=="data"){c=new Array();var h=0;while(child=jpf.getNode(m,[h++])){c.push(this.unserialize(child));}return c;}else{this.handleError(new Error(jpf.formatErrorString(1087,null,"","Malformed XMLRPC Message")));return false;}break;case"struct":c={};var h=0;while(child=jpf.getNode(m,[h++])){if(child.tagName=="member"){c[jpf.getNode(child,[0]).firstChild.nodeValue]=this.unserialize(jpf.getNode(child,[1]));}else{this.handleError(new Error(jpf.formatErrorString(1087,null,"","Malformed XMLRPC Message2")));return false;}}return c;break;case"boolean":return Boolean(isNaN(parseInt(m.firstChild.nodeValue))?(m.firstChild.nodeValue=="true"):parseInt(m.firstChild.nodeValue));break;case"base64":return jpf.crypt.Base64.decode(m.firstChild.nodeValue);break;case"value":child=jpf.getNode(m,[0]);return(!child)?((m.firstChild)?new String(m.firstChild.nodeValue):""):this.unserialize(child);break;default:throw new Error(jpf.formatErrorString(1088,null,"","Malformed XMLRPC Message: "+m.tagName));return false;break;}};this.isValid=function(c){var m=c.data;if(jpf.getNode(m,[0]).tagName=="fault"){if(!jpf.isSafari){var h=m.selectSingleNode("//member[name/text()='faultCode']/value/int/text()").nodeValue;var n="\n"+m.selectSingleNode("//member[name/text()='faultString']/value/string/text()").nodeValue;}else{h=n="";}c.message=n;return false;}c.data=jpf.getNode(m,[0,0,0]);return true;};};jpf.cgi=function(){this.supportMulticall=false;this.namedArguments=true;jpf.teleport.register(this);if(!this.uniqueId){jpf.makeClass(this);this.implement(jpf.BaseComm,jpf.http,jpf.rpc);}this.unserialize=function(a){return a;};this.getSingleCall=function(c,a,h){h.push(a);};this.serialize=function(m,a){var n=[];function h(t,q){if(t&&t.dataType=="array"){for(var s=0;s<t.length;s++){h(t[s],q+"%5B"+s+"%5D");}}else{if(typeof t=="object"){for(prop in t){if(jpf.isSafariOld&&(!t[prop]||typeof p[prop]!="object")){continue;}if(typeof t[prop]=="function"){continue;}h(t[prop],q+"%5B"+encodeURIComponent(prop)+"%5D");}}else{if(typeof t!="undefined"&&t!==null){n.push(q+"="+encodeURIComponent(t));}}}}if(this.multicall){n.push("func="+this.mcallname);for(var c=0;c<a[0].length;c++){h(a[0][c],"f%5B"+c+"%5D");}}else{for(prop in a){if(jpf.isSafariOld&&(!a[prop]||typeof a[prop]=="function")){continue;}h(a[prop],prop);}}if(!this.baseUrl){this.baseUrl=this.url;}this.url=this.urls[m]?this.urls[m]:this.baseUrl;if(this.method!="GET"){return n.join("&");}this.url=this.url+(n.length?(this.url.indexOf("?")>-1?"&":"?")+n.join("&"):"");return"";};this.$load=function(a){this.method=(a.getAttribute("http-method")||"GET").toUpperCase();this.contentType=this.method=="GET"?null:"application/x-www-form-urlencoded";if(a.getAttribute("method-name")){var n=a.getAttribute("method-name");var h=a.childNodes;for(var c,m=0;m<h.length;m++){if(h[m].nodeType!=1){continue;}c=h[m].insertBefore(a.ownerDocument.createElement("variable"),h[m].firstChild);c.setAttribute("name",n);c.setAttribute("value",h[m].getAttribute("name"));}}};this.submitForm=function(h,n){if(!this["postform"]){this.addMethod("postform",n);}var a=[];for(var c=0;c<h.elements.length;c++){if(!h.elements[c].name){continue;}if(h.elements[c].tagname="input"&&(h.elements[c].type=="checkbox"||h.elements[c].type=="radio")&&!h.elements[c].checked){continue;}if(h.elements[c].tagname="select"&&h.elements[c].multiple){for(j=0;j<h.elements[c].options.length;j++){if(h.elements[c].options[j].selected){a.push(h.elements[c].name+"="+encodeURIComponent(h.elements[c].options[j].value));}}}else{a.push(h.elements[c].name+"="+encodeURIComponent(h.elements[c].value));}}var m=(h.action||location.href);this.urls.postform=m+(m.indexOf("?")>-1?"&":"?")+a.join("&");this["postform"].call(this);return false;};};jpf.namespace("datainstr.url",function(t,u,s){if(!u.parsed){var a=u.instrData.join(":");if(t){a=a.replace(/\{(.*?)\}/g,function(v,w){var y=t.selectSingleNode(w);return y?(y.nodeType>=2&&y.nodeType<=4?y.nodeValue:y.xml||y.serialize()):"";});}var n=a.split("?");a=n.shift();var m=n.join("?");var h=u.args;var q=(h&&h.length)?(h[0].nodeType?h[0].xml||h[0].serialize():jpf.serialize(h[0])):m;if(u.preparse){u.parsed=[a,m,q];u.preparse=-1;return;}}else{var a=u.parsed[0];var m=u.parsed[1];var q=u.parsed[2];}var c=new jpf.http();c.contentType="application/x-www-form-urlencoded";c.method=(u.instrType.replace(/url.?/,"")||"GET").toUpperCase();c.get(jpf.getAbsolutePath(jpf.appsettings.baseurl,a+(c.method=="GET"?"?"+m:"")),s,jpf.extend({data:q},u));});jpf.Init.addConditional(function(){jpf.dispatchEvent("domready");},null,["body","class"]);jpf.addDomLoadEvent(function(){jpf.Init.run("body");});jpf.start();