var apf={VERSION:"3.0beta",CDN:"",READY:false,NODE_HIDDEN:101,NODE_VISIBLE:102,NODE_O3:103,KEYBOARD:2,KEYBOARD_MOUSE:true,SUCCESS:1,TIMEOUT:2,ERROR:3,OFFLINE:4,debug:false,includeStack:[],initialized:false,AppModules:[],autoLoadSkin:false,started:false,crypto:{},config:{},_GET:{},$asyncObjects:{"apf.oHttp":1},basePath:"./",ns:{apf:"http://ajax.org/2005/aml",aml:"http://ajax.org/2005/aml",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"},availHTTP:[],releaseHTTP:function(a){if(apf.brokenHttpAbort){return;}if(self.XMLHttpRequestUnSafe&&a.constructor==XMLHttpRequestUnSafe){return;}a.onreadystatechange=function(){};a.abort();this.availHTTP.push(a);},browserDetect:function(){if(this.$bdetect){return;}this.$bdetect=true;var g=navigator.userAgent.toLowerCase()||"";this.isOpera=(self.opera&&Object.prototype.toString.call(self.opera)=="[object Opera]");this.isKonqueror=g.indexOf("konqueror")!=-1;this.isSafari = !this.isOpera && ((navigator.vendor && navigator.vendor.match(/Apple/) ? true : false) || g.indexOf("safari") != -1);this.isSafariOld=false;this.isIphone=g.indexOf("iphone")!=-1||g.indexOf("aspen simulator")!=-1;this.isChrome=Boolean(/source/.test((/a/.toString+"")))||g.indexOf("chrome")!=-1;this.isWebkit=this.isSafari||this.isChrome||this.isKonquerer;if(this.isWebkit){var d=g.match(/applewebkit\/(\d+)/);if(d){this.webkitRev=parseInt(d[1]);this.isSafariOld=parseInt(d[1])<420;}}this.isGecko=(function(i){i[i]=i+"";return i[i]!=i+"";})(new String("__count__"));this.isGecko3=this.isGecko&&(function a(){})[-5]=="x";this.isGecko35=this.isGecko&&(/a/[-1]&&Object.getPrototypeOf)?true:false;this.versionGecko=this.isGecko?parseFloat(g.match(/(?:gecko)\/([\d\.]+)/i)[1]):-1;this.versionFF=this.isGecko?parseFloat(g.match(/(?:firefox)\/([\d\.]+)/i)[1]):-1;var c;this.isIE=!+"\v1";if(this.isIE){this.isIE=parseFloat(g.match(/msie ([\d\.]*)/)[1]);}this.isIE8=this.isIE==8&&(c=true);this.isIE7=!c&&this.isIE==7&&(c=true);if(this.isIE==7&&document.documentMode==7){apf.isIE7=true;apf.isIE8=false;apf.isIE7Emulate=true;apf.isIE=7;}this.isIE6=!c&&this.isIE==6&&(c=true);var b=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();this.isWin=(b=="win");this.isMac=(b=="mac");this.isLinux=(b=="linux");this.isAIR=g.indexOf("adobeair")!=-1;},setCompatFlags:function(){this.TAGNAME=apf.isIE?"baseName":"localName";this.styleSheetRules=apf.isIE?"rules":"cssRules";this.brokenHttpAbort=apf.isIE6;this.canUseHtmlAsXml=apf.isIE;this.supportNamespaces=!apf.isIE;this.cannotSizeIframe=apf.isIE;this.hasConditionCompilation=apf.isIE;this.supportOverflowComponent=apf.isIE;this.hasEventSrcElement=apf.isIE;this.canHaveHtmlOverSelects=!apf.isIE6&&!apf.isIE5;this.hasInnerText=apf.isIE;this.hasMsRangeObject=apf.isIE;this.descPropJs=apf.isIE;this.hasClickFastBug=apf.isIE;this.hasExecScript=window.execScript?true:false;this.canDisableKeyCodes=apf.isIE;this.hasTextNodeWhiteSpaceBug=apf.isIE||apf.isIE>=8;this.hasCssUpdateScrollbarBug=apf.isIE;this.canUseInnerHtmlWithTables=!apf.isIE;this.hasSingleResizeEvent=!apf.isIE;this.hasStyleFilters=apf.isIE;this.supportOpacity=!apf.isIE;this.supportPng24=!apf.isIE6&&!apf.isIE5;this.cantParseXmlDefinition=apf.isIE50;this.hasDynamicItemList=!apf.isIE||apf.isIE>=7;this.canImportNode=apf.isIE;this.hasSingleRszEvent=!apf.isIE;this.hasXPathHtmlSupport=!apf.isIE;this.hasFocusBug=apf.isIE;this.hasHeightAutoDrawBug=apf.isIE&&apf.isIE<8;this.hasIndexOfNodeList=!apf.isIE;this.hasReadyStateBug=apf.isIE50;this.dateSeparator=apf.isIE?"-":"/";this.canCreateStyleNode=!apf.isIE;this.supportFixedPosition=!apf.isIE||apf.isIE>=7;this.hasHtmlIdsInJs=apf.isIE&&apf.isIE<8||apf.isWebkit;this.needsCssPx=!apf.isIE;this.hasCSSChildOfSelector=!apf.isIE||apf.isIE>=8;this.styleAttrIsObj=apf.isIE<8;this.hasAutocompleteXulBug=apf.isGecko;this.loadsLocalFilesSync=apf.isIE||apf.isGecko;this.mouseEventBuffer=apf.isIE?20:6;this.hasComputedStyle=typeof document.defaultView!="undefined"&&typeof document.defaultView.getComputedStyle!="undefined";this.supportCSSAnim=apf.isWebkit&&(apf.webkitRev>525);this.w3cRange=Boolean(window.getSelection);this.locale=(apf.isIE?navigator.userLanguage:navigator.language).toLowerCase();this.characterSet=document.characterSet||document.defaultCharset||"utf-8";var j=document.createElement("div");this.hasContentEditable=(typeof j.contentEditable=="string"||typeof j.contentEditable=="boolean");var k=["transform","OTransform","KhtmlTransform","MozTransform","WebkitTransform"],m=["","O","Khtml","Moz","Webkit"],c=["","o-","khtml-","moz-","webkit-"],g=["transitionend","transitionend","transitionend","transitionend","webkitTransitionEnd"],d=0,b=5;this.supportCSSAnim=false;this.supportCSSTransition=false;for(;d<b&&!this.supportCSSAnim;++d){if(typeof j.style[k[d]]=="undefined"){continue;}this.supportCSSAnim=k[d];this.runtimeStylePrefix=m[d];this.classNamePrefix=c[d];this.cssAnimEvent=g[d];}j=null;delete j;this.supportVML=apf.isIE;this.supportSVG=!apf.isIE;this.hasHtml5XDomain=apf.versionGecko>=3.5;this.supportCanvas=!!document.createElement("canvas").getContext;this.supportCanvasText=!!(this.supportCanvas&&typeof document.createElement("canvas").getContext("2d").fillText=="function");this.hasVideo=!!document.createElement("video")["canPlayType"];this.hasAudio=!!document.createElement("audio")["canPlayType"];this.hasGeolocation=!!navigator.geolocation;this.supportHashChange=("onhashchange" in self)&&(!apf.isIE||apf.isIE>=8);j=document.createElement("input");var a=this;(function(n){for(var l in n){j.setAttribute("type",l);a["hasInput"+l.charAt(0).toUpperCase()+l.substr(1).replace("-l","L")]=!!(j.type!=="text");}})({search:1,tel:1,url:1,email:1,datetime:1,date:1,month:1,week:1,time:1,"datetime-local":1,number:1,range:1,color:1});j=null;delete j;this.maxHttpRetries=apf.isOpera?0:3;this.percentageMatch=new RegExp();this.percentageMatch.compile("([\\-\\d\\.]+)\\%","g");this.reMatchXpath=new RegExp();this.reMatchXpath.compile("(^|\\|)(?!\\@|[\\w-]+::)","g");},extend:function(b,d){var g,c,a=!b.notNull;if(arguments.length==2){for(g in d){if(a||d[g]){b[g]=d[g];}}return b;}for(c=1;c<arguments.length;c++){d=arguments[c];for(g in d){if(a||d[g]){b[g]=d[g];}}}return b;},$extend:function(a,b){for(var c in b){a[c]=b[c];}return a;},ajax:function(){return this.oHttp.get.apply(this.oHttp,arguments);},start:function(){this.started=true;var s=location.href.split("#")[0].split("?")[0];this.host=location.hostname&&s.replace(/(\/\/[^\/]*)\/.*$/,"$1");this.hostPath=s.replace(/\/[^\/]*$/,"")+"/";this.setCompatFlags();if(this.isIE){apf.runIE();}if(apf.isWebkit){apf.runWebkit();}if(this.isOpera){apf.runOpera();}if(this.isGecko||!this.isIE&&!apf.isWebkit&&!this.isOpera){apf.runGecko();}for(var t,g,w,j,d,c,x,b=location.href.split(/[?&]/),q=b.length,r=1;r<q;r++){if(j=b[r].match(/(.*?)(\..*?|\[.*?\])?=([^#]*)/)){d=decodeURI(j[1]).toLowerCase(),c=this._GET;if(j[2]){for(w=decodeURI(j[2]).replace(/\[\s*\]/g,"[-1]").split(/[\.\[\]]/),t=0,g=w.length;t<g;t++){x=w[t],c=c[d]?c[d]:c[d]=(parseInt(x)==x)?[]:{},d=x.replace(/^["\'](.*)["\']$/,"$1");}}c[d!="-1"?d:c.length]=unescape(decodeURI(j[3]));}}this.oHttp=new this.http();this.Init.addConditional(this.parseAppMarkup,apf,["body"]);try{if(apf.isIE){document.execCommand("BackgroundImageCache",false,true);}}catch(u){}this.started=true;if(this.load_done){this.execDeferred();}this.root=true;for(var t=0;t<apf.$required.length;t++){apf.include(apf.$required[t]);}apf.require=apf.include;},nsqueue:{},findPrefix:function(b,d){var c;if(b.nodeType==9){if(!b.documentElement){return false;}if(b.documentElement.namespaceURI==d){return b.prefix||b.scopeName;}c=b.documentElement;}else{if(b.namespaceURI==d){return b.prefix||b.scopeName;}c=b.ownerDocument.documentElement;if(c&&c.namespaceURI==d){return b.prefix||b.scopeName;}while(b.parentNode){b=b.parentNode;if(b.namespaceURI==d){return b.prefix||b.scopeName;}}}if(c){for(var a=0;a<c.attributes.length;a++){if(c.attributes[a].nodeValue==d){return c.attributes[a][apf.TAGNAME];}}}return false;},importClass:function(b,a,d){if(!b){throw new Error(apf.formatErrorString(1018,null,"importing class","Could not load reference. Reference is null"));}if(!a){return apf.exec(b.toString(),d);}var c=b.toString().replace(/^\s*function\s*\w*\s*\([^\)]*\)\s*\{/,"").replace(/\}\s*$/,"");return apf.exec(c,d);},toString:function(){return"[Ajax.org Platform (apf)]";},all:[],implement:function(d){if(arguments.length==1){d.call(this);}else{for(var c,g=0,b=arguments.length;g<b;g++){c=arguments[g];arguments[g].call(this);}}return this;},uniqueHtmlIds:0,setUniqueHtmlId:function(a){var b;a.setAttribute("id",b="q"+this.uniqueHtmlIds++);return b;},getUniqueId:function(){return this.uniqueHtmlIds++;},lookup:function(a){return this.all[a];},findHost:function(b){while(b&&b.parentNode){try{if(b.host){break;}}catch(a){}b=b.parentNode;}return(b&&b.host&&typeof b.host!="string")?b.host:false;},setReference:function(a,b){return self[a]&&self[a].hasFeature?0:(self[a]=b);},console:{debug:function(c,a,b){},time:function(c,a,b){},log:function(c,a,b){},info:function(c,a,b){},warn:function(c,a,b){},error:function(c,a,b){},dir:function(a){this.info(apf.vardump(a,null,false).replace(/ /g,"&nbsp;").replace(/</g,"&lt;"));}},formatErrorString:function(c,g,d,b,j,i,a){apf.lastErrorMessage=b;return b;},getDirname:function(a){return((a||"").match(/^([^#]*\/)[^\/]*(?:$|\#)/)||{})[1];},getFilename:function(a){return((a||"").split("?")[0].match(/(?:\/|^)([^\/]+)$/)||{})[1];},getAbsolutePath:function(b,a){return !a||!b||a.match(/^\w+\:\/\//)?a:b.replace(/\/$/,"")+"/"+a;},include:function(d,a,i,j){apf.console.info("including js file: "+d);var b=a?apf.getAbsolutePath(apf.basePath||"",d):d;if(apf.isSafariOld&&!apf.started){document.write('<script type="text/javascript" src="'+b+'"><\/script>');}else{var g=document.getElementsByTagName("head")[0],c=document.createElement("script");if(i){c.setAttribute("_apf_type",i);}c.src=b;g.appendChild(c);if(j){c[apf.isIE?"onreadystatechange":"onload"]=j;}}},$required:[],require:function(){var b=apf.getDirname(location.href),c=0,a=arguments.length;for(;c<a;c++){this.$required.push(apf.getAbsolutePath(b,arguments[c]));}},Init:{queue:[],cond:{combined:[]},done:{},add:function(a,b){if(this.inited){a.call(b);}else{if(a){this.queue.push([a,b]);}}},addConditional:function(b,c,a){if(typeof a!="string"){if(this.checkCombined(a)){return b.call(c);}this.cond.combined.push([b,c,a]);}else{if(self[a]){b.call(c);}else{if(!this.cond[a]){this.cond[a]=[];}this.cond[a].push([b,c]);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 b=0;b<a.length;b++){if(!this.done[a[b]]){return false;}}return true;},run:function(a){this.inited=this.done[a]=true;this.checkAllCombined();var c=a?this.cond[a]:this.queue;if(!c){return;}for(var b=0;b<c.length;b++){c[b][0].call(c[b][1]);}}},amlParts:[],parseStrategy:0,parsePartialAml:function(d){var i;if(apf.isIE){i=function(y){try{var u={IMG:1,LINK:1,META:1,INPUT:1,BR:1,HR:1,AREA:1,BASEFONT:1},x=new RegExp(y.outerHTML.replace(/([\(\)\|\\\.\^\$\{\}\[\]])/g,"\\$1")+".*"+y.tagName),t=y.parentNode.outerHTML.replace(/\n/g,"").match(x),A=t[0]+">".replace(/(\w+)\s*=\s*([^\>="'\s ]+)( |\s|\>|\/\>)/g,'$1="$2"$3').replace(/ disabled /g," disabled='true' ").replace(/\]\]\&gt;/g,"]]>").replace(/<(\w+)(\s[^>]*[^\/])?>/g,function(C,B,D){if(u[B]){return"<"+B+(D||"")+"/>";}else{return C;}});}catch(z){return;}var w=apf.getAmlDocFromString("<div jid='"+(a++)+"' "+g+">"+A+"</div>").documentElement;while(w.childNodes.length>1){w.removeChild(w.lastChild);}apf.AppNode.appendChild(w);};}else{i=function(u){var w=u.outerHTML.replace(/ _moz-userdefined=""/g,""),t=apf.getAmlDocFromString("<div jid='"+(a++)+"' "+g+">"+w+"</div>").documentElement;while(t.childNodes.length>1){t.removeChild(t.lastChild);}if(apf.isWebkit){t=apf.AppNode.ownerDocument.importNode(t,true);}apf.AppNode.appendChild(t);};}var k=document.body.outerHTML.match(/(\w+)\s*=\s*["']http:\/\/ajax\.org\/2005\/aml["']/);if(!k){return false;}var g="xmlns:"+k[0],m=(RegExp.$1||"").toUpperCase();if(apf.isOpera){m=m.toLowerCase();}if(!m){return false;}m+=":";apf.AppNode=apf.getAmlDocFromString("<"+m.toLowerCase()+"application "+g+" />").documentElement;var r,l,o,b=false,a=0,c=document.body;while(c){b=c.nodeType==1&&c.tagName.substr(0,2)==m;if(b){i(o=c);if(apf.isIE){l=c;var n=1,j=l.nextSibling;if(j){l.parentNode.removeChild(l);while(j&&(j.nodeType!=1||j.tagName.indexOf(m)>-1)){if(j.nodeType==1){n+=j.tagName.charAt(0)=="/"?-1:1;}if(n==0){if(r){r.parentNode.removeChild(r);}r=j;break;}j=(l=j).nextSibling;if(!j){j=l;break;}if(l.nodeType==1){l.parentNode.removeChild(l);if(r){r.parentNode.removeChild(r);r=null;}}else{if(r){r.parentNode.removeChild(r);}r=l;}}c=j;}else{if(r){r.parentNode.removeChild(r);}r=l;}}else{if(r){r.parentNode.removeChild(r);}r=c;}if(apf.amlParts.length&&apf.amlParts[apf.amlParts.length-1][1]==o){apf.amlParts[apf.amlParts.length-1][1]=-1;}apf.amlParts.push([c.parentNode,apf.isIE?c.nextSibling:c.nextSibling]);}else{if(c.tagName=="SCRIPT"&&c.getAttribute("src")&&(c.getAttribute("src").indexOf("ajax.org")>-1)){var s=c.outerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/<SCRIPT[^>]*\>\s*<\!\[CDATA\[>?/i,"").replace(/<SCRIPT[^>]*\>(?:<\!\-\-)?/i,"").replace(/(\/\/)?\s*\&\#8211;>\s*<\/SCRIPT>/i,"").replace(/\-\->\s*<\/SCRIPT>/i,"").replace(/\]\](?:\&gt\;|>)\s*<\/SCRIPT>/i,"").replace(/<\/SCRIPT>$/mi,"").replace(/<\/?\s*(?:p|br)\s*\/?>/ig,"").replace(/<\!--\s*.*?\s*-->\s*<script.*/ig,"").replace(/\\+(['"])/g,"$1");if(s.trim()){var q=apf.getAmlDocFromString("<div jid='"+(a++)+"' "+g+">"+s+"</div>").documentElement;if(apf.isWebkit){q=apf.AppNode.ownerDocument.importNode(q,true);}apf.AppNode.appendChild(q);apf.amlParts.push([c.parentNode,c.nextSibling]);}}}if(!b&&c.firstChild||c.nextSibling){if(!b&&c.firstChild){c=c.firstChild;}else{c=c.nextSibling;}}else{do{c=c.parentNode;if(c.tagName=="BODY"){c=null;}}while(c&&!c.nextSibling);if(c){c=c.nextSibling;}}}if(r){r.parentNode.removeChild(r);}},parseAppMarkup:function(a){var b=false;if(this.parseStrategy==1||!this.parseStrategy&&!a&&document.documentElement.outerHTML.split(">",1)[0].indexOf(apf.ns.aml)==-1){this.parsePartialAml(a);if(this.parseStrategy==1||apf.amlParts.length){apf.isParsingPartial=true;apf.loadAmlIncludes(apf.AppNode);if(!self.ERROR_HAS_OCCURRED){apf.initialize();}return;}else{b=true;}}if(b&&document.documentElement.outerHTML.split(">",1)[0].indexOf(apf.ns.aml)==-1){return false;}if(this.parseStrategy==21||!this.parseStrategy&&!a){return apf.oHttp.get((apf.alternativeAml||document.body&&document.body.getAttribute("xmlurl")||location.href).split(/#/)[0],{callback:function(k,j,c){if(j!=apf.SUCCESS){var m=new Error(apf.formatErrorString(0,null,"Loading XML application data","Could not load XML from remote source: "+c.message));if(c.tpModule.retryTimeout(c,j,null,m)===true){return true;}throw m;}var l=k.replace(/\<\!DOCTYPE[^>]*>/,"").replace(/^[\r\n\s]*/,"");if(!apf.supportNamespaces){l=l.replace(/xmlns\=\"[^"]*\"/g,"");}if(self.ERROR_HAS_OCCURRED){return;}if(apf.isIE){document.body.innerHTML="";}else{var d=document.body.childNodes;for(var g=d.length-1;g>=0;g--){d[g].parentNode.removeChild(d[g]);}}document.body.style.display="block";apf.initialize(l);},ignoreOffline:true});}else{document.body.style.display="block";if(!self.ERROR_HAS_OCCURRED){apf.initialize(a.outerHTML||a.xml);}}},namespaces:{},setNamespace:function(a,b){this.namespaces[a]=b;b.namespaceURI=a;},initialize:function(l){apf.console.info("Initializing...");clearInterval(apf.Init.interval);apf.Init.run();var g=parseFloat(apf.getStyle(document.body,"marginTop"));apf.doesNotIncludeMarginInBodyOffset=(document.body.offsetTop!==g);if(apf.isParsingPartial){apf.config.setDefaults();apf.hasSingleRszEvent=true;var b=document.body;var c=b.lastChild;apf.AmlParser.parseMoreAml(apf.AppNode,b,null,true,false);var m,a,k,d,j=null,i=b.lastChild;while(i&&c!=i){d=apf.amlParts[i.getAttribute("jid")];k=i.previousSibling;if(d){m=d[0];if("P".indexOf(m.tagName)>-1){j=m.parentNode.insertBefore(apf.getNode(i,[0]),m);}else{a=apf.getNode(i,[0]);while(a){if(a){j=m.insertBefore(a,typeof d[1]=="number"?j:d[1]);}else{j=typeof d[1]=="number"?j:d[1];}a=apf.getNode(i,[0]);}}i.parentNode.removeChild(i);}i=k;}$setTimeout("apf.layout.forceResize();");}else{apf.window.init(l);}},execDeferred:function(){var a=apf.load_events.length;while(a--){(apf.load_events.shift())();}},load_events:[],load_timer:null,load_done:false,load_init:null,addDomLoadEvent:function(j){if(!this.$bdetect){this.browserDetect();}if(apf.load_done){return j();}if(!apf.load_init){apf.load_init=function(){if(apf.load_done){return;}clearInterval(apf.load_timer);apf.load_timer=null;apf.load_done=true;if(apf.started){apf.execDeferred();}};}apf.load_events.push(j);if(j&&apf.load_events.length==1){var k=document,c="undefined";if((typeof k.readyState!=c&&k.readyState=="complete")||(typeof k.readyState==c&&(k.getElementsByTagName("body")[0]||k.body))){return apf.load_init();}if(k.addEventListener&&!apf.isOpera){window.addEventListener("DOMContentLoaded",apf.load_init,false);}else{if(apf.isIE&&window==top){apf.load_timer=setInterval(function(){try{k.documentElement.doScroll("left");}catch(i){$setTimeout(arguments.callee,0);return;}apf.load_init();},10);}else{if(apf.isOpera){k.addEventListener("DOMContentLoaded",function(){apf.load_timer=setInterval(function(){for(var n=0,m=k.styleSheets.length;n<m;n++){if(k.styleSheets[n].disabled){return;}}apf.load_init();},10);},false);}else{if(apf.isWebkit&&!apf.isIphone){var g=k.getElementsByTagName("link"),b=g.length,d;for(;b>=0;b++){if(!g[b]||g[b].getAttribute("rel")!="stylesheet"){g.splice(b,0);}}d=g.length;apf.load_timer=setInterval(function(){if(/loaded|complete/.test(k.readyState)&&k.styleSheets.length==d){apf.load_init();}},10);}else{var a=window.onload;window.onload=function(){apf.load_init();if(a){a();}};}}}}}},addListener:function(c,b,a){if(c.addEventListener){c.addEventListener(b,a,false);}else{if(c.attachEvent){c.attachEvent("on"+b,a);}}return this;},removeListener:function(c,b,a){if(c.removeEventListener){c.removeEventListener(b,a,false);}else{if(c.detachEvent){c.detachEvent("on"+b,a);}}return this;},stopEvent:function(a){this.stopPropagation(a).preventDefault(a);return false;},stopPropagation:function(a){if(a.stopPropagation){a.stopPropagation();}else{a.cancelBubble=true;}return this;},preventDefault:function(a){if(a.preventDefault){a.preventDefault();}else{a.returnValue=false;}return this;},unload:function(b){this.isDestroying=true;this.popup.destroy();var d,c=0,a=this.all.length;for(;c<a;c++){d=this.all[c];if(d&&d!=b&&d.destroy&&!d.apf){d.destroy(false);}}for(c=0,a=this.availHTTP.length;c<a;c++){this.availHTTP[c]=null;}this.availHTTP.length=0;if(apf.xmldb){apf.xmldb.unbind(apf.window);}this.isDestroying=false;}};var $xmlns=function(b,a,d,c){if(!apf.supportNamespaces){if(!c){c=apf.findPrefix(b,d);}if(b.style||b==document){return b.getElementsByTagName(a);}else{if(c){(b.nodeType==9?b:b.ownerDocument).setProperty("SelectionNamespaces","xmlns:"+c+"='"+d+"'");}return b.selectNodes(".//"+(c?c+":":"")+a);}}return b.getElementsByTagNameNS(d,a);};var $setTimeout=setTimeout;var $setInterval=setInterval;document.documentElement.className+=" has_apf";apf.browserDetect();apf.Init.run("apf");apf.Class=function(){};apf.Class.prototype=new (function(){var FUN="function",OBJ="object",UNDEF="undefined",SEL="selected|selection";PROP="prop.",MODEL="model",VALUE="value";this.$regbase=0;this.hasFeature=function(test){return this.$regbase&test;};this.$initStack=[];this.$bufferEvents=[];this.$init=function(callback,nodeFunc,struct){if(typeof callback==FUN||callback===true){this.$bufferEvents=this.$bufferEvents.slice();if(callback===true){return this;}this.$initStack=this.$initStack.slice();this.$initStack.push(callback);return this;}this.addEventListener=realAddEventListener;this.$removalQueue=[];if(this.nodeType!=2){this.$uniqueId=apf.all.push(this)-1;}this.$captureStack={};this.$eventsStack={};this.$funcHandlers={};var i=0,l=this.$initStack.length;for(;i<l;i++){this.$initStack[i].apply(this,arguments);}for(i=0,l=this.$bufferEvents.length;i<l;i++){this.addEventListener.apply(this,this.$bufferEvents[i]);}delete realAddEventListener;delete this.$initStack;delete this.$bufferEvents;if(struct&&struct.htmlNode){this.$pHtmlNode=struct.htmlNode;this.ownerDocument.$domParser.$continueParsing(this);apf.queue.empty();}return this;};this.implement=apf.implement;this.$handlePropSet=function(prop,value){this[prop]=value;};this.$bindProperty=function(myProp,bObject,bProp,fParsed){if(!fParsed){return bObject.$handlePropSet(bProp,this[myProp]);}var eventName=PROP+myProp,eFunc,isBeingCalled,isLang;(this.$eventsStack[eventName]||(this.$eventsStack[eventName]=[])).push(eFunc=function(e){if(isBeingCalled){return;}apf.$lm_has_lang=false;isBeingCalled=true;try{if(fParsed.asyncs){return fParsed.call(bObject,bObject.xmlRoot,function(value){bObject.setProperty(bProp,value,true,false,10);if(apf.$lm_has_lang&&!isLang){isLang=true;apf.language.addProperty(bObject,bProp,fParsed);}isBeingCalled=false;});}else{var value=fParsed.call(bObject,bObject.xmlRoot);}}catch(e){apf.console.warn("[331] Could not execute binding for property "+bProp+"\n\n"+e.message);isBeingCalled=false;return;}bObject.setProperty(bProp,value,true,false,10);if(apf.$lm_has_lang&&!isLang){isLang=true;apf.language.addProperty(bObject,bProp,fParsed);}isBeingCalled=false;});return eFunc;};this.$attrExcludePropBind=false;this.$setDynamicProperty=function(prop,pValue){var exclNr=this.$attrExcludePropBind[prop],options;if(SEL.indexOf(prop)>-1){options={xpathmode:2,parsecode:true};}else{if(exclNr==2){options={nostring:true};}else{if(exclNr===0){options={parsecode:true};}}}var fParsed=apf.lm.compile(pValue,options);if(prop==MODEL){(this.$modelParsed=fParsed).instruction=pValue;}if(fParsed.type==2){this[prop]=!pValue;return this.setProperty(prop,exclNr==1?pValue:fParsed.str);}if(exclNr==2||fParsed.xpaths.length&&exclNr!=1){if(!this.hasFeature(apf.__DATABINDING__)){this.implement(apf.StandardBinding);}this.$addAttrBind(prop,fParsed,pValue);}var matches=exclNr&&exclNr!=3&&prop!=MODEL?{}:fParsed.props,found=false,_self=this,o,node,bProp,p;for(p in matches){o=p.split(".");if(o.length>2){bProp=o.pop();try{node=eval(o.join("."));}catch(e){if(arguments[2]){apf.console.warn("[287] Could not execute binding test : "+pValue.replace(/</g,"&lt;")+"\n\n"+e.message);}else{apf.queue.add(prop+":"+this.$uniqueId,function(){_self.$clearDynamicProperty(prop);_self.$setDynamicProperty(prop,pValue,true);});}continue;}if(!node||typeof node!=OBJ||!node.$regbase){bProp=o[1];node=self[o[0]];}else{o.push(bProp);}}else{bProp=o[1];node=self[o[0]]||o[0]=="this"&&this;}if(!node){if(arguments[2]){apf.console.warn("[287] Could not execute binding test : "+pValue.replace(/</g,"&lt;")+"\n\n"+o[0]+" does not exist");}else{apf.queue.add(prop+":"+this.$uniqueId,function(){_self.$clearDynamicProperty(prop);_self.$setDynamicProperty(prop,pValue,true);});return;}}if(!node.$bindProperty){continue;}if(!this.$funcHandlers[prop]){this.$funcHandlers[prop]=[];}this.$funcHandlers[prop].push({amlNode:node,prop:bProp,handler:node.$bindProperty(bProp,this,prop,fParsed)});found=true;}if(found){this.$funcHandlers[prop][0].handler({initial:true});}else{if(exclNr){return this.setProperty(prop,pValue);}apf.$lm_has_lang=false;try{if(fParsed.asyncs){return fParsed.call(this,this.xmlRoot,function(value){_self.setProperty(prop,value,true);if(apf.$lm_has_lang){apf.language.addProperty(this,prop,fParsed);}});}else{var value=fParsed.call(this,this.xmlRoot);}}catch(e){apf.console.warn("[331] Could not execute binding test or: "+pValue.replace(/</g,"&lt;")+"\n\n"+e.message);return;}this[prop]=!value;this.setProperty(prop,value,true);if(apf.$lm_has_lang){apf.language.addProperty(this,prop,fParsed);}}};this.$clearDynamicProperty=function(prop){if(this.$removeAttrBind){this.$removeAttrBind(prop);}apf.language.removeProperty(this,prop);if(prop==MODEL){this.$modelParsed=null;}var f,i,l,h=this.$funcHandlers[prop];if(h&&typeof h!=FUN){for(i=0,l=h.length;i<l;i++){(f=h[i]).amlNode.removeEventListener(PROP+f.prop,f.handler);}delete this.$funcHandlers[prop];}};this.watch=function(propName,callback){var eventName=PROP+propName,wrapper=function(e){callback.call(this,propName,e.oldvalue,e.value);};wrapper.callback=callback;(this.$eventsStack[eventName]||(this.$eventsStack[eventName]=[])).push(wrapper);};this.unwatch=function(propName,callback){var list,eventName=PROP+propName;if(!(list=this.$eventsStack[eventName])){return;}for(var i=0,l=list.length;i<l;i++){if(list[i].callback==callback){list.remove(i);return;}}};this.getAvailableProperties=function(){return this.$supportedProperties.slice();};this.setProperty=function(prop,value,forceOnMe,setAttr,inherited){var s,r,arr,e,i,l,oldvalue=this[prop],isChanged=(typeof value==OBJ)?value!=(typeof oldvalue==OBJ?oldvalue:null):String(oldvalue)!==String(value),eventName=PROP+prop;if(isChanged){if(!forceOnMe){if(this.xmlRoot&&typeof value!=OBJ&&(!(s=this.$attrExcludePropBind[prop]))&&(r=(this.$attrBindings&&this.$attrBindings[prop]||prop!=VALUE&&this.$bindings[prop]&&this.$bindings[prop][0]))){if(r.cvalue.type==3){return apf.setNodeValue(this.$getDataNode(prop.toLowerCase(),this.xmlRoot,true),value,true);}}}if(this.$handlePropSet(prop,value,forceOnMe)===false){return;}value=this[prop];if(setAttr){this.setAttribute(prop,value,true);}}if(arr=this.$eventsStack[eventName]){if(this.dispatchEvent(eventName,{prop:prop,value:value,oldvalue:oldvalue})===false){e.returnValue=false;}}if((aci||(aci=apf.config.$inheritProperties))[prop]&&this.$amlLoaded){if(inherited!=10&&!value){delete this.$inheritProperties[prop];if(this.$setInheritedAttribute(prop)){return;}}else{if(inherited!=10){this.$inheritProperties[prop]=inherited||-1;}}if((!e||e.returnValue!==false)&&this.childNodes){(function recur(nodes){var i,l,node,n;for(i=0,l=nodes.length;i<l;i++){node=nodes[i];if(node.nodeType!=1){continue;}if(!(n=node.$inheritProperties[prop])){recur(node.childNodes);}else{if(n>0){node.setProperty(prop,value,false,false,2);}}}})(this.childNodes);}}return value;};var aci;this.getProperty=function(prop){return this[prop];};apf.eventDepth=0;this.dispatchEvent=function(eventName,options,e){var arr,result,rValue,i,l;apf.eventDepth++;e=options&&options.name?options:e;if(!e||!e.currentTarget){if(!(options||(options={})).currentTarget){options.currentTarget=this;}if(arr=this.$captureStack[eventName]){for(i=0,l=arr.length;i<l;i++){rValue=arr[i].call(this,e||(e=new apf.AmlEvent(eventName,options)));if(typeof rValue!=UNDEF){result=rValue;}}}}if(options&&options.captureOnly){return e&&typeof e.returnValue!=UNDEF?e.returnValue:result;}else{if(this["on"+eventName]){result=this["on"+eventName].call(this,e||(e=new apf.AmlEvent(eventName,options)));}if(arr=this.$eventsStack[eventName]){for(i=0,l=arr.length;i<l;i++){if(!arr[i]){continue;}rValue=arr[i].call(this,e||(e=new apf.AmlEvent(eventName,options)));if(typeof rValue!=UNDEF){result=rValue;}}}}if((e&&e.bubbles&&!e.cancelBubble||options&&options.bubbles)&&this!=apf){rValue=(this.parentNode||apf).dispatchEvent(eventName,null,e||(e=new apf.AmlEvent(eventName,options)));if(typeof rValue!=UNDEF){result=rValue;}}var p;while(this.$removalQueue.length){p=this.$removalQueue.shift();p[0].remove(p[1]);}if(--apf.eventDepth==0&&this.ownerDocument&&!this.ownerDocument.$domParser.$parseContext&&!apf.isDestroying&&apf.queue){apf.queue.empty();}return e&&typeof e.returnValue!=UNDEF?e.returnValue:result;};this.addEventListener=function(a,b,c){this.$bufferEvents.push([a,b,c]);};var realAddEventListener=function(eventName,callback,useCapture){if(eventName.substr(0,2)=="on"){eventName=eventName.substr(2);}var stack=useCapture?this.$captureStack:this.$eventsStack;if(!stack[eventName]){stack[eventName]=[];}if(stack[eventName].indexOf(callback)==-1){stack[eventName].unshift(callback);}var f;if(f=this.$eventsStack["$event."+eventName]){f[0].call(this,callback);}};this.removeEventListener=function(eventName,callback,useCapture){var stack=useCapture?this.$captureStack:this.$eventsStack;if(stack[eventName]){this.$removalQueue.push([stack[eventName],callback]);}};this.hasEventListener=function(eventName){return(this.$eventsStack[eventName]&&this.$eventsStack[eventName].length>0);};this.destroy=function(deep,clean){if(typeof this.$uniqueId==UNDEF&&this.nodeType!=2){return;}this.$amlLoaded=false;this.$amlDestroyed=true;if(this.$destroy){this.$destroy();}this.dispatchEvent("DOMNodeRemoved");this.dispatchEvent("DOMNodeRemovedFromDocument");apf.all[this.$uniqueId]=undefined;if(!this.nodeFunc&&this.nodeType!=2){try{if(this.id||this.name){self[this.id||this.name]=null;}}catch(ex){}return;}if(this.$ext&&!this.$ext.isNative&&this.$ext.nodeType==1&&this.localName!="a"){this.$ext.oncontextmenu=this.$ext.host=null;if(clean){if(this.localName!="collection"){this.$ext.parentNode.removeChild(this.$ext);}}}if(this.$int&&!this.$int.isNative&&this.$int.nodeType==1&&this.localName!="a"){this.$int.host=null;}this.$aml=null;if(deep&&this.childNodes){var nodes=this.childNodes;for(i=nodes.length-1;i>=0;i--){if(nodes[i].destroy){nodes[i].destroy(true,clean&&this.localName=="collection");}}this.childNodes=null;}if(this.parentNode&&this.removeNode){this.removeNode();}else{if(this.ownerElement&&!this.ownerElement.$amlDestroyed){this.ownerElement.removeAttributeNode(this);}}if(this.$focussable&&this.focussable){apf.window.$removeFocus(this);}if(this.attributes){var attr=this.attributes;for(var i=attr.length-1;i>=0;i--){this.$clearDynamicProperty(attr[i].nodeName);attr[i].destroy();}}try{if(this.id||this.name){self[this.id||this.name]=null;}}catch(ex){}apf.nameserver.remove(this.localName,this);};})();apf.extend(apf,new apf.Class().$init());apf.Init.run("class");apf.color={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"},fixHSB:function(a){return{h:Math.min(360,Math.max(0,a.h)),s:Math.min(100,Math.max(0,a.s)),b:Math.min(100,Math.max(0,a.b))};},fixRGB:function(a){return{r:Math.min(255,Math.max(0,a.r)),g:Math.min(255,Math.max(0,a.g)),b:Math.min(255,Math.max(0,a.b))};},fixHex:function(c){var a=6-c.length;if(a>0){var d=[],b=0;for(;b<a;b++){d.push("0");}d.push(c);c=d.join("");}return c;},hexToRGB:function(a){a=parseInt(((a.indexOf("#")>-1)?a.substring(1):a),16);return{r:a>>16,g:(a&65280)>>8,b:(a&255)};},hexToHSB:function(a){return this.RGBToHSB(this.hexToRGB(a));},RGBToHSB:function(c){var b={h:0,s:0,b:0};var d=Math.min(c.r,c.g,c.b),a=Math.max(c.r,c.g,c.b),g=a-d;b.b=a;if(a!=0){}b.s=a!=0?255*g/a:0;if(b.s!=0){if(c.r==a){b.h=(c.g-c.b)/g;}else{if(c.g==a){b.h=2+(c.b-c.r)/g;}else{b.h=4+(c.r-c.g)/g;}}}else{b.h=-1;}b.h*=60;if(b.h<0){b.h+=360;}b.s*=100/255;b.b*=100/255;return b;},HSBToRGB:function(a){var c={},j=Math.round(a.h),i=Math.round(a.s*255/100),b=Math.round(a.b*255/100);if(i==0){c.r=c.g=c.b=b;}else{var k=b,g=(255-i)*b/255,d=(k-g)*(j%60)/60;if(j==360){j=0;}if(j<60){c.r=k,c.b=g,c.g=g+d;}else{if(j<120){c.g=k,c.b=g,c.r=k-d;}else{if(j<180){c.g=k,c.r=g,c.b=g+d;}else{if(j<240){c.b=k,c.r=g,c.g=k-d;}else{if(j<300){c.b=k,c.g=g,c.r=g+d;}else{if(j<360){c.r=k,c.g=g,c.b=k-d;}else{c.r=0,c.g=0,c.b=0;}}}}}}}return{r:Math.round(c.r),g:Math.round(c.g),b:Math.round(c.b)};},RGBToHex:function(a){var c=[a.r.toString(16),a.g.toString(16),a.b.toString(16)],b=0;for(;b<3;b++){if(c[b].length==1){c[b]="0"+c[b];}}return c.join("");},HSBToHex:function(a){return this.RGBToHex(this.HSBToRGB(a));}};apf.isChildOf=function(a,d,b){if(!a||!d){return false;}if(d.nodeType==2){d=d.ownerElement||d.selectSingleNode("..");}if(b&&a==d){return true;}var c=d.parentNode;while(c){if(c==a){return true;}c=c.parentNode;}return false;};apf.isOnlyChild=function(j,b){if(!j||!j.parentNode||b&&b.indexOf(j.nodeType)==-1){return false;}var d,a,g,c=j.parentNode.childNodes;for(d=0,a=c.length;d<a;d++){g=c[d];if(g.nodeType==1&&g!=j){return false;}if(g.nodeType==3&&!g.nodeValue.trim()){return false;}}return true;};apf.getChildNumber=function(g,b){var k=g.parentNode,c=0;if(!k){return 0;}for(var d=0,a=k.childNodes.length;d<a;d++){if(k.childNodes[d]==g){return c;}if(!b||g.nodeType==1&&g.tagName==k.childNodes[d].tagName){c++;}}return c;};apf.mergeXml=function(t,n,x){if(typeof n!="object"){n=getElementById(n);}if(x&&x.clearContents){var c,g,m,a=n.selectNodes("descendant::node()[@"+apf.xmldb.xmlListenTag+"]");for(m=a.length-1;m>=0;m--){var w=a[m].getAttribute(apf.xmldb.xmlListenTag).split(";");for(g=w.length-1;g>=0;g--){c=apf.all[w[g]];if(c.dataParent&&c.dataParent.xpath){c.dataParent.parent.signalXmlUpdate[c.$uniqueId]=true;}else{if(c.$model){c.$model.$waitForXml(c);}}}}a=n.childNodes;for(m=a.length-1;m>=0;m--){n.removeChild(a[m]);}}if(x&&x.start){var b,q,a,r,m,d,k=x.marker;if(!k){}if(k.getAttribute("start")-x.start==0){k.setAttribute("start",x.start+x.length);b=parseInt(k.getAttribute("reserved"));k.setAttribute("reserved",b+x.length);q=k;}else{if(x.start+x.length==k.getAttribute("end")){k.setAttribute("end",x.start+x.length);q=k.nextSibling;b=parseInt(k.getAttribute("reserved"))+parseInt(k.getAttribute("end"))-x.length;}else{var u=k.parentNode.insertBefore(k.cloneNode(true),k);u.setAttribute("end",x.start-1);k.setAttribute("start",x.start+x.length);b=parseInt(k.getAttribute("reserved"));k.setAttribute("reserved",b+x.length);q=k;}}a=t.childNodes;if(n.ownerDocument.importNode){r=n.ownerDocument;for(m=0,d=a.length;m<d;m++){n.insertBefore(r.importNode(a[m],true),q).setAttribute(apf.xmldb.xmlIdTag,x.documentId+"|"+(b+m));}}else{for(m=a.length-1;m>=0;m--){n.insertBefore(a[0],q).setAttribute(apf.xmldb.xmlIdTag,x.documentId+"|"+(b+m));}}}else{q=x&&x.beforeNode?x.beforeNode:apf.getNode(n,[0]);a=t.childNodes;if(n.ownerDocument.importNode){r=n.ownerDocument;for(m=0,d=a.length;m<d;m++){n.insertBefore(r.importNode(a[m],true),q);}}else{for(m=a.length-1;m>=0;m--){n.insertBefore(a[0],q);}}}if(x&&x.copyAttributes){var o=t.attributes;for(m=0;m<o.length;m++){if(o[m].nodeName!=apf.xmldb.xmlIdTag){n.setAttribute(o[m].nodeName,o[m].nodeValue);}}}return n;};apf.setNodeValue=function(g,d,j,c){if(!g){return;}var i,a,b;if(c){i=c.undoObj;a=c.xpath;b=c.newNodes;i.extra.oldValue=c.forceNew?"":apf.queryValue(g,a);i.xmlNode=g;if(a){g=apf.createNodeFromXpath(g,a,b,c.forceNew);}i.extra.appliedNode=g;}if(g.nodeType==1){if(!g.firstChild){g.appendChild(g.ownerDocument.createTextNode("-"));}g.firstChild.nodeValue=apf.isNot(d)?"":d;if(j){apf.xmldb.applyChanges("synchronize",g,i);}}else{g.nodeValue=apf.isNot(d)?"":d;if(j){apf.xmldb.applyChanges("synchronize",g.parentNode||g.ownerElement||g.selectSingleNode(".."),i);}}if(j){apf.xmldb.applyRSB(["setNodeValue",g,d],i);}};apf.setQueryValue=function(b,a,d){var c=apf.createNodeFromXpath(b,a);if(!c){return null;}apf.setNodeValue(c,d,true);return c;};apf.queryValue=function(b,a){if(!b){return"";}if(b.nodeType==2){return b.nodeValue;}if(a){b=b.selectSingleNode(a);if(!b){return"";}}return b.nodeType==1?(!b.firstChild?"":b.firstChild.nodeValue):b.nodeValue;};apf.queryValues=function(g,b){var c=[];if(!g){return c;}var a=g.selectNodes(b);if(!a.length){return c;}for(var d=0;d<a.length;d++){var j=a[d];if(j.nodeType==1){j=j.firstChild;}c.push(j.nodeValue||"");}return c;};apf.queryNodes=function(b,a){if(a&&(apf.hasXPathHtmlSupport&&a.selectSingleNode||!a.style)){return a.selectNodes(b);}return apf.XPath.selectNodes(b,a);};apf.queryNode=function(b,a){if(a&&(apf.hasXPathHtmlSupport&&a.selectSingleNode||!a.style)){return a.selectSingleNode(b);}var c=apf.queryNodes(b+(apf.isIE?"":"[1]"),a?a:null);return c.length>0?c[0]:null;};apf.getInheritedAttribute=function(d,c,g){var b,a;if(d.nodeValue!=1){d=d.parentNode;}while(d&&(d.nodeType!=1||!(b=c&&((a=d.getAttribute(c))||typeof a=="string")||g&&g(d)))){d=d.parentNode;}if(a==""){return"";}return !b&&c&&apf.config?apf.config[c]:b;};apf.createNodeFromXpath=function(g,t,j,l){var r,q="",u=t.replace(/('.*?')|(".*?")|\|/g,function(i,x,w){if(x||w){return x||w;}return"-%-|-%-";}).split("-%-|-%-")[0].split("/");if(!l&&(r=g.selectSingleNode(t))){return r;}var k=u.length-1;if(l){if(u[k].trim().match(/^\@(.*)$|^text\(\)$/)){k--;}}for(var a,m=false,c=0;c<k;c++){if(!m&&g.selectSingleNode(q+(c!=0?"/":"")+u[c])){q+=(c!=0?"/":"")+u[c];continue;}var b=u[c].match(/(\w+)\[@([\w-]+)=(\w+)\]/);if(b){u[c]=b[1];}m=true;a=g.selectSingleNode(q||".").appendChild(g.ownerDocument.createElement(u[c]));if(b){a.setAttribute(b[2],b[3]);q+=(q?"/":"")+b[0];}else{q+=(q?"/":"")+u[c];}if(j){j.push(a);}}if(!q){q=".";}var o,d=u[k],n=g.nodeType==9?g:g.ownerDocument;do{if(d.match(/^\@(.*)$/)){(o||g.selectSingleNode(q)).setAttributeNode(o=g.ownerDocument.createAttribute(RegExp.$1));}else{if(d.trim()=="text()"){o=(o||g.selectSingleNode(q)).appendChild(g.ownerDocument.createTextNode(""));}else{var s=d.match(/(\w+)\[@([\w-]+)=(\w+)\]/);if(s){d=s[1];}o=(o||g.selectSingleNode(q)).appendChild(n.createElement(d));if(s){o.setAttribute(s[2],s[3]);}if(j){j.push(o);}}}q+=(q?"/":"")+u[k];}while((d=u[++k]));return o;};apf.convertMethods={json:function(a){return JSON.stringify(apf.xml2json(a));},cgivars:function(o,s){if(!s){s="";}var t,b,g,m,c,r=[],a=o.childNodes,k={},n=0,d=a.length;for(;n<d;++n){if(a[n].nodeType!=1){continue;}b=a[n].tagName;if(k[b]){continue;}g=o.selectNodes(b);if(g.length>1){k[b]=true;for(m=0,c=g.length;m<c;m++){t=this.cgivars(g[m],s+b+"["+m+"]");if(t){r.push(t);}}}else{t=this.cgivars(a[n],s+b);if(t){r.push(t);}}}var q=o.attributes;for(n=0,d=q.length;n<d;n++){if(q[n].nodeValue){if(s){r.push(s+"["+q[n].nodeName+"]="+escape(q[n].nodeValue));}else{r.push(q[n].nodeName+"="+escape(q[n].nodeValue));}}}if(r.length){return r.join("&");}t=apf.queryValue(o,"text()");if(s&&t){return s+"="+escape(t);}return"";},cgiobjects:function(n,r,w,x){if(!r){r="";}var d=n.childNodes,k;var g=[],u={};var y="",c,t;var s,m,l;var o,b;var q;for(m=0;m<d.length;m++){k=d[m];if(k.nodeType==1){c=k.tagName;q=k.parentNode.selectNodes(c).length==1?true:false;if(typeof u[c]=="undefined"){u[c]=0;}y=r+(w?"[":"")+c+(w?"]":"")+(q?"":"["+u[c]+"]");o=k.attributes;b=k.attributes.length;if(b>0){for(l=0;l<b;l++){if(!(s=o[l]).nodeValue){continue;}g.push(y+"[_"+s.nodeName+"]="+escape(s.nodeValue.trim()));}}t=this.cgiobjects(k,y,true);if(t.dataType!==1){g.push(t);}else{if(k.firstChild&&k.firstChild.nodeValue.trim()){g.push(y+(b>0?"[_]=":"=")+escape(k.firstChild.nodeValue.trim()));}else{if(b==0){if(x){g.push(y);}}}}u[c]++;}}if(!w&&n.getAttribute("id")){g.push("id="+escape(n.getAttribute("id")));}if(g.length){return g.join("&");}return g;}};apf.convertXml=function(a,b){return apf.convertMethods[b](a);};apf.getTextNode=function(a){for(var c=0,b=a.childNodes.length;c<b;++c){if(a.childNodes[c].nodeType==3||a.childNodes[c].nodeType==4){return a.childNodes[c];}}return false;};apf.getBoundValue=function(b,d,c){if(!d&&!b.xmlRoot){return"";}var a=b.$getDataNode("value",b.xmlRoot);return a?apf.queryValue(a):"";};apf.getArrayFromNodelist=function(d){for(var b=[],c=0,a=d.length;c<a;++c){b.push(d[c]);}return b;};apf.serializeChildren=function(d){var j,g=[],b=d.childNodes,c=0,a=b.length;for(;c<a;++c){g[c]=(j=b[c]).nodeType==1?j.xml||j.serialize():(j.nodeType==8?"":j.nodeValue);}return g.join("");};apf.getXmlString=function(b){var a=apf.xmldb.cleanNode(b.cloneNode(true));return a.xml||a.serialize();};apf.getXml=function(c,a,b){return apf.getXmlDom(c,a,b).documentElement;};apf.formatXml=function(g){g=g.trim();var b=g.split("\n"),d=0,c=0,a=b.length;for(;c<a;++c){b[c]=b[c].trim();}b=b.join("\n").replace(/\>\n/g,">").replace(/\>/g,">\n").replace(/\n\</g,"<").replace(/\</g,"\n<").split("\n");b.removeIndex(0);b.removeIndex(b.length);for(c=0,a=b.length;c<a;c++){b[c]="    ".repeat((b[c].match(/^\s*\<\//)?(d==0)?0:--d:(b[c].match(/^\s*\<[^\?][^>]+[^\/]\>/)?d++:d)))+b[c];}if(!g){return"";}return b.join("\n");};apf.xmlToXpath=function(n,o,m){if(!n){return"";}if(m===true&&n.nodeType==1&&n.getAttribute(apf.xmldb.xmlIdTag)){return"//node()[@"+apf.xmldb.xmlIdTag+"='"+n.getAttribute(apf.xmldb.xmlIdTag)+"']";}if(apf!=this&&this.lookup&&this.select){var g,b=this.lookup[n.tagName];if(b){g=n.selectSingleNode(b).nodeValue;return"//"+n.tagName+"["+b+"='"+g+"']";}for(var j=0,d=this.select.length;j<d;j++){if(n.selectSingleNode(this.select[j][0])){g=n.selectSingleNode(this.select[j][1]).nodeValue;return"//"+this.select[j][0]+"["+this.select[j][1]+"='"+g+"']";}}}if(n==o){return".";}if(!n.parentNode&&!n.ownerElement){return false;}var k=[],c=n;if(c.nodeType==2){k.push("@"+c.nodeName);c=c.ownerElement||n.selectSingleNode("..");}var a;do{k.unshift((c.nodeType==1?c.tagName:"text()")+"["+(m&&(a=c.nodeType==1&&c.getAttribute(apf.xmldb.xmlIdTag))?"@"+apf.xmldb.xmlIdTag+"='"+a+"'":(apf.getChildNumber(c,true)+1))+"]");c=c.parentNode;}while(c&&c.nodeType==1&&c!=o);return k.join("/");};apf.xpathToXml=function(a,b){if(!b){return false;}return b.selectSingleNode(a);};apf.flash=(function(){function getControlVersion(){var version,axo;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version");}catch(e){}if(!version){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version");}catch(e){}}if(!version){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version=axo.GetVariable("$version");}catch(e){}}if(!version){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version="WIN 3,0,18,0";}catch(e){}}if(!version){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11";}catch(e){version=-1;}}return version;}function getSwfVersion(){var flashVer=-1,sAgent=navigator.userAgent.toLowerCase();if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"",swfDescr=navigator.plugins["Shockwave Flash"+swVer2].description,aDescr=swfDescr.split(" "),aTempMaj=aDescr[2].split("."),nMajor=aTempMaj[0],nMinor=aTempMaj[1],sRev=aDescr[3];if(sRev==""){sRev=aDescr[4];}if(sRev[0]=="d"){sRev=sRev.substring(1);}else{if(sRev[0]=="r"){sRev=sRev.substring(1);if(sRev.indexOf("d")>0){sRev=sRev.substring(0,sRev.indexOf("d"));}}}flashVer=nMajor+"."+nMinor+"."+sRev;}}else{if(sAgent.indexOf("webtv/2.6")!=-1){flashVer=4;}else{if(sAgent.indexOf("webtv/2.5")!=-1){flashVer=3;}else{if(sAgent.indexOf("webtv")!=-1){flashVer=2;}else{if(apf.isIE&&!apf.isOpera){flashVer=getControlVersion();}}}}}return flashVer;}function detectFlashVersion(reqMajorVer,reqMinorVer,reqRevision){var versionStr=getSwfVersion();if(versionStr==-1){return false;}if(versionStr!=0){var aVersions;if(apf.isIE&&!apf.isOpera){var aTemp=versionStr.split(" "),sTemp=aTemp[1];aVersions=sTemp.split(",");}else{aVersions=versionStr.split(".");}var nMajor=aVersions[0],nMinor=aVersions[1],sRev=aVersions[2];if(nMajor>parseFloat(reqMajorVer)){return true;}if(nMajor==parseFloat(reqMajorVer)){if(nMinor>parseFloat(reqMinorVer)){return true;}if(nMinor==parseFloat(reqMinorVer)&&sRev>=parseFloat(reqRevision)){return true;}}return false;}}function generateObj(objAttrs,params,embedAttrs,stdout){if(stdout=="undefined"){stdout=false;}var i,str=[];if(apf.isIE&&!apf.isOpera){str.push("<object ");for(i in objAttrs){str.push(i,'="',objAttrs[i],'" ');}str.push(">");for(i in params){str.push('<param name="',i,'" value="',params[i],'" />');}str.push("</object>");}else{str.push("<embed ");for(i in embedAttrs){str.push(i,'="',embedAttrs[i],'" ');}str.push("></embed>");}var sOut=str.join("");if(stdout===true){document.write(sOut);}return sOut;}function AC_FL_RunContent(options){var ret=AC_GetArgs(options,"movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");return generateObj(ret.objAttrs,ret.params,ret.embedAttrs);}function buildContent(options){var v=isEightAvailable();if(isAvailable()&&!v){return buildInstaller(options||{});}if(v){return AC_FL_RunContent(options);}return'This content requires the             <a href="http://www.adobe.com/go/getflash/">Adobe Flash Player</a>.';}function embed(options){var obj=options.context,node=options.htmlNode,prop=options.property||"$player";delete options.context,delete options.htmlNode,delete options.property;var content=buildContent(options),cb=function(){$setTimeout(function(){node.innerHTML=content;obj[prop]=getElement(options.id);$setTimeout(function(){var fail=null;if(!obj[prop].parentNode){fail="File Uploader error: The movie has to be enabled manually because of Flashblock. No browser refresh is required.";}else{if(obj[prop].style.display=="none"){fail="File Uploader error: Adblock Plus blocks or hides the movie. Please enable it and refresh your browser.";}else{if(!obj[prop].offsetWidth){fail="File Uploader error: The Flash movie failed to load. Please check if the file exists and the path is correct.";}}}if(fail){obj.dispatchEvent("error",{message:fail});}},1000);},200);};return apf.loaded?cb():apf.addEventListener("load",cb);}function buildInstaller(options){if(!options){options={};}var ret=AC_GetArgs(options,"movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash"),MMPlayerType=(apf.isIE==true)?"ActiveX":"PlugIn",MMredirectURL=window.location;document.title=document.title.slice(0,47)+" - Flash Player Installation";var MMdoctitle=document.title;return AC_FL_RunContent({src:"playerProductInstall",FlashVars:"MMredirectURL="+MMredirectURL+"&MMplayerType="+MMPlayerType+"&MMdoctitle="+MMdoctitle+"",width:"100%",height:"100%",align:"middle",id:ret.embedAttrs.name,quality:"high",bgcolor:"#000000",name:ret.embedAttrs.name,allowScriptAccess:"always",type:"application/x-shockwave-flash",pluginspage:"http://www.adobe.com/go/getflashplayer"});}var sSrc="src|movie",sObj="onafterupdate|onbeforeupdate|onblur|oncellchange|onclick|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondrop|onfinish|onfocus|onhelp|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup|onload|onlosecapture|onpropertychange|onreadystatechange|onrowsdelete|onrowenter|onrowexit|onrowsinserted|onstart|onscroll|onbeforeeditfocus|onactivate|onbeforedeactivate|ondeactivate|type|codebase|id",sEmb="width|height|align|vspace|hspace|class|title|accesskey|name|tabindex";function AC_GetArgs(options,srcParamName,classid,mimeType){var i,name,ret={embedAttrs:{},params:{},objAttrs:{}};for(i in options){name=i.toLowerCase();if(name=="classid"){continue;}if(name=="pluginspage"){ret.embedAttrs[i]=options[i];}else{if(sSrc.indexOf(name)>-1){ret.embedAttrs.src=options[i];ret.params[srcParamName]=options[i];}else{if(sObj.indexOf(name)>-1){ret.objAttrs[i]=options[i];}else{if(sEmb.indexOf(name)>-1){ret.embedAttrs[i]=ret.objAttrs[i]=options[i];}else{ret.embedAttrs[i]=ret.params[i]=options[i];}}}}}ret.objAttrs.classid=classid;if(mimeType){ret.embedAttrs.type=mimeType;}return ret;}function getElement(id){var elem;if(typeof id=="object"){return id;}if(apf.isIE){return self[id];}else{elem=document[id]?document[id]:document.getElementById(id);if(!elem){elem=apf.lookup(id);}return elem;}}var hash={},uniqueID=1;function addPlayer(player){hash[++uniqueID]=player;return uniqueID;}function getPlayer(id){return hash[id];}function callMethod(id,methodName){var player=hash[id];if(player==null){throw new Error(apf.formatErrorString(0,this,"Player with id: "+id+" not found"));}if(player[methodName]==null){throw new Error(apf.formatErrorString(0,this,"Method "+methodName+" Not found"));}var args=[],i=2,l=arguments.length;for(;i<l;i++){args.push(decode(arguments[i]));}player[methodName].apply(player,args);}function remote(o,fn){if(typeof o=="string"){o=hash[o];}var rs=o.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");return eval(rs);}function encode(data){if(!data||typeof data!="string"){return data;}return data.replace(/\&([^;]*)\;/g,"&amp;$1;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace("\\","&custom_backslash;").replace(/\0/g,"\\0").replace(/\"/g,"&quot;");}function decode(data){if(data&&data.length&&typeof data!="string"){data=data[0];}if(!data||typeof data!="string"){return data;}return data.replace(/\&custom_lt\;/g,"<").replace(/\&custom_gt\;/g,">").replace(/\&custom_backslash\;/g,"\\").replace(/\\0/g,"\0");}var aIsAvailable={};function isAvailable(sVersion){if(typeof sVersion!="string"){sVersion="6.0.65";}var aVersion=sVersion.split(".");while(aVersion.length<3){aVersion.push("0");}if(typeof aIsAvailable[sVersion]=="undefined"){aIsAvailable[sVersion]=detectFlashVersion(parseInt(aVersion[0]),parseInt(aVersion[1]),parseInt(aVersion[2]));}return aIsAvailable[sVersion];}function isEightAvailable(){return isAvailable("8.0.0");}var oSandboxTypes={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 getSandbox(sType){var oSandbox={type:null,description:null,noRemote:false,noLocal:false,error:null};oSandbox.type=sType.toLowerCase();oSandbox.description=oSandboxTypes[(typeof oSandboxTypes[oSandbox.type]!="undefined"?oSandbox.type:"unknown")];if(oSandbox.type=="localwithfile"){oSandbox.noRemote=true;oSandbox.noLocal=false;oSandbox.error="Flash security note: Network/internet URLs will not                                  load due to security restrictions.                                 Access can be configured via Flash Player Global Security                                 Settings Page:                                  http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";}else{if(oSandbox.type=="localwithnetwork"){oSandbox.noRemote=false;oSandbox.noLocal=true;}else{if(oSandbox.type=="localtrusted"){oSandbox.noRemote=false;oSandbox.noLocal=false;}}}return oSandbox;}return{isAvailable:isAvailable,isEightAvailable:isEightAvailable,buildContent:buildContent,embed:embed,encode:encode,decode:decode,getElement:getElement,addPlayer:addPlayer,getPlayer:getPlayer,callMethod:callMethod,getSandbox:getSandbox,remote:remote};})();apf.isJson=(function(){var b=/\\["\\\/bfnrtu]/g,a=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,d=/(?:^|:|,)(?:\s*\[)+/g,c=/^[\],:{}\s]*$/;return function(g){if(!g){return false;}return c.test(g.replace(b,"@").replace(a,"]").replace(d,""));};})();if(!self.JSON){self.JSON=(function(){var g=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),m=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),j={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},k=function(n,o,q){return o?j[o]:String.fromCharCode(parseInt(q,16));},b=new String(""),a="\\",i={"{":Object,"[":Array},c=Object.hasOwnProperty,l=function(n,o){n=o+n;return n.substring(n.length-o.length);},d={0:function(q){if(q.nodeType&&q.ownerDocument&&q.cloneNode(true)){return"apf.xmldb.getXml("+JSON.stringify(apf.getXmlString(q))+")";}var n=[];for(var r in q){n.push('"'+r.replace(/(["\\])/g,"\\$1")+'": '+JSON.stringify(q[r]));}return"{"+n.join(", ")+"}";},5:function(n){n='"'+n.replace(/(["\\])/g,"\\$1")+'"';return n.replace(/(\n)/g,"\\n").replace(/\r/g,"");},2:function(n){return n.toString();},4:function(n){return n.toString();},3:function(n){return'{"jsonclass":["sys.ISODate", ["'+l(n.getUTCFullYear(),"0000")+l(n.getUTCMonth()+1,"00")+l(n.getUTCDate(),"00")+"T"+l(n.getUTCHours(),"00")+":"+l(n.getUTCMinutes(),"00")+":"+l(n.getUTCSeconds(),"00")+'"]]}';},1:function(n){for(var r=[],o=0;o<n.length;o++){r.push(JSON.stringify(n[o]));}return"["+r.join(", ")+"]";},7:function(n){return;}};return{parse:function(x,s){var r=x.match(g),z;var y=r[0];if("{"==y){z={};}else{if("["==y){z=[];}else{throw new Error(y);}}var w,A,t=[z];for(var q=1,o=r.length;q<o;++q){y=r[q];switch(y.charCodeAt(0)){default:A=t[0];A[w||A.length]=+(y);w=void 0;break;case 34:y=y.substring(1,y.length-1);if(y.indexOf(a)!==-1){y=y.replace(m,k);}A=t[0];if(!w){if(A instanceof Array){w=A.length;}else{w=y||b;break;}}A[w]=y;w=void 0;break;case 91:A=t[0];t.unshift(A[w||A.length]=[]);w=void 0;break;case 93:t.shift();break;case 102:A=t[0];A[w||A.length]=false;w=void 0;break;case 110:A=t[0];A[w||A.length]=null;w=void 0;break;case 116:A=t[0];A[w||A.length]=true;w=void 0;break;case 123:A=t[0];t.unshift(A[w||A.length]={});w=void 0;break;case 125:t.shift();break;}}if(t.length){throw new Error();}if(s){var u=function(F,E){var G=F[E];if(G&&typeof G=="object"){var n=null;for(var C in G){if(c.call(G,C)&&G!==F){var B=u(G,C);if(B!==void 0){G[C]=B;}else{if(!n){n=[];}n.push(C);}}}if(n){for(var D=n.length;--D>=0;){delete G[n[D]];}}}return s.call(F,E,G);};z=u({"":z},"");}return z;},stringify:function(n){if(typeof args=="function"||apf.isNot(n)){return"null";}return d[n.dataType||0](n);}};})();}apf.serialize=function(a){return self.JSON.stringify(a);};apf.unserialize=function(a){if(!a){return a;}return self.JSON.parse(a);};apf.setcookie=function(c,g,b,j,d,i){var a=c+"="+escape(g)+";";if(b){a+="expires="+new Date(b+new Date().getTimezoneOffset()*60).toGMTString()+";";}if(j){a+="path="+j+";";}if(d){a+="domain="+d+";";}if(i){a+="secure";}document.cookie=a;return g;};apf.getcookie=function(c){var b=document.cookie.split("; ");for(var d=0;d<b.length;d++){var a=b[d].split("=");if(c==a[0]){return unescape(a[1]);}}return"";};apf.delcookie=function(a,b){document.cookie=a+"=blah; expires=Fri, 31 Dec 1999 23:59:59 GMT;"+(b?"domain="+b:"");};apf.AbstractEvent=function(a,d){d=d||window;var c=d.document;a=a||d.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)){c=(!c.compatMode||c.compatMode=="CSS1Compat")?c.html:c.body;this.page={x:a.pageX||a.clientX+(c?c.scrollLeft:0),y:a.pageY||a.clientY+(c?c.scrollTop:0)};this.client={x:(a.pageX)?a.pageX-d.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-d.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(b){}}}}}}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;};};apf.AbstractEvent.KEYS={enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46,fromCode:function(b){for(var a in this){if(this[a]==b){return a;}return null;}}};apf.AbstractEvent.stop=function(a){return(new apf.AbstractEvent(a)).stop();};apf.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(j,d,c){this.init();var b=this.plane;this.current=j;if(!d){this.lastZ=this.current.style.zIndex;this.current.style.zIndex=100000;}else{this.plane.appendChild(j);}var a=(b.parentNode==document.body?(apf.isIE?document.documentElement.offsetWidth-(apf.isIE<8?2:4):window.innerWidth):b.parentNode.offsetWidth);var g=(b.parentNode==document.body?(apf.isIE?document.documentElement.offsetHeight-(apf.isIE<8?2:4):window.innerHeight):b.parentNode.offsetHeight);if(c){if(this.lastCursor===null){this.lastCursor=document.body.style.cursor;}document.body.style.cursor=apf.getStyle(j,"cursor");}this.plane.style.display="block";var i=apf.getDiff(b.parentNode);this.plane.style.width=(a-i[0])+"px";this.plane.style.height=(g-i[1])+"px";return b;},hide:function(){var a=apf.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(!apf.isIE){document.activeElement.focus();}apf.document.activeElement.$focus();}this.current=null;if(this.lastCursor!==null){document.body.style.cursor=this.lastCursor;this.lastCursor=null;}return this.plane;}};if(typeof isFinite=="undefined"){function isFinite(a){return a+1!=a;}}apf.ARRAY=1;apf.NUMBER=2;apf.DATE=3;apf.BOOLEAN=4;apf.STRING=5;apf.REGEXP=6;apf.FUNCTION=7;Array.prototype.dataType=apf.ARRAY;Number.prototype.dataType=apf.NUMBER;Date.prototype.dataType=apf.DATE;Boolean.prototype.dataType=apf.BOOLEAN;String.prototype.dataType=apf.STRING;RegExp.prototype.dataType=apf.REGEXP;Function.prototype.dataType=apf.FUNCTION;apf.getCgiString=function(a,d,c){var j=[];function g(l,i){var m;if(apf.isArray(l)){for(var k=0;k<l.length;k++){g(l[k],i+"%5B%5D");}}else{if(typeof l=="object"){for(m in l){if(apf.isSafariOld&&(!l[m]||typeof p[m]!="object")){continue;}if(typeof l[m]=="function"){continue;}g(l[m],i+"%5B"+encodeURIComponent(m)+"%5D");}}else{j.push(i+"="+encodeURIComponent(l));}}}if(d){j.push("func="+c);for(var b=0;b<a[0].length;b++){g(a[0][b],"f%5B"+b+"%5D");}}else{for(prop in a){if(apf.isSafariOld&&(!a[prop]||typeof a[prop]=="function")){continue;}g(a[prop],prop);}}return j.join("&");};apf.fromCgiString=function(b){if(!b){return false;}var l={};b=b.split("&");for(var g,d=0;d<b.length;d++){g=b[d].split("=");g[0]=decodeURIComponent(g[0]);var k=g[0].replace(/\]/g,"").split("[");var c=l;for(var a=0;a<k.length;a++){if(c[k[a]]){c=c[k[a]];}else{if(k.length==a+1){if(k[a]){c[k[a]]=decodeURIComponent(g[1]);}else{c.push(decodeURIComponent(g[1]));}break;}else{c[k[a]]=!k[a+1]?[]:{};c=c[k[a]];}}}}return l;};Function.prototype.extend=function(){apf.extend.apply(this,[this].concat(Array.prototype.slice.call(arguments)));return this;};Function.prototype.bindWithEvent=function(){var a=this,b=Array.prototype.slice.call(arguments),d=b.shift(),c=b.shift();return function(g){if(!g){g=window.event;}if(c===true){g=new apf.AbstractEvent(g,window);}return a.apply(d,[g].concat(b).concat(Array.prototype.slice.call(arguments)));};};Array.prototype.copy=function(){var a=[];for(var c=0,b=this.length;c<b;c++){a[c]=this[c]&&this[c].copy?this[c].copy():this[c];}return a;};Array.prototype.merge=function(){for(var d=0,b=arguments.length;d<b;d++){for(var c=0,a=arguments[d].length;c<a;c++){this.push(arguments[d][c]);}}};Array.prototype.arrayAdd=function(){var g=this.copy();for(var d=0,b=arguments.length;d<b;d++){for(var c=0,a=g.length;c<a;c++){g[c]+=arguments[d][c];}}return g;};Array.prototype.equals=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]!=c[b]){return false;}}return true;};Array.prototype.makeUnique=function(){var a,c,b=[];for(a=0,c=this.length;a<c;a++){if(b.indexOf(this[a])==-1){b.push(this[a]);}}this.length=0;for(a=0,c=b.length;a<c;a++){this.push(b[a]);}return this;};Array.prototype.contains=function(a,b){return this.indexOf(a,b)!=-1;};Array.prototype.indexOf=Array.prototype.indexOf||function(c,d){var a=this.length;for(var b=(d<0)?Math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b;}}return -1;};Array.prototype.lastIndexOf=Array.prototype.lastIndexOf||function(c,d){var a=this.length;for(var b=(d>=a)?a-1:(d<0)?d+a:a-1;b>=0;b--){if(this[b]===c){return b;}}return -1;};Array.prototype.pushUnique=function(){var c,b=0,a=arguments.length;for(;b<a;++b){c=arguments[b];if(this.indexOf(c)==-1){this.push(c);}}return this;};Array.prototype.search=function(){for(var b=0,c=arguments.length;b<c;b++){if(typeof this[b]!="array"){continue;}for(var a=0;a<c;a++){if(this[b][a]!=arguments[a]){break;}else{if(a==(c-1)){return this[b];}}}}};Array.prototype.each=Array.prototype.forEach=Array.prototype.forEach||function(c){for(var b=0,a=this.length;b<a;b++){c.call(this,this[b],b,this);}return this;};Array.prototype.remove=function(b){for(var a=this.length-1;a>=0;a--){if(this[a]!=b){continue;}this.splice(a,1);}return this;};Array.prototype.removeIndex=function(a){if(!this.length){return null;}return this.splice(a,1);};Array.prototype.insertIndex=function(b,a){this.splice(a,0,b);};Array.prototype.invert=Array.prototype.reverse=Array.prototype.reverse||function(){var a=this.length-1;for(var b,c=0;c<Math.ceil(0.5*a);c++){b=this[c];this[c]=this[a-c];this[a-c]=b;}return this;};Array.prototype.filter=Array.prototype.filter||function(d,g){var c=[];for(var b=0,a=this.length;b<a;b++){if(d.call(g,this[b],b,this)){c.push(this[b]);}}return c;};Array.prototype.every=Array.prototype.every||function(c,d){for(var b=0,a=this.length;b<a;b++){if(!c.call(d,this[b],b,this)){return false;}}return true;};Array.prototype.map=Array.prototype.map||function(d,g){var c=[];for(var b=0,a=this.length;b<a;b++){c[b]=d.call(g,this[b],b,this);}return c;};Array.prototype.some=Array.prototype.some||function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true;}}return false;};Number.prototype.toPrettyDigit=Number.prototype.toPrettyDigit||function(){var a=this.toString();return(a.length==1)?"0"+a:a;};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);};String.prototype.toXml=function(){var c=apf.getXml("<root>"+this+"</root>");if(c.childNodes.length==1){return c.childNodes[0];}else{var b=c.ownerDocument.createDocumentFragment(),a=c.childNodes;while(a.length){b.appendChild(a[0]);}return b;}};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 c=document.createElement("div");c.innerHTML=this.stripTags();if(c.childNodes[0]){if(c.childNodes.length>1){var a=[];for(var b=0;b<c.childNodes.length;b++){a.push(c.childNodes[b].nodeValue);}return a.join("");}else{return c.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(b,a){return this.length>=b?this.substring(0,b-(a?4:1))+(a?"...":""):this;};String.prototype.pad=function(a,c,b){return b?(this+Array(a).join(c)).slice(0,a):(Array(a).join(c)+this).slice(-a);};apf.PAD_LEFT=false;apf.PAD_RIGHT=true;String.prototype.splitSafe=function(c,a,b){return(b&&this.toLowerCase()||this).replace(/(?:^\s+|\n|\s+$)/g,"").split(new RegExp("[\\s ]*"+c+"[\\s ]*","g"),a||999);};String.prototype.appendRandomNumber=function(c){for(var a=[],b=1;b<=c;b++){a.push(apf.randomGenerator.generate(1,9));}return this.toString()+a.join("");};String.prototype.prependRandomNumber=function(c){for(var a=[],b=1;b<=c;b++){a.push(apf.randomGenerator.generate(1,9));}return a.join("")+this.toString();};String.prototype.sprintf=function(){var d=this.toString(),a=0,c=d.indexOf("%s");while(c>=0){var b=arguments[a++]||" ";d=d.substr(0,c)+b+d.substr(c+2);c=d.indexOf("%s");}return d;};apf.nameserver={lookup:{},add:function(a,b){if(!this.lookup[a]){this.lookup[a]=[];}return this.lookup[a].push(b)-1;},register:function(a,c,b){if(!this.lookup[a]){this.lookup[a]={};}return(this.lookup[a][c]=b);},remove:function(a,b){var c=this.lookup[a];if(c){for(var d in c){if(c[d]==b){delete c[d];}}}},get:function(a,b){return this.lookup[a]?this.lookup[a][b]:null;},getAll:function(g){var c,a=[],b=this.lookup[g];if(!b){return a;}if(b.dataType==apf.ARRAY){for(var d=0;d<b.length;d++){a.push(b[d]);}}else{for(c in b){a.push(b[c]);}}return a;},getAllNames:function(c){var b,a=[];for(b in this.lookup[c]){if(parseInt(b)==b){continue;}a.push(b);}return a;}};apf.registry=apf.extend({put:function(a,c,b){this.register(b,a,c);},getNamespaces:function(){},getKeys:function(a){return this.getAllNames(a);},remove:function(a,b){delete this.lookup[b][a];},clear:function(a){this.lookup={};},$export:function(c){var b,a;for(b in this.lookup){for(a in this.lookup[b]){c.put(a,this.lookup[a][b],b);}}}},apf.nameserver);apf.registry.lookup={};apf.registry.get=function(a,b){return this.lookup[b]?this.lookup[b][a]:null;};apf.Init.run("nameserver");apf.highlightXml=apf.highlightCode=function(g){var b=g.split(/\n\r?/);for(var d=1000,c=0,a=b.length;c<a;c++){d=Math.min(d,b[c].match(/^(\s+)?[^\s]/)&&RegExp.$1.length||1000);if(!d){break;}}g=g.replace(new RegExp("^ {"+d+"}","gm"),"").replace(/<!--([\s\S]+?)-->|<\?([\w\-]+)([\s\S]+?)\?>|<\!\[CDATA\[([\s\S]*?)\]\]>|<(\w+:)?script([\s\S]*?)>([\s\S]*?)<\/(?:\w+:)?script>|<([\/\w\:\-]+)([\s\S]*?)(\/?)>/g,function(l,o,n,r,s,i,q,u,k,t,j){if(o){return'<span style="color:green">&lt;!--'+o+"--&gt;</span>";}else{if(n){return'<span style="color:orange">&lt;?'+n+"</span>"+apf.highlightJs(r,true)+'<span style="color:orange">?&gt;</span>';}else{if(s){return'<span style="color:gray">&lt;![CDATA['+s+"]]&gt;</span>";}else{if(i){return'<span style="color:#127ac6">&lt;'+i+"script"+(t?"</span>"+t.replace(/("[\s\S]*?")|([\w\-\:]+)/g,function(x,z,y){if(z){return z;}return'<span style="color:red">'+y+"</span>";})+'<span style="color:#127ac6">&gt;</span>':"&gt;</span>")+apf.highlightJs(u,true)+'<span style="color:#127ac6">&lt;/'+i+"script&gt;</span>";}else{if(k){return'<span style="color:#127ac6">&lt;'+(k.substr(0,2)=="a:"?"<a href='element."+k.substr(2)+"'>"+k+"</a>":k)+(t?"</span>"+t.replace(/("[\s\S]*?")|([\w\-\:]+)/g,function(x,z,y){if(z){return z;}return'<span style="color:red">'+y+"</span>";})+'<span style="color:#127ac6">'+j+"&gt;</span>":"&gt;</span>");}}}}}});return g;};apf.convertAmlToJson=function(i){var d=apf.getXml("<a:app xmlns:a='"+apf.ns.apf+"'>"+i+"</a:app>",null,true);var c=[],b={"true":1,"false":1};var a=(function g(m,x,t){var q=new Array(x+2).join("  "),n=[];for(var o,y=0,r=m.length;y<r;y++){o=m[y];if(o.nodeType==3||o.nodeType==4){if(o.nodeValue.replace(/[\s]*$/,"").replace(/^[\s]*/,"")){(t||n).push("data",'"'+o.nodeValue.trim().replace(/"/g,'\\"').replace(/\n/g,"\\\n")+'"');}continue;}else{if(o.nodeType==8){n.push(q+"//"+o.nodeValue);continue;}else{if(o.nodeType!=1){continue;}else{if(o[apf.TAGNAME]=="script"){var E=o.childNodes;for(var u=0,w=E.length;u<w;u++){if(E[u].nodeValue.trim()!="//"){c.push(E[u].nodeValue.replace(/^ {16}/gm,"").replace(/\/\/$/,"")+"\n");}}continue;}}}}var A,z=o.childNodes.length+(A=o.attributes).length;var C=0,k=[];n.push(q+"new apf."+o[apf.TAGNAME]+(z||!x?"({":"()"+(x==0?";":(y==r-1?"":","))));if(!x){k.push("htmlNode","document.body");C=Math.max(8,C);}for(var D,u=0,w=A.length;u<w;u++){k.push((D=A[u]).nodeName,D.nodeName.substr(0,2)=="on"?"function(){"+D.nodeValue+"}":(parseInt(D.nodeValue)==D.nodeValue||b[D.nodeValue]?D.nodeValue:'"'+D.nodeValue.replace(/"/g,'\\"')+'"'));C=Math.max(D.nodeName.length,C);}var B="";if(o[apf.TAGNAME]=="model"&&o.childNodes.length){k.push("data",'"'+apf.serializeChildren(o).trim().replace(/"/g,'\\"').replace(/\r?\n/g,"\\\n")+'"');}else{if(z){var B=g(o.childNodes,x+2,k);}}C=Math.max(B?10:4,C);C++;for(u=0,w=k.length;u<w;u+=2){n.push(q+"  "+k[u].pad(C," ",apf.PAD_RIGHT)+": "+k[u+1]+(u!=w-2||B?",":""));}if(B){n.push(q+"  "+"childNodes".pad(C," ",apf.PAD_RIGHT)+": [");n.push(B.substr(0,B.length-1));n.push(q+"  ]");}if(z||!x){n.push(q+"})"+(x==0?";":(y==r-1?"":",")));}}return n.join("\n")+(x==0?"\n\n"+c.join("").trim():"");})(d.childNodes,0);return a+"\n\n";};apf.highlightJs=function(a,j){if(!j){var c=a.split(/\n\r?/);for(var g=1000,d=0,b=c.length;d<b;d++){g=Math.min(g,c[d].match(/^(\s+)?[^\s]/)&&RegExp.$1.length||1000);if(!g){break;}}a=a.replace(new RegExp("^ {"+g+"}","gm"),"");}return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/(\/\*[\s\S]+\*\/)|(\/\/.*)$|("(?:[^"\\]+|\\[\s\S])*")|('(?:[^'\\]+|\\[\s\S])*')|(\W)(apf|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(i,w,t,n,l,q,r,k,s,o,u){if(o){return s+'<span style="color:#ff8000">'+o+"</span>"+u;}else{if(t||w){return'<span style="color:green">'+(t||w)+"</span>";}else{if(n||l){return'<span style="color:#808080">'+(n||l)+"</span>";}else{if(q){return q+'<span style="color:#127ac6">'+r+"</span>"+k;}}}}});};apf.highlightCode2=function(a){var c=[],b=[];return a.replace(/(\/\*[\s\S]*?\*\/|\/\/.*)/g,function(d){c.push(d);return"###n"+(c.length-1)+"###";}).replace(/\"([\s\S]*?)\"/g,function(g,d){b.push(d);return"###s"+(b.length-1)+"###";}).replace(/\'([\s\S]*?)\'/g,function(g,d){b.push(d);return"###q"+(b.length-1)+"###";}).replace(/(\<)|(\>)/g,function(i,g,d){return"<span stylecolorwhite>"+(g?"@lt@":"@gt@")+"</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(g,d){return"<span stylecolorpurple>"+c[d].escapeHTML()+"</span>";}).replace(/###s(\d+)###/g,function(g,d){return'<span stylecolorgray>"'+b[d].escapeHTML()+'"</span>';}).replace(/###q(\d+)###/g,function(g,d){return"<span stylecolorgray>'"+b[d].escapeHTML()+"'</span>";}).replace(/stylecolor(.*?)\>/g,"style='color:$1'>").replace(/@(.*?)@/g,"&$1;");};apf.formatJS=function(b){var g=0,a=0;var i=[],c=[];return b.replace(/(\/\*[\s\S]*?\*\/|\/\/.*)/g,function(d){i.push(d);return"###n"+(i.length-1)+"###";}).replace(/\"([\s\S]*?)\"/g,function(j,d){c.push(d);return"###s"+(c.length-1)+"###";}).replace(/\'([\s\S]*?)\'/g,function(j,d){c.push(d);return"###q"+(c.length-1)+"###";}).replace(/;+/g,";").replace(/{;/g,"{").replace(/({)|(})|(\()|(\))|(;)/g,function(d,r,s,k,l,n){if(r){g++;}if(s){g--;}if(k){a++;return k;}if(l){a--;return l;}var q="";for(var j=0;j<g;j++){q+="\t";}if(r){return"{\n"+q;}if(s){return"\n"+q+"}";}if(n){return(a>0)?n:(";\n"+q);}}).replace(/;\s*\n\s*\n/g,";\n").replace(/}var/g,"}\nvar").replace(/([\n\s]*)###n(\d+)###[\n\s]*/g,function(j,d,k){return d+i[k]+d;}).replace(/###s(\d+)###/g,function(j,d,k){return'"'+c[d]+'"';}).replace(/###q(\d+)###/g,function(j,d,k){return"'"+c[d]+"'";});};apf.pasteWindow=function(b){var a=window.open("about:blank");a.document.write(b);};apf.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"};apf.htmlentities=function(a){return a.escapeHTML();};apf.xmlentities=function(a){return a.replace(/&([a-z]+);/gi,function(c,b){if(apf.xmlEntityMap[b=b.toLowerCase()]){return"&#"+apf.xmlEntityMap[b]+";";}return c;});};apf.html_entity_decode=function(a){return(a||"").replace(/\&\#38;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&nbsp;/g," ");};apf.isCharacter=function(a){return(a<112||a>122)&&(a==32||a>42||a==8);};apf.randomGenerator={d:new Date(),seed:null,A:48271,M:2147483647,Q:null,R:null,oneOverM:null,generate:function(b,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-b+1)*this.next()+b);},next:function(){var a=this.seed/this.Q;var b=this.seed%this.Q;var c=this.A*b-this.R*a;if(c>0){this.seed=c;}else{this.seed=c+this.M;}return(this.seed*this.oneOverM);}};apf.getNoCacheUrl=function(a){return a+(a.indexOf("?")==-1?"?":"&")+"nocache="+new Date().getTime();};apf.parseExpression=function(str){if(!apf.parseExpression.regexp.test(str)){return str;}return eval(RegExp.$1);};apf.parseExpression.regexp=/^\{([\s\S]*)\}$/;apf.formatNumber=function(a,c){var b=parseFloat(a);if(!b){return a;}var d=new String(Math.round(b*100)/100).replace(/(\.\d?\d?)$/,function(g){return g.pad(3,"0",apf.PAD_RIGHT);});if(d.indexOf(".")==-1){d+=".00";}return c+d;};apf.exec=function(str,win){if(!str){return str;}if(!win){win=self;}if(apf.isO3){eval(str,self);}else{if(apf.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;};apf.K=function(){};apf.isNumber=function(a){return parseFloat(a)==a;};apf.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]";};apf.isTrue=function(a){return(a===true||a==="true"||a==="on"||typeof a=="number"&&a>0||a==="1");};apf.isFalse=function(a){return(a===false||a==="false"||a==="off"||a===0||a==="0");};apf.isNot=function(a){return(!a&&typeof a!="string"&&a!==0||(typeof a=="number"&&!isFinite(a)));};apf.removePathContext=function(b,a){if(!a){return"";}if(a.indexOf(b)>-1){return a.substr(b.length);}return a;};apf.cancelBubble=function(a,b){a.cancelBubble=true;if(b.$focussable&&!b.disabled){apf.window.$focus(b);}};apf.destroyHtmlNode=function(a){if(!a){return;}if(!apf.isIE||a.ownerDocument!=document){if(a.parentNode){a.parentNode.removeChild(a);}return;}var b=document.getElementById("IELeakGarbageBin");if(!b){b=document.createElement("DIV");b.id="IELeakGarbageBin";b.style.display="none";document.body.appendChild(b);}b.appendChild(a);b.innerHTML="";};apf.getRules=function(b){var c={};for(var a=b.firstChild;a;a=a.nextSibling){if(a.nodeType!=1){continue;}else{if(!c[a[apf.TAGNAME]]){c[a[apf.TAGNAME]]=[];}c[a[apf.TAGNAME]].push(a);}}return c;};apf.getBox=function(d,c){if(!c){c=0;}if(d==null||(!parseInt(d)&&parseInt(d)!=0)){return[0,0,0,0];}var a=d.split(" ");for(var b=0;b<a.length;b++){a[b]=parseInt(a[b])||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;};apf.getNode=function(c,a){var d=0;if(c!=null){for(var b=0;b<c.childNodes.length;b++){if(c.childNodes[b].nodeType==1){if(d==a[0]){c=c.childNodes[b];if(a.length>1){a.shift();c=this.getNode(c,a);}return c;}d++;}}}return null;};apf.getFirstElement=function(a){return a.firstChild.nodeType==1?a.firstChild:a.firstChild.nextSibling;};apf.getLastElement=function(a){return a.lastChild.nodeType==1?a.lastChild:a.lastChild.previousSibling;};apf.selectTextHtml=function(b){if(!apf.hasMsRangeObject){return;}var a=document.selection.createRange();try{a.moveToElementText(b);}catch(c){}a.select();};apf.popup={cache:{},focusFix:{INPUT:1,TEXTAREA:1,SELECT:1},setContent:function(g,d,c,b,a){if(!this.popup){this.init();}this.cache[g]={content:d,style:c,width:b,height:a};d.style.position="absolute";d.onmousedown=function(i){if(!i){i=event;}if(apf.hasFocusBug&&!apf.popup.focusFix[(i.srcElement||i.target).tagName]){apf.window.$focusfix();}};return d.ownerDocument;},removeContent:function(a){this.cache[a]=null;delete this.cache[a];},init:function(){this.popup={};apf.addEventListener("hotkey",function(a){if(a.keyCode=="27"||a.altKey){apf.popup.forceHide();}});},show:function(n,q){q=apf.extend({x:0,y:0,animate:false,ref:null,width:null,height:null,callback:null,draggable:false,resizable:false,allowTogether:false,autoCorrect:true},q);if(!this.popup){this.init();}if((!q.allowTogether||q.allowTogether!=this.last)&&this.last!=n){this.hide();}var c=this.cache[n];c.options=q;var a=c.content,g=false;if(!c.content.style.zIndex){c.content.style.zIndex=10000000;}if(c.content.style.display&&c.content.style.display.indexOf("none")>-1){c.content.style.display="";}if(q.ref){var k=apf.getAbsolutePosition(q.ref,c.content.offsetParent||c.content.parentNode),l=(q.y||0)+k[1],b=apf.getOverflowParent(c.content);if(q.width||c.width){a.style.width=((q.width||c.width)-3)+"px";}g=q.autoCorrect&&(l+(q.height||c.height||c.content.offsetHeight))>(b==document.documentElement?(apf.isIE?b.offsetHeight:(window.innerHeight+window.pageYOffset))+b.scrollTop:b.offsetHeight+b.scrollTop);a.style.top=(g?(l-(q.height||c.height||c.content.offsetHeight)):l)+"px";a.style.left=((q.x||0)+k[0])+"px";}apf.setStyleClass(a,g?"upward":"downward",[g?"downward":"upward"]);if(q.animate){if(q.animate=="fade"){apf.tween.single(a,{type:"fade",from:0,to:1,anim:apf.tween.NORMAL,steps:apf.isIE?5:10});}else{var m,j=apf.isIE8?5:7,d=0;m=setInterval(function(){var i=++d*((q.height||c.height)/j);a.style.height=i+"px";if(g){a.style.top=(l-i-q.y)+"px";}else{(q.$int||a).scrollTop=-1*(d-j)*((q.height||c.height)/j);}a.style.display="block";if(d>=j){clearInterval(m);if(q.callback){q.callback(a);}}},10);}}else{if(q.height||c.height){a.style.height=(q.height||c.height)+"px";}a.style.top=(l)+"px";a.style.display="block";if(q.callback){q.callback(a);}}$setTimeout(function(){apf.popup.last=n;});if(q.draggable){q.id=n;this.makeDraggable(q);}},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&&a.options.onclose){a.options.onclose(apf.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(!apf.Interactive||this.cache[a.id].draggable){return;}var b=this.cache[a.id].content;this.cache[a.id].draggable=true;var c={$propHandlers:{},minwidth:10,minheight:10,maxwidth:10000,maxheight:10000,dragOutline:false,resizeOutline:false,draggable:true,resizable:a.resizable,$ext:b,oDrag:b.firstChild};b.onmousedown=b.firstChild.onmousedown=function(d){if(!d){d=event;}if(apf.hasFocusBug&&!apf.popup.focusFix[(d.srcElement||d.target).tagName]){apf.window.$focusfix();}(d||event).cancelBubble=true;};apf.implement.call(c,apf.Interactive);c.$propHandlers.draggable.call(c,true);c.$propHandlers.resizable.call(c,true);},forceHide:function(){if(this.last&&!apf.plane.current&&this.isShowing(this.last)){var a=apf.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;apf.destroyHtmlNode(this.cache[a].content);this.cache[a].content=null;this.cache[a]=null;}}if(!this.popup){return;}}};apf.iepngfix=(function(){var d=null,c=null,a=true,j,i=function(){if(!j){j=apf.skins.skins["default"].mediaPath+"/blank.gif";}if(c===null){if(d){c=d.splitSafe(",");}else{c=[document];}}function m(l){if(l.currentStyle.backgroundImage.match(/\.png/i)!==null){g(l);}if(l.tagName=="IMG"&&l.src.match(/\.png$/i)!==null){b(l);}if(a&&(l.tagName=="A"||l.tagName=="INPUT")&&l.style.position===""){l.style.position="relative";}}for(var n=0,k=c.length,q;n<k;n++){if(typeof c[n]=="string"){c[n]=document.getElementById(c[n]);}q=c[n];if(!q){continue;}if(q!=document){m(q);}for(var o=q.all.length-1,r=null;(r=q.all[o]);o--){m(r);}}},g=function(l){var n="scale",k=l.currentStyle.backgroundImage,m=k.substring(5,k.length-2);if(l.currentStyle.backgroundRepeat=="no-repeat"){n="crop";}l.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+m+"', sizingMethod='"+n+"')";l.style.backgroundImage="url("+j+")";},b=function(k){var l=k.src;k.style.width=k.width+"px";k.style.height=k.height+"px";k.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+l+"', sizingMethod='scale')";k.src=j;};return{limitTo:function(k){d=k;return this;},run:i};})();apf.setStyleRule=function(b,m,n,a,k){b=b.toLowerCase();if(!a){var g=(k||self).document.styleSheets;for(var c=g.length-1;c>=0;c--){try{var o=g[c][apf.styleSheetRules];for(var d=0;d<o.length;d++){if(o.item(d).selectorText.toLowerCase()==b){o.item(d).style[m]=n;return true;}}}catch(l){}}}else{var o=(k||self).document.styleSheets[a||0][apf.styleSheetRules];for(var d=0;d<o.length;d++){if(o.item(d).selectorText.toLowerCase()==b){o.item(d).style[m]=n;return true;}}}return false;};apf.getStyleRule=function(b,m,a,k){b=b.toLowerCase();if(!a){var g=(k||self).document.styleSheets;for(var c=g.length-1;c>=0;c--){try{var n=g[c][apf.styleSheetRules];for(var d=0;d<n.length;d++){if(n.item(d).selectorText.toLowerCase()==b){return n.item(d).style[m];}}}catch(l){}}}else{var n=(k||self).document.styleSheets[a||0][apf.styleSheetRules];for(var d=0;d<n.length;d++){if(n.item(d).selectorText.toLowerCase()==b){return n.item(d).style[m];}}}return false;};apf.setStyleClass=function(c,b,d,g){if(!c||g&&this.disabled){return;}if(b){if(d){d[d.length]=b;}else{d=[b];}}var a=new RegExp("(^| +)(?:"+(d?d.join("|"):"")+")","gi");c.className!=null?(c.className=c.className.replace(a," ")+(b?" "+b:"")):c.setAttribute("class",(c.getAttribute("class")||"").replace(a," ")+(b?" "+b:""));return c;};apf.importCssString=function(b,g,d){g=g||document;var c=g.getElementsByTagName("head")[0];if(!apf.supportOpacity){b=b.replace(/opacity[ \s]*\:[ \s]*([\d\.]+)/g,function(i,j){return"filter:progid:DXImageTransform.Microsoft.Alpha(opacity="+(j*100)+")";});}if(apf.canCreateStyleNode){var a=g.createElement("style");a.appendChild(g.createTextNode(b));if(d){a.setAttribute("media",d);}c.appendChild(a);}else{c.insertAdjacentHTML("beforeend",".<style media='"+(d||"all")+"'>"+b+"</style>");}};apf.getStyleRecur=function(a,c){var b=apf.hasComputedStyle?document.defaultView.getComputedStyle(a,"").getPropertyValue(c.replace(/([A-Z])/g,function(d,g){return"-"+g.toLowerCase();})):a.currentStyle[c];return((!b||b=="transparent"||b=="inherit")&&a.parentNode&&a.parentNode.nodeType==1)?this.getStyleRecur(a.parentNode,c):b;};apf.importStylesheet=function(b,c){for(var a=0;a<b.length;a++){if(!b[a][1]){continue;}if(apf.isIE){(c||window).document.styleSheets[0].addRule(b[a][0],b[a][1]);}else{(c||window).document.styleSheets[0].insertRule(b[a][0]+" {"+b[a][1]+"}",0);}}};apf.isInRect=function(b,a,d){var c=this.getAbsolutePosition(b);if(a<c[0]||d<c[1]||a>b.offsetWidth+c[0]-10||d>b.offsetHeight+c[1]-10){return false;}return true;};apf.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;};apf.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;};apf.getAbsolutePosition=function(b,j,c){if("getBoundingClientRect" in document.documentElement){if(apf.doesNotIncludeMarginInBodyOffset&&b==document.body){return[b.offsetLeft+(parseFloat(apf.getStyle(b,apf.descPropJs?"marginLeft":"margin-top"))||0),+(b.scrollLeft||0),b.offsetTop+(parseFloat(apf.getStyle(b,apf.descPropJs?"marginTop":"margin-top"))||0)+(b.scrollTop||0)];}var i=b.getBoundingClientRect(),r=i.top,d=i.left,m=(apf.isIE&&apf.isIE<8);if(!(apf.isIE&&b==document.documentElement)){d+=document.body.scrollLeft||document.documentElement.scrollLeft||0;r+=document.body.scrollTop||document.documentElement.scrollTop||0;}return[d-(m?2:0),r-(m?2:0)];}var k=c?0:b.offsetLeft,s=c?0:b.offsetTop;b=c?b:b.offsetParent||b.parentNode;if(apf.isIE8&&j){n=this.getStyle(b,"borderLeftWidth");k-=(apf.isIE&&b.currentStyle.borderLeftStyle!="none"&&n=="medium"?2:parseInt(n)||0);g=this.getStyle(b,"borderTopWidth");s-=(apf.isIE&&b.currentStyle.borderTopStyle!="none"&&g=="medium"?2:parseInt(g)||0);}var n,g,t;while(b&&b!=j){n=apf.isOpera||apf.isIE8?0:this.getStyle(b,apf.descPropJs?"borderLeftWidth":"border-left-width");k+=(apf.isIE&&b.currentStyle.borderLeftStyle!="none"&&n=="medium"?2:parseInt(n)||0)+b.offsetLeft;if(apf.isIE&&!apf.isIE8&&apf.getStyle(b,"styleFloat")=="none"&&apf.getStyle(b,"position")=="relative"){var a=b.previousSibling;while(a){if(a.nodeType==1){t=apf.getStyle(a,"styleFloat");if(t=="left"){k-=parseInt(apf.getStyle(b,"marginLeft"))||0;break;}else{if(t=="right"){break;}}}a=a.previousSibling;}}g=apf.isOpera||apf.isIE8?0:this.getStyle(b,apf.descPropJs?"borderTopWidth":"border-top-width");s+=(apf.isIE&&b.currentStyle.borderTopStyle!="none"&&g=="medium"?2:parseInt(g)||0)+b.offsetTop;if(!apf.isGecko&&b!=j&&(b.tagName!="HTML"||b.ownerDocument!=document)){k-=b.scrollLeft;s-=b.scrollTop;}if(b.tagName.toLowerCase()=="table"){s-=parseInt(b.border||0)+parseInt(b.cellSpacing||0);k-=parseInt(b.border||0)+parseInt(b.cellSpacing||0)*2;}else{if(b.tagName.toLowerCase()=="tr"){var l;s-=(l=parseInt(b.parentNode.parentNode.cellSpacing));while(b.previousSibling){s-=(b=b.previousSibling).offsetHeight+l;}}}if(apf.isIE&&!b.offsetParent&&b.parentNode.nodeType==1){k-=b.parentNode.scrollLeft;s-=b.parentNode.scrollTop;}b=b.offsetParent;}return[k,s];};apf.getViewPort=function(b){b=b||window;var a=(!b.document.compatMode||b.document.compatMode=="CSS1Compat")?b.document.html||b.document.documentElement:b.document.body;return{x:b.pageXOffset||a.scrollLeft,y:b.pageYOffset||a.scrollTop,width:b.innerWidth||a.clientWidth,height:b.innerHeight||a.clientHeight};};apf.history={inited:false,page:null,past:[],future:[],delay:1,init:function(i,c,g){if(this.inited){return;}if(g){this.delay=g;}this.inited=true;var d,a=this;function b(){d=apf.dispatchEvent("hashinit")||location.href.match(/#(.*)$/)&&decodeURI(RegExp.$1)||apf._GET[c||-1]||i;location.hash=d;a.hasChanged(d||null);}if(apf.supportHashChange){$setTimeout(function(){b();window.onhashchange=function(){var k=location.hash.replace("#","");apf.history.hasChanged(decodeURI(k));};});}else{if(apf.isIE){b();var j="<style>                    BODY, HTML{margin:0}                    h1{height:100px; margin:0; padding:0; overflow:hidden}                </style>                <body>                    <h1 id='"+d+"'>0</h1>                </body>                <script>                    var lastURL = -1;                    if (document.all)                        document.body.onscroll = checkUrl;                    else                        setInterval('checkUrl()', 200);                                        function checkUrl(){                        var iScr = (document.all ? document.body : document.documentElement).scrollTop;                        if (lastURL == iScr) return;                        top.apf.history.hasChanged(document.getElementsByTagName('h1')[Math.round(iScr / 100)].id, true);                        lastURL = iScr;                    }                    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(j);document.frames.nav.document.close();}this.iframe=document.frames.nav;this.timer2=setInterval(function(){if(!apf.history.changingHash&&location.hash!="#"+apf.history.page){var k=location.hash.replace(/^#/,"");var l=apf.history.page;apf.history.setHash(k,true,true);apf.history.page=l;apf.history.hasChanged(k);}},apf.history.delay||1);}else{b();apf.history.lastUrl=location.href.toString();this.timer2=setInterval(function(){if(apf.history.lastUrl==location.href.toString()){return;}apf.history.lastUrl=location.href.toString();var k=location.hash.replace("#","");apf.history.hasChanged(decodeURI(k));},20);}}},to_name:null,setHash:function(b,a,d){if(this.changing||this.page==b||!d&&decodeURIComponent(location.hash)=="#"+decodeURIComponent(b)){this.to_name=b;return;}if(!apf.supportHashChange&&apf.isIE&&!a){this.to_name=b;return $setTimeout(function(){apf.history.setHash(apf.history.to_name,true,d);},200);}this.changePage(b);if(!this.inited){return this.init(b);}if(!apf.supportHashChange&&apf.isIE){var c=this.iframe.document.body.appendChild(this.iframe.document.createElement("h1"));c.id=b;c.innerHTML="1";}(!apf.supportHashChange&&apf.isIE?this.iframe:window).location.href="#"+b;if(!apf.isIE&&!apf.isGecko&&!apf.isIphone){apf.history.lastUrl=location.href.toString();}},timer:null,changePage:function(b,a){if(!apf.supportHashChange&&apf.isIE){this.page=b;this.changingHash=true;clearTimeout(this.timer);this.timer=$setTimeout(function(){location.hash=b;apf.history.changingHash=false;},1);}},update:function(d){var c,b,a=0;for(c=0,b=this.past.length;c<b&&a===0;c++){if(this.past[c]==d){a=c+1;}}if(a>0){this.future=this.past.slice(a,this.past.length-1).concat(this.future).makeUnique();this.past.splice(a,this.past.length-(a));a=-a;}else{for(c=0,b=this.future.length;c<b&&a===0;c++){if(this.future[c]==d){a=c+1;this.past=this.past.concat(this.future.splice(0,this.future.length-a)).makeUnique();}}if(a===0){this.past.push(d);a=1;}}return a;},hasChanged:function(b,a){if(b==this.page&&!a){return;}this.changePage(b,a);this.changing=true;apf.dispatchEvent("hashchange",{page:b,index:this.update(b)});this.changing=false;this.page=b;}};apf.config=new apf.Class().$init();apf.extend(apf.config,{disableRightClick:false,allowSelect:false,allowBlur:true,autoDisableActions:true,autoDisable:false,disableF5:true,autoHideLoading:true,disableSpace:true,defaultPage:"home",disableBackspace:true,undokeys:false,outline:false,dragOutline:false,resizeOutline:false,autoDisableNavKeys:true,disableTabbing:false,resourcePath:null,initdelay:true,liveText:false,iePngFix:false,iphoneFullscreen:true,iphoneStatusbar:"default",iphoneIcon:null,iphoneIconIsGlossy:false,iphoneFixedViewport:true,skinset:"default",name:self.window&&window.location.href.replace(/[^0-9A-Za-z_]/g,"_"),tags:{},defaults:{},baseurl:"",model:"@default","empty-message":"No items","loading-message":"Loading...","offline-message":"You are currently offline.",setDefaults:function(){if(apf.isParsingPartial){this.disableRightClick=false;this.allowSelect=true;this.autoDisableActions=true;this.autoDisable=false;this.disableF5=false;this.autoHideLoading=true;this.disableSpace=false;this.disableBackspace=false;this.undokeys=false;this.disableTabbing=true;this.allowBlur=true;}},getDefault:function(b,g){var c=this.defaults[b];if(!c){return;}for(var a=c.length-1;a>=0;a--){if(c[a][0]==g){return c[a][1];}}},setProperty:function(a,b){this[a.replace(/-(\w)/g,function(c,d){return d.toUpperCase();})]=this[a]=b;(this.$propHandlers&&this.$propHandlers[a]||apf.GuiElement.propHandlers[a]||apf.K).call(this,b);},$inheritProperties:{},$propHandlers:{baseurl:function(a){this.baseurl=apf.parseExpression(a);},language:function(a){apf.addEventListener("load",function(){apf.setModel(apf.config.language,apf.language);});},layout:function(a){apf.queue.add("layout",function(){apf.setModel(apf.config.layout,apf.layout);});},"resource-path":function(a){this.resourcePath=apf.parseExpression(a||"").replace(/resources\/?|\/$/g,"");},iepngfix:function(b,a){this.iePngFix=(!apf.supportPng24&&(apf.isTrue(b)||a.getAttribute("iepngfix-elements")));if(this.iePngFix){$setTimeout(function(){apf.iepngfix.limitTo(a.getAttribute("iepngfix-elements")||"").run();});}},skinset:function(a){if(this.$amlLoaded){apf.skins.changeSkinset(a);}},outline:function(a){this.dragOutline=this.resizeOutline=this.outline=apf.isTrue(a);},"drag-outline":function(a){this.dragOutline=a?apf.isTrue(a):false;},"resize-outline":function(a){this.resizeOutline=a?!apf.isFalse(a):false;},storage:function(a){if(a){apf.storage.init(a);}},debug:function(a){apf.debug=a;}}});if(apf.history){apf.addEventListener("load",function(){apf.history.init(apf.config.defaultPage,"page");});}apf.offline={onLine:true};apf.printer={tagName:"printer",nodeFunc:apf.NODE_HIDDEN,lastContent:"",inited:false,panel:null,init:function(aml){if(this.inited){return this;}this.inited=true;this.$aml=aml;this.panel=document.body.appendChild(document.createElement("div"));this.panel.setAttribute("id","print_content");this.panel.onmousedown=function(){apf.printer.hide();};with(this.panel.style){position="absolute";top="0";left="0";width="100%";height="100%";backgroundColor="white";zIndex=100000000;}apf.importCssString("#print_content{display:none}");apf.importCssString(apf.hasCSSChildOfSelector&&!apf.isIE?"body #print_content{display:block} body>*{display:none}":"body #print_content, body #print_content *{display:block} body *{display:none}",document,"print");if(aml){var a,i,attr=aml.attributes;for(i=0;i<attr.length;i++){a=attr[i];if(a.nodeName.indexOf("on")==0){apf.addEventListener(a.nodeName,apf.lm.compile(a.nodeValue,{event:true,parsecode:true}));}}}function printPNGFix(disable){if(apf.supportPng24){return;}if(!apf.config.iePngFix){return;}for(var e,i=0,j=document.all.length;i<j;i++){e=document.all[i];if(e.filters["DXImageTransform.Microsoft.AlphaImageLoader"]||e._png_print){if(disable){e._png_print=e.style.filter;e.style.filter="";}else{e.style.filter=e._png_print;e._png_print="";}}}}var _self=this;window.onbeforeprint=function(){printPNGFix(true);apf.dispatchEvent("beforeprint");};window.onafterprint=function(){printPNGFix(false);if(apf.isIE){_self.hide();}apf.dispatchEvent("afterprint");};return this;},preview:function(b,a){this.init();if(typeof b!="string"){b=b.outerHTML||b.xml||b.serialize();}this.lastContent=b;this.panel.innerHTML=b;if(a){this.show();}return this;},show:function(){if(!this.inited){return this;}this.panel.style.display="block";this.panel.style.height=document.body.scrollHeight+"px";this.panel.style.width=document.body.scrollWidth+"px";return this;},hide:function(){if(!this.inited){return this;}this.panel.style.display="none";return this;}};apf.print=function(a){apf.printer.init().preview(a,apf.isIE);window.print();};apf.selection=function(b,z,l){b=b||window;z=z||window.document;this.current=null;var r="function",u="undefined",i="character",A="Text",x="Control",o="None",j,d=(l&&typeof l.$visualFocus==r),k=this;this.get=function(){return apf.w3cRange?b.getSelection():z.selection;};this.set=function(){if(!this.current){return null;}if(apf.w3cRange){this.moveToBookmark(this.current);return this.current;}try{if(d){l.$visualFocus();}else{b.focus();}this.current.select();}catch(E){}if(d){l.$visualFocus();}else{b.focus();}return this.current;};this.cache=function(F){if(apf.w3cRange){if(F){this.current=this.getBookmark();}return this;}var E=z.selection;this.current=E.createRange();this.current.type=E.type;if(this.current.type==A&&this.current.text==""&&!j){j=$setTimeout(this.cache,0);}else{clearTimeout(j);j=null;}return this;};this.getRange=function(){var E=this.get(),F;try{if(E){F=E.rangeCount>0?E.getRangeAt(0):(E.createRange?E.createRange():z.createRange());}}catch(G){}if(!F){F=apf.w3cRange?z.createRange():z.body.createTextRange();}return F;};this.setRange=function(F){if(apf.w3cRange){var E=this.get();if(E){E.removeAllRanges();E.addRange(F);}}else{try{F.select();}catch(G){}}return this;};var m,s="BR|IMG|HR|INPUT",C="P|BUTTON|TEXTAREA|SELECT|DIV|H[1-6]|ADDRESS|PRE|OL|UL|LI|TABLE|TBODY|TR|DT|DE|TD|SUB|SUP",w="SELECT|BUTTON|TEXTAREA",c=new RegExp("^(?:"+C+")$","i"),t=new RegExp("^(?:"+w+")$","i"),q=new RegExp("^(?:"+s+")$","i");this.inline=s;this.block=C;this.form=w;function y(E){return(apf.isOpera||apf.isIE)?E:E.replace(/\r\n/g," ");}function a(E){return String(apf.isIE?E.nodeType==3?E.nodeValue:E.innerText:E.textContent);}function D(E){return String(E.nodeType==3?apf.isIE?E.nodeValue:E.textContent:E.innerHTML);}function B(G,J){var K,H=0,I="",F=0,E=G.childNodes.length;for(;F<E;F++){K=G.childNodes[F];if(t.test(K.nodeName)){I+="<->"+(apf.isIE?"":y(a(K)).replace(/./gi," "))+"</->";}else{if(c.test(K.nodeName)){I+="<+>"+(apf.isIE?"":y(a(K)).replace(/./gi," "))+"</+>";}else{if(q.test(K.nodeName)){I+="<>";}else{if(K.nodeName=="SPAN"&&(H=_4.attr(K,"scaytid"))){I+="<"+H+">"+y(D(K))+"</>";}else{I+=y(D(K));}}}}}return I;}function n(I,H,E,F){var G;F=F||this.containerNode;H=H?new RegExp("^(?:"+H+")$"):null;while(I&&I!=F){if(H&&H.test(I.nodeName.toUpperCase())){return I;}if(E){for(G in E){if(I.getAttribute(G)!==null&&E[G]===null){return I;}if((E[G]!==null&&I.getAttribute(G)!==null&&!(I.getAttribute(G)===false))?!E[G]:E[G]){return I;}}}I=I.parentNode;}return false;}this.getBookmark=function(H,I){var M=-16777215,O=this.getRange(),X=apf.getViewPort(b),Z=z.body,Q={scrollX:X.x,scrollY:X.y,collapse:0,start:0},U=this.get();m=null;if(H=="simple"){Q.rng=O;return Q;}if(!apf.w3cRange){if(O.item){var Y=O.item(0),R=Z.getElementsByTagName(Y.nodeName),V=0,T=R.length;for(;V<T;V++){if(Y==R[V]){return !(W=V);}}return apf.extend(Q,{tag:Y.nodeName,index:W});}var G,ab,W,aa;G=O.duplicate();G.moveToElementText(Z);G.collapse(true);ab=Math.abs(G.move(i,M));G=O.duplicate();G.collapse(true);W=Math.abs(G.move(i,M));G=O.duplicate();G.collapse(false);var J=0;aa=G.duplicate();aa.moveEnd(i,1);aa.collapse(false);var L=aa.parentElement();if(c.test(L.nodeName)){if(n(G.parentElement(),C,null,Z)!=L){m=L;}}return apf.extend(Q,{start:W-ab-J,length:Math.abs(G.move(i,M))-W});}var P=U.anchorNode;while(P&&(P.nodeType!=1)){P=P.parentNode;}if(P&&P.nodeName=="IMG"){return Q;}if(!U){return null;}var K,F=O.startContainer,S=U.anchorNode,E=I?I(S):null;if(U.isCollapsed){Q.collapse=1;P=n(S,C)||Z;if(S.nodeType==3){K=z.createTreeWalker(P,NodeFilter.SHOW_TEXT,null,false);while(R=K.nextNode()){if(R==S){Q.start=Q.start+U.anchorOffset;break;}Q.start+=y(R.nodeValue||"").length;}}else{if(S!=P){K=z.createTreeWalker(P,NodeFilter.SHOW_ALL,null,false);while(R=K.nextNode()){if(R==S){break;}Q.start+=y(R.nodeValue||"").length;}}for(V=0,T=O.startOffset;V<T;V++){Q.start+=parseInt(String(F.childNodes[V].textContent).length);}}Q.end=Q.start;if(!E){Q.content=F.textContent||F.innerHTML;try{if(O.startOffset==0&&F.previousSibling&&(/IMG|BR|INPUT/.test(F.previousSibling.nodeName))){Q.br=F.previousSibling;}if(F.childNodes[O.startOffset-1]&&(/IMG|BR|INPUT/.test(F.childNodes[O.startOffset-1].nodeName))){Q.br=F.childNodes[O.startOffset-1];}}catch(Y){}}if(E&&O.startOffset==0){R=E.previousSibling;while(R&&((R.nodeType==3&&R.textContent=="")||(R.nodeType!=3&&R.innerHTML==""))){if(R&&(/IMG|BR|INPUT/.test(R.nodeName))){Q.br=R;Q.br2=R.nextSibling;break;}R=R.previousSibling;}}apf.extend(Q,{block:P,node:F,offset:O.startOffset});return Q;}var N=[];P=0;K=z.createTreeWalker(Z,NodeFilter.SHOW_TEXT,null,false);while((R=K.nextNode())!=null){if(R==F){N[0]=P;}if(R==O.endContainer){N[1]=P;break;}P+=y(R.nodeValue||"").length;}apf.extend(Q,{start:N[0]+O.startOffset,end:N[1]+O.endOffset,block:Z});return Q;};this.moveToBookmark=function(O){var Q,F=this.get(),N=z.body,E=this.getRange();function I(S,ab){var V,Z,X,U,T,R=0,Y={},W=-1,aa=z.createTreeWalker(O.block,NodeFilter.SHOW_TEXT,null,false);while(V=aa.nextNode()){X=V.nodeValue||"";U=y(X).length;R+=U;if(O.collapse){if(R>=S){Z=n(V,C)||N;}if(R==S){W=Z==O.block?1:0;}if(W==-1&&R>S||W==1){Y.endNode=Y.startNode=V;Y.endOffset=Y.startOffset=S-(R-U);return Y;}}else{if(R>=S&&!Y.startNode){T=S-(R-U);Y.startNode=V;Y.startOffset=S-(R-U);}if(R>=ab){Y.endNode=V;Y.endOffset=ab-(R-U);return Y;}}}return null;}if(!O){return false;}if(!apf.w3cRange){z.body.setActive();if(Q=O.rng){try{Q.select();}catch(M){}return true;}if(O.tag){Q=N.createControlRange();var G=z.getElementsByTagName(O.tag),J=0,H=G.length;for(;J<H;J++){if(J==O.index){Q.addElement(G[J]);}}}else{try{if(O.start<0){return true;}Q=F.createRange();if(m){Q.moveToElementText(m);Q.moveStart(i,-2);Q.expand(word);Q.collapse(false);}else{Q.moveToElementText(N);Q.collapse(true);Q.moveStart(i,O.start);Q.moveEnd(i,O.length);}}catch(K){return true;}}try{Q.select();}catch(M){}return true;}if(!F){return false;}Q=E.cloneRange();if(O.rng){F.removeAllRanges();F.addRange(O.rng);}else{if(typeof O.node!=u){var P=false;if((O.node.nodeType==3&&O.node.parentNode!=null&&O.node.textContent==O.content)||(O.node.nodeType!=3&&O.node.innerHTML==O.content)){Q.setStart(O.node,O.offset);Q.collapse(true);P=true;}if(typeof O.br!=u&&(/IMG|BR|INPUT/.test(O.br.nodeName))){if(O.br.nextSibling){Q.selectNode(O.br.nextSibling);Q.collapse(true);}else{Q.selectNode(O.br);Q.collapse(false);}P=true;}if(P){if(!apf.isOpera){F.removeAllRanges();}F.addRange(Q);N.focus();b.scrollTo(O.scrollX,O.scrollY);return;}}if(typeof O.start!=u&&typeof O.end!=u){try{var L=I(O.start,O.end);if(L){Q.setStart(L.startNode,L.startOffset);Q.setEnd(L.endNode,L.endOffset);b.scrollTo(O.scrollX,O.scrollY);if(!apf.isOpera){F.removeAllRanges();}F.addRange(Q);}}catch(M){apf.console.error(M);}}return;}};this.getContent=function(J){if(typeof J!="string"){J="html";}var F=this.getRange(),E=this.get(),H,I,L,K=z.body;if(J=="text"){return this.isCollapsed()?"":(F.text||(E.toString?E.toString():""));}if(this.isCollapsed()){return"";}if(typeof F.htmlText!=u){return F.htmlText;}var G,L=F.cloneContents();if(!L.childNodes.length){return"";}G=L.childNodes[0].ownerDocument.createElement("div");G.appendChild(L);return G.innerHTML;};this.setContent=function(F,I){var E=this.getRange();if(!I){F=apf.htmlCleaner.prepare(F,true);}if(E.insertNode){F+='<span id="__caret">_</span>';E.deleteContents();E.insertNode(this.getRange().createContextualFragment(F));var G=z.getElementById("__caret");var H=G.previousSibling;E=z.createRange();E.setStartBefore(G);E.setEndAfter(G);this.setRange(E);z.execCommand("Delete",false,null);if(G&&G.parentNode){G.parentNode.removeChild(G);}return H;}else{if(E.item){this.remove();E=this.getRange();}F=F.replace(/^<(\w+)/,'<$1 id="__caret"');E.pasteHTML(F);var H=z.getElementById("__caret");if(H){H.removeAttribute("id");return H;}}};var g={img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1};this.getType=function(){var E=this.get();if(apf.isIE){return E.type;}else{var G="Text";if(E&&E.rangeCount==1){var F=E.getRangeAt(0);if(F.startContainer==F.endContainer&&(F.endOffset-F.startOffset)==1&&F.startContainer.nodeType==1&&g[F.startContainer.childNodes[F.startOffset].nodeName.toLowerCase()]){G=x;}}return G;}};this.getSelectedNode=function(){var F=this.getRange();if(!apf.isIE){if(!F){return z;}var E=this.get(),G=F.commonAncestorContainer;if(!F.collapsed){if(apf.isWebkit&&E.anchorNode&&E.anchorNode.nodeType==1){return E.anchorNode.childNodes[E.anchorOffset];}if(F.startContainer==F.endContainer){if(F.startOffset-F.endOffset<2){if(F.startContainer.hasChildNodes()){G=F.startContainer.childNodes[F.startOffset];}}}}return G;}return F.item?F.item(0):F.parentElement();};this.getParentNode=function(){switch(this.getType()){case x:if(apf.isIE){return this.getSelectedNode().parentElement;}else{return this.getSelectedNode().parentNode;}case o:return;default:var E=this.get();if(apf.isIE){return E.createRange().parentElement();}else{if(E){var F=E.anchorNode;while(F&&F.nodeType!=1){F=F.parentNode;}return F;}}break;}};this.selectNode=function(G){var E,F;while(G.nodeType==1&&G.firstChild){G=G.firstChild;}if(apf.isIE){E=this.get();if(!G){G=E.createRange().parentElement();}try{E.empty();}catch(I){}try{F=z.body.createControlRange();F.addElement(G);}catch(I){F=z.body.createTextRange();try{F.moveToElementText(G.nodeType!=1?G.parentNode:G);}catch(H){if(G.nodeValue){F.findText(G.nodeValue);}}}try{F.select();}catch(I){}}else{F=this.getRange();if(G){F.selectNode(G);}E=this.get();E.removeAllRanges();E.addRange(F);}return this;};this.collapse=function(F){var E=this.getRange(),G;if(E.item){G=E.item(0);E=z.body.createTextRange();E.moveToElementText(G);}E.collapse(!!F);this.setRange(E);return this;};this.isCollapsed=function(){var F=this.getRange(),E=this.get();if(!F||F.item){return false;}return !E||F.boundingWidth==0||F.collapsed;};this.hasAncestorNode=function(H){var F,E=this.getRange();if(this.getType()==x||!apf.isIE){F=this.getSelectedNode();if(!F&&!apf.isIE){try{F=E.startContainer;}catch(G){}}}else{F=E.parentElement();}while(F){if(apf.isIE){if(F.tagName==H){return true;}else{if(F.nodeType==1&&F.tagName==H){return true;}}}F=F.parentNode;}return false;};this.moveToAncestorNode=function(I){var H,G,E=this.getRange();I=I.toUpperCase();if(apf.isIE){if(this.getType()==x){for(G=0;G<E.length;G++){if(E(G).parentNode){H=E(G).parentNode;break;}}}else{H=E.parentElement();}while(H&&H.nodeName!=I){H=H.parentNode;}return H;}else{var F=this.getSelectedNode();if(!F){F=b.getSelection().getRangeAt(0).startContainer;}while(F){if(F.tagName==I){return F;}F=F.parentNode;}return null;}};this.remove=function(){var E=this.get(),F;if(apf.isIE){if(E.type!=o){E.clear();}}else{if(E){for(F=0;F<E.rangeCount;F++){E.getRangeAt(F).deleteContents();}}}return this;};this.$destroy=function(){b=z=l=this.current=k=null;delete b;delete z;delete l;delete this.current;delete k;};};apf.saveData=apf.getData=function(b,l){if(!b){return false;}var m,i=b.charAt(0),k=l.callback;var g=function(q,o,n){var r=l.callback;if(o!=apf.SUCCESS){return r(q,o,n||{});}return r(q,o,n||{});};if(!l){l={};}var d=l.fParsed||(b.indexOf("{")>-1||b.indexOf("[")>-1?apf.lm.compile(b,{withopt:true,precall:l._pc==-1?false:l._pc,alwayscb:true,simplexpath:true}):{str:b,type:2});if(d.type==3){if(d.xpaths[0]){return g(apf.nameserver.get("model",d.xpaths[0]).data.selectSingleNode(d.xpaths[1]),apf.SUCCESS,{});}else{return g(l.xmlNode.data.selectSingleNode(d.xpaths[1]),apf.SUCCESS,{});}}if(i=="<"){if(d.type==2){m=d.str;}else{return d(l.xmlNode,g,l);}}else{if((i=="["||i=="{")){return d(l.xmlNode,g,l);}else{if(d.type==1||d.type==3){var j=k;k=l.callback=function(r,q,n){if(l._pc===true){return;}if(q!=apf.SUCCESS){return j.apply(this,arguments);}var o=r.split(" "),s="get";if(o.length>1&&o[0].length<10){s=o.shift();o=o.join(" ");}else{o=r;}k=l.callback=j;apf.oHttp.exec(s,[o],g,l);};d(l.xmlNode,g,l);}else{if(l._pc===true){return;}var c=b.split(" "),a="get";if(c.length>1&&c[0].length<10){a=c.shift();c=c.join(" ");}else{c=b;}apf.oHttp.exec(a,[c.replace(/\\/g,"")],g,l);}}}if(m){if(k){g(m,apf.SUCCESS,{});}else{return m;}}};apf.setModel=function(a,d){if(!a){return;}var c=a.indexOf("{")>-1||a.indexOf("[")>-1?apf.lm.compile(a,{alwayscb:true}):{type:2,str:a};if(a=="@default"||c.type==2){var b=apf.nameserver.get("model",a);if(b){return b.register(d);}else{if(a=="@default"){return;}}if(a.indexOf(".")==-1&&a.indexOf("/")==-1){return;}}if(c.type==3){if(c.models){if(c.xpaths.length==2&&c.xpaths[0]!="#"&&c.xpaths[1]!="#"){apf.nameserver.get("model",c.xpaths[0]).register(d,c.xpaths[1]);return;}}}if(d.clear){d.clear("loading");}apf.getData(a,{parsed:c,callback:function(k,j,g){if(j!=apf.SUCCESS){throw new Error(apf.formatErrorString(0,null,"Loading new data","Could not load data into model.                 \nMessage: "+g.message+"                \nInstruction: '"+a+"'"));}if(!k){return;}if(typeof k=="string"){if(k.charAt(0)=="<"){k=apf.getXml(k);}else{if(k.indexOf("http://")==0){return apf.setModel(k,d);}else{throw new Error("Invalid data from server");}}}var i=apf.xmldb.findModel(k);if(i){i.register(d,apf.xmlToXpath(k,i.data));}else{new apf.model().register(d).load(k);}}});};apf.skins={skins:{},css:[],events:["onmousemove","onmousedown","onmouseup","onmouseout","onclick","ondragcopy","ondragstart"],Init:function(n,k,o){var c=(k?k.getAttribute("id"):null)||n.getAttribute("id");var d=(k?k.getAttribute("src").match(/\//)||o:"")?(o||k.getAttribute("src")).replace(/\/[^\/]*$/,"")+"/":"";var g=(n.getAttribute("media-path")?apf.getAbsolutePath(d||apf.hostPath,n.getAttribute("media-path")):(k?k.getAttribute("media-path"):null));var l=(n.getAttribute("icon-path")?apf.getAbsolutePath(d||apf.hostPath,n.getAttribute("icon-path")):(k?k.getAttribute("icon-path"):null));if(!c){c="default";}if(n.getAttribute("id")){document.body.className+=" "+n.getAttribute("id");}var m=c.split("|");c=m[0];if(!this.skins[c]||c=="default"){this.skins[c]={base:d,name:c,iconPath:typeof l!="string"&&!l?"icons/":l,mediaPath:typeof g!="string"&&!g?"images/":g,templates:{},originals:{},xml:n};if(m.length>1){for(var j=0;j<m.length;j++){this.skins[m[j]]=this.skins[c];}}}if(!this.skins["default"]&&this.$first==k){this.skins["default"]=this.skins[c];}var b=n.childNodes;for(var j=b.length-1;j>=0;j--){if(b[j].nodeType!=1){continue;}this.skins[c].templates[b[j].getAttribute("name")]=b[j];if(b[j].ownerDocument){this.importSkinDef(b[j],d,c);}}this.purgeCss(g||d+"images/",l||d+"icons/");if(this.queue[c]){for(var a in this.queue[c]){this.queue[c][a]();}}},loadStylesheet:function(filename,title){var o;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",apf.ns.aml),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",apf.ns.apf);var t=this.skins[name].templates;for(i=0;i<nodes.length;i++){if(!nodes[i].firstChild){continue;}t[nodes[i].firstChild.nodeValue.toLowerCase()]=xmlNode;}},loadedCss:"",purgeCss:function(a,c){if(!this.css.length){return;}var b=this.css.join("\n").replace(/images\//g,a).replace(/icons\//g,c);apf.importCssString(b);this.css=[];},loadCssInWindow:function(a,k,c,i){this.css=[];var b=a.split(":");var j=this.skins[b[0]];var d=j.templates[b[1]];this.importSkinDef(d,j.base,j.name);var g=this.css.join("\n").replace(/images\//g,c).replace(/icons\//g,i);apf.importCssString(g);this.css=[];},setSkinPaths:function(a,c){a=a.split(":");var b=a[0];var d=a[1];c.iconPath=this.skins[b].iconPath;c.mediaPath=this.skins[b].mediaPath;},getTemplate:function(c,b){c=c.split(":");var g=c[0];var k=c[1];if(!this.skins[g]){if(b){return false;}return false;}if(!this.skins[g].templates[k]){return false;}var l=this.skins[g].templates[k];var a=this.skins[g].originals[k];if(!a){a=this.skins[g].originals[k]={};var d=$xmlns(l,"presentation",apf.ns.aml)[0].childNodes;for(var j=0;j<d.length;j++){if(d[j].nodeType!=1){continue;}a[d[j].baseName||d[j][apf.TAGNAME]]=d[j];}}return a;},getCssString:function(a){return apf.queryValue($xmlns(this.skins[a.split(":")[0]].xml,"style",apf.ns.aml)[0],"text()");},changeSkinset:function(b){var a=apf.document.documentElement;while(a){if(a&&a.nodeFunc==apf.NODE_VISIBLE&&a.hasFeature(apf.__PRESENTATION__)&&!a.skinset){a.$propHandlers.skinset.call(a,b);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;}}}},queue:{},waitForSkin:function(a,c,b){if(this.skins[a]){return;}(this.queue[a]||(this.queue[a]={}))[c]=b;return true;},setIcon:function(b,c,a){if(!c){b.style.backgroundImage="";return;}if(b.tagName.toLowerCase()=="img"){b.setAttribute("src",c?(a||"")+c:"");return;}b.style.backgroundImage="url("+(a||"")+c+")";}};apf.language={automatch:false,loaded:false,prefix:"sub.main.",words:{},texts:{},elements:{},bindings:{},count:0,load:function(a,b){if(!a){return;}if(typeof a=="string"){if(a.charAt(0)=="<"){a=apf.getXmlDom(a).documentElement;}else{return this.loadFrom(a);}}this.parseSection(a,b);this.redraw();this.loaded=true;},loadFrom:function(a){apf.getData(a,{callback:function(b){if(!b){return;}apf.language.load(b);}});},parseSection:function(c,d){if(!d){d=c.getAttribute("id")||"";}if(c.tagName=="key"){d+="/"+c.getAttribute("id");this.words[d]=c.firstChild?c.firstChild.nodeValue:"";return;}if(c.tagName=="group"){d+=(d?"/":"")+c.getAttribute("id");}var a=c.childNodes;for(var b=0;b<a.length;b++){if(a[b].nodeType==1){this.parseSection(a[b],d);}}},redraw:function(){var b,g,a,l,i=this.elements,d;for(b in i){l=i[b],d=apf.all[b];for(a in l){g=l[a];try{if(g.asyncs){return g.call(this,d.xmlRoot,function(n){d.setProperty(a,n,true);});}else{var m=g.call(d,d.xmlRoot);}}catch(k){apf.console.warn("[275] Could not execute language update for "+a+"\n\n"+k.message);continue;}d.setProperty(a,m,true);}}var c,d,j=this.bindings;for(b in j){d=apf.all[b];if(d.selection){c=d.getSelection();d.reload();d.selectList(c);}else{d.reload();}}},getWord:function(a){return this.words[a];},addProperty:function(a,c,b){(this.elements[a.$uniqueId]||(this.elements[a.$uniqueId]={}))[c]=b;},removeProperty:function(a,b){delete (this.elements[a.$uniqueId]||false)[b];},addBinding:function(a){this.bindings[a.$uniqueId]=true;},removeBinding:function(a){delete this.bindings[a.$uniqueId];}};apf.date=(function(){return{masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"},i18n:{beginWeekday:1,dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNumbers:{Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6,Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],monthNumbers:{Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11}}};})();apf.date.dateFormat=(function(){var a=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,b=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,d=/[^-+\dA-Z]/g,c=function(i,g){i=String(i);g=g||2;while(i.length<g){i="0"+i;}return i;};return function(l,B,w){var j=apf.date;if(arguments.length==1&&(typeof l=="string"||l instanceof String)&&!/\d/.test(l)){B=l;l=undefined;}l=l?new Date(l):new Date();if(isNaN(l)){return"NaN";}B=String(j.masks[B]||B||j.masks["default"]);if(B.slice(0,4)=="UTC:"){B=B.slice(4);w=true;}var z=w?"getUTC":"get",r=l[z+"Date"](),g=l[z+"Day"](),n=l[z+"Month"](),u=l[z+"FullYear"](),x=l[z+"Hours"](),q=l[z+"Minutes"](),A=l[z+"Seconds"](),t=l[z+"Milliseconds"](),i=w?0:l.getTimezoneOffset(),k={d:r,dd:c(r),ddd:j.i18n.dayNames[g],dddd:j.i18n.dayNames[g+7],m:n+1,mm:c(n+1),mmm:j.i18n.monthNames[n],mmmm:j.i18n.monthNames[n+12],yy:String(u).slice(2),yyyy:u,h:x%12||12,hh:c(x%12||12),H:x,HH:c(x),M:q,MM:c(q),s:A,ss:c(A),l:c(t,3),L:c(t>99?Math.round(t/10):t),t:x<12?"a":"p",tt:x<12?"am":"pm",T:x<12?"A":"P",TT:x<12?"AM":"PM",Z:w?"UTC":(String(l).match(b)||[""]).pop().replace(d,""),o:(i>0?"-":"+")+c(Math.floor(Math.abs(i)/60)*100+Math.abs(i)%60,4),S:["th","st","nd","rd"][r%10>3?0:(r%100-r%10!=10)*r%10]};return B.replace(a,function(m){return m in k?k[m]:m.slice(1,m.length-1);});};})();apf.date.getDateTime=function(n,r){var g=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g;var j=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC:)(?:[-+]\d{4})?)\b/g;var a=0;var b,q=new Date().getFullYear(),c=1,l=1,i=12,k=0,u=0;var t=apf.date.i18n;if(!r){throw new Error(apf.formatErrorString(0,null,"date-format","Date format is null"));}r=r.replace(j,"");var o=r.replace(g,function(y,x,w){var d=n.substring(w+a,w+a+y.length);switch(y){case"d":case"m":case"h":case"H":case"M":case"s":if(!/[\/, :\-](d|m|h|H|M|s)$|^(d|m|h|H|M|s)[\/, :\-]|[\/, :\-](d|m|h|H|M|s)[\/, :\-]/.test(r)){throw new Error(apf.formatErrorString(0,null,"date-format","Dates without leading zero needs separators"));}var s=parseInt(n.substring(w+a,w+a+2));if(s.toString().length==2){a++;}return y=="d"?l=s:(y=="m"?c=s:(y=="M"?k=s:(y=="s"?u=s:i=s)));case"dd":return l=d;case"dddd":a+=t.dayNames[t.dayNumbers[d.substring(0,3)]+7].length-4;break;case"mm":return c=d;case"mmm":return c=t.monthNumbers[d]+1;case"mmmm":var m=t.monthNumbers[d.substring(0,3)];a+=t.monthNames[m+12].length-4;return c=m+1;case"yy":return q=parseInt(d)<70?"20"+d:d;case"yyyy":return q=d;case"hh":return i=d;case"HH":return i=d;case"MM":return k=d;case"ss":return u=d;case"'T'":case"'Z'":a-=2;break;}});return new Date(q,c-1,l,i,k,u);};Date.prototype.format=function(a,b){return apf.date.dateFormat(this,a,b);};Date.parse=function(b,a){return apf.date.getDateTime(b,a);};apf.xmldb=new (function(){this.xmlDocTag="a_doc";this.xmlIdTag="a_id";this.xmlListenTag="a_listen";this.htmlIdTag="id";this.disableRSB=false;this.$xmlDocLut=[];this.getElementById=function(d,c){if(!c){c=this.$xmlDocLut[d.split("|")[0]];}if(!c){return false;}return c.selectSingleNode("descendant-or-self::node()[@"+this.xmlIdTag+"='"+d+"']");};this.getNode=function(c){if(!c||!c.getAttribute(this.htmlIdTag)){return false;}return this.getElementById(c.getAttribute(this.htmlIdTag).split("|",2).join("|"));};this.getNodeById=function(g,d){var c=g.split("|");c.pop();return this.getElementById(c.join("|"),d);};this.getDocumentById=function(c){return this.$xmlDocLut[c];};this.getDocument=function(c){return this.$xmlDocLut[c.getAttribute(this.xmlIdTag).split("|")[0]];};this.getID=function(c,d){return c.getAttribute(this.xmlIdTag)+"|"+d.$uniqueId;};this.getElement=function(k,l){var c=k.childNodes;for(var d=0,g=0;g<c.length;g++){if(c[g].nodeType!=1){continue;}if(d++==l){return c[g];}}};this.setModel=function(c){apf.nameserver.register("model",c.data.ownerDocument.documentElement.getAttribute(this.xmlDocTag),c);};this.findModel=function(c){return apf.nameserver.get("model",c.ownerDocument.documentElement.getAttribute(this.xmlDocTag));};this.getXmlId=function(c){return c.getAttribute(this.xmlIdTag)||this.nodeConnect(apf.xmldb.getXmlDocId(c),c);};this.getHtmlNode=function(c,d){if(c&&c.nodeType==1&&c.getAttribute(this.xmlIdTag)){return d.$findHtmlNode(c.getAttribute(this.xmlIdTag)+"|"+d.$uniqueId);}return null;};this.findHtmlNode=function(c,d){do{if(c.nodeType==1&&c.getAttribute(this.xmlIdTag)){return d.$findHtmlNode(c.getAttribute(this.xmlIdTag)+"|"+d.$uniqueId);}if(c==d.xmlRoot){return null;}c=c.parentNode;}while(c&&c.nodeType!=9);return null;};this.findXmlNode=function(c){if(!c){return false;}var d;while(c&&c.nodeType==1&&(c.tagName.toLowerCase()!="body"&&!(d=c.getAttribute(this.htmlIdTag))||(d||(d=c.getAttribute(this.htmlIdTag)))&&d.match(/^q/))){if(c.host&&c.host.$ext==c){return c.host.xmlRoot;}c=c.parentNode;}if(!c||c.nodeType!=1){return false;}if(c.tagName.toLowerCase()=="body"){return false;}return this.getNode(c);};this.getXml=apf.getXml;this.nodeCount={};this.nodeConnect=function(g,d,j,k){if(!this.nodeCount[g]){this.nodeCount[g]=0;}var i;i=d.getAttribute(this.xmlIdTag)||d.setAttribute(this.xmlIdTag,(i=g+"|"+ ++this.nodeCount[g]))||i;if(!k){return i;}var c=i+"|"+k.$uniqueId;if(j){j.setAttribute(this.htmlIdTag,c);}return c;};this.$listeners=[];this.addNodeListener=function(d,i,g){var j,c=String(d.getAttribute(this.xmlListenTag)||"");if(!g){g=String(i.$uniqueId);}if(g.charAt(0)=="p"){g=g.split("|");j=this.$listeners.push(function(){var m=apf.all[g[1]];if(m){var l=apf.all[g[3]];var k=l.$propBinds[g[1]][g[2]].root;m.$execProperty(g[2],k?l.data.selectSingleNode(k):l.data);}})-1;}else{j=this.$listeners.push(function(k){var l=apf.all[g];if(l){l.$xmlUpdate.apply(l,k);}})-1;}if(!c||c.indexOf(j)==-1){d.setAttribute(this.xmlListenTag,c?c+";"+j:j);}return d;};this.removeNodeListener=function(j,l,m){var g=j.getAttribute(this.xmlListenTag);var c=(g?g.split(";"):[]);if(!m){m=l.$uniqueId;}for(var k=[],d=0;d<c.length;d++){if(c[d]!=m){k.push(c[d]);}}j.setAttribute(this.xmlListenTag,k.join(";"));return j;};this.setTextNode=apf.setTextNode=function(d,i,c,j){var g;if(c){g=d.selectSingleNode(c);if(!g){return;}d=g.nodeType==1?g:null;}if(d.nodeType!=1){g=d;}else{if(d||!g){g=d.selectSingleNode("text()");if(!g){g=d.appendChild(d.ownerDocument.createTextNode(""));}}}if(j){j.extra.oldValue=g.nodeValue;}g.nodeValue=i;if(g.$regbase){g.$setValue(i);}this.applyChanges("text",g.parentNode,j);this.applyRSB(["setTextNode",d,i,c],j);};this.setAttribute=apf.setAttribute=function(g,d,i,c,j){(c?g.selectSingleNode(c):g).setAttribute(d,i);this.applyChanges("attribute",g,j);this.applyRSB(["setAttribute",g,d,i,c],j);};this.removeAttribute=apf.removeAttribute=function(g,d,c,i){if(i){i.name=d;}(c?g.selectSingleNode(c):g).removeAttribute(d);this.applyChanges("attribute",g,i);this.applyRSB(["removeAttribute",g,d,c],i);};this.replaceNode=apf.replaceNode=function(g,i,d,j){if(d){i=i.selectSingleNode(d);}if(j){j.oldNode=i;j.xmlNode=g;}var c=i.parentNode;c.replaceChild(g,i);this.copyConnections(i,g);this.applyChanges("replacechild",g,j);this.applyRSB(["replaceChild",i,g,d],j);return g;};this.addChildNode=apf.addChildNode=function(l,k,c,d,m){var j=l.insertBefore(l.ownerDocument.createElement(k),d);for(var g=0;g<c.length;g++){j.setAttribute(c[g][0],c[g][1]);}if(m){m.extra.addedNode=j;}this.applyChanges("add",j,m);this.applyRSB(["addChildNode",l,k,c,d],m);return j;};this.appendChild=apf.appendChild=function(j,i,d,l,c,k){if(l&&j.selectSingleNode(i.tagName)){return false;}if(k){this.cleanNode(i);}if(j.ownerDocument.importNode&&j.ownerDocument!=i.ownerDocument){i=j.ownerDocument.importNode(i,true);}if(c){var g=[];var j=apf.createNodeFromXpath(j,c,g);if(g.length){j.appendChild(i);while(g.length){if(j==g.pop()&&g.length){j=j.parentNode;}}}}else{if(i.parentNode){this.removeNode(i);}}j.insertBefore(i,d);this.applyChanges("add",i,k);this.applyRSB(["appendChild",j,i.xml,d,l,c],k);return i;};this.moveNode=apf.moveNode=function(i,g,d,c,j){if(!j){j={extra:{}};}j.extra.oldParent=g.parentNode;j.extra.beforeNode=g.nextSibling;j.extra.parent=(c?i.selectSingleNode(c):i);this.applyChanges("move-away",g,j);this.applyRSB(["moveNode",i,g,d,c],j);if(!apf.isWebkit&&apf.xmldb.getXmlDocId(g)!=apf.xmldb.getXmlDocId(i)){g.removeAttributeNode(g.getAttributeNode(this.xmlIdTag));this.nodeConnect(apf.xmldb.getXmlDocId(i),g);}if(apf.isWebkit&&i.ownerDocument!=g.ownerDocument){g=i.ownerDocument.importNode(g,true);}j.extra.parent.insertBefore(g,d);this.applyChanges("move",g,j);};this.removeNode=apf.removeNode=function(d,c,i){if(c){d=d.selectSingleNode(c);}if(i){i.extra.parent=d.parentNode;i.extra.removedNode=d;i.extra.beforeNode=d.nextSibling;}this.applyRSB(["removeNode",d,c],i);this.applyChanges("remove",d,i);var g=d.parentNode;g.removeChild(d);this.applyChanges("redo-remove",d,null,g);};this.removeNodeList=apf.removeNodeList=function(c,k){for(var g=[],d=0;d<c.length;d++){if(k){g.push({pNode:c[d].parentNode,removedNode:c[d],beforeNode:c[d].nextSibling});}this.applyChanges("remove",c[d],k);var j=c[d].parentNode;j.removeChild(c[d]);this.applyChanges("redo-remove",c[d],null,j);}if(k){k.extra.removeList=g;}this.applyRSB(["removeNodeList",c,null],k);};var b={},a;this.$hasQueue=false;this.applyChanges=function(m,u,x,g){if(x&&x.$dontapply){return;}if(x&&!x.xmlNode){x.xmlNode=u;}var c=g,w=(u.nodeType==1?u:u.parentNode);if(!this.delayUpdate&&"|remove|move-away|".indexOf("|"+m+"|")>-1){this.notifyQueued();}var l,t,r,q,n,o,d,k,s,y;while(w&&w.nodeType!=9){l=w.getAttribute(this.xmlListenTag);if(l){r=l.split(";");for(q=0;q<r.length;q++){t=r[q];o=b[t];if(!o){b[t]=o=[];}if("|update|attribute|text|".indexOf("|"+m+"|")>-1){y=false;for(n=0;n<o.length;n++){if(o[n]&&u==o[n][1]&&"|update|attribute|text|".indexOf("|"+o[n][0]+"|")>-1){o[n]=null;y=true;continue;}}o.push(["update",u,w,x,c]);s=true;continue;}if("|remove|move-away|add|".indexOf("|"+m+"|")>-1){if(this.$listeners[t]){this.$listeners[t]([m,u,w,x,c]);}}else{o.push([m,u,w,x,c]);s=true;}}}w=w.parentNode||g;if(w==g){g=null;}}if(x&&!this.delayUpdate){apf.xmldb.notifyQueued();}else{if(s){clearTimeout(a);a=$setTimeout(function(){apf.xmldb.notifyQueued();});}}};this.notifyQueued=function(){this.$hasQueue=false;clearTimeout(a);for(var g in b){var j=b[g];var d=this.$listeners[g];if(!j){continue;}for(var c=0;c<j.length;c++){if(!j[c]){continue;}d(j[c]);}}b={};};this.notifyListeners=function(g){var d=g.getAttribute(apf.xmldb.xmlListenTag);if(d){d=d.split(";");for(var c=0;c<d.length;c++){apf.all[d[c]].$xmlUpdate("synchronize",g,g);}}};this.applyRSB=function(g,j){if(apf.xmldb.disableRSB){return;}var i=g[1]&&g[1].length&&g[1][0]||g[1];if(i.nodeType==2){i=i.ownerElement||i.selectSingleNode("..");}var c=apf.xmldb.getXmlDocId(i),d=apf.nameserver.get("model",c);if(!d&&apf.isO3){d=self[c];}if(!d){if(!apf.nameserver.getAll("remote").length){return;}return;}if(!d.rsb){return;}if(j){d.rsb.queueMessage(g,d,j);}else{d.rsb.sendChange(g,d);}};this.copyConnections=function(d,c){try{c.setAttribute(this.xmlListenTag,d.getAttribute(this.xmlListenTag));}catch(g){}try{c.setAttribute(this.xmlIdTag,d.getAttribute(this.xmlIdTag));}catch(g){}};this.cleanNode=function(g){try{var d,c=g.selectNodes("descendant-or-self::node()[@"+this.xmlListenTag+"]");for(d=c.length-1;d>=0;d--){c[d].removeAttribute(this.xmlListenTag);}c=g.selectNodes("descendant-or-self::node()[@"+this.xmlIdTag+"]");for(d=c.length-1;d>=0;d--){c[d].removeAttribute(this.xmlIdTag);}c=g.selectNodes("descendant-or-self::node()[@"+this.xmlDocTag+"]");for(d=c.length-1;d>=0;d--){c[d].removeAttribute(this.xmlDocTag);}c=g.selectNodes("descendant-or-self::node()[@a_loaded]");for(d=c.length-1;d>=0;d--){c[d].removeAttribute("a_loaded");}}catch(j){}return g;};this.copy=this.getCleanCopy=apf.getCleanCopy=function(c){return apf.xmldb.cleanNode(c.cloneNode(true));};this.unbind=function(n){for(var q={},l=0;l<n.apf.all.length;l++){if(n.apf.all[l]&&n.apf.all[l].unloadBindings){q[n.apf.all[l].unloadBindings()]=true;}}for(var c=0;c<this.$xmlDocLut.length;c++){if(!this.$xmlDocLut[c]){continue;}var o=this.$xmlDocLut[c].selectNodes("//self::node()[@"+this.xmlListenTag+"]");for(var l=0;l<o.length;l++){var g=o[l].getAttribute(this.xmlListenTag).split(";");for(var m=[],d=0;d<g.length;d++){if(!q[g[d]]){m.push(g[d]);}}if(m.length!=g.length){o[l].setAttribute(this.xmlListenTag,m.join(";"));}}}};this.getXmlDocId=function(g,c){var i=g.ownerDocument.documentElement;if(!apf.isChildOf(i,g)){i=g;}var d=(i||g).getAttribute(this.xmlDocTag)||this.$xmlDocLut.indexOf(i||g.ownerDocument||g);if(!d||d==-1){d=this.$xmlDocLut.push(i||g.ownerDocument||g)-1;if(i){i.setAttribute(this.xmlDocTag,d);}}if(c){apf.nameserver.register("model",d,c);}return d;};});apf.htmlCleaner=(function(){var d=null,b=null,c={table:1,TABLE:1},a={br:1,img:1,input:1,hr:1};return{prepare:function(l,j){if(!d){d=[/<(\/?)strong>|<strong( [^>]+)>/gi,/<(\/?)em>|<em( [^>]+)>/gi,/&apos;/g,/(<(\/?)(span|strong|em|u|i|b|a|strike|sup|sub|font|img)(?:\s+[\s\S]*?)?>)|(<br[\s\S]*?>)|(<(\/?)([\w\-]+)(?:\s+[\s\S]*?)?>)|([^<>]*)/gi,/(<a[^>]*href=)([^\s^>]+)*([^>]*>)/gi,/<p><\/p>/gi,/<a( )([^>]+)\/>|<a\/>/gi];}if(apf.isGecko){l=l.replace(d[0],"<$1b$2>").replace(d[1],"<$1i$2>");}else{if(apf.isIE){l=l.replace(d[2],"&#39;").replace(d[4],"$1$2 _apf_href=$2$3");var n=[],o=false,g=[],k=[],m=[],i=false;l.replace(d[3],function(t,z,B,D,C,w,r,x,y){if(z){var s=g.push(z);D=D.toLowerCase();if(!a[D]){if(B){if(!k[k.length-1]||k[k.length-1][0]!=D){g.length--;}else{k.length--;}}else{k.push([D,s]);}}o=true;}else{if(y){g.push(y);o=true;}else{if(C){if(o){if(k.length){g.push(C);}else{n.push("<p>",g.join(""),"</p>");g=[];}if(!k.length){o=false;}}else{if((m.length||i)&&C.indexOf("_apf_marker")>-1){}else{n.push("<p>&nbsp;</p>");}}}else{if(w){if(r){if(m[m.length-1]!=x.toLowerCase()){return;}else{m.length--;}if(g.length){n.push(g.join(""));g=[];}i=2;}else{var u=g.length&&g.join("").trim();var A=u?g:n;if(!c[x]){if(A[A.length-1]=="<p>&nbsp;</p>"){A[A.length-1]="";}else{if(u&&!m.length){A.push("<p></p>");}}}if(g.length){if(!u||m.length){n.push(g.join(""));g=[];}else{n.push("<p>",g.join(""),"</p>");g=[];}}m.push(x.toLowerCase());}n.push(w);o=false;}}}}i=i==2?1:false;});var q;if((q=g.join("")).trim()){n.push(j?q:"<p>"+q+"</p>");}l=n.join("");}}l=(apf.xmlentities?apf.xmlentities(l):l).replace(d[6],"<a$1$2></a>");return l;},parse:function(k,i,l){if(!b){b=[/<br[^>]*><\/li>/gi,/<br[^>]*_apf_placeholder="1"\/?>/gi,/<(a|span|div|h1|h2|h3|h4|h5|h6|pre|address)>[\s\n\r\t]*<\/(a|span|div|h1|h2|h3|h4|h5|h6|pre|address)>/gi,/<(tr|td)>[\s\n\r\t]*<\/(tr|td)>/gi,/[\s]*_apf_href="?[^\s^>]+"?/gi,/(".*?"|'.*?')|(\w)=([^'"\s>]+)/gi,/<((?:br|input|hr|img)(?:[^>]*[^\/]|))>/ig,/<p>&nbsp;$/mig,/(<br[^>]*?>(?:[\r\n\s]|&nbsp;)*<br[^>]*?>)|(<(\/?)(span|strong|em|u|i|b|a|br|strike|sup|sub|font|img)(?:\s+.*?)?>)|(<(\/?)([\w\-]+)(?:\s+.*?)?>)|([^<>]*)/gi,/<\/p>/gi,/<p>/gi,/<\s*\/?\s*(?:\w+:\s*)?[\w-]*[\s>\/]/g];}if(apf.isIE){k=k.replace(b[7],"<p></p>").replace(b[9],"<br />").replace(b[10],"");}else{if(k=="<br>"){k="";}}k=(apf.xmlentities?apf.xmlentities(k):k).replace(b[0],"</li>").replace(b[1],"").replace(b[2],"").replace(b[3],"<$1>&nbsp;</$2>").replace(b[4],"").replace(b[6],"<$1 />").replace(b[11],function(q){return q.toLowerCase();});if(apf.isIE&&!l){var o=[],j=true,n=[],m=[],g=[];k.replace(b[8],function(t,B,y,A,D,u,q,w,x){if(y){if(apf.isIE){y=y.replace(b[5],function(F,G,E,s){return G||E+'="'+s+'"';});}var r=n.push(y);if(!a[D]){if(A){if(!m[m.length-1]||m[m.length-1][0]!=D){n.length--;}else{m.length--;}}else{m.push([D,r]);}}j=true;}else{if(x){n.push(x);j=true;}else{if(B){if(j){if(m.length){n.push(B);}else{o.push("<p>",n.join("").trim()||"&nbsp;","</p>");n=[];j=false;}}else{o.push("<p>&nbsp;</p>");}}else{if(u){if(q){if(g[g.length-1]!=w){return;}else{g.length--;}if(n.length){o.push(n.join(""));n=[];}}else{if(apf.isIE){u=u.replace(b[5],function(F,G,E,s){return G||E+'="'+s+'"';});}var z=n.length?n:o;if(z[z.length-1]=="<p>&nbsp;</p>"){z.length--;}if(n.length){var C;if(g.length||(C=n.join("").trim()).replace(/<.*?>/g,"").trim()==""){o.push(C||n.join(""));n=[];}else{o.push("<p>",(C||n.join("").trim()||"&nbsp;").replace(/<br \/>[\s\r\n]*$/,""),"</p>");n=[];}}g.push(w);}o.push(u);j=false;}}}}});if(n.length){o.push("<p>"+n.join("").replace(/<br \/>[\s\r\n]*$/,"")+"</p>");}k=o.join("");}else{k=k.replace(/<br[^>]*_apf_marker="1"[^>]*>/gi,"<br />");}return k;}};})();apf.storage={modules:{},init:function(a){if(!a){a=this.autodetect();}var b=this.getProvider(a);apf.storage=apf.extend(b,this);apf.storage.init=null;return b;},getProvider:function(a){var b=apf.storage.modules[a];if(!b||typeof b!="object"){return false;}if(!b.isAvailable()){return false;}if(!b.initialized&&(!b.init||b.init()===false)){return false;}b.name=a;apf.extend(b,this.base);return b;},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(d,b){var g=this.getKeys(d);if(!g||!g.length){return;}var a=this.getMultiple(g,d);for(var c=0;c<g.length&&a;c++){if(a[c]){b[g[c]]=a[c];}}return g.length;}}};apf.Sort=function(b){var c={};this.parseXml=function(l,j){if(j){c={};}c.order=l.order;c.getValue=l.csort||l.$compile("sort");c.getNodes=self[l["nodes-method"]];c.ascending=(c.order||"").indexOf("desc")==-1;c.order=null;if(l["data-type"]){c.method=d[l["data-type"]];}else{if(l["sort-method"]){c.method=self[l["sort-method"]];}else{c.method=d.alpha;}}var m=l["date-format"];if(m){c.sort_dateFmtStr=m;c.method=d.date;var g=m.match(/(D+|Y+|M+|h+|m+|s+)/g);if(g){for(var n={},k=0;k<g.length;k++){n[g[k].substr(0,1)]=k+1;}c.dateFormat=new RegExp(m.replace(/([^\sDYMhms])/g,"\\$1").replace(/YYYY/,"(\\d\\d\\d\\d)").replace(/(DD|YY|MM|hh|mm|ss)/g,"(\\d\\d)"));c.dateReplace="$"+n.M+"/$"+n.D+"/$"+n.Y;if(n.h){c.dateReplace+=" $"+n.h+":$"+n.m+":$"+n.s;}}}};this.set=function(i,g){if(g){c={};}apf.extend(c,i);if(!c.ascending){c.ascending=i.order?i.order.indexOf("desc")==-1:true;}c.order=null;if(i.type){c.method=d[i.type];}else{if(i.method){c.method=self[i.method];}else{if(!c.method){c.method=d.alpha;}}}if(!c.getValue){c.getValue=function(j){return apf.queryValue(j,c.xpath);};}};this.get=function(){return apf.extend({},c);};this.findSortSibling=function(l,k){var g=getNodes?getNodes(l,k):this.getTraverseNodes(l);for(var j=0;j<g.length;j++){if(!compare(k,g[j],true,sortSettings)){return g[j];}}return null;};var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000"];var d={alpha:function(g){return g.toString().toLowerCase();},number:function(g){return(g.length<a.length?a[a.length-g.length]:"")+g;},date:function(i,g){var j=c.dateFormat;var l=c.dateReplace;var m=c.sort_dateFmtStr;var k;if(!j){k=new Date(i);}else{if(m=="*"){k=Date.parse(i);}else{k=(new Date(i.replace(j,l))).getTime();}}i=""+k.getTime();if(i=="NaN"){i="0";}return(i.length<a.length?a[a.length-i.length]:"")+i;}};this.apply=function(j,r,k,g,o){var s=[],m=j.length;while(m--){var t=c.getValue(j[m]);if(j){s[s.length]={toString:function(){return this.v;},xmlNode:j[m],v:(c.method||d.alpha)(t||"",r,j[m])};}}s.sort();var l=o?Math.min(s.length,g+o):s.length;if(!g){g=0;}if(k){if(c.ascending){for(m=g;m<l;m++){f(m,l,s[m].xmlNode,s[m].v);}}else{for(m=l-1;m>=g;m--){f(l-m-1,l,s[m].xmlNode,s[m].v);}}}else{var q=[];if(c.ascending){for(m=g;m<l;m++){q[q.length]=s[m].xmlNode;}}else{for(m=l-1;m>=g;m--){q[q.length]=s[m].xmlNode;}}return q;}};if(b){this.parseXml(b);}};apf.tween=(function(x){var H={left:function(L,K){L.style.left=K+n;},right:function(L,K){L.style.left="";L.style.right=K+n;},top:function(L,K){L.style.top=K+n;},bottom:function(L,K){L.style.top="";L.style.bottom=K+n;},width:function(M,L,K){M.style.width=L+n;},height:function(M,L,K){M.style.height=L+n;},scrollTop:function(M,L,K){M.scrollTop=L;},scrollLeft:function(M,L,K){M.scrollLeft=L;},"height-rsz":function(M,L,K){M.style.height=L+n;if(x.hasSingleResizeEvent){window.onresize();}},mwidth:function(L,K,N){var M=x.getDiff(L);L.style.width=K+n;L.style.marginLeft=-1*(K/2+(parseInt(x.getStyle(L,"borderLeftWidth"))||M[0]/2)+(N.margin||0))+n;},mheight:function(L,K,N){var M=x.getDiff(L);L.style.height=K+n;L.style.marginTop=(-1*K/2-(parseInt(x.getStyle(L,"borderTopWidth"))||M[1]/2)+(N.margin||0))+n;},scrollwidth:function(L,K){L.style.width=K+n;L.scrollLeft=L.scrollWidth;},scrollheight_old:function(L,K){try{L.style.height=K+n;L.scrollTop=L.scrollHeight;}catch(M){alert(K);}},scrollheight:function(M,L,O){var N=x.getHeightDiff(M),K=O.$int||M;M.style.height=Math.max((L+(O.diff||0)),0)+n;K.scrollTop=K.scrollHeight-K.offsetHeight-N+(O.diff||0);},scrolltop:function(L,K){L.style.height=K+n;L.style.top=(-1*K-2)+n;L.scrollTop=0;},clipright:function(M,L,K){M.style.clip="rect(auto, auto, auto, "+L+"px)";M.style.marginLeft=(-1*L)+n;},fade:function(L,K){if(!x.supportOpacity&&x.hasStyleFilters){L.style.filter="alpha(opacity="+parseInt(K*100)+")";}else{L.style.opacity=K;}},bgcolor:function(L,K){L.style.backgroundColor=K;},textcolor:function(L,K){L.style.color=K;},htmlcss:function(L,K,M){if(x.hasStyleFilters&&M.type=="filter"){L.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+K+")";}else{L.style[M.type]=K+(M.needsPx?n:"");}},transformscale:function(L,K,M){L.style[M.type]=m+parseFloat(K)+j;},transformrotate:function(L,K,M){L.style[M.type]=E+parseFloat(K)+D;},transformvalscale:function(K){return m+parseFloat(K)+j;},transformvalrotate:function(K){return E+parseFloat(K)+D;}};var o="id",n="px",r="number",u="transformval",l="transform",w="scale",m="scale(",E="rotate(",j=")",D="deg)",I=["linear","ease-in","ease-out","ease","ease-in-out","cubic-bezier"],q={left:"left",right:"right",top:"top",bottom:"bottom",width:"width",height:"height",scrollTop:false,scrollLeft:false,mwidth:false,mheight:false,scrollwidth:false,scrollheight:false,fade:"opacity",opacity:"opacity",bgcolor:"background-color",textcolor:"color",transform:"transform"},J=Math.pow,F=Math.round,B={},z=null,d=function(K,M){var L=K.getAttribute(o);if(!L){x.setUniqueHtmlId(K);L=K.getAttribute(o);}if(!B[L]){B[L]=[];}B[L].push(M);if(B[L].length==1){M(0);}},C=function(L){var K=B[L.getAttribute(o)];if(!K){return;}K.shift();if(K.length){K[0](0);}},c=function(M,K){var L=B[M.getAttribute(o)];if(!L){return;}if(K&&z&&z.control){z.control.stop=true;}L.length=0;},i=function(L){var M=L.getAttribute(o);if(!M){x.setUniqueHtmlId(L);M=L.getAttribute(o);}for(var K in B){if(K==M){B[K]=[];}}},k=function(P,Q,M,L){var O=0,K=L-1,N=[Q];if(typeof P==r){if(!P){P=x.tween.linear;}else{if(P==1){P=x.tween.easeInCubic;}else{if(P==2){P=x.tween.easeOutCubic;}}}}for(O=0;O<K;++O){N.push(P(O/L,Q,M-Q));}N.push(M);return N;},g=function(Q,K,P,R){var L,M,S=x.color.colors,U=parseInt((S[K]||K).slice(1),16),T=parseInt((S[P]||P).slice(1),16),O=0,N=[];for(;O<R;O++){M=O/(R-1),L=1-M;N[N.length]="#"+("000000"+((F((U&255)*L+(T&255)*M)&255)|(F((U&65280)*L+(T&65280)*M)&65280)|(F((U&16711680)*L+(T&16711680)*M)&16711680)).toString(16)).slice(-6);}return N;},G=function(K,L){L=x.extend({steps:3,interval:20,anim:x.tween.linear,control:{}},L);if(K.nodeFunc>100){L.$int=K.$int;K=K.$ext;}try{if("fixed|absolute|relative".indexOf(x.getStyle(K,"position"))==-1){K.style.position="relative";}}catch(O){}var S=(x.supportCSSAnim&&x.supportCSSTransition&&q[L.type]),N=(L.type==l);L.method=S?L.type:N?H[l+(L.subType||w)]:H[L.type]||H.htmlcss;if(S){var P=q[L.type];if(P===false){return x.tween;}L.type=P||L.type;if(N){if(!L.subType){L.subType=w;}L.type=x.supportCSSAnim;}var M=(N)?H[u+(L.subType||w)]:null;K.style[L.type]=N?M(L.from):L.from+(t[L.type]?n:"");$setTimeout(function(){K.style[L.type]=N?M(L.to):L.to+(t[L.type]?n:"");K.offsetTop;K.style[x.cssPrefix+"Transition"]=L.type+" "+((L.steps*L.interval)/1000)+"s "+I[L.anim||0];var T=function(){if(L.onfinish){L.onfinish(K,L.userdata);}K.style[x.cssPrefix+"Transition"]="";K.removeEventListener(x.cssAnimEvent,T);};K.addEventListener(x.cssAnimEvent,T);});return x.tween;}var R=L.color?g(L.anim,L.from,L.to,L.steps):k(L.anim,parseFloat(L.from),parseFloat(L.to),L.steps),Q=function(T){z=L;if(L.control&&L.control.stop){L.control.stop=false;c(K);if(L.onstop){L.onstop(K,L.userdata);}return;}if(L.onbeforeeach&&L.onbeforeeach(K,L.userdata)===false){return;}try{L.method(K,R[T],L);}catch(U){}if(L.oneach){L.oneach(K,L.userdata);}if(T<L.steps){return $setTimeout(function(){Q(T+1);},L.interval);}z=null;if(L.control){L.control.stopped=true;}if(L.onfinish){L.onfinish(K,L.userdata);}C(K);};if(L.type.indexOf("scroll")>-1){i(K);}d(K,Q);return x.tween;},A=function(N,ad){ad=x.extend({steps:3,interval:20,anim:x.tween.linear,control:{}},ad);if(N.nodeFunc>100){ad.$int=N.$int;N=N.$ext;}var ac,Q,U=x.supportCSSAnim&&x.supportCSSTransition,S=false,K=((ad.steps*ad.interval)/1000),L=I[ad.anim||0],ab=[],W=[],aa=0,X=ad.tweens.length;for(;aa<X;aa++){var ae=ad.tweens[aa];if(ae.oHtml&&ae.oHtml.nodeFunc>100){ae.$int=ae.oHtml.$int;ae.oHtml=ae.oHtml.$ext;}ac=(U&&q[ae.type]);Q=(ae.type==l);if(Q){if(!ae.subType){ae.subType=w;}ae.type=x.supportCSSAnim;}ae.method=ac?ae.type:Q?H[l+(ae.subType)]:H[ae.type]||H.htmlcss;if(ac){var M=Q?ae.type:q[ae.type];ae.type=M||ae.type;var T=H[u+(ae.subType)];N.style[ae.type]=Q?T(ae.from):ae.from+(t[ae.type]?n:"");W.push([ae.type,Q?T(ae.to):ae.to+(t[ae.type]?n:"")]);ab.push(ae.type+" "+K+"s "+L+" 0");S=true;}else{ab.push(ae.color?g(ad.anim,ae.from,ae.to,ad.steps):k(ad.anim,parseFloat(ae.from),parseFloat(ae.to),ad.steps));}}if(S){N.style[x.cssPrefix+"Transition"]=ab.join(",");N.offsetTop;var P=0,O=function(){P++;if(P==W.length){if(ad.onfinish){ad.onfinish(N,ad.userdata);}N.style[x.cssPrefix+"Transition"]="";N.removeEventListener(x.cssAnimEvent,O);}};N.addEventListener(x.cssAnimEvent,O,false);for(var Y=0,Z=W.length;Y<Z;Y++){N.style[W[Y][0]]=W[Y][1];}return x.tween;}var V=ad.tweens,R=function(ag){z=ad;if(ad.control&&ad.control.stop){ad.control.stop=false;c(N);if(ad.onstop){ad.onstop(N,ad.userdata);}return;}try{for(var af=0;af<ab.length;af++){V[af].method(V[af].oHtml||N,ab[af][ag],V[af]);}}catch(ah){}if(ad.oneach){ad.oneach(N,ad.userdata);}if(ag<ad.steps){return $setTimeout(function(){R(ag+1);},ad.interval);}z=null;if(ad.control){ad.control.stopped=true;}if(ad.onfinish){ad.onfinish(N,ad.userdata);}C(N);};d(N,R);return x.tween;},s=function(O,L,aa,ab){(aa=aa||{}).tweens=[];if(O.nodeFunc>100){O=O.$ext;}if(ab){x.setStyleClass(O,"",[L]);}var W=function(ac,ae){if(ac){x.setStyleClass(O,"",[L]);}else{x.setStyleClass(O,L);}for(var ad=0;ad<aa.tweens.length;ad++){if(aa.tweens[ad].type=="filter"){continue;}O.style[aa.tweens[ad].type]="";}if(ae){ae.apply(this,arguments);}};var K=aa.onfinish,N=aa.onstop;aa.onfinish=function(){W(ab,K);};aa.onstop=function(){W(!ab,N);};var S,P,T,V,Z,Y,R,X,U={};for(X=0;X<document.styleSheets.length;X++){R=document.styleSheets[X][x.styleSheetRules];for(V=R.length-1;V>=0;V--){var Q=R[V];if(!Q.style||!Q.selectorText.match("."+L+"$")){continue;}for(Y in Q.style){if(!Q.style[Y]||b.indexOf("|"+Y+"|")==-1){continue;}if(Y=="filter"){if(!Q.style[Y].match(/opacity\=([\d\.]+)/)){continue;}P=RegExp.$1;S=(x.getStyleRecur(O,Y)||"").match(/opacity\=([\d\.]+)/);T=S?RegExp.$1:100;Z=false;if(P==T){if(ab){T=100;}else{P=100;}}}else{P=ab&&O.style[Y]||Q.style[Y];if(ab){O.style[Y]="";}T=x.getStyleRecur(O,Y);Z=Y.match(/color/i)?true:false;}U[Y]={type:Y,from:(Z?String:parseFloat)(ab?P:T),to:(Z?String:parseFloat)(ab?T:P),color:Z,needsPx:t[Y.toLowerCase()]||false};}}}for(var M in U){aa.tweens.push(U[M]);}if(ab){x.setStyleClass(O,L);}return A(O,aa);},a=function(L,K,M){s(L,K,M,true);},t={left:true,top:true,bottom:true,right:true,width:true,height:true,fontSize:true,lineHeight:true,textIndent:true},b="|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|transform|",y="|scale|rotate|";return{single:G,multi:A,css:s,cssRemove:a,clearQueue:c,addModule:function(K,L,M){if(typeof K!="string"||typeof L!="function"||(H[K]&&!M)){return this;}H[K]=L;return this;},NORMAL:0,EASEIN:1,EASEOUT:2,linear:function(L,M,K){return K*L+M;},easeInQuad:function(L,M,K){return K*J(L,2)+M;},easeOutQuad:function(L,M,K){return -K*L*(L-2)+M;},easeInOutQuad:function(L,M,K){if((L/=0.5)<1){return K/2*L*L+M;}return -K/2*((--L)*(L-2)-1)+M;},easeInCubic:function(L,M,K){return K*J(L,3)+M;},easeOutCubic:function(L,M,K){return K*(J(L-1,3)+1)+M;},easeInOutCubic:function(L,M,K){if((L/=0.5)<1){return K/2*J(L,3)+M;}return K/2*(J(L-2,3)+2)+M;},easeInQuart:function(L,M,K){return K*J(L,4)+M;},easeOutQuart:function(L,M,K){return -K*(J(L-1,4)-1)+M;},easeInOutQuart:function(L,M,K){if((L/=0.5)<1){return K/2*J(L,4)+M;}return -K/2*(J(L-2,4)-2)+M;},easeInQuint:function(L,M,K){return K*J(L,5)+M;},easeOutQuint:function(L,M,K){return K*(J(L-1,5)+1)+M;},easeInOutQuint:function(L,M,K){if((L/=0.5)<1){return K/2*J(L,5)+M;}return K/2*(J(L-2,5)+2)+M;},easeInSine:function(L,M,K){return -K*Math.cos(L*(Math.PI/2))+K+M;},easeOutSine:function(L,M,K){return K*Math.sin(L*(Math.PI/2))+M;},easeInOutSine:function(L,M,K){return -K/2*(Math.cos(Math.PI*L)-1)+M;},easeInExpo:function(L,M,K){return(L==0)?M:K*J(2,10*(L-1))+M;},easeOutExpo:function(L,M,K){return(L==1)?M+K:K*(-J(2,-10*L)+1)+M;},easeInOutExpo:function(L,M,K){if(L==0){return M;}if(L==1){return M+K;}if((L/=0.5)<1){return K/2*J(2,10*(L-1))+M;}return K/2*(-J(2,-10*--L)+2)+M;},easeInCirc:function(L,M,K){return -K*(Math.sqrt(1-L*L)-1)+M;},easeOutCirc:function(L,M,K){return K*Math.sqrt(1-(L-=1)*L)+M;},easeInOutCirc:function(L,M,K){if((L/=0.5)<1){return -K/2*(Math.sqrt(1-L*L)-1)+M;}return K/2*(Math.sqrt(1-(L-=2)*L)+1)+M;},easeInElastic:function(M,P,L){var N=1.70158,O=0.3,K=L;if(M==0){return P;}if(M==1){return P+L;}if(!K||K<Math.abs(L)){K=L;N=O/4;}else{N=O/(2*Math.PI)*Math.asin(L/K);}return -(K*J(2,10*(M-=1))*Math.sin((M*1-N)*(2*Math.PI)/O))+P;},easeOutElastic:function(M,P,L){var N=1.70158,O=0.3,K=L;if(M==0){return P;}if(M==1){return P+L;}if(K<Math.abs(L)){K=L;N=O/4;}else{N=O/(2*Math.PI)*Math.asin(L/K);}return K*J(2,-10*M)*Math.sin((M-N)*(2*Math.PI)/O)+L+P;},easeInOutElastic:function(M,P,L){var N=1.70158,O=0,K=L;if(M==0){return P;}if((M/2)==2){return P+L;}if(!O){O=0.3*1.5;}if(K<Math.abs(L)){K=L;N=O/4;}else{N=O/(2*Math.PI)*Math.asin(L/K);}if(M<1){return -0.5*(K*J(2,10*(M-=1))*Math.sin((M-N)*(2*Math.PI)/O))+P;}return K*J(2,-10*(M-=1))*Math.sin((M-N)*(2*Math.PI)/O)*0.5+L+P;},easeInBack:function(L,N,K){var M=1.70158;return K*J(L,2)*((M+1)*L-M)+N;},easeOutBack:function(L,N,K){var M=1.70158;return K*((L-=1)*L*((M+1)*L+M)+1)+N;},easeInOutBack:function(L,N,K){var M=1.70158;if((L/2)<1){return K/2*(L*L*(((M*=(1.525))+1)*L-M))+N;}return K/2*((L-=2)*L*(((M*=(1.525))+1)*L+M)+2)+N;},easeInBounce:function(L,M,K){return K-x.tween.easeOutBounce(1-L,0,K)+M;},easeOutBounce:function(L,M,K){if(L<(1/2.75)){return K*(7.5625*L*L)+M;}else{if(L<(2/2.75)){return K*(7.5625*(L-=(1.5/2.75))*L+0.75)+M;}else{if(L<(2.5/2.75)){return K*(7.5625*(L-=(2.25/2.75))*L+0.9375)+M;}else{return K*(7.5625*(L-=(2.625/2.75))*L+0.984375)+M;}}}},easeInOutBounce:function(L,M,K){if(L<1/2){return x.tween.easeInBounce(L*2,0,K)*0.5+M;}return x.tween.easeOutBounce(L*2-1,0,K)*0.5+K*0.5+M;}};})(apf);apf.resize=function(){this.scales={scalex:false,scaley:false,scaleratio:false,dwidth:0,dheight:0,snap:false,gridW:48,gridH:48};this.htmlElement;var a=[];this.init=function(){a=[new apf.resize.square("top","left",this),new apf.resize.square("top","middle",this),new apf.resize.square("top","right",this),new apf.resize.square("middle","left",this),new apf.resize.square("middle","right",this),new apf.resize.square("bottom","left",this),new apf.resize.square("bottom","middle",this),new apf.resize.square("bottom","right",this)];};this.grab=function(b,c){this.htmlElement=b;this.scales=c;if(!a.length){this.init();}this.show();};this.hide=function(){for(var c=0,b=a.length;c<b;c++){a[c].visible=false;a[c].repaint();}};this.show=function(){var k=this.scales.scalex;var j=this.scales.scaley;var g=this.scales.scaleratio;for(var c=0,b=a.length,d;c<b;c++){d=a[c];d.visible=k&&j?true:(j&&!k?(d.posX=="middle"?true:false):(k&&!j?(d.posY=="middle"?true:false):(g?((d.posY=="top"||d.posY=="bottom")&&d.posX!=="middle"?true:false):false)));d.repaint();}};this.destroy=function(){for(var b=0;b<a.length;b++){a[b].destroy();}};};apf.resize.square=function(d,g,b){this.visible=true;this.posX=g;this.posY=d;var c=0;var a=this;this.htmlElement=b.htmlElement.parentNode.appendChild(document.createElement("div"));apf.setStyleClass(this.htmlElement,"square");this.repaint=function(){if(this.visible){var k=b.htmlElement;this.htmlElement.style.display="block";var q=parseInt(k.style.width)+apf.getDiff(k)[0];var m=parseInt(k.style.height)+apf.getDiff(k)[1];var s=parseInt(k.style.top);var i=parseInt(k.style.left);var r=this.htmlElement.offsetWidth;var n=this.htmlElement.offsetHeight;var u=d=="top"?s-c-n:d=="middle"?s+m/2-n/2:s+m+c;var j=g=="left"?i-c-r:g=="middle"?i+q/2-r/2:i+q+c;var o=(d=="middle"?"w-resize":(g=="middle"?"n-resize":(d+g=="topleft"||d+g=="bottomright")?"nw-resize":"ne-resize"));this.htmlElement.style.top=(u-1)+"px";this.htmlElement.style.left=(j-1)+"px";this.htmlElement.style.cursor=o;}else{var r=this.htmlElement.offsetWidth;this.htmlElement.style.display="none";}};this.destroy=function(){apf.destroyHtmlNode(this.htmlElement);};this.htmlElement.onmouseover=function(i){apf.setStyleClass(a.htmlElement,"squareHover");};this.htmlElement.onmouseout=function(i){apf.setStyleClass(a.htmlElement,"",["squareHover"]);};this.htmlElement.onmousedown=function(P){P=(P||event);var o=b.htmlElement,E=P.clientX,B=P.clientY,G=o.parentNode.offsetTop,O=o.parentNode.offsetLeft,x=b.scales.dwidth,N=b.scales.dheight,F=b.scales.snap,i=b.scales.gridH,L=b.scales.gridW,J=apf.flow.isBlock(o),C=J.other.ratio,n=a.posX,m=a.posY,H,D,A,k,u,s,j,z,I=parseInt(o.style.left),y=parseInt(o.style.top),q=parseInt(o.style.width),K=parseInt(o.style.height),M=false;b.onresizedone(q,K,y,I);if(P.preventDefault){P.preventDefault();}document.onmousemove=function(t){t=(t||event);u=t.clientX-E;s=t.clientY-B;var l=t.shiftKey,r=C;if(l){if(n=="right"&&m=="bottom"){H=q+u;D=H/r;k=I;A=y;}else{if(n=="right"&&m=="top"){H=q+u;D=H/r;k=I;A=y-u/r;}else{if(n=="left"&&m=="bottom"){H=q-u;D=H/r;k=I+u;A=y;}else{if(n=="left"&&m=="top"){H=q-u;D=H/r;k=I+u;A=y+u/r;}}}}if(H>=x&&D>=N){H=j=Math.max(x,H);D=z=Math.max(N,D);}else{H=j;D=z;return false;}}else{H=n=="right"?q+u:(n=="left"?q-u:q);D=m=="bottom"?K+s:(m=="top"?K-s:K);k=n=="right"?I:(n=="left"?Math.min(I+q-x,I+u):I);A=m=="bottom"?y:(m=="top"?Math.min(y+K-N,y+s):y);H=Math.max(x,H);D=Math.max(N,D);}if(F){k=Math.floor(k/L)*L;A=Math.floor(A/i)*i;H=Math.ceil(H/L)*L;D=Math.ceil(D/i)*i;}if(b.onresize){b.onresize(o,A,k,H,D);}b.show();M=true;};document.onmouseup=function(l){document.onmousemove=null;if(b.onresizedone&&M){b.onresizedone(H,D,A,k);J.other.ratio=H/D;M=false;}};};};apf.layout={layouts:{},addParent:function(b,a){var c;if(!(c=b.getAttribute("id"))){c=apf.setUniqueHtmlId(b);}return this.layouts[c]={layout:new apf.layoutParser(b,a),controls:[]};},get:function(c,a){var b=this.layouts[c.getAttribute("id")];if(!b){b=this.addParent(c,a);}return b;},isLoadedXml:function(g){var a=g.childNodes;var i=g.selectSingleNode(".//node[@name]");var d=i?self[i.getAttribute("name")]:null;var c=d.$ext.parentNode;var b=this.getHtmlId(c);return(this.loadedXml[b]==g);},$loadFrom:function(a){apf.getData(a,{callback:function(b){if(!b){return;}apf.layout.loadXml(b);}});},loadedXml:{},cacheXml:{},loadXml:function(j){var a=j.childNodes;var l=j.selectSingleNode(".//node[@name]");var g=l?self[l.getAttribute("name")]:null;var d=g.$ext.parentNode;var k=this.get(d,apf.getBox(j.getAttribute("margin")||""));var c=this.getHtmlId(d);this.metadata=[];for(var b=0;b<a.length;b++){if(a[b].nodeType!=1){continue;}k.root=this.parseXml(a[b],k);break;}this.compile(d);if(apf.window.inited){this.activateRules(d);}this.loadedXml[c]=j;},metadata:[],getData:function(a,b){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:b.parentNode,size:[300,200],position:[0,0],last:{},copy:function(){var d=apf.extend({},this);if(!this.node){d.children=[];for(var c=0;c<this.children.length;c++){d.children[c]=this.children[c].copy();d.children[c].parent=d;}}return d;},setPosition:function(c,d){this.oHtml.style.left=c+"px";this.oHtml.style.top=d+"px";this.position=[c,d];},setFloat:function(){var d=apf.getDiff(this.oHtml);this.oHtml.style.width=(this.size[0]-d[0])+"px";if(this.state<0){this.oHtml.style.height=(this.size[1]-d[1])+"px";}this.prehide();this.hidden=3;if(this.hid){var c=apf.lookup(this.hid);if(c.syncAlignment){c.syncAlignment(this);}}},unfloat:function(){if(this.hidden!=3){return;}this.show();},state:-1,minimize:function(c){if(this.state<0){this.lastfheight=this.fheight;this.fheight=""+c;this.lastsplitter=this.splitter;if(this.parent.vbox){this.splitter=-1;}this.state=1;}},restore:function(){if(this.state>0){this.fheight=this.lastfheight;this.splitter=this.lastsplitter;this.state=-1;}},hidden:false,hiddenChildren:[],prehide:function(j){if(this.hidden==3){this.hidden=true;if(this.hid){apf.lookup(this.hid).visible=false;}if(this.oHtml){this.oHtml.style.display="none";}return;}if(this.hidden&&!j){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 g,o,n=0,k,d,m=["children","hiddenChildren"];while(m.length){g=this.parent[m.pop()];for(k=0,d=g.length;k<d;k++){o=g[k];if(o!=this&&!o.hidden){n=1;break;}}}if(!n){this.parent.prehide(j);}if(j){return this.hide(true);}if(apf.layout.dlist.contains(this)){apf.layout.dlist.remove(this);return false;}else{apf.layout.dlist.pushUnique(this);}},preshow:function(c){if(!this.hidden){return;}this.hidden=false;if(c){return this.show(true);}if(this.parent.hidden){this.parent.preshow();}if(apf.layout.dlist.contains(this)){apf.layout.dlist.remove(this);return false;}else{apf.layout.dlist.pushUnique(this);}},hide:function(d){var c=this.parent.children;c.removeIndex(this.stackId);for(var g=0;g<c.length;g++){c[g].stackId=g;}this.parent.hiddenChildren.push(this);if(d){return;}if(this.hidden!=3){if(this.hid){apf.lookup(this.hid).visible=false;}if(this.oHtml){this.oHtml.style.display="none";}}},show:function(d){var c=this.parent.children;if(this.hidepos.prev&&this.hidepos.prev.parent==this.parent&&!this.hidepos.prev.hidden&&!apf.layout.dlist.contains(this.hidepos.prev)){if(c.length<this.hidepos.prev.stackId+1){c.push(this);}else{c.insertIndex(this,this.hidepos.prev.stackId+1);}}else{if(this.hidepos.next&&this.hidepos.next.parent==this.parent&&!this.hidepos.next.hidden&&!apf.layout.dlist.contains(this.hidepos.next)){if(this.hidepos.next.stackId==0){c.unshift(this);}else{if(c.length<this.hidepos.next.stackId-1){c.push(this);}else{c.insertIndex(this,this.hidepos.next.stackId-1);}}}else{if(!this.hidepos.prev){c.unshift(this);}else{if(!this.hidepos.next){c.push(this);}else{if(this.stackId<c.length){c.insertIndex(this,this.stackId);}else{c.push(this);}}}}}for(var g=0;g<c.length;g++){if(c[g]){c[g].stackId=g;}}this.parent.hiddenChildren.remove(this);if(!d){if(this.hidden!=3){if(this.hid){apf.lookup(this.hid).visible=true;}if(this.oHtml){this.oHtml.style.display="block";}}}this.hidden=false;this.hidepos=null;},remove:function(){var g=this.parent;if(!g){return;}if(this.hidden||g.hiddenChildren.contains(this)){g.hiddenChildren.remove(this);apf.layout.dlist.remove(this);}else{var c=g.children;c.remove(this);for(var d=0;d<c.length;d++){c[d].stackId=d;}}for(var j in this.last){if(j=="splitter"){if(g.originalMargin){if(g.parent.pOriginalMargin){g.parent.splitter=null;g.parent.edgeMargin=g.parent.pOriginalMargin[0];g.parent.pOriginalMargin=null;delete g.last.splitter;}g.splitter=null;g.edgeMargin=g.originalMargin[0];g.originalMargin=null;}}this[j]=g[j]||this.last[j];}this.last={};if(!g.children.length&&!g.hiddenChildren.length){g.remove();}this.parent=null;},add:function(g){this.parent=g;if(this.hidden){var c=g.hiddenChildren;c.push(this);}else{var c=g.children;c.push(this);for(var d=0;d<c.length;d++){if(c[d]){c[d].stackId=d;}}}}};},parseXml:function(x,layout,amlNode,norecur){var aData=this.getData(typeof amlNode=="string"?amlNode:x.localName||x[apf.TAGNAME],layout.layout);if(aData.node){if(!amlNode){amlNode=self[x.getAttribute("name")];}aData.oHtml=amlNode.$ext;amlNode.aData=aData;amlNode.$setLayout("alignment");var aml=amlNode;if(aml.getAttribute("width")){aData.fwidth=aml.getAttribute("width");}if(aml.getAttribute("height")){aData.fheight=aml.getAttribute("height");}if(!this.getHtmlId(aData.oHtml)){apf.setUniqueHtmlId(aData.oHtml);}aData.id=this.getHtmlId(aData.oHtml);if(aData.oHtml.style){aData.oHtml.style.position="absolute";}aData.hid=amlNode.$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"?4:false);}if(x.getAttribute("width")){aData.fwidth=String(apf.parseExpression(x.getAttribute("width")));}if(x.getAttribute("height")){aData.fheight=String(apf.parseExpression(x.getAttribute("height")));}if(x.getAttribute("lastsplitter")){aData.lastsplitter=x.getAttribute("lastsplitter");}if(x.getAttribute("hidden")){aData.hidden=(x.getAttribute("hidden")==3)?x.getAttribute("hidden"):apf.isTrue(x.getAttribute("hidden"));}else{if(x.getAttribute("visible")=="false"){aData.hidden=true;}}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);if(aData.node&&amlNode.syncAlignment){amlNode.syncAlignment(aData);}if(!norecur&&!aData.node){var nodes=x.childNodes;for(var last,a,i=0;i<nodes.length;i++){if(nodes[i].nodeType!=1){continue;}a=this.parseXml(nodes[i],layout);if(last&&last.hidden){last.hidepos.next=a;}if(a.hidden){if(a.hid){var j=apf.lookup(a.hid);if(a.hidden===true&&j.visible){j.visible=false;a.oHtml.style.display="none";}if(a.hidden==3){var diff=apf.getDiff(a.oHtml);a.oHtml.style.left=a.position[0]+"px";a.oHtml.style.top=a.position[1]+"px";a.oHtml.style.width=(a.size[0]-diff[0])+"px";a.oHtml.style.height=((!this.state||this.state<0?a.size[1]:a.fheight)-diff[1])+"px";}}aData.hiddenChildren.push(a);a.hidepos={prev:aData.children[aData.children.length-1]};}else{if(a.hid){var j=apf.lookup(a.hid);if(!j.visible){j.visible=true;a.oHtml.style.display="block";}}a.stackId=aData.children.push(a)-1;}a.parent=aData;last=a;}}aData.xml=x;return aData;},getXml:function(c){var a=apf.layout.get(c);var b=a.root.xml?a.root.xml.ownerDocument.createElement("layout"):apf.xmldb.getXml("<layout />");apf.layout.parseToXml(a.root,b);return b;},saveXml:function(){for(var g in this.loadedXml){var d=this.loadedXml[g];var b=this.layouts[g];var a=b.root;for(var c=d.childNodes.length-1;c>=0;c--){d.removeChild(d.childNodes[c]);}this.parseToXml(a,d);}},parseToXml:function(k,a){var g=k.xml?k.xml.cloneNode(false):a.ownerDocument.createElement(k.vbox?"vbox":(k.hbox?"hbox":"node"));a.appendChild(g);if(k.template){g.setAttribute("align",k.template);}if(k.edgeMargin){g.setAttribute("edge",k.edgeMargin);}if(k.weight){g.setAttribute("weight",k.weight);}if(k.splitter){g.setAttribute("splitter",k.splitter===false?-1:k.splitter);}if(k.fwidth){g.setAttribute("width",k.fwidth);}if(k.fheight){g.setAttribute("height",k.fheight);}if(k.minwidth){g.setAttribute("minwidth",k.minwidth);}if(k.minheight){g.setAttribute("minheight",k.minheight);}if(k.lastfheight){g.setAttribute("lastheight",k.lastfheight);}if(k.lastsplitter){g.setAttribute("lastsplitter",k.lastsplitter);}if(k.hidden){g.setAttribute("hidden",(k.hidden==3)?"3":"true");}else{if(g.getAttribute("hidden")){g.removeAttribute("hidden");}}if(k.stackId){g.setAttribute("stack",k.stackId);}if(k.state>0){g.setAttribute("state",k.state);}else{if(g.getAttribute("state")){g.removeAttribute("state");}}if(k.position){g.setAttribute("position",k.position.join(","));}if(k.size){g.setAttribute("size",k.size.join(","));}var j=k.children.copy();for(var d=0;d<k.hiddenChildren.length;d++){var c=k.hiddenChildren[d].hidepos;if(c.prev){var b=j.indexOf(c.prev);if(b<0){j.unshift(k.hiddenChildren[d]);}else{j.insertIndex(k.hiddenChildren[d],b);}}else{if(c.next){var b=j.indexOf(c.next);if(b-1<0){j.unshift(k.hiddenChildren[d]);}else{j.insertIndex(k.hiddenChildren[d],b-1);}}else{j.push(k.hiddenChildren[d]);}}}for(var d=0;d<j.length;d++){this.parseToXml(j[d],g);}},checkInheritance:function(c){for(var b=0;b<c.children.length;b++){if(!c.children[b].node){this.checkInheritance(c.children[b]);}}var d=c.children[0];if(d&&c.parent){if(c.vbox){if(!c.fwidth&&d.fwidth||d.last.fwidth&&d.fwidth!==null&&d.last.fwidth==c.fwidth){d.last.fwidth=c.fwidth=d.fwidth;d.fwidth=null;}var a=c.parent;if((a&&!a.fheight&&d.fheight||d.last.fheight&&d.fheight!==null&&d.last.fheight==a.fheight)&&c.children.length==1){d.last.fheight=a.fheight=d.fheight;d.fheight=null;}}else{if((!c.fheight&&d.fheight||d.last.fheight&&d.fheight!==null&&d.last.fheight==c.fheight)&&c.children.length==1){d.last.fheight=c.fheight=d.fheight;d.fheight=null;}}if(d.weight||d.last.weight&&d.last.weight==c.weight){d.last.weight=c.weight=d.weight;}}},compileAlignment:function(b){if(!b.children.length){this.removeRule(b.pHtml,"layout");var a=this.layouts[b.pHtml.getAttribute("id")];return;}var g=b.children;for(var d=false,c=0;c<g.length;c++){if(g[c].template=="bottom"){if(g[c].splitter){g[c-1].splitter=g[c].splitter;g[c].splitter=null;}g[c-1].edgeMargin=Math.max(g[c].edgeMargin,g[c-1].edgeMargin||0,g[c-1].splitter||0);g[c].edgeMargin=null;}if(g[c].hidden){g[c].prehide(true);}}var a=this.layouts[b.pHtml.getAttribute("id")];a.layout.compile(b.copy());a.layout.reset();},addAlignNode:function(j,b){var u=(typeof j.align=="undefined"?j.getAttribute("align"):j.align).split("-");var y=b.children;var w=j.aData;if(typeof j.splitter=="undefined"){if(u[1]=="splitter"){w.splitter=u[2]||4;}else{w.splitter=false;}}w.edgeMargin=Math.max(w.edgeMargin,w.splitter||0);u=u[0];w.template=u;if(u=="top"){for(var c=y.length,o=0;o<y.length;o++){if(y[o].template!="top"){c=o;break;}}for(var o=y.length-1;o>=c;o--){y[o+1]=y[o];y[o].stackId=o+1;}y[c]=w;y[c].stackId=c;w.parent=b;}else{if(u=="bottom"){w.stackId=y.push(w)-1;w.parent=b;}else{var m=null;for(var c=-1,o=0;o<y.length;o++){if(y[o].hbox){m=y[o];break;}else{if(y[o].node&&y[o].template=="top"){c=o;}}}if(!m){var k=apf.layout.get(b.pHtml);m=apf.layout.parseXml(apf.xmldb.getXml("<hbox />"),k,null,true);m.parent=b;if(c>-1){for(var o=y.length-1;o>c;o--){y[o+1]=y[o];y[o].stackId++;}y[c+1]=m;m.stackId=c+1;}else{m.stackId=y.unshift(m)-1;}}var g,d=m.children.concat(m.hiddenChildren);for(var o=0;o<d.length;o++){if(d[o].template==u){g=d[o];break;}}d=m.children;if(!g){var k=apf.layout.get(b.pHtml);g=apf.layout.parseXml(apf.xmldb.getXml("<vbox />"),k,null,true);g.parent=m;g.template=u;if(u=="left"){if(!w.fwidth){var r;for(var x=false,o=0;o<d.length;o++){if(d[o].template=="middle"){x=d[o];break;}}if(x&&!x.children.length){d.remove(x);for(var o=0;o<d.length;o++){d[o].stackId=o;}}}d.unshift(g);for(var o=0;o<d.length;o++){d[o].stackId=o;}}else{if(u=="right"){if(w.fwidth){var r;for(var x=false,o=0;o<d.length;o++){if(d[o].template=="middle"||d[o].template=="left"&&!d[o].fwidth){x=true;break;}}if(!x){r=apf.layout.parseXml(apf.xmldb.getXml("<vbox />"),k,null,true);r.parent=m;r.template="middle";r.stackId=d.push(r)-1;}}g.stackId=d.push(g)-1;}else{if(u=="middle"){for(var t,o=0;o<d.length;o++){if(d[o].template=="right"){t=o;}}var q=d[t];if(q){d[t]=g;g.stackId=t;q.stackId=d.push(q)-1;}else{g.stackId=d.push(g)-1;}}}}}w.stackId=g.children.push(w)-1;w.parent=g;if(g.hidden){g.preshow(true);}}}},compile:function(c){var b=this.layouts[c.getAttribute("id")];if(!b){return false;}var a=b.root.copy();b.layout.compile(a);b.layout.reset();},removeAll:function(b){b.children.length=null;this.compileAlignment(b);var a=this.getHtmlId(b.pHtml);if(!this.rules[a]){delete this.qlist[a];}},timer:null,qlist:{},dlist:[],$hasQueue:false,queue:function(b,c,a){this.$hasQueue=true;var d;if(!(d=this.getHtmlId(b))){d=apf.setUniqueHtmlId(b);}if(this.qlist[d]){if(c){this.qlist[d][2].push(c);}if(a){this.qlist[d][1]=a;}return;}this.qlist[d]=[b,a,[c]];if(!this.timer){this.timer=$setTimeout("apf.layout.processQueue()");}},processQueue:function(){clearTimeout(this.timer);this.timer=null;this.$hasQueue=false;var b,g,a,d,c;for(b=0;b<this.dlist.length;b++){if(this.dlist[b].hidden){this.dlist[b].hide();}else{this.dlist[b].show();}}for(g in this.qlist){d=this.qlist[g];if(d[1]){apf.layout.compileAlignment(d[1]);}c=d[2];for(b=0,a=c.length;b<a;b++){if(c[b]){c[b].$updateLayout();}}apf.layout.activateRules(d[0]);}if(apf.hasSingleRszEvent){apf.layout.forceResize();}this.qlist={};this.dlist=[];},rules:{},onresize:{},getHtmlId:function(a){return a.getAttribute?a.getAttribute("id"):1;},setRules:function(c,g,d,b){if(!this.getHtmlId(c)){apf.setUniqueHtmlId(c);}if(!this.rules[this.getHtmlId(c)]){this.rules[this.getHtmlId(c)]={};}var a=this.rules[this.getHtmlId(c)][g];if(!b&&a){this.rules[this.getHtmlId(c)][g]=d+"\n"+a;}else{this.rules[this.getHtmlId(c)][g]=d;}},getRules:function(a,b){return b?this.rules[this.getHtmlId(a)][b]:this.rules[this.getHtmlId(a)];},removeRule:function(d,j){var b=this.getHtmlId(d);if(!this.rules[b]){return;}var c=this.rules[b][j]||false;delete this.rules[b][j];var i;for(i in this.rules[b]){}if(!i){delete this.rules[b];}if(apf.hasSingleRszEvent){if(this.onresize[b]){this.onresize[b]=null;}else{var g=d.parentNode;while(g&&g.nodeType==1&&!this.onresize[g.getAttribute("id")]){g=g.parentNode;}if(g&&g.nodeType==1){var a=this.onresize[g.getAttribute("id")];if(a.children){delete a.children[b];}}}}return c;},activateRules:function(g,l){if(!g){var a,i;for(a in this.rules){i=document.getElementById(a);if(!i||i.onresize){continue;}this.activateRules(i);}if(apf.hasSingleRszEvent&&window.onresize){window.onresize();}return;}var j,d,m,q,o=[];if(!apf.hasSingleRszEvent){q=this.rules[this.getHtmlId(g)];if(!q){g.onresize=null;return false;}for(d in q){if(typeof q[d]!="string"){continue;}o.push(q[d]);}j=apf.needsCssPx?new Function(o.join("\n")):new Function(o.join("\n").replace(/ \+ 'px'|try\{\}catch\(e\)\{\}\n/g,""));g.onresize=j;if(!l){j();}}else{var c=this.getHtmlId(g);q=this.rules[c];if(!q){return false;}for(d in q){if(typeof q[d]!="string"){continue;}o.push(q[d]);}var b=g.parentNode;while(b&&b.nodeType==1&&!this.onresize[b.getAttribute("id")]){b=b.parentNode;}var k=new Function(o.join("\n"));if(this.onresize[c]){k.children=this.onresize[c].children;}if(b&&b.nodeType==1){var n=this.onresize[b.getAttribute("id")];(n.children||(n.children={}))[c]=k;}else{this.onresize[c]=k;}if(!l){k();}if(!window.onresize){var j=function(t){try{var w=[];for(var r in t){w.unshift(t[r]);}for(var s=0;s<w.length;s++){w[s]();if(w[s].children){j(w[s].children);}}}catch(u){}};window.onresize=function(){j(apf.layout.onresize);};}}},forceResize:function(g){if(apf.hasSingleRszEvent){return window.onresize&&window.onresize();}var b=g.onresize;if(b){b();}var d=g.getElementsByTagName("*");for(var c=0,a=d.length;c<a;c++){if(d[c].onresize){d[c].onresize();}}},paused:{},pause:function(b,c){if(apf.hasSingleRszEvent){var a=this.getHtmlId(b);this.paused[a]=this.onresize[a]||true;if(c){this.onresize[a]=c;this.onresize[a].children=this.paused[a].children;c();}else{delete this.onresize[a];}}else{this.paused[this.getHtmlId(b)]=b.onresize||true;if(c){b.onresize=c;c();}else{b.onresize=null;}}},play:function(b){if(!this.paused[this.getHtmlId(b)]){return;}if(apf.hasSingleRszEvent){var a=this.getHtmlId(b);var c=this.paused[a];if(typeof c=="function"){this.onresize[a]=c;}else{delete this.onresize[a];}if(window.onresize){window.onresize();}this.paused[this.getHtmlId(b)]=null;}else{var c=this.paused[this.getHtmlId(b)];if(typeof c=="function"){b.onresize=c;c();}else{b.onresize=null;}this.paused[this.getHtmlId(b)]=null;}}};apf.layout.load=apf.layout.loadXml;apf.getWindowWidth=function(){return apf.isIE?document.documentElement.offsetWidth-(apf.isIE8?4:0):window.innerWidth;};apf.getWindowHeight=function(){return apf.isIE?document.documentElement.offsetHeight-(apf.isIE8?4:0):window.innerHeight;};apf.layoutParser=function(a,c){c=(c&&c.length==4)?c:[0,0,0,0];this.pMargin=c;this.RULES=[];this.parentNode=a;if(!this.parentNode.getAttribute("id")){apf.setUniqueHtmlId(this.parentNode);}var i={};var d=0;var g=0;this.createSplitters=true;this.setMargin=function(j){c=j;};this.reset=function(){this.RULES=[];i={};this.lastType=this.globalEdge=this.globalSplitter=null;};this.compile=function(j,k){this.addRule("var v = apf.layout.vars");this.globalSplitter=j.splitter;this.globalEdge=j.edgeMargin;if(this.globalSplitter||this.globalEdge){this.setglobals(j);}this.preparse(j);this.parserules(j);this.RULES=new b().calc(this.RULES);var l=("try{"+this.RULES.join("}catch(e){}\ntry{")+"}catch(e){}\n").replace(/([^=]+\.style[^=]+) = (.*?)\}/g,"$1 = ($2) + 'px'}");if(!apf.hasHtmlIdsInJs){l=l.replace(/q([\w|]+)\.(offset|style)/g,'document.getElementById("q$1").$2');}this.lastRoot=j;if(!k){apf.layout.setRules(this.parentNode,"layout",l,true);apf.layout.queue(this.parentNode);}else{return l;}return false;};this.addRule=function(j){this.RULES.push(j);};this.setglobals=function(k,l){if(!l&&this.globalEdge&&!k.edgeMargin&&(!k.xml||!k.xml.getAttribute("edge"))){if(!k.splitter){k.splitter=this.globalSplitter;}k.edgeMargin=Math.max(this.globalSplitter,this.globalEdge);}if(k.node){return;}for(var j=0;j<k.children.length;j++){this.setglobals(k.children[j],j==k.children.length-1);}};this.preparse=function(k){if(k.node){return;}else{var t=k.vbox?"height":"width";var m=0;var s=0;var z=0;k.childweight=0;k.childminwidth=0;k.childminheight=0;var y=["v."+t+"_"+k.id],l=[];var j=k.children;for(var o=0;o<j.length;o++){if(o<j.length-1){y.push(" - "+j[o].edgeMargin);}var r=j[o]["f"+t];if(r){l.push((r.indexOf("%")>-1)?" - ("+(j[o]["calc"+t]="v.innerspace_"+k.id+" * "+parseFloat(r)/100)+")":" - ("+r+")");}else{k.childweight+=j[o].weight;j[o]["calc"+t]="Math."+(o%2==0?"ceil":"floor")+"(v.restspace_"+k.id+" * ("+j[o].weight+"/v.weight_"+k.id+"))";}var q=(k.vbox?"width":"height");var w=j[o]["f"+q];if(!w){j[o]["calc"+q]=(k.vbox?"v.width_":"v.height_")+k.id;}else{j[o]["calc"+q]=w.indexOf("%")>-1?"v.innerspace_"+k.id+" * "+parseFloat(w)/100:w;}if(j[o].node&&j[o].xml.visible!==false){j[o].oHtml.style.display="block";}else{this.preparse(j[o]);}if(k.vbox){k.childminheight+=Math.max(j[o].childminheight||0,j[o].minheight||0,10)+j[o].edgeMargin;k.childminwidth=Math.max(k.childminwidth,j[o].minwidth||j[o].childminwidth||10);}else{k.childminwidth+=Math.max(j[o].minwidth||0,j[o].childminwidth||0,10)+j[o].edgeMargin;k.childminheight=Math.max(k.childminheight,j[o].minheight||j[o].childminheight||10);}}k.innerspace=y.join("");k.restspace=k.innerspace+" "+l.join("");if(!k.parent){var n=0,B=0;if(this.parentNode.tagName.toLowerCase()!="body"){var u=apf.getDiff(this.parentNode);B=u[0];n=u[1];}var A=(this.parentNode.tagName.toLowerCase()=="body"?"apf.getWindowWidth()":"document.getElementById('"+this.parentNode.id+"').offsetWidth");var x=(this.parentNode.tagName.toLowerCase()=="body"?"apf.getWindowHeight()":"document.getElementById('"+this.parentNode.id+"').offsetHeight");k.calcwidth="Math.max("+d+", "+A+" - "+(c[1])+" - "+c[3]+" - "+n+")";k.calcheight="Math.max("+g+", "+x+" - "+(c[2])+" - "+c[0]+" - "+B+")";}}};this.parserules=function(o){if(!o.node){this.addRule("v.width_"+o.id+" = Math.max("+o.childminwidth+","+o.minwidth+","+(o.calcwidth||o.fwidth)+")");this.addRule("v.height_"+o.id+" = Math.max("+o.childminheight+","+o.minheight+","+(o.calcheight||o.fheight)+")");this.addRule("v.weight_"+o.id+" = "+o.childweight);this.addRule("v.innerspace_"+o.id+" = "+o.innerspace);this.addRule("v.restspace_"+o.id+" = "+o.restspace);var k=apf.layout.metadata[o.id];k.calcData=o;o.original=k;if(!o.parent){this.addRule("v.left_"+o.id+" = "+c[3]);this.addRule("v.top_"+o.id+" = "+c[0]);for(var m=0;m<o.children.length;m++){this.parserules(o.children[m]);}return;}else{var s=["v.top_"+o.id," = "];var u=["v.left_"+o.id," = "];}}else{var s=[o.id,".style.top = "];var u=[o.id,".style.left = "];if(o.hid){var k=apf.lookup(o.hid).aData;k.calcData=o;o.original=k;}var n=o.oHtml;var r=apf.getDiff(n);var t=r[1];var l=r[0];if(o.calcwidth){this.addRule(o.id+".style.width = -"+l+" + Math.max( "+o.calcwidth+", "+o.minwidth+")");}else{n.style.width=Math.max(0,o.fwidth-l)+"px";}if(o.calcheight){this.addRule(o.id+".style.height = -"+t+" + Math.max( "+o.calcheight+", "+o.minheight+")");}else{n.style.height=Math.max(0,o.fheight-t)+"px";}}var j=o.parent.children[o.stackId-1];var q=o.parent.children[o.stackId+1];if(o.parent.vbox){if(o.parent.isBottom){if(!q){s.push("v.top_",o.parent.id," + v.height_",o.parent.id," - ",o.id,".offsetHeight");}else{if(q.node){s.push(q.id,".offsetTop - ",q.edgeMargin," - ",o.id,".offsetHeight");}else{s.push("v.top_"+q.id," - ",q.edgeMargin," - ",(o.node?o.id+".offsetHeight":"v.height_"+o.id));}}}else{if(!o.stackId){s.push("v.top_"+o.parent.id);}else{if(j){if(j.node){s.push(j.id,".offsetTop + ",j.id,".offsetHeight + ",j.edgeMargin);}else{s.push("v.top_",j.id," + v.height_",j.id," + ",j.edgeMargin);}}}}}else{s.push("v.top_"+o.parent.id);}if(o.parent.hbox){if(o.parent.isRight){if(!q){u.push("v.left_",o.parent.id," + v.width_",o.parent.id," - ",(o.node?o.id+".offsetWidth":"v.width_"+o.id),null);}else{if(q.node){u.push(q.id,".offsetLeft - ",q.edgeMargin," - ",(o.node?o.id+".offsetWidth":"v.width_"+o.id));}else{u.push("v.left_"+q.id," - ",q.edgeMargin," - ",(o.node?o.id+".offsetWidth":"v.width_"+o.id));}}}else{if(!o.stackId){u.push("v.left_"+o.parent.id);}else{if(j){if(j.node){u.push(j.id,".offsetLeft + ",j.id,".offsetWidth + ",j.edgeMargin);}else{u.push("v.left_",j.id," + v.width_",j.id," + ",j.edgeMargin);}}}}}else{u.push("v.left_"+o.parent.id);}if(u.length>2){this.addRule(u.join(""));}if(s.length>2){this.addRule(s.join(""));}if(!o.node){for(var m=0;m<o.children.length;m++){this.parserules(o.children[m]);}}};this.parsesplitters=function(k){if(k.parent&&k.splitter>0){apf.layout.getSplitter(this).init(k.splitter,k.hid,k);}if(!k.node){for(var j=0;j<k.children.length;j++){this.parsesplitters(k.children[j]);}}};function b(){this.parselookup={};this.nRules=[];this.doneRules={};this.maskText=function(m,l,k,j){return l+".offset"+k.toUpperCase();};this.handleVar=function(m,l,k,j){var n="a"+l.replace(/\|/g,"_")+"_style_"+k.toLowerCase();return i[n]?n:m;};this.parseRule=function(o){var l=o.split(" = "),r=l[0].replace(/^([_\w\d\|]+)\.style\.(\w)/,this.maskText),n="a"+l[0].replace(/[\.\|]/g,"_");i[n]=true;var m=l[1].split(/[ \(\)]/),q=[],j;for(var k=0;k<m.length;k++){if(m[k].match(/^([_\w\d\|]+)\.offset(\w+)$/)&&!m[k].match(/PNODE/)){q.push(m[k]);}}if(n.match(/width|height/i)){l[1]=l[1].replace(/^(\s*[\-\d]+[\s\-\+]+)/,"");j=l[0]+" = "+RegExp.$1+n;}else{j=l[0]+" = "+n;}if(o.match(/^v\./)){return{id:r,rule_p1:l[0]+" = ",rule_p2:l[1],ruleb:null,deps:q,processed:false};}return{id:r,rule_p1:"var "+n+" = ",rule_p2:l[1],ruleb:j,deps:q,processed:false};};this.calc=function(l){var k,q,n="";for(k=0;k<l.length;k++){if(l[k].match(/^var/)){this.nRules.push(l[k]);continue;}var m=this.parseRule(l[k],k);this.parselookup[m.id]=m;}for(q in this.parselookup){this.processNode(this.parselookup[q]);}for(q in this.parselookup){var j=this.parselookup[q];this.walkRules(j);}for(q in this.parselookup){this.nRules.push(this.parselookup[q].ruleb);}return this.nRules;};this.walkRules=function(j){if(this.doneRules[j.id]){return;}for(var k=0;k<j.deps.length;k++){if(j.deps[k]&&!j.deps[k].walked&&!this.doneRules[j.deps[k].id]){j.deps[k].walked=true;this.walkRules(j.deps[k]);}}this.doneRules[j.id]=true;this.nRules.push(j.rule_p1+j.rule_p2.replace(/([_\w\d\|]+)\.offset(\w+)/g,this.handleVar));};this.processNode=function(m){for(var k=0;k<m.deps.length;k++){var j=typeof m.deps[k]=="string"?this.parselookup[m.deps[k]]:m.deps[k];if(!j){m.deps[k]=null;continue;}m.deps[k]=j;if(!j.processed){j.processed=true;this.processNode(j);}}};}};apf.queue={q:{},timer:null,add:function(b,a){this.q[b]=a;if(!this.timer){this.timer=$setTimeout("apf.queue.empty()");}},remove:function(a){delete this.q[a];},empty:function(c){clearTimeout(this.timer);this.timer=null;if(apf.layout&&apf.layout.$hasQueue){apf.layout.processQueue();}if(apf.xmldb&&apf.xmldb.$hasQueue){apf.xmldb.notifyQueued();}var b=this.q;for(var c in b){var a=b[c];if(a){delete b[c];a();}}}};apf.http=function(){this.queue=[null];this.callbacks={};this.cache={};this.timeout=this.timeout||10000;this.autoroute=this.autoroute||false;this["route-server"]=this["route-server"]||null;if(!this.$uniqueId){this.$uniqueId=apf.all.push(this)-1;}this.toString=this.toString||function(){return"[Ajax.org Teleport Component : (HTTP)]";};var a=apf.config.name+".apf.http";this.saveCache=function(){var b=apf.serialize(comm.cache);apf.storage.put("cache_"+this.name,b,apf.config.name+".apf.http");};this.loadCache=function(){var b=apf.storage.get("cache_"+this.name,apf.config.name+".apf.http");if(!b){return false;}this.cache=apf.unserialize(b);return true;};this.clearCache=function(){apf.storage.remove("cache_"+this.name,apf.config.name+".apf.http");};this.getXml=function(c,d,b){if(!b){b={};}b.useXML=true;b.callback=d;return this.get(c,b);};this.get=this.$get=function(c,u){if(!u){u={};}var n=this;var d=u.id;var j=u.async=(u.async||typeof u.async=="undefined"||apf.isOpera||false);if(apf.isWebkit){c=apf.html_entity_decode(c);}var l=u.data||"";if(apf.isNot(d)){if(this.cache[c]&&this.cache[c][l]){var t={responseText:this.cache[c][l],responseXML:{},status:200,isCaching:true};}else{var t=apf.getHttpReq();}d=this.queue.push({http:t,url:c,callback:u.callback,retries:0,options:u})-1;if(t.isCaching){if(j){return $setTimeout("apf.lookup("+this.$uniqueId+").receive("+d+");",50);}else{return this.receive(d);}}}else{var t=this.queue[d].http;if(t.isCaching){t=apf.getHttpReq();}else{t.abort();}}if(j){t.onreadystatechange=function(){if(!n.queue[d]||t.readyState!=4){return;}if(j&&arguments.callee.caller){setTimeout(function(){n.receive(d);});}else{n.receive(d);}};}var o=this.autoroute&&apf.isOpera?true:(u.autoroute||this.shouldAutoroute),r=o?this["route-server"]:c;var i=false;try{if(u.nocache){r=apf.getNoCacheUrl(r);}if(apf.config.queryAppend){r+=(r.indexOf("?")==-1?"?":"&")+apf.config.queryAppend;}if(apf.hasHtml5XDomain&&r.match(/^http:\/\//)&&!new apf.url(r).isSameLocation()){throw new Error(apf.formatErrorString(0,this,"Communication error","Url: "+r+"\nReason: Same origin policy in effect"));}t.open(this.method||u.method||"GET",r,j);if(u.username){t.setRequestHeader("Authorization","Basic "+apf.crypto.Base64.encode(u.username+":"+u.password));}if(!apf.isWebkit){t.setRequestHeader("User-Agent","Ajax.org Teleport 3.0");}t.setRequestHeader("X-Requested-With","XMLHttpRequest");if(!u.headers||!u.headers["Content-type"]){t.setRequestHeader("Content-type",this.contentType||(this.useXML||u.useXML?"text/xml":"text/plain"));}if(o){t.setRequestHeader("X-Route-Request",c);t.setRequestHeader("X-Proxy-Request",c);t.setRequestHeader("X-Compress-Response","gzip");}}catch(m){i=m.message;}if(i){var q=false;if(!q&&this.autoroute&&!o){this.shouldAutoroute=true;u.autoroute=true;return this.get(c,u);}if(!q){var s=u.callback?u.callback(null,apf.ERROR,{userdata:u.userdata,http:t,url:c,tpModule:this,id:d,message:"Permission denied accessing remote resource: "+c+"\nMessage: "+i}):false;if(!s){this.clearQueueItem(d);}return;}}if(this.$headerHook){this.$headerHook(t);}if(u.headers){for(var b in u.headers){t.setRequestHeader(b,u.headers[b]);}}function g(){var y=self.navigator.onLine?"File or Resource not available "+c:"Browser is currently working offline";var w=self.navigator&&navigator.onLine?apf.ERROR:apf.TIMEOUT;var x=u.callback?u.callback(null,w,{userdata:u.userdata,http:t,url:c,tpModule:n,id:d,message:y}):false;if(!x){n.clearQueueItem(d);}}function k(y){var w;if(apf.isIE&&y){var x=window.onerror;window.onerror=function(){if(arguments.caller.callee==k){window.onerror=x;return true;}else{window.onerror=x;if(x){return x.apply(window,arguments);}}};t.send(l);window.onerror=x;}else{try{t.send(l);}catch(z){w=true;}}if(w){g();return;}}if(!j){k.call(this);return this.receive(d);}else{if(apf.loadsLocalFilesSync&&location.protocol=="file:"&&c.indexOf("http://")==-1){$setTimeout(function(){k.call(n,true);});}else{k.call(n);}return d;}};if(!this.exec){this.exec=function(j,d,i,c){if(!c){c={};}var b=d[0],g="";if(!c.method){c.method=j.toUpperCase();}if(!c.callback){c.callback=i;}this.contentType="application/x-www-form-urlencoded";this.$get(apf.getAbsolutePath(apf.config.baseurl,b),c.method=="GET"?c:apf.extend({data:g},c));};}this.receive=function(b){if(!this.queue[b]){return false;}var d=this.queue[b],k=d.http,l=d.callback;if(self.navigator&&navigator.onLine===false&&(location.protocol!="file:"||d.url.indexOf("http://")>-1)){return false;}if(d.async){try{if(k.status){}}catch(i){var j=this;return $setTimeout(function(){j.receive(b);},10);}}var g=[],c={tpModule:this,http:k,url:d.url,callback:l,id:b,retries:d.retries||0,userdata:d.options.userdata};if(k.status>600){return this.$timeout(b);}c.data=k.responseText;if(k.status>=400&&k.status<600||k.status<10&&k.status!=0){g.push("HTTP error ["+b+"]:"+k.status+"\n"+k.responseText);}if(d.options.useXML||this.useXML){if((k.responseText||"").replace(/^[\s\n\r]+|[\s\n\r]+$/g,"")==""){g.push("Received an empty XML document (0 bytes)");}else{try{var m=(k.responseXML&&k.responseXML.documentElement)?apf.xmlParseError(k.responseXML):apf.getXmlDom(k.responseText);if(!apf.supportNamespaces){m.setProperty("SelectionLanguage","XPath");}c.data=m.documentElement;}catch(i){g.push("Received invalid XML\n\n"+i.message);}}}if(g.length){c.message=g.join("\n");if(!l||!l(c.data,apf.ERROR,c)){this.clearQueueItem(b);}return;}if(d.options.caching){if(!this.cache[d.url]){this.cache[d.url]={};}this.cache[d.url][d.options.data]=k.responseText;}if(!l||!l(c.data,apf.SUCCESS,c)){this.clearQueueItem(b);}return c.data;};this.$timeout=function(k){if(!this.queue[k]){return false;}var j=this.queue[k],c=j.http;try{if(c.status){}}catch(d){var b=this;return $setTimeout(function(){b.$timeout(k);},10);}var i=j.callback;c.abort();var g=i?i(null,apf.TIMEOUT,{userdata:j.options.userdata,http:c,url:j.url,tpModule:this,id:k,message:"HTTP Call timed out",retries:j.retries||0}):false;if(!g){this.clearQueueItem(k);}};this.retryTimeout=function(b,d,c,i,g){if(d==apf.TIMEOUT&&b.retries<(g||apf.maxHttpRetries)){return b.tpModule.retry(b.id);}i=i||new Error(apf.formatErrorString(0,this,"Communication "+(d==apf.TIMEOUT?"timeout":"error"),"Url: "+b.url+"\nInfo: "+b.message));if((c||apf).dispatchEvent("error",apf.extend({error:i,state:d,bubbles:true},b))===false){return true;}};this.clearQueueItem=function(b){if(!this.queue[b]){return false;}if(apf.releaseHTTP){apf.releaseHTTP(this.queue[b].http);}this.queue[b]=null;delete this.queue[b];return true;};this.retry=function(c){if(!this.queue[c]){return false;}var b=this.queue[c];b.retries++;b.options.id=c;this.get(b.url,b.options);return true;};this.cancel=function(b){if(b===null){b=this.queue.length-1;}if(!this.queue[b]){return false;}this.clearQueueItem(b);};if(!this.$loadAml&&!this.instantiate&&!this.call){this.$loadAml=function(b){var k=this["receive"];for(var j=0,c=this.childNodes.length;j<c;j++){if(this.childNodes[j].nodeType!=1){continue;}var g=this.childNodes[j].getAttribute("url"),m=self[this.childNodes[j].getAttribute("receive")||k],d={useXML:this.childNodes[j].getAttribute("type")=="XML",async:!apf.isFalse(this.childNodes[j].getAttribute("async"))};this[this.childNodes[j].getAttribute("name")]=function(l,i){d.userdata=i;d.data=l;return this.get(g,d);};}};this.instantiate=function(b){var g=b.getAttribute("src"),d={async:b.getAttribute("async")!="false",nocache:true};this.getURL=function(j,i){d.data=j;d.userdata=i;d.callback=this.callbacks.getURL;return this.get(g,d);};var c="http"+Math.round(Math.random()*100000);apf.setReference(c,this);return c+".getURL()";};this.call=function(c,b){this[c].call(this,b);};}};apf.Init.run("http");apf.DOMParser=function(){};apf.DOMParser.prototype=new (function(){this.caseInsensitive=true;this.preserveWhiteSpace=true;this.$shouldWait=0;var b=[/\<\!(DOCTYPE|doctype)[^>]*>/,/&nbsp;/g,/<\s*\/?\s*(?:\w+:\s*)[\w-]*[\s>\/]/g],a="//@*[not(contains(local-name(), '.')) and not(translate(local-name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = local-name())]";this.parseFromString=function(m,o,g){var k;if(this.caseInsensitive){var n=m.replace(b[0],"").replace(b[1]," ").replace(b[2],function(i){return i.toLowerCase();});if(!this.supportNamespaces){n=n.replace(/xmlns\=\"[^"]*\"/g,"");}k=apf.getXmlDom(n,null,this.preserveWhiteSpace||apf.debug).documentElement;var j,c,d=k.selectNodes(a);for(j=0,c=d.length;j<c;j++){(d[j].ownerElement||d[j].selectSingleNode("..")).setAttribute(d[j].nodeName.toLowerCase(),d[j].nodeValue);}}else{k=apf.getXmlDom(m,null,this.preserveWhiteSpace||apf.debug).documentElement;}return this.parseFromXml(k,g);};this.parseFromXml=function(d,g){var E,c,x;if(!g){g={};}if(!g.delayedRender&&!g.include){if(g.doc){E=g.doc;c=g.docFrag||E.createDocumentFragment();}else{E=new apf.AmlDocument();E.$aml=d;E.$domParser=this;}x=this.$createNode(E,d.nodeType,d);(c||E).appendChild(x);if(g.htmlNode){x.$int=g.htmlNode;}}else{x=g.amlNode;E=g.doc;if(g.include){var y=x.childNodes;var t=y.indexOf(g.beforeNode);var r=y.splice(t,y.length-t);}}this.$parseContext=[x,g];var z,w={},q=[],k=this;(function s(G,j){var H,L,F,K,n=G.childNodes,J=0,I=j.length;for(;J<I;J++){L=k.$createNode(E,(F=j[J]).nodeType,F);if(!L){continue;}n[H=n.length]=L;L.parentNode=G;if(H>0){(L.previousSibling=n[H-1]).nextSibling=L;}if(!L.render&&L.canHaveChildren&&(K=F.childNodes).length){s(L,K);}if(L.$parsePrio){if(L.$parsePrio=="001"){L.dispatchEvent("DOMNodeInsertedIntoDocument");continue;}(w[L.$parsePrio]||(q.push(L.$parsePrio)&&(w[L.$parsePrio]=[]))).push(L);}}G.firstChild=n[0];G.lastChild=n[I-1];})(x,d.childNodes);if(g.include&&r.length){var m=y.length-1;y.push.apply(y,r);var o=y[m];var u=y[m+1];(u.previousSibling=o).nextSibling=u;x.lastChild=y[y.length-1];}if(g.delay){x.$parseOptions={prios:q,nodelist:w};return(c||E);}q.sort();var D,C,B,A;for(D=0,B=q.length;D<B;D++){z=w[q[D]];for(C=0,A=z.length;C<A;C++){z[C].dispatchEvent("DOMNodeInsertedIntoDocument");}}if(this.$shouldWait){return(c||E);}if(g.timeout){$setTimeout(function(){k.$continueParsing(x,g);});}else{this.$continueParsing(x,g);}return(c||E);};this.$callCount=0;this.$continueParsing=function(d,s){if(this.$shouldWait&&--this.$shouldWait!=0){return false;}if(!s){s={};}this.$callCount++;if(d.$parseOptions){var o=d.$parseOptions.prios,r=d.$parseOptions.nodelist,n,m,k,g,c;delete d.$parseOptions;o.sort();for(n=0,k=o.length;n<k;n++){nodes=r[o[n]];for(m=0,g=nodes.length;m<g;m++){if(!(c=nodes[m]).parentNode||c.$amlLoaded){continue;}nodes[m].dispatchEvent("DOMNodeInsertedIntoDocument");}}}if(!s.ignoreSelf&&!d.$amlLoaded){d.dispatchEvent("DOMNodeInsertedIntoDocument");}(function q(t){var w,x;for(var u=0,j=t.length;u<j;u++){if(!(w=t[u]).$parsePrio&&!w.$amlLoaded){w.dispatchEvent("DOMNodeInsertedIntoDocument");}if(!w.render&&(x=w.childNodes).length){q(x);}}})(d.childNodes);if(!--this.$callCount&&!s.delay){apf.queue.empty();}if(s.callback){s.callback.call(d.ownerDocument);}delete this.$parseContext;};this.$createNode=function(z,q,A,g,y,t){var d;switch(q){case 1:var c,s;if(A){if((g=A.namespaceURI||apf.ns.xhtml)&&!(s=z.$prefixes[g])){z.$prefixes[s=A.prefix||A.scopeName||""]=g;z.$namespaceURIs[g]=s;if(!z.namespaceURI&&!s){z.namespaceURI=g;z.prefix=s;}}y=A.baseName||A.localName||A.tagName.split(":").pop();}else{s=z.$prefixes[g]||"";}var m=apf.namespaces[g].elements;d=new (m[y]||m["@default"])(null,y);d.prefix=s||"";d.namespaceURI=g;d.tagName=s?s+":"+y:y;if(A){if(c=A.getAttribute("id")){d.$propHandlers.id.call(d,d.id=c);}var w=A.attributes,j;for(var x,r=0,k=w.length;r<k;r++){d.attributes.push(new apf.AmlAttr(d,(j=(x=w[r]).nodeName),x.nodeValue));if(j=="render"){d.render=true;}}}break;case 2:d=new apf.AmlAttr();d.name=d.nodeName=y;if(t||(t=A&&A.nodeValue)){d.value=d.nodeValue=t;}if(A){if(A.namespaceURI&&!(d.prefix=z.$namespaceURIs[d.namespaceURI=A.namespaceURI])){z.$prefixes[d.prefix=A.prefix||A.scopeName]=d.namespaceURI;}}else{d.prefix=z.$prefixes[g];}break;case 3:if(A){t=A&&A.nodeValue;}if(!this.preserveWhitespace&&!(t||"").trim()){return;}d=new apf.AmlText();d.nodeValue=t||A&&A.nodeValue;break;case 7:var u=y||A&&A.nodeName;d=new apf.aml.processingInstructions[u]();d.target=d.nodeName=u;d.data=d.nodeValue=t||A&&A.nodeValue;break;case 4:d=new apf.AmlCDATASection();d.nodeValue=t||A&&A.nodeValue;break;case 5:d=new apf.AmlNode();d.nodeType=q;break;case 6:d=new apf.AmlNode();d.nodeType=q;break;case 8:d=new apf.AmlComment();d.nodeValue=t||A&&A.nodeValue;break;case 9:d=new apf.AmlDocument();d.$domParser=this;break;case 10:d=new apf.AmlNode();d.nodeType=q;break;case 11:d=new apf.AmlDocumentFragment();break;}d.$aml=A;d.ownerDocument=z;return d;};})();apf.AmlNamespace=function(){this.elements={};this.processingInstructions={};};apf.AmlNamespace.prototype={setElement:function(a,b){return this.elements[a]=b;},setProcessingInstruction:function(b,a){this.processingInstructions[b]=a;}};apf.aml=new apf.AmlNamespace();apf.setNamespace("http://ajax.org/2005/aml",apf.aml);apf.__AMLNODE__=1<<14;apf.AmlNode=function(){this.$init(function(){this.childNodes=[];});};(function(){this.$regbase=this.$regbase|apf.__AMLNODE__;this.NODE_ELEMENT=1;this.NODE_ATTRIBUTE=2;this.NODE_TEXT=3;this.NODE_CDATA_SECTION=4;this.NODE_ENTITY_REFERENCE=5;this.NODE_ENTITY=6;this.NODE_PROCESSING_INSTRUCTION=7;this.NODE_COMMENT=8;this.NODE_DOCUMENT=9;this.NODE_DOCUMENT_TYPE=10;this.NODE_DOCUMENT_FRAGMENT=11;this.NODE_NOTATION=12;this.ownerDocument=null;this.nodeValue="";this.namespaceURI="";this.appendChild=this.insertBefore=function(d,o,c){if(this.nodeType==this.NODE_DOCUMENT){if(this.childNodes.length){throw new Error(apf.formatErrorString(0,this,"Insertbefore DOM operation","Only one top level element is allowed in an AML document."));}else{this.documentElement=d;}}if(d.nodeType==this.NODE_DOCUMENT_FRAGMENT){var a=d.childNodes.slice(0);for(var j=0,g=a.length;j<g;j++){this.insertBefore(a[j],o);}return d;}var b=d.parentNode==this,m=d.$pHtmlNode,r=d.parentNode,k=-1,n=this;if(o){k=this.childNodes.indexOf(o);if(k<0){return false;}}if(!d.ownerDocument){d.ownerDocument=this.ownerDocument||apf.ownerDocument;}if(d.parentNode){d.removeNode(b,c);}d.parentNode=this;if(o){d.nextSibling=o;d.previousSibling=o.previousSibling;o.previousSibling=d;if(d.previousSibling){d.previousSibling.nextSibling=d;}}if(k>=0){this.childNodes=this.childNodes.slice(0,k).concat(d,this.childNodes.slice(k));}else{k=this.childNodes.push(d)-1;d.nextSibling=null;if(k>0){d.previousSibling=this.childNodes[k-1];d.previousSibling.nextSibling=d;}else{d.previousSibling=null;}}this.firstChild=this.childNodes[0];this.lastChild=this.childNodes[this.childNodes.length-1];function s(){d.$pHtmlNode=n.canHaveChildren?n.$int:document.body;d.dispatchEvent("DOMNodeInserted",{$beforeNode:o,relatedNode:n,$isMoveWithinParent:b,$oldParentHtmlNode:m,$oldParent:r,bubbles:true});var i;var l=(d.$ext&&d.$ext.nodeType==1&&(i=d.$ext.getElementsByTagName("iframe")).length>0&&apf.findHost(i[0].parentNode)==d);if(!c&&d.$ext&&!l){d.$pHtmlNode.insertBefore(d.$ext,o&&o.$ext||null);}}var q=this.nodeType==this.NODE_DOCUMENT?this:this.ownerDocument;if(!q||q.$domParser.$shouldWait){return d;}if(this.nodeType==this.NODE_DOCUMENT_FRAGMENT){return;}if(!d.$amlLoaded){(this.ownerDocument||this).$domParser.$continueParsing(d,{delay:true});}s();return d;};this.removeNode=function(b,a){if(!this.parentNode||!this.parentNode.childNodes){return this;}this.parentNode.childNodes.remove(this);if(this.$amlLoaded&&!apf.isDestroying){if(!a&&this.$ext&&this.$ext.parentNode){this.$ext.parentNode.removeChild(this.$ext);}this.dispatchEvent("DOMNodeRemoved",{relatedNode:this.parentNode,bubbles:true,$doOnlyAdmin:b});}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(a){a.removeNode();return this;};this.replaceChild=function(){};this.cloneNode=function(a){if(a&&this.nodeType==1){return this.ownerDocument.$domParser.parseFromXml(this,{doc:this.ownerDocument,delay:true}).childNodes[0];}else{return this.ownerDocument.$domParser.$createNode(this.ownerDocument,this.nodeType,this);}};this.canDispatch=function(a,b){};this.compareDocumentPosition=function(a){};this.hasAttributes=function(){return this.attributes&&this.attributes.length;};this.hasChildNodes=function(){return this.childNodes&&this.childNodes.length;};this.isDefaultNamespace=function(a){if(b.nodeType==1){if(!this.prefix){return this.namespaceURI==a;}}var b=this.parentNode||this.ownerElement;return b&&b.isDefaultNamespace(a);};this.lookupNamespaceURI=function(b){if(a.nodeType==1){if(this.namespaceURI&&b==this.prefix){return this.namespaceURI;}}var a=this.parentNode||this.ownerElement;return a&&a.lookupNamespaceURI(b);};this.lookupPrefix=function(a){if(this.nodeType==1){if(a==this.namespaceURI&&this.prefix){return this.prefix;}}var b=this.parentNode||this.ownerElement;return b&&b.lookupPrefix(a);};this.normalize=function(){};this.selectNodes=function(b,a){if(!apf.XPath){apf.runXpath();}return apf.XPath.selectNodes(b,a||(this.nodeType==9?this.documentElement:this));};this.selectSingleNode=function(b,a){if(!apf.XPath){apf.runXpath();}return apf.XPath.selectNodes(b,a||(this.nodeType==9?this.documentElement:this))[0];};}).call(apf.AmlNode.prototype=new apf.Class());apf.AmlElement=function(c,a){var b=this.$init;this.$init=function(g,d,k){this.$supportedProperties=this.$supportedProperties.slice();var l,j,i;j=this.$propHandlers;i=this.$propHandlers={};for(l in j){i[l]=j[l];}j=this.$booleanProperties;i=this.$booleanProperties={};for(l in j){i[l]=j[l];}b.call(this,g,d,k);};this.$init(function(m,j,n){this.$events={};this.$inheritProperties={};this.attributes=new apf.AmlNamedNodeMap(this);this.nodeFunc=j;this.localName=m;if(n){var g,o,k,d;if(n.childNodes){g=n.childNodes;delete n.childNodes;}for(o in n){if(o=="htmlNode"){continue;}this.attributes.push(new apf.AmlAttr(this,o,n[o]));}if(!this.ownerDocument){this.ownerDocument=apf.document;this.prefix="";this.namespaceURI=null;this.tagName=m;}if(g){this.childNodes=g;for(k=0,d=g.length;k<d;k++){g[k].nextSibling=g[k+1]||null;g[k].previousSibling=g[k-1]||null;g[k].parentNode=this;}this.firstChild=g[0]||null;this.lastChild=g[g.length-1]||null;}this.$aml=apf.$emptyNode||(apf.$emptyNode=apf.getXml("<empty />"));}});if(a){b.call(this,a,apf.NODE_HIDDEN,c);}};(function(){this.nodeType=this.NODE_ELEMENT;this.canHaveChildren=true;this.$propHandlers={id:function(b){if(this.name==b){return;}if(self[this.name]==this){self[this.name]=null;}if(!self[b]||!self[b].hasFeature){try{self[b]=this;}catch(a){}}apf.nameserver.register(this.localName,b,this);this.name=b;}};this.$booleanProperties={};this.$inheritProperties={};this.$supportedProperties=[];this.getElementsByTagName=function(g,k){g=g.toLowerCase();var j,d,b,c=this.childNodes,a=[];for(d=0,b=c.length;d<b;d++){if((j=c[d]).nodeType!=1){continue;}if(j.tagName==g||g=="*"){a.push(j);}if(!k&&j.nodeType==1){a=a.concat(j.getElementsByTagName(g));}}return a;};this.getElementsByTagNameNS=function(g,d,m){d=d.toLowerCase();var k,j,b,c=this.childNodes,a=[];for(j=0,b=c.length;j<b;j++){if((k=c[j]).nodeType!=1){continue;}if(k.namespaceURI==g&&(k.localName==d||d=="*")){a.push(k);}if(!m&&k.nodeType==1){a=a.concat(k.getElementsByTagNameNS(g,d));}}return a;};this.setAttribute=function(c,g,d){c=c.toLowerCase();var b=this.attributes.getNamedItem(c);if(!b){this.attributes.push(b=new apf.AmlAttr(this,c,g));if(!this.$amlLoaded){return;}if(d){b.$setValue(g);}else{b.dispatchEvent("DOMNodeInsertedIntoDocument",{relatedNode:this});b.dispatchEvent("DOMNodeInserted",{relatedNode:this,bubbles:true});}return;}b.$setValue(g);if(d||!this.$amlLoaded){return;}b.$triggerUpdate();};this.setAttributeNode=function(a){this.attributes.setNamedItem(a);};this.setAttributeNS=function(b,a,c){return this.setAttribute(a,c);};this.hasAttribute=function(a){return this.getAttributeNode(a)?true:false;};this.hasAttributeNS=function(b,a){return this.hasAttribute(a);};this.removeAttribute=function(a){this.attributes.removeNamedItem(a);return this;};this.removeAttributeNS=function(b,a){return this.removeAttribute(a);};this.removeAttributeNode=function(a){this.attributes.removeNamedItem(a.name);};this.getAttribute=function(b,a){var c=this.attributes.getNamedItem(b);return c?(a?c.inheritedValue||c.nodeValue:c.nodeValue):null;};this.getAttributeNode=function(a){return this.attributes.getNamedItem(a);};this.getBoundingClientRect=function(){return new apf.AmlTextRectangle(this);};this.querySelector=function(){};this.querySelectorAll=function(){};this.scrollIntoView=function(){};this.replaceMarkup=function(a,b){if(!b){b={};}if(!b.$intAML){b.$intAML=this.$aml;}if(!b.$int){b.$int=this.$int;}b.clear=true;for(var c=this.childNodes.length-1;c>=0;c--){var d=this.childNodes[c];if(d.destroy){d.destroy(true);}if(d.$ext!=this.$int){apf.destroyHtmlNode(d.$ext);}}this.childNodes.length=0;this.$int.innerHTML="<div class='loading'>loading...</div>";this.insertMarkup(a,b);};this.insertMarkup=function(b,c){var a=new apf.XiInclude();a.setAttribute("href",b);if(c&&c.clear){a.setAttribute("clear",true);}a.options=c;a.callback=c&&c.callback;this.appendChild(a);};this.serialize=function(b){if(b||!this.firstChild){return"<"+(this.prefix?this.prefix+":"+this.localName+" xmlns:"+this.prefix+'="'+this.namespaceURI+'"':this.localName)+(this.attributes.length?" ":"")+this.attributes.join(" ")+"/>";}else{var c=["<"+(this.prefix?this.prefix+":"+this.localName+" xmlns:"+this.prefix+'="'+this.namespaceURI+'"':this.localName)+(this.attributes.length?" ":"")+this.attributes.join(" ")+">"];for(var a=this.firstChild;a;a=a.nextSibling){c.push(a.serialize());}return c.join("")+"</"+(this.prefix?this.prefix+":"+this.localName:this.localName)+">";}};this.$setInheritedAttribute=function(c){var b,a=this;b=a.getAttribute(c);if(!b){a=a.parentNode;while(a&&a.nodeType==1&&!(b=a.getAttribute(c,true))){a=a.parentNode;}}if(!b&&apf.config&&c){b=apf.config[c];}if(b){this.$clearDynamicProperty(c);if(typeof b=="string"&&(b.indexOf("{")>-1||b.indexOf("[")>-1)){this.$setDynamicProperty(c,b);this.$inheritProperties[c]=2;}else{this.setProperty(c,b,false,false,2);}}return b;};this.$handlePropSet=function(d,c,b){if(c&&this.$booleanProperties[d]){c=apf.isTrue(c);}this[d]=c;var a;return(a=this.$propHandlers&&this.$propHandlers[d]||this.nodeFunc==apf.NODE_VISIBLE&&apf.GuiElement&&apf.GuiElement.propHandlers[d]||null)&&a.call(this,c,d,b);};this.addEventListener("DOMNodeInsertedIntoDocument",function(n){var s,k,b,o=this.attributes;var g=apf.nameserver.getAll("defaults_"+this.localName);if(g.length){for(var c=0,m=g.length;c<m;c++){var r=g[c].attributes,q;for(k=0,b=r.length;k<b;k++){s=o.getNamedItem((q=r[k]).nodeName);if(s){if(s.value){continue;}s.$setValue(q.nodeValue);this.$inheritProperties[q.nodeName]=2;}else{this.attributes.push(new apf.AmlAttr(this,q.nodeName,q.nodeValue));this.$inheritProperties[q.nodeName]=2;}}}}for(k=0,b=o.length;k<b;k++){o[k].dispatchEvent("DOMNodeInsertedIntoDocument");}this.$amlLoaded=true;},true);}).call(apf.AmlElement.prototype=new apf.AmlNode());apf.AmlCharacterData=function(){this.data="";this.length=0;this.$init(true);this.appendData=function(a){this.dispatchEvent("DOMCharacterDataModified",{value:a});};this.deleteData=function(b,a){this.dispatchEvent("DOMCharacterDataModified",{offset:b,count:a});};this.insertData=function(b,a){this.dispatchEvent("DOMCharacterDataModified",{offset:b,count:a});};this.replaceData=function(c,a,b){this.dispatchEvent("DOMCharacterDataModified",{offset:c,count:a,value:b});};this.substringData=function(b,a){};};apf.AmlCharacterData.prototype=new apf.AmlNode();apf.AmlText=function(a){this.$init(a);};(function(){this.nodeType=this.NODE_TEXT;this.nodeName="#text";this.serialize=function(){return apf.xmlentities(this.nodeValue).replace(/</g,"&lt;").replace(/>/g,"&gt;");};this.$handlePropSet=function(c,b,a){this[c]=b;if(c=="data"){this.$clearDynamicProperty("calcdata");this.$setDynamicProperty(c,b);}else{if(this.$propHandlers[c]){this.$propHandlers[c].call(this,b,c);}}};this.$attrExcludePropBind={data:0};this.getAttribute=function(){};this.mainBind="data";this.$setValue=function(a){this.dispatchEvent("DOMCharacterDataModified",{bubbles:true,prevValue:this.nodeValue,newValue:this.nodeValue=a});if(this.$amlLoaded){this.$ext.nodeValue=a;}};this.addEventListener("DOMNodeInsertedIntoDocument",function(b){var c;if(!(c=this.parentNode.$int)||this.parentNode.hasFeature(apf.__CHILDVALUE__)){return;}this.$amlLoaded=true;var a=this.nodeValue;if(apf.config.liveText&&!this.parentNode.hasFeature(apf.__CHILDVALUE__)&&(a.indexOf("{")>-1||a.indexOf("[")>-1)){this.$supportedProperties=[];this.$propHandlers={};this.$booleanProperties={};this.$inheritProperties={};this.$propHandlers.calcdata=apf.LiveMarkupPi.prototype.$propHandlers.calcdata;this.$setInheritedAttribute=apf.AmlElement.prototype.$setInheritedAttribute;this.implement(apf.StandardBinding);c.appendChild(this.$ext=document.createElement("span"));this.$setDynamicProperty("calcdata",this.nodeValue);return;}if(apf.hasTextNodeWhiteSpaceBug){var a=a.replace(/[\t\n\r ]+/g," ");if(a&&a!=" "){this.$ext=c.appendChild(c.ownerDocument.createTextNode(a));}}else{this.$ext=c.appendChild(c.ownerDocument.createTextNode(a));}},true);}).call(apf.AmlText.prototype=new apf.AmlCharacterData());apf.AmlCDATASection=function(a){this.nodeType=this.NODE_CDATA_SECTION;this.nodeName="#cdata-section";this.$init(a);};apf.AmlCDATASection.prototype=new apf.AmlText(true);apf.AmlCDATASection.prototype.serialize=function(){return"<![CDATA["+this.nodeValue+"]]>";};apf.AmlDocumentFragment=function(a){this.$init(a);};apf.AmlDocumentFragment.prototype=new apf.AmlNode();apf.AmlDocumentFragment.prototype.nodeName="#document-fragment";apf.AmlDocumentFragment.prototype.nodeType=apf.AmlDocumentFragment.prototype.NODE_DOCUMENT_FRAGMENT;apf.AmlDocument=function(){this.$prefixes={};this.$namespaceURIs={};this.domConfig=new apf.AmlConfiguration();this.$init();};(function(){this.nodeType=this.NODE_DOCUMENT;this.nodeFunc=apf.NODE_HIDDEN;this.nodeName="#document";this.$amlLoaded=true;this.activeElement=null;this.doctype=null;this.domConfig=null;this.implementation=null;this.characterSet=apf.characterSet;this.documentElement=null;this.getElementById=function(a){return self[a];};this.getElementsByTagName=function(b){var c,a=(c=this.documentElement).getElementsByTagName(b);if(c.tagName==b){a.push(c);}return a;};this.getElementsByTagNameNS=function(c,b){var d,a=(d=this.documentElement).getElementsByTagNameNS(c,b);if(d.tagName==b&&d.namespaceURI==c){a.push(d);}return a;};this.createElement=function(a){return this.$domParser.$createNode(this,this.NODE_ELEMENT,null,this.namespaceURI,a);};this.createElementNS=function(a,b){return this.$domParser.$createNode(this,this.NODE_ELEMENT,null,a,b);};this.importNode=function(b,a){if(a&&b.nodeType==1){return this.$domParser.parseFromXml(b,{doc:this,delay:true}).childNodes[0];}else{return this.$domParser.$createNode(this,b.nodeType,b);}};this.createAttribute=function(a){return this.$domParser.$createNode(this,this.NODE_ATTRIBUTE,null,this.nameSpaceURI,a);};this.createAttributeNS=function(a,b){return this.$domParser.$createNode(this,this.NODE_ATTRIBUTE,null,a,b);};this.createEvent=function(){return new apf.AmlEvent();};this.createComment=function(a){return this.$domParser.$createNode(this,this.NODE_COMMENT,null,null,null,a);};this.createProcessingInstruction=function(a){return this.$domParser.$createNode(this,this.NODE_PROCESSING_INSTRUCTION,null,null,null,a);};this.createCDATASection=function(a){return this.$domParser.$createNode(this,this.NODE_CDATA_SECTION,null,null,null,a);};this.createTextNode=function(a){return this.$domParser.$createNode(this,this.NODE_TEXT,null,null,null,a);};this.createDocumentFragment=function(){return this.$domParser.$createNode(this,this.NODE_DOCUMENT_FRAGMENT);};this.querySelector=function(){};this.querySelectorAll=function(){};this.evaluate=function(g,d,c,i,b){var a=apf.XPath.selectNodes(g,d||this.documentElement);return{snapshotLength:a.length,snapshotItem:function(j){return a[j];}};};this.createNSResolver=function(a){return{};};}).call(apf.AmlDocument.prototype=new apf.AmlNode());apf.AmlProcessingInstruction=function(a){this.$init(a);this.$supportedProperties=[];this.$propHandlers={};this.$booleanProperties={};this.$inheritProperties={};};(function(){this.nodeType=this.NODE_PROCESSING_INSTRUCTION;this.data=null;this.target=null;this.serialize=function(){return"<?"+this.target+"\n"+apf.xmlentities(this.nodeValue)+"\n?>";};this.$attrExcludePropBind=apf.extend({calcdata:0},this.$attrExcludePropBind);this.getAttribute=function(){};this.$setInheritedAttribute=apf.AmlElement.prototype.$setInheritedAttribute;this.$handlePropSet=function(c,b,a){this[c]=b;if(c=="data"){this.$clearDynamicProperty("calcdata");this.$setDynamicProperty("calcdata",b);}else{if(c=="target"){}else{if(this.$propHandlers[c]){this.$propHandlers[c].call(this,b,c);}}}};this.addEventListener("DOMNodeInsertedIntoDocument",function(a){var b;if(this.parentNode.$bindingRule||!(b=this.parentNode.$int)){return;}b.appendChild(this.$ext=document.createElement("span"));this.$ext.host=this;this.$setDynamicProperty("calcdata",this.data);},true);this.addEventListener("DOMNodeRemovedFromDocument",function(a){this.$clearDynamicProperty("calcdata");});}).call(apf.AmlProcessingInstruction.prototype=new apf.AmlNode());apf.AmlAttr=function(c,a,b){this.$init();this.ownerElement=c;this.ownerDocument=c.ownerDocument;this.nodeName=this.name=a;this.nodeValue=this.value=b;};(function(){this.nodeType=this.NODE_ATTRIBUTE;this.MODIFICATION=1;this.ADDITION=2;this.REMOVAL=3;this.serialize=this.toString=function(){return this.name+'="'+apf.xmlentities(String(this.value)).replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"';};this.$setValue=function(a){this.nodeValue=this.value=a;this.specified=true;};this.$triggerUpdate=function(d){var a=this.name,c=this.value,b=this.ownerElement;if(a=="id"&&!this.specified&&b.id){this.specified=true;return;}if(a.substr(0,2)=="on"){if(b.$events[a]){b.removeEventListener(a.replace(/^on/,""),b.$events[a]);}if(c){b.addEventListener(a,(b.$events[a]=(typeof c=="string"?apf.lm.compile(c,{event:true,parsecode:true}):c)));}return;}else{if(this.specified){b.$clearDynamicProperty(a);}if(typeof c=="string"&&(b.$attrExcludePropBind[a]||(c.indexOf("{")>-1||c.indexOf("[")>-1))){b.$setDynamicProperty(a,c);return;}}b.setProperty(a,c);if(this.specified){b.dispatchEvent("DOMAttrModified",{relatedNode:this,attrChange:this.MODIFICATION,attrName:a,newValue:c,prevValue:null,bubble:true});}else{this.specified=true;}};this.addEventListener("DOMNodeInsertedIntoDocument",this.$triggerUpdate);}).call(apf.AmlAttr.prototype=new apf.AmlNode());apf.AmlConfiguration=function(a){this.parameterNames=[];this.$init(a);};(function(){this.setParameter=this.setProperty;this.getParameter=this.getProperty;this.canSetParameter=function(a,b){return this.parameterNames.indexOf(a)>-1;};}).call(apf.AmlConfiguration.prototype=new apf.Class());apf.AmlComment=function(a){this.nodeType=this.NODE_COMMENT;this.nodeName="#comment";this.$init(a);};(function(){this.serialize=function(){return"<!--"+this.nodeValue+"-->";};this.$setValue=function(a){this.dispatchEvent("DOMCharacterDataModified",{bubbles:true,newValue:a,prevValue:this.nodeValue});};}).call(apf.AmlComment.prototype=new apf.AmlCharacterData());apf.AmlTextRectangle=function(c){var a=this;function b(){var d=a.getAbsolutePosition(a.$ext);a.setProperty("left",d[0]);a.setProperty("top",d[1]);a.setProperty("right",document.documentElement.offsetWidth-d[0]);a.setProperty("bottom",document.documentElement.offsetWidth-d[1]);}c.addEventListener("prop.width",b);c.addEventListener("prop.height",b);c.addEventListener("prop.left",b);c.addEventListener("prop.top",b);b.call(c);};apf.AmlTextRectangle.prototype=new apf.Class();apf.AmlNamedNodeMap=function(a){this.$host=a;};(function(){this.getNamedItem=function(a){for(var b=0;b<this.length;b++){if(this[b].name==a){return this[b];}}return false;};this.setNamedItem=function(d){var a=d.name;for(var c,b=this.length-1;b>=0;b--){if(this[b].name==a){this[b].ownerElement=null;this.splice(b,1);break;}}this.push(d);d.ownerElement=this.$host;d.$triggerUpdate();};this.removeNamedItem=function(a){for(var c,b=this.length-1;b>=0;b--){if(this[b].name==a){c=this[b];this.splice(b,1);break;}}if(!c){return false;}c.ownerElement.setProperty(a,"");c.ownerElement=null;return c;};this.item=function(a){return this[a];};this.length=0;this.splice=function(d,c){for(var b=d,a=this.length-c;b<a;b++){this[b]=this[b+1];}delete this[b];this.length-=c;};this.push=function(a){this[this.length++]=a;return this.length;};this.join=function(j){var b=[];for(var k,d,g=0,c=this.length;g<c;g++){if((k=(d=this[g]).ownerElement)&&!k.$inheritProperties[d.nodeName]){b.push(this[g]);}}return b.join(j);};}).call(apf.AmlNamedNodeMap.prototype={});apf.AmlEvent=function(a,b){this.name=a;var c;for(c in b){this[c]=b[c];}};apf.AmlEvent.prototype={bubbles:false,cancelBubble:false,preventDefault:function(){this.returnValue=false;},stopPropagation:function(){this.cancelBubble=true;},stop:function(){this.returnValue=false;this.cancelBubble=true;}};apf.xhtml=new apf.AmlNamespace();apf.setNamespace("http://www.w3.org/1999/xhtml",apf.xhtml);apf.XhtmlElement=function(c,b){this.$init(b||true,apf.NODE_VISIBLE,c);this.$xoe=this.addEventListener;this.addEventListener=this.$xae;this.removeEventListener=this.$xre;var a=this;this.$de=function(d){a.dispatchEvent(d.type,d);};};(function(){this.$xae=function(b,a){if(!this.$ext){return;}apf.addListener(this.$ext,b,this.$de);this.$xoe.apply(this,arguments);};this.$xre=function(b,a){if(!this.$ext){return;}apf.removeListener(this.$ext,b,this.$de);apf.AmlElement.prototype.removeEventListener.apply(this,arguments);};this.$handlePropSet=function(a,d,c){if(this.$booleanProperties[a]){d=apf.isTrue(d);}this[a]=d;var b=this.$propHandlers&&this.$propHandlers[a]||apf.GuiElement.propHandlers[a];if(b){b.call(this,d,null,a);}else{if(this.$int){this.$int.setAttribute(apf.isIE&&a=="class"?"className":a,d);}}};this.addEventListener("DOMNodeInsertedIntoDocument",function(a){var b;if(!(b=this.parentNode.$int)){return;}if(this.$aml){this.$ext=this.$int=apf.insertHtmlNode(this.$aml.serialize?this.$aml:this.$aml.cloneNode(false),b);}else{this.$ext=this.$int=b.appendChild(document.createElement(this.localName));}},true);}).call(apf.XhtmlElement.prototype=new apf.AmlElement());apf.xhtml.setElement("@default",apf.XhtmlElement);apf.XhtmlIgnoreElement=function(b,a){this.$init(a,apf.NODE_VISIBLE,b);};apf.XhtmlIgnoreElement.prototype=new apf.AmlElement();apf.xhtml.setElement("script",apf.XhtmlIgnoreElement);apf.xhtml.setElement("noscript",apf.XhtmlIgnoreElement);apf.xhtml.setElement("head",apf.XhtmlIgnoreElement);apf.xhtml.setElement("meta",apf.XhtmlIgnoreElement);apf.XhtmlInputElement=function(b,a){this.$init(a||"input",apf.NODE_VISIBLE,b);};(function(){this.$xae=apf.XhtmlElement.prototype.$xae;this.$xre=apf.XhtmlElement.prototype.$xre;this.$handlePropSet=function(a,c,b){if(a=="type"){return;}return apf.XhtmlElement.prototype.$handlePropSet.call(this,a,c,b);};this.addEventListener("DOMNodeInsertedIntoDocument",function(a){var b;if(!(b=this.parentNode.$int)){return;}if(this.$aml){this.$ext=this.$int=apf.insertHtmlNode(this.$aml.serialize?this.$aml:this.$aml.cloneNode(false),b);}else{this.$ext=this.$int=document.createElement(this.localName);if(this.getAttribute("type")){this.$int.setAttribute("type",this.getAttribute("type"));}b.appendChild(this.$int);}},true);}).call(apf.XhtmlInputElement.prototype=new apf.AmlElement());apf.xhtml.setElement("input",apf.XhtmlInputElement);apf.XhtmlBodyElement=function(b,a){this.$init(a||"body",apf.NODE_VISIBLE,b);};(function(){this.addEventListener("DOMNodeInsertedIntoDocument",function(a){if(!this.ownerDocument.body){this.ownerDocument.body=this;}this.$ext=this.$int=document.body;},true);}).call(apf.XhtmlBodyElement.prototype=new apf.AmlElement());apf.xhtml.setElement("body",apf.XhtmlBodyElement);apf.XhtmlOptionElement=function(b,a){this.$init(a||"option",apf.NODE_VISIBLE,b);};(function(){this.addEventListener("DOMNodeInsertedIntoDocument",function(a){this.$ext=this.$int=this.parentNode.$int.appendChild(this.parentNode.$int.ownerDocument.createElement("option"));if(this.value){this.$int.setAttribute("value",this.value);}},true);}).call(apf.XhtmlOptionElement.prototype=new apf.AmlElement());apf.xhtml.setElement("option",apf.XhtmlOptionElement);apf.XhtmlHtmlElement=function(b,a){this.$init(a||"html",apf.NODE_VISIBLE,b);this.$int=document.body;this.$tabList=[];this.$focussable=apf.KEYBOARD;this.focussable=true;this.visible=true;this.$isWindowContainer=true;this.focus=function(){this.dispatchEvent("focus");};this.blur=function(){this.dispatchEvent("blur");};apf.window.$addFocus(this);this.addEventListener("DOMNodeInsertedIntoDocument",function(o){var k,j,r,g,q,d=this.attributes,m=this.ownerDocument;for(k=0,j=d.length;k<j;k++){r=(g=d[k]).nodeName.split(":");if(r[0]=="xmlns"){if(q=r[1]){m.$prefixes[q]=g.nodeValue;m.$namespaceURIs[g.nodeValue]=q;}else{m.namespaceURI=g.nodeValue;}}}if(!m.namespaceURI){m.namespaceURI=apf.ns.xhtml;}});};apf.XhtmlHtmlElement.prototype=new apf.XhtmlElement();apf.xhtml.setElement("html",apf.XhtmlHtmlElement);apf.XhtmlSkipChildrenElement=function(b,a){this.$init(a,apf.NODE_VISIBLE,b);};(function(){this.canHaveChildren=false;this.$redraw=function(){var a=this;apf.queue.add("redraw"+this.$uniqueId,function(){var c=a.$ext.parentNode;var b=a.$ext.nextSibling;c.removeChild(a.$ext);a.$ext=apf.insertHtmlNode(null,c,b,a.$aml?(a.$aml.serialize?a.$aml.serialize():a.$aml.xml):a.serialize());});};this.addEventListener("DOMNodeInsertedIntoDocument",function(a){var b;if(!(b=this.parentNode.$int)){return;}this.$ext=apf.insertHtmlNode(null,b,null,this.$aml?(this.$aml.serialize?this.$aml.serialize():this.$aml.xml):this.serialize());},true);}).call(apf.XhtmlSkipChildrenElement.prototype=new apf.AmlElement());apf.xhtml.setElement("object",apf.XhtmlSkipChildrenElement);apf.xhtml.setElement("embed",apf.XhtmlSkipChildrenElement);apf.xhtml.setElement("table",apf.XhtmlSkipChildrenElement);apf.xhtml.setElement("pre",apf.XhtmlSkipChildrenElement);apf.xsd=new apf.AmlNamespace();apf.setNamespace("http://www.w3.org/2001/XMLSchema",apf.xsd);apf.xsd.typeHandlers={"http://www.w3.org/2001/XMLSchema":{dateTime:function(b){b=b.replace(/-/g,"/");b.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2}):(\d{2})$/);if(!RegExp.$3||RegExp.$3.length<4){return false;}var a=new Date(b);if(a.getFullYear()!=parseFloat(RegExp.$3)){return false;}if(a.getMonth()!=parseFloat(RegExp.$2)-1){return false;}if(a.getDate()!=parseFloat(RegExp.$1)){return false;}if(a.getHours()!=parseFloat(RegExp.$4)){return false;}if(a.getMinutes()!=parseFloat(RegExp.$5)){return false;}if(a.getSeconds()!=parseFloat(RegExp.$5)){return false;}return true;},time:function(b){b.match(/^(\d{2}):(\d{2}):(\d{2})$/);var a=new Date("21/06/1980 "+b);if(a.getHours()!=parseFloat(RegExp.$1)){return false;}if(a.getMinutes()!=parseFloat(RegExp.$2)){return false;}if(a.getSeconds()!=parseFloat(RegExp.$3)){return false;}return true;},date:function(b){b=b.replace(/-/g,"/");b.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!RegExp.$3||RegExp.$3.length<4){return false;}var a=new Date(RegExp.$2+"/"+RegExp.$1+"/"+RegExp.$3);if(a.getFullYear()!=parseFloat(RegExp.$3)){return false;}if(a.getMonth()!=parseFloat(RegExp.$2)-1){return false;}if(a.getDate()!=parseFloat(RegExp.$1)){return false;}return true;},gYearMonth:function(b){b=b.replace(/-/g,"/");b.match(/^\/?(\d{4})(?:\d\d)?\/(\d{2})(?:\w|[\+\-]\d{2}:\d{2})?$/);if(!RegExp.$1||RegExp.$1.length<4){return false;}var a=new Date(b);if(a.getFullYear()!=parseFloat(RegExp.$)){return false;}if(a.getMonth()!=parseFloat(RegExp.$2)-1){return false;}return true;},gYear:function(b){b.match(/^\/?(\d{4})(?:\d\d)?(?:\w|[\+\-]\d{2}:\d{2})?$/);if(!RegExp.$1||RegExp.$1.length<4){return false;}var a=new Date(b);if(a.getFullYear()!=parseFloat(RegExp.$1)){return false;}return true;},gMonthDay:function(b){b=b.replace(/-/g,"/");b.match(/^\/\/(\d{2})\/(\d{2})(?:\w|[\+\-]\d{2}:\d{2})?$/);var a=new Date(b);if(a.getMonth()!=parseFloat(RegExp.$1)-1){return false;}if(a.getDate()!=parseFloat(RegExp.$2)){return false;}return true;},gDay:function(b){b=b.replace(/-/g,"/");b.match(/^\/{3}(\d{2})(?:\w|[\+\-]\d{2}:\d{2})?$/);var a=new Date(b);if(a.getDate()!=parseFloat(RegExp.$1)){return false;}return true;},gMonth:function(b){b=b.replace(/-/g,"/");b.match(/^\/{2}(\d{2})(?:\w|[\+\-]\d{2}:\d{2})?$/);var a=new Date(b);if(a.getMonth()!=parseFloat(RegExp.$1)-1){return false;}return true;},string:function(a){return typeof a=="string";},"boolean":function(a){return/^(true|false)$/i.test(a);},base64Binary:function(a){return true;},hexBinary:function(a){return/^(?:0x|x|#)?[A-F0-9]{0,8}$/i.test(a);},"float":function(a){return parseFloat(a)==a;},decimal:function(a){return/^[0-9\.\-,]+$/.test(a);},"double":function(a){return parseFloat(a)==a;},anyURI:function(a){return/^(?:\w+:\/\/)?(?:(?:[\w\-]+\.)+(?:[a-z]+)|(?:(?:1?\d?\d?|2[0-4]9|25[0-5])\.){3}(?:1?\d\d|2[0-4]9|25[0-5]))(?:\:\d+)?(?:\/([^\s\\\%]+|%[\da-f]{2})*)?$/i.test(a);},QName:function(a){return true;},normalizedString:function(a){return true;},token:function(a){return true;},language:function(a){return true;},Name:function(a){return true;},NCName:function(a){return true;},ID:function(a){return true;},IDREF:function(a){return true;},IDREFS:function(a){return true;},NMTOKEN:function(a){return true;},NMTOKENS:function(a){return true;},integer:function(a){return parseInt(a)==a;},nonPositiveInteger:function(a){return parseInt(a)==a&&a<=0;},negativeInteger:function(a){return parseInt(a)==a&&a<0;},"long":function(a){return parseInt(a)==a&&a>=-2147483648&&a<=2147483647;},"int":function(a){return parseInt(a)==a;},"short":function(a){return parseInt(a)==a&&a>=-32768&&a<=32767;},"byte":function(a){return parseInt(a)==a&&a>=-128&&a<=127;},nonNegativeInteger:function(a){return parseInt(a)==a&&a>=0;},unsignedLong:function(a){return parseInt(a)==a&&a>=0&&a<=4294967295;},unsignedInt:function(a){return parseInt(a)==a&&a>=0;},unsignedShort:function(a){return parseInt(a)==a&&a>=0&&a<=65535;},unsignedByte:function(a){return parseInt(a)==a&&a>=0&&a<=255;},positiveInteger:function(a){return parseInt(a)==a&&a>0;}},"http://ajax.org/2005/aml":{url:function(a){return/\b(https?|ftp):\/\/([\-A-Z0-9.]+)(\/[\-A-Z0-9+&@#\/%=~_|!:,.;]*)?(\?[\-A-Z0-9+&@#\/%=~_|!:,.;]*)?/i.test(a.trim());},website:function(a){return/^(?:http:\/\/)?([\w-]+\.)+\w{2,4}$/.test(a.trim());},email:function(a){return/^[A-Z0-9\.\_\%\-]+@(?:[A-Z0-9\-]+\.)+[A-Z]{2,4}$/i.test(a.trim());},creditcard:function(d){d=d.replace(/ /g,"");d=d.pad(21,"0",apf.PAD_LEFT);for(var c=0,b,a=d.length;a>=0;a--){b=d.substr(a,1)*(a%2+1);c+=b>9?b-9:b;}return c%10===0;},expdate:function(b){b=b.replace(/-/g,"/");b=b.split("/");var a=new Date(b[0]+"/01/"+b[1]);if(a.getYear()!=parseFloat(b[1])){return false;}if(a.getMonth()!=parseFloat(b[0])-1){return false;}return true;},wechars:function(a){return/^[0-9A-Za-z\xC0-\xCF\xD1-\xD6\xD8-\xDD\xDF-\xF6\xF8-\xFF -\.',]+$/.test(a);},phonenumber:function(a){return/^[\d\+\- \(\)]+$/.test(a);},faxnumber:function(a){return/^[\d\+\- \(\)]+$/.test(a);},mobile:function(a){return/^[\d\+\- \(\)]+$/.test(a);}}};apf.xsd.custumTypeHandlers={};apf.xsd.matchType=function(i,d){var a=d.split(":"),g=a[0],j=apf.document,b=j.$prefixes[g];d=a[1];if(g=="xsd"){b="http://www.w3.org/2001/XMLSchema";}if(!b){b=j.namespaceURI||apf.ns.xhtml;}var k=this.typeHandlers[b];if(k&&k[d]){return k[d](i);}throw new Error(apf.formatErrorString(0,null,"Validating XSD Type","Could not find type: "+d));return true;};apf.xsd.checkType=function(g,m){var l=typeof m=="object"?apf.queryValue(m):m;if(g.indexOf(":")>-1){var i=g.split(":"),b=i[0],a=i[1],k=apf.document,j=k.$prefixes[b];if(b=="xsd"){j="http://www.w3.org/2001/XMLSchema";}if(!j){j=k.namespaceURI||apf.ns.xhtml;}var d=this.typeHandlers[j];if(d&&d[a]){return d[a](l);}}if(this.custumTypeHandlers[g]){return this.custumTypeHandlers[g](l);}else{}};apf.html5=new apf.AmlNamespace();apf.setNamespace("",apf.html5);apf.HTML5INPUT={email:"textbox",url:"textbox",password:"textbox",datetime:"spinner",date:"calendar",month:"spinner",week:"spinner",time:"spinner",number:"spinner",range:"slider",checkbox:"checkbox",radio:"radiobutton",file:"upload",submit:"submit",image:"submit",reset:"button"};apf.xinclude=new apf.AmlNamespace();apf.setNamespace("http://www.w3.org/2001/XInclude",apf.xinclude);apf.XiFallback=function(b,a){this.$init(a||"fallback",apf.NODE_HIDDEN,b);};apf.XiFallback.prototype=new apf.AmlElement();apf.XiFallback.prototype.$parsePrio="002";apf.xinclude.setElement("fallback",apf.XiFallback);apf.aml.setElement("fallback",apf.XiFallback);apf.XiInclude=function(b,a){this.$init(a||"include",apf.NODE_HIDDEN,b);};apf.xinclude.setElement("include",apf.XiInclude);apf.aml.setElement("include",apf.XiInclude);(function(){this.$parsePrio="002";this.$propHandlers.href=this.$propHandlers.src=function(d){if(typeof d!="string"){return b.call(this,d);}this.$path=d.charAt(0)=="{"?d:apf.getAbsolutePath(apf.hostPath,d);var g=this.ownerDocument.$domParser;if(!this.defer){g.$shouldWait++;this.$parseContext=g.$parseContext||[this.parentNode];}c.call(this,this.$path);};function a(d){if(this.callback){this.callback({xmlNode:d,amlNode:this.parentNode});}this.parentNode.removeChild(this);}function b(j){var m=this.ownerDocument.$domParser;if(this.clear){this.parentNode.$int.innerHTML="";}if(j){m.parseFromXml(j,{doc:this.ownerDocument,amlNode:this.parentNode,beforeNode:this,include:true});if(!this.defer){var l=(this.$parseContext[1]||(this.$parseContext[1]={})),g=l.callback,d=this;l.callback=function(){a.call(d,j);if(g){g.call(d.ownerDocument);}};if(m.$continueParsing.apply(m,this.$parseContext)===false){var k=(m.$parseContext[1]||(m.$parseContext[1]={})),i=l.callback;k.callback=function(){if(g){g.call(d.ownerDocument);}m.$continueParsing.apply(m,d.$parseContext);};}}else{a.call(this,j);}}else{if(!this.defer){m.$continueParsing.apply(m,this.$parseContext);}a.call(this,j);}}function c(g){var d=this;apf.getData(g,apf.extend(this.options||{},{callback:function(l,k,i){if(k!=apf.SUCCESS){var m=new Error(apf.formatErrorString(1007,d,"Loading Includes","Could not load Include file '"+(g||d.src)+"'\nReason: "+i.message));if(i.tpModule.retryTimeout(i,k,null,m)===true){return true;}apf.console.error(m.message);b.call(d,null);return;}l=l.replace(/\<\!DOCTYPE[^>]*>/,"").replace(/^[\r\n\s]*/,"");if(!apf.supportNamespaces){l=l.replace(/xmlns\=\"[^"]*\"/g,"");}if(l.indexOf("<a:application")==-1){l="<a:application xmlns:a='"+apf.ns.aml+"'>"+l+"</a:application>";}var j=apf.getXml(l,null,true);if(!j){throw new Error(apf.formatErrorString(0,null,"Loading include","Could not parse include file. Maybe the file does not exist?",j));}j.setAttribute("filename",i.url);b.call(d,j);},async:true,ignoreOffline:true}));}}).call(apf.XiInclude.prototype=new apf.AmlElement());apf.__ANCHORING__=1<<13;apf.Anchoring=function(){this.$regbase=this.$regbase|apf.__ANCHORING__;this.$anchors=[];var i=1;var c=2;this.$updateQueue=0;this.$inited=this.$parsed=this.$anchoringEnabled=false;this.$hordiff=this.$verdiff=0;this.$rule_v=this.$rule_h=this.$rule_header="";var d=apf.layout;this.$supportedProperties.push("anchors");var b={right:function(l,n){if(!this.$anchoringEnabled&&!this.$setLayout("anchoring")){return;}if(!l){this.$ext.style[n]="";}if(!this.$updateQueue){d.queue(this.$pHtmlNode,this);}this.$updateQueue=this.$updateQueue|c;},bottom:function(l,n){if(!this.$anchoringEnabled&&!this.$setLayout("anchoring")){return;}if(!l){this.$ext.style[n]="";}if(!this.$updateQueue){d.queue(this.$pHtmlNode,this);}this.$updateQueue=this.$updateQueue|i;}};b.left=b.width=b.right;b.top=b.height=b.bottom;this.$propHandlers.anchors=function(l){this.$anchors=l?l.splitSafe("(?:, *| )"):[];if(!this.$anchoringEnabled&&!this.$setLayout("anchoring")){return;}if(!this.$updateQueue&&apf.loaded){d.queue(this.$pHtmlNode,this);}this.$updateQueue=this.$updateQueue|c|i;};this.$disableAnchoring=function(l){if(!this.$inited||!this.$anchoringEnabled||!this.$pHtmlNode){return;}d.removeRule(this.$pHtmlNode,this.$uniqueId+"_anchors");if(d.queue){d.queue(this.$pHtmlNode);}for(var n in b){delete this.$propHandlers[n];}this.removeEventListener("DOMNodeRemoved",j);this.removeEventListener("DOMNodeInserted",a);if(this.right){this.$ext.style.left=this.$ext.offsetLeft;}if(this.bottom){this.$ext.style.top=this.$ext.offsetTop;}this.removeEventListener("prop.visible",g);this.$inited=false;this.$anchoringEnabled=false;};this.$enableAnchoring=function(){if(this.$inited){return;}apf.extend(this.$propHandlers,b);this.addEventListener("DOMNodeRemoved",j);this.addEventListener("DOMNodeInserted",a);this.addEventListener("prop.visible",g);this.$updateQueue=0|((this.left||this.width||this.right||this.anchors)&&c)|((this.top||this.height||this.bottom||this.anchors)&&i);if(this.$updateQueue){d.queue(this.$pHtmlNode,this);}this.$inited=true;this.$anchoringEnabled=true;};function g(l){if(!(this.$rule_header||this.$rule_v||this.$rule_h)){return;}if(l.value){if(this.$rule_v||this.$rule_h){var n=this.$rule_header+"\n"+this.$rule_v+"\n"+this.$rule_h;d.setRules(this.$pHtmlNode,this.$uniqueId+"_anchors",n);d.queue(this.$pHtmlNode,this);}d.processQueue();}else{d.removeRule(this.$pHtmlNode,this.$uniqueId+"_anchors");d.queue(this.$pHtmlNode);}}function j(l){if(l&&(l.$doOnlyAdmin||l.currentTarget==this)){return;}if(d.queue&&this.$pHtmlNode){d.removeRule(this.$pHtmlNode,this.$uniqueId+"_anchors");d.queue(this.$pHtmlNode);}}function a(l){if(!this.$amlLoaded||l.currentTarget!=this){return;}if(!l.$moveWithinParent&&this.$parsed){this.$moveAnchoringRules(l.$oldParentHtmlNode);}}this.$moveAnchoringRules=function(l,n){var o=l&&d.removeRule(l,this.$uniqueId+"_anchors");if(o){d.queue(l);}if(!this.$rule_v&&!this.$rule_h){return;}this.$rule_header=m.call(this);o=this.$rule_header+"\n"+this.$rule_v+"\n"+this.$rule_h;this.$ext.style.display="none";d.setRules(this.$pHtmlNode,this.$uniqueId+"_anchors",o);d.queue(this.$pHtmlNode,this);};this.$hasAnchorRules=function(){return this.$rule_v||this.$rule_h?true:false;};function m(){return"try{            var oHtml = "+(apf.hasHtmlIdsInJs?this.$ext.getAttribute("id"):"document.getElementById('"+this.$ext.getAttribute("id")+"')")+";                        var pWidth = "+(this.$pHtmlNode==this.$pHtmlDoc.body?"apf.getWindowWidth()":"oHtml.parentNode.offsetWidth")+";                        var pHeight = "+(this.$pHtmlNode==this.$pHtmlDoc.body?"apf.getWindowHeight()":"oHtml.parentNode.offsetHeight")+";            }catch(e){            }";}function k(n,l){return String(n).replace(apf.percentageMatch,"(("+l+" * $1)/100)");}this.$recalcAnchoring=function(l){var n=apf.getDiff(this.$ext);this.$hordiff=n[0];this.$verdiff=n[1];this.$updateQueue=this.$updateQueue|c|i;this.$updateLayout();d.queue(this.$pHtmlNode,this);if(!l){d.processQueue();}};this.$updateLayout=function(){if(!this.$ext.offsetHeight&&!this.$ext.offsetWidth){var s=this;var q=function(A,z,B){if(s.$updateQueue&&apf.isTrue(B)&&(s.$ext.offsetWidth||s.$ext.offsetHeight)){s.$updateLayout();apf.layout.activateRules(s.$ext.parentNode);var C=s;while(C){C.unwatch("visible",q);C=C.parentNode;}s.$isWaitingOnDisplay=false;}};this.$isWaitingOnDisplay=true;this.watch("visible",q);var n=this.parentNode;while(n){n.watch("visible",q);n=n.parentNode;}return;}if(!this.$parsed){if(!this.$ext.getAttribute("id")){apf.setUniqueHtmlId(this.$ext);}var u=apf.getDiff(this.$ext);this.$hordiff=u[0];this.$verdiff=u[1];if(this.$getOption){this.$minheight=Math.max(parseInt(this.$getOption("main","minheight"))||0,parseInt(this.getAttribute("minheight"))||0)||0;this.$maxheight=Math.min(parseInt(this.$getOption("main","maxheight"))||0,parseInt(this.getAttribute("maxheight"))||100000)||100000;this.$minwidth=Math.max(parseInt(this.$getOption("main","minwidth"))||0,parseInt(this.getAttribute("minwidth"))||0)||0;this.$maxwidth=Math.min(parseInt(this.$getOption("main","maxwidth"))||0,parseInt(this.getAttribute("maxwidth"))||100000)||100000;}else{this.$minheight=0;this.$maxheight=100000;this.$minwidth=0;this.$maxwidth=100000;}this.$rule_header=m.call(this);this.$parsed=true;}if(!this.$updateQueue){if(this.visible){this.$ext.style.display="";}return;}if(this.draggable=="relative"){if("absolute|fixed|relative".indexOf(apf.getStyle(this.$ext,"position"))==-1){this.$ext.style.position="absolute";}}else{if(this.left||this.top||this.right||this.bottom||this.$anchors.length){if("absolute|fixed".indexOf(apf.getStyle(this.$ext,"position"))==-1){this.$ext.style.position="absolute";}}}var y;if(this.$updateQueue&c){y=[];var r=this.left||this.$anchors[3],w=this.right||this.$anchors[1],o=this.width;if(w&&typeof w=="string"){w=k(w,"pWidth");}if(r){if(parseInt(r)!=r){r=k(r,"pWidth");y.push("oHtml.style.left = ("+r+") + 'px'");}else{this.$ext.style.left=r+"px";}}if(!r&&w){if(parseInt(w)!=w){w=k(w,"pWidth");y.push("oHtml.style.right = ("+w+") + 'px'");}else{this.$ext.style.right=w+"px";}}if(o){if(parseInt(o)!=o){o=k(o,"pWidth");y.push("oHtml.style.width = Math.max("+this.$minwidth+", Math.min("+this.$maxwidth+", "+o+" - "+this.$hordiff+")) + 'px'");}else{this.$ext.style.width=(o>this.$hordiff+this.$minwidth?(o<this.$hordiff+this.$maxwidth?o-this.$hordiff:this.$maxwidth):this.$minwidth)+"px";}}if(w!=null&&r!=null){y.push("oHtml.style.width = (pWidth - ("+w+") - ("+r+") - "+this.$hordiff+") + 'px'");}this.$rule_h=(y.length?"try{"+y.join(";}catch(e){};try{")+";}catch(e){};":"");}if(this.$updateQueue&i){y=[];var t=this.top||this.$anchors[0],l=this.bottom||this.$anchors[2],x=this.height;if(l&&typeof l=="string"){l=k(l,"pHeight");}if(t){if(parseInt(t)!=t){t=k(t,"pHeight");y.push("oHtml.style.top = ("+t+") + 'px'");}else{this.$ext.style.top=t+"px";}}if(!t&&l){if(parseInt(l)!=l){y.push("oHtml.style.bottom = ("+l+") + 'px'");}else{this.$ext.style.bottom=l+"px";}}if(x){if(parseInt(x)!=x){x=k(x,"pHeight");y.push("oHtml.style.height = Math.max("+this.$minheight+", Math.min("+this.$maxheight+", "+x+" - "+this.$verdiff+")) + 'px'");}else{this.$ext.style.height=(x>this.$verdiff+this.$minheight?(x<this.$verdiff+this.$maxheight?x-this.$verdiff:this.$maxheight):this.$minheight)+"px";}}if(l!=null&&t!=null){y.push("oHtml.style.height = (pHeight - ("+l+") - ("+t+") - "+this.$verdiff+") + 'px'");}this.$rule_v=(y.length?"try{"+y.join(";}catch(e){};try{")+";}catch(e){};":"");}if(this.$rule_v||this.$rule_h){d.setRules(this.$pHtmlNode,this.$uniqueId+"_anchors",this.$rule_header+"\n"+this.$rule_v+"\n"+this.$rule_h,true);}else{d.removeRule(this.$pHtmlNode,this.$uniqueId+"_anchors");}this.$updateQueue=0;};this.addEventListener("DOMNodeInsertedIntoDocument",function(l){});this.addEventListener("DOMNodeRemovedFromDocument",function(l){this.$disableAnchoring();});};apf.__ALIGNMENT__=1<<12;apf.Alignment=function(){this.$regbase=this.$regbase|apf.__ALIGNMENT__;var l=apf.layout;if(typeof this.dock=="undefined"){this.dock=false;}if(typeof this.dockable=="undefined"){this.dockable=false;}this.$booleanProperties.dock=true;this.$booleanProperties.dockable=true;this.$supportedProperties.push("dock","dockable","align","lean","edge","weight","splitter","minwidth","minheight");this.$disableAlignment=function(purge){if(!this.aData||!this.$alignmentEnabled){return;}for(var prop in propHandlers){delete this.$propHandlers[prop];}this.removeEventListener("DOMNodeRemoved",remove);this.removeEventListener("DOMNodeInserted",reparent);this.removeEventListener("prop.visible",visibleHandler);remove.call(this);};this.$enableAlignment=function(purge){this.$alignmentEnabled=true;var buildParent="vbox|hbox".indexOf(this.parentNode.tagName)==-1&&!this.parentNode.pData;apf.extend(this.$propHandlers,propHandlers);this.addEventListener("DOMNodeRemoved",remove);this.addEventListener("DOMNodeInserted",reparent);this.addEventListener("prop.visible",visibleHandler);var layout=l.get(this.$pHtmlNode,buildParent?apf.getBox(this.parentNode.margin||this.$pHtmlNode.getAttribute("margin")||""):null);if(buildParent){this.parentNode.pData=l.parseXml(this.parentNode||apf.getXml("<vbox />"),layout,"vbox",true);layout.root=this.parentNode.pData;}if(!this.aData){this.aData=l.parseXml(this,layout,this,true);}if(this.align){l.addAlignNode(this,layout.root);if(this.aData.hidden||this.visible===false){this.aData.prehide(true);}this.$purgeAlignment();}else{var pData=this.parentNode.aData||this.parentNode.pData;this.aData.stackId=pData.children.push(this.aData)-1;this.aData.parent=pData;}};function visibleHandler(e){if(!this.aData){return;}if(!this.aData.hidden==e.value){return;}if(e.value){if(this.aData.preshow()!==false){this.$ext.style.display="none";}this.$purgeAlignment();}else{this.$ext.style.display="block";this.aData.prehide();this.$purgeAlignment();}apf.layout.processQueue();}this.$purgeAlignment=function(){var layout=l.get(this.$pHtmlNode);if(this.$ext&&this.$ext.style.display=="block"&&!this.$ext.offsetHeight&&!this.$ext.offsetWidth){var _self=this;var propChange=function(name,old,value){if(_self.$ext.offsetWidth||_self.$ext.offsetHeight){l.queue(_self.$pHtmlNode,null,layout.root);var p=_self;while(p){p.unwatch("visible",propChange);p=p.parentNode;}_self.$isWaitingOnDisplay=false;}};this.$isWaitingOnDisplay=true;this.watch("visible",propChange);var p=this.parentNode;while(p){p.watch("visible",propChange);p=p.parentNode;}return;}l.queue(this.$pHtmlNode,null,layout.root);};function remove(e){if(e&&(e.$doOnlyAdmin||e.currentTarget!=this)){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;}if(this.$ext){this.$ext.style.display="none";}}}function reparent(e){if(!this.$amlLoaded||e.currentTarget!=this){return;}if(!e.$moveWithinParent&&this.aData&&this.aData.pHtml!=this.$pHtmlNode){this.aData.pHtml=this.$pHtmlNode;this.$enableAlignment();}}var propHandlers={align:function(value){this.aData.remove();this.aData.template=value;this.splitter=undefined;this.aData.edgeMargin=this.edge||0;this.$enableAlignment();},lean:function(value){this.aData.isBottom=(value||"").indexOf("bottom")>-1;this.aData.isRight=(value||"").indexOf("right")>-1;this.$purgeAlignment();},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();},weight:function(value){this.aData.weight=parseFloat(value);this.$purgeAlignment();},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();},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();},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();},minwidth:function(value){this.aData.minwidth=value;this.$purgeAlignment();},minheight:function(value){this.aData.minheight=value;this.$purgeAlignment();}};this.addEventListener("DOMNodeRemovedFromDocument",function(e){this.$disableAlignment();this.aData=null;});};apf.__CONTENTEDITABLE__=1<<24;apf.__GUIELEMENT__=1<<15;apf.__VALIDATION__=1<<6;apf.GuiElement=function(){this.$init(true);};(function(){this.$regbase=this.$regbase|apf.__GUIELEMENT__;this.$focussable=apf.KEYBOARD_MOUSE;this.visible=true;this.$booleanProperties["disable-keyboard"]=true;this.$booleanProperties.visible=true;this.$booleanProperties.focussable=true;this.$supportedProperties.push("draggable","resizable");this.$supportedProperties.push("focussable","zindex","disabled","tabindex","disable-keyboard","contextmenu","visible","autosize","loadaml","actiontracker","alias","width","left","top","height","tooltip");this.$setLayout=function(b){if(!this.$drawn||!this.$pHtmlNode){return false;}if(this.parentNode){if(this.parentNode.localName=="table"){this.parentNode.register(this);this.$disableCurrentLayout=null;return b=="table";}}if(!this.$anchoringEnabled){if(this.$disableCurrentLayout){this.$disableCurrentLayout();}this.$enableAnchoring();this.$disableCurrentLayout=this.$disableAnchoring;}return b=="anchoring";};this.implement(apf.Anchoring,apf.Alignment);this.setWidth=function(b){this.setProperty("width",b,false,true);return this;};this.setHeight=function(b){this.setProperty("height",b,false,true);return this;};this.setLeft=function(b){this.setProperty("left",b,false,true);return this;};this.setTop=function(b){this.setProperty("top",b,false,true);return this;};if(!this.show){this.show=function(){this.setProperty("visible",true,false,true);return this;};}if(!this.hide){this.hide=function(){this.setProperty("visible",false,false,true);return this;};}this.getWidth=function(){return(this.$ext||{}).offsetWidth;};this.getHeight=function(){return(this.$ext||{}).offsetHeight;};this.getLeft=function(){return(this.$ext||{}).offsetLeft;};this.getTop=function(){return(this.$ext||{}).offsetTop;};this.enable=function(){this.setProperty("disabled",false,false,true);return this;};this.disable=function(){this.setProperty("disabled",true,false,true);return this;};this.sendToBack=function(){this.setProperty("zindex",0,false,true);return this;};this.bringToFront=function(){this.setProperty("zindex",apf.all.length+1,false,true);return this;};this.sendBackwards=function(){this.setProperty("zindex",this.zindex-1,false,true);return this;};this.bringForward=function(){this.setProperty("zindex",this.zindex+1,false,true);return this;};this.hasFocus=function(){};this.addEventListener("DOMNodeInsertedIntoDocument",function(c){var b=this.$aml;if(this.parentNode){if(this.localName=="item"&&this.parentNode.hasFeature(apf.__MULTISELECT__)){this.$pHtmlNode=this.parentNode.$container;}else{this.$pHtmlNode=this.parentNode.$int;}}if(!this.$pHtmlNode){return;}this.$pHtmlDoc=this.$pHtmlNode.ownerDocument||document;if(this.$initSkin){this.$initSkin(b);}if(this.$draw){this.$draw();}if(c.id){this.$ext.setAttribute("id",c.id);}if(typeof this.visible=="undefined"){this.visible=true;}if(this.$focussable&&typeof this.focussable=="undefined"){apf.GuiElement.propHandlers.focussable.call(this);}this.$drawn=true;},true);this.addEventListener("DOMNodeInsertedIntoDocument",function(b){if(!this.$pHtmlNode){return;}this.$setLayout();if(this.$loadAml){this.$loadAml(this.$aml);}});var a;this.addEventListener("$event.resize",a=function(b){apf.layout.setRules(this.$ext,"resize","var o = apf.all["+this.$uniqueId+"];            if (o) o.dispatchEvent('resize');",true);apf.layout.queue(this.$ext);this.removeEventListener("$event.resize",a);});}).call(apf.GuiElement.prototype=new apf.AmlElement());apf.GuiElement.propHandlers={focussable:function(a){if(typeof a=="undefined"){this.focussable=true;}if(!this.hasFeature(apf.__FOCUSSABLE__)){this.implement(apf.Focussable);}if(this.focussable){apf.window.$addFocus(this,this.tabindex);}else{apf.window.$removeFocus(this);}},zindex:function(a){this.$ext.style.zIndex=a;},visible:function(a){if(apf.isFalse(a)||typeof a=="undefined"){this.$ext.style.display="none";if(apf.document.activeElement==this||this.canHaveChildren&&apf.isChildOf(this,apf.document.activeElement,false)){if(apf.config.allowBlur&&this.hasFeature(apf.__FOCUSSABLE__)){this.blur();}else{apf.window.moveNext();}}this.visible=false;}else{this.$ext.style.display="block";if(apf.layout&&this.$int){apf.layout.forceResize(this.$int);}this.visible=true;}},disabled:function(j){if(!this.$drawn){var a=this;this.disabled=false;apf.queue.add("disable"+this.$uniqueId,function(i){a.disabled=j;apf.GuiElement.propHandlers.disabled.call(a,j);});return;}if(this.canHaveChildren){if(j!=-1){j=this.disabled=apf.isTrue(j);}var c=this.childNodes;for(var g,d=0,b=c.length;d<b;d++){g=c[d];if(g.nodeFunc==apf.NODE_VISIBLE){if(j&&g.disabled!=-1){g.$disabled=g.disabled||false;}g.setProperty("disabled",j?-1:false);}}if(this.$isWindowContainer){return;}}if(j==-1||j==false){}else{if(typeof this.$disabled=="boolean"){if(j===null){j=this.$disabled;this.$disabled=null;}else{this.$disabled=j||false;return;}}}if(apf.isTrue(j)||j==-1){this.disabled=false;if(apf.document.activeElement==this){apf.window.moveNext(true);if(apf.document.activeElement==this){this.$blur();}}if(this.hasFeature(apf.__PRESENTATION__)){this.$setStyleClass(this.$ext,this.$baseCSSname+"Disabled");}if(this.$disable){this.$disable();}this.disabled=j;}else{if(this.hasFeature(apf.__DATABINDING__)&&apf.config.autoDisable&&!(!this.$bindings||this.xmlRoot)){return false;}this.disabled=false;if(apf.document.activeElement==this){this.$focus();}if(this.hasFeature(apf.__PRESENTATION__)){this.$setStyleClass(this.$ext,null,[this.$baseCSSname+"Disabled"]);}if(this.$enable){this.$enable();}}},enabled:function(a){this.setProperty("disabled",!a);},"disable-keyboard":function(a){this.disableKeyboard=apf.isTrue(a);},tooltip:function(a){this.$ext.setAttribute("title",a);},actiontracker:function(a){if(!a){this.$at=null;}else{if(a.tagName=="actiontracker"){this.$at=a;}else{this.$at=typeof a=="string"&&self[a]?apf.nameserver.get("actiontracker",a)||self[a].getActionTracker():apf.setReference(a,apf.nameserver.register("actiontracker",a,new apf.actiontracker()));if(!this.$at.name){this.$at.name=a;}}}},aml:function(a){this.insertMarkup(a);}};apf.__PRESENTATION__=1<<9;apf.Presentation=function(){this.$init(true);};(function(){this.$regbase=this.$regbase|apf.__PRESENTATION__;this.$supportedProperties.push("skin");this.$propHandlers.skinset=this.$propHandlers.skin=function(g){if(!this.$amlLoaded){return;}if(!this.$skinTimer){var d=this;clearTimeout(this.$skinTimer);this.$skinTimer=$setTimeout(function(){a.call(d,g);delete d.$skinTimer;});}};this.$propHandlers.style=function(d){if(!this.styleAttrIsObj&&this.$amlLoaded){this.$ext.setAttribute("style",d);}};var b;this.$propHandlers["class"]=function(d){this.$setStyleClass(this.$ext,d,[b||""]);};this.$forceSkinChange=function(g,d){a.call(this,g,d);};function a(A,j){clearTimeout(this.$skinTimer);if(this.selectable){var q=this.getSelection();}var o=this.$ext,u=this.$int,y=o.nextSibling,k=this.$ext.getAttribute("id"),m=this.$baseCSSname;if(o.parentNode){o.parentNode.removeChild(o);}if(this.$destroy){this.$destroy(true);}this.skin=A;this.$loadSkin(j?j+":"+A:null);if(this.$draw){this.$draw(true);}if(k){this.$ext.setAttribute("id",k);}if(y){this.$ext.parentNode.insertBefore(this.$ext,y);}var t,s,w=[],r=(o.className||"").splitSafe("s+");for(t=0;t<r;t++){if(r[t]&&r[t]!=m){w.push(r[t].replace(m,this.$baseCSSname));}}apf.setStyleClass(this.$ext,w.join(" "));var g,x=apf.skins.events;for(t=0,s=x.length;t<s;t++){g=x[t];if(typeof o[g]=="function"&&!this.$ext[g]){this.$ext[g]=o[g];}}this.$ext.style.left=o.style.left;this.$ext.style.top=o.style.top;this.$ext.style.width=o.style.width;this.$ext.style.height=o.style.height;this.$ext.style.right=o.style.right;this.$ext.style.bottom=o.style.bottom;this.$ext.style.zIndex=o.style.zIndex;this.$ext.style.position=o.style.position;this.$ext.style.display=o.style.display;if(this.$loadAml){this.$loadAml(this.$aml);}if(this.$int&&this.$int!=u){var n,z=this.$int,d=u.childNodes;for(var t=d.length-1;t>=0;t--){if((n=d[t]).host){n.host.$pHtmlNode=z;if(n.host.$isLeechingSkin){c.call(n.host);}}z.insertBefore(n,z.firstChild);}this.$int.onresize=u.onresize;}if(this.hasFeature(apf.__DRAGDROP__)){if(document.elementFromPointAdd){document.elementFromPointRemove(o);document.elementFromPointAdd(this.$ext);}}if(this.disabled){this.$disable();}if(this.$focussable&&apf.document.activeElement==this){this.$focus();}if(this.hasFeature(apf.__DATABINDING__)&&this.xmlRoot){this.reload();}else{if(this.value){this.$propHandlers.value.call(this,this.value);}}this.dispatchEvent("$skinchange");if(this.hasFeature(apf.__MULTISELECT__)){if(this.selectable){this.selectList(q,true);}}if(this.hasFeature(apf.__ANCHORING__)){this.$recalcAnchoring();}if(this.hasFeature(apf.__ALIGNMENT__)){if(this.aData){this.aData.oHtml=this.$ext;}if(this.pData){this.pData.oHtml=this.$ext;this.pData.pHtml=this.$int;var d=this.pData.childNodes;for(t=0;t<d.length;t++){d[t].pHtml=this.$int;}}}if(this.draggable&&this.$propHandlers.draggable){this.$propHandlers.draggable.call(this,this.draggable);}if(this.resizable&&this.$propHandlers.resizable){this.$propHandlers.resizable.call(this,this.resizable);}apf.layout.forceResize(this.$ext);}this.$setStyleClass=apf.setStyleClass;function c(l){if(!this.$amlLoaded||l&&(l.$moveWithinParent||l.currentTarget!=this)){return;}this.$setInheritedAttribute(this,"skinset");if(this.attributes.getNamedItem("skin")){return;}var d,i=this.parentNode,g;if((d=this.$canLeechSkin.dataType==apf.STRING?this.$canLeechSkin:this.localName)&&i.$originalNodes&&(g=i.$originalNodes[d])&&g.getAttribute("inherit")){var j=g.getAttribute("link");this.$isLeechingSkin=true;if(j){this.$forceSkinChange(j);}else{var k=i.skinName.split(":");this.$forceSkinChange(k[1],k[0]);}}else{if(this.$isLeechingSkin){delete this.kin;this.$forceSkinChange();}}}this.$initSkin=function(d){if(this.$canLeechSkin){this.addEventListener("DOMNodeInserted",c);}if(!this.skin){this.skin=this.getAttribute("skin");}var g,j=this.parentNode,i;if(this.$canLeechSkin&&!this.skin&&(g=this.$canLeechSkin.dataType==apf.STRING?this.$canLeechSkin:this.localName)&&j.$originalNodes&&(i=j.$originalNodes[g])&&i.getAttribute("inherit")){var k=i.getAttribute("link");this.$isLeechingSkin=true;if(k){this.skin=k;this.$loadSkin();}else{this.$loadSkin(j.skinName);}}else{if(!this.skinset){this.skinset=this.getAttribute("skinset");}this.$loadSkin(null,this.$canLeechSkin);}};this.$loadSkin=function(i,g){this.baseSkin=i||(this.skinset||this.$setInheritedAttribute("skinset"))+":"+(this.skin||this.localName);clearTimeout(this.$skinTimer);if(this.skinName){this.$blur();this.$baseCSSname=null;}this.skinName=this.baseSkin;this.$pNodes={};this.$originalNodes=apf.skins.getTemplate(this.skinName,true);if(!this.$originalNodes){var j=this.skin;if(j){var d=this.skinName.split(":")[0];this.baseName=this.skinName="default:"+j;this.$originalNodes=apf.skins.getTemplate(this.skinName);if(!this.$originalNodes&&d!="default"){this.baseName=this.skinName=d+":"+this.localName;this.$originalNodes=apf.skins.getTemplate(this.skinName,true);}}if(!this.$originalNodes){this.baseName=this.skinName="default:"+this.localName;this.$originalNodes=apf.skins.getTemplate(this.skinName);}if(!this.$originalNodes){if(g){return(this.baseName=this.skinName=this.originalNode=null);}throw new Error(apf.formatErrorString(1077,this,"Presentation","Could not load skin: "+this.baseSkin));}}if(this.$originalNodes){apf.skins.setSkinPaths(this.skinName,this);}};this.$getNewContext=function(g,d){this.$pNodes[g]=this.$originalNodes[g].cloneNode(true);};this.$hasLayoutNode=function(d){return this.$originalNodes[d]?true:false;};this.$getLayoutNode=function(d,j,i){var g=this.$pNodes[d]||this.$originalNodes[d];if(!g){return false;}if(!j){return apf.getFirstElement(g);}var k=g.selectSingleNode("@"+j);if(!k){return null;}return(i?apf.queryNode(k.nodeValue,i):apf.getFirstElement(g).selectSingleNode(k.nodeValue));};this.$getOption=function(g,j){g=g.toLowerCase();var i=this.$pNodes[g]||this.$originalNodes[g];if(!j||!i){return i;}var d=i.selectSingleNode("@"+j);return d?d.nodeValue:"";};this.$getExternal=function(d,g,j,k){if(!g){g=this.$pHtmlNode;}if(!d){d="main";}d=d.toLowerCase();this.$getNewContext(d);var l=this.$getLayoutNode(d);var i;if(i=(k||this).getAttributeNode("style")){l.setAttribute("style",i.nodeValue);}if(i=(k||this).getAttributeNode("class")){this.$setStyleClass(l,(b=i.nodeValue));}if(j){j.call(this,l);}l=apf.insertHtmlNode(l,g);l.host=this;if(i=(k||this).getAttributeNode("bgimage")){l.style.backgroundImage="url("+apf.getAbsolutePath(this.mediaPath,i.nodeValue)+")";}if(!this.$baseCSSname){this.$baseCSSname=l.className.trim().split(" ")[0];}return l;};this.$focus=function(){if(!this.$ext){return;}this.$setStyleClass(this.oFocus||this.$ext,this.$baseCSSname+"Focus");};this.$blur=function(){if(this.renaming){this.stopRename(null,true);}if(!this.$ext){return;}this.$setStyleClass(this.oFocus||this.$ext,"",[this.$baseCSSname+"Focus"]);};this.$fixScrollBug=function(){if(this.$int!=this.$ext){this.oFocus=this.$int;}else{this.oFocus=this.$int=this.$ext.appendChild(document.createElement("div"));this.$int.style.height="100%";this.$int.className="focusbug";}};}).call(apf.Presentation.prototype=new apf.GuiElement());apf.config.$inheritProperties.skinset=1;apf.__VALIDATION__=1<<6;apf.validator={macro:{datatype:"apf.xsd.matchType(value, '",datatype_:"')",pattern:"value.match(",pattern_:")",custom:"(",custom_:")",min:"parseInt(value) >= ",max:"parseInt(value) <= ",maxlength:"value.toString().length <= ",minlength:"value.toString().length >= ",notnull:"value.toString().length > 0",checkequal:"!(temp = ",checkequal_:").isValid() || temp.getValue() == value"},compile:function(b){var a=this.macro,c=["var temp, valid = true;             if (!validityState)                 validityState = new apf.validator.validityState(); "];if(b.required){c.push("if (checkRequired && (!value || value.toString().trim().length == 0)) {                validityState.$reset();                validityState.valueMissing = true;                valid = false;            }");}c.push("validityState.$reset();            if (value) {");for(prop in b){if(!a[prop]){continue;}c.push("if (!(",a[prop],b[prop],a[prop+"_"]||"",")){                validityState.$set('",prop,"');                valid = false;            }");}c.push("};validityState.valid = valid; return validityState;");return new Function("value","checkRequired","validityState",c.join(""));}};apf.validator.validityState=function(){this.valueMissing=false,this.typeMismatch=false,this.patternMismatch=false,this.tooLong=false,this.rangeUnderflow=false,this.rangeOverflow=false,this.stepMismatch=false,this.customError=false,this.valid=true,this.$reset=function(){for(var a in this){if(a.substr(0,1)=="$"){continue;}this[a]=false;}this.valid=true;},this.$set=function(a){switch(a){case"min":this.rangeUnderflow=true;break;case"max":this.rangeOverflow=true;break;case"minlength":this.tooShort=true;break;case"maxlength":this.tooLong=true;break;case"pattern":this.patternMismatch=true;break;case"datatype":this.typeMismatch=true;break;case"notnull":this.typeMismatch=true;break;case"checkequal":this.typeMismatch=true;break;}};};apf.Validation=function(){this.$regbase=this.$regbase|apf.__VALIDATION__;this.isValid=function(b){if(!this.$vOptions){return true;}(this.$vOptions.isValid||(this.$vOptions.isValid=apf.validator.compile(this.$vOptions))).call(this,typeof this.getValue=="function"?this.getValue(null,true):null,b,this.validityState||(this.validityState=new apf.validator.validityState()));var a=this.validityState.valid;if(!a){this.dispatchEvent("invalid",this.validityState);}return a;};this.setCustomValidity=function(a){};this.showMe=function(){var a=this.parentNode;while(a){if(a.show){a.show();}a=a.parentNode;}};this.checkValidity=this.validate=function(a,c,b){if(b||!this.isValid(!a)&&!c){this.setError();return false;}else{this.clearError();return true;}};this.setError=function(b){if(!this.$validgroup){this.$propHandlers.validgroup.call(this,"vg"+this.parentNode.$uniqueId);}var a=this.$validgroup.getErrorBox(this);if(!this.$validgroup.allowMultipleErrors){this.$validgroup.hideAllErrors();}a.setMessage(this.invalidmsg);apf.setStyleClass(this.$ext,this.$baseCSSname+"Error");this.showMe();a.display(this);if(this.hasFeature(apf.__MULTISELECT__)&&this.validityState.$errorXml){this.select(this.validityState.$errorXml);}if(apf.document.activeElement&&apf.document.activeElement!=this){this.focus(null,{mouse:true});}};this.clearError=function(b){if(this.$setStyleClass){this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Error"]);}if(this.$validgroup){var a=this.$validgroup.getErrorBox(null,true);if(!a||a.host!=this){return;}a.hide();}};this.addEventListener("DOMNodeRemovedFromDocument",function(a){if(this.$validgroup){this.$validgroup.unregister(this);}});this.addEventListener("DOMNodeInsertedIntoDocument",function(a){if(!this.validgroup){this.$setInheritedAttribute("validgroup");}});this.$attrExcludePropBind=apf.extend({pattern:1,validtest:3},this.$attrExcludePropBind);this.$booleanProperties.required=true;this.$supportedProperties.push("validgroup","required","datatype","pattern","min","max","maxlength","minlength","validtest","notnull","checkequal","invalidmsg","requiredmsg");this.$fValidate=function(){if(this.contenteditable){return;}if(!this.$validgroup){this.validate(true);}else{var a=this.$validgroup.getErrorBox(this);if(!a.visible||a.host!=this){this.validate(true);}}};this.addEventListener("blur",this.$fValidate);this.$propHandlers.validgroup=function(b){if(b){var a;if(typeof b!="string"){this.$validgroup=b.name;a=b;}else{a=apf.nameserver.get("validgroup",b);}this.$validgroup=a||new apf.ValidationGroup(b);this.$validgroup.register(this);}else{this.$validgroup.unregister(this);this.$validgroup=null;}};this.$propHandlers.pattern=function(a,b){if(a.substr(0,1)!="/"){a="/"+a+"/";}(this.$vOptions||(this.$vOptions={}))[b]=a;delete this.$vOptions.isValid;};this.$propHandlers.datatype=this.$propHandlers.required=this.$propHandlers.custom=this.$propHandlers.min=this.$propHandlers.max=this.$propHandlers.maxlength=this.$propHandlers.minlength=this.$propHandlers.notnull=this.$propHandlers.checkequal=function(a,b){(this.$vOptions||(this.$vOptions={}))[b]=a;delete this.$vOptions.isValid;};this.$propHandlers.validtest=function(c){var a=this,b={};this.removeValidationCache=function(){b={};};this.$checkRemoteValidation=function(){var d=this.getValue();if(typeof b[d]=="boolean"){return b[d];}if(b[d]==-1){return true;}b[d]=-1;apf.getData(this.validtest,{xmlNode:this.xmlRoot,value:this.getValue(),callback:function(k,j,g){if(j!=apf.SUCCESS){if(j==apf.TIMEOUT&&g.retries<apf.maxHttpRetries){return g.tpModule.retry(g.id);}else{var i=new Error(apf.formatErrorString(0,a,"Validating entry at remote source","Communication error: \n\n"+g.message));if(a.dispatchEvent("error",apf.extend({error:i,state:status},g))!==false){throw i;}return;}}b[d]=apf.isTrue(k);if(!b[d]){if(!a.hasFocus()){a.setError();}}else{a.clearError();}}});return true;};(this.$vOptions||(this.$vOptions={})).custom="apf.lookup("+this.$uniqueId+").$checkRemoteValidation()";delete this.$vOptions.isValid;};};apf.GuiElement.propHandlers.datatype=apf.GuiElement.propHandlers.required=apf.GuiElement.propHandlers.pattern=apf.GuiElement.propHandlers.min=apf.GuiElement.propHandlers.max=apf.GuiElement.propHandlers.maxlength=apf.GuiElement.propHandlers.minlength=apf.GuiElement.propHandlers.notnull=apf.GuiElement.propHandlers.checkequal=apf.GuiElement.propHandlers.validtest=function(a,b){this.implement(apf.Validation);this.$propHandlers[b].call(this,a,b);};apf.ValidationGroup=function(a){this.$init();this.childNodes=[];if(a){apf.setReference(a,this);}this.name=a||"validgroup"+this.$uniqueId;apf.nameserver.register("validgroup",this.name,this);};(function(){this.validateVisibleOnly=false;this.allowMultipleErrors=false;this.register=function(o){if(o.hasFeature(apf.__VALIDATION__)){this.childNodes.push(o);}};this.unregister=function(o){this.childNodes.remove(o);};this.toString=function(){return"[APF Validation Group]";};var errbox;this.getErrorBox=function(o,no_create){if(this.allowMultipleErrors||!errbox&&!no_create){errbox=new apf.errorbox();errbox.$pHtmlNode=o.$ext.parentNode;errbox.skinset=apf.getInheritedAttribute(o.parentNode,"skinset");errbox.dispatchEvent("DOMNodeInsertedIntoDocument");}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.$ext||oEl.$ext.offsetHeight)&&(oEl.hasFeature(apf.__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.checkValidity=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;}}return !found;};}).call(apf.ValidationGroup.prototype=new apf.Class());apf.config.$inheritProperties.validgroup=1;apf.__DATABINDING__=1<<1;apf.DataBinding=function(){this.$init(true);this.$loadqueue=this.$dbTimer=null;this.$regbase=this.$regbase|apf.__DATABINDING__;this.$mainBind="value";this.$bindings=this.$cbindings=this.$attrBindings=false;this.$attrExcludePropBind=apf.extend({model:1,each:1},this.$attrExcludePropBind);this.setQueryValue=function(d,j,g){var i=apf.createNodeFromXpath(this[g||"xmlRoot"],d);if(!i){return null;}apf.setNodeValue(i,j,true);return i;};this.queryValue=function(d,g){return apf.queryValue(this[g||"xmlRoot"],d);};this.queryValues=function(d,g){return apf.queryValues(this[g||"xmlRoot"],d);};this.queryNode=function(d,g){var i=this[g||"xmlRoot"];return i?i.selectSingleNode(d):null;};this.queryNodes=function(d,g){var i=this[g||"xmlRoot"];return i?i.selectNodes(d):[];};this.$checkLoadQueue=function(){if(this.$loadqueue){this.xmlRoot=null;var d=this.load(this.$loadqueue[0],{cacheId:this.$loadqueue[1]});if(!d||d.dataType!=apf.ARRAY||d!=this.$loadqueue){this.$loadqueue=null;}}};this.$execProperty=function(l,i){var g=this.$attrBindings[l];apf.$lm_has_lang=false;try{if(g.cvalue.asyncs){var d=this;return g.cvalue.call(this,i,function(m){d.setProperty(l,m,true);if(apf.$lm_has_lang){apf.language.addProperty(this,l,g.cvalue);}});}else{var j=g.cvalue.call(this,i);}}catch(k){apf.console.warn("[400] Could not execute binding for property "+l+"\n\n"+k.message);return;}this.setProperty(l,j,true);if(apf.$lm_has_lang){apf.language.addProperty(this,l,g.cvalue);}};this.$applyBindRule=function(g,i,d,k){var j=this.$attrBindings[g]&&this.$attrBindings[g].cvalue||this.$cbindings[g];return j?j.call(this,i,k):d||"";};this.$hasBindRule=function(d){return this.$attrBindings[d]||this.$bindings&&this.$bindings[d];};this.$getBindRule=function(d,g){return this.$attrBindings[d]||this.$bindings&&this.$bindings.getRule(d,g);};var b={drag:1,drop:1,dragcopy:1};this.$getDataNode=function(i,j,n,g,d){var l,m=this.$attrBindings[i];if(m){if(m.cvalue.type!=3){return false;}var k=m.cvalue2||m.compile("value",{xpathmode:d?4:3,parsecode:1,injectself:b[i]});if(k&&(l=k(j,n))){if(g){g.push(m);}return l;}return false;}return this.$bindings&&this.$bindings.getDataNode(i,j,n,g,d);};this.setModel=function(d){this.setAttribute("model",d,false,true);};this.getModel=function(d){if(d&&!this.$model){return this.dataParent?this.dataParent.parent.getModel(true):null;}return this.$model;};this.reload=function(){this.load(this.xmlRoot,{cacheId:this.cacheId,force:true});};this.load=function(g,d){if(d){var k=d.cacheId,j=d.force,l=d.noClearMsg;}if(k&&k==this.cacheId&&!j){return;}if(apf.popup.isShowing(this.$uniqueId)){apf.popup.forceHide();}if(g){if(typeof g=="string"){if(g.charAt(0)=="<"){g=apf.getXmlDom(g).documentElement;}else{return apf.model.prototype.$loadFrom.call(this,g,d);}}else{if(g.nodeType==9){g=g.documentElement;}else{if(g.nodeType==3||g.nodeType==4){g=g.parentNode;}else{if(g.nodeType==2){g=g.ownerElement||g.parentNode||g.selectSingleNode("..");}}}}}if(this.$preventDataLoad||!this.$canLoadData&&((!this.$bindings&&!this.$canLoadDataAttr)||!this.$amlLoaded)&&(!this.hasFeature(apf.__MULTISELECT__)||!(this.each||this.$template))||this.$canLoadData&&!this.$canLoadData()){this.xmlRoot=g;return this.$loadqueue=[g,k];}if(this.dataParent&&this.dataParent.xpath){this.dataParent.parent.signalXmlUpdate[this.$uniqueId]=!g;}if(!g&&(!k||!this.$isCached||!this.$isCached(k))){this.clear(l);if(apf.config.autoDisable&&this.$createModel===false){this.setProperty("disabled",true);}return;}var i=this.disabled;this.disabled=false;if(this.dispatchEvent("beforeload",{xmlNode:g})===false){return false;}if(this.caching&&!j&&g&&g==this.xmlRoot){return;}this.clear(true,true);this.cacheId=k;if(this.dispatchEvent("$load",{forceNoCache:j,xmlNode:g})===false){delete this.cacheId;return;}this.documentId=apf.xmldb.getXmlDocId(g);this.xmlRoot=g;this.setProperty("root",this.xmlRoot);apf.$lm_has_lang=false;this.$load(g);if(apf.$lm_has_lang){apf.language.addBinding(this);}else{apf.language.removeBinding(this);}this.$loadSubData(g);if(this.$createModel===false){this.disabled=true;this.setProperty("disabled",false);}else{this.disabled=i;}this.dispatchEvent("afterload",{xmlNode:g});};this.$loadSubData=function(d){if(this.$hasLoadStatus(d)){return;}var k,j=this.$getBindRule("load",d);if(j&&(!j[1]||j[1](d))){this.$setLoadStatus(d,"loading");if(this.$setClearMessage){this.$setClearMessage(this["loading-message"],"loading");}var i=this.getModel(true);var g=this;if(i.$insertFrom(j.getAttribute("get"),{xmlNode:k,insertPoint:d,amlNode:this,callback:function(){g.setProperty(g.hasFeature(apf.__MULTISELECT__)?"selected":"root",d);}})===false){this.clear(true);if(apf.config.autoDisable){this.setProperty("disabled",true);}}}};this.clear=function(i,k,g){if(!this.$container){return;}if(this.clearSelection){this.clearSelection(!k);}var j=this.$container.offsetHeight;if(this.dispatchEvent("$clear")!==false){this.$container.innerHTML="";}if(typeof i=="string"){var d=i;i=false;if(!this[d+"-message"]){this.$setInheritedAttribute(d+"-message");}}this.$lastClearType=d||null;if(!i&&this.$setClearMessage){this.$setClearMessage(d?this[d+"-message"]:this["empty-message"],d||"empty",j);}else{if(this.$removeClearMessage){this.$removeClearMessage();}}if(!g){this.documentId=this.xmlRoot=this.cacheId=null;}if(!i){if(this.hasFeature(apf.__MULTISELECT__)){this.setProperty("length",0);}}};this.clearMessage=function(d){this.customMsg=d;this.clear("custom");};this.$setLoadStatus=function(g,j,d){var i=g.getAttribute("a_loaded");i=i?i.replace(new RegExp("\\|\\w+\\:"+this.$uniqueId+"\\|","g"),""):"";if(!d){i+="|"+j+":"+this.$uniqueId+"|";}g.setAttribute("a_loaded",i);};this.$removeLoadStatus=function(d){this.$setLoadStatus(d,null,true);};this.$hasLoadStatus=function(d,i){var g=d.getAttribute("a_loaded");if(!g){return false;}return(g.indexOf((i||"")+":"+this.$uniqueId+"|")!=-1);};this.insert=function(i,d){if(typeof i=="string"){if(i.charAt(0)=="<"){i=apf.getXmlDom(i).documentElement;}else{if(!d.insertPoint){d.insertPoint=this.xmlRoot;}return apf.model.prototype.$insertFrom.call(this,i,d);}}var j=d.insertPoint||this.xmlRoot;if(this.dispatchEvent("beforeinsert",{xmlParentNode:j})===false){return false;}if(typeof d.copyAttributes=="undefined"){d.copyAttributes=true;}var g=apf.mergeXml(i,j,d);apf.xmldb.applyChanges("insert",j);if(this.selectable&&this.autoselect){if(this.xmlNode==g){this.$selectDefault(this.xmlNode);}}else{if(this.xmlNode==g){this.setProperty("root",this.xmlNode);}}if(this.$hasLoadStatus(j,"loading")){this.$setLoadStatus(j,"loaded");}this.dispatchEvent("afterinsert");};this.$booleanProperties["render-root"]=true;this.$supportedProperties.push("empty-message","loading-message","offline-message","render-root","smartbinding","bindings","actions");this.$propHandlers["render-root"]=function(d){this.renderRoot=d;};this.$propHandlers["empty-message"]=function(d){this["empty-message"]=d;if(this.$updateClearMessage){this.$updateClearMessage(this["empty-message"],"empty");}};this.$propHandlers["loading-message"]=function(d){this["loading-message"]=d;if(this.$updateClearMessage){this.$updateClearMessage(this["loading-message"],"loading");}};this.$propHandlers["offline-message"]=function(d){this["offline-message"]=d;if(this.$updateClearMessage){this.$updateClearMessage(this["offline-message"],"offline");}};this.$propHandlers.smartbinding=this.$propHandlers.actions=this.$propHandlers.bindings=function(g,i){var d="$"+i;if(this[d]){this[d].unregister(this);}if(!g){return;}apf.nameserver.get(i,g).register(this);if(i!="actions"){this.$checkLoadQueue();}};var c={caption:1,icon:1,select:1,css:1,sort:1,drop:2,drag:2,dragcopy:2,eachvalue:1};this.$addAttrBind=function(d,j,q){if(j.models){if(this.hasFeature(apf.__MULTISELECT__)){}}var k,n,s,l,t=j.xpaths,o={};for(k=0;k<t.length;k+=2){if(!o[(s=t[k])]){o[s]=1;}else{o[s]++;}}if(!this.$propsUsingMainModel){this.$propsUsingMainModel={};}var r=(this.$attrBindings||(this.$attrBindings={}))[d]={cvalue:j,value:q,compile:apf.BindingRule.prototype.$compile,models:[]};delete this.$propsUsingMainModel[d];for(n,k=0;k<t.length;k+=2){s=t[k];if(o[s]==-1){continue;}n=t[k+1];if(s=="#"||n=="#"){var g=(r.cvalue3||(r.cvalue3=apf.lm.compile(r.value,{xpathmode:5})))(this.xmlRoot);if(typeof g!="string"){l=g.model&&g.model.$isModel&&g.model;if(l){n=g.xpath;}else{if(g.model){l=apf.xmldb.findModel(g.model);n=apf.xmlToXpath(g.model,l.data)+(g.xpath?"/"+g.xpath:"");}else{this.addEventListener("prop."+d,function(w){var u=(r.cvalue3||(r.cvalue3=apf.lm.compile(r.value,{xpathmode:5})))(this.xmlRoot);if(u.model){this.removeEventListener("prop."+d,arguments.callee);var i=this;setTimeout(function(){i.$clearDynamicProperty(d);i.$setDynamicProperty(d,q);},10);}});continue;}}}else{l=null;}}else{l=null;}if(!l){if(s){l=apf.nameserver.get("model",s)||apf.setReference(s,apf.nameserver.register("model",s,new apf.model()));}else{if(!this.$model&&!this.$initingModel){a.call(this);}l=this.$model;if(!this.hasFeature(apf.__MULTISELECT__)&&c[d]!=2||!c[d]){this.$propsUsingMainModel[d]={xpath:n,optimize:o[s]==1};}}}if(l&&(!this.hasFeature(apf.__MULTISELECT__)&&c[d]!=2||!c[d])){l.$bindXmlProperty(this,d,n,o[s]==1,q.indexOf("*[")>-1);r.models.push(l);}o[s]=-1;}r.xpath=n;this.$canLoadDataAttr=c[d]==1;this.$checkLoadQueue();};this.$removeAttrBind=function(k){var g=this.$attrBindings[k];if(!g){return;}delete this.$attrBindings[k];var j=g.models;for(var d=0;d<j.length;d++){j[d].$unbindXmlProperty(this,k);}};this.$initingModel;function a(){this.$initingModel=true;this.$setInheritedAttribute("model");}this.addEventListener("DOMNodeInsertedIntoDocument",function(d){if(!this.model&&this.$setClearMessage&&!this.value){this.$setClearMessage(this["empty-message"],"empty");}this.$amlLoaded=true;this.$checkLoadQueue();});this.addEventListener("DOMNodeRemovedFromDocument",function(d){apf.language.removeBinding(this);});this.$propHandlers.model=function(m){if(!m&&!this.$modelParsed){if(this.$model){this.clear();this.$model.unregister(this);this.$model=null;this.lastModelId="";}else{if(this.dataParent){this.dataParent.parent=null;}}return;}this.$initingModel=true;var j;if((j=this.$modelParsed)&&j.type!=2){var l,k=j.props;if(this.dataParent){this.dataParent=null;}for(var n in k){this.dataParent={parent:self[n.split(".")[0]],xpath:null,model:this.$modelParsed.instruction};l=true;break;}if(l){if(this.dataParent&&!this.dataParent.signalXmlUpdate){this.dataParent.signalXmlUpdate={};}}this.$modelParsed=null;}var i;if(typeof m=="object"){if(m.dataType==apf.ARRAY){i=apf.nameserver.get("model",m[0]);i.register(this,m[1]);return;}else{if(m.$isModel){i=m;m=this.model=i.name;if(!m){i.setProperty("id",m=this.model="model"+i.$uniqueId);}}else{if(this.dataParent){this.model=this.dataParent.model;i=apf.xmldb.findModel(m);var g=apf.xmlToXpath(m,i.data,true)||".";i.register(this,g);return;}else{}}}}clearTimeout(this.$dbTimer);if(!this.$amlLoaded&&this.nodeType==1){var d=this;this.$dbTimer=$setTimeout(function(){if(!d.$amlDestroyed){apf.setModel(m,d);}});}else{apf.setModel(m,this);}};this.$propHandlers.viewport=function(d){if(d!="virtual"){return;}this.implement(apf.VirtualViewport);};};apf.DataBinding.prototype=apf.Presentation?new apf.Presentation():new apf.AmlElement();apf.config.$inheritProperties.model=1;apf.config.$inheritProperties["empty-message"]=1;apf.config.$inheritProperties["loading-message"]=1;apf.config.$inheritProperties["offline-message"]=1;apf.config.$inheritProperties.noloading=1;apf.Init.run("databinding");apf.MultiselectBinding=function(){if(!this.setQueryValue){this.implement(apf.DataBinding);}this.$init(function(){this.$selectTimer={};});};(function(){this.length=0;this.$attrExcludePropBind=apf.extend({caption:2,icon:2,eachvalue:2,select:2,css:2,sort:2,drag:2,drop:2,dragcopy:2,selected:2,each:1,selection:3,"selection-unique":3,"selection-constructor":3},this.$attrExcludePropBind);this.resort=function(g,c,d){if(!this.$sort){this.$sort=new apf.Sort();}this.$sort.set(g,c);if(this.clearAllCache){this.clearAllCache();}if(d){return;}var b=this;(function i(l,o){var m=b.$sort.apply(apf.getArrayFromNodelist(l.selectNodes(b.each)));for(var k=0;k<m.length;k++){if(b.$isTreeArch||b.$withContainer){var n=apf.xmldb.findHtmlNode(m[k],b);var j=b.$findContainer(n);o.appendChild(n);if(!apf.isChildOf(n,j,true)){o.appendChild(j);}i(m[k],j);}else{o.appendChild(apf.xmldb.findHtmlNode(m[k],b));}}})(this.xmlRoot,this.$container);return g;};this.toggleSortOrder=function(){return this.resort({ascending:!this.$sort.get().ascending}).ascending;};this.getSortSettings=function(){return this.$sort.get();};this.getTraverseNodes=function(c){if(this.$sort){var b=apf.getArrayFromNodelist((c||this.xmlRoot).selectNodes(this.each));return this.$sort.apply(b);}return(c||this.xmlRoot).selectNodes(this.each);};this.getFirstTraverseNode=function(c){if(this.$sort){var b=(c||this.xmlRoot).selectNodes(this.each);return this.$sort.apply(b)[0];}return(c||this.xmlRoot).selectSingleNode(this.each);};this.getLastTraverseNode=function(c){var b=this.getTraverseNodes(c||this.xmlRoot);return b[b.length-1];};this.isTraverseNode=function(d){var b=this.getTraverseNodes(this.getTraverseParent(d)||this.xmlRoot);for(var c=0;c<b.length;c++){if(b[c]==d){return true;}}return false;};this.getNextTraverseSelected=function(g,b,k){if(!g){g=this.selected;}if(!k){k=1;}var d=0;var c=this.getTraverseNodes(this.getTraverseParent(g)||this.xmlRoot);while(c[d]&&c[d]!=g){d++;}var j=(b==null)?c[d+k]||c[d-k]:(b?c[d+k]:c[d-k]);return j||k&&(d<k||(d+1)>Math.floor(c.length/k)*k)?j:(b?c[c.length-1]:c[0]);};this.getNextTraverse=function(g,b,j){if(!j){j=1;}if(!g){g=this.selected;}var d=0;var c=this.getTraverseNodes(this.getTraverseParent(g)||this.xmlRoot);while(c[d]&&c[d]!=g){d++;}return c[d+(b?-1*j:j)];};this.getTraverseParent=function(c){if(!c.parentNode||c==this.xmlRoot){return false;}if(c.$regbase){return c.parentNode;}var b,d=c.getAttribute(apf.xmldb.xmlIdTag);if(!d){c.setAttribute(apf.xmldb.xmlIdTag,"temp");d="temp";}b=c.selectSingleNode("ancestor::node()[(("+this.each+")/@"+apf.xmldb.xmlIdTag+")='"+d+"']");if(d=="temp"){c.removeAttribute(apf.xmldb.xmlIdTag);}return b;};if(!this.$findHtmlNode){this.$findHtmlNode=function(b){return this.$pHtmlDoc.getElementById(b);};}this.$setClearMessage=function(j,d,i){if(!this.$empty){if(!this.$hasLayoutNode("empty")){return;}this.$getNewContext("empty");var c=this.$getLayoutNode("empty");if(!c){return;}this.$empty=apf.insertHtmlNode(c,this.$container);}else{this.$container.appendChild(this.$empty);}var g=this.$getLayoutNode("empty","caption",this.$empty);if(g){apf.setNodeValue(g,j||"");}this.$empty.setAttribute("id","empty"+this.$uniqueId);apf.setStyleClass(this.$empty,d,["loading","empty","offline"]);var b=apf.getStyle(this.$ext,"height");this.$empty.style.height=(i&&(!b||b=="auto")&&d!="empty")?(Math.max(10,(i-apf.getHeightDiff(this.$empty)-apf.getHeightDiff(this.$ext)))+"px"):"";};this.$updateClearMessage=function(d,b){if(!this.$empty||this.$empty.parentNode!=this.$container||this.$empty.className.indexOf(b)==-1){return;}var c=this.$getLayoutNode("empty","caption",this.$empty);if(c){apf.setNodeValue(c,d||"");}};this.$removeClearMessage=function(){if(!this.$empty){this.$empty=document.getElementById("empty"+this.$uniqueId);}if(this.$empty&&this.$empty.parentNode){this.$empty.parentNode.removeChild(this.$empty);}};this.$load=function(b){apf.xmldb.addNodeListener(b,this);var g=this.getTraverseNodes(b).length;if(!this.renderRoot&&!g){return this.clear(null,null,true);}var c=this.$addNodes(b,null,null,this.renderRoot);this.$fill(c);if(this.selectable){if(this.autoselect){if(!this.selected){if(this.renderRoot){this.select(b,null,null,null,true);}else{if(c.length){this.$selectDefault(b);}}}}else{this.clearSelection(true);var d=this.renderRoot?this.xmlRoot:this.getFirstTraverseNode();if(d){this.setCaret(d);}if(this.selected){this.setProperty("selected",null);}if(this.choosen){this.setProperty("choosen",null);}}}if(this.focussable){apf.document.activeElement==this?this.$focus():this.$blur();}if(g!=this.length){this.setProperty("length",g);}};var a={insert:127,add:123,remove:46,"redo-remove":79,synchronize:127,"move-away":105,move:77};this.$xmlUpdate=function(y,g,m,t,x){if(!this.xmlRoot){return;}var r,j,b,n,B=g;if(!m){m=this.xmlRoot;}if(y=="redo-remove"){x.appendChild(g);var A=this.isTraverseNode(g);x.removeChild(g);if(!A){g=x;}}do{if(y=="add"&&this.isTraverseNode(g)&&B==g){break;}if(g.getAttribute(apf.xmldb.xmlIdTag)){n=this.$findHtmlNode(g.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);if(n&&(B!=g||g==this.xmlRoot)&&a[y]&1){y="update";}if(g==m&&!this.renderRoot){if(g==this.xmlRoot&&y!="insert"){this.dispatchEvent("xmlupdate",{action:y,xmlNode:g,UndoObj:t});return;}break;}if(n&&a[y]&2&&!this.isTraverseNode(g)){y="remove";}if(!n&&a[y]&4&&this.isTraverseNode(g)){y="add";break;}if(n||y=="move"){break;}}else{if(a[y]&8&&this.isTraverseNode(g)){y="add";break;}}if(g==m){break;}g=g.parentNode;}while(g&&g.nodeType!=9);apf.$lm_has_lang=false;if(this.hasFeature(apf.__VIRTUALVIEWPORT__)){if(!this.$isInViewport(g)){return;}}var d=g;if(g&&g.nodeType==9){g=B;}if(y=="replacechild"&&(t?t.args[0]==this.xmlRoot:!this.xmlRoot.parentNode)){return this.load(t?t.args[1]:m);}if(t&&g&&!t.xmlNode){t.xmlNode=g;}if(y=="move"&&d==B){var s=apf.isChildOf(this.xmlRoot,g.parentNode,true);var l=apf.isChildOf(this.xmlRoot,t.extra.parent,true);if(s&&l){this.$moveNode(g,n);}else{if(s){y="add";}else{if(l){y="remove";}}}}else{if(y=="move-away"){var u=apf.isChildOf(this.xmlRoot,t.extra.parent,true);if(!u){y="remove";}}}if(this.$removeClearMessage&&this.$setClearMessage){if(this.getFirstTraverseNode()){this.$removeClearMessage();}else{this.$setClearMessage(this["empty-message"],"empty");}}if(y=="insert"&&(this.$isTreeArch||g==this.xmlRoot)){if(!g){return;}if(this.$hasLoadStatus(g)&&this.$removeLoading){this.$removeLoading(n);}if(this.$container.firstChild&&!apf.xmldb.getNode(this.$container.firstChild)){this.$container.innerHTML="";if(!this.renderRoot){j=this.getTraverseNodes().length;if(!j){this.clear();}}}r=this.$addNodes(g,(this.$getParentNode?this.$getParentNode(n):n),true,false);this.$fill(r);if(this.selectable&&(j===0||!this.xmlRoot.selectSingleNode(this.each))){return;}}else{if(y=="add"){var z;b=this.getTraverseParent(g);if(b==this.xmlRoot){z=this.$container;}if(!z&&this.$isTreeArch){z=this.$findHtmlNode(b.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);}if(!z&&this.getCacheItem){z=this.getCacheItem(b.getAttribute(apf.xmldb.xmlIdTag)||(b.getAttribute(apf.xmldb.xmlDocTag)?"doc"+b.getAttribute(apf.xmldb.xmlDocTag):false));}if(z||this.$isTreeArch&&apf.isChildOf(this.xmlRoot,g)){z=(this.$findContainer&&z?this.$findContainer(z):z)||this.$container;r=this.$addNodes(g,z,true,true,apf.xmldb.getHtmlNode(this.getNextTraverse(g),this));if(z){this.$fill(r);}}}else{if(y=="remove"){if(!g||B!=g){return;}if(n){this.$deInitNode(g,n);}else{if(g==this.xmlRoot){return this.load({noClearMsg:!this.dataParent||!this.dataParent.autoselect});}}}else{if(n){this.$updateNode(g,n);if(y=="replacechild"&&this.hasFeature(apf.__MULTISELECT__)&&this.selected&&g.getAttribute(apf.xmldb.xmlIdTag)==this.selected.getAttribute(apf.xmldb.xmlIdTag)){this.selected=g;}}else{if(y=="redo-remove"){var c=this.xmlRoot;while(c&&c.nodeType!=9){c=c.parentNode;}if(!c){var i=this.getModel(true);return i.$waitForXml(this);}}}}}}if(apf.$lm_has_lang){apf.language.addBinding(this);}b=g?g.parentNode:x;if(this.$isTreeArch&&b&&b.nodeType==1){do{n=this.$findHtmlNode(b.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);if(n){this.$updateNode(b,n);}}while((b=this.getTraverseParent(b))&&b.nodeType==1);}if(a[y]&32&&this.selectable&&B==g&&(y!="insert"||g==this.xmlRoot)){clearTimeout(this.$selectTimer.timer);if(y=="remove"&&apf.isChildOf(g,this.selected,true)||g==this.$selectTimer.nextNode){this.$selectTimer.nextNode=this.getDefaultNext(g,this.$isTreeArch);}var k=this;this.$selectTimer.timer=$setTimeout(function(){k.$checkSelection(k.$selectTimer.nextNode);k.$selectTimer.nextNode=null;});}if(a[y]&64){if(!j){j=this.xmlRoot.selectNodes(this.each).length;}if(j!=this.length){this.setProperty("length",j);}}if(this.signalXmlUpdate&&a[y]&16){var q;for(q in this.signalXmlUpdate){if(parseInt(q)!=q){continue;}var w=apf.lookup(q);if(!this.selected){continue;}g=this.selected.selectSingleNode(w.dataParent.xpath);if(!g){continue;}w.load(g);}}this.dispatchEvent("xmlupdate",{action:y,xmlNode:g,result:r,UndoObj:t});};this.$addNodes=function(s,r,g,d,m,k){var q,c;d=(d&&(this.renderRoot&&s==this.xmlRoot||this.isTraverseNode(s)));var b=d?[s]:this.getTraverseNodes(s);for(var j=0;j<b.length;j++){if(b[j].nodeType!=1){if(this.$addNonElement){this.$addNonElement(b[j],r||this.$container,g,m,k);}continue;}if(g){q=this.$findHtmlNode(b[j].getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);}if(!q){var n=apf.xmldb.nodeConnect(this.documentId,b[j],null,this);var o=d?m:(c?c.nextSibling:null),l=this.$add(b[j],n,d?s.parentNode:s,o?r||this.$container:r,o,(!o&&j==b.length-1),k);if(l===false){break;}}if(g){c=q;}}return b;};this.$handleBindingRule=function(c,d){if(!c){this[d]=null;}if(d=="each"){if(c.indexOf("::")>-1){c=c.replace(/^\[|\]$/g,"").split("::");this.setProperty("model",c[0]);this.each=c[1];}else{this.each=c.replace(/^\[|\]$/g,"");}}if(this.xmlRoot&&!this.$bindRuleTimer&&this.$amlLoaded){var b=this;apf.queue.add("reload"+this.$uniqueId,function(){b.reload();});}};this.$select=function(b){if(this.renaming){this.stopRename(null,true);}if(!b||!b.style){return;}return this.$setStyleClass(b,"selected");};this.$deselect=function(b){if(this.renaming){this.stopRename(null,true);if(this.ctrlselect){return false;}}if(!b){return;}return this.$setStyleClass(b,"",["selected","indicate"]);};this.$indicate=function(b){if(this.renaming){this.stopRename(null,true);}if(!b){return;}return this.$setStyleClass(b,"indicate");};this.$deindicate=function(b){if(this.renaming){this.stopRename(null,true);}if(!b){return;}return this.$setStyleClass(b,"",["indicate"]);};this.$propHandlers.each=this.$propHandlers.caption=this.$propHandlers.eachvalue=this.$propHandlers.icon=this.$propHandlers.tooltip=this.$handleBindingRule;this.$propHandlers.sort=function(b){if(b){this.$sort=new apf.Sort();this.$sort.set({getValue:apf.lm.compile(b)});}else{this.$sort=null;}};}).call(apf.MultiselectBinding.prototype=new apf.DataBinding());apf.StandardBinding=function(){this.$init(true);if(apf.Validation){this.implement(apf.Validation);}if(!this.setQueryValue){this.implement(apf.DataBinding);}if(!this.defaultValue){this.defaultValue="";}this.$load=function(c){apf.xmldb.addNodeListener(c,this);var a,i,j,g,k,d;if(a=this.$bindings){for(j in a){i=j.toLowerCase();if(this.$supportedProperties.indexOf(i)>-1){k=(g=a[i]).length==1?g[0]:this.$getBindRule(i,c);d=k.value||k.match;this.$clearDynamicProperty(i);if(d.indexOf("{")>-1||d.indexOf("[")>-1){this.$setDynamicProperty(i,d);}else{if(this.setProperty){this.setProperty(i,d,true);}}}}}if(this.errBox&&this.isValid&&this.isValid()){this.clearError();}};this.$xmlUpdate=function(g,r,a,l){if(g=="redo-remove"){var c=false,i=this.getModel(true);if(i){var k=i.getXpathByAmlNode(this);if(k){r=i.data.selectSingleNode(k);if(r!=this.xmlRoot){c=true;}}}if(c||this.xmlRoot==r){return i.$waitForXml(this);}}if(l&&!l.xmlNode){l.xmlNode=this.xmlRoot;}var n,d,m,o,j,q;if(n=this.$bindings){for(m in n){d=m.toLowerCase();if(this.$supportedProperties.indexOf(d)>-1){j=(o=n[d]).length==1?o[0]:this.$getBindRule(d,r);q=j.value||j.match;this.$clearDynamicProperty(d);if(q.indexOf("{")>-1||q.indexOf("[")>-1){this.$setDynamicProperty(d,q);}else{if(this.setProperty){this.setProperty(d,q);}}}}}if(this.errBox&&this.isValid&&this.isValid()){this.clearError();}this.dispatchEvent("xmlupdate",{action:g,xmlNode:r,UndoObj:l});};this.addEventListener("$clear",function(b,a){if(this.$propHandlers&&this.$propHandlers.value){this.value=-99999;this.$propHandlers.value.call(this,"");}});};apf.StandardBinding.prototype=new apf.DataBinding();apf.Init.run("standardbinding");apf.__MULTISELECT__=1<<8;apf.MultiSelect=function(){this.$init(function(){this.$valueList=[];this.$selectedList=[];});};(function(){this.$regbase=this.$regbase|apf.__MULTISELECT__;this.sellength=0;this.selected=null;this.$selected=null;this.caret=null;this.$caret=null;this.useindicator=true;this.remove=function(b){if(!b){b=this.$valueList;}if(b.nodeType){b=[b];}if(!b||!b.length){return;}var d=[];for(var c=0;c<b.length;c++){d.push({func:"removeNode",args:[b[c]]});}if(this.$actions.removegroup){return this.$executeAction("multicall",d,"removegroup",b[0]);}else{return this.$executeAction("multicall",d,"remove",b[0],null,null,b.length>1?b:null);}};this.add=function(n,o,m,b){var k;if(this.$actions){if(n&&n.nodeType){k=this.$actions.getRule("add",n);}else{if(typeof n=="string"){if(n.trim().charAt(0)=="<"){n=apf.getXml(n);k=this.$actions.getRule("add",n);}else{var r=this.$actions.add;for(var g=0,d=r.length;g<d;g++){if(r[g].getAttribute("type")==n){n=null;k=r[g];break;}}}}}if(!k){k=(this.$actions.add||{})[0];}}else{k=null;}var j=this.$isTreeArch?this.selected||this.xmlRoot:this.xmlRoot,c=this,q=function(s,t,i){if(t!=apf.SUCCESS){var u;u=new Error(apf.formatErrorString(1032,c,"Loading xml data","Could not add data for control "+c.name+"["+c.tagName+"] \nUrl: "+i.url+"\nInfo: "+i.message+"\n\n"+n));if(i.tpModule.retryTimeout(i,t,c,u)===true){return true;}throw u;}if(typeof s!="object"){s=apf.getXmlDom(s).documentElement;}if(s.getAttribute(apf.xmldb.xmlIdTag)){s.setAttribute(apf.xmldb.xmlIdTag,"");}var l=c.$actions&&c.$actions.getRule("add",c.$isTreeArch?c.selected:c.xmlRoot);if(!o){if(l&&l.parent){o=(l.cparent||l.compile("parent",{xpathmode:2,injectself:true}))(c.$isTreeArch?c.selected||c.xmlRoot:c.xmlRoot);}else{o=c.$isTreeArch?c.selected||c.xmlRoot:c.xmlRoot;}}if(!o){o=c.xmlRoot;}if(apf.isWebkit&&o.ownerDocument!=s.ownerDocument){s=o.ownerDocument.importNode(s,true);}if(c.$executeAction("appendChild",[o,s,m],"add",s)!==false&&c.autoselect){c.select(s);}if(b){b.call(c,s);}return s;};if(n){return q(n,apf.SUCCESS);}else{if(k.get){return apf.getData(k.get,{xmlNode:j,callback:q});}else{}}return addXmlNode;};if(!this.setValue){this.setValue=function(c,b){noEvent=b;this.setProperty("value",c,false,true);noEvent=false;};}this.findXmlNodeByValue=function(g){var c=this.getTraverseNodes(),b=this.$attrBindings.eachvalue&&"eachvalue"||this.$bindings.value&&"value"||this.$hasBindRule("caption")&&"caption";if(!b){return false;}for(var d=0;d<c.length;d++){if(this.$applyBindRule(b,c[d])==g){return c[d];}}};if(!this.getValue){this.getValue=function(c,b){return this.value;};}this.reselect=function(){if(this.selected){this.select(this.selected,null,this.ctrlselect,null,true);}};this.select=function(r,c,o,i,d,k,s){if(!this.selectable||s&&this.disabled){return;}if(i==-1){i=false;s=true;}if(this.$skipSelect){this.$skipSelect=false;return;}if(this.ctrlselect&&!o){c=true;}if(!this.multiselect){c=o=false;}if(!this.xmlRoot){if(!this.$buffered){var l;this.addEventListener("afterload",l=function(){this.select.apply(this,this.$buffered);this.removeEventListener("afterload",l);delete this.$buffered;});}this.$buffered=Array.prototype.slice.call(arguments);return;}var q;if(!r){return false;}if(typeof r!="object"){var n=r;r=null;if(typeof r=="string"){r=apf.xmldb.getNodeById(n);}if(!r){r=this.findXmlNodeByValue(n);if(!r){this.clearSelection(k);return;}}}if(!r.style){q=this.$findHtmlNode(r.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);}else{var b=(q=r).getAttribute(apf.xmldb.htmlIdTag);while(!b&&q.parentNode){b=(q=q.parentNode).getAttribute(apf.xmldb.htmlIdTag);}r=apf.xmldb.getNodeById(b);}if(!o&&!c&&!d&&!this.reselectable&&this.$valueList.length<=1&&this.$valueList.indexOf(r)>-1){return;}if(this.dispatchEvent("beforeselect",{selected:r,htmlNode:q,ctrlKey:c,shiftKey:o,force:d,captureOnly:k})===false){return false;}var g=this.caret;this.caret=r;if(o){var j=this.$calcSelectRange(this.$valueList[0]||g,r);if(this.$caret){this.$deindicate(this.$caret);}this.selectList(j);this.$selected=this.$caret=this.$indicate(q);}else{if(c){if(this.$valueList.contains(r)){if(this.selected==r){this.$deselect(this.$findHtmlNode(this.selected.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId));this.$deindicate(this.$caret);if(this.$valueList.length&&!i){this.selected=this.$valueList[0];}}else{this.$deselect(q,r);}if(!i){this.$selectedList.remove(q);this.$valueList.remove(r);}if(q!=this.$caret){this.$deindicate(this.$caret);}this.$selected=this.$caret=this.$indicate(q);}else{if(this.$caret){this.$deindicate(this.$caret);}this.$caret=this.$indicate(q,r);this.$selected=this.$select(q,r);this.selected=r;if(!i){this.$selectedList.push(q);this.$valueList.push(r);}}}else{if(i&&q&&this.$selectedList.contains(q)){return;}else{if(this.$selected){this.$deselect(this.$selected);}if(this.$caret){this.$deindicate(this.$caret);}if(this.selected){this.clearSelection(true);}this.$caret=this.$indicate(q,r);this.$selected=this.$select(q,r);this.selected=r;this.$selectedList.push(q);this.$valueList.push(r);}}}if(this.delayedselect&&(typeof c=="boolean")){var m=this;$setTimeout(function(){m.dispatchEvent("afterselect",{selection:m.$valueList,selected:r,caret:m.caret,captureOnly:k});},10);}else{this.dispatchEvent("afterselect",{selection:this.$valueList,selected:r,caret:this.caret,captureOnly:k});}return true;};this.choose=function(b,c){if(!this.selectable||c&&this.disabled){return;}if(this.dispatchEvent("beforechoose",{xmlNode:b})===false){return false;}if(b&&!b.style){this.select(b);}if(this.hasFeature(apf.__DATABINDING__)&&this.dispatchEvent("afterchoose",{xmlNode:this.selected})!==false){this.setProperty("chosen",this.selected);}};this.clearSelection=function(c,g){if(!this.selectable||g&&this.disabled||!this.$valueList.length){return;}if(!c){if(this.dispatchEvent("beforeselect",{selection:[],selected:null,caret:this.caret})===false){return false;}}var d;for(var b=this.$valueList.length-1;b>=0;b--){d=this.$findHtmlNode(this.$valueList[b].getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);this.$deselect(d);}this.$selectedList.length=0;this.$valueList.length=0;this.$selected=this.selected=null;if(this.caret){d=this.$findHtmlNode(this.caret.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);this.$caret=this.$indicate(d);}if(!c){this.dispatchEvent("afterselect",{selection:this.$valueList,selected:null,caret:this.caret});}};this.selectList=function(b,g,j,m){if(!this.selectable||m&&this.disabled){return;}if(this.dispatchEvent("beforeselect",{selection:b,selected:j||b[0],caret:this.caret,captureOnly:g})===false){return false;}this.clearSelection(true);for(var l,d=0;d<b.length;d++){if(!b[d]||b[d].nodeType!=1){continue;}var k,c=b[d];if(typeof c!="object"){c=apf.xmldb.getNodeById(c);}if(!c.style){k=this.$pHtmlDoc.getElementById(c.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);}else{k=c;c=apf.xmldb.getNodeById(k.getAttribute(apf.xmldb.htmlIdTag));}if(!c){continue;}if(k){if(!l&&j==k){l=k;}this.$select(k,c);this.$selectedList.push(k);}this.$valueList.push(c);}this.$selected=l||this.$selectedList[0];this.selected=j||this.$valueList[0];this.dispatchEvent("afterselect",{selection:this.$valueList,selected:this.selected,caret:this.caret,captureOnly:g});};this.setCaret=function(b){if(!b){if(this.$caret){this.$deindicate(this.$caret);}this.caret=this.$caret=null;return;}var c;if(typeof b!="object"){b=apf.xmldb.getNodeById(b);}if(!b.style){c=this.$findHtmlNode(b.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);}else{var d=(c=b).getAttribute(apf.xmldb.htmlIdTag);while(!d&&c.parentNode){d=(c=c.parentNode).getAttribute(apf.xmldb.htmlIdTag);}b=apf.xmldb.getNodeById(d);}if(this.$caret){this.$deindicate(this.$caret);}this.$caret=this.$indicate(c);this.setProperty("caret",this.caret=b);};this.$setTempSelected=function(d,g,c,j){clearTimeout(this.timer);if(this.$bindings.selectable){while(d&&!this.$getDataNode("selectable",d)){d=this.getNextTraverseSelected(d,!j);}if(!d){return;}}if(!this.multiselect){g=c=false;}if(g||this.ctrlselect){if(this.$tempsel){this.select(this.$tempsel);this.$tempsel=null;}this.setCaret(d);}else{if(c){if(this.$tempsel){this.$selectTemp();this.$deselect(this.$tempsel);this.$tempsel=null;}this.select(d,null,c);}else{if(!this.bufferselect||this.$valueList.length>1){this.select(d);}else{var i=apf.xmldb.getID(d,this);this.$deselect(this.$tempsel||this.$selected);this.$deindicate(this.$tempsel||this.$caret);this.$tempsel=this.$indicate(document.getElementById(i));this.$select(this.$tempsel);var b=this;this.timer=$setTimeout(function(){b.$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(c){if(!this.multiselect||!this.selectable||c&&this.disabled||!this.xmlRoot){return;}var b=this.$isTreeArch?this.xmlRoot.selectNodes(".//"+this.each.split("|").join("|.//")):this.xmlRoot.selectNodes(this.each);this.selectList(b);};this.getSelection=function(b){var c,d;if(b){d=this.xmlRoot?this.xmlRoot.ownerDocument.createDocumentFragment():apf.getXmlDom().createDocumentFragment();for(c=0;c<this.$valueList.length;c++){apf.xmldb.cleanNode(d.appendChild(this.$valueList[c].cloneNode(true)));}}else{for(d=[],c=0;c<this.$valueList.length;c++){d.push(this.$valueList[c]);}}return d;};this.$getSelection=function(b){return b?this.$selectedList:this.$valueList;};this.defaultSelectNext=function(c,b){var d=this.getNextTraverseSelected(c);if(d||!b){this.select(d?d:this.getTraverseParent(c));}else{this.clearSelection(true);}};this.selectNext=function(){var b=this.getNextTraverse();if(b){this.select(b);}};this.selectPrevious=function(){var b=this.getNextTraverse(null,-1);if(b){this.select(b);}};this.getDefaultNext=function(c,b){var d=this.getNextTraverseSelected(c);return(d&&d!=c)?d:(b?this.getTraverseParent(c):null);};this.isSelected=function(c){if(!c){return false;}for(var b=0;b<this.$valueList.length;b++){if(this.$valueList[b]==c){return this.$valueList.length;}}return false;};this.$checkSelection=function(c){if(this.$valueList.length>1){for(var b=[],g=0,d=this.$valueList.length;g<d;g++){if(apf.isChildOf(this.xmlRoot,this.$valueList[g])){b.push(this.$valueList[g]);}}if(b.length>1){this.selectList(b);if(this.caret&&!apf.isChildOf(this.xmlRoot,this.caret)){this.setCaret(c||this.selected);}return;}else{if(b.length){c=b[0];}}}if(!c){if(this.selected&&!apf.isChildOf(this.xmlRoot,this.selected)){c=this.getFirstTraverseNode();}else{if(this.selected&&this.caret&&!apf.isChildOf(this.xmlRoot,this.caret)){this.setCaret(this.selected);}else{if(!this.selected){c=this.xmlRoot?this.getFirstTraverseNode():null;}else{return;}}}}if(c){if(this.autoselect){this.select(c);}else{if(!this.multiselect){this.clearSelection();}this.setCaret(c);}}else{this.clearSelection();}};this.selectable=true;if(typeof this.ctrlselect=="undefined"){this.ctrlselect=false;}if(typeof this.multiselect=="undefined"){this.multiselect=true;}if(typeof this.autoselect=="undefined"){this.autoselect=true;}if(typeof this.delayedselect=="undefined"){this.delayedselect=true;}if(typeof 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","selection","selected","default","value","caret");this.$propHandlers.value=function(c){if(this.$lastValue==c){delete this.$lastValue;return;}if(!this.$attrBindings.eachvalue&&!this.$amlLoaded&&this.getAttribute("eachvalue")){var b=this;return apf.queue.add("value"+this.$uniqueId,function(){b.$propHandlers.value.call(b,c);});}if(c||c===0||this["default"]){this.select(String(c)||this["default"]);}else{this.clearSelection();}};this.$propHandlers["default"]=function(b,c){if(!this.value||!this.$amlLoaded&&!(this.getAttribute("value")||this.getAttribute("selected")||this.getAttribute("selection"))){this.$propHandlers.value.call(this,"");}};this.$propHandlers.caret=function(b,c){if(b){this.setCaret(b);}};this.$propHandlers.selection=this.$propHandlers.selected=function(u,n){if(!u){u=this[n]=null;}if(n=="selected"&&typeof u!="string"&&u==this.selected){this.selected=null;return;}if(this.$isSelecting){this.selection=this.$valueList;return false;}var t,l,k,z,y,C,B;if(n=="selection"){if(typeof u=="object"&&u==this.$valueList){var b;if((C=this.$attrBindings[n])&&C.cvalue.models){this.$isSelecting=true;l=this.$attrBindings.eachvalue&&"eachvalue"||this.$bindings.value&&"value"||this.$hasBindRule("caption")&&"caption";if(!l){throw new Error("Missing bind rule set: eachvalue, value or caption");}var g=this.$getDataNode(n,this.xmlRoot);t=u;k=(B=this.$attrBindings["selection-unique"])&&B.cvalue;if(g.length){b=g[0].parentNode;}else{var r,s;if(C.cvalue.xpaths[0]=="#"||C.cvalue.xpaths[1]=="#"){var w=(C.cvalue3||(C.cvalue3=apf.lm.compile(C.value,{xpathmode:5})))(this.xmlRoot);r=w.model&&w.model.$isModel&&w.model;if(r){s=w.xpath;}else{if(w.model){r=apf.xmldb.findModel(w.model);s=apf.xmlToXpath(w.model,r.data)+(w.xpath?"/"+w.xpath:"");}else{}}}else{r=apf.nameserver.get("model",C.cvalue.xpaths[0]);s=C.cvalue.xpaths[1];}if(!r||!r.data){this.$isSelecting=false;return false;}b=r.queryNode(s.replace(/\/[^\/]+$|^[^\/]*$/,"")||".");if(!b){throw new Error("Missing parent node");}}remove_loop:for(z=0;z<g.length;z++){u=k?k(g[z]):this.$applyBindRule(l,g[z]);for(y=0;y<t.length;y++){if(this.$applyBindRule(l,t[y])==u){continue remove_loop;}}apf.xmldb.removeNode(g[z]);}add_loop:for(z=0;z<t.length;z++){u=this.$applyBindRule(l,t[z]);for(y=0;y<g.length;y++){if(k?k(g[y]):this.$applyBindRule(l,g[y])==u){continue add_loop;}}var x=this.$attrBindings["selection-constructor"]&&this.$getDataNode("selection-constructor",t[z])||apf.getCleanCopy(t[z]);apf.xmldb.appendChild(b,x);}this.$isSelecting=false;}return;}this.selection=this.$valueList;}else{this.selected=null;}if(!this.xmlRoot){if(!this.$buffered){var A;this.addEventListener("afterload",A=function(){this.removeEventListener("afterload",A);this.$propHandlers.selected.call(this,u,n);delete this.$buffered;});this.$buffered=true;}this[n]=null;return false;}if(!u||typeof u!="object"){if(this.$attrBindings[n]){t=this.$getDataNode(n,this.xmlRoot);if(t){this.setProperty("selection",t);}}else{if(!u){this.clearSelection();}else{this.select(u);}}return false;}else{if(typeof u.length=="number"){t=u;if(!t.length){this.selected=null;if(this.$valueList.length){this.clearSelection();return false;}else{return;}}if(this.isTraverseNode(t[0])&&apf.isChildOf(this.xmlRoot,t[0])){if(!this.multiselect){this.select(t[0]);}else{this.selectList(t);}return false;}if(this.$attrBindings[n]){l=this.$attrBindings.eachvalue&&"eachvalue"||this.$bindings.value&&"value"||this.$hasBindRule("caption")&&"caption";if(!l){throw new Error("Missing bind rule set: eachvalue, value or caption");}var q=!this.each?this.getTraverseNodes():this.xmlRoot.selectNodes("//"+this.each.split("|").join("|//"));k=(C=this.$attrBindings["selection-unique"])&&C.cvalue;var o=[];for(z=0;z<t.length;z++){u=k?k(t[z]):this.$applyBindRule(l,t[z]);for(y=0;y<q.length;y++){if(this.$applyBindRule(l,q[y])==u){o.push(q[y]);}}}this.selectList(o,true);return false;}throw new Error("Show me which case this is");}else{if(this.$valueList.indexOf(u)==-1){this.select(u);}}}};this.$propHandlers.allowdeselect=function(c){if(c){var b=this;this.$container.onmousedown=function(g){if(!g){g=event;}if(g.ctrlKey||g.shiftKey){return;}var d=g.srcElement||g.target;if(b.allowdeselect&&(d==this||d.getAttribute(apf.xmldb.htmlIdTag))){b.clearSelection();}};}else{this.$container.onmousedown=null;}};this.$propHandlers.ctrlselect=function(b){if(b!="enter"){this.ctrlselect=apf.isTrue(b);}};function a(){this.selectAll();}this.$propHandlers.autoselect=function(b){if(b=="all"&&this.multiselect){this.addEventListener("afterload",a);}else{this.removeEventListener("afterload",a);}};this.$propHandlers.multiselect=function(b){if(!b&&this.$valueList.length>1){this.select(this.selected);}};this.addEventListener("beforeselect",function(b){if(this.$bindings.selectable&&!this.$getDataNode("selectable",b.selected)){return false;}},true);this.addEventListener("afterselect",function(g){var d=null;this.setProperty("caret",g.caret);if(this.sellength!=g.selection.length){this.setProperty("sellength",g.selection.length);}delete this.selection;this.setProperty("selection",g.selection);if(!g.selection.length){this.setProperty("selected",g.selected);if(this.value){this.setProperty("value","");}}else{this.$chained=true;if(!g.force&&(!this.dataParent||!this.dataParent.parent.$chained)){var b=this;$setTimeout(function(){b.setProperty("selected",d||g.selected);delete b.$chained;},10);}else{this.setProperty("selected",d||g.selected);delete this.$chained;}var c=this.$attrBindings.eachvalue&&"eachvalue"||this.$bindings.value&&"value"||this.$hasBindRule("caption")&&"caption";if(c){this.$lastValue=this.$applyBindRule(c,g.selected);if(this.$lastValue!=(c!="value"&&(this.xmlRoot&&this.$applyBindRule("value",this.xmlRoot,null,true))||this.value)){if(c=="eachvalue"||this.xmlRoot!=this){this.change(this.$lastValue);}else{this.setProperty("value",this.$lastValue);}}delete this.$lastValue;}}},true);}).call(apf.MultiSelect.prototype=new apf.MultiselectBinding());apf.__CONTENTEDITABLE__=1<<23;apf.__CHILDVALUE__=1<<27;apf.ChildValue=function(){if(!this.$childProperty){this.$childProperty="value";}this.$regbase=this.$regbase|apf.__CHILDVALUE__;var a;this.addEventListener("DOMCharacterDataModified",a=function(d){if(d.currentTarget==this){return;}var b=this.serialize().match(/^[\s\S]*?>([\s\S]*)<[\s\S]*?$/),c=b&&b[1]||"";if(c.indexOf("{")>-1||c.indexOf("[")>-1){this.$setDynamicProperty(this.$childProperty,c);}else{this.setProperty(this.$childProperty,c);}});this.addEventListener("DOMNodeInserted",a);this.addEventListener("DOMNodeRemoved",a);this.addEventListener("DOMNodeInsertedIntoDocument",function(d){if(!this.getElementsByTagNameNS(this.namespaceURI,"*").length&&(this.childNodes.length>1||this.firstChild&&(this.firstChild.nodeType==1||this.firstChild.nodeType!=7&&this.firstChild.nodeValue.trim().length))){var b=(this.$aml&&this.$aml.xml||this.serialize()).match(/^[\s\S]*?>([\s\S]*)<[\s\S]*?$/),c=b&&b[1]||"";if(c.indexOf("{")>-1||c.indexOf("[")>-1){this.$setDynamicProperty(this.$childProperty,c);}else{this.setProperty(this.$childProperty,c);}}else{if(typeof this[this.$childProperty]=="undefined"){this.$propHandlers[this.$childProperty].call(this,"");}}});};apf.__DATAACTION__=1<<25;apf.DataAction=function(){this.$regbase=this.$regbase|apf.__DATAACTION__;this.getActionTracker=function(d){if(!apf.AmlNode){return apf.window.$at;}var b=this,c=d?null:this.$at;if(!c&&this.dataParent){c=this.dataParent.parent.$at;}while(!c){if(!b.parentNode){var a;return(a=this.getModel&&this.getModel(true))&&a.$at||apf.window.$at;}c=(b=b.parentNode).$at;}return c;};this.$actionsLog={};this.$actions=false;this.$startAction=function(b,d,g){if(this.disabled||this.contenteditable&&b!="edit"){return false;}var c=this.$actions&&this.$actions.getRule(b,d);if(!c&&apf.config.autoDisableActions&&this.$actions){return false;}var a=typeof apf.offline!="undefined";if(this.dispatchEvent(b+"start",{xmlContext:d})===false){return false;}this.$actionsLog[b]=d;return true;};this.addEventListener("xmlupdate",function(b){if(apf.xmldb.disableRSB!=2){return;}for(var a in this.$actionsLog){if(apf.isChildOf(this.$actionsLog[a],b.xmlNode,true)){this.$actionsLog[a].rollback.call(this,this.$actionsLog[a].xmlContext);}}});this.$stopAction=function(b,c,a){delete this.$actionsLog[b];};this.$executeAction=function(o,g,b,n,i,c,q){if(this.disabled||this.contenteditable&&b!="edit"){return;}var l=this.$actions&&this.$actions.getRule(b,n);if(!l&&this.$actions&&apf.config.autoDisableActions&&"action|change".indexOf(b)==-1){apf.console.warn("Could not execute action '"+b+"'.               No valid action rule was found and auto-disable-actions is enabled");return false;}var m;if(q){m=[];for(var a=q.length-1;a>=0;a--){m.unshift({xmlActionNode:l&&l[4],amlNode:this,selNode:q[a],xmlNode:q[a]});}}var j=new apf.AmlEvent("before"+b.toLowerCase(),{action:o,args:g,xmlActionNode:l,amlNode:this,selNode:c,multiple:m||false});if(!i){if(this.dispatchEvent(j.name,null,j)===false){return false;}}var d=this.getActionTracker().execute(j);j.xmlNode=d.xmlNode;j.undoObj=d;if(!i){j.name="after"+b.toLowerCase();j.cancelBubble=false;delete j.returnValue;this.dispatchEvent(j.name,null,j);}return d;};this.$executeSingleValue=function(a,l,s,r,j){var k,n,q=this.$getBindRule(l,s);if(!q){return false;}var o=q.value?q.cvalue:q.cmatch;if(!o){if(q.value){o=q.compile("value");}else{return false;}}var t,b=o.xpaths,g=false;if(b[0]=="#"||b[1]=="#"){var d=(q.cvalue3||(q.cvalue3=apf.lm.compile(q.value,{xpathmode:5})))(s);var i=d.model&&d.model.$isModel&&d.model;if(i){var c=i.queryNode(d.xpath);s=i.data;}else{i=apf.xmldb.findModel(d.model);var c=d.model.selectSingleNode(d.xpath);s=d.model;}b[1]=d.xpath;}else{var i=b[0]&&apf.nameserver.get("model",b[0])||this.$model,c=i?i.queryNode(b[1]):(s||this.xmlRoot).selectSingleNode(b[1]);}if(c){if(apf.queryValue(c)==r){return;}t=(c.nodeType==1||c.nodeType==3||c.nodeType==4)?"setTextNode":"setAttribute";n=(c.nodeType==1)?[c,r]:(c.nodeType==3||c.nodeType==4?[c.parentNode,r]:[c.ownerElement||c.selectSingleNode(".."),c.nodeName,r]);}else{if(!this.$createModel){return false;}t="setValueByXpath";k=b[1];if(!s){if(!i){i=this.getModel();}if(i){if(!i.data){i.load("<data />");}k=(i.getXpathByAmlNode(this)||".")+(k&&k!="."?"/"+k:"");s=i.data;}else{if(!this.dataParent){return false;}s=this.dataParent.parent.selected||this.dataParent.parent.xmlRoot;if(!s){return false;}k=(this.dataParent.xpath||".")+(k&&k!="."?"/"+k:"");g=true;}}n=[s,r,k];}if(j){return{func:t,args:n};}this.$executeAction(t,n,a,s);if(g){this.load(s.selectSingleNode(k));}};this.change=function(c,b){if(this.errBox&&this.errBox.visible&&this.isValid&&this.isValid()){this.clearError();}if(!this.xmlRoot&&!this.$createModel||!(this.$mainBind=="value"&&this.hasFeature(apf.__MULTISELECT__)?this.$attrBindings.value:this.$hasBindRule(this.$mainBind))){if(!b&&c===this.value||this.dispatchEvent("beforechange",{value:c})===false){return false;}this.setProperty("value",c);return this.dispatchEvent("afterchange",{value:c});}var a=this.$attrBindings.eachvalue&&"eachvalue"||this.$bindings.value&&"value"||this.$hasBindRule("caption")&&"caption";if(c==(a!="value"&&(this.xmlRoot&&this.$applyBindRule("value",this.xmlRoot,null,true))||this.value)){return false;}this.$executeSingleValue("change",this.$mainBind,this.xmlRoot,c);};this.$booleanProperties["render-root"]=true;this.$supportedProperties.push("create-model","actions");this.$propHandlers["create-model"]=function(a){this.$createModel=a;};this.addEventListener("DOMNodeInsertedIntoDocument",function(a){if(typeof this["create-model"]=="undefined"&&!this.$setInheritedAttribute("create-model")){this.$createModel=true;}});};apf.config.$inheritProperties["create-model"]=1;apf.__CACHE__=1<<2;apf.Cache=function(){this.cache={};this.subTreeCacheContext=null;this.caching=true;this.$regbase=this.$regbase|apf.__CACHE__;this.addEventListener("$load",function(g){if(!this.caching||g.forceNoCache){return;}if(!this.cacheId){this.cacheId=g.xmlNode.getAttribute(apf.xmldb.xmlIdTag)||apf.xmldb.nodeConnect(apf.xmldb.getXmlDocId(g.xmlNode),g.xmlNode);}var d=b.call(this,this.cacheId,g.xmlNode);if(d){if(d==-1){return false;}var c=this.getTraverseNodes();if(c.length&&this.autoselect){this.select(c[0],null,null,null,true);}else{this.clearSelection();}if(!c.length){this.$removeClearMessage();this.$setClearMessage(this["empty-message"],"empty");}if(c.length!=this.length){this.setProperty("length",c.length);}return false;}});this.addEventListener("$clear",function(){if(!this.caching){return;}if(this.hasFeature(apf.__MULTISELECT__)&&this.subTreeCacheContext&&this.subTreeCacheContext.oHtml){if(this.renderRoot){this.subTreeCacheContext.parentNode.insertBefore(this.subTreeCacheContext.oHtml,this.subTreeCacheContext.beforeNode);}else{while(this.$container.childNodes.length){this.subTreeCacheContext.oHtml.appendChild(this.$container.childNodes[0]);}}this.documentId=this.xmlRoot=this.cacheId=this.subTreeCacheContext=null;}else{if(this.$loadedWhenOffline){this.$loadedWhenOffline=false;}else{var c=this.$getCurrentFragment();if(!c){return;}c.documentId=this.documentId;c.xmlRoot=this.xmlRoot;if(this.cacheId||this.xmlRoot){a.call(this,this.cacheId||this.xmlRoot.getAttribute(apf.xmldb.xmlIdTag)||"doc"+this.xmlRoot.getAttribute(apf.xmldb.xmlDocTag),c);}}}});function b(m,i){if(i&&this.hasFeature(apf.__MULTISELECT__)&&this.$isTreeArch){var c,d=i.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId,j=this.$pHtmlDoc.getElementById(d);if(j){c=getId?false:this.$container;}else{for(var l in this.cache){if(this.cache[l]&&this.cache[l].nodeType){j=this.cache[l].getElementById(d);if(j){c=getId?l:this.cache[l];break;}}}}if(c&&!this.cache[m]){var k=this.$findHtmlNode(i.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);this.subTreeCacheContext={oHtml:k,parentNode:k.parentNode,beforeNode:k.nextSibling,cacheItem:c};this.documentId=apf.xmldb.getXmlDocId(i);this.cacheId=m;this.xmlRoot=i;if(this.renderRoot){this.$container.appendChild(k);}else{while(k.childNodes.length){this.$container.appendChild(k.childNodes[0]);}}return true;}}if(!this.cache[m]){return false;}var g=this.cache[m];this.documentId=g.documentId;this.cacheId=m;this.xmlRoot=g.xmlRoot;this.clearCacheItem(m);this.$setCurrentFragment(g);return true;}function a(d,c){if(!this.caching){return;}this.cache[d]=c;}this.$findHtmlNode=function(g){var c=this.$pHtmlDoc.getElementById(g);if(c){return c;}for(var d in this.cache){if(this.cache[d]&&this.cache[d].nodeType){c=this.cache[d].getElementById(g);if(c){return c;}}}return null;};this.clearCacheItem=function(d,c){this.cache[d].documentId=this.cache[d].cacheId=this.cache[d].xmlRoot=null;if(c){apf.destroyHtmlNode(this.cache[d]);}this.cache[d]=null;};this.clearAllCache=function(){for(var c in this.cache){if(this.cache[c]){this.clearCacheItem(c,true);}}};this.getCacheItem=function(c){return this.cache[c];};this.$isCached=function(c){return this.cache[c]||this.cacheId==c?true:false;};if(!this.$getCurrentFragment){this.$getCurrentFragment=function(){var c=this.$container.ownerDocument.createDocumentFragment();while(this.$container.childNodes.length){c.appendChild(this.$container.childNodes[0]);}return c;};this.$setCurrentFragment=function(c){this.$container.appendChild(c);if(!apf.window.hasFocus(this)){this.blur();}};}this.$booleanProperties.caching=true;this.$supportedProperties.push("caching");this.addEventListener("DOMNodeRemovedFromDocument",function(c){this.clearAllCache();});};apf.GuiElement.propHandlers.caching=function(a){if(!apf.isTrue(a)){return;}if(!this.hasFeature(apf.__CACHE__)){this.implement(apf.Cache);}};apf.__RENAME__=1<<10;apf.Rename=function(){this.$regbase=this.$regbase|apf.__RENAME__;this.canrename=true;this.$renameSubject=this.renameTimer=this.lastCursor=null;this.$booleanProperties.canrename=true;this.$booleanProperties.autorename=true;this.$supportedProperties.push("canrename","autorename");this.$propHandlers.autorename=function(c){if(c){this.reselectable=true;this.bufferselect=false;this.addEventListener("afterselect",a);this.addEventListener("keydown",b);}else{this.removeEventListener("afterselect",a);this.removeEventListener("keydown",b);}};function a(){var c=this;$setTimeout(function(){if(c.hasFocus()){c.startRename();}},20);}function b(c){if(!this.renaming&&apf.isCharacter(c.keyCode)){this.startRename();}}this.$isContentEditable=function(c){if(this.renaming&&this.autorename){return true;}};this.rename=function(c,d){if(!c){c=this.caret||this.selected;}if(!c){return;}this.$executeSingleValue("rename","caption",c,d);};this.startDelayedRename=function(d,c,g){if(d&&(d.button==2||d.ctrlKey||d.shiftKey)||g&&this.disabled){return;}clearTimeout(this.renameTimer);this.renameTimer=$setTimeout("apf.lookup("+this.$uniqueId+").startRename()",c||400);};this.startRename=function(i,c,l){if(!i&&(this.renaming||!this.canrename||!this.$startAction("rename",this.caret||this.selected,this.stopRename))||l&&this.disabled){return false;}if(!this.hasFocus()){this.focus(null,null,true);}clearTimeout(this.renameTimer);var m=this.$getCaptionElement?this.$getCaptionElement():this.$caret||this.$selected;if(!m){return this.stopRename();}this.renaming=true;this.$renameSubject=this.caret||this.selected;var d=m.offsetWidth;this.lastCursor=m.style.cursor;m.style.cursor="text";m.parentNode.replaceChild(this.$txt,m);m.host=this;if(apf.isTrue(this.$getOption("main","scalerename"))){var k=apf.getWidthDiff(this.$txt);this.$txt.style.width=(d-k-3)+"px";}this.$replacedNode=m;var g=this.$getCaptionXml?this.$getCaptionXml(this.$renameSubject):this.$getDataNode("caption",this.$renameSubject);value=c||!g?"":(g.nodeType!=1?unescape(decodeURI(g.nodeValue)):(apf.isOnlyChild(g.firstChild,[3,4])?apf.queryValue(g):this.$applyBindRule("caption",this.$renameSubject)))||"";if(apf.hasContentEditable){if(this.$multiLineRename){this.$txt.innerHTML=apf.htmlCleaner.prepare(value.trim().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />"));}else{this.$txt.innerHTML=value.replace(/</g,"&lt;");}}else{this.$txt.value=value;}this.$txt.unselectable="Off";this.$txt.host=this;try{this.$txt.focus();this.$txt.select();}catch(j){}};this.stopRename=function(c,g){clearTimeout(this.renameTimer);if(!this.renaming||c&&c!=this.$renameSubject||!this.$replacedNode){return false;}if(this.$txt.parentNode&&this.$txt.parentNode.nodeType==1){if(apf.isIE8||apf.isIE7Emulate){this.$txt.blur();}this.$txt.parentNode.replaceChild(this.$replacedNode,this.$txt);}this.renaming=false;if(this.$replacedNode){this.$replacedNode.style.cursor=this.lastCursor||"";this.$replacedNode.host=null;}if(this.$multiLineRename){var d=apf.html_entity_decode(apf.htmlCleaner.parse(this.$txt.innerHTML,true).replace(/<br \/>/g,"").replace(/<\/?p>/g,""));}else{var d=this.$txt[apf.hasContentEditable?"innerText":"value"].replace(/<.*?nobr>/gi,"");}if(!g||(this.$validateRename&&!this.$validateRename(d))){this.dispatchEvent("stoprename");this.$stopAction("rename");}else{if(this.$replacedNode){this.$replacedNode.innerHTML=d.replace(/</g,"&lt;").replace(/\r?\n/g,"<br />");}this.rename(this.$renameSubject,d);}if(!this.renaming){this.$renameSubject=null;this.$replacedNode=null;this.$txt.style.width="";}return true;};this.addEventListener("keydown",function(d){var c=d.keyCode;if(this.renaming){if(c==27||this.$multiLineRename&&d.ctrlKey&&c==13||!this.$multiLineRename&&c==13){this.stopRename(null,c==13&&!this.$autocomplete);d.cancelBubble=true;return false;}return;}if(c==113){if(this.$tempsel){this.$selectTemp();}if(this.caret!=this.selected){if(this.multiselect||this.isSelected(this.caret)){this.selected=this.caret;this.$selected=this.$caret;}else{this.select(this.caret,true);}}this.startRename();return false;}},true);this.addEventListener("DOMNodeRemovedFromDocument",function(c){this.$txt.refCount--;if(!this.$txt.refCount){this.$txt.host=this.$txt.onmouseover=this.$txt.onmousedown=this.$txt.select=this.$txt.onfocus=this.$txt.onblur=null;}});this.$init(function(){if(!(this.$txt=document.getElementById("txt_rename"))){if(apf.hasContentEditable){this.$txt=document.createElement("DIV");this.$txt.contentEditable=true;if(apf.isIE6){this.$txt.style.width="1px";}}else{this.$txt=document.createElement("input");this.$txt.id="txt_rename";this.$txt.autocomplete=false;}if(apf.hasFocusBug){apf.sanitizeTextbox(this.$txt);}this.$txt.refCount=0;this.$txt.id="txt_rename";apf.importCssString("#txt_rename{white-space:nowrap}");this.$txt.onselectstart=function(c){(c||event).cancelBubble=true;};apf.sanitizeTextbox(this.$txt);this.$txt.onmouseover=this.$txt.onmouseout=this.$txt.oncontextmenu=this.$txt.onmousedown=function(c){(c||event).cancelBubble=true;};this.$txt.onkeyup=function(){if(!this.host.$autocomplete){return;}this.host.$lookup(this[apf.hasContentEditable?"innerHTML":"value"]);};this.$txt.select=function(){if(!apf.hasMsRangeObject){return this.focus();}var c=document.selection.createRange();try{c.moveToElementText(this);if(apf.isFalse(this.host.$getOption("main","selectrename"))||typeof this.host.$renameStartCollapse!="undefined"){c.collapse(this.host.$renameStartCollapse);}}catch(d){}c.select();};if(apf.hasFocusBug){this.$txt.onfocus=function(){if(apf.window){apf.window.$focusfix2();}};}this.$txt.onblur=function(){if(apf.isGecko){return;}if(apf.hasFocusBug){apf.window.$blurfix();}if(this.host.$autocomplete){return;}this.host.stopRename(null,true);};}this.$txt.refCount++;});};apf.Teleport=function(){this.$init(true);};apf.__TELEPORT__=1<<28;(function(){this.$parsePrio="002";this.$regbase=this.$regbase|apf.__TELEPORT__;this.$booleanProperties.autoroute=true;this.$supportedProperties.push("url","timeout","protocol","route-server","autoroute");this.$propHandlers.url=function(b){var a=new apf.url(b);if(!a.protocol){throw new Error(apf.formatErrorString(0,this,"Communication (Teleport) initialization error","Invalid server url provided."));}this.$domain=a.host;this.$rootPath=a.path;this.$server=b.replace(new RegExp(this.$rootPath+"$"),"");};this.$propHandlers.timeout=function(a){this.timeout=parseInt(a)||10000;};this.$propHandlers.protocol=function(b){var a=b.toLowerCase();if(!apf[a]){throw new Error(apf.formatErrorString(1025,null,"Teleport baseclass","Could not find Ajax.org Teleport RPC Component '"+a+"'",this));}this.implement(apf[a]);};this.toString=function(){return"[Ajax.org Teleport Component : "+(this.name||"")+" ("+this.type+")]";};this.addEventListener("DOMNodeInsertedIntoDocument",function(){if(!apf.http){throw new Error(apf.formatErrorString(1024,null,"Teleport baseclass","Could not find Ajax.org Teleport HTTP Component",this.$aml));}this.implement(apf.http);if(this.id){apf.$asyncObjects[this.id]=1;}});}).call(apf.Teleport.prototype=new apf.AmlElement());apf.Init.run("teleport");apf.__MULTICHECK__=1<<22;apf.MultiCheck=function(){this.$regbase=this.$regbase|apf.__MULTICHECK__;this.multicheck=true;this.checklength=0;this.$checkedList=[];this.check=function(d,j){if(j&&this.disabled||this.$checkedList.indexOf(d)>-1){return;}if(j&&this.$executeSingleValue("checked","checked",d,"true")!==false){return;}if(this.dispatchEvent("beforecheck",{xmlNode:d})===false){return false;}if(!this.multicheck&&this.$checkedList.length){this.clearChecked(true);}this.$checkedList.push(d);if(this.$isTreeArch){var a=d.selectNodes(".//"+this.each.split("|").join("|.//"));this.checkList(a,null,true,true);var g,c=this.getTraverseParent(d);while(c&&c!=this.xmlRoot){a=this.getTraverseNodes(c);g=true;for(var b=0;b<a.length;b++){if(this.$checkedList.indexOf(a[b])==-1){g=false;break;}}apf.setStyleClass(apf.xmldb.getHtmlNode(c,this),g?"checked":"partial",["partial","checked"]);if(g){this.$checkedList.push(c);}c=this.getTraverseParent(c);}}this.$setStyleClass(apf.xmldb.getHtmlNode(d,this),"checked",["partial"]);this.dispatchEvent("aftercheck",{list:this.$checkedList,xmlNode:d});};this.uncheck=function(a,b){if(b&&this.disabled||this.$checkedList.indexOf(a)==-1){return;}if(b&&this.$executeSingleValue("checked","checked",a,"false")!==false){return;}if(this.$isTreeArch){return this.checkList([a],true,true);}if(this.dispatchEvent("beforeuncheck",{xmlNode:a})===false){return false;}this.$checkedList.remove(a);this.$setStyleClass(apf.xmldb.getHtmlNode(a,this),"",["checked","partial"]);this.dispatchEvent("afteruncheck",{list:this.$checkedList,xmlNode:a});};this.checkToggle=function(a,c){if(c&&this.disabled){return;}if(a.style){var b=a,d=b.getAttribute(apf.xmldb.htmlIdTag);while(!d&&b.parentNode){d=(b=b.parentNode).getAttribute(apf.xmldb.htmlIdTag);}a=apf.xmldb.getNode(b);}if(this.$checkedList.indexOf(a)>-1){this.uncheck(a,c);}else{this.check(a,c);}};this.checkList=function(a,b,n,g,o){if(!a.indexOf){a=apf.getArrayFromNodelist(a);}if(o){if(this.disabled){return;}var m=[];for(var l,d=0;d<a.length;d++){l=this.$executeSingleValue("checked","checked",a[d],"false",true);if(l===false){break;}m.push(l);}if(m.length){return this.$executeAction("multicall",m,"checked",a[0],null,null,a.length>1?a:null);}}if(!g&&this.dispatchEvent("beforecheck",{list:a})===false){return false;}if(!b&&!n){this.clearChecked(true);}if(!this.multicheck){a=[a[0]];}var d;if(b){for(d=a.length-1;d>=0;d--){this.$checkedList.remove(a[d]);this.$setStyleClass(apf.xmldb.getHtmlNode(a[d],this),"",["checked"]);}}else{for(d=a.length-1;d>=0;d--){this.$checkedList.push(a[d]);this.$setStyleClass(apf.xmldb.getHtmlNode(a[d],this),"checked");}}if(!g&&this.$isTreeArch){var k=this;function j(z,c){var q=k.getTraverseNodes(z);if(!q.length){if(c){if(b){k.$checkedList.remove(z);k.$setStyleClass(apf.xmldb.getHtmlNode(z,k),"",["checked"]);return 0;}else{if(k.$checkedList.indexOf(z)==-1){k.$checkedList.push(z);k.$setStyleClass(apf.xmldb.getHtmlNode(z,k),"checked");}return 1;}}return k.$checkedList.indexOf(z)>-1?1:0;}var s=k.$checkedList.indexOf(z)!=-1,r=c||a.indexOf(z)>-1&&(b?!s:s),y=true,x=true,w=false,t;for(var u=q.length-1;u>=0;u--){t=j(q[u],r);if(t){x=false;if(!w&&t==2){w=true;}}else{y=false;}if(!y&&!x){w=true;}}if(z==k.xmlRoot){return;}if(y){if(!s){k.$checkedList.push(z);apf.setStyleClass(apf.xmldb.getHtmlNode(z,k),"checked",["partial"]);}}else{if(s){k.$checkedList.remove(z);}apf.setStyleClass(apf.xmldb.getHtmlNode(z,k),w?"partial":"",["partial","checked"]);}return y?1:(x?0:2);}j(this.xmlRoot);}if(!g){this.dispatchEvent("aftercheck",{list:a});}};this.clearChecked=function(b){if(!b&&this.dispatchEvent("beforeuncheck",{xmlNode:this.$checkedList})===false){return false;}for(var a=this.$checkedList.length-1;a>=0;a--){this.$setStyleClass(apf.xmldb.getHtmlNode(this.$checkedList[a],this),"",["checked"]);}this.$checkedList.length=0;if(!b){this.dispatchEvent("afteruncheck",{list:this.$checkedList});}};this.isChecked=function(a){return this.$checkedList.indexOf(a)>-1;};this.getChecked=function(a){var b,c;if(a){c=this.xmlRoot?this.xmlRoot.ownerDocument.createDocumentFragment():apf.getXmlDom().createDocumentFragment();for(b=0;b<this.$checkedList.length;b++){apf.xmldb.cleanNode(c.appendChild(this.$checkedList[b].cloneNode(true)));}}else{for(c=[],b=0;b<this.$checkedList.length;b++){c.push(this.$checkedList[b]);}}return c;};this.checkAll=function(b){if(!this.multicheck||b&&this.disabled||!this.xmlRoot){return;}var a=this.$isTreeArch?this.xmlRoot.selectNodes(".//"+this.each.split("|").join("|.//")):this.getTraverseNodes();this.checkList(a);};this.addEventListener("beforeload",function(){this.clearChecked(true);});this.addEventListener("afterload",function(){if(this.$checkedList.length){this.checkList(this.$checkedList,false,true,false);}});this.addEventListener("xmlupdate",function(c){if(c.action=="synchronize"||c.action=="update"){var b=apf.isTrue(this.$applyBindRule("checked",c.xmlNode));var a=this.isChecked(c.xmlNode);if(b!=a){if(b){this.check(c.xmlNode);}else{this.uncheck(c.xmlNode);}}}});this.addEventListener("aftercheck",function(){if(this.checklength!=this.$checkedList.length){this.setProperty("checklength",this.$checkedList.length);}});this.addEventListener("afteruncheck",function(){if(this.checklength!=this.$checkedList.length){this.setProperty("checklength",this.$checkedList.length);}});};apf.__DOCKING__=1<<18;apf.Docking=function(){this.$regbase=this.$regbase|apf.__DOCKING__;this.startDocking=function(a){apf.DockServer.start(this.aData,this,a);};};apf.DockServer={edge:30,inited:false,init:function(){if(this.inited){return;}this.inited=true;if(!this.nextPositionMarker){this.nextPositionMarker=document.body.appendChild(document.createElement("div"));this.nextPositionMarker.style.border="4px solid #555";this.nextPositionMarker.style.position="absolute";this.nextPositionMarker.style.zIndex=10000;this.nextPositionMarker.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=50);";this.nextPositionMarker.style.opacity=0.5;apf.setUniqueHtmlId(this.nextPositionMarker);}},start:function(d,a,c){if(!this.inited){apf.DockServer.init();}this.dragdata={item:d,amlNode:a,x:c.offsetX||c.layerX,y:c.offsetY||c.layerY};apf.dragMode=true;document.onmousemove=this.onmousemove;document.onmouseup=this.onmouseup;apf.plane.show(this.nextPositionMarker);var g=apf.getAbsolutePosition(d.oHtml),b=apf.getDiff(this.nextPositionMarker);this.nextPositionMarker.style.left=g[0]+"px";this.nextPositionMarker.style.top=g[1]+"px";this.nextPositionMarker.style.width=(d.oHtml.offsetWidth-b[0])+"px";this.nextPositionMarker.style.height=(d.oHtml.offsetHeight-b[1])+"px";this.nextPositionMarker.style.display="block";apf.layout.pause(d.oHtml.parentNode);},floatElement:function(a){this.dragdata.item.setPosition(a.clientX-this.dragdata.x,a.clientY-this.dragdata.y);if(this.dragdata.item.hidden!=3){this.dragdata.item.setFloat();this.dragdata.amlNode.$purgeAlignment();}else{apf.layout.play(this.dragdata.item.oHtml.parentNode);}},setPosition:function(b){var a=apf.getDiff(this.nextPositionMarker);this.nextPositionMarker.style.left=(b.clientX-this.dragdata.x)+"px";this.nextPositionMarker.style.top=(b.clientY-this.dragdata.y)+"px";this.nextPositionMarker.style.width=(this.dragdata.item.size[0]-a[0])+"px";this.nextPositionMarker.style.height=((this.dragdata.item.state<0?this.dragdata.item.size[1]:this.dragdata.item.fheight)-a[1])+"px";document.body.style.cursor="default";},onmousemove:function(G){if(!G){G=event;}if(apf.isIE&&G.button<1){return false;}apf.plane.hide();apf.DockServer.nextPositionMarker.style.top="10000px";var c=document.elementFromPoint(G.clientX+document.documentElement.scrollLeft,G.clientY+document.documentElement.scrollTop);apf.plane.show(apf.DockServer.nextPositionMarker);var C=c;while(C&&!C.host&&C.parentNode){C=C.parentNode;}var D=C&&C.host?C.host:false,m=D.$ext;if(!D.aData||!D.dock){document.body.style.cursor="";apf.setStyleClass(document.body,"same",["south","east","north","west"]);return apf.DockServer.setPosition(G);}if(apf.DockServer.dragdata.item==D.aData&&D.aData.hidden==3){return apf.DockServer.setPosition(G);}var g=D.aData.calcData,j=apf.getAbsolutePosition(m),F=G.clientX-j[0],u=G.clientY-j[1],x=apf.getDiff(apf.DockServer.nextPositionMarker),a=x[1],i=x[0],k=Math.min(apf.DockServer.edge,m.offsetHeight/2),E=Math.min(apf.DockServer.edge,m.offsetWidth/2),y=m.offsetWidth-F,I=m.offsetHeight-u,d,B=I/k,A=F/E,n=u/k,s=y/E;if(B<Math.min(A,s,n)){if(I<=k){d="south";}}else{if(s<Math.min(B,n,A)){if(y<=E){d="east";}}else{if(A<Math.min(B,n,s)){if(F<=E){d="west";}}else{if(n<Math.min(A,s,B)){if(u<=k){d="north";}}}}}if(apf.DockServer.dragdata.item==D.aData){d="same";}if(!d){return apf.DockServer.setPosition(G);}var H=apf.DockServer.nextPositionMarker;if(d=="west"){H.style.left=j[0]+"px";H.style.top=j[1]+"px";H.style.width=((m.offsetWidth/2)-i)+"px";H.style.height=(m.offsetHeight-a)+"px";}else{if(d=="north"){H.style.left=j[0]+"px";H.style.top=j[1]+"px";H.style.width=(m.offsetWidth-i)+"px";H.style.height=(Math.ceil(m.offsetHeight/2)-a)+"px";}else{if(d=="east"){H.style.left=(j[0]+Math.ceil(m.offsetWidth/2))+"px";H.style.top=j[1]+"px";H.style.width=((m.offsetWidth/2)-i)+"px";H.style.height=(m.offsetHeight-a)+"px";}else{if(d=="south"){H.style.left=j[0]+"px";H.style.top=(j[1]+Math.ceil(m.offsetHeight/2))+"px";H.style.width=(m.offsetWidth-i)+"px";H.style.height=(Math.ceil(m.offsetHeight/2)-a)+"px";}else{if(d=="same"){H.style.left=j[0]+"px";H.style.top=j[1]+"px";H.style.width=(m.offsetWidth-i)+"px";H.style.height=(m.offsetHeight-a)+"px";}}}}}document.body.style.cursor="";apf.setStyleClass(document.body,d,["same","south","east","north","west"]);},onmouseup:function(P){if(!P){P=event;}if(apf.isIE&&P.button<1){return false;}apf.plane.hide();apf.dragMode=false;document.onmousemove=document.onmouseup=null;apf.DockServer.nextPositionMarker.style.display="none";document.body.className="";var c=document.elementFromPoint(P.clientX+document.documentElement.scrollLeft,P.clientY+document.documentElement.scrollTop),H=c;while(H&&!H.host&&H.parentNode){H=H.parentNode;}var K=H&&H.host?H.host:false,x=K.$ext,a=K.aData;if(!K.aData||!K.dock||apf.DockServer.dragdata.item==K.aData&&K.aData.hidden==3){return apf.DockServer.floatElement(P);}if(apf.DockServer.dragdata.item==K.aData){return apf.layout.play(x.parentNode);}var s=apf.getAbsolutePosition(x),N=P.clientX-s[0],D=P.clientY-s[1],g,u=Math.min(apf.DockServer.edge,x.offsetHeight/2),L=Math.min(apf.DockServer.edge,x.offsetWidth/2),E=x.offsetWidth-N,Q=x.offsetHeight-D,G=Q/u,F=N/L,y=D/u,C=E/L;if(G<Math.min(F,C,y)){if(Q<=u){g="b";}}else{if(C<Math.min(G,y,F)){if(E<=L){g="r";}}else{if(F<Math.min(G,y,C)){if(N<=L){g="l";}}else{if(y<Math.min(F,C,G)){if(D<=u){g="t";}}}}}if(!g){return apf.DockServer.floatElement(P);}var k=x.parentNode;N=apf.layout.layouts[k.getAttribute("id")];if(!N){return false;}var M=N.root;var J=a;if(apf.DockServer.dragdata.item.hidden==3){apf.DockServer.dragdata.item.unfloat();}var n=apf.DockServer.dragdata.item,i=n.parent;if(i.children.length==2){var B=i.children[(n.stackId==0)?1:0];B.parent=i.parent;B.stackId=i.stackId;B.parent.children[B.stackId]=B;B.weight=i.weight;B.fwidth=i.fwidth;B.fheight=i.fheight;}else{var I=i.children;for(var O=n.stackId;O<I.length;O++){I[O]=I[O+1];if(I[O]){I[O].stackId=O;}}I.length--;}var d=(g=="l"||g=="r")?"hbox":"vbox",A=J.parent,m=apf.layout.getData(d,N.layout);m.splitter=J.splitter;m.edgeMargin=J.edgeMargin;m.id=apf.layout.metadata.push(m)-1;m.parent=A;A.children[J.stackId]=m;m.stackId=J.stackId;m.children=(g=="b"||g=="r")?[J,n]:[n,J];J.parent=n.parent=m;J.stackId=(g=="b"||g=="r")?0:1;n.stackId=(g=="b"||g=="r")?1:0;m.fwidth=J.fwidth;m.fheight=J.fheight;n.weight=J.weight=1;J.fwidth=J.fheight=null;var M=M.copy();N.layout.compile(M);N.layout.reset();apf.layout.activateRules(N.layout.parentNode);}};apf.__INTERACTIVE__=1<<21;apf.Interactive=function(){var m,k,Q,O,b,D=null,P,I,z,J,Y,o,E,S,c,U,a,r,g,y,H,G,R,n=this,T,N,M,B,K,q,d;this.$regbase=this.$regbase|apf.__INTERACTIVE__;this.$propHandlers.draggable=function(t){if(apf.isFalse(t)){this.draggable=t=false;}else{if(apf.isTrue(t)){this.draggable=t=true;}}var w=this.oDrag||this.$ext;if(w.interactive&1){return;}var l=w.onmousedown;w.onmousedown=function(Z){if(l&&l.apply(this,arguments)===false){return;}if((Z||event).button==2){return;}i.apply(this,arguments);};w.interactive=(w.interactive||0)+1;};this.$propHandlers.resizable=function(w){if(apf.isFalse(w)){this.resizable=w=false;}else{if(apf.isTrue(w)){this.resizable=w=true;}}var Z=this.oResize||this.$ext;if(Z.interactive&2){return;}var l=Z.onmousedown;var t=Z.onmousemove;Z.onmousedown=function(){if(l&&l.apply(this,arguments)===false){return;}C.apply(this,arguments);};Z.onmousemove=function(){if(t&&t.apply(this,arguments)===false){return;}x.apply(this,arguments);};Z.interactive=(Z.interactive||0)+2;g=this.$getOption&&parseInt(this.$getOption("Main","resize-border"))||3;y=this.$getOption&&parseInt(this.$getOption("Main","resize-corner"))||12;H=apf.getBox(apf.getStyle(this.$ext,apf.isIE?"borderWidth":"border-width"));};function i(l){if(!l){l=event;}if(!n.draggable||n.editable||apf.dragMode){return;}K=false;apf.dragMode=true;B=false;apf.popup.forceHide();T="absolute|fixed".indexOf(apf.getStyle(n.$ext,"position"))>-1;if(!T){n.$ext.style.position=(T=n.dragSelection)?"absolute":"relative";}if(T&&!n.aData){apf.plane.show(K?oOutline:n.$ext);}var t=T?apf.getAbsolutePosition(n.$ext,n.$ext.offsetParent,true):[parseInt(apf.getStyle(n.$ext,"left"))||0,parseInt(apf.getStyle(n.$ext,"top"))||0];m=t[0]-(N=l.clientX);k=t[1]-(M=l.clientY);document.onmousemove=j;document.onmouseup=function(){document.onmousemove=document.onmouseup=null;if(T&&!n.aData){apf.plane.hide();}var w=K?oOutline:n.$ext;if(B){if(n.setProperty){if(n.right||n.bottom){var Z=n.$ext.offsetParent;if(Z.tagName=="BODY"){Z=document.documentElement;}}if(n.right){n.setProperty("right",Z.offsetWidth-w.offsetLeft-w.offsetWidth);}if(n.bottom){n.setProperty("bottom",Z.offsetHeight-w.offsetTop-w.offsetHeight);}if(P&&(!n.right||n.left)){n.setProperty("left",P);}if(I&&(!n.bottom||n.top)){n.setProperty("top",I);}}else{if(K){n.$ext.style.left=P+"px";n.$ext.style.top=I+"px";}}}P=I=E=S=null;if(!T){n.$ext.style.position="relative";}if(n.showdragging){apf.setStyleClass(n.$ext,"",["dragging"]);}if(T&&K){oOutline.style.display="none";}apf.dragMode=false;if(n.dispatchEvent){n.dispatchEvent("drag",{htmlNode:w});}};if(apf.isIE){apf.window.$mousedown(l);}return false;}function j(Z){if(!Z){Z=event;}if(n.dragSelection){B=true;}if(!B&&n.showdragging){apf.setStyleClass(n.$ext,"dragging");}var t=Z.clientX-N,l=Z.clientY-M,aa;if(!B&&(aa=t*t>l*l?t:l)*aa<2){return;}else{if(!B&&K&&oOutline.style.display!="block"){oOutline.style.display="block";}}var w=K?oOutline:n.$ext;w.style.left=(P=Z.clientX+m)+"px";w.style.top=(I=Z.clientY+k)+"px";B=true;}this.$resizeStart=C;function C(ac,Z){if(!ac){ac=event;}if(!n.resizable||n.editable){return;}q=false;if(!q){var ab=apf.getDiff(n.$ext);R=ab[0];G=ab[1];}b=apf.getAbsolutePosition(n.$ext);b.push(n.$ext.offsetWidth);b.push(n.$ext.offsetHeight);d=apf.getAbsolutePosition(n.$ext,n.$ext.offsetParent);var w=0,t=0,l=(N=ac.clientX)-b[0]+w+document.documentElement.scrollLeft,ad=(M=ac.clientY)-b[1]+t+document.documentElement.scrollTop,aa;if(Z&&Z.resizeType){T="absolute|fixed".indexOf(apf.getStyle(n.$ext,"position"))>-1;aa=Z.resizeType;}else{aa=F.call(n.$ext,l,ad);}Q=l;O=ad;if(!aa){return;}if(n.dispatchEvent&&n.dispatchEvent("resizestart",{type:aa})===false){return;}apf.popup.forceHide();if(n.$ext.style.right){n.$ext.style.left=n.$ext.offsetLeft+"px";n.$ext.style.right="";}if(n.$ext.style.bottom){n.$ext.style.top=n.$ext.offsetTop+"px";n.$ext.style.bottom="";}apf.dragMode=true;B=false;c=aa.indexOf("w")>-1;U=aa.indexOf("n")>-1;a=aa.indexOf("e")>-1;r=aa.indexOf("s")>-1;if(!n.minwidth){n.minwidth=0;}if(!n.minheight){n.minheight=0;}if(!n.maxwidth){n.maxwidth=10000;}if(!n.maxheight){n.maxheight=10000;}if(T){z=b[0]+b[2]-n.minwidth;J=b[1]+b[3]-n.minheight;Y=b[0]+b[2]-n.maxwidth;o=b[1]+b[3]-n.maxheight;}if(T){apf.plane.show(q?oOutline:n.$ext);}if(!Z||!Z.nocursor){if(D===null){D=document.body.style.cursor;}document.body.style.cursor=aa+"-resize";}document.onmousemove=s;document.onmouseup=function(af){document.onmousemove=document.onmouseup=null;if(T){apf.plane.hide();}if(q){var ae=apf.getDiff(n.$ext);R=ae[0];G=ae[1];}W(af||event,true);if(n.setProperty){L();}P=I=E=S=null;document.body.style.cursor=D;D=null;if(q){oOutline.style.display="none";}apf.dragMode=false;if(n.dispatchEvent){n.dispatchEvent("resize");}};if(apf.isIE){apf.window.$mousedown(ac);}return false;}function L(ac,ab,Z,l,w,t){if(typeof ac=="undefined"){ac=P,ab=I,Z=E,l=S,t=G,w=R;}if(T){var aa=n.$ext;if(n.right||n.bottom){var ad=aa.offsetParent;if(ad.tagName=="BODY"){ad=document.documentElement;}}if(n.right&&n.right!=n.setProperty("right",(aa.offsetParent.tagName=="BODY"?apf.getWindowHeight():aa.offsetParent.offsetWidth)+(parseInt(apf.getStyle(aa.offsetParent,apf.descPropJs?"borderLeftWidth":"border-left-width"))||0)-(ac===null?aa.offsetLeft:ac)-aa.offsetWidth)){if(!n.left){aa.style.left="";}}if(n.bottom&&n.bottom!=n.setProperty("bottom",(aa.offsetParent.tagName=="BODY"?apf.getWindowHeight():aa.offsetParent.offsetHeight)+(parseInt(apf.getStyle(aa.offsetParent,apf.descPropJs?"borderTopWidth":"border-top-width"))||0)-(ab===null?aa.offsetTop:ab)-aa.offsetHeight)){if(!n.top){aa.style.top="";}}if(ac&&(!n.right||n.left)){n.setProperty("left",ac);}if(ab&&(!n.bottom||n.top)){n.setProperty("top",ab);}}if(Z&&(!n.left||!n.right)){n.setProperty("width",Z+w);}if(l&&(!n.top||!n.bottom)){n.setProperty("height",l+t);}}this.$updateProperties=L;var V=Math.min,u=Math.max,X;function s(l){if(!l){l=event;}if(X&&new Date().getTime()-X<(q?6:apf.mouseEventBuffer)){return;}X=new Date().getTime();W(l);}function W(aa,Z){var w=q&&!Z?oOutline:n.$ext;var t=document.documentElement.scrollLeft,l=document.documentElement.scrollTop;if(c){w.style.left=(P=u(Y,V(z,d[0]+aa.clientX-N+t)))+"px";w.style.width=(E=V(n.maxwidth-R,u(R,n.minwidth,b[2]-(aa.clientX-N)+t)-R))+"px";}if(U){w.style.top=(I=u(o,V(J,d[1]+aa.clientY-M+l)))+"px";w.style.height=(S=V(n.maxheight-G,u(G,n.minheight,b[3]-(aa.clientY-M)+l)-G))+"px";}if(a){w.style.width=(E=V(n.maxwidth-R,u(R,n.minwidth,aa.clientX-b[0]+(b[2]-Q)+t)-R))+"px";}if(r){w.style.height=(S=V(n.maxheight-G,u(G,n.minheight,aa.clientY-b[1]+(b[3]-O)+l)-G))+"px";}if(n.parentNode&&n.parentNode.localName=="table"){L();apf.layout.processQueue();}if(apf.hasSingleRszEvent){apf.layout.forceResize(n.$int);}}function F(l,Z){var w="",t="";T="absolute|fixed".indexOf(apf.getStyle(n.$ext,"position"))>-1;if(n.resizable==true||n.resizable=="vertical"){if(Z<g+H[0]){w=T?"n":"";}else{if(Z>this.offsetHeight-g){w="s";}else{if(Z>this.offsetHeight-y){t="s";}}}}if(n.resizable==true||n.resizable=="horizontal"){if(l<(w?y:g)+H[0]){w+=t+(T?"w":"");}else{if(l>this.offsetWidth-(w||t?y:g)){w+=t+"e";}}}return w;}var A;function x(Z){if(!Z){Z=event;}if(!n.resizable||n.editable||document.onmousemove){return;}var ac=apf.getAbsolutePosition(n.$ext),w=0,t=0,l=Z.clientX-ac[0]+w+document.documentElement.scrollLeft,ab=Z.clientY-ac[1]+t+document.documentElement.scrollTop;if(!A){A=apf.getStyle(this,"cursor");}var aa=F.call(n.$ext,l,ab);this.style.cursor=aa?aa+"-resize":A||"default";}};apf.GuiElement.propHandlers.resizable=function(a){this.implement(apf.Interactive);this.$propHandlers.resizable.apply(this,arguments);};apf.GuiElement.propHandlers.draggable=function(a){this.implement(apf.Interactive);this.$propHandlers.draggable.apply(this,arguments);};apf.__VIRTUALVIEWPORT__=1<<19;apf.VirtualViewport=function(){this.$init(true);this.$regbase=this.$regbase|apf.__VIRTUALVIEWPORT__;this.virtualVTimer=null;this._xmlUpdate=this.$xmlUpdate;apf.setStyleClass(this.$ext,"virtual");this.$deInitNode=function(g,i){this.viewport.redraw();};this.$moveNode=function(g,i){this.viewport.redraw();};this.emptyNode=apf.xmldb.getXml("<empty />");this.$addEmpty=this.$add;this.$add=function(j,i,k,m,g){var l=this.$pHtmlDoc.getElementById(i);if(!l){return;}this.$updateNode(j,l);};this.$fill=function(){};this.addEventListener("$load",function(){if(!this.viewport.limit){this.viewport.limit=1;}});this.clear=function(i,g){if(this.clearSelection){this.clearSelection(!g);}this.documentId=this.xmlRoot=this.cacheId=null;if(!i){this.viewport.offset=0;this.viewport.length=0;this.viewport.resize(0);this.viewport.sb.update();this.$setClearMessage(this["empty-message"]);}else{if(this.$removeClearMessage){this.$removeClearMessage();}}this.viewport.cache=null;};var a=this;this.viewport={offset:0,limit:2,length:0,sb:new apf.scrollbar(),host:this,cache:null,inited:false,draw:function(){this.inited=true;var g=this.limit;this.limit=0;this.resize(g,true);},redraw:function(){this.change(this.offset);},prepare:function(){if(!this.inited){this.draw();}var k=a.getTraverseNodes();if(!k){return;}var o=apf.xmldb.getXmlDocId(a.xmlRoot),q=a.$container.childNodes;for(var m=0,n=0,g=q.length;n<g;n++){if(q[n].nodeType!=1){continue;}q[n].style.display=(m>=k.length)?"none":"block";apf.xmldb.nodeConnect(o,k[m],q[n],a);m++;}},resize:function(g,l){this.cache=null;var k;if(g<this.limit){var j=a.$container.childNodes;for(k=j.length-1;k>=0;k--){if(j[k].nodeType!=1){continue;}a.$container.removeChild(j[k]);if(--this.limit==g){break;}}}else{if(g>this.limit){for(k=this.limit;k<g;k++){a.$addEmpty(a.emptyNode,"",a.xmlRoot,a.$container);}}else{return;}}this.limit=g;if(l){this.sb.update(this.$container);}},findNewLimit:function(n){var m=a.$container;if(!n){n=m.scrollTop;}if(!a.xmlRoot||m.lastChild&&m.lastChild.style.display=="none"){return;}if(!m.lastChild||m.lastChild.offsetTop+m.lastChild.offsetHeight<=m.offsetHeight+n){var i,j,g,l=a.$getSelection();while(this.limit<this.length-1&&(!m.lastChild||m.lastChild.offsetTop+m.lastChild.offsetHeight<=m.offsetHeight+n)){this.limit++;g=a.getTraverseNodes();if(g.length<this.limit){this.limit=g.length;break;}j=g[g.length-1];i=apf.xmldb.nodeConnect(a.documentId,j,null,a);a.$addEmpty(j,i,a.xmlRoot,m);if(l.indexOf(j)>-1){a.$select(m.lastChild);}else{a.$deselect(m.lastChild);}}}else{if(m.lastChild&&m.lastChild.offsetTop>m.offsetHeight+n){var k;while(this.limit>2&&(k=m.lastChild).offsetTop>m.offsetHeight+n){a.$container.removeChild(k);this.limit--;}}}if(!this.initialLimit){this.initialLimit=this.limit;}},change:function(n,D,u,m){var g;if(n<0){n=0;}if(n>this.length-this.limit-1){g=Math.floor(this.length-this.limit-1);}else{g=Math.floor(n);}if(!D){D=this.limit;}this.cache=null;var r=g-this.offset,B=this.limit;if(r*r>=this.limit*this.limit){r=false;}this.offset=g;if(r>0){var o=a.$container.lastChild;if(o.nodeType!=1){o=o.previousSibling;}}if(u){this.sb.$curValue=this.offset/(this.length-this.limit-1);this.sb.updatePos();}var t=a.getTraverseNodes();if(!t){return;}if(t.length<this.limit){if(n>0){alert("shouldnt get here");}else{this.resize(t.length);}}var y=apf.xmldb.getXmlDocId(a.xmlRoot),s=a.$container.childNodes,l,q,w,x,C,z,A;if(r>0){w=B-r;C=s.length,x=a.$getSelection();for(z=0,A=0;z<r&&A<C;A++){q=a.$container.firstChild;if(q.nodeType==1){z++;l=t[w++];if(l){apf.xmldb.nodeConnect(y,l,q,a);a.$updateNode(l,q);if(x.indexOf(l)>-1){a.$select(q);}else{a.$deselect(q);}q.style.display="block";}else{q.style.display="none";}}a.$container.appendChild(q);}}else{if(r<0){r=r*-1;w=0;x=a.$getSelection();for(z=0,A=s.length-1;z<r&&A>=0;A++){q=a.$container.lastChild;if(q.nodeType==1){z++;l=t[w++];apf.xmldb.nodeConnect(y,l,q,a);a.$updateNode(l,q);if(x.indexOf(l)>-1){a.$select(q);}else{a.$deselect(q);}q.style.display="block";}a.$container.insertBefore(q,a.$container.firstChild);}}else{if(r===false){C=s.length;x=a.$getSelection();for(z=0,A=0;A<C;A++){q=s[A];if(q.nodeType==1){l=t[z++];apf.xmldb.nodeConnect(y,l,q,a);a.$updateNode(l,q);if(x.indexOf(l)>-1){a.$select(q);}else{a.$deselect(q);}}}}}}if(!m){if(n>=this.length-this.initialLimit){r=n-(this.length-this.initialLimit)+2;a.$container.scrollTop=(a.$container.scrollHeight-a.$container.offsetHeight)*(r/2);}else{var k=(n%1)*a.$container.firstChild.offsetHeight;this.findNewLimit(k);a.$container.scrollTop=k;}if(u){this.sb.update();}return;}}};this.viewport.sb.parentNode=new apf.Class().$init();this.viewport.sb.parentNode.$container=this.$pHtmlNode;this.viewport.sb.dispatchEvent("DOMNodeInsertedIntoDocument");this.viewport.sb.attach(this.$container,this.viewport,function(j,k){var i=a.viewport;if(i.sb.realtime||!j){var g=i.length-i.initialLimit;if(g==0){a.$container.scrollTop=k*(a.$container.scrollHeight-a.$container.offsetHeight);}else{i.change(g*k,i.limit,false);}}else{clearTimeout(this.virtualVTimer);this.virtualVTimer=$setTimeout(function(){i.change(Math.round((i.length-i.initialLimit)*k),i.limit,false);},300);}});apf.layout.setRules(this.$container,"scrollbar","        var s = apf.all["+this.viewport.sb.$uniqueId+"];        s.update();    ",true);apf.layout.queue(this.$container);this.$isInViewport=function(m,n){var j=this.getTraverseNodes();for(var k=0,g=j.length;k<g;k++){if(j[k]==m){return true;}}return false;};this.scrollTo=function(i,j){var g={};this.$isInViewport(i,g);this.viewport.change(g.position+(j?this.viewport.limit-1:0));};this.getFirstTraverseNode=function(g){return this.getTraverseNodes(g)[0];};this.$clearVirtualDataset=function(g){var j=g.childNodes;for(var k=j.length-1;k>=0;k--){g.removeChild(j[k]);}};this.$createVirtualDataset=function(j,k,i){var g=j.selectSingleNode("a_marker")||j.appendChild(j.ownerDocument.createElement("a_marker"));g.setAttribute("start","0");if(k){g.setAttribute("end",k);g.setAttribute("reserved",++this.nodeCount[i]);this.nodeCount[i]+=k;}};this.$xmlUpdate=function(){this.viewport.cache=null;this.viewport.length=this.xmlRoot.selectNodes(this.each).length;this.viewport.sb.update(this.$container);this._xmlUpdate.apply(this,arguments);};this.$load=function(g){apf.xmldb.addNodeListener(g,this);if(!this.renderRoot&&!this.getTraverseNodes(g).length){return this.clear("loading");}if(this.$hasBindRule("load")){this.$createVirtualDataset(g);}this.viewport.cache=null;this.viewport.length=this.xmlRoot.selectNodes(this.each).length+1;this.viewport.prepare();var i=this.$addNodes(g,null,null,this.renderRoot);this.viewport.sb.update(this.$container);if(this.selectable){if(this.autoselect){if(i.length){this.$selectDefault(g);}else{this.setProperty("selected",null);}}else{this.clearSelection(true);var j=this.getFirstTraverseNode();if(j){this.setCaret(j);}this.setProperty("selected",null);this.setProperty("chosen",null);}}if(this.$focussable){apf.window.hasFocus(this)?this.$focus():this.$blur();}};this.$loadSubData=function(){};this.$loadPartialData=function(g,m,i){var l,k=this.$getBindRule("load",xmlRootNode);if(k&&(!k[1]||k[1](xmlRootNode))){this.$setLoadStatus(xmlRootNode,"loading");var j=this.getModel(true);j.$insertFrom(k.getAttribute("get"),{ascending:this.$sort?this.$sort.get().ascending:true,xmlNode:l,documentId:this.documentId,marker:g,start:m,length:i,insertPoint:this.xmlRoot,amlNode:this,callback:function(n){a.setProperty("root",a.xmlRoot);var o=parseInt(apf.queryValue(n,k.getAttribute("total")));if(a.viewport.length!=o){a.viewport.length=o;this.$createVirtualDataset(a.xmlRoot,a.viewport.length,a.documentId);}}});}};function b(g,k,l){for(var j=0;j<g;j++){k.push(a.documentId+"|"+(l+j));}}function c(m,s,g,r){var o,j,l,u=this.viewport.limit,t=[];if(s==-1){j=r.selectNodes(a.each);l=0;o=m[0];}else{if(g<0){b(Math.abs(g),t,parseInt(o.getAttribute("reserved"))+parseInt(o.getAttribute("end"))-parseInt(o.getAttribute("start"))+g);g=0;a.$loadPartialData(o);if(t.length==u){return t;}}j=m[s].selectNodes("following-sibling::"+this.each.split("|").join("following-sibling::"));l=m[s].getAttribute("end");o=m[++s];}do{var q=Math.min(o.getAttribute("start")-l,u);for(var n=g;n<q;n++){t.push(j[n]);}if(t.length==u){break;}var k=parseInt(o.getAttribute("end"))-parseInt(o.getAttribute("start"));b(Math.min(k,u-t.length),t,parseInt(o.getAttribute("reserved")));a.$loadPartialData(o);l=parseInt(o.getAttribute("end"));o=m[++s];g=0;}while(t.length<u&&o);a.viewport.cache=t;return t;}this.getTraverseNodes=function(k){if(!this.xmlRoot){return;}if(this.viewport.cache){return this.viewport.cache;}var n=this.viewport.offset+1,g=n+this.viewport.limit;var m=(k||this.xmlRoot).selectNodes("a_marker");if(!m.length){var l=(k||this.xmlRoot).selectNodes("("+this.each+")[position() >= "+n+" and position() < "+(g)+"]");return this.$sort?this.$sort.apply(l):l;}for(var j=0;j<m.length;j++){if(m[j].getAttribute("end")<n){if(j==m.length-1){return c(m,j,n-m[j].getAttribute("end"),(k||this.xmlRoot));}continue;}if(m[j].getAttribute("start")-g<=0&&n>=m[j].getAttribute("start")){return c(m,j,n-m[j].getAttribute("end"),(k||this.xmlRoot));}else{if(m[j-1]){return c(m,j-1,n-m[j-1].getAttribute("end"),(k||this.xmlRoot));}else{return c(m,-1,n,(k||this.xmlRoot));}}}};var d=this.getNextTraverseSelected;this.getNextTraverseSelected=function(l,g,n){if(!l){l=this.selected;}if(!n){n=1;}var m=d.call(this,l,g,n);if(m&&m!=l){return m;}var j=this.getTraverseNodes(),k=0;while(j[k]&&j[k]!=l){k++;}if(g){k=-1*(j.length-k-1);}this.viewport.change(Math.max(0,this.viewport.offset+k+(g?n:-1*n)),null,true,true);j=this.getTraverseNodes();return j[g?j.length-1:0];};this.caching=false;};apf.__TRANSACTION__=1<<3;apf.Transaction=function(){this.$regbase=this.$regbase|apf.__TRANSACTION__;this.$addParent=this.$transactionNode=this.$transactionSubject=this.$originalNode=this.$inTransaction=this.$lastAction=null;this.$supportedProperties.push("autoshow");this.$booleanProperties.autoshow=true;this.commit=function(c){if(!this.$inTransaction){return false;}if(!this.$validgroup&&this.validgroup){this.$validgroup=self[this.validgroup];}if(this.$validgroup&&!this.$validgroup.isValid()){return false;}var b=true;if(!this.$at.undolength){if(c){return false;}this.$at.purge();this.$inTransaction=false;this.load(this.$originalNode);this.$helperModel.reset();b=false;}else{this.$at.reset();this.$inTransaction=false;this.$transactionNode.removeAttribute(apf.xmldb.xmlListenTag);if(this.$lastAction=="add"){if(this.$transactionSubject.$executeAction("appendChild",[this.$addParent,this.$transactionNode],"add",this.$transactionNode)&&this.$transactionSubject.hasFeature(apf.__MULTISELECT__)){this.$transactionSubject.select(this.$transactionNode);}this.$transactionSubject=null;}else{var a=this.$at;this.$at=this.dataParent?this.dataParent.parent.getActionTracker():null;this.$transactionSubject.$executeAction("replaceNode",[this.$originalNode,this.$transactionNode],"update",this.$transactionNode);this.$at=a;}}this.$transactionNode=null;this.$addParent=null;this.$originalNode=null;if(this.autoshow){if(this.autoshow==-1){this.autoshow=true;}else{this.hide();}}return b;};this.rollback=function(a){if(!this.$inTransaction){return;}if(this.$at){if(this.rpcMode=="realtime"){this.$at.undo(-1);}this.$at.reset();}this.$transactionNode=null;this.$addParent=null;if(!a){this.load(this.$originalNode);}this.$helperModel.reset();this.$stopAction(this.$lastAction,true);this.$originalNode=null;this.$inTransaction=false;if(this.autoshow){if(this.autoshow==-1){this.autoshow=true;}else{this.hide();}}};this.begin=function(c,r,g,q){if(this.$inTransaction){if(this.autoshow){this.autoshow=-1;}this.rollback();}var n=this;this.$lastAction=c;if(!this.$lastAction){this.$lastAction=this.xmlRoot&&"update"||"add";}if(q){this.$setDynamicProperty("model","["+q.id+".selected]");}if(r&&this.$lastAction=="update"){this.xmlRoot=r;}if(!this.$at){this.$at=new apf.actiontracker();var m=function(i){n.setProperty(i.prop,i.value);};this.$at.addEventListener("prop.undolength",m);this.setProperty("undolength",0);this.$at.addEventListener("prop.redolength",m);this.setProperty("redolength",0);}if(!this.$helperModel){this.$helperModel=new apf.model();this.$helperModel["save-original"]=true;this.$helperModel.load("<data />");}this.$transactionNode=null;this.$addParent=null;this.$originalNode=this.xmlRoot;this.$inTransaction=true;function b(){this.$inTransaction=-1;this.$helperModel.data.appendChild(this.$transactionNode);this.load(this.$helperModel.data.firstChild);this.$inTransaction=true;if(this.disabled){this.enable();}if(this.autoshow){if(this.autoshow==-1){this.autoshow=true;}else{this.show();}}}q=this.dataParent&&this.dataParent.parent;if(!q||!q.$actions||!q.$actions[this.$lastAction]){q=this;}if(this.$lastAction=="add"){var o,a=q.$actions;if(a){if(r&&r.nodeType){o=a.getRule("add",r);}else{if(typeof r=="string"){if(r.trim().charAt(0)=="<"){r=apf.getXml(r);o=a.getRule("add",r);}else{var t=a.$rules.add;for(var j=0,d=t.length;j<d;j++){if(t[j].getAttribute("type")==r){r=null;o=t[j];break;}}}}}if(!o){o=(q.$actions.add||{})[0];}}else{o=null;}var k=this.$isTreeArch?this.selected||this.xmlRoot:this.xmlRoot;var s=function(u,w,i){if(w!=apf.SUCCESS){var x;x=new Error(apf.formatErrorString(1032,q,"Loading xml data","Could not add data for control "+q.name+"["+q.tagName+"] \nUrl: "+i.url+"\nInfo: "+i.message+"\n\n"+r));if(i.tpModule.retryTimeout(i,w,q,x)===true){return true;}throw x;}if(typeof u!="object"){u=apf.getXmlDom(u).documentElement;}if(u.getAttribute(apf.xmldb.xmlIdTag)){u.setAttribute(apf.xmldb.xmlIdTag,"");}if(!q.$startAction("add",u,n.rollback)){return false;}var l=(q.$actions&&q.$actions.getRule("add",q.$isTreeArch?q.selected:q.xmlRoot)||{})[2];if(g){n.$addParent=g;}else{if(l&&l.getAttribute("parent")){n.$addParent=q.xmlRoot.selectSingleNode(l.getAttribute("parent"));}else{n.$addParent=q.$isTreeArch?q.selected||q.xmlRoot:q.xmlRoot;}}if(!n.$addParent){n.$addParent=q.xmlRoot||q.getModel(true).data;}if(apf.isWebkit&&n.$addParent.ownerDocument!=u.ownerDocument){u=n.$addParent.ownerDocument.importNode(u,true);}n.$transactionNode=u;n.$transactionSubject=q;b.call(n);};if(r){return s(r,apf.SUCCESS);}else{if(o&&o.get){return apf.getData(o.get,{xmlNode:k,callback:s});}else{}}}else{if(!q.$startAction(this.$lastAction,this.xmlRoot,this.rollback)){return false;}this.$transactionSubject=q;this.$transactionNode=this.$originalNode.cloneNode(true);b.call(this);}};this.$canLoadData=function(){return true;};this.addEventListener("prop.model",function(a){return false;});this.clear=function(){this.documentId=this.xmlRoot=this.cacheId=null;};this.addEventListener("beforeload",function(b){var a=b.xmlNode;if(this.$inTransaction==-1){return;}if(this.$inTransaction){if(this.$transactionNode&&a!=this.$transactionNode){if(this.autoshow){this.autoshow=-1;}this.rollback(true);}else{return;}}if(this.autoshow){this.autoshow=-1;}if(this.begin("update",a)!==false){return false;}});};apf.GuiElement.propHandlers.transaction=function(b){if(!(this.transaction=apf.isTrue(b))){return;}if(!this.hasFeature(apf.__DATABINDING__)){this.implement(apf.StandardBinding);}if(!this.hasFeature(apf.__DATAACTION__)){this.implement(apf.DataAction);if(this.actions){this.$propHandlers.actions.call(this,this.actions,"actions");}}if(!this.hasFeature(apf.__TRANSACTION__)){this.implement(apf.Transaction);if(!this.validgroup){this.$validgroup=new apf.ValidationGroup();this.$validgroup.register(this);}if(!this.id){this.setProperty("id",this.localName+"_"+this.$uniqueId);}var a=this.attributes.getNamedItem("model");if(!a){this.attributes.push(a=new apf.AmlAttr(this,"model",null));}a.inheritedValue="{"+this.id+".root}";if(typeof this.autoshow=="undefined"&&(this.localName=="modalwindow"||this.localName=="window")){this.autoshow=true;}}};apf.BaseStateButtons=function(){this.state="normal";this.edit=false;this.animate=true;var i={min:["minimized","minimize","restore"],max:["maximized","maximize","restore"],edit:["edit","edit","closeedit"],close:["closed","close","show"]};this.$lastheight=null;this.$lastpos=null;this.$lastzindex=null;this.$lastState={normal:true};this.$booleanProperties.animate=true;this.$supportedProperties.push("buttons","animate","state");this.close=function(){this.setProperty("state",this.state.split("|").pushUnique("closed").join("|"),false,true);return this;};this.minimize=function(){this.setProperty("state",this.state.split("|").remove("maximized").remove("normal").pushUnique("minimized").join("|"),false,true);return this;};this.maximize=function(){this.setProperty("state",this.state.split("|").remove("minimized").remove("normal").pushUnique("maximized").join("|"),false,true);return this;};this.restore=function(){this.setProperty("state",this.state.split("|").remove("minimized").remove("maximized").pushUnique("normal").join("|"),false,true);return this;};this.edit=function(j){this.setProperty("state",this.state.split("|").pushUnique("edit").join("|"),false,true);return this;};this.closeedit=function(j){this.setProperty("state",this.state.split("|").remove("edit").join("|"),false,true);return this;};this.$toggle=function(j){var k=i[j][0];this[i[j][this.state.indexOf(k)>-1?2:1]]();};this.$propHandlers.refparent=function(j){if(typeof j=="string"){this.$refParent=self[j]&&self[j].$ext||document.getElementById(j);}else{this.$refParent=j;}};this.$propHandlers.state=function(y,z,F,n){var k=this;if(!this.$amlLoaded){apf.queue.add("state"+this.$uniqueId,function(){k.$propHandlers.state.call(k,y,z);});return;}var D,j,H,A,u,x={},w=y.split("|"),C=this.$lastState,r=[];for(D=0;D<w.length;D++){x[w[D]]=true;}x.value=y;if(!x.maximized&&!x.minimized){x.normal=true;}if(!n&&this.dispatchEvent("beforestatechange",{from:C,to:x})===false){this.state=C.value;return false;}if(x.closed==this.visible){this.setProperty("visible",!x.closed);}if(x.normal!=C.normal||!x.normal&&(x.minimized!=C.minimized||x.maximized!=C.maximized)){if(this.$lastheight){this.$ext.style.height=this.$lastheight;}if(this.$lastpos){if(this.animate&&!z){var q=this.$ext;H=apf.getStyle(q,"position");if(H!="absolute"){A=parseInt(apf.getStyle(q,"left"))||0;u=parseInt(apf.getStyle(q,"top"))||0;}else{A=q.offsetLeft;u=q.offsetTop;}this.animstate=1;apf.tween.multi(q,{steps:5,interval:10,tweens:[{type:"left",from:A,to:this.$lastpos.px[0]},{type:"top",from:u,to:this.$lastpos.px[1]},{type:"width",from:this.$ext.offsetWidth-g,to:this.$lastpos.px[2]},{type:"height",from:this.$ext.offsetHeight-b,to:this.$lastpos.px[3]}],oneach:function(){if(apf.hasSingleRszEvent){apf.layout.forceResize(k.$int);}},onfinish:function(){k.$propHandlers.state.call(k,y,true,null,true);}});return;}this.$ext.style.left=this.$lastpos.css[0];this.$ext.style.top=this.$lastpos.css[1];this.$ext.style.width=this.$lastpos.css[2];this.$ext.style.height=this.$lastpos.css[3];j=this.$lastpos.parentNode;j.style.width=this.$lastpos.parent[0];j.style.height=this.$lastpos.parent[1];j.style.overflow=this.$lastpos.parent[2];}if(this.aData&&this.aData.restore){this.aData.restore();}if(apf.layout){apf.layout.play(this.$pHtmlNode);}if(this.$lastzindex){this.$ext.style.zIndex=this.$lastzindex[0];if(this.oCover){this.oCover.style.zIndex=this.$lastzindex[1];}}this.$lastheight=this.$lastpos=this.$lastzindex=null;if(x.normal){r.push("",this.$baseCSSname+"Max",this.$baseCSSname+"Min");}}if(x.minimized!=C.minimized){if(x.minimized){r.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){this.$lastheight=apf.getStyle(this.$ext,"height");this.$ext.style.height=Math.max(0,this.collapsedHeight-apf.getHeightDiff(this.$ext))+"px";}if(this.hasFocus()){apf.window.moveNext(null,this,true);}}else{r.push(this.$baseCSSname+"Min");$setTimeout(function(){apf.window.$focusLast(k);});}}if(x.maximized!=C.maximized){if(x.maximized){r.unshift(this.$baseCSSname+"Max",this.$baseCSSname+"Min",this.$baseCSSname+"Edit");j=this.$refParent;if(!j){j=(this.$ext.offsetParent==document.body?document.documentElement:this.$ext.parentNode);}k.animstate=0;var G=false,q=this.$ext;var H=apf.getStyle(q,"position");if(H=="absolute"){j.style.overflow="hidden";A=q.offsetLeft;u=q.offsetTop;}else{var m=apf.getAbsolutePosition(q,j);A=m[0];u=m[1];}this.$lastpos={css:[this.$ext.style.left,this.$ext.style.top,this.$ext.style.width,this.$ext.style.height],px:[A,u,this.$ext.offsetWidth-g,this.$ext.offsetHeight-b],parent:[j.style.width,j.style.height,j.style.overflow],parentNode:j};var B=[q.offsetWidth,q.offsetHeight];function E(){var l=!apf.isIE&&j==document.documentElement?window.innerWidth:j.offsetWidth,o=!apf.isIE&&j==document.documentElement?window.innerHeight:j.offsetHeight;if(H!="absolute"){var I=apf.getDiff(j);l-=I[0]+(!k.$refParent&&apf.isIE8?4:0);o-=I[0]+(!k.$refParent&&apf.isIE8?4:0);}else{if(!k.$refParent&&apf.isIE8){l-=4;o-=4;}}var t=k.$refParent?[0,0,0,0]:d,J=j!=q.offsetParent?apf.getAbsolutePosition(j,q.offsetParent):[0,0],s=apf.getDiff(j);j.style.width=(j.offsetWidth-s[0])+"px";j.style.height=(j.offsetHeight-s[1])+"px";if(k.animate&&!G){k.animstate=1;G=true;apf.tween.multi(q,{steps:5,interval:10,tweens:[{type:"left",from:A,to:J[0]-t[3]},{type:"top",from:u,to:J[1]-t[0]},{type:"width",from:B[0]-g,to:(l-g+t[1]+t[3])},{type:"height",from:B[1]-b,to:(o-b+t[0]+t[2])}],oneach:function(){if(apf.hasSingleRszEvent){apf.layout.forceResize(k.$int);}},onfinish:function(){k.animstate=0;k.dispatchEvent("afterstatechange",{from:C,to:x});}});}else{if(!k.animstate){q.style.left=(J[0]-t[3])+"px";q.style.top=(J[1]-t[0])+"px";q.style.width=(l-g+t[1]+t[3])+"px";q.style.height=(o-b+t[0]+t[2])+"px";}}}if(apf.layout){apf.layout.pause(this.$pHtmlNode,E);}this.$lastzindex=[this.$ext.style.zIndex||1,this.oCover&&this.oCover.style.zIndex||1];if(this.oCover){this.oCover.style.zIndex=apf.WinServer.count+1;}this.$ext.style.zIndex=apf.WinServer.count+2;}else{r.push(this.$baseCSSname+"Max");}}if(x.edit!=C.edit){if(x.edit){r.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;}r.push(this.$baseCSSname+"Edit");if(r.length==1){r.unshift("");}if(this.btnedit){c.edit.innerHTML="edit";}}}if(r.length||x.closed!=C.closed){if(r.length){this.$setStyleClass(this.$ext,r.shift(),r);}if(x.edit){this.dispatchEvent("prop.visible",{value:true});if(k.oSettings){apf.layout.forceResize(k.oSettings);}}if(!x.maximized||C.maximized&&k.animate){k.dispatchEvent("afterstatechange",{from:C,to:x});}this.$lastState=x;if(this.aData&&!x.maximized){this.$purgeAlignment();}if(!this.animate&&apf.hasSingleRszEvent&&apf.layout){apf.layout.forceResize(k.$int);}}};var d,g,b,c={};this.$propHandlers.buttons=function(o){if(apf.isIphone){return;}if(!this.$hasLayoutNode("button")){return;}var m=o&&(o=o.replace(/(\|)\||\|$/,"$1")).split("|")||[],j=this.$buttons.childNodes,r=o&&new RegExp("("+o+")"),s={},q=[];for(var l=0;l<j.length;l++){if(j[l].nodeType!=1||j[l].tagName!="DIV"){continue;}if(j[l].getAttribute("button")&&(!o||!j[l].className||!j[l].className.match(r))){j[l].style.display="none";this.$setStyleClass(j[l],"",["min","max","close","edit"]);q.push(j[l]);}else{s[RegExp.$1]=j[l];}}for(l=0;l<m.length;l++){if(!m[l]){continue;}if(s[m[l]]){this.$buttons.insertBefore(s[m[l]],this.$buttons.firstChild);continue;}var k=q.pop();if(!k){this.$getNewContext("button");k=this.$getLayoutNode("button");k.setAttribute("button","button");a.call(this,k);k=apf.insertHtmlNode(k,this.$buttons);}this.$setStyleClass(k,m[l],["min","max","close","edit"]);k.onclick=new Function("apf.lookup("+this.$uniqueId+").$toggle('"+m[l]+"')");k.style.display="block";c[m[l]]=k;this.$buttons.insertBefore(k,this.$buttons.firstChild);}var n=apf.getDiff(this.$ext);g=n[0];b=n[1];d=apf.getBox(apf.getStyle(this.$ext,"borderWidth"));};function a(j){j.setAttribute("onmousedown","var o = apf.all["+this.$uniqueId+"];             o.$setStyleClass(this, 'down', null, true);             var o = apf.findHost(this).$ext;             if (o.onmousedown) o.onmousedown(event);             event.cancelBubble = true;             apf.window.$mousedown(event);");j.setAttribute("onmouseup","var o = apf.all["+this.$uniqueId+"];             o.$setStyleClass(this, '', ['down'], true);");j.setAttribute("onmouseover","var o = apf.all["+this.$uniqueId+"];             o.$setStyleClass(this, 'hover', null, true);");j.setAttribute("onmouseout","var o = apf.all["+this.$uniqueId+"];             o.$setStyleClass(this, '', ['hover', 'down'], true);");}this.$initButtons=function(n){this.collapsedHeight=this.$getOption("Main","collapsed-height");var m=this.$getLayoutNode("main","buttons",n);if(!m||apf.isIphone||!this.getAttribute("buttons")||!this.$hasLayoutNode("button")){return;}var j=(this.getAttribute("buttons")||"").split("|").length;for(var l,k=0;k<j;k++){this.$getNewContext("button");l=m.appendChild(this.$getLayoutNode("button"));l.setAttribute("button","button");a.call(this,l);}};this.addEventListener("DOMNodeRemovedFromDocument",function(k){for(var j in c){c[j].onclick=null;}});};apf.BaseTab=function(){this.$init(true);};(function(){this.isPaged=true;this.$focussable=apf.KEYBOARD;this.length=0;this.isLoading={};this.inited=this.ready=false;this.set=function(x,y,w){if(w||this.src&&!this.$findPage(x,{})){return this.$propHandlers.activepage.call(this,x,null,null,y,w);}if(y&&this.activepage==x){return y();}this.$lastCallback=y;this.setProperty("activepage",x);};this.$supportedProperties.push("activepage","activepagenr","length","src","loading");this.$propHandlers.activepagenr=this.$propHandlers.activepage=function(z,w,x,E,A){if(!this.inited||apf.isNot(z)){return;}if(!E){E=this.$lastCallback;delete this.$lastCallback;}var B,y={};B=this.$findPage(z,y);if(!B){if(this.src){if(this.isLoading[z]){return;}if(this.$findPage("loading",{})){this.$propHandlers.activepage.call(this,"loading");}this.setProperty("loading",true);this.isLoading[z]=true;B=this.ownerDocument.createElementNS(apf.ns.apf,"page");B.setAttribute("id",z);this.appendChild(B);var C=this;B.insertMarkup(this.src,{page:z,callback:function(F){if(!F.xmlNode){var G=new Error(apf.formatErrorString(0,null,"Loading new page","Could not load new page: "+C.src));C.setProperty("loading",false);if(this.dispatchEvent("error",apf.extend({error:G,bubbles:true},F))===false){return true;}throw G;}else{C.setProperty("activepage",z);if(E){E();}C.setProperty("loading",false);}}});return;}return false;}if(B.parentNode!=this){return false;}if(!B.visible||B.disabled){return false;}if(z.tagName){z=y.position;this.activepage=B.name||z;}if(!A){var D={previous:this.activepage,previousId:this.activepagenr,previousPage:this.$activepage,next:z,nextId:y.position,nextpage:B};if(this.dispatchEvent("beforeswitch",D)===false){if(this.hideLoader){this.hideLoader();}return false;}}this.activepagenr=y.position;this.setProperty("activepagenr",y.position);if(this.$activepage){this.$activepage.$deactivate();}B.$activate();this.$activepage=B;this.scrollIntoView(B);if(this.hideLoader){if(B.$rendered!==false){this.hideLoader();}else{B.addEventListener("afterrender",function(){this.parentNode.hideLoader();});}}if(!A){if(B.$rendered!==false){this.dispatchEvent("afterswitch",D);}else{B.addEventListener("afterrender",function(){this.parentNode.dispatchEvent("afterswitch",D);});}}if(typeof E=="function"){E();}return true;};this.getPages=function(){var z=[],x=this.childNodes;for(var y=0,w=x.length;y<w;y++){if("page|case".indexOf(x[y].localName)>-1){z.push(x[y]);}}return z;};this.getPage=function(w){if(apf.isNot(w)){return this.$activepage;}else{return this.$findPage(w);}};this.add=function(w,x,y){var z=apf.document.createElement(y||"page");if(x){z.setAttribute("id",x);}if(w){z.setAttribute("caption",w);}this.appendChild(z);this.scrollIntoView(z);return z;};this.remove=function(w){var x=this.$findPage(w);if(!x){return false;}x.removeNode();this.setScrollerState();return x;};var c={scrollOn:false,steps:15,interval:10,size:0,left:0,control:{stop:false},stopHandle:function(){i=false;}},s=1,o=2,u=4,t=8,l=s,q=s,d=1,a=2,n=4,i=false,j=null,m=false,b=d;function k(){var x="cache_"+this.$buttons.childNodes.length;if(c[x]){return c[x];}var z=0;for(var y=0,w=this.$buttons.childNodes.length;y<w;y++){if(typeof this.$buttons.childNodes[y].offsetWidth!="undefined"){z+=this.$buttons.childNodes[y].offsetWidth;}}return c[x]=z;}function g(w,y){var x=w&n;if(x){w=d;}var z=this[w&d?"oLeftScroll":"oRightScroll"];if(!(y&t)){if(w&d){l=y;}else{q=y;}}if(y&s){apf.setStyleClass(z,"",["disabled","hover","down"]);}else{if(y&o){apf.setStyleClass(z,"hover",["disabled","down"]);}else{if(y&u){apf.setStyleClass(z,"down",["disabled","hover"]);}else{if(y&t){apf.setStyleClass(z,"disabled",["hover","down"]);}}}}if(x){g(a,y);}}this.setScrollerState=function(y,x){if(!this.ready||!this.$hasButtons||!this.oScroller){return;}if(typeof y=="undefined"){var w=this.oScroller.offsetWidth||parseInt(apf.getStyle(this.oScroller,"width").replace(/(px|em|%)/,""));y=((k.call(this)+w)>this.$ext.offsetWidth);x=n;}if(x&n&&y!==c.scrollOn){c.scrollOn=y;if(!y){this.$buttons.style.left=c.left+"px";this.oScroller.style.display="none";}}else{this.oScroller.style.display="";}this.oScroller.style.display=(x&n&&!y)?"none":"";if(typeof x=="undefined"){x=n;}if(!y){if((x&d)||(x&n)){g.call(this,d,t);}if((x&a)||(x&n)){g.call(this,a,t);}}};this.correctScrollState=function(){if(!this.ready||!this.$hasButtons||!this.oScroller){return;}this.setScrollerState();};function r(x,w){if(c.size<=0){c.left=this.$buttons.offsetLeft;c.size=Math.round(this.firstChild.$button.offsetWidth);}if(x&d){return c.left;}else{if(x&a){var y=this.$buttons.childNodes[this.$buttons.childNodes.length-1];return this.$ext.offsetWidth-(y.offsetLeft+y.offsetWidth+(this.oScroller.offsetWidth+4));}}}this.scroll=function(C,z){if(!this.ready||!this.$hasButtons||!this.oScroller){return;}if(!C){C=window.event;}if(typeof C.type=="unknown"){C={type:"click"};}if(i&&C.type!="dblclick"){return;}i=true;if(typeof z=="undefined"){z=d;}var x=this.$buttons.offsetLeft,B=C.delta?Math.round(C.delta*36):c.size,A=r.call(this,z),w=this;if(z&d){g(d,u);g(a,s);if(x===A){this.setScrollerState(false,d);return apf.tween.single(this.$buttons,{steps:c.steps,interval:20,from:x,to:x+12,type:"left",anim:apf.tween.EASEOUT,onstop:c.stopHandle,onfinish:function(D){apf.tween.single(D,{steps:c.steps,interval:c.interval,from:x+12,to:x,type:"left",anim:apf.tween.EASEIN,onstop:c.stopHandle,onfinish:function(){i=false;if(C.name=="mousescroll"){g(d,s);}}});}});}var y=x+(C.type=="dblclick"?B*3:B);if(y>A){y=A;}if(y===A){this.setScrollerState(false,d);}this.setScrollerState(true,a);apf.tween.single(this.$buttons,{steps:c.steps,interval:c.interval,control:c.control,from:x,to:y,type:"left",anim:apf.tween.NORMAL,onstop:c.stopHandle,onfinish:function(){i=false;if(C.name=="mousescroll"){g(d,s);}if(m){w.scroll(C,b);}}});}else{if(z&a){this.setScrollerState(true);g(a,u);g(d,s);if(x===A){this.setScrollerState(false,a);return apf.tween.single(this.$buttons,{steps:c.steps,interval:20,from:x,to:x-24,type:"left",anim:apf.tween.EASEOUT,onstop:c.stopHandle,onfinish:function(E,D){apf.tween.single(E,{steps:c.steps,interval:c.interval,from:x-24,to:x,type:"left",anim:apf.tween.EASEIN,onstop:c.stopHandle,onfinish:function(){i=false;if(C.name=="mousescroll"){g(a,s);}}});}});}var y=x-(C.type=="dblclick"?B*3:B);if(y<A){y=A;}apf.tween.single(this.$buttons,{steps:c.steps,interval:c.interval,control:c.control,from:x,to:y,type:"left",anim:apf.tween.NORMAL,onstop:c.stopHandle,onfinish:function(){i=false;if(C.name=="mousescroll"){g(a,s);}if(m){w.scroll(C,b);}}});}}};this.scrollIntoView=function(A){i=false;if(!this.ready||!this.$hasButtons||!this.oScroller||!A.$drawn){return;}i=true;if(this.$buttons.offsetWidth<this.$ext.offsetWidth){return this.setScrollerState(false);}var C=A.$button.offsetLeft,E=A.$button.offsetWidth,B=this.$buttons.offsetLeft;if(c.size<=0){c.left=this.$buttons.offsetLeft;var y=this.firstChild;while(!y.$button){y=y.nextSibling;}c.size=Math.round(y.$button.offsetWidth);}this.$buttons.style.left=B;var w=this.$ext.offsetWidth,x=this.oScroller.offsetWidth+4,D=null,z;if((C+E)>((w-x)-B)){D=(-(C-c.left)+(w-E-x));z=a;}else{if((B+C)<c.left){D=c.left-C;z=d;}}if(D!==null){this.setScrollerState(true);g(a,z&a?u:s);g(d,z&d?u:s);apf.tween.clearQueue(this.$buttons,true);apf.tween.single(this.$buttons,{steps:c.steps,interval:c.interval,from:B,to:D,type:"left",anim:apf.tween.NORMAL,onstop:c.stopHandle,onfinish:function(){i=false;g(a,s);g(d,s);}});}else{i=false;}};this.addEventListener("DOMNodeRemoved",function(x){var w=x.currentTarget;if(x.$doOnlyAdmin||x.relatedNode!=this||w.localName!="page"){return;}if(this.firstChild==w&&w.nextSibling){w.nextSibling.$first();}if(this.lastChild==w&&w.previousSibling){w.previousSibling.$last();}if(this.$activepage==w){if(w.nextSibling||w.previousSibling){this.set(w.nextSibling||w.previousSibling);}else{this.setScrollerState();this.$activepage=this.activepage=this.activepagenr=null;}}else{this.setScrollerState();}this.setProperty("length",this.childNodes.length);});this.addEventListener("DOMNodeInserted",function(z){var w=z.currentTarget;if(w.localName!="page"||z.relatedNode!=this){return;}if(!z.$beforeNode){var x;if(x=this.lastChild){if(x.nodeType!=1){x=x.previousSibling;}if(x){x.$last(true);}}w.$last();}if(!this.firstChild||z.$beforeNode==this.firstChild){if(this.firstChild){this.firstChild.$first(true);}w.$first();}if(this.$activepage){var y={};this.$findPage(this.$activepage,y);if(this.activepagenr!=y.position){if(parseInt(this.activepage)==this.activepage){this.activepage=y.position;this.setProperty("activepage",y.position);}this.activepagenr=y.position;this.setProperty("activepagenr",y.position);}}else{if(!this.$activepage){this.set(w);}}this.setProperty("length",this.childNodes.length);});this.$findPage=function(B,C){var A,x=this.childNodes;for(var z=0,y=0,w=x.length;y<w;y++){A=x[y];if("page|case".indexOf(A.localName)>-1&&(z++==B||(B.localName&&A||A.name)==B)){if(C){C.position=z-1;}return A;}}return null;};this.$enable=function(){var x=this.childNodes;for(var y=0,w=x.length;y<w;y++){if(x[y].enable){x[y].enable();}}};this.$disable=function(){var x=this.childNodes;for(var y=0,w=x.length;y<w;y++){if(x[y].disable){x[y].disable();}}};this.addEventListener("keydown",function(y){if(!this.$hasButtons){return;}var x,w=y.keyCode;switch(w){case 9:break;case 13:break;case 32:break;case 37:x=this.getPage().previousSibling;while(x&&(x.nodeType!=1||"page|case".indexOf(x.localName)==-1||!x.visible)){x=x.previousSibling;}if(x){this.setProperty("activepage",x);}break;case 39:x=this.getPage().nextSibling;while(x&&(x.nodeType!=1||"page|case".indexOf(x.localName)==-1||!x.visible)){x=x.nextSibling;}if(x){this.setProperty("activepage",x);}break;default:return;}},true);this.$loadChildren=function(F){var D=false,E=this,C,A,y,x,w;this.inited=true;if(this.$hasButtons){this.$buttons=this.$getLayoutNode("main","buttons",this.$ext);this.$buttons.setAttribute("id",this.$uniqueId+"_buttons");}this.oPages=this.$getLayoutNode("main","pages",this.$ext);this.oScroller=this.$getLayoutNode("main","scroller",this.oPages);if(this.oScroller){function B(H,G){clearTimeout(j);b=G;j=$setTimeout(function(){m=true;E.scroll(H,G);},500);}function z(){clearTimeout(j);m=false;}this.oScroller.onmouseout=function(G){c.control.stop=true;g(n,s);};this.oLeftScroll=apf.getNode(this.oScroller,[0]);this.oRightScroll=apf.getNode(this.oScroller,[1]);["oLeftScroll","oRightScroll"].forEach(function(I){var G=I=="oLeftScroll"?d:a,H=I=="oLeftScroll"?a:d;E[I].ondbclick=E[I].onmousedown=function(K){c.control.stop=false;var J=G&d?l:q;if(this.className.indexOf("disabled")!=-1||J&u){return;}K=K||event;E.scroll(K,G);B(K,G);if(!apf.isSafariOld){this.onmouseout();}};E[I].onmouseover=function(){c.control.stop=false;var J=G&d?l:q;if(this.className.indexOf("disabled")!=-1||J&u){return;}g(G,o);g(H,s);b=G;};E[I].onmouseout=function(){var J=G&d?l:q;if(this.className.indexOf("disabled")!=-1||J&u){return;}g(G,s);};E[I].onmouseup=function(){if(this.className.indexOf("disabled")==-1){g(G,s);}z();c.control.stop=true;};});}apf.layout.setRules(this.$ext,this.$uniqueId+"_tabscroller","var o = apf.all["+this.$uniqueId+"]; o && o.correctScrollState()");apf.layout.queue(this.$ext);if(this.$int){this.$int=this.oPages;D=true;w=this.childNodes;for(C=0;C<w.length;C++){x=w[C];if(x.nodeType!=1){continue;}x.$draw(true);if(x.$skinchange){x.$skinchange();}x.$loadAml();}}else{this.$int=this.oPages;w=this.childNodes;for(A=0,C=0,y=w.length;C<y;C++){if("page|case".indexOf((x=w[C]).localName)>-1){if(A++==0){x.$first();}if(A==y){x.$last();}}}}if(x){this.activepage=(typeof this.activepage!="undefined"?this.activepage:this.activepagenr)||0;D=this.getPage(this.activepage);if(D.render!="runtime"||D.$rendered){this.$propHandlers.activepage.call(this,this.activepage);}}else{this.isPages=false;}this.setProperty("length",A);this.ready=true;window.setTimeout(function(){E.setScrollerState();},0);if(!this.activepage&&this.getAttribute("src")){this.src=this.getAttribute("src");this.$propHandlers.activepage.call(this);}};this.$destroy=function(w){if(w||!this.oScroller){return;}apf.layout.removeRule(this.$ext,this.$uniqueId+"_tabscroller");[this.oLeftScroll,this.oRightScroll].forEach(function(x){x.onmousedown=x.ondblclick=x.onmouseover=x.onmouseout=x.onmouseup=null;});};}).call(apf.BaseTab.prototype=new apf.Presentation());apf.__FOCUSSABLE__=1<<26;apf.Focussable=function(){this.$regbase=this.$regbase|apf.__FOCUSSABLE__;this.setTabIndex=function(a){apf.window.$removeFocus(this);apf.window.$addFocus(this,a);return this;};this.focus=function(a,c,b){if(!a){if(this.$isWindowContainer){apf.window.$focusLast(this,c,true);}else{apf.window.$focus(this,c);if(!b&&apf.hasFocusBug){apf.window.$focusfix();}}return this;}if(this.$focus){this.$focus(c);}this.dispatchEvent("focus",apf.extend({srcElement:this,bubbles:true},c));return this;};this.blur=function(a,b){if(apf.popup.isShowing(this.$uniqueId)){apf.popup.forceHide();}if(this.$blur){this.$blur(b);}if(!a){apf.window.$blur(this);}this.dispatchEvent("blur",apf.extend({srcElement:this,bubbles:!b||!b.cancelBubble},b));return this;};this.hasFocus=function(){return apf.document.activeElement==this||this.$isWindowContainer&&(apf.document.activeElement||{}).$focusParent==this;};};apf.__MEDIA__=1<<20;apf.Media=function(){this.$init(true);};(function(){this.$regbase=this.$regbase|apf.__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.$sources=[];this.$nomedia=null;this.$amlTimer=null;this.$loadTimer=null;this.$posTimer=null;this.$volTimer=null;this.$propHandlers.readyState=function(c){if(this.readyState!==c){this.readyState=c;}if(c==apf.Media.HAVE_NOTHING){var d=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:d,bubbles:true})===false){throw d;}}else{if(c==apf.Media.HAVE_CURRENT_DATA){this.dispatchEvent("havecurrentdata");}else{if(c==apf.Media.HAVE_FUTURE_DATA){this.dispatchEvent("havefuturedata");}else{if(c==apf.Media.HAVE_ENOUGH_DATA){this.dispatchEvent("haveenoughdata");this.setProperty("ready",true);}}}}};this.$propHandlers.bufferedBytes=function(c){this.setProperty("progress",this.totalBytes?c.end/this.totalBytes:0);};this.$propHandlers.position=function(d){clearTimeout(this.$posTimer);if(this.duration<=0||!this.seek){return;}var c=this;this.$posTimer=$setTimeout(function(){if(d>=c.progress){d=c.progress-0.05;}var g=!c.paused;if(g){c.pause();}if(d<0){d=0;}else{if(d>1){d=1;}}c.seek(Math.round(d*c.duration));c.setProperty("paused",!g);});};this.$propHandlers.currentTime=function(c){if(c>=0&&this.seek){this.seek(c);}};this.$propHandlers.volume=function(c){if(!this.player){return;}if(c<1&&c>0){c=c*100;}if(this.setVolume){this.setVolume(c);}if(c>0&&this.muted){this.setProperty("muted",false);}};this.oldVolume=null;this.$propHandlers.muted=function(c){if(!this.player||!this.setVolume){return;}if(c){this.oldVolume=this.volume;this.setVolume(0);}else{this.setVolume(this.oldVolume||20);}};this.$propHandlers.paused=function(c){if(!this.player){return;}this.paused=apf.isTrue(c);if(this.paused){this.player.pause();}else{this.player.play();}};this.$propHandlers.type=function(d){if(this.$loadTimer){return;}var c=this;this.$loadTimer=window.setTimeout(function(){a.call(c);});};this.$propHandlers.src=function(i){if(this.$loadTimer||!i){return;}var g=new apf.url(i);this.src=g.uri;if(this.src!=this.currentSrc&&this.networkState!==apf.Media.LOADING){var d=this.$guessType(this.src);if(d==this.type){b.call(this);this.loadMedia();}else{this.type=d;var c=this;this.$loadTimer=window.setTimeout(function(){a.call(c);});}}};this.$propHandlers.ID3=function(c){if(!this.player){return;}if(typeof this.player.setID3=="function"){this.player.setID3(c);}};this.addEventListener("AMLRemove",function(c){b.call(this);});this.addEventListener("AMLReparent",function(c,g,d){if(!this.$amlLoaded){return;}this.$draw();a.call(this,true);});function b(){this.setProperty("networkState",apf.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 a(c){window.clearTimeout(this.$loadTimer);this.$loadTimer=null;if(!c){b.call(this);}this.$destroy(true);this.playerType=this.$getPlayerType(this.type);if(!this.playerType||!this.$isSupported()){this.$ext.innerHTML=this.notSupported;return;}this.$initPlayer();}this.MediaError=function(c){return new Error(apf.formatErrorString(0,this,"Media",c));};this.src=this.currentSrc=null;this.networkState=apf.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=apf.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(d){if(this.$getPlayerType){var c=this.$getPlayerType(d);if(!c||!this.$isSupported(c)){return"no";}if(c.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(g,j,d,c,l,k,i){};this.removeCueRanges=function(c){};this.getCounter=function(i,d,k){if(k){i=i-this.duration;}var c=Math.round(Math.abs(i/1000)),j=String(Math.round(Math.abs(c/60/60))).pad(2,"0"),g=String(Math.round(Math.abs(c/60))).pad(2,"0"),m=String(c).pad(2,"0"),l=String(Math.round(Math.abs(i%1000))).pad(3,"0");return(k?"- ":"")+d.replace(/\%T/g,"%H:%M:%S").replace(/\%[a-zA-Z\%]/g,function(n){switch(n){case"%H":return j;case"%M":return g;case"%S":return m;case"%Q":return l;case"%n":return"\n";case"%t":return"\t";case"%%":return"%";}});};this.setSource=function(){if(!this.src){var l,k,c=this.$sources;for(var g=0,d=c.length;g<d;g++){l=c[g].src;if(!l){continue;}k=c[g].type;if(!k){k=this.$guessType(l);}if(this.canPlayType(k)!="no"){this.src=l;this.type=k;break;}}}else{if(!this.type){this.type=this.$guessType(this.src);if(this.canPlayType(this.type)=="no"){return false;}}}return(this.src&&this.type);};this.$addSource=function(d){clearTimeout(this.$amlTimer);if(d.localName!="source"){return false;}this.$sources.pushUnique(d);var c=this;this.$amlTimer=$setTimeout(function(){clearTimeout(c.$amlTimer);c.dispatchEvent("AMLMediaReady");});};this.$removeSource=function(c){this.$sources.remove(c);};this.addEventListener("DOMNodeInserted",function(d){var c=d.currentTarget;if(c.parentNode!=this){return;}this.$addSource(c);});this.addEventListener("DOMNodeRemoved",function(d){var c=d.currentTarget;if(!(c.parentNode==this||c.parentNode.parentNode==this)){return;}this.$removeSource(c);});}).call(apf.Media.prototype=new apf.StandardBinding());apf.nomedia=function(b,a){this.$init(a||"nomedia",apf.NODE_HIDDEN,b);};(function(){this.addEventListener("DOMNodeInsertedIntoDocument",function(){this.parentNode.notSupported=apf.getXmlString(this.$aml).replace(/<\/?a:nomedia[^>]*>/g,"");});}).call(apf.nomedia.prototype=new apf.AmlElement());apf.aml.setElement("nomedia",apf.nomedia);apf.Media.NETWORK_EMPTY=0;apf.Media.NETWORK_IDLE=1;apf.Media.NETWORK_LOADING=2;apf.Media.NETWORK_LOADED=3;apf.Media.HAVE_NOTHING=0;apf.Media.HAVE_METADATA=1;apf.Media.HAVE_SOME_DATA=2;apf.Media.HAVE_CURRENT_DATA=3;apf.Media.HAVE_FUTURE_DATA=4;apf.Media.HAVE_ENOUGH_DATA=5;apf.BaseTree=function(){this.$init(true);this.$dynCssClasses=[];this.$nodes=[];};(function(){this.implement(apf.Rename,apf.DataAction,apf.Cache);this.$isTreeArch=true;this.$focussable=true;this.multiselect=false;this.bufferselect=true;this.startcollapsed=true;this.$animType=apf.tween.NORMAL;this.$animOpenStep=3;this.$animCloseStep=1;this.$animSpeed=10;var a=1<<1,c=1<<2,d=1<<3,j=1<<4;var b=this.$treeState={};this.$treeState[0]="";this.$treeState[a]="min";this.$treeState[a|c]="plus";this.$treeState[d]="last";this.$treeState[d|a]="minlast";this.$treeState[d|a|c]="pluslast";this.$treeState[j]="root";this.$booleanProperties.openadd=true;this.$booleanProperties.startcollapsed=true;this.$booleanProperties.nocollapse=true;this.$booleanProperties.singleopen=true;this.$booleanProperties.prerender=true;this.$booleanProperties.removecontainer=true;this.$supportedProperties.push("openadd","startcollapsed","nocollapse","singleopen","prerender","removecontainer");this.openadd=true;this.startcollapsed=1;this.prerender=true;this.expandAll=function(){var l=this.each.split("|").join("["+this.each.replace(/\|/g," or ")+"]|.//"),k=this;(function(q){var m=q.selectNodes(l);for(var r,n=0;n<m.length;n++){if(r=apf.xmldb.getHtmlNode(m[n],k)){k.slideToggle(r,1,true);}arguments.callee(m[n]);}})(this.xmlRoot);};this.collapseAll=function(){var l=this.xmlRoot.selectNodes(".//"+this.each.split("|").join("["+this.each.replace(/\|/g," or ")+"]|.//"));for(var m,k=l.length-1;k>=0;k--){if(m=apf.xmldb.getHtmlNode(l[k],this)){this.slideToggle(m,2,true);}}};this.expandAndSelect=function(m){var l=this;(function k(o){var n=l.getTraverseParent(o);if(n!=l.xmlRoot){k(n);}l.slideToggle(apf.xmldb.getHtmlNode(n,l),1,true);})(m);this.select(m);};this.selectPath=function(k){};this.slideToggle=function(n,m,l,o){if(this.nocollapse||o&&this.disabled){return;}if(!n){n=this.$selected;}var q=n.getAttribute(apf.xmldb.htmlIdTag);while(!q&&n.parentNode){q=(n=n.parentNode).getAttribute(apf.xmldb.htmlIdTag);}var k=this.$getLayoutNode("item","container",n);if(!k){return;}if(apf.getStyle(k,"display")=="block"){if(m==1){return;}n.className=n.className.replace(/min/,"plus");this.slideClose(k,apf.xmldb.getNode(n),l);}else{if(m==2){return;}n.className=n.className.replace(/plus/,"min");this.slideOpen(k,apf.xmldb.getNode(n),l);}};this.isCollapsed=function(k){return(apf.getStyle(this.$getLayoutNode("item","container",apf.xmldb.getHtmlNode(k,this)),"display")=="none");};var g={};this.slideOpen=function(l,o,m){if(!o){o=this.selected;}var q=apf.xmldb.findHtmlNode(o,this);if(!l){l=this.$findContainer(q);}if(!l.innerHTML&&!this.getTraverseNodes(o).length){return;}if(this.singleopen){var n=this.getTraverseParent(o),r=(n||this.xmlRoot).getAttribute(apf.xmldb.xmlIdTag);if(g[r]&&g[r][1]!=o&&this.getTraverseParent(g[r][1])==n){this.slideToggle(g[r][0],2);}g[r]=[q,o];}l.style.display="block";if(!this.prerender&&this.$hasLoadStatus(o,"potential")&&!l.innerHTML){this.$extend(o,l,m);return;}if(m||l.scrollHeight>1000){l.style.height="auto";l.style.overflow="visible";this.dispatchEvent("expand",{xmlNode:o});return;}var k=this;apf.tween.single(l,{type:"scrollheight",from:0,to:l.scrollHeight,anim:this.$animType,steps:this.$animOpenStep,interval:this.$animSpeed,onfinish:function(s){if(o&&k.$hasLoadStatus(o,"potential")){$setTimeout(function(){s.style.height=s.scrollHeight+"px";s.style.overflow="hidden";k.$extend(o,s);});s.style.height=apf.hasHeightAutoDrawBug?"100%":"auto";s.style.overflow="visible";}else{s.style.overflow="visible";s.style.height=apf.hasHeightAutoDrawBug?"100%":"auto";}if(s.scrollHeight>0){k.dispatchEvent("expand",{xmlNode:o});}else{k.dispatchEvent("collapse",{xmlNode:o});}}});};this.slideClose=function(l,n,m){if(this.nocollapse){return;}if(!n){n=this.selected;}if(this.singleopen){var q=(this.getTraverseParent(n)||this.xmlRoot).getAttribute(apf.xmldb.xmlIdTag);g[q]=null;}if(!l){var o=apf.xmldb.findHtmlNode(n,this);l=this.$findContainer(o);}l.style.height=l.offsetHeight;l.style.overflow="hidden";if(m){l.style.height=0;l.style.display="none";this.dispatchEvent("collapse",{xmlNode:n});return;}var k=this;apf.tween.single(l,{type:"scrollheight",from:l.scrollHeight,to:0,anim:this.$animType,steps:this.$animCloseStep,interval:this.$animSpeed,onfinish:function(r,s){r.style.display="none";k.dispatchEvent("collapse",{xmlNode:n});}});};this.$add=function(l,z,k,u,y,t,F){if(this.$isTreeArch&&this.$needsDepth&&typeof F=="undefined"){var r=k;F=0;while(r!=this.xmlRoot){F++;r=r.parentNode;}}var q=this.$getBindRule("insert",l)?true:false,E=this.getTraverseNodes(l),D=E.length?true:false,A=q||D,x=this.$hasBindRule("collapsed")?(this.$getDataNode("collapsed",l)?true:false):(this.$hasBindRule("expanded")?(this.$getDataNode("expanded",l)?false:true):this.startcollapsed),m=(A?a:0)|(x&&A||q?c:0)|(t?d:0),s=this.$initNode(l,m,z,F),w=this.$getLayoutNode("item","container",s),C;if(!x&&!this.nocollapse){w.setAttribute("style","overflow:visible;height:auto;display:block;");}var n,B=(!this.removecontainer||A);if(!A||q){w.setAttribute("style","display:none;");}if(!this.prerender){C=E.length;}if(A&&!this.prerender&&C>2&&x||q&&(!this.$hasLoadStatus(l)||this.$hasLoadStatus(l,"potential"))){this.$setLoading(l,w);}else{if(!D&&(n=this.$applyBindRule("empty",l))){this.$setEmptyMessage(w,n);}}if((!u||u==this.$container)&&k==this.xmlRoot&&!y){this.$nodes.push(s);if(!apf.isChildOf(s,w,true)&&B){this.$nodes.push(w);}this.$setStyleClass(s,"root");this.$setStyleClass(w,"root");}else{if(!u){u=apf.xmldb.findHtmlNode(l.parentNode,this);u=u?this.$getLayoutNode("item","container",u):this.$container;}if(u==this.$container){this.$setStyleClass(s,"root");this.$setStyleClass(w,"root");}if(!y&&this.getNextTraverse(l)){y=apf.xmldb.findHtmlNode(this.getNextTraverse(l),this);}if(y&&y.parentNode!=u){y=null;}if(u.style&&this.getTraverseNodes(l.parentNode).length==1){this.$removeEmptyMessage(u);}if(u.style){var o=!apf.isChildOf(s,w,true);s=apf.insertHtmlNode(s,u,y);if(o&&B){var w=apf.insertHtmlNode(w,u,y);}else{var w=this.$getLayoutNode("item","container",s);}}else{u.insertBefore(s,y);if(!apf.isChildOf(s,w,true)&&B){u.insertBefore(w,y);}}if(u.style){if(!x&&this.openadd&&u!=this.$container&&u.style.display!="block"){this.slideOpen(u,k,true);}this.$fixItem(k,apf.xmldb.findHtmlNode(k,this));if(this.getNextTraverse(l,true)){this.$fixItem(this.getNextTraverse(l,true),apf.xmldb.findHtmlNode(this.getNextTraverse(l,true),this));}}}if((this.prerender||C<3||!x)&&(l.namespaceURI!=apf.ns.apf||l.localName!="item")){this.$addNodes(l,w,false,null,null,(F||0)+1);}return w;};this.$fill=function(){if(this.$useiframe){this.$pHtmlDoc=this.oDoc;}if(this.$useTable){apf.insertHtmlNodes(this.$nodes,this.$container,null,"<table class='records' cellpadding='0' cellspacing='0'><tbody>","</tbody></table>");}else{apf.insertHtmlNodes(this.$nodes,this.$container);}this.$nodes.length=0;};this.$getParentNode=function(k){return k?this.$getLayoutNode("item","container",k):this.$container;};this.$fixItem=function(w,t,s,u,n){if(!t){return;}if(s){var o;if(o=this.getNextTraverse(w,true)){this.$fixItem(o,this.$findHtmlNode(o.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId),null,true);}if(!this.emptyMessage&&w.parentNode.selectNodes(this.each).length==1){this.$fixItem(w.parentNode,this.$findHtmlNode(w.parentNode.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId),null,false,true);}}else{var l=this.$getLayoutNode("item","container",t),r=false;if(n){r=false;}else{if(this.getTraverseNodes(w).length>0){r=true;}else{if(this.$hasLoadStatus(w,"potential")){r=true;}else{r=false;}}}var m=r&&l.style.display!="block",q=this.getNextTraverse(w,null,u?2:1)?false:true,k=(r?a:0)|(m?c:0)|(q?d:0);this.$setStyleClass(this.$getLayoutNode("item","class",t),b[k],["min","plus","last","minlast","pluslast"]);this.$setStyleClass(this.$getLayoutNode("item","container",t),b[k],["min","plus","last","minlast","pluslast"]);if(this.$getLayoutNode("item","openclose",t)){this.$getLayoutNode("item","openclose",t).setAttribute("children",r);}if(!r&&l){l.style.display="none";}}};this.$deInitNode=function(l,n){var k=this.$getLayoutNode("item","container",n),m=n.parentNode;k.parentNode.removeChild(k);m.removeChild(n);if(this.$withContainer){n.parentNode.removeChild(n.nextSibling);}if(l.parentNode!=this.xmlRoot){this.$fixItem(l,n,true);}var o;if(!m.childNodes.length&&(o=this.$applyBindRule("empty",l))){this.$setEmptyMessage(m,o);}this.$fixItem(l,n,true);};this.$moveNode=function(s,r){if(!self.apf.debug&&!r){return;}var m;if(this.$hasLoadStatus(s.parentNode,"potential")){m=this.$getLayoutNode("item","container",r);r.parentNode.removeChild(r);m.parentNode.removeChild(m);this.$extend(s.parentNode);return;}var t=r.parentNode,l=apf.xmldb.findHtmlNode(s.parentNode,this),u=this.getNextTraverse(s),q=u?apf.xmldb.findHtmlNode(u,this):null,o=l?this.$getLayoutNode("item","container",l):this.$container;m=this.$getLayoutNode("item","container",r);if(o!=t&&this.getTraverseNodes(s.parentNode).length==1){this.$removeEmptyMessage(o);}o.insertBefore(r,q);if(m){o.insertBefore(m,q);}var n;if(!t.childNodes.length&&(n=this.$applyBindRule("empty",s))){this.$setEmptyMessage(t,n);}if(this.openadd&&l!=this.$container&&o.style.display!="block"){this.slideOpen(o,l,true);}this.$fixItem(s,r);var k=this.getTraverseParent(s);this.$fixItem(k,apf.xmldb.findHtmlNode(k,this));if(this.getNextTraverse(s,true)){this.$fixItem(this.getNextTraverse(s,true),apf.xmldb.findHtmlNode(this.getNextTraverse(s,true),this));}};this.$setLoading=function(m,l){this.$setLoadStatus(m,"potential");var k=this.getTraverseNodes(m).length;if(!k||k>20){this.$getNewContext("loading");apf.insertHtmlNode(this.$getLayoutNode("loading"),l);}};this.$removeLoading=function(k){if(!k){return;}this.$getLayoutNode("item","container",k).innerHTML="";};this.$extend=function(m,k,l){var o=this.$getBindRule("insert",m),n=o&&o.match?(o.cmatch||o.compile("match"))(m):m;if(o&&n){this.$setLoadStatus(m,"loading");if(o.get){this.getModel().$insertFrom(o.getAttribute("get"),{xmlNode:n,insertPoint:n,amlNode:this});}else{if(this.$applyBindRule("insert",m)){this.insert(data,{insertPoint:n});}}}else{if(!this.prerender){this.$setLoadStatus(m,"loading");this.$removeLoading(apf.xmldb.findHtmlNode(m,this));i.call(this,{action:"insert",xmlNode:m,result:this.$addNodes(m,k,true),anim:!l});}}};function i(m){if(m.action=="move-away"){this.$fixItem(m.xmlNode,apf.xmldb.findHtmlNode(m.xmlNode,this),true);}if(m.action!="insert"){return;}var l=this.$findHtmlNode(m.xmlNode.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);if(!l){return;}if(m.action=="insert"&&m.result.length>0){if(this.$hasLoadStatus(m.xmlNode,"loaded")){var k=this.$getLayoutNode("item","container",l);this.slideOpen(k,m.xmlNode);}else{if(this.$hasLoadStatus(m.xmlNode,"potential")){this.$setLoadStatus(m.xmlNode,"loaded");}}}else{this.$fixItem(m.xmlNode,l);}}this.addEventListener("xmlupdate",i);this.addEventListener("beforerename",function(){if(this.$tempsel){clearTimeout(this.timer);this.select(this.$tempsel);this.$tempsel=null;this.timer=null;}});this.addEventListener("keydown",function(C){var E=C.keyCode,o=C.ctrlKey,w=C.shiftKey,B=this.$caret||this.$selected,r,u,n,y,x,D,k,t;if(!B||this.renaming){return;}var l=this.caret||this.selected,m=this.$ext;switch(E){case 13:if(this.$tempsel){this.$selectTemp();}if(this.ctrlselect=="enter"){this.select(this.caret,true);}this.choose(B);break;case 32:if(this.$tempsel){this.$selectTemp();}if(this.$mode&&!o){var z=this.getSelection();if(!z.length||!this.multiselect){this.checkToggle(this.caret,true);}else{this.checkList(z,this.isChecked(this.selected),true,false,true);}}else{if(o||!this.isSelected(this.caret)){this.select(this.caret,true);}}return false;case 46:if(this.$tempsel){this.$selectTemp();}this.remove(this.caret);break;case 36:this.$setTempSelected(this.getFirstTraverseNode(),false,w);m.scrollTop=0;return false;case 35:var q=this.getLastTraverseNode();while(!this.isCollapsed(q)){q=this.getLastTraverseNode(q);}this.$setTempSelected(q,false,w,true);m.scrollTop=m.scrollHeight;return false;case 37:if(this.$tempsel){this.$selectTemp();}if(this.caret.selectSingleNode(this.each)&&!this.isCollapsed(this.caret)){this.slideToggle(this.$caret||this.$selected,2);}else{if(k=this.getTraverseParent(this.caret)){this.select(k);}}return false;case 107:case 187:case 39:if(this.$tempsel){this.$selectTemp();}if(this.$hasLoadStatus(this.caret,"potential")||this.getFirstTraverseNode(this.caret)){this.slideToggle(this.$caret||this.$selected,1);}break;case 109:case 189:if(this.getFirstTraverseNode(this.caret)){this.slideToggle(this.$caret||this.$selected,2);}break;case 38:if(!l&&!this.$tempsel){return;}y=this.$tempsel?apf.xmldb.getNode(this.$tempsel):l;D=this.getNextTraverse(y,true);if(D){x=this.getTraverseNodes(D);do{t=this.$getLayoutNode("item","container",this.$findHtmlNode(apf.xmldb.getID(D,this)));if(t&&apf.getStyle(t,"display")=="block"&&x.length){D=x[x.length-1];}else{break;}}while(D&&(x=this.getTraverseNodes(D)).length);}else{if(this.getTraverseParent(y)==this.xmlRoot){this.dispatchEvent("selecttop");return;}else{D=this.getTraverseParent(y);}}if(D&&D.nodeType==1){this.$setTempSelected(D,o,w,true);}else{return false;}B=apf.xmldb.findHtmlNode(D,this);u=apf.getAbsolutePosition(B,this.$container)[1]-(B.offsetHeight/2);if(u<=m.scrollTop){m.scrollTop=u;}return false;case 40:if(!l&&!this.$tempsel){return;}y=this.$tempsel?apf.xmldb.getNode(this.$tempsel):l;D=this.getFirstTraverseNode(y);if(D){t=this.$getLayoutNode("item","container",this.$findHtmlNode(apf.xmldb.getID(y,this)));if(t&&apf.getStyle(t,"display")!="block"){D=null;}}while(!D){k=this.getTraverseParent(y);if(!k){break;}var A=0;x=this.getTraverseNodes(k);while(x[A]&&x[A]!=y){A++;}D=x[A+1];y=k;}if(D&&D.nodeType==1){this.$setTempSelected(D,o,w);}else{return false;}B=apf.xmldb.findHtmlNode(D,this);u=apf.getAbsolutePosition(B,this.$container)[1]+(B.offsetHeight/2);if(u>m.scrollTop+m.offsetHeight){m.scrollTop=u-m.offsetHeight;}return false;case 33:r=apf.getAbsolutePosition(this.$container);n=document.elementFromPoint(r[0]+this.$container.offsetWidth-2,r[1]+2);D=apf.xmldb.findXmlNode(n);if(D==this.selected){m.scrollTop-=m.offsetHeight-apf.getHeightDiff(m);n=document.elementFromPoint(r[0]+this.$container.offsetWidth-2,r[1]+2);D=apf.xmldb.findXmlNode(n);}this.select(D);B=apf.xmldb.findHtmlNode(D,this);u=apf.getAbsolutePosition(B,this.$container)[1]-(B.offsetHeight/2);if(u<=m.scrollTop){m.scrollTop=u;}break;case 34:r=apf.getAbsolutePosition(this.$container);n=document.elementFromPoint(r[0]+this.$container.offsetWidth-2,r[1]+this.$ext.offsetHeight-4);D=apf.xmldb.findXmlNode(n);if(D==this.selected){m.scrollTop+=m.offsetHeight-apf.getHeightDiff(m);n=document.elementFromPoint(r[0]+this.$container.offsetWidth-2,r[1]+this.$ext.offsetHeight-4);D=apf.xmldb.findXmlNode(n);}this.select(D);B=apf.xmldb.findHtmlNode(D,this);u=apf.getAbsolutePosition(B,this.$container)[1]+(B.offsetHeight/2);if(u>m.scrollTop+m.offsetHeight){m.scrollTop=u-m.offsetHeight;}break;default:if(this.celledit){if(!o&&!C.altKey&&(E>46&&E<112||E>123)){this.startRename(null,true);}return;}else{if(E==65&&o){this.selectAll();return false;}else{if(this.caption||(this.bindingRules||{})["caption"]){if(!this.xmlRoot){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 x=this.getTraverseNodes();for(var s,A=0;A<x.length;A++){s=this.$applyBindRule("caption",x[A]);if(s&&s.substr(0,this.lookup.str.length).toUpperCase()==this.lookup.str){if(!this.isSelected(x[A])){if(this.mode=="check"){this.setCaret(x[A]);}else{this.select(x[A]);}}if(B){this.$container.scrollTop=B.offsetTop-(this.$container.offsetHeight-B.offsetHeight)/2;}return;}}return;}}}break;}},true);this.$getCaptionElement=function(){if(!this.$selected){return false;}var k=this.$getLayoutNode("item","caption",this.$selected);return k.nodeType==1?k:k.parentNode;};this.$calcSelectRange=function(m,k){var o=[],q=false,n=0,l=this.hasFeature(apf.__VIRTUALVIEWPORT__)?this.xmlRoot.selectNodes(this.$isTreeArch?this.each:".//"+this.each.split("|").join("|.//")):this.getTraverseNodes();for(;n<l.length;n++){if(l[n]==m){q=true;}if(q){o.push(l[n]);}if(l[n]==k){q=false;}}if(!o.length||q){o=[];for(q=false,n=l.length-1;n>=0;n--){if(l[n]==m){q=true;}if(q){o.push(l[n]);}if(l[n]==k){q=false;}}}return o;};this.$findContainer=function(k){return this.$getLayoutNode("item","container",k);};this.$selectDefault=function(m){if(this.select(this.getFirstTraverseNode(m),null,null,null,true)){return true;}else{var k=this.getTraverseNodes(m);for(var l=0;l<k.length;l++){if(this.$selectDefault(k[l])){return true;}}}};this.$setEmptyMessage=function(n,o){this.$getNewContext("empty");var l=this.$getLayoutNode("empty");if(!l){return;}var m=apf.insertHtmlNode(l,n);var k=this.$getLayoutNode("empty","caption",m);if(k){apf.setNodeValue(k,o||"");}if(n.style){this.slideOpen(n,null,true);}else{n.setAttribute("style","overflow:visible;height:auto;display:block;");}};this.$removeEmptyMessage=function(l){var k=l.firstChild;if(!k){return;}do{if(k.className=="message"){l.removeChild(k);return;}k=k.nextSibling;}while(k);};this.$drawBase=function(){this.$ext=this.$getExternal();this.$container=this.$getLayoutNode("main","container",this.$ext);this.opencloseaction=this.$getOption("main","openclose");if(apf.hasCssUpdateScrollbarBug&&!this.mode){this.$fixScrollBug();}var k=this;this.$ext.onclick=function(l){k.dispatchEvent("click",{htmlEvent:l||event});};};this.addEventListener("DOMNodeInsertedIntoDocument",function(){if(this.nocollapse){this.startcollapsed=false;}else{if(this.startcollapsed===1){this.startcollapsed=!apf.isFalse(this.$getOption("main","startcollapsed"));}}});this.addEventListener("DOMNodeRemovedFromDocument",function(){this.$ext.onclick=null;apf.destroyHtmlNode(this.oDrag);this.oDrag=null;});}).call(apf.BaseTree.prototype=new apf.MultiSelect());apf.__ALIGNMENT__=1<<29;apf.A11y=function(){this.setRole=function(b,a){if(!b){throw new Error();}if(!apf.A11y.ROLES[a]){throw new Error();}b.setAttribute("role",a);};this.setWidgetAttr=function(d,c,b){var a=apf.A11y.ATTR_WIDGETS[c];if(!a){throw new Error("attr does not exist");}if((typeof a=="boolean"&&typeof b!="boolean")||(typeof a=="number"&&typeof b!="number")||((typeof a=="string"||apf.isArray(a))&&typeof b!="string")){throw new Error("invalid type");}d.setAttribute("aria-"+c,b);};this.updateLiveRegion=function(d,c,b){var a=apf.A11y.ATTR_LIVEREGION[c];if(!a){throw new Error("attr does not exist");}if((typeof a=="boolean"&&typeof b!="boolean")||(apf.isArray(a)&&typeof b!="string")){throw new Error("invalid type");}if(d){d.setAttribute("aria-"+c,b);}else{}};this.setDragDropAttr=function(d,c,b){var a=apf.A11y.ATTR_LIVEREGION[c];if(!a){throw new Error("attr does not exist");}if((typeof a=="boolean"&&typeof b!="boolean")||(apf.isArray(a)&&typeof b!="string")){throw new Error("invalid type");}d.setAttribute("aria-"+c,b);};this.setRelationAttr=function(){var b=Array.prototype.slice.call(arguments),d=b.shift(),c=b.shift(),a=b.join(" ");if(!apf.A11y.ATTR_RELATIONS[c]){throw new Error();}d.setAttribute("aria-"+c,a);};};apf.A11y.ROLES={alert:1,alertdialog:1,application:1,article:1,banner:1,button:1,checkbox:1,columnheader:1,combobox:1,complementary:1,contentinfo:1,definition:1,dialog:1,directory:1,grid:1,gridcell:1,"group:":1,heading:1,img:1,link:1,list:1,listbox:1,listitem:1,log:1,main:1,marquee:1,math:1,menu:1,menubar:1,menuitem:1,menuitemcheckbox:1,menuitemradio:1,navigation:1,note:1,option:1,presentation:1,progressbar:1,radio:1,radiogroup:1,region:1,row:1,rowheader:1,search:1,seperator:1,slider:1,slinbutton:1,status:1,tab:1,tablist:1,tabpanel:1,textbox:1,timer:1,toolbar:1,tooltip:1,tree:1,treegrid:1,treeitem:1};apf.A11y.ATTR_WIDGETS={autocomplete:true,checked:true,disabled:true,expanded:true,haspopup:true,hidden:true,invalid:["grammar","false","spelling","true"],level:1,multiline:true,multiselectable:true,pressed:["true","false","pressed"],readonly:true,required:true,selected:true,sort:["ascending","descending","none","other"],valuemax:1,valuemin:1,valuenow:1,valuetext:"string"};apf.A11y.ATTR_LIVEREGION={atomic:true,busy:true,live:["off","polite","assertive"],relevant:["additions","removals","text","all","additions text"]};apf.A11y.ATTR_DRAGDROP={dropeffect:["copy","move","reference","execute","popup","none"],grabbed:true};apf.A11y.ATTR_RELATIONS={activedescendant:{},controls:{},describedby:{},flowto:{},label:"1",labelledby:{},owns:{},posinset:1,setsize:1};apf.__DRAGDROP__=1<<5;apf.DragDrop=function(){this.$regbase=this.$regbase|apf.__DRAGDROP__;this.$dragInited=false;this.copy=function(j,m,g,d){if(j.nodeType){j=[j];}var c,n=[],k=0,b=j.length;for(;k<b;k++){n.push({func:d?"moveNode":"appendChild",args:[m,d?j[k]:j[k]=j[k].cloneNode(true),g]});}if(this.$actions[(d?"movegroup":"copygroup")]){c=this.$executeAction("multicall",n,(d?"movegroup":"copygroup"),j[0]);}else{c=this.$executeAction("multicall",n,(d?"move":"copy"),j[0],null,null,j.length>1?j:null);}if(c!==false){return j;}return false;};this.move=function(c,d,b){return this.copy(c,d,b,true);};this.isDragAllowed=function(c,k){if(this.disabled||!c||!c.length||!c[0]){return false;}if(this.drag||this.dragcopy){if(k){k.merge(c);}return true;}var m,b=[],i=0,g=c.length;for(;i<g;i++){m=this.$getDataNode("drag",c[i],null,b);if(!m){return false;}if(k){k.push(m);}}return b.length?b:false;};this.isDropAllowed=function(r,n){if(this.disabled||!r||!r.length||!n){return false;}var k,c,m=this.$attrBindings&&this.$attrBindings.drop;if(this.drop&&(!m||m.value=="true")){this.$setDynamicProperty("drop",this.hasFeature(apf.__MULTISELECT__)?"["+this.each+"]":"[node()]");m=true;}if(m){for(var d=0,b=r.length;d<b;d++){k=this.$getDataNode("drop",r[d]);if(!k){break;}}if(d==b&&n&&!apf.isChildOf(k,n,true)){return[n,null];}}var t=this.$bindings.drop;if(!t||!t.length){return false;}var q,s,g=0,o=t.length;for(;g<o;g++){q=this.$bindings.getRuleIndex("drop",g);for(var d=0,b=r.length;d<b;d++){k=q.cvalue?q.cvalue(r[d]):q.cmatch(r[d]);if(!k){break;}}if(d!=b){continue;}s=q.target;if(!s||s=="."){c=n;}else{c=(q.ctarget||q.compile("target"))(n);}if(c&&!apf.isChildOf(k,c,true)){return[c,q];}}return false;};this.$dragDrop=function(w,d,s,t,q,u,b){if(m=="tree-append"&&q){return false;}var m=s&&s.action;if(m){m=(s.caction||s.compile("action"))(d[0]);}else{m=t;}var c={internal:apf.DragServer.dragdata.host==this,ctrlKey:b.ctrlKey,keyCode:b.keyCode},o=s&&s.copy;if(o){o=!apf.isFalse((s.ccopy||s.compile("copy"))(d[0],c));}else{if(typeof this.dragcopy=="boolean"||typeof this.dropcopy=="boolean"){if(this.dropcopy){o=this.dropcopy;}else{if(this.dragcopy){o=b.ctrlKey;}else{var j=this.$attrBindings&&this.$attrBindings.dragcopy;if(j){o=!apf.isFalse((j.cvalue2||j.compile("value",{withopt:true}))(d[0],c));}}}}}if(!o){for(var n=0,g=u.length;n<g;n++){o=typeof u[n]=="object"&&u[n].copy?!apf.isFalse((u[n].ccopy||u[n].compile("copy"))(d[0],c)):b.ctrlKey;if(o){break;}}}var r,x=o?"copy":"move",k=s?s.getAttribute("parent"):null;switch(m){case"list-append":w=(q?w:this.getTraverseParent(w));if(k){if(w.selectSingleNode(k)){w=w.selectSingleNode(k);}else{w.appendChild(w.ownerDocument.createElement(k));w=w.selectSingleNode(k);}}r=this[x](d,w);break;case"insert-before":r=q?this[x](d,w):this[x](d,w.parentNode,w);break;case"tree-append":if(k){if(w.selectSingleNode(k)){w=w.selectSingleNode(k);}else{w.appendChild(w.ownerDocument.createElement(k));w=w.selectSingleNode(k);}}r=this[x](d,w);break;}if(this.selectable&&r){this.selectList(r);this.setCaret(r[0]);this.focus();}return r;};this.enableDragDrop=function(){this.icoAllowed="";this.icoDenied="";this.$ext.dragdrop=false;var b=this;this.$ext[apf.isIphone?"ontouchstart":"onmousedown"]=function(k){if(b.disabled){return;}k=k||window.event;if(apf.isIphone){if(k.touches.length==1){return;}var j=k;k=k.touches[0];var l=apf.getAbsolutePosition(k.target,this);k.offsetX=l[0];k.offsetY=l[1];}var i,d=k.originalTarget||k.srcElement||k.target,c=b.hasFeature(apf.__MULTISELECT__);if(c&&d==b.$container){return;}b.dragging=0;if(!apf.isIphone&&b.allowdeselect&&(d==this||d.getAttribute(apf.xmldb.htmlIdTag))){return b.clearSelection();}if(b.$findValueNode){i=b.$findValueNode(d);}var g=(i?apf.xmldb.getNode(i):apf.xmldb.findXmlNode(d));if(c&&(!b.selected||!g||g==b.xmlRoot)){return;}if(b.isDragAllowed(c?b.$getSelection():g)){if(apf.isIphone){j.preventDefault();}apf.DragServer.start(b,d,k);}};this.$ext[apf.isIphone?"ontouchmove":"onmousemove"]=function(c){if(this.host.dragging!=1||b.disabled){return;}};if(apf.isIphone){this.$ext.ontouchend=this.$ext.ontouchcancel=function(){if(b.disabled){return;}this.host.dragging=0;};}else{this.$ext.onmouseup=function(){if(b.disabled){return;}this.host.dragging=0;};this.$ext.ondragcopy=this.$ext.ondragstart=function(){return false;};}if(document.elementFromPointAdd){document.elementFromPointAdd(this.$ext);}if(this.$initDragDrop&&!this.$dragInited){this.$initDragDrop();this.$dragInited=2;}else{this.$dragInited=true;}};function a(){this.$dragInited=false;if(apf.isIphone){this.$ext.ontouchstart=this.$ext.ontouchmove=this.$ext.ontouchend=this.$ext.ontouchcancel=null;}else{this.$ext.onmousedown=this.$ext.onmousemove=this.$ext.onmouseup=null;}if(document.elementFromPointRemove){document.elementFromPointRemove(this.$ext);}}this.implement(this.hasFeature(apf.__MULTISELECT__)?apf.MultiselectDragDrop:apf.StandardDragDrop);this.$supportedProperties.push("drop","drag","dragcopy");this.$propHandlers.dragcopy=this.$propHandlers.dropcopy=this.$propHandlers.drag=this.$propHandlers.drop=function(b,c){this[c]=apf.isTrue(b);if(this.$dragInited&&c=="drag"&&b&&this.$dragInited!=2){this.$initDragDrop();this.$dragInited=2;return;}if(c=="dragcopy"||c=="dropcopy"){return;}if(!b&&!this.drag&&!this.drop&&!this.$bindings&&(this.$attrBindings&&(!this.$attrBindings.drag||!this.$attrBindings.drop))){a.call(this);}else{if(b&&!this.$dragInited){this.enableDragDrop();}}};this.addEventListener("DOMNodeRemovedFromDocument",function(b){a.call(this);if(this.oDrag){apf.destroyHtmlNode(this.oDrag);this.oDrag=null;}});};apf.GuiElement.propHandlers.dragcopy=apf.GuiElement.propHandlers.dropcopy=apf.GuiElement.propHandlers.drop=apf.GuiElement.propHandlers.drag=function(a,b){if(!apf.isFalse(a)){if(!this.hasFeature(apf.__DRAGDROP__)){this.implement(apf.DragDrop);this.enableDragDrop();}this[b]=apf.isTrue(a);}};apf.DragServer={Init:function(){if(apf.isIphone){this.ontouchmove=this.onmousemove;this.ontouchend=this.ontouchcancel=this.onmouseup;}apf.addEventListener("hotkey",function(a){if(apf.window.dragging&&a.keyCode==27){if(document.body.lastHost&&document.body.lastHost.dragOut){document.body.lastHost.dragOut(apf.dragHost);}return apf.DragServer.stopdrag();}});},start:function(j,b,l){if(document.elementFromPointReset){document.elementFromPointReset();}j.dragging=1;var m=window.document;m=(!m.compatMode||m.compatMode=="CSS1Compat")?m.html||m.documentElement:m.body;var r=(apf.isIE?m.scrollLeft:window.pageXOffset),q=(apf.isIE?m.scrollTop:window.pageYOffset),a=j.$ext.offsetParent,n;while(a&&a!=m&&a.tagName!="BODY"){r-=a.scrollLeft;q-=a.scrollTop;a=a.offsetParent;}var i=b,g;while(i&&i.nodeType==1&&!(g=i.getAttribute(apf.xmldb.htmlIdTag))){i=i.parentNode;}if(!g){return;}n=apf.getAbsolutePosition(i);apf.DragServer.coordinates={srcElement:b,doc:m,scrollX:r,scrollY:q,offsetX:l.clientX-n[0],offsetY:l.clientY-n[1],clientX:l.pageX?l.pageX-window.pageXOffset:l.clientX,clientY:l.pageY?l.pageY-window.pageYOffset:l.clientY};var o=j.hasFeature(apf.__MULTISELECT__)?j.getSelection():[j.xmlRoot],k=[],c=j.isDragAllowed(o,k);if(!c){return;}if(j.hasEventListener("dragdata")){k=j.dispatchEvent("dragdata",{data:k});}this.dragdata={rules:c,selection:o,data:k,indicator:j.$showDragIndicator(o,this.coordinates),host:j};if(j.dispatchEvent("dragstart",this.dragdata)===false){return false;}j.dragging=2;apf.dragMode=true;document.onmousemove=this.onmousemove;document.onmouseup=this.onmouseup;},stop:function(a,b){if(this.last){this.dragout();}this.dragdata.host.dragging=0;this.dragdata.host.$hideDragIndicator(b);apf.dragMode=false;document.onmousemove=document.onmouseup=null;this.dragdata=null;},dragover:function(i,c,g){g=g||window.event;var d;if(i.$findValueNode){d=i.$findValueNode(c);}if(this.lastFel&&this.lastFel==d||!this.lastFel&&this.last==i){return;}var j=(d?apf.xmldb.getNode(d):apf.xmldb.findXmlNode(c)),a=i.isDropAllowed&&i.xmlRoot?i.isDropAllowed(this.dragdata.data,j||i.xmlRoot):apf.isTrue(apf.getInheritedAttribute(i,"",function(k){if(k.drop){i=k;if(i==apf.DragServer.last){return false;}return true;}}));if(this.last&&this.last!=i){this.dragout(this.last);}if(!a){return;}if(i.dispatchEvent("dragover",this.dragdata)===false){a=false;}var b=g.originalTarget||g.srcElement||g.target;if(i&&i.$dragover){i.$dragover(c,this.dragdata,a);}this.last=i;this.lastFel=d;},dragout:function(a){this.lastFel=null;if(a){a.dispatchEvent("dragout",this.dragdata);}if(this.last&&this.last.$dragout){this.last.$dragout(null,this.dragdata);}this.last=null;},dragdrop:function(a,b,q,k){var j,n,g=(a.$findValueNode?apf.xmldb.getNode(a.$findValueNode(b)):apf.xmldb.findXmlNode(b)),c=(a.isDropAllowed&&a.xmlRoot)?a.isDropAllowed(this.dragdata.data,g||a.xmlRoot):false;if(this.dragdata.indicator){n=this.dragdata.indicator.style.top;this.dragdata.indicator.style.top="10000px";}if(!c){c=apf.isTrue(apf.getInheritedAttribute(a,"",function(m){if(m.drop){a=m;return true;}}));}if(c){if(a.dispatchEvent("dragdrop",apf.extend({candrop:c,htmlEvent:k,top:n},this.dragdata))===false){c=false;}else{if(!a.xmlRoot){var d=a.getModel?a.getModel(true):apf.nameserver.get("model",a.model);if(d){d.load(this.dragdata.data[0]);}return true;}else{var i=c[1]&&c[1].action||(a.$isTreeArch?"tree-append":"list-append");if(i=="list-append"&&(!a.$isTreeArch&&a==this.dragdata.host)){c=false;}}}}if(this.dragdata.indicator){this.dragdata.indicator.style.top=n;}if(!c){this.dragout(a);return false;}if(a.$dragDrop){var l=a.$dragDrop(c[0],this.dragdata.data,c[1],i,j||c[0]==a.xmlRoot,this.dragdata.rules,k);this.dragdata.resultNode=l;}if(a.$dragdrop){a.$dragdrop(b,apf.extend({htmlEvent:k,xmlNode:l},this.dragdata),c);}this.last=null;this.lastFel=null;return true;},onmousemove:function(i){if(!apf.DragServer.dragdata){return;}i=i||window.event;if(apf.isIphone){i.preventDefault();if(!i.touches){return apf.DragServer.stop(true);}i=i.touches[0];}var b=apf.DragServer.dragdata,j={clientX:i.pageX?i.pageX-window.pageXOffset:i.clientX,clientY:i.pageY?i.pageY-window.pageYOffset:i.clientY};if(!b.started&&Math.abs(apf.DragServer.coordinates.clientX-j.clientX)<6&&Math.abs(apf.DragServer.coordinates.clientY-j.clientY)<6){return;}if(!b.started){if(b.host.$dragstart){b.host.$dragstart(null,b);}b.started=true;}var a=b.indicator.style.top;b.indicator.style.display="block";if(b.indicator){b.indicator.style.top="10000px";}apf.DragServer.dragdata.x=i.pageX?i.pageX-(apf.isGecko?window.pageXOffset:0):j.clientX;apf.DragServer.dragdata.y=i.pageY?i.pageY-(apf.isGecko?window.pageYOffset:0):j.clientY;var d=document.elementFromPoint(apf.DragServer.dragdata.x,apf.DragServer.dragdata.y);b.indicator.style.top=a;b.host.$moveDragIndicator(j);var g=apf.findHost(d);if(g){apf.DragServer.dragover(g,d,i);}else{if(apf.DragServer.last){apf.DragServer.dragout(apf.DragServer.last);}}apf.DragServer.lastTime=new Date().getTime();},onmouseup:function(i){i=i||window.event;if(apf.isIphone){i.preventDefault();if(!i.changedTouches){return apf.DragServer.stop(true);}i=i.changedTouches[0];}var k={clientX:i.pageX?i.pageX-window.pageXOffset:i.clientX,clientY:i.pageY?i.pageY-window.pageYOffset:i.clientY};if(!apf.DragServer.dragdata.started&&Math.abs(apf.DragServer.coordinates.clientX-k.clientX)<6&&Math.abs(apf.DragServer.coordinates.clientY-k.clientY)<6){apf.DragServer.stop(true);return;}var b=apf.DragServer.dragdata.indicator,a=b.style.top;if(b){b.style.top="10000px";}apf.DragServer.dragdata.x=i.pageX?i.pageX-(apf.isGecko?window.pageXOffset:0):k.clientX;apf.DragServer.dragdata.y=i.pageY?i.pageY-(apf.isGecko?window.pageYOffset:0):k.clientY;var d=document.elementFromPoint(apf.DragServer.dragdata.x,apf.DragServer.dragdata.y);b.style.top=a;var g=apf.findHost(d);if(apf.DragServer.host&&g!=apf.DragServer.host){apf.DragServer.dragout(apf.DragServer.host);}var j=apf.DragServer.dragdrop(g,d,apf.DragServer.dragdata.host,i);apf.DragServer.stop(true,j);}};apf.MultiselectDragDrop=function(){this.diffX=this.diffY=0;this.multiple=false;this.lastDragNode=null;this.lastel=null;this.$showDragIndicator=function(d,k){this.multiple=d.length>1;if(this.multiple){this.diffX=k.scrollX;this.diffY=k.scrollY;}else{this.diffX=-1*k.offsetX;this.diffY=-1*k.offsetY;}var c=this.oDrag.className.split(" ")[0];this.$setStyleClass(this.oDrag,this.multiple?c+"_multiple":"",[c+"_multiple"]);if(this.multiple){document.body.appendChild(this.oDrag);return this.oDrag;}else{if(this.localName=="datagrid"){if(this.lastDragNode){apf.destroyHtmlNode(this.lastDragNode);}d=this.$selected||this.$caret;var j=d.cloneNode(true);j.removeAttribute("onmousedown");j.onmousedown=null;j.removeAttribute("onmouseup");j.onmouseup=null;j.removeAttribute("onmouseout");j.onmouseout=null;j.removeAttribute("ondblclick");j.ondblclick=null;document.body.appendChild(j);j.style.position="absolute";j.style.width=d.offsetWidth+"px";j.style.display="none";j.style.zIndex=10000000;j.removeAttribute("id");this.$setStyleClass(j,"draggrid");var a=d.childNodes;var g=j.childNodes;for(var b=a.length-1;b>=0;b--){if(g[b].nodeType==1){g[b].style.width=apf.getStyle(a[b],"width");}}return(this.lastDragNode=j);}else{this.$updateNode(this.selected,this.oDrag);}}return this.oDrag;};this.$hideDragIndicator=function(c){var b=this.lastDragNode||this.oDrag,a=this;if(!this.multiple&&!c&&b.style.display=="block"){var d=apf.getAbsolutePosition(this.$selected||this.$caret);apf.tween.multi(b,{anim:apf.tween.EASEIN,steps:15,interval:10,tweens:[{type:"left",from:b.offsetLeft,to:d[0]},{type:"top",from:b.offsetTop,to:d[1]}],onfinish:function(){if(a.lastDragNode){apf.destroyHtmlNode(a.lastDragNode);a.lastDragNode=null;}else{a.oDrag.style.display="none";}}});}else{if(this.lastDragNode){apf.destroyHtmlNode(this.lastDragNode);this.lastDragNode=null;}else{this.oDrag.style.display="none";}}};this.$moveDragIndicator=function(b){var a=this.lastDragNode||this.oDrag;a.style.left=(b.clientX+this.diffX)+"px";a.style.top=(b.clientY+this.diffY+(this.multiple?15:0))+"px";};this.$initDragDrop=function(){if(!this.$hasLayoutNode("dragindicator")){return;}this.oDrag=apf.insertHtmlNode(this.$getLayoutNode("dragindicator"),document.body);this.oDrag.style.zIndex=1000000;this.oDrag.style.position="absolute";this.oDrag.style.cursor="default";this.oDrag.style.display="none";};this.$findValueNode=function(a){if(!a){return null;}while(a&&a.nodeType==1&&!a.getAttribute(apf.xmldb.htmlIdTag)){if(this.$isTreeArch&&a.previousSibling&&a.previousSibling.nodeType==1){a=a.previousSibling;}else{a=a.parentNode;}}return(a&&a.nodeType==1&&a.getAttribute(apf.xmldb.htmlIdTag))?a:null;};this.$dragout=function(g,b,a){if(this.lastel){this.$setStyleClass(this.lastel,"",["dragDenied","dragInsert","dragAppend","selected","indicate"]);}var j=this.$getSelection(true);for(var d=0,c=j.length;d<c;d++){this.$setStyleClass(j[d],"selected",["dragDenied","dragInsert","dragAppend","indicate"]);}this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Drop"]);this.lastel=null;};if(!this.$dragdrop){this.$dragdrop=this.$dragout;}this.$dragover=function(g,b,a){this.$setStyleClass(this.$ext,this.$baseCSSname+"Drop");var m=this.$getSelection(true);for(var d=0,c=m.length;d<c;d++){this.$setStyleClass(m[d],"",["dragDenied","dragInsert","dragAppend","selected","indicate"]);}if(this.lastel){this.$setStyleClass(this.lastel,"",["dragDenied","dragInsert","dragAppend","selected","indicate"]);}var k=a[1]&&a[1].action;this.lastel=this.$findValueNode(g);if(this.$isTreeArch&&k=="list-append"){var j=apf.xmldb.findHtmlNode(this.getTraverseParent(apf.xmldb.getNode(this.lastel)),this);this.lastel=j?this.$getLayoutNode("item","container",j):this.$container;this.$setStyleClass(this.lastel,"dragInsert");}else{this.$setStyleClass(this.lastel,a?(k=="insert-before"?"dragInsert":"dragAppend"):"dragDenied");}};};apf.StandardDragDrop=function(){this.$showDragIndicator=function(c,d){var a=d.offsetX+22,g=d.offsetY;this.oDrag.startX=a;this.oDrag.startY=g;document.body.appendChild(this.oDrag);var b=this.$getLayoutNode("main","caption",this.oDrag);if(b.nodeType!=1){b=b.parentNode;}b.innerHTML=this.$applyBindRule("caption",this.xmlRoot)||"";return this.oDrag;};this.$hideDragIndicator=function(){this.oDrag.style.display="none";};this.$moveDragIndicator=function(a){this.oDrag.style.left=(a.clientX-this.oDrag.startX+document.documentElement.scrollLeft)+"px";this.oDrag.style.top=(a.clientY-this.oDrag.startY+document.documentElement.scrollTop)+"px";};this.$initDragDrop=function(){if(!this.getAttribute("drag")){return;}this.oDrag=document.body.appendChild(this.$ext.cloneNode(true));this.oDrag.style.zIndex=1000000;this.oDrag.style.position="absolute";this.oDrag.style.cursor="default";this.oDrag.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=50)";this.oDrag.style.MozOpacity=0.5;this.oDrag.style.opacity=0.5;this.oDrag.style.display="none";};};apf.DragServer.Init();apf.__XFORMS__=1<<17;apf.__DELAYEDRENDER__=1<<11;apf.DelayedRender=function(){this.$regbase=this.$regbase|apf.__DELAYEDRENDER__;this.$rendered=false;this.$render=function(b){if(this.$rendered){return;}if(this.dispatchEvent("beforerender")===false){return;}if(this["render-delay"]||b){$setTimeout("apf.lookup("+this.$uniqueId+").$renderparse()",10);}else{this.$renderparse();}};this.$renderparse=function(){if(this.$rendered){return;}var b=this.ownerDocument.$domParser;b.parseFromXml(this.$aml,{amlNode:this,doc:this.ownerDocument,delayedRender:true});b.$continueParsing(this);this.$rendered=true;this.dispatchEvent("afterrender");};var a;this.addEventListener("prop.visible",a=function(){if(arguments[0].value){this.$render();this.removeEventListener("prop.visible",a);}});};apf.GuiElement.propHandlers.render=function(a){if(!this.hasFeature(apf.__DELAYEDRENDER__)&&a=="runtime"){this.implement(apf.DelayedRender);if(this.localName!="page"){this.visible=false;this.$ext.style.display="none";}if(typeof this["render-delay"]=="undefined"){this.$setInheritedAttribute("render-delay");}}};apf.config.$inheritProperties["render-delay"]=1;apf.BaseButton=function(){this.$init(true);};(function(){this.implement(apf.ChildValue);this.refKeyDown=this.refMouseDown=0;this.mouseOver=this.mouseLeft=false;this.$propHandlers.background=function(c){var d=this.$getLayoutNode("main","background",this.$ext);if(!d){return;}if(c){var a=c.split("|");this.$background=a.concat(["vertical",2,16].slice(a.length-1));d.style.backgroundImage="url("+this.mediaPath+a[0]+")";d.style.backgroundRepeat="no-repeat";}else{d.style.backgroundImage="";d.style.backgroundRepeat="";this.$background=null;}};this.addEventListener("keydown",function(b){var a=b.keyCode;switch(a){case 13:if(this.localName!="checkbox"){this.$ext.onmouseup(b.htmlEvent,true);}break;case 32:if(!b.htmlEvent.repeat){this.refKeyDown++;this.$updateState(b.htmlEvent);}return false;}},true);this.addEventListener("keyup",function(b){var a=b.keyCode;switch(a){case 32:this.refKeyDown--;if(this.refKeyDown<0){this.refKeyDown=0;return false;}if(this.refKeyDown+this.refMouseDown==0&&!this.disabled){this.$ext.onmouseup(b,true);}this.$updateState(b);return false;}},true);this.states={Out:1,Over:2,Down:3};this.$updateState=function(b,a){if(b.reset){this.refKeyDown=0;this.refMouseDown=0;this.mouseOver=false;return false;}if(this.refKeyDown>0||(this.refMouseDown>0&&this.mouseOver)||(this.isBoolean&&this.value)){this.$setState("Down",b,a);}else{if(this.mouseOver){this.$setState("Over",b,a);}else{this.$setState("Out",b,a);}}};this.$setupEvents=function(){var a=this;this.$ext.onmousedown=function(b){b=b||window.event;if(a.disabled||a.$notfromext&&(b.srcElement||b.target)==this){return;}a.refMouseDown=1;a.mouseLeft=false;a.$updateState(b,"mousedown");};this.$ext.onmouseup=function(c,b){c=c||window.event;if(a.disabled||!b&&(!a.mouseOver||!a.refMouseDown)){return;}a.refMouseDown=0;a.$updateState(c,"mouseup");if(a.disabled||(c&&c.type=="click"&&a.mouseLeft==true)){return false;}if(a.refMouseDown+a.refKeyDown){return false;}if(a.$clickHandler&&a.$clickHandler()){a.$updateState(c||event,"click");}else{a.dispatchEvent("click",{htmlEvent:c});}return false;};this.$ext.onmousemove=function(b){if(!a.mouseOver&&!a.disabled){b=b||window.event;if(a.$notfromext&&(b.srcElement||b.target)==this){return;}a.mouseOver=true;a.$updateState(b,"mouseover");}};this.$ext.onmouseout=function(c){c=c||window.event;var b=c.explicitOriginalTarget||c.toElement;if(a.disabled||this==b||apf.isChildOf(this,b)){return;}a.mouseOver=false;a.refMouseDown=0;a.mouseLeft=true;a.$updateState(c,"mouseout");};if(apf.isIphone){apf.iphone.linkEvents(this.$ext,true);}if(apf.hasClickFastBug){this.$ext.ondblclick=this.$ext.onmouseup;}};this.$doBgSwitch=function(b){if(this.background&&(this.$background[2]>=b||b==4)){if(b==4){b=this.$background[2]+1;}var a=this.$background[1]=="vertical"?"0 -"+(parseInt(this.$background[3])*(b-1))+"px":"-"+(parseInt(this.$background[3])*(b-1))+"px 0";this.$getLayoutNode("main","background",this.$ext).style.backgroundPosition=a;}};this.$focus=function(){if(!this.$ext){return;}this.$setStyleClass(this.$ext,this.$baseCSSname+"Focus");};this.$blur=function(a){if(!this.$ext){return;}this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Focus"]);if(a){this.$updateState(a);}};this.$destroy=function(a){if(!a&&this.$ext){this.$ext.onmousedown=this.$ext.onmouseup=this.$ext.onmouseover=this.$ext.onmouseout=this.$ext.onclick=this.$ext.ondblclick=null;}};}).call(apf.BaseButton.prototype=new apf.StandardBinding());apf.BaseList=function(){this.$init(true);this.$dynCssClasses=[];this.listNodes=[];};(function(){this.implement(apf.Cache,apf.DataAction);this.$focussable=true;this.multiselect=true;this.mode="normal";this.$propHandlers.fill=function(a){if(a){this.loadFillData(this.getAttribute("fill"));}else{this.clear();}};this.$propHandlers.template=function(c){this.$template=typeof c=="object"?c:apf.nameserver.get("template",c);if(!this.$template){var b;apf.addEventListener("parsestop",b=function(){_self.$propHandlers.template.call(_self,c);apf.removeEventListener("parsestop",b);});return;}this.$deInitNode=function(g,i){var d=g.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId;this.$template.destroyInstance(d);if(i){i.parentNode.removeChild(i);}};this.$updateNode=function(d,i,g){};this.$moveNode=function(d,g){};var a=document.createDocumentFragment();this.$add=function(i,g,j,l,d){var k=document.createElement("div");k.setAttribute("id",g);a.appendChild(k);this.$template.getNewInstance(this.$getLayoutNode("item","container",k),g,i,true);};this.$fill=function(){this.$container.appendChild(a);apf.queue.empty();};this.$checkLoadQueue();};this.$keyHandler=function(m){var u=m.keyCode,b=m.ctrlKey,q=m.shiftKey,o=this.$selected||this.$caret;if(m.returnValue==-1||!o||this.renaming){return;}var s=this.caret||this.selected,c=this.$ext,d,g,n,w,r,l,k;switch(u){case 13:if(this.$tempsel){this.$selectTemp();}if(this.ctrlselect=="enter"){this.select(this.caret,true);}this.choose(this.selected);break;case 32:if(b||this.mode!="normal"||!this.isSelected(this.caret)){this.select(this.caret,b);}break;case 109:case 46:if(this.disableremove){return;}if(this.$tempsel){this.$selectTemp();}this.remove(this.mode!="normal"?this.caret:null);break;case 36:if(this.hasFeature(apf.__VIRTUALVIEWPORT__)){this.viewport.change(0,null,true,true);}this.select(this.getFirstTraverseNode(),false,q);this.$container.scrollTop=0;break;case 35:if(this.hasFeature(apf.__VIRTUALVIEWPORT__)){this.viewport.change(this.viewport.length,null,true,true);}this.select(this.getLastTraverseNode(),false,q);this.$container.scrollTop=this.$container.scrollHeight;break;case 107:if(this.more){this.startMore();}break;case 37:if(!s&&!this.$tempsel){return;}d=this.$tempsel?apf.xmldb.getNode(this.$tempsel):s;g=apf.getBox(apf.getStyle(o,"margin"));n=o.offsetWidth?Math.floor((c.offsetWidth-(r?15:0))/(o.offsetWidth+g[1]+g[3])):1;g=apf.getBox(apf.getStyle(o,"margin"));d=this.getNextTraverseSelected(d,false);if(d){this.$setTempSelected(d,b,q,true);}else{return;}o=apf.xmldb.findHtmlNode(d,this);if(o.offsetTop<c.scrollTop){c.scrollTop=Array.prototype.indexOf.call(this.getTraverseNodes(),d)<n?0:o.offsetTop-g[0];}break;case 38:if(!s&&!this.$tempsel){return;}d=this.$tempsel?apf.xmldb.getNode(this.$tempsel):s;g=apf.getBox(apf.getStyle(o,"margin"));r=c.scrollHeight>c.offsetHeight;n=o.offsetWidth?Math.floor((c.offsetWidth-(r?15:0))/(o.offsetWidth+g[1]+g[3])):1;d=this.getNextTraverseSelected(d,false,n);if(d){this.$setTempSelected(d,b,q,true);}else{return;}o=apf.xmldb.findHtmlNode(d,this);if(o.offsetTop<c.scrollTop){c.scrollTop=Array.prototype.indexOf.call(this.getTraverseNodes(),d)<n?0:o.offsetTop-g[0];}break;case 39:if(!s&&!this.$tempsel){return;}d=this.$tempsel?apf.xmldb.getNode(this.$tempsel):s;g=apf.getBox(apf.getStyle(o,"margin"));d=this.getNextTraverseSelected(d,true);if(d){this.$setTempSelected(d,b,q);}else{return;}o=apf.xmldb.findHtmlNode(d,this);if(o.offsetTop+o.offsetHeight>c.scrollTop+c.offsetHeight){c.scrollTop=o.offsetTop-c.offsetHeight+o.offsetHeight+g[0];}break;case 40:if(!s&&!this.$tempsel){return;}d=this.$tempsel?apf.xmldb.getNode(this.$tempsel):s;g=apf.getBox(apf.getStyle(o,"margin"));r=c.scrollHeight>c.offsetHeight;n=o.offsetWidth?Math.floor((c.offsetWidth-(r?15:0))/(o.offsetWidth+g[1]+g[3])):1;d=this.getNextTraverseSelected(d,true,n);if(d){this.$setTempSelected(d,b,q);}else{return;}o=apf.xmldb.findHtmlNode(d,this);if(o.offsetTop+o.offsetHeight>c.scrollTop+c.offsetHeight){c.scrollTop=o.offsetTop-c.offsetHeight+o.offsetHeight+g[0];}break;case 33:if(!s&&!this.$tempsel){return;}d=this.$tempsel?apf.xmldb.getNode(this.$tempsel):s;g=apf.getBox(apf.getStyle(o,"margin"));k=c.scrollHeight>c.offsetHeight;l=c.scrollWidth>c.offsetWidth;n=Math.floor((c.offsetWidth-(k?15:0))/(o.offsetWidth+g[1]+g[3]));w=Math.floor((c.offsetHeight-(l?15:0))/(o.offsetHeight+g[0]+g[2]));d=this.getNextTraverseSelected(d,false,n*w);if(!d){d=this.getFirstTraverseNode();}if(d){this.$setTempSelected(d,b,q,true);}else{return;}o=apf.xmldb.findHtmlNode(d,this);if(o.offsetTop<c.scrollTop){c.scrollTop=Array.prototype.indexOf.call(this.getTraverseNodes(),d)<n?0:o.offsetTop-g[0];}break;case 34:if(!s&&!this.$tempsel){return;}d=this.$tempsel?apf.xmldb.getNode(this.$tempsel):s;g=apf.getBox(apf.getStyle(o,"margin"));k=c.scrollHeight>c.offsetHeight;l=c.scrollWidth>c.offsetWidth;n=Math.floor((c.offsetWidth-(k?15:0))/(o.offsetWidth+g[1]+g[3]));w=Math.floor((c.offsetHeight-(l?15:0))/(o.offsetHeight+g[0]+g[2]));d=this.getNextTraverseSelected(s,true,n*w);if(!d){d=this.getLastTraverseNode();}if(d){this.$setTempSelected(d,b,q);}else{return;}o=apf.xmldb.findHtmlNode(d,this);if(o.offsetTop+o.offsetHeight>c.scrollTop+c.offsetHeight){c.scrollTop=o.offsetTop-c.offsetHeight+o.offsetHeight+g[0];}break;default:if(u==65&&b){this.selectAll();}else{if(this.$hasBindRule("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(u);var a=this.getTraverseNodes();for(var t,j=0;j<a.length;j++){t=this.$applyBindRule("caption",a[j]);if(t&&t.substr(0,this.lookup.str.length).toUpperCase()==this.lookup.str){if(!this.isSelected(a[j])){if(this.mode=="check"){this.setCaret(a[j]);}else{this.select(a[j]);}}if(o){this.$container.scrollTop=o.offsetTop-(this.$container.offsetHeight-o.offsetHeight)/2;}return;}}return;}}break;}this.lookup=null;return false;};this.$deInitNode=function(a,b){if(!b){return;}b.parentNode.removeChild(b);};this.$updateNode=function(c,i,d){var b=this.$getLayoutNode("item","icon",i);if(b){if(b.nodeType==1){b.style.backgroundImage="url("+apf.getAbsolutePath(this.iconPath,this.$applyBindRule("icon",c))+")";}else{b.nodeValue=apf.getAbsolutePath(this.iconPath,this.$applyBindRule("icon",c));}}else{var g=this.$getLayoutNode("item","image",i);if(g){if(g.nodeType==1){g.style.backgroundImage="url("+apf.getAbsolutePath(apf.hostPath,this.$applyBindRule("image",c))+")";}else{g.nodeValue=apf.getAbsolutePath(apf.hostPath,this.$applyBindRule("image",c));}}}var j=this.$getLayoutNode("item","caption",i);if(j){if(j.nodeType==1){j.innerHTML=this.$applyBindRule("caption",c);}else{j.nodeValue=this.$applyBindRule("caption",c);}}i.title=this.$applyBindRule("title",c)||"";var a=this.$applyBindRule("css",c);if(a||this.$dynCssClasses.length){this.$setStyleClass(i,a,this.$dynCssClasses);if(a&&!this.$dynCssClasses.contains(a)){this.$dynCssClasses.push(a);}}if(!d&&this.$updateModifier){this.$updateModifier(c,i);}};this.$moveNode=function(d,g){if(!g){return;}var a=g.parentNode;var c=this.getNextTraverse(d);var b=c?apf.xmldb.findHtmlNode(c,this):null;a.insertBefore(g,b);};this.$add=function(n,i,k,o,l){this.$getNewContext("item");var g=this.$getLayoutNode("item"),c=this.$getLayoutNode("item","select"),j=this.$getLayoutNode("item","icon"),a=this.$getLayoutNode("item","image"),m=this.$getLayoutNode("item","caption");g.setAttribute("id",i);c.setAttribute("onmouseover","var o = apf.lookup("+this.$uniqueId+"); o.$setStyleClass(this, 'hover', null, true);");c.setAttribute("onselectstart","return false;");c.setAttribute("style",(c.getAttribute("style")||"")+";user-select:none;-moz-user-select:none;-webkit-user-select:none;");if(this.hasFeature(apf.__RENAME__)||this.hasFeature(apf.__DRAGDROP__)){c.setAttribute("ondblclick","var o = apf.lookup("+this.$uniqueId+"); o.stopRename(); o.choose()");c.setAttribute("onmouseout","var o = apf.lookup("+this.$uniqueId+");            	  o.$setStyleClass(this, '', ['hover'], true);                this.hasPassedDown = false;");c.setAttribute(this.itemSelectEvent||"onmousedown","var o = apf.lookup("+this.$uniqueId+');                 var xmlNode = apf.xmldb.findXmlNode(this);                 var isSelected = o.isSelected(xmlNode);                 this.hasPassedDown = true;                 if (!o.renaming && o.hasFocus() && isSelected == 1)                     this.dorename = true;                 if (!o.hasFeature(apf.__DRAGDROP__) || o.mode != "normal" || !isSelected && !event.ctrlKey)                     o.select(this, event.ctrlKey, event.shiftKey, -1)');c.setAttribute("onmouseup","if (!this.hasPassedDown) return;                var o = apf.lookup("+this.$uniqueId+');if (o.hasFeature(apf.__RENAME__) && this.dorename && o.mode == "normal")                    o.startDelayedRename(event, null, true);this.dorename = false;                 var xmlNode = apf.xmldb.findXmlNode(this);                 var isSelected = o.isSelected(xmlNode);                 if (o.mode == "normal" && o.hasFeature(apf.__DRAGDROP__))                     o.select(this, event.ctrlKey, event.shiftKey, -1)');}else{c.setAttribute("onmouseout","apf.setStyleClass(this, '', ['hover']);");c.setAttribute("ondblclick","var o = apf.lookup("+this.$uniqueId+"); o.choose(null, true)");c.setAttribute(this.itemSelectEvent||"onmousedown","var o = apf.lookup("+this.$uniqueId+"); o.select(this, event.ctrlKey, event.shiftKey, -1)");}this.$listGrid=this.$getOption("main","list-mode")=="grid";if(this.$listGrid){g.setAttribute("onmouseover",g.getAttribute("onmouseover")+"var o = apf.lookup("+this.$uniqueId+");o.$selectSeries(event);");}if(j){if(j.nodeType==1){j.setAttribute("style","background-image:url("+apf.getAbsolutePath(this.iconPath,this.$applyBindRule("icon",n))+")");}else{j.nodeValue=apf.getAbsolutePath(this.iconPath,this.$applyBindRule("icon",n));}}else{if(a){if(a.nodeType==1){if((a.tagName||"").toLowerCase()=="img"){a.setAttribute("src",apf.getAbsolutePath(apf.hostPath,this.$applyBindRule("image",n)));}else{a.setAttribute("style","background-image:url("+apf.getAbsolutePath(apf.hostPath,this.$applyBindRule("image",n))+")");}}else{if(apf.isSafariOld){var b=a.ownerElement.parentNode,d=b.appendChild(b.ownerDocument.createElement("img"));d.setAttribute("src",apf.getAbsolutePath(apf.hostPath,this.$applyBindRule("image",n)));}else{a.nodeValue=apf.getAbsolutePath(apf.hostPath,this.$applyBindRule("image",n));}}}}if(m){apf.setNodeValue(m,this.$applyBindRule("caption",n));}g.setAttribute("title",this.$applyBindRule("tooltip",n)||"");var q=this.$applyBindRule("css",n);if(q){this.$setStyleClass(g,q);if(q){this.$dynCssClasses.push(q);}}if(this.$addModifier){this.$addModifier(n,g);}if(o){apf.insertHtmlNode(g,o,l);}else{this.listNodes.push(g);}};this.$fill=function(){if(this.more&&!this.moreItem){this.$getNewContext("item");var b=this.$getLayoutNode("item"),c=this.$getLayoutNode("item","caption"),a=this.$getLayoutNode("item","select");b.setAttribute("class","more");a.setAttribute("onmousedown","var o = apf.lookup("+this.$uniqueId+');o.clearSelection();o.$setStyleClass(this, "more_down", null, true);');a.setAttribute("onmouseout","apf.lookup("+this.$uniqueId+').$setStyleClass(this, "", ["more_down"], true);');a.setAttribute("onmouseup","apf.lookup("+this.$uniqueId+").startMore(this, true)");if(c){apf.setNodeValue(c,this.more.match(/caption:(.*)(;|$)/i)[1]);}this.listNodes.push(b);}apf.insertHtmlNodes(this.listNodes,this.$container);this.listNodes.length=0;if(this.more&&!this.moreItem){this.moreItem=this.$container.lastChild;}};this.startMore=function(c,b){if(b&&this.disabled){return;}this.$setStyleClass(c,"",["more_down"]);var a;if(!this.$actions.add){if(this.each&&!this.each.match(/[\/\[]/)){a="<"+this.each+(this.each.match(/^a:/)?" xmlns:a='"+apf.ns.aml+"'":"")+" custom='1' />";}else{return false;}}this.add(a,null,null,function(d){this.select(d,null,null,null,null,true);this.$container.appendChild(this.moreItem);var g=function(){this.getActionTracker().undo(this.autoselect?2:1);this.removeEventListener("stoprename",g);this.removeEventListener("beforerename",j);this.removeEventListener("afterrename",i);};var i=function(){this.removeEventListener("afterrename",i);};var j=function(l){this.removeEventListener("stoprename",g);this.removeEventListener("beforerename",j);var k=this.findXmlNodeByValue(l.args[1]);if(k||!l.args[1]){if(l.args[1]&&this.dispatchEvent("notunique",{value:l.args[1]})===false){this.startRename();this.addEventListener("stoprename",g);this.addEventListener("beforerename",j);}else{this.removeEventListener("afterrename",i);this.getActionTracker().undo();if(!this.isSelected(k)){this.select(k);}}return false;}};this.addEventListener("stoprename",g);this.addEventListener("beforerename",j);this.addEventListener("afterrename",i);this.startDelayedRename({},1);});};this.$calcSelectRange=function(c,a){var g=[],b=this.hasFeature(apf.__VIRTUALVIEWPORT__)?this.xmlRoot.selectNodes(this.each):this.getTraverseNodes(),j,d;for(j=false,d=0;d<b.length;d++){if(b[d]==c){j=true;}if(j){g.push(b[d]);}if(b[d]==a){j=false;}}if(!g.length||j){g=[];for(j=false,d=b.length-1;d>=0;d--){if(b[d]==c){j=true;}if(j){g.push(b[d]);}if(b[d]==a){j=false;}}}return g;};this.$selectDefault=function(a){this.select(this.getTraverseNodes()[0],null,null,null,true);};this.loadFillData=function(o){var n,a,d,k=o.splitSafe(","),m=[];for(var b,c,l=0;l<k.length;l++){if((c=k[l]).match(/^\d+-\d+$/)){b=c.split("-");a=parseInt(b[0]);d=parseInt(b[1]);if(b[0].length==b[1].length){n=Math.max(b[0].length,b[1].length);for(var g=a;g<d+1;g++){m.push("<item>"+(g+"").pad(n,"0")+"</item>");}}else{for(var g=a;g<d+1;g++){m.push("<item>"+g+"</item>");}}}else{m.push("<item>"+c+"</item>");}}this.$initingModel=true;this.each="item";this.$setDynamicProperty("caption","[label/text()|@caption|text()]");this.$setDynamicProperty("eachvalue","[value/text()|@value|text()]");this.$canLoadDataAttr=false;this.load("<data>"+m.join("")+"</data>");};}).call(apf.BaseList.prototype=new apf.MultiSelect());apf.BaseSimple=function(){this.$init(true);};(function(){this.implement(apf.DataAction);this.getValue=function(){return this.value;};}).call(apf.BaseSimple.prototype=new apf.StandardBinding());apf.window=function(){this.$uniqueId=apf.all.push(this);this.apf=apf;this.toString=function(){return"[APF Component : "+(this.name||"")+" (apf.window)]";};this.getActionTracker=function(){return this.$at;};this.loadCodeFile=function(s){if(self[s]){apf.importClass(self[s],true,this.win);}else{apf.include(s);}};this.show=function(){if(apf.isDeskrun){jdwin.Show();}};this.hide=function(){if(apf.isDeskrun){jdwin.Hide();}else{this.loaded=false;if(this.win){this.win.close();}}};this.focus=function(){if(apf.isDeskrun){jdwin.SetFocus();}else{window.focus();}};this.setIcon=function(s){if(apf.isDeskrun){jdwin.icon=parseInt(s)==s?parseInt(s):s;}};this.setTitle=function(s){this.title=s||"";if(apf.isDeskrun){jdwin.caption=s;}else{document.title=(s||"");}};this.loadAml=function(s){if(s[apf.TAGNAME]=="deskrun"){this.loadDeskRun(s);}};this.$tabList=[];this.$addFocus=function(t,u,s){if(!s){t.addEventListener("DOMNodeInserted",r);t.addEventListener("DOMNodeRemoved",k);if(t.$isWindowContainer>-2){t.addEventListener("focus",q);t.addEventListener("blur",q);t.$focusParent=t;if(t.$isWindowContainer>-1){if(!t.$tabList){t.$tabList=[t];}this.$tabList.push(t);return;}else{t.$tabList=[t];}}}var w=n(t),x=w.$tabList;if(!t.$isWindowContainer){t.$focusParent=w;}if(x[u]){x.insertIndex(t,u);}else{x.push(t);}};this.$removeFocus=function(s){if(!s.$focusParent){return;}s.$focusParent.$tabList.remove(s);if(!s.$isWindowContainer){s.removeEventListener("DOMNodeInserted",r);s.removeEventListener("DOMNodeRemoved",k);}if(s.$isWindowContainer>-2){s.removeEventListener("focus",q);s.removeEventListener("blur",q);}};var a;this.$focus=function(t,w,u){var s=this.document.activeElement;if(s==t&&!u){return;}this.$settingFocus=t;if(!w){w={};}if(s&&s!=t&&a!=s){a=s;w.toElement=t;w.fromElement=s;s.blur(true,w);if(a!=s){return false;}}(apf.activeElement=this.document.activeElement=t).focus(true,w);this.$settingFocus=null;apf.dispatchEvent("movefocus",{toElement:t});};this.$blur=function(t){var s=this.document.activeElement;if(s!=t){return false;}s.$focusParent.$lastFocussed=null;apf.activeElement=this.document.activeElement=null;apf.dispatchEvent("movefocus",{fromElement:t});};var j;this.$focusDefault=function(s,u){var t=n(s);this.$focusLast(t,u);};this.$focusRoot=function(s){var t=apf.document.documentElement;if(this.$focusLast(t,s)===false){}};this.$focusLast=function(u,z,t){var s=u.$lastFocussed;if(s&&s.parentNode&&s.$focussable===true&&(t||s.$ext.offsetHeight)){this.$focus(s,z,true);}else{var w,y=u,x;while(y){if(!x&&y.focussable!==false&&y.$focussable===true&&!y.$tabList&&(t||y.$ext.offsetHeight)&&!y.disabled){this.$focus(y,z,true);break;}if((w=!x&&y.firstChild||!(x=false)&&y.nextSibling)){y=w;if(y.$isWindowContainer>0){x=true;}}else{if(y==u){if(y.$isWindowContainer){this.$focus(y,z,true);}return;}else{do{y=y.parentNode;}while(y&&!y.nextSibling&&y!=u&&!y.$isWindowContainer);if(y==u){return;}if(y){if(y.$isWindowContainer){this.$focus(y,z,true);break;}y=y.nextSibling;}}}}if(!y){this.$focus(apf.document.documentElement);}}};function q(s){if(s.name=="blur"){if(s.srcElement!=this&&this.$blur){this.$blur();}return;}if(s.srcElement!=this&&this.$focus){this.$focus();}if(s.srcElement==this||s.trackedChild){s.trackedChild=true;return;}this.$lastFocussed=s.srcElement;if(this.localName.indexOf("window")>-1){s.trackedChild=true;}}function n(s){var t=s;do{t=t.parentNode;}while(t&&!t.$isWindowContainer);return t||apf.document.documentElement;}function r(s){if(s&&s.currentTarget!=this){return;}if(this.$isWindowContainer){apf.window.$tabList.pushUnique(this);}else{apf.window.$addFocus(this,this.tabindex,true);}}function k(s){if(s&&s.currentTarget!=this){return;}if(this.$isWindowContainer){apf.window.$tabList.remove(this);return;}if(!this.$focusParent){return;}this.$focusParent.$tabList.remove(this);}this.hasFocus=function(s){return this.document.activeElement==s;};this.moveNext=function(D,w,s,C){if(s&&apf.document.activeElement){var u=apf.document.activeElement.$focusParent;if(u.visible&&u.modal){return false;}}var y,t,A,x=w||apf.document.activeElement,z=x?(s&&x.$isWindowContainer>0?apf.window:x.$focusParent):apf.document.documentElement,B=z.$tabList;if(x&&(s||x!=apf.document.documentElement)){t=(B||[]).indexOf(x);if(t==-1){return;}}else{t=-1;}if(this.document.activeElement&&this.document.activeElement==x&&B.length==1||B.length==0){return false;}y=(D?-1:1);A=t;if(t<0){t=0;}do{A+=y;if(A>=B.length){A=0;}else{if(A<0){A=B.length-1;}}if(t==A&&x){return false;}x=B[A];}while(!x||x.disabled||x==apf.document.activeElement||(s?!x.visible:x.$ext&&!x.$ext.offsetHeight)||x.focussable===false||s&&!x.$tabList.length);if(z==apf.window){this.$focusLast(x,{mouse:true},s);}else{(C||(C={})).shiftKey=D;this.$focus(x,C);}};this.focusDefault=function(){if(this.moveNext()===false){this.moveNext(null,apf.document.documentElement,true);}};apf.addListener(window,"beforeunload",function(){return apf.dispatchEvent("exit");});apf.addListener(window,"unload",function(){if(!apf){return;}apf.window.isExiting=true;apf.window.destroy();});var d,c="",m="";this.$focusfix=function(){if(apf.isIphone){return;}c+="a";clearTimeout(d);$setTimeout("window.focus();");d=$setTimeout(b);};this.$focusfix2=function(){if(apf.isIphone){return;}c+="b";clearTimeout(d);d=$setTimeout(b);};this.$blurfix=function(){if(apf.isIphone){return;}c+="c";clearTimeout(d);d=$setTimeout(b);};function b(){clearTimeout(d);if(c=="e"||c=="c"||c.charAt(0)=="x"&&!c.match(/eb$/)||c=="ce"||c=="de"){if(m!="blur"){m="blur";apf.window.dispatchEvent("blur");}}else{if(m!="focus"){m="focus";apf.window.dispatchEvent("focus");}}c="";d=null;}apf.addListener(window,"focus",this.$focusevent=function(){if(apf.isIphone){return apf.window.dispatchEvent("focus");}if(apf.hasFocusBug){c+="d";clearTimeout(d);d=$setTimeout(b);}else{clearTimeout(o);g.newState="focus";o=$setTimeout(g,10);}});apf.addListener(window,"blur",this.$blurevent=function(){if(!apf){return;}if(apf.isIphone){return apf.window.dispatchEvent("blur");}if(apf.hasFocusBug){c+="e";clearTimeout(d);d=$setTimeout(b);}else{clearTimeout(o);g.newState="blur";o=$setTimeout(g,10);}});var o;function g(){clearTimeout(o);var s=g.newState;if(m==s){return;}m=s;apf.dispatchEvent(m);}this.hasFocus=function(){return(m=="focus");};apf.addListener(document,"contextmenu",function(s){if(!s){s=event;}if(apf.config.disableRightClick){if(s.preventDefault){s.preventDefault();}return false;}});var i={INPUT:1,TEXTAREA:1,SELECT:1};apf.addListener(document,"mousedown",this.$mousedown=function(y){y=y||window.event;var x,u=apf.findHost(y.srcElement||y.target),t=u&&u.$editable;if(apf.popup.last&&(!u||apf.popup.last!=u.$uniqueId)){apf.popup.forceHide();}if((!u||!u.$focussable||u.focussable===false)&&apf.config.allowBlur&&u.canHaveChildren!=2){j=null;if(apf.document.activeElement){apf.document.activeElement.blur();}}else{if(u){if((x=apf.document.activeElement&&apf.document.activeElement.$focusParent||j)&&x.visible&&x.modal&&u.$focusParent!=x){apf.window.$focusLast(x,{mouse:true});}else{if(!u&&apf.document.activeElement){apf.window.$focusRoot();}else{if(u.$isWindowContainer==-1){if(u.$tabList.length){apf.window.moveNext(null,u.$tabList[0],null,{mouse:true});}else{apf.window.$focus(u);}}else{if(!u.disabled&&u.focussable!==false){if(u.$focussable===apf.KEYBOARD_MOUSE){apf.window.$focus(u,{mouse:true});}else{if(u.canHaveChildren==2){if(!apf.config.allowBlur||!apf.document.activeElement||apf.document.activeElement.$focusParent!=u){apf.window.$focusLast(u,{mouse:true});}}else{apf.window.$focusDefault(u,{mouse:true});}}}else{apf.window.$focusDefault(u,{mouse:true});}}}}if(apf.hasFocusBug){var s=i[(y.srcElement||y.target).tagName]&&!(y.srcElement||y.target).disabled||(y.srcElement&&y.srcElement.isContentEditable)||u.$isContentEditable&&u.$isContentEditable(y)&&!u.disabled;if(!u||!s){apf.window.$focusfix();}}else{if(!m){apf.window.$focusevent();}}}}apf.dispatchEvent("mousedown",{htmlEvent:y,amlNode:u||apf.document.documentElement});var w=!(!apf.isIphone&&!apf.isIE&&(apf.document&&!apf.config.allowSelect&&(!apf.isParsingPartial||u)||apf.dragMode)&&!i[y.target.tagName]);if(w){u=apf.findHost(y.target);if(u){var s=i[(y.srcElement||y.target).tagName]&&!(y.srcElement||y.target).disabled||(y.srcElement&&y.srcElement.isContentEditable)||u.$isContentEditable&&u.$isContentEditable(y)&&!u.disabled;if(!s&&u.nodeType!=u.NODE_PROCESSING_INSTRUCTION&&!u.$allowSelect&&!u.getElementsByTagNameNS(apf.ns.xhtml,"*").length){w=false;}}}if(!w&&!t){if(y.preventDefault){y.preventDefault();}return false;}});apf.addListener(document,"selectstart",function(u){if(!u){u=event;}var t=!(apf.document&&!apf.config.allowSelect||apf.dragMode);if(t){var s=apf.findHost(u.srcElement);if(s&&s.nodeType!=s.NODE_PROCESSING_INSTRUCTION&&!s.$allowSelect&&!s.getElementsByTagNameNS(apf.ns.xhtml,"*").length){t=false;}}if(!t){u.returnValue=false;return false;}});apf.addListener(document,"keyup",this.$keyup=function(s){if(!s){s=event;}if(apf.document&&apf.document.activeElement&&!apf.document.activeElement.disableKeyboard&&apf.document.activeElement.dispatchEvent("keyup",{keyCode:s.keyCode,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,altKey:s.altkey,htmlEvent:s})===false){s.returnValue=false;return false;}apf.dispatchEvent("keyup",null,s);});function l(x){if(!x){x=event;}var z=null;if(x.wheelDelta){z=x.wheelDelta/120;if(apf.isOpera){z*=-1;}}else{if(x.detail){z=-x.detail/3;}}if(z!==null){if(apf.isIE){var u=x.srcElement||x.target;while(u&&u.scrollHeight<=u.offsetHeight){u=u.parentNode;}if(!u){return;}if(u.nodeType==9){u=u.documentElement;}if(u&&u.tagName=="BODY"&&"auto|scroll".indexOf(apf.getStyle(u,"overflowY"))==-1){u=document.documentElement;}if(u&&"auto|scroll".indexOf(apf.getStyle(u,"overflowY"))>-1){var s,y=0.35*u.offsetHeight*z;if(z<0){if(u&&u.scrollTop>=(s=u.scrollHeight-u.offsetHeight+apf.getVerBorders(u))+y){u.scrollTop=s;x.returnValue=false;}}else{if(u&&u.scrollTop<=y){u.scrollTop=0;x.returnValue=false;}}}}var w={delta:z,target:x.target||x.srcElement},t=apf.dispatchEvent("mousescroll",w);if(t===false||w.returnValue===false){if(x.preventDefault){x.preventDefault();}x.returnValue=false;}}}if(document.addEventListener){document.addEventListener("DOMMouseScroll",l,false);}window.onmousewheel=document.onmousewheel=l;apf.addListener(document,"keydown",this.$keydown=function(z){z=z||event;var u=apf.findHost(z.srcElement||z.target),t=i[(z.explicitOriginalTarget||z.srcElement||z.target).tagName]||(z.srcElement&&z.srcElement.isContentEditable);var x={ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,keyCode:z.keyCode,htmlEvent:z,bubbles:true};if(apf.document.activeElement&&!apf.document.activeElement.disableKeyboard&&apf.document.activeElement.dispatchEvent("keydown",x)===false){z.returnValue=false;z.cancelBubble=true;if(apf.canDisableKeyCodes){try{z.keyCode=0;}catch(z){}}if(z.preventDefault){z.preventDefault();}return false;}else{if((!apf.config.disableTabbing||apf.document.activeElement)&&z.keyCode==9){if(z.ctrlKey&&apf.document.activeElement){var s=apf.document.activeElement.$focusParent;if(s.modal){if(z.preventDefault){z.preventDefault();}return false;}apf.window.moveNext(z.shiftKey,apf.document.activeElement.$focusParent,true);s=apf.document.activeElement.$focusParent;if(s&&s.bringToFront){s.bringToFront();}}else{if(!apf.document.activeElement||apf.document.activeElement.tagName!="menu"){apf.window.moveNext(z.shiftKey);}}if(z.preventDefault){z.preventDefault();}return false;}}var y=apf.isMac?z.metaKey:z.altKey;if(apf.config.disableBackspace&&z.keyCode==8&&!t){if(apf.canDisableKeyCodes){try{z.keyCode=0;}catch(z){}}z.returnValue=false;}if(apf.config.disableF5&&(z.keyCode==116||z.keyCode==117)){if(apf.canDisableKeyCodes){try{z.keyCode=0;}catch(z){}}else{z.preventDefault();z.stopPropagation();}}if(z.keyCode==27){z.returnValue=false;}if(!apf.config.allowSelect&&z.shiftKey&&(z.keyCode>32&&z.keyCode<41)&&!t){z.returnValue=false;}if(z.returnValue===false&&z.preventDefault){z.preventDefault();}return z.returnValue;});apf.document={};this.init=function(s){if(apf.actiontracker){this.$at=new apf.actiontracker();this.$at.name="default";apf.nameserver.register("actiontracker","default",this.$at);}this.$domParser=new apf.DOMParser();this.document=apf.document=this.$domParser.parseFromString(s,"text/xml",{timeout:apf.config.initdelay,callback:function(u){if(apf.parsed!=2){var t=apf.parsed;apf.parsed=2;apf.dispatchEvent("parse",{initial:t});apf.parsed=true;}if(!apf.loaded){if(!apf.document.activeElement&&!apf.config.allowBlur){apf.window.focusDefault();}apf.loaded=true;if(apf.config.initdelay){$setTimeout(function(){apf.dispatchEvent("load");});}else{apf.dispatchEvent("load");}}}});this.addEventListener("focus",function(t){if(!apf.document.activeElement&&j&&!apf.isIphone){if(j.$isWindowContainer==-1){if(j.$tabList.length){apf.window.moveNext(null,j.$tabList[0]);}else{apf.window.$focus(j);}}else{apf.window.$focusLast(j);}}});this.addEventListener("blur",function(t){if(!apf.document.activeElement||apf.isIphone){return;}apf.document.activeElement.blur(true,{srcElement:this});j=apf.document.activeElement.$focusParent;apf.activeElement=apf.document.activeElement=null;});};this.destroy=function(){this.$at=null;apf.unload(this);apf=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;if(document.body){document.body.onmousedown=document.body.onmousemove=document.body.onmouseup=null;document.body.innerHTML="";}};};apf.window.prototype=new apf.Class().$init();apf.window=new apf.window();apf.sanitizeTextbox=function(a){a.onfocus=function(){if(apf.window){apf.window.$focusfix2();}};a.onblur=function(){if(apf.window){apf.window.$blurfix();}};};apf.runWebkit=function(){HTMLDocument.prototype.selectNodes=XMLDocument.prototype.selectNodes=function(c,b){if(c.substr(0,2)=="//"){c="."+c;}try{var k=this.evaluate(c,(b||this),this.createNSResolver(this.documentElement),7,null);}catch(j){try{var k=this.evaluate("child::"+c,(b||this),this.createNSResolver(this.documentElement),7,null);}catch(j){throw new Error("XPath error: "+j.message+"\nLine: "+j.lineNumber+"\nExpression: '"+c+"'");}}var d=new Array(k.snapshotLength);d.expr=c;for(var g=d.length-1;g>=0;g--){d[g]=k.snapshotItem(g);}return d;};Text.prototype.selectNodes=Element.prototype.selectNodes=function(b){return this.ownerDocument.selectNodes(b,this);};HTMLDocument.prototype.selectSingleNode=XMLDocument.prototype.selectSingleNode=function(c,b){var d=this.selectNodes(c,b||null);return d[0]||null;};Text.prototype.selectSingleNode=Element.prototype.selectSingleNode=function(b){return this.ownerDocument.selectSingleNode(b,this);};var a=new XMLSerializer();apf.insertHtmlNodes=function(g,m,d){var k,n=document.createDocumentFragment(),c=[],j=0,b=g.length;for(;j<b;j++){if(!(k=g[j])){continue;}n.appendChild(k);}(d||m).insertAdjacentHTML(d?"beforebegin":"beforeend",apf.html_entity_decode(a.serializeToString(n)).replace(/<([^>]+)\/>/g,"<$1></$1>"));};apf.insertHtmlNode=function(c,g,b,d){if(g.nodeType!=11&&!g.style){return g.appendChild(c);}if(!d){d=apf.html_entity_decode(c.serialize?c.serialize(true):((c.nodeType==3||c.nodeType==4||c.nodeType==2)?c.nodeValue:a.serializeToString(c)));}(b||g).insertAdjacentHTML(b?"beforebegin":"beforeend",d.replace(/<([^>]+)\/>/g,"<$1></$1>"));return b?b.previousSibling:g.lastChild;};if(apf.runNonIe){apf.runNonIe();}};apf.runIE=function(){var a=false,b=false;apf.getHttpReq=b?function(){if(apf.availHTTP.length){return apf.availHTTP.pop();}return new XMLHttpRequest();}:function(){if(apf.availHTTP.length){return apf.availHTTP.pop();}return new ActiveXObject("microsoft.XMLHTTP");};apf.getXmlDom=b?function(g,c){var d=getDOMParser(g,c);return d;}:function(i,c,g){var d=new ActiveXObject("microsoft.XMLDOM");d.setProperty("SelectionLanguage","XPath");if(g){d.preserveWhiteSpace=true;}if(i){if(apf.cantParseXmlDefinition){i=i.replace(/\] \]/g,"] ]").replace(/^<\?[^>]*\?>/,"");}d.loadXML(i);if(!c){this.xmlParseError(d);}}return d;};apf.xmlParseError=function(d){var c=d.parseError;if(c!=0){throw new Error(apf.formatErrorString(1050,null,"XML Parse error on line "+c.line,c.reason+"Source Text:\n"+c.srcText.replace(/\t/gi," ")));}return d;};apf.getStyle=function(c,d){return c.currentStyle[d];};apf.insertHtmlNodes=function(j,m,g){for(var o=[],k=0,d=j.length;k<d;k++){o[k]=j[k].xml;}o=apf.html_entity_decode(o.join(""));if(apf.isIE<7){o=o.replace(/style="background-image:([^"]*)"/g,"find='$1' style='background-image:$1'");}try{(g||m).insertAdjacentHTML(g?"beforebegin":"beforeend",o);}catch(n){document.body.insertAdjacentHTML("beforeend","<table><tr>"+o+"</tr></table>");var c=document.body.lastChild.firstChild.firstChild;for(k=c.childNodes.length-1;k>=0;k--){m.appendChild(c.childNodes[apf.hasDynamicItemList?0:k]);}}if(apf.isIE<7){$setTimeout(function(){var r=m.getElementsByTagName("*");for(var u,t=0,q=r.length;t<q;t++){if(u=r[t].getAttribute("find")){r[t].style.backgroundImage=u.trim();}}});}};apf.insertHtmlNode=function(g,i,c,k){if(i.nodeType!=11&&!i.style){return i.appendChild(g);}var d=c||i;if(!k){k=apf.html_entity_decode(g.serialize?g.serialize(true):g.xml||g.outerHTML||g.nodeValue);}try{d.insertAdjacentHTML(c?"beforeBegin":"beforeEnd",k);}catch(j){d.insertAdjacentHTML("afterEnd",k);return d.nextSibling;}return c?c.previousSibling:i.lastChild;};apf.getHorBorders=function(c){return Math.max(0,(parseInt(c.currentStyle.borderLeftWidth)||0)+(parseInt(c.currentStyle.borderRightWidth)||0));};apf.getVerBorders=function(c){return Math.max(0,(parseInt(c.currentStyle.borderTopWidth)||0)+(parseInt(c.currentStyle.borderBottomWidth)||0));};apf.getWidthDiff=function(c){return Math.max(0,(parseInt(c.currentStyle.paddingLeft)||0)+(parseInt(c.currentStyle.paddingRight)||0)+(parseInt(c.currentStyle.borderLeftWidth)||0)+(parseInt(c.currentStyle.borderRightWidth)||0));};apf.getHeightDiff=function(c){return Math.max(0,(parseInt(c.currentStyle.paddingTop)||0)+(parseInt(c.currentStyle.paddingBottom)||0)+(parseInt(c.currentStyle.borderTopWidth)||0)+(parseInt(c.currentStyle.borderBottomWidth)||0));};apf.getDiff=function(c){return[Math.max(0,(parseInt(c.currentStyle.paddingLeft)||0)+(parseInt(c.currentStyle.paddingRight)||0)+(parseInt(c.currentStyle.borderLeftWidth)||0)+(parseInt(c.currentStyle.borderRightWidth)||0)),Math.max(0,(parseInt(c.currentStyle.paddingTop)||0)+(parseInt(c.currentStyle.paddingBottom)||0)+(parseInt(c.currentStyle.borderTopWidth)||0)+(parseInt(c.currentStyle.borderBottomWidth)||0))];};apf.getMargin=function(c){return[Math.max(0,(parseInt(c.currentStyle.marginLeft)||0)+(parseInt(c.currentStyle.marginRight)||0)),Math.max(0,(parseInt(c.currentStyle.marginTop)||0)+(parseInt(c.currentStyle.marginBottom)||0))];};apf.getOpacity=function(c){return parseInt(((c.currentStyle.filter||"").match(/alpha\(opacity=(\d*)\)/)||[0,0])[1])/100;};apf.popup2={cache:{},setContent:function(j,i,g,d,c){if(!this.popup){this.init();}this.cache[j]={content:i,style:g,width:d,height:c};if(i.parentNode){i.parentNode.removeChild(i);}if(g){apf.importCssString(g,this.popup.document);}return this.popup.document;},removeContent:function(c){this.cache[c]=null;delete this.cache[c];},init:function(){this.popup=window.createPopup();this.popup.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                <html xmlns="http://www.w3.org/1999/xhtml" xmlns:a='+apf.ns.aml+' xmlns:xsl="http://www.w3.org/1999/XSL/Transform">                <head>                    <script>                    var apf = {                        all: [],                        lookup:function(uniqueId){                            return this.all[uniqueId] || {                                $setStyleClass:function(){}                            };                        }                    };                    function destroy(){                        apf.all=null;                    }                    <\/script>                    <style>                    HTML{border:0;overflow:hidden;margin:0}                    BODY{margin:0}                    </style>                </head>                <body onmouseover="if(!self.apf) return;if(this.c){apf.all = this.c.all;this.c.Popup.parentDoc=self;}"></body>                </html>');var d=apf;this.popup.document.body.onmousemove=function(){this.c=d;};},show:function(u,q,n,g,k,d,t,s){if(!this.popup){this.init();}var j=this.cache[u];this.popup.document.body.innerHTML=j.content.outerHTML;if(g){var r,m=7,l=0,c=this.popup;r=setInterval(function(){var i=++l*((t||j.height)/m);c.show(q,n,d||j.width,i,k);c.document.body.firstChild.style.marginTop=(l-m-1)*((t||j.height)/m);if(l>m){clearInterval(r);s(c.document.body.firstChild);}},10);}else{this.popup.show(q,n,d||j.width,t||j.height,k);}this.last=u;},hide:function(){if(this.popup){this.popup.hide();}},forceHide:function(){if(this.last){apf.lookup(this.last).dispatchEvent("popuphide");}},destroy:function(){if(!this.popup){return;}this.popup.document.body.c=null;this.popup.document.body.onmouseover=null;}};apf.importClass(apf.runXpath,true,self);};apf.runIphone=function(){if(!apf.isIphone){return;}$setTimeout(function(){apf.importCssString('html, body {                margin: 0;                font-family: Helvetica;                background: #fff;                color: #000000;                overflow-x: hidden;                -webkit-user-select: none;                -webkit-text-size-adjust: none;                -webkit-touch-callout: none;            }            body > *:not(.toolbar) {                min-height: 372px;            }            body[orient="landscape"] > *:not(.toolbar) {                min-height: 268px;            }            body > *[selected="true"] {                display: block;            }',"screen");var l=document.getElementsByTagName("head")[0];if(apf.config.iphoneIcon){var m=document.createElement("link");m.setAttribute("rel","apple-touch-icon"+(apf.config.iphoneIconIsGlossy?"":"-precomposed"));m.setAttribute("href","apf.config.iphoneIcon");l.appendChild(m);}function n(o,q){var r=document.createElement("meta");r.setAttribute("name",o);r.setAttribute("content",q);l.appendChild(r);}if(apf.config.iphoneFixedViewport){n("viewport","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;");}if(apf.config.iphoneFullScreen){n("apple-mobile-web-app-capable","yes");if(apf.config.iphoneStatusBar){n("apple-mobile-web-app-status-bar-style","apf.config.iphoneStatusBar");}}});var a=false,c=0,i="portrait",d="landscape",g=null;apf.addDomLoadEvent(function(){$setTimeout(b,0);g=setInterval(b,300);});function k(){switch(window.orientation){case 0:j(i);break;case 90:case -90:j(d);break;}}if(typeof window.onorientationchange=="object"){window.onorientationchange=k;a=true;$setTimeout(k,0);}function b(){if(!a){if(window.innerWidth!=c){c=window.innerWidth;var l=c==320?i:d;j(l);}}}function j(l){document.body.setAttribute("orient",l);$setTimeout("scrollTo(0,1)",100);}["gesturestart","gesturechange","gestureend","orientationchange"].forEach(function(l){document["on"+l]=function(m){if(apf.dispatchEvent){apf.dispatchEvent(l,m);}};});apf.iphone={titleNode:null,linkEvents:function(n,m){return;n[m?"onclick":"ontouchstart"]=function(o){if(!o.touches||o.touches.length!=1){return;}var q=o.touches[0];if(typeof this.onmousedown=="function"){this.onmousedown(q);if(this!=document){return false;}}};n.ontouchmove=function(o){if(!o.touches||o.touches.length!=1){return;}var q=o.touches[0];if(typeof this.onmousemove=="function"){this.onmousemove(q);if(this!=document){return false;}}};var l=false;n.ontouchend=n.ontouchcancel=function(o){if(l){return;}var q=o.touches&&o.touches.length?o.touches[0]:o.changedTouches[0];if(!q){return;}l=true;$setTimeout(function(){l=false;});if(typeof this.onmouseup=="function"){this.onmouseup(q);if(this!=document){return false;}}};return this;},nav:{sections:null,active:null,def:"home",divideChar:"/",levelTwoChar:"-",go:function(s,q){var r,m,t=apf.iphone.nav;t.update();if(!(m=t.sections[s.page])){return;}scrollTo(0,1);apf.dispatchEvent("pagechange",s);var w=m.getAttribute("title");if(apf.iphone.titleNode&&w){apf.iphone.titleNode.innerHTML=w;}if(q){for(r in t.sections){t.sections[r].hide();}m.show();}else{for(r in t.sections){if(!t.sections[r].visible||r==s.page){continue;}var u=t.sections[r];u.setProperty("zindex",0);apf.tween.single(u.$ext,{steps:5,interval:10,from:u.$ext.offsetLeft,to:(s.index<0)?1000:-1000,type:"left",anim:apf.tween.EASEOUT,onfinish:function(){u.setProperty("visible",false);}});}var o=10,n=m.$ext,l=(s.index<0)?-(n.offsetWidth)-o:window.innerWidth+n.offsetLeft+o;m.setProperty("visible",true);m.setProperty("zindex",apf.all.length+1);apf.tween.single(n,{steps:5,interval:10,from:l,to:0,type:"left",anim:apf.tween.EASEIN});}},update:function(m){if(this.sections&&!m){return;}this.sections={};for(var l in window){if(window[l]&&window[l]["tagName"]&&window[l].tagName=="section"){this.sections[l]=window[l];}}}}};$setTimeout(function(){apf.addEventListener("hashchange",apf.iphone.nav.go);if(location.href.match(/#(.*)$/)){apf.history.init(decodeURI(RegExp.$1));}else{if(apf._GET.page){apf.history.init(apf._GET.page);}else{apf.history.init();}}});document.ontouchstart=function(l){if(!l.touches||l.touches.length!=1){return;}var o=l.touches[0],n=o.target,m=apf.findHost(o.target);if(!m){return;}while(typeof n.onmousedown!="function"&&n!=document.body){n=n.parentNode;}if(typeof n.onmousedown=="function"){if(typeof n.onmouseover=="function"){n.onmouseover(o);}else{if(typeof n.onmousemove=="function"){n.onmousemove(o);}}n.onmousedown(o);return false;}};document.ontouchmove=function(l){if(!l.touches||l.touches.length!=1){return;}var o=l.touches[0],n=o.target,m=apf.findHost(o.target);if(!m){return;}while(typeof n.onmousemove!="function"&&n!=document.body){n=n.parentNode;}if(typeof n.onmousemove=="function"){n.onmousemove(o);return false;}else{if(typeof document.onmousemove=="function"){return document.onmousemove(o);}}};document.ontouchend=document.ontouchcancel=function(l){var o=l.touches&&l.touches.length?l.touches[0]:l.changedTouches[0];if(!o){return;}var n=o.target,m=apf.findHost(o.target);if(!m){return;}while(typeof n.onmouseup!="function"&&n!=document.body){n=n.parentNode;}if(typeof n.onmouseup=="function"){if(typeof n.onmouseout=="function"){n.onmouseout(o);}n.onmouseup(o,true);return false;}else{if(typeof document.onmouseup=="function"){return document.onmouseup(o);}}};};apf.runNonIe=function(){DocumentFragment.prototype.getElementById=function(k){return this.childNodes.length?this.childNodes[0].ownerDocument.getElementById(k):null;};if(XMLDocument.prototype.__defineGetter__){XMLDocument.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this);});XMLDocument.prototype.__defineSetter__("xml",function(){throw new Error(apf.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){Text.prototype.insertAdjacentElement=HTMLElement.prototype.insertAdjacentElement=function(k,l){switch(k.toLowerCase()){case"beforebegin":this.parentNode.insertBefore(l,this);break;case"afterbegin":this.insertBefore(l,this.firstChild);break;case"beforeend":this.appendChild(l);break;case"afterend":if(this.nextSibling){this.parentNode.insertBefore(l,this.nextSibling);}else{this.parentNode.appendChild(l);}break;}};}if(!HTMLElement.prototype.insertAdjacentHTML){Text.prototype.insertAdjacentHTML=HTMLElement.prototype.insertAdjacentHTML=function(l,n){var m=this.ownerDocument.createRange();m.setStartBefore(apf.isWebkit?document.body:(self.document?document.body:this));var k=m.createContextualFragment(n);this.insertAdjacentElement(l,k);};}if(!HTMLBodyElement.prototype.insertAdjacentHTML){HTMLBodyElement.prototype.insertAdjacentHTML=HTMLElement.prototype.insertAdjacentHTML;}if(!HTMLElement.prototype.insertAdjacentText){Text.prototype.insertAdjacentText=HTMLElement.prototype.insertAdjacentText=function(l,m){var k=document.createTextNode(m);this.insertAdjacentElement(l,k);};}HTMLElement.prototype.removeNode=function(){if(!this.parentNode){return;}this.parentNode.removeChild(this);};if(HTMLElement.prototype.__defineSetter__){HTMLElement.prototype.__defineSetter__("innerText",function(k){var l=""+k;this.innerHTML=l.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 c=false;try{XMLDocument.prototype.async=true;c=true;}catch(i){}Document.prototype.onreadystatechange=null;Document.prototype.parseError=0;Array.prototype.item=function(k){return this[k];};Array.prototype.expr="";try{XMLDocument.prototype.readyState=0;}catch(i){}XMLDocument.prototype.$clearDOM=function(){while(this.hasChildNodes()){this.removeChild(this.firstChild);}};XMLDocument.prototype.$copyDOM=function(k){this.$clearDOM();if(k.nodeType==9||k.nodeType==11){var m=k.childNodes;for(var l=0;l<m.length;l++){this.appendChild(this.importNode(m[l],true));}}else{if(k.nodeType==1){this.appendChild(this.importNode(k,true));}}};XMLDocument.prototype.loadXML=function(m){apf.xmldb.setReadyState(this,1);var l=this.xml||this.serialize();var k=(new DOMParser()).parseFromString(m,"text/xml");apf.xmldb.setReadyState(this,2);this.$copyDOM(k);apf.xmldb.setReadyState(this,3);apf.xmldb.loadHandler(this);return l;};Node.prototype.getElementById=function(k){};HTMLElement.prototype.replaceNode=Element.prototype.replaceNode=function(k){if(!this.parentNode){return;}this.parentNode.insertBefore(k,this);this.parentNode.removeChild(this);};XMLDocument.prototype.$load=XMLDocument.prototype.load;XMLDocument.prototype.load=function(n){var k=document.implementation.createDocument("","",null);k.$copyDOM(this);this.parseError=0;apf.xmldb.setReadyState(this,1);try{if(this.async==false&&c){var l=new XMLHttpRequest();l.open("GET",n,false);l.overrideMimeType("text/xml");l.send(null);apf.xmldb.setReadyState(this,2);this.$copyDOM(l.responseXML);apf.xmldb.setReadyState(this,3);}else{this.$load(n);}}catch(m){this.parseError=-1;}finally{apf.xmldb.loadHandler(this);}return k;};apf.getStyle=function(k,l){return window.getComputedStyle(k,"").getPropertyValue(l);};HTMLDocument.prototype.setProperty=XMLDocument.prototype.setProperty=function(k,l){};apf.getHttpReq=function(){if(apf.availHTTP.length){return apf.availHTTP.pop();}return new XMLHttpRequest();};apf.getXmlDom=function(m,k){var l;if(m){l=new DOMParser();l=l.parseFromString(m,"text/xml");if(!k){this.xmlParseError(l);}}else{l=document.implementation.createDocument("","",null);}return l;};apf.xmlParseError=function(l){if(l.getElementsByTagName("parsererror").length){var o=l.documentElement.firstChild.nodeValue.split("\n"),m=o[2].match(/\w+ (\d+)/)[1],n=o[0].replace(/\w+ \w+ \w+: (.*)/,"$1"),k=l.documentElement.lastChild.firstChild.nodeValue.split("\n")[0];throw new Error(apf.formatErrorString(1050,null,"XML Parse Error on line "+m,n+"\nSource Text : "+k.replace(/\t/gi," ")));}return l;};apf.xmldb.setReadyState=function(k,l){k.readyState=l;if(k.onreadystatechange!=null&&typeof k.onreadystatechange=="function"){k.onreadystatechange();}};apf.xmldb.loadHandler=function(k){if(!k.documentElement||k.documentElement.tagName=="parsererror"){k.parseError=-1;}apf.xmldb.setReadyState(k,4);};apf.Init.add(function(){var l,k=document.getElementsByTagName("form");for(l=0;l<k.length;l++){k[l].removeNode();}k=document.getElementsByTagName("xml");for(l=0;l<k.length;l++){k[l].removeNode();}k=null;});if(document.body){document.body.focus=function(){};}if(!document.elementFromPoint){Document.prototype.elementFromPointRemove=function(k){if(!this.RegElements){return;}this.RegElements.remove(k);};Document.prototype.elementFromPointAdd=function(k){if(!this.RegElements){this.RegElements=[];}this.RegElements.push(k);};Document.prototype.elementFromPointReset=function(k){FoundValue=[];FoundNode=null;LastFoundAbs=document.documentElement;};Document.prototype.elementFromPoint=function(w,s){document.elementFromPointReset();if(this.RegElements){var A=-1,m,l,k,u,t,q,o,r;for(A=-1,l,m=0;m<this.RegElements.length;m++){k=this.RegElements[m];if(a(k,"display")=="none"){continue;}u=j(k);t=g(k);q=u+k.offsetWidth;o=t+k.offsetHeight;if(w>u&&w<q&&s>t&&s<o){r=d(k);if(r>A){l=[k,w,s,u,t];A=r;}}}if(l){b(l[0],l[1],l[2],0,FoundValue,l[3],l[4]);if(!FoundNode){FoundNode=l[0];LastFoundAbs=l[0];FoundValue=[A];}}}if(!this.RegElements||!this.RegElements.length){b(document.body,w,s,0,[],j(document.body),g(document.body));}return FoundNode;};function a(k,l){return document.defaultView.getComputedStyle(k,"").getPropertyValue(l);}function b(D,q,o,r,I,t,s){var J=I,A=r,C=D.childNodes,B,E,m,w,u,H,G,F,k,l;for(B,E=0;E<D.childNodes.length;E++){B=D.childNodes[E];if(B.nodeType==1&&a(B,"display")!="none"&&B.offsetParent){w=t+B.offsetLeft-B.offsetParent.scrollLeft;u=s+B.offsetTop-B.offsetParent.scrollTop;H=w+B.offsetWidth;G=u+B.offsetHeight;F=a(B,"position");F=(F=="absolute")||(F=="relative");k=a(B,"overflow")=="hidden";l=(q>w&&q<H&&o>u&&o<G);if(F&&k&&!l){continue;}r=A;I=J.copy();m=parseInt(a(B,"z-index"))||0;if(F&&(m||m==0)||k){if(!F){m=0;}if(m>=(FoundValue[r]||0)){if(m>(I[r]||0)){I[r]=m;}r++;if(l&&r>=FoundValue.length){FoundNode=B;FoundValue=I;LastFoundAbs=B;}}else{continue;}}else{if(l&&r>=FoundValue.length){FoundNode=B;FoundValue=I;}}b(B,q,o,r,I,F?w:t,F?u:s);}}}function g(k){return k.offsetTop+parseInt(apf.getStyle(k,"border-top-width"))+(k.offsetParent?g(k.offsetParent):0);}function j(k){return k.offsetLeft+parseInt(apf.getStyle(k,"border-left-width"))+(k.offsetParent?j(k.offsetParent):0);}function d(m){var l=0,o,k=m;while(k&&k.nodeType==1){l=Math.max(l,parseInt(a(k,"z-index"))||-1);k=k.parentNode;}return l;}}apf.getHorBorders=function(k){return Math.max(0,(parseInt(apf.getStyle(k,"border-left-width"))||0)+(parseInt(apf.getStyle(k,"border-right-width"))||0));};apf.getVerBorders=function(k){return Math.max(0,(parseInt(apf.getStyle(k,"border-top-width"))||0)+(parseInt(apf.getStyle(k,"border-bottom-width"))||0));};apf.getWidthDiff=function(k){return Math.max(0,(parseInt(apf.getStyle(k,"padding-left"))||0)+(parseInt(apf.getStyle(k,"padding-right"))||0)+(parseInt(apf.getStyle(k,"border-left-width"))||0)+(parseInt(apf.getStyle(k,"border-right-width"))||0));};apf.getHeightDiff=function(k){return Math.max(0,(parseInt(apf.getStyle(k,"padding-top"))||0)+(parseInt(apf.getStyle(k,"padding-bottom"))||0)+(parseInt(apf.getStyle(k,"border-top-width"))||0)+(parseInt(apf.getStyle(k,"border-bottom-width"))||0));};apf.getDiff=function(k){return[Math.max(0,parseInt(apf.getStyle(k,"padding-left"))+parseInt(apf.getStyle(k,"padding-right"))+parseInt(apf.getStyle(k,"border-left-width"))+parseInt(apf.getStyle(k,"border-right-width"))||0),Math.max(0,parseInt(apf.getStyle(k,"padding-top"))+parseInt(apf.getStyle(k,"padding-bottom"))+parseInt(apf.getStyle(k,"border-top-width"))+parseInt(apf.getStyle(k,"border-bottom-width"))||0)];};apf.getMargin=function(k){return[Math.max(0,(parseInt(apf.getStyle(k,"margin-left"))||0)+(parseInt(apf.getStyle(k,"margin-right"))||0)),Math.max(0,(parseInt(apf.getStyle(k,"margin-top"))||0)+(parseInt(apf.getStyle(k,"margin-bottom"))||0))];};apf.getOpacity=function(k){return apf.getStyle(k,"opacity");};};apf.runOpera=function(){if(apf.runNonIe){apf.runNonIe();}Document.prototype.selectNodes=XMLDocument.prototype.selectNodes=HTMLDocument.prototype.selectNodes=function(c,b){var j=this.evaluate(c,(b?b:this),this.createNSResolver(this.documentElement),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var d=new Array(j.snapshotLength);d.expr=c;for(var g=0;g<d.length;g++){d[g]=j.snapshotItem(g);}return d;};Text.prototype.selectNodes=Element.prototype.selectNodes=function(b){var c=this.ownerDocument;if(!c.selectSingleNode){c.selectSingleNode=HTMLDocument.prototype.selectSingleNode;c.selectNodes=HTMLDocument.prototype.selectNodes;}if(c.selectNodes){return c.selectNodes(b,this);}else{throw new Error(apf.formatErrorString(1047,null,"XPath Selection","Method selectNodes is only supported by XML Nodes"));}};Document.prototype.selectSingleNode=XMLDocument.prototype.selectSingleNode=HTMLDocument.prototype.selectSingleNode=function(c,b){var d=this.selectNodes(c+"[1]",b?b:null);return d.length>0?d[0]:null;};Text.prototype.selectSingleNode=Element.prototype.selectSingleNode=function(b){var c=this.ownerDocument;if(!c.selectSingleNode){c.selectSingleNode=HTMLDocument.prototype.selectSingleNode;c.selectNodes=HTMLDocument.prototype.selectNodes;}if(c.selectSingleNode){return c.selectSingleNode(b,this);}else{throw new Error(apf.formatErrorString(1048,null,"XPath Selection","Method selectSingleNode is only supported by XML Nodes. \nInfo : "+e));}};var a=new XMLSerializer();apf.insertHtmlNodes=function(d,k,c){var j,m=document.createDocumentFragment(),g=0,b=d.length;for(;g<b;g++){if(!(j=d[g])){continue;}m.appendChild(j);}(c||k).insertAdjacentHTML(c?"beforebegin":"beforeend",apf.html_entity_decode(a.serializeToString(m)).replace(/<([^>]+)\/>/g,"<$1></$1>"));};apf.insertHtmlNode=function(c,g,b,d){if(g.nodeType!=11&&!g.style){return g.appendChild(c);}if(!d){d=apf.html_entity_decode(c.serialize?c.serialize(true):((c.nodeType==3||c.nodeType==4||c.nodeType==2)?c.nodeValue:a.serializeToString(c)));}(b||g).insertAdjacentHTML(b?"beforebegin":"beforeend",d.replace(/<([^>]+)\/>/g,"<$1></$1>"));return b?b.previousSibling:g.lastChild;};};apf.runGecko=function(){if(apf.runNonIe){apf.runNonIe();}HTMLDocument.prototype.selectNodes=XMLDocument.prototype.selectNodes=function(d,c){try{var l=this.evaluate(d,(c||this),this.createNSResolver(this.documentElement),7,null);}catch(k){var m=k.message;if(k.code==k.INVALID_EXPRESSION_ERR){m=m.replace(/the expression/i,"'"+d+"'");}throw new b(k.lineNumber,"XPath error: "+m);}var g=new Array(l.snapshotLength);g.expr=d;for(var j=g.length-1;j>=0;j--){g[j]=l.snapshotItem(j);}return g;};Text.prototype.selectNodes=Element.prototype.selectNodes=function(c){return this.ownerDocument.selectNodes(c,this);};HTMLDocument.prototype.selectSingleNode=XMLDocument.prototype.selectSingleNode=function(d,c){var g=this.selectNodes(d+"[1]",c||null);return g[0]||null;};Text.prototype.selectSingleNode=Element.prototype.selectSingleNode=function(c){return this.ownerDocument.selectSingleNode(c,this);};var a=new XMLSerializer();apf.insertHtmlNodes=function(g,m,d){var n=document.createElement("div"),q=document.createDocumentFragment(),j=g.length-1,c,k;for(;j>=0;j--){k=g[j];q.insertBefore(k,q.firstChild);}n.innerHTML=apf.html_entity_decode(a.serializeToString(q)).replace(/<([^>]+)\/>/g,"<$1></$1>");q=document.createDocumentFragment();for(j=0,c=n.childNodes.length;j<c;j++){k=n.childNodes[0];q.appendChild(k);}if(d){m.insertBefore(q,d);}m.appendChild(q);};apf.insertHtmlNode=function(d,i,c,g){if(i.nodeType!=11&&!i.style){return i.appendChild(d);}var j=document.createElement("div");if(!g){g=apf.html_entity_decode(d.serialize?d.serialize(true):((d.nodeType==3||d.nodeType==4||d.nodeType==2)?d.nodeValue:a.serializeToString(d)));}j.innerHTML=g.replace(/<([^>]+)\/>/g,"<$1></$1>");if(c){i.insertBefore(j.firstChild,c);}i.appendChild(j.firstChild);return c?c.previousSibling:i.lastChild;};function b(c,d){this.message=d;this.nr=c;}};apf.url=function(j){var d;if(j.indexOf(":")==-1&&(d=location.toString()).indexOf(":")!=-1){d=new apf.url(d);j=apf.getAbsolutePath(d.protocol+"://"+d.host+"/"+(d.directory.charAt(d.directory.length-1)=="/"?d.directory:d.directory+"/"),j).replace(/\/\/\/\//,"///");}var g=apf.url.options,b=g.parser[g.strictMode?"strict":"loose"].exec(j),c=14;this.uri=j.toString();while(c--){this[g.key[c]]=b[c]||"";}this[g.q.name]={};var a=this;this[g.key[12]].replace(g.q.parser,function(k,i,l){if(i){a[g.q.name][i]=l;}});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);};};apf.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*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};apf.JSImplementation=function(){var a=["[","{","(","text","xpath","word","sep","ws","semi","sh","op","col","str","regex","comment"];var c=["]","}",")"];var b=new RegExp();b.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(o,l,g){for(var k=0;k<o.length;k++){var d=o[k],j=d[0];if(j<3){l.push(g+a[j]);this.dump_tree(d[1],l,"  "+g);l.push(c[j]);l.push("\n");}else{l.push(g+a[j]+": "+d[1]+"\n");}}return l;};this.parse=function(u,k){var n=[];var x=[];var w=[];var l=x;var g=0,r=0;var m=0,d=0;var t=0;var s=[0,0,0];u.replace(b,function(Q,S,L,T,P,N,M,z,U,I,C,y,E,W,B,R,j,G,K,J,H,O,D){function F(Y){var X=k?u.substr(r,D-r).replace(/[\r\n]\s*/,"").replace(/^\s*[\r\n]/,"").replace(/[\r\n\t]/g,""):u.substr(r,D-r).replace(/[\r\n\t]/g,"");if(X.length>0){l[l.length]=[Y,X,r,D];}}function V(X,Y){l[l.length]=[X,Y,D];}function A(X){s[X]++;var Y=[];l[l.length]=[X,Y,D];w[w.length]=l;l=Y;}function i(X){s[X]--;if(w.length==0){n[n.length]=["extra "+c[X],D];}else{l=w.pop();var Y=l[l.length-1][0];if(Y!=X){n[n.length]=["scope mismatch "+a[Y]+" with "+a[X],D];}}}if(!m){if(S){V(5,Q);if(Q=="macro"){t=1;}else{if(t){macros[Q]=1,t=0;}}}if(L){V(6,",");}if(y){V(7,Q);}if(T){V(8,Q);}if(U){V(9,Q);}if(I){V(10,Q);}if(C){V(11,Q);}if(W){A(0);}if(B){i(0);}if(G){A(1);}if(K){i(1);}if(R){A(2);}if(j){i(2);}}if(M){if(m==0){m=5;r=D+2;}}if(z){if(m==5){m=0;D+=1;F(14);}}if(J){if(m==0){m=1;r=D;}else{if(m==1){m=0;D+=1;F(12);}}}if(H){if(m==0){m=2;r=D;}else{if(m==2){m=0;D+=1;F(12);}}}if(P){if(m==0){m=4;r=D+2;}}if(N){if(m==4){m=0;F(14);}}if(O){if(m==0){if(l.length==0||l[l.length-1][0]==6){m=3;r=D;}else{V(10,Q);}}else{if(m==3){m=0;D+=1;F(13);}}}return Q;});if(w.length>0){for(var q=w.length-1;q>=0;q--){var o=w[q][w[q].length-1];n[n.length]=["unclosed tag "+a[o[0]],o[2]];}}return{tree:x,stack:w,err:n,count:s};};};apf.JavascriptParser=new apf.JSImplementation();apf.runXpath=function(){apf.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(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==apf.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 data=info[count],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 data=info[count],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 data=info[count],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 data=info[count],tagName=x[0],inclSelf=x[1],prefix=x[2],nodes,i,l;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(apf.isIE){nodes=htmlNode.getElementsByTagName("*");}else{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);recur(n);}})(htmlNode);}}else{nodes=htmlNode.getElementsByTagName((prefix&&(apf.isGecko||apf.isOpera||htmlNode.nodeFunc)?prefix+":":"")+tagName);}for(i=0,l=nodes.length;i<l;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 data=info[count],tagName=x[0],inclSelf=x[1],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 data=info[count],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 data=info[count],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").replace(/\|\|(\d+)\|\|\d+/g,"##$1").replace(/\.\|\|\d+/g,".").replace(/\[([^\]]*)\]/g,function(match,m1){return"/##"+m1.replace(/\|/g,"_@_");});if(sExpr=="/"||sExpr=="."){return sExpr;}return this.processXpath(sExpr.replace(/\/\//g,"descendant::"),isAbsolute);},processXpath:function(sExpr,isAbsolute){var results=[],i,l,m,query;sExpr=sExpr.replace(/'[^']*'/g,function(m){return m.replace("|","_@_");});sExpr=sExpr.split("|");for(i=0,l=sExpr.length;i<l;i++){sExpr[i]=sExpr[i].replace(/_\@\_/g,"|");}if(sExpr.length==1){sExpr=sExpr[0];}else{for(i=0,l=sExpr.length;i<l;i++){sExpr[i]=this.processXpath(sExpr[i]);}results.push([this.multiXpaths,sExpr]);return results;}var sections=sExpr.split("/");for(i=0,l=sections.length;i<l;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(/^\#\#(.*)$/)){query=RegExp.$1;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,["apf.XPath.doXpathFunc(htmlNode, 'local-name') == '"+RegExp.$1+"'"]]);}else{query=sections[i];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){return new apf.CodeCompilation(code).compile();},doXpathFunc:function(contextNode,type,nodelist,arg2,arg3,xmlNode){if(!nodelist||nodelist.length==0){nodelist="";}if(type=="not"){return !nodelist;}var arg1,i,l;if(typeof nodelist=="object"||nodelist.dataType==apf.ARRAY){if(nodelist&&!nodelist.length){nodelist=[nodelist];}var res=false,value;for(i=0,l=nodelist.length;i<l;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 apf.getChildNumber(contextNode)+1;case"format-number":return apf.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).split(":").pop();case"substring":return arg1&&arg2?arg1.substring(arg2,arg3||0):"";case"contains":return arg1&&arg2?arg1.indexOf(arg2)>-1:false;case"concat":var str="";for(i=1,l=arguments.length;i<l;i++){if(typeof arguments[i]=="object"){str+=getNodeValue(arguments[i][0]);continue;}str+=arguments[i];}return str;case"translate":for(i=0,l=arg2.length;i<l;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,l=sResult.length;i<l;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],rootNode=(info[3]?(contextNode.nodeType==9?contextNode.documentElement:this.getRoot(contextNode)):contextNode),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;}apf.CodeCompilation=function(code){this.data={F:[],S:[],I:[],X:[]};this.compile=function(){code=code.replace(/ or /g," || ").replace(/ and /g," && ").replace(/!=/g,"{}").replace(/=/g,"==").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_";});data=this.data.S;code=code.replace(/'([^']*)'/g,function(d,match){return(data.push(match)-1)+"S_";}).replace(/"([^"]*)"/g,function(d,match){return(data.push(match)-1)+"S_";});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_";}).replace(/(\.[\.\@\/\w]*)/g,function(d,m1,m2){return(data.push(m1)-1)+"X_";});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"apf.XPath.selectNodeExtended('"+data.X[nr].replace(/'/g,"\\'")+"', htmlNode, "+str+")";}).replace(/(\d+)([FISX])_/g,function(d,nr,type){var value=data[type][nr];if(type=="F"){return"apf.XPath.doXpathFunc(htmlNode, '"+value+"', ";}else{if(type=="S"){return"'"+value+"'";}else{if(type=="I"){return value;}else{if(type=="X"){return"apf.XPath.selectNodeExtended('"+value.replace(/'/g,"\\'")+"', htmlNode)";}}}}}).replace(/, \)/g,")");};};};apf.lm=new (function(){var bx={"var":1,"for":1,"while":1,"do":1,"if":1,"else":1,"switch":1,"case":1,"break":1,"continue":1,"default":1,"function":2,"return":1,"try":1,"catch":1,"throw":1,"debugger":1,alert:1,confirm:1,setTimeout:1,setInterval:1,"delete":1,"export":1,"import":1,label:1,foreach:1,each:1,node:1,local:1,yield:1,let:1,"finally":1,"delete":1},aw={"\n":1,"\r\n":1,"==":2,"++":2,"--":2,'"':5,"'":5,"<!--":6,"-->":6,"/*":6,"//":6,"*/":6,"{":7,"}":8,"[":9,"]":10,"(":11,")":12,"<":13,">":14,"+=":2,"-=":2,"/=":2,"*=":2,"!=":2},aO={"{":"}","[":"]","(":")","{{":"}"},aR={ancestor:1,"ancestor-or-self":1,attribute:1,child:1,descendant:1,"descendant-or-self":1,following:1,"following-sibling":1,namespace:1,parent:1,preceding:1,self:1},aZ={";":1,",":2,"^":3,"=":4,"+=":4,"-=":4,"/=":4,"*=":4,"/":5,":":6},aQ={"~":"_val(_n,","%":"_nod(_n,","*":"_nods(_n,","#":"_cnt(_n,","$":"_lng("},l={"~":"_val(_n,","%":"_xml(_n,","*":"_xmls(_n,","#":"_cnt(_n,","$":"_lng("},bc={"~":"_val(_n,","%":"_val(_n,","*":"_val(_n,","#":"_cnt(_n,","$":"_lng("},bE,C={"~":"_val(_n,","%":"_xml(_n,","*":"_xmls(_n,","#":"_cnt(_n,","$":"_lng("},ak={"~":"_val(_n,","%":"_xml(_n,","*":"_xmls(_n,","#":"_cnt(_n,","$":"_lnged("},k={"[":1,"(":1,",":1,"=":1,"return":1,"throw":1},aa={"else":1,"return":1,"delete":1},aA={"do":1,"else":1,"try":1},a4={"=":"_asn(","+=":"_add(","-=":"_sub(","/=":"_div(","*=":"_mul("},aC={"+":1,"%":1,"-":1,"/":1,"=":1,"(":1,"?":1,"|":1,"^":1,"[":1,"&":1,"*":1,"!":1,":":1,"<":1,",":1},aS={"{":1,"} ":1,")":1,")   ":1,";":1,"\n":1,"else":1},L={"{":1,";":1,"\n":1,"else":1},u={"} ":1,")   ":1,"(":1,")":1,";":1,"&":1,"^":1,"|":1,",":1,'"':1,"'":1,"=":1,"!=":2,"+=":2,"-=":2,"/=":2,"*=":2,"?":1,"{":1,"}":1,">":1,"[":1,"]":1,"+":1,":":1,"else":1,"return":1},F={'"':1,"'":1,">":1,"]":1,"}":1},bu={'\\"':'"',"\\'":"'","\\{":"{","\\}":"}","\\[":"[","\\]":"]","\\(":"(","\\)":")","\\\\":"\\"},bA={alert:1,confirm:1,setTimeout:1,setInterval:1,"switch":1,call:1,"return":1,"throw":1,"case":1,"catch":1},q={" ":1,"\n":1},a2={"{":1,";":1,"(":1,"\n":1},bj={"\\{":"{","\\}":"}","\\[":"[","\\]":"]","\\(":"(","\\)":")"},B={"\\{":"{","\\}":"}","\\[":"[","\\]":"]","\\(":"(","\\)":")","\\\\":"\\\\\\\\","\\":"\\\\","\\<":"<","\\>":">"},ar={lte:"<=",gte:">=",lt:"<",gt:">",and:"&&",or:"||",andbin:"&",orbin:"|",LTE:"<=",GTE:">=",LT:"<",GT:">",AND:"&&",OR:"||",ANDBIN:"&",ORBIN:"|"},O={0:"_val(_n,",1:"_valcr(_n,_cr,",2:"_nod(_n,",3:"_nodcr(_n,_cr,",4:"_nods(_n,",5:"_xpt(_n,",6:"_valst(_n,",7:"_valed(_n,",8:"_valattr(_n,",foreach:"_nods(_n,",each:"_nods(_n,",local:"_nod(_n,",tagName:"_nod(_n,",localName:"_nod(_n,",xml:"_xmlq(",_call:"_val(_n,"},a0={"_val(_n,":"_valm(","_valcr(_n,_cr,":"_valcr(0,_cr,","_nod(_n,":"_nodm(","_nodcr(_n,_cr,":"_nodcr(0,_cr,","_nods(_n,":"_nodsm(","_xml(_n,":"_xml(0,","_xmls(_n,":"_xmls(0,","_cnt(_n,":"_cntm(","_xpt(_n,":"_xptm(","_valst(_n,":"_valm(","_valed(_n,":"_valed(0,","_lng(":"_lng(","_lnged(":"_lnged(","_nod_del(_n,":"_nod_del(0,","_nods_del(_n,":"_nods_del(0,"},ab={"=":{"_val(_n,":"_nod_asn(_n,","_valm(":"_nod_asn(0,","_valcr(_n,_cr,":"_nod_asn(_n,","_valcr(0,_cr,":"_nod_asn(0,","_nod(_n,":"_nod_asn(_n,","_nodm(":"_nod_asn(0,","_nodcr(_n,_cr,":"_nod_asn(_n,","_nodcr(0,_cr,":"_nod_asn(0,","_nods(_n,":"_nods_asn(_n,","_nodsm(":"_nods_asn(0,"},"+=":{"_val(_n,":"_nod_add(_n,","_valm(":"_nod_add(0,","_valcr(_n,_cr,":"_nod_add(_n,","_valcr(0,_cr,":"_nod_add(0,","_nod(_n,":"_nod_add(_n,","_nodm(":"_nod_add(0,","_nodcr(_n,_cr,":"_nod_add(_n,","_nodcr(0,_cr,":"_nod_add(0,","_nods(_n,":"_nods_add(_n,","_nodsm(":"_nods_add(0,"}},r={"_cnt(_n,":"_nod_del(_n,","_xpt(_n,":"_nod_del(_n,","_val(_n,":"_nod_del(_n,","_valcr(_n,":"_nod_del(_n,","_nod(_n,":"_nod_del(_n,","_nodcr(_n,_cr,":"_nod_del(_n,","_nods(_n,":"_nods_del(_n,"},ae=/(\r?[\n]|\/\*|\*\/|\/\/|\<\!\-\-|\-\-\>|[=\!+\/\*-]=|\+\+|\-\-|["'{(\[\])}\]\<\>]|$)|([ \t]+)|([a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF.$_][\w.$_]*)|(\d[x\d.]*)|(\\?[\w._?,:;!=+-\\\/^&|*"'[\]{}()%$#@~`<>]?)/g,ag=/(^|\|)(?!\@|text\(\)|\.\.|[\w\-\:]+?\:\:)/g,ay={},aD={},az={},bv=apf.$asyncObjects||{comm:1,rpc:1,http:1},aF,bC,aG,j,aL,bm,am,an,ad,bf,aH,bF,bD,S,af=[],be,au=[],av=[],bo,a6,t,bp,bH,G,aB,bn,al,z,br,aJ,Y,aT,aj,aI,bb,bl,K;ay["if"]="if(",aD["if"]=")",ay["while"]="while(",aD["while"]=")",ay["for"]="for(",aD["for"]=")",ay["switch"]="switch(",aD["switch"]=")",ay["catch"]="catch(",aD["catch"]=")",aD["function"]=")  ";ay.foreach=ay.each="\nfor(var _t=_t||[],_t=(_t.push(_n,0,(";aD.foreach=aD.each=")||[]),_t);(_n=_t[_t.length-1][_t[_t.length-2]++])||(_t.length-=2,_n=_t.pop(),0);)";ay.local="\nfor(var _t=_t||[],_t=(_t.push(_n,((_n=_local(";aD.local=")),1)),_t);(_t[_t.length-1]--&&_n)||(_t.length--,_n=_t.pop(),0);)";ay.localName="_localName(_n",aD.localName=")";ay.output="_o.join(''",aD.output=")";ay.reset="(_o=[],l=0",aD.reset=")";ay.item="(_t[_t.length-1][_t[_t.length-2]-1]",aD.item=")",ay.first="(_t[_t.length-2]==1",aD.first=")",ay.last="(_t[_t.length-2]==_t[_t.length-1].length",aD.last=")",ay.total="(_t[_t.length-1].length",aD.total=")",ay.pos="(_t[_t.length-2]-1",aD.pos=")",ay.tagName="_tagName(_n",aD.tagName=")";ay._nodeValue="_nodeValue(_n",aD._nodeValue=")";aD.async="])";aD.precall="])";aD._call=")";var N={_call:".call(_n",localName:ay.localName,tagName:ay.tagName,nodeValue:ay.nodeValue},y="(function(){var _o=[],_l=0;\n",J=";return _l==1?_o[0]:_o.join('');})()",x="_async(_n,_c,_a,_w,_f,this,",A="',_a[++_a.i]||[",E="_r=",ac,aq="_o[_l++]=",bz="",aP="{var _o=[],_l=0,_n=this;\n",a1=";\nreturn _l==1?_o[0]:_o.join('');}",aY="(_a=_a||{}).i=0;try{\n",a9="}catch(_e){if(_e.x)return;throw(_e);}\n",aX="(_a=_a||{}).i=0;try{_pc(_w);",a8="}catch(_e){if(_e.x)return;throw(_e);}",ba="with(_w){",bi="}",bw="var _o=[],_l=0;_o[_l++]=",T="var _o=[],_l=0;\n",bG=";\nreturn _ret(_l==1?_o[0]:_o.join(''));",Q=";\n_c(_ret(_l==1?_o[0]:_o.join('')),apf.SUCCESS,apf.$lmx);apf.$lmx=null;",ai="return _ret(",at=");",a3="_c(_ret(",bd="),apf.SUCCESS,apf.$lmx);apf.$lmx=null;\n",D="var _r=",n="var _r;",M=";\nreturn _r;",c=";\n_c(_r,apf.SUCCESS,apf.$lmx);apf.$lmx=null;",b=";\n_c(0,apf.SUCCESS,apf.$lmx);apf.$lmx=null;;",aW="return ",a7="",aN="_c(",aV=",apf.SUCCESS);",a5="var _f=function(_n,_c,_w,_a){",d="var _f=function(_n,_w){",i="var _f=function(_n){",X="var _f=function(_n,_c,_w,_cr,_a){",g="var _f=function(_n,_w,_cr,){",ah="var _f=function(_n,_cr){",U="var _f=function(event,_c,_w,_a,_n){",bg="var _f=function(event,_w,_n){",W="var _f=function(event,_n){",w="}",P="var _f=function(_m){",I=";\nif(_n=_r){if(!_n.nodeType)_n=_m;",ap=";\nif(_n=",ax="){if(!_n.nodeType)_n=_m;",bh="\nreturn ",aM="\nreturn _ret(",aU=");",a="\nreturn _n;",bq="\nreturn (_r = (",bB="))?(_r.nodeType?_r:_n):(_r===null?null:_n);",bk="var _r, _n = _m;",H=";\n_n = _m;",m="\nreturn _ret(_nodeValue(_n));",aK="\nreturn _n;",by="\n}";function V(o){var bt,s;if(am[a6-1]=="{{"){bt=a6-1;}else{for(s=be-2,bt=0;s>=0&&am[bt=(af[s]&268435455)-1]!="{{";s-=2){}}if(!o&&an>bt+1){am[bt]=y+aq;}else{am[bt]=y;}bo=1;}function aE(bP,bJ,s,bI,o,bt,bL){var bO,bN,bM,bK=bJ?aw[bJ]:(s?0:(bI?3:(o?4:(bP?2:15))));switch(bo){case 0:case 1:switch(bK){case 0:if((z==3&&al!="$")||z==4){am[an++]=" ";}else{if(aQ[al]){z=0;}}break;case 1:aB++,bb=bL;if(am[an-1]!="\n"&&!a2[al]){am[an++]="\n";}if(aQ[al]){z=0;}break;case 2:if(bN=aZ[bP]){switch(bN){case 1:if(!af[be-1]){am[an++]=")",be-=2;}if(!bo){if(am[an-1]!="\n"&&al!="{"&&al!=";"){am[an++]="\n";}}else{if(!be||af[be-1]){am[an++]=";";}}break;case 2:if(!af[be-1]){am[an++]=")",be-=2;}am[an++]=",";break;case 3:if(am[an-1]=="\n"||am[an-1]==";"||al=="{"||al=="} "||an==a6){if(!bo){V();}am[an++]="  ";}else{am[an++]="^";}break;case 4:if(al!="<"&&al!=">"){if(!bo&&am[a6-1]!="("){V(true);}am[an++]=bP;for(bN=an;bN>=a6&&!bx[am[bN]]&&!((am[bN]=="  "||am[bN]==(bn?aq:ac))&&(am[bN]="",1));bN--){}if(z==3&&br>0&&al.charAt(0)!="."){if(aL){an-=2;while(q[am[an]]){an--;}bM=al;am[an++]=a4[bP],am[an++]=bM.slice(0,br),am[an++]=",'",am[an++]=bM.slice(br+1),am[an++]="',",af[be++]=a6|(bo<<28),af[be++]="";}}else{if(am[bN=an-2]==") "){if(!(bO=ab[bP])||!(bO=bO[am[bM=af[be]&268435455]])){throw {t:"Invalid xpath assign",p:bL};}am[bM]=bO,am[bN]=",",am[bN+1]="",am[bN+2]="";af[be++]=a6|(bo<<28),af[be++]="";}}}else{am[an++]=bP;}break;case 5:if(k[al]){af[be++]=a6|(bo<<28);af[be++]=am[an++]=bP;a6=t=an-1;bn++,bo=5,bp=bP;}else{am[an++]="/";}break;case 6:if(be>2&&af[be-1]=="{{"&&(an<a6+4&&z==5)||(an<a6+3&&(z==3||z==4))){am[a6-1]=af[be-1]="{";bo=(bN=af[be-2])>>28;af[be-2]=bN&268435455,bn--;}else{if(am[an-3]=="case"||(z==5&&K=="case")){bP=";";}}am[an++]=":";break;default:am[an++]=bP;break;}}else{am[an++]=bu[bP]||bP;}break;case 3:case 4:bN=bO=bM=0;br=(K=bP).lastIndexOf(".");if(bP.charAt(0)!="."&&((bN=(bO=((aS[al]||am[an-1]=="\n")&&!aC[al]))&&!af[be-1].indexOf("{")&&an>a6)||(bM=bx[bP]))&&!bo){if(bM==2&&af[be-1].indexOf("{")){bM=0;}V(bM);}if(bO&&!af[be-1]){am[an-1]=="\n"&&(am[an-1]=""),am[an++]=")",am[an++]="\n",bN=1,be-=2;}if(bN&&bo&&!bx[bP]){am[an++]=(bn?aq:ac);}if(br>0&&bP.charAt(0)!="."){aH[am[an++]=Y=bP]=1;}else{am[an++]=ar[bP]||bP;}break;case 5:if((bN=(bO=((aS[al]||am[an-1]=="\n")&&!aC[al]))&&!af[be-1].indexOf("{")&&an>a6)&&!bo){V();}if(bO&&!af[be-1]){am[an-1]=="\n"&&(am[an-1]=""),am[an++]=")",am[an++]="\n",bN=1,be-=2;}if(bN){am[an++]=(am[an-2]!="\n"&&F[al])?"+":(bn?aq:ac);}else{if(F[al]){am[an++]="+";}}af[be++]=a6|(bo<<28),af[be++]=am[an++]=bP;a6=t=an-1,bn++,bo=5,bp=bP;break;case 6:if(bP=="*/"||bP=="-->"){throw {t:"Unmatched comment "+bP,p:bL};}aT=bo,aj=al,aI=z,bo=6,bp=bP;break;case 7:if(am[an-1]==")  "||(am[an-2]==")  "&&an--)){if(af[be-1]!="("&&af[be-1]!="["){af[be++]=a6|(bo<<28),af[be++]="{{",am[an++]=aP,a6=an,bo=1,bn++,am[an++]="";}else{af[be++]=a6,af[be++]=am[an++]=bP,a6=an;bo=1;}}else{if((ay[af[be+1]]&&al==")   ")||aA[al]){af[be++]=a6,af[be++]=am[an++]=bP,a6=an;am[an++]="";}else{if((bN=(bO=((aS[al]||am[an-1]=="\n")&&!aC[al]))&&!af[be-1].indexOf("{")&&an>a6)&&!bo){V();}if(bO&&!af[be-1]){am[an-1]=="\n"&&(am[an-1]=""),am[an++]=")",am[an++]="\n",bN=1,be-=2;}if(bN){am[an++]=(am[an-2]!="\n"&&F[al])?"+''+":(bn?aq:ac);}else{if(F[al]){am[an++]=(al=="}")?"+''+":"+";}}af[be++]=a6|(bo<<28),af[be++]=am[an++]="{{";if(!bn&&a6!=an){bF++;}bn++,t=a6=an,bo=0;}}break;case 8:if(!af[be-1]){am[an++]=")",am[an++]="\n",be-=2;}if(aO[bN=af[--be]]!=(am[an++]=bP)){throw {t:"Cannot close "+bN+" with "+bP,p:bL};}if(bN=="{{"){if(a6==an-1){if((af[be-1]>>28)<=1){am[a6-1]="{",am[an-1]="}";}else{am[a6-1]=am[an-1]="'";}}else{if(!bo){am[a6-1]="(",am[an-1]=")";}else{if(am[a6-1]==aP){if(a6==an-2){am[a6-1]="{",am[an-1]="}";}else{am[an-1]=a1;}}else{am[an-1]=J;}}}bo=(bN=af[--be])>>28,a6=bN&268435455;t=an,bn--;if(!bn){bF++;}if(bo==7){am[an++]='+"\\"',bo=4;}}else{a6=af[--be];}break;case 9:if(((z==3&&!aa[al]&&al!="$")||al==")"||al=="]")&&am[an-1]!="\n"){am[an++]="[",af[be++]=a6|(bo<<28),af[be++]=bP,t=a6=an;}else{aJ=null;if((bM=aQ[al])){an--,al=am[an-1];if(am[an-1]=="delete"||(am[an-2]=="delete"&&an--)){bM=r[bM],an--;}}else{bM=O[af[be-1]]||O[bn?0:aF];if(al=="delete"){bM=r[bM],an-=2;}}if((bN=(bO=((aS[al]||am[an-1]=="\n")&&!aC[al]))&&!af[be-1].indexOf("{")&&(an>a6||af[be-1].length==1))&&!bo){V();}if(bO&&!af[be-1]){am[an-1]=="\n"&&(am[an-1]=""),am[an++]=")",am[an++]="\n",bN=1,be-=2;}if(bN){am[an++]=(am[an-2]!="\n"&&F[al])?"+":(bn?aq:ac);}else{if(F[al]){am[an++]="+";}}if(!bn&&an!=a6){bF++;}bn++,af[be++]=a6|(bo<<28),af[be++]=am[an++]=bM,t=a6=an,au[a6]=bL,bo=3;}break;case 10:if(!af[be-1]){am[an++]=")",be-=2;}if(aO[bN=af[--be]]!=(am[an++]=bP)){throw {t:"Cannot close "+bN+" with "+bP,p:bL};}a6=af[--be]&268435455;break;case 11:if(((bN=(bO=((L[al]||am[an-1]=="\n")&&!aC[al]))&&!af[be-1].indexOf("{")&&an>a6))&&!bo){V();}if(bO&&!af[be-1]){am[an-1]=="\n"&&(am[an-1]=""),am[an++]=")",am[an++]="\n",bN=1,be-=2;}if(bN&&bo){am[an++]=(bn?aq:ac),z=0;}if(bM=ay[al]){if(am[an-1]==" "){an--;}am[an-1]=bM,af[be++]=a6,af[be++]=al,a6=t=an;}else{if(z==3){if(br<0){bN=0;if(al=="function"||am[an-3]=="function"||am[an-4]=="function"){af[be++]=a6,af[be++]="function",am[an++]="(",a6=t=an;if(al!="function"&&bm&&be==4){am[bN=(am[an-4]=="function")?(an-4):(an-5)]="var "+al+" = self."+al+" = function";am[bN+2]="";}}else{if(!bA[al]&&am[an-3]!="new"){am[an++]=".call(_n",af[be++]=a6,af[be++]="_call",a6=t=an;}else{af[be++]=a6,af[be++]=am[an++]=bP,a6=t=an;}}}else{if(br>1&&bv[bN=al.substring(0,br)]){if(am[--an]==" "){an--;}am[an++]=x,am[an++]=bN,am[an++]=",'";am[an++]=al.slice(br+1);am[an++]=A,af[be++]=a6,af[be++]="async",a6=t=an,ad++;}else{if(al.indexOf(".")!=br){aH[al.slice(0,br)]=1;}af[be++]=a6,af[be++]=am[an++]=bP,a6=t=an;}}}else{af[be++]=a6,af[be++]=am[an++]=bP,a6=t=an;}if(al==Y){delete aH[al];}}break;case 12:if(!af[be-1]){am[an-1]=="\n"&&(am[an-1]=""),am[an++]=")",am[an++]="\n",bN=1,be-=2;}if(bM=aD[bN=af[--be]]){if(bN!="_call"){bP=")   ";}if((bO=N[bN])&&bO!=am[an-1]){am[a6-1]=bO+",";}am[an++]=bM;}else{if(aO[bN]!=(am[an++]=bP)){throw {t:"Cannot close "+bN+" with "+bP,p:bL};}}a6=af[--be]&268435455;break;case 13:if(an==a6||u[al]||am[an-1]=="\n"){if((bN=(bO=((aS[al]||am[an-1]=="\n")&&!aC[al]))&&!af[be-1].indexOf("{")&&an>a6)&&!bo){V();}if(bO&&!af[be-1]){am[an-1]=="\n"&&(am[an-1]=""),am[an++]=")",am[an++]="\n",bN=1,be-=2;}if(bN){am[an++]=(am[an-2]!="\n"&&F[al])?"+''+":(bn?aq:ac);}else{if(F[al]){am[an++]="+";}}bl=null,am[an++]='"',am[an++]="<",bn++,af[be++]=a6|(bo<<28),be+=3,af[be-2]=af[be-1]=0;t=a6=an-1,bo=4;}else{am[an++]="<";}break;case 14:am[an++]=">";break;case 15:if(be&&!af[be-1]){am[an-1]=="\n"&&(am[an-1]=""),am[an++]=")",am[an++]="\n",bN=1,be-=2;}break;}break;case 2:switch(bK){case 1:aB++,bb=bL;if(an!=a6&&an!=t){am[an++]="\\n";}break;case 2:if(an==t){am[an]=(an++==a6)?'"':'+"';}am[an++]=B[bP]||bP;break;case 3:if(an==t){am[an]=(an++==a6)?'"':'+"';}if(bP.charAt(bP.length-1)=="$"){am[an++]=bP.slice(0,-1);am[an++]=bP="$";}else{am[an++]=bP;}break;case 5:if(an==t){am[an]=(an++==a6)?'"':'+"';}am[an++]=(bP=='"')?'\\"':"'";break;case 7:if(an==t){if(an!=a6){am[an++]="+";}}else{am[an++]='"+',bn||bF++;}af[be++]=a6|536870912,af[be++]=am[an++]="{{",bn++,t=a6=an,bo=0;break;case 9:aJ=null;if((bM=l[al])&&am[an-1]==al){if(--an-1==a6){an--;}}else{bM=O[(bn||a6!=an)?0:aF];}if(an!=a6){am[an]=(an++==t)?"+":(bn||bF++,'"+');if(!bn){bF++;}}af[be++]=a6|536870912,af[be++]=am[an++]=bM,t=a6=an,bn++,bo=3;break;case 15:if(be){throw {t:"Unclosed "+af[be-1]+" found at end in textmode",p:bL};}if(an!=a6&&an!=t){am[an++]='"',bn||bF++;}break;default:if(an==t){am[an]=(an++==a6)?'"':'+"';}am[an++]=bP;}break;case 3:switch(bK){case 0:if(an!=a6){if(an==t){am[an++]='+"';}am[an++]=bP;}break;case 1:aB++,bb=bL;break;case 2:if(bP==":"&&al==":"&&!aR[bM=am[an-2]]&&((bN=af[be-2])>>28)!=6){if(am[an-2]=='+"'){am[an-2]=am[an-1]="",aJ="#";}else{am[an-1]='"';if(t==a6){aJ=am.slice(t+1,an-1).join("");}else{aJ="#";}}if(!(bM=a0[am[a6-1]])){throw {t:"Invalid model found for: "+am[a6-1],p:bL};}am[a6-1]=bM,am[an++]=",",t=a6=an;}else{if(bP==","&&(bN=(af[be-2]>>28))<=1){an=a6-1,bO=bH.slice(au[a6]+1,bL+1);z=9,bo=bN,am[an++]=al="[";af[be-2]=(af[be-2]&268435455)|(bo<<28),af[be-1]=al,t=a6=an,bn--;if(!bn){bD--;}if(bO.length>1){av.push(bH);(bH=bO).replace(ae,aE);bH=av.pop();}}else{if(an==t){am[an]=(an++==a6)?'"':'+"';}am[an++]=bu[bP]||bP;}}break;case 3:if(an==t){am[an]=(an++==a6)?'"':'+"';}if(bP.charAt(bP.length-1)=="$"){am[an++]=bP.slice(0,-1);am[an++]=bP="$";}else{am[an++]=bP;}break;case 5:if(an==t){am[an]=(an++==a6)?'"':'+"';}if(af[be-1]=="["){af[be-1]=bP;}else{if(af[be-1]==bP){af[be-1]="[";}}if(bP=='"'){am[an++]="\\";}am[an++]=bP;break;case 7:if(an==t){if(an!=a6){am[an++]="+''+";}}else{am[an++]='"+';}af[be++]=a6|805306368,af[be++]=am[an++]="{{",bn++,t=a6=an,bo=0;if(aJ&&af[be-3]!=l["$"]){bf.push(aJ,"#");aJ=null,S++;}break;case 9:if(af[be-1]=="'"||af[be-1]=='"'||((z!=3||al=="$")&&al!=")"&&al!="]")){if(aJ){bf.push(aJ,"#"),S++;}aJ=null;if((bM=l[al])&&am[an-1]==al){an--;}else{bM=O[0];}if(an==t){if(an!=a6){am[an++]="+";}}else{am[an++]='"+';}af[be++]=a6|805306368,af[be++]=am[an++]=bM,bn++,t=a6=an,bo=3;}else{if(an==t){am[an]=(an++==a6)?'"':'+"';}af[be++]=a6|1610612736,af[be++]=am[an++]="[";}break;case 10:be--,bo=(bM=af[--be])>>28,bM=bM&268435455;if(bo==6){if(af[be+1]!="["){throw {t:"In xpath, cannot close "+af[be+1]+" with "+bP,p:bL};}if(an==t){am[an]=(an++==a6)?'"':'+"';}am[an++]="]";bo=3;}else{if(an==a6){if((af[be]>>28)<=1){am[a6-1]="[",am[an++]="]";}else{am[a6-1]=am[an++]='"';}t=an;}else{if(an!=t){am[an++]='"';}if(t==a6){bN=am.slice(t+1,an-1).join("");if(j&&am[a6-1]!=","&&bN!=(bO=bN.replace(ag,"$1self::"))&&af[be+1]!=l["$"]){am[a6+1]=bN=bO;for(bO=a6+2;bO<an-1;bO++){am[bO]="";}}}else{if((bO=am[a6-1])!=","){bN="#";if(j){am[a6-1]=bO+"_injself(",am[an++]=")";}}else{bN="";}}if(af[be+1]!=l["$"]&&bN){bf.push(aJ,bN);if(aJ){S++;}}am[an++]=") ",t=an;if(bo==7){am[an++]='+"\\"',bo=4;}}bn--,aJ=null;if(!bn){bF++,bD++;}}a6=bM;break;case 11:if(an==t){am[an]=(an++==a6)?'"':'+"';}af[be++]=a6|805306368,af[be++]=am[an++]="(";break;case 12:if(an==t){am[an]=(an++==a6)?'"':'+"';}if(aO[bN=af[--be]]!=(am[an++]=bP)){throw {t:"Cannot close "+bN+" with "+bP,p:bL};}a6=af[--be]&268435455;break;case 15:throw {t:"Unexpected end whilst parsing xpath",p:bL};break;default:if(an==t){am[an]=(an++==a6)?'"':'+"';}am[an++]=bP;break;}break;case 4:switch(bK){case 0:if(an==t){am[an++]='+"';}am[an++]=" ",z=0;break;case 1:if(an==t){am[an++]='+"';}aB++,bb=bL,am[an++]="\\n",z=1;break;case 2:if(an==t){am[an++]='+"';}if(bP=="/"&&al=="<"){be-=4;if(af[be]||af[be+2]){throw {t:"Unexpected closing tag whilst parsing xml",p:bL};}}else{if(bP==":"&&z==3&&am[an-2]=="<"){bl=al;}}am[an++]=B[bP]||bP;break;case 3:if(an==t){am[an++]='+"';}if(bP.charAt(bP.length-1)=="$"){am[an++]=bP.slice(0,-1);am[an++]=bP="$";}else{am[an++]=bP;}break;case 5:if(an==t){am[an++]='+"';}if(bP=='"'){am[an++]="\\";}am[an++]=bP;break;case 6:if(bP=="//"&&!af[be-1]){if(an==t){am[an++]='+"';}am[an++]=bP;}else{if(bP=="*/"){throw {t:"Unmatched comment "+bP,p:bL};}aT=bo,aj=al,aI=z,bo=6,bp=bP;}break;case 13:bl=null;if(an==t){am[an++]='+"';}am[an++]=bP,af[be]=af[be+2]=0,be+=4,af[be-1]=0;break;case 14:if(an==t){am[an++]='+"';}am[an++]=bP;if(al!="<"){if(al=="/"){be-=4;if(af[be+2]){throw {t:"Unexpected / whilst parsing xml",p:bL};}if(am[an-3]=="<"){an-=2,am[an-1]="";}}else{be-=2;}if(af[be]){bn--,am[an++]='"',a6=af[be],t=an,bo=a6>>28,a6=a6&268435455;}else{af[be-1]=1;}}else{an--,am[an-1]="";}break;case 9:aJ=null;if(al=="!"&&am[an-2]=="<"&&!af[be-1]){am[an++]=bP,af[be++]=a6|(bo<<28);af[be++]="]]>",a6=t=an-1;bn++,bo=5;}else{if(af[be-1]){if((bN=bE[al])){an--;}else{bN=O[bl?bC:0];}af[be++]=a6|1073741824;}else{af[be++]=a6|1073741824;if((bN=bc[al])){an--;if(am[an-1]=="="){al="=";}}else{bN=O[bl?aG:8];}if(al=="="){am[an++]='\\"',af[be-1]=a6|1879048192;}}am[an]=(an++==t)?"+''+":'"+';bn++,af[be++]=am[an++]=bN,t=a6=an,bo=3;}break;case 7:if(!af[be-1]&&al=="="){am[an++]='\\"',af[be++]=a6|1879048192;}else{af[be++]=a6|1073741824;}am[an]=(an++==t)?"+''+":'"+';af[be++]=am[an++]="{{",bn++;t=a6=an,bo=0;break;default:if(an==t){am[an++]='+"';}am[an++]=bP;break;case 15:throw {t:"Unexpected end whilst parsing xml",p:bL};break;}break;case 5:switch(bK){case 1:aB++,bb=bL;if(an==t){am[an]=(an++==a6)?'"':'+"';}am[an++]="\\n";break;case 2:if(bP=="/"&&af[be-1]=="/"){am[an++]="/",a6=af[be-=2],t=an,bo=a6>>28,a6=a6&268435455,bn--;}else{if(an==t){am[an]=(an++==a6)?'"':'+"';}am[an++]=(af[be-1]!="/"&&bj[bP])||bP;}break;case 3:if(an==t){am[an]=(an++==a6)?"":'+"';}if(bP.charAt(bP.length-1)=="$"){am[an++]=bP.slice(0,-1);am[an++]=bP="$";}else{am[an++]=bP;}break;case 5:if(af[be-1]==bP){if(a6!=t){am[an]=(an++!=t)?(bP+")"):")";}else{am[an++]=bP;}a6=af[be-=2],t=an,bo=a6>>28;a6=a6&268435455,bn--;}else{if(an==t){am[an]=(an++==a6)?'"':'+"';}am[an++]=bP=='"'?'\\"':bP;}break;case 6:if(af[be-1]=="/"&&bP=="*/"){am[an++]="*/",a6=af[be-=2],t=an,bo=a6>>28,a6=a6&268435455,bn--;}else{if(an==t){am[an]=(an++==a6)?"":'+"';}am[an++]=bP;}break;case 7:if(af[be-1]!="'"&&af[be-1]!="/"){if(af[be-1]=='"'){am[a6]='("';}if(an==t){if(an!=a6){am[an++]="+";}}else{am[an++]='"+';}af[be++]=a6|1342177280,am[an++]=af[be++]="{{",bn++,t=a6=an,bo=0;}else{am[an++]=bP;}break;case 9:if(af[be-1]!="'"&&af[be-1]!="/"&&(af[be-1]=='"'&&(am[a6]='("')||an!=a6+2||al!="CDATA")){aJ=null;if((bM=l[al])&&am[an-1]==al){an--;}else{bM=O[0];}if(an!=a6){am[an]=(an++==t)?"+":'"+';}af[be++]=a6|1342177280,af[be++]=am[an++]=bM,t=a6=an,bn++,bo=3;}else{am[an++]=bP;}break;case 14:if(an==t){am[an]=(an++==a6)?"":'+"';}am[an++]=bP;if(af[be-1]=="]]>"&&al=="]"&&am[an-3]=="]"){a6=af[be-=2],bo=a6>>28;a6=a6&268435455,bn--;be-=4;if(af[be]){bn--,am[an++]='"',a6=af[be],t=an,bo=a6>>28,a6=a6&268435455;}else{af[be-1]=1;}}break;case 15:throw {t:"Unexpected end whilst parsing string",p:bL};break;default:if(an==t){am[an]=(an++==a6)?"":'+"';}am[an++]=bP;break;}break;case 6:switch(bK){case 1:aB++,bb=bL;if(bp=="//"){bo=aT,bP=al=aj,bK=z=aI;}break;case 6:if((bp=="/*"&&bP=="*/")||(bp=="<!--"&&bP=="-->")){bo=aT,bP=al=aj,bK=z=aI;}break;case 15:throw {t:"Unexpected end whilst parsing comment",p:bL};break;}break;}if(bK>1){al=bP,z=bK;}}this.lastCode=function(){if(typeof(am)=="object"){return am.join("");}return am;};function bs(bt,o,s){if(bt.t){throw new Error(apf.formatErrorString(0,null,"Parsing live markup source","Error whilst parsing: "+bt.t+" on line:"+aB+" col:"+(bt.p-o-2)+(s?(" part: "+s):"")+"\n"+bH));}else{throw new Error(apf.formatErrorString(0,null,"Compiling live markup function","Error whilst compiling: "+bt.message+"\nInput:\n"+bH+"\nGenerated:\n"+apf.lm.lastCode()));}}var Z={},R={};this.resetCache=function(){Z={};};var ao=/^\s*~~(c\d+)~~/;this.compile=function(s,o){if(!o){o=R;}if(s==null||!s.length){return o.nostring?function(){return s;}:{type:2,str:s};}var bK,bI;if(s.charAt(0)=="~"&&(bK=s.match(ao))){if(bK=apf.lm_exec[bK[1]]){return bK;}alert("ERROR, undefined live markup cache marker found:"+s);return{type:2,str:s};}var bt=(o.xpathmode|(o.withopt&&16)|(o.precall&&32)|(o.alwayscb&&64)|(o.nostring&&128)|(o.parsecode&&256)|(o.nostate&&512)|(o.editable&&1024)|(o.langedit&&2048)|(o.injectself&&4096)|(o.event&&8192)|(o.funcglobal&&16384))+s;if(bK=Z[bt]){return bK;}j=o.injectself,aF=o.xpathmode||0,aG=o.nostate?0:6,bC=o.editable?7:0;bm=o.funcglobal;bE=o.langedit?ak:C;aH={},bf=[],af=[],am=["","","",""],bH=s,G=bH.length;an=a6=t=am.length,bF=bD=ad=S=bn=aB=z=bb=0;if(o.parsecode){bo=0,be=2,af[0]=an,af[1]="{{",al="{",ac=o.event?"":(aF<=1?aq:E);}else{bo=2,be=al=0,ac=aq;}if(o.nothrow){bH.replace(ae,aE);}else{try{bH.replace(ae,aE);}catch(bJ){bs(bJ,bb);return null;}}if(o.parsecode){if(bn||af[be-1].length==1){bs({t:"Unclosed "+af[be-1]+" found at end in codemode",p:G},bb);}if(t!=an){bF++;}}if(!o.nostring&&(bo==2&&t==4||an==4)){return{type:2,str:am.slice(5,-1).join("").replace(/\\n/g,"\n").replace(/\\"/g,'"')};}if(ad||o.alwayscb){if(o.event){if(bo==1){am[3]="";}am[an++]=b;}else{if(aF){if(bo==1){am[3]=(am[3]!=y)?D:n,am[an++]=c;}else{am[3]=aN,am[an++]=aV;}}else{if(bo==1){am[3]=(am[3]!=y)?bw:T,am[an++]=Q;}else{am[3]=a3,am[an++]=bd;}}}if(ad){if(bo==1){if(o.precall){am[2]=aX,am[an-1]=a8+am[an-1];}else{am[2]=aY,am[an-1]=a9+am[an-1];}}else{am[an++]=am[3]+"_r"+am[an-2];if(o.precall){am[2]=aX,am[3]=D,am[an-2]=a8;}else{am[2]=aY,am[3]=D,am[an-2]=a9;}}}if(o.withopt){am[1]=ba,am[an++]=bi;}am[0]=o.event?U:((aF==1||aF==3)?X:a5);am[an++]=w;}else{if(o.event){if(bo==1){am[3]="";}}else{if(aF){if(bo==1){am[3]=(am[3]!=y)?D:n,am[an++]=M;}else{am[3]=aW,am[an++]=a7;}}else{if(bo==1){am[3]=(am[3]!=y)?bw:T,am[an++]=bG;}else{am[3]=ai,am[an++]=at;}}}if(o.withopt){am[2]=ba,am[an++]=bi;}am[0]=o.event?(o.withopt?bg:W):(o.withopt?((aF==1||aF==3)?g:d):((aF==1||aF==3)?ah:i));am[an++]=w;}if(o.nothrow){bI=apf.lm_exec.compile(am.join(""));}else{try{bI=apf.lm_exec.compile(am.join(""));}catch(bJ){bs(bJ,bb);return null;}}bI.type=(bF==1&&bD==1)?3:1;bI.xpaths=bf,bI.models=S,bI.props=aH,bI.asyncs=ad;Z[bt]=bI;return bI;};this.compileMatch=function(bK,o){if(!o){o=R;}aH={},bf=[],am=[P,bk],af=[],bn=0,an=am.length,bE=C;for(var bI,s,bJ=0,bt=bK.length;bJ<bt;bJ+=2){if(bH=bK[bJ]){G=af.length,aF=2;if(bJ){am[an++]=H;}am[an++]="";af[0]=s=an=a6=t=am.length,ac=E;aB=z=bF=bD=ad=bo=bb=0;be=2,af[1]="{{",al="{";j=1;if(o.nothrow){bH.replace(ae,aE);}else{try{bH.replace(ae,aE);}catch(bM){bs(bM,bb);return null;}}if(bn||af[be-1].length==1){bs({t:"Unclosed "+af[be-1]+" found at end in codemode",p:G});}if(ad){bs({t:"Asynchronous calls not supported in match/value"});}if(bo==1){am[s-1]=(am[s-1]!=y)?ac:"",am[an++]=I;}else{am[s-1]=ap,am[an++]=ax;}}if(bH=bK[bJ+1]){G=af.length;if(!bK[bJ]&&bJ){am[an++]=H;}am[an++]="";s=an=a6=t=am.length,ac=aq;aF=j=al=be=aB=bF=bD=z=ad=bb=0;if(o.node){aF=2;}bo=2,j=0;if(o.nothrow){bH.replace(ae,aE);}else{try{bH.replace(ae,aE);}catch(bM){bs(bM,bb);return null;}}if(ad){bs({t:"Asynchronous calls not supported in match/value"});}if(o.node){if(bo==2&&t==s||an==s){am[s-1]=a;}else{am[s-1]=bq,am[an++]=bB;}}else{if(bo==2&&t==s||an==s){am[s-1]=bh;}else{am[s-1]=aM,am[an++]=aU;}}if(bK[bJ]){am[an++]=by;}else{break;}}else{if(!bK[bJ]){bs({t:"Both match and value are empty"});}if(o.node){am[an++]=aK;}else{am[an++]=m;}aF=2;am[an++]=by;}}am[an++]=w;var bL;if(o.nothrow){bL=apf.lm_exec.compile(am.join(""));}else{try{bL=apf.lm_exec.compile(am.join(""));}catch(bM){bs(bM,bb);return null;}}bL.type=1,bL.xpaths=bf,bL.props=aH,bL.asyncs=ad;return bL;};this.setWarnLevel=function(o){apf.lm_exec.setWarnLevel(o);};})();apf.lm_exec=new (function(){var wlvl=1;this.setWarnLevel=function(lvl){wlvl=lvl;};function wxpath(x,t){apf.console.warn("Live Markup warning in "+t+", no results for xpath: '"+x+"'");}function wnode(x,t){apf.console.warn("Live Markup warning in "+t+", xpath on null node: '"+x+"'");}function wmodel(m,x,t){apf.console.warn("Live Markup warning in "+t+", xpath on empty model: '"+m+"' xpath: '"+x+"'");}function wlang(x,t){apf.console.warn("Live Markup warning in "+t+", language symbol not found: '"+x+"'");}function xmlParse(str){var n=apf.getXmlDom("<_apflmlist_>"+str+"</_apflmlist_>");if(!n||!(n=n.documentElement)){return null;}return(n.firstChild==n.lastChild)?n.firstChild:n;}function __val(n,x){if(!n){return("");}return(n=(n.nodeType!=1&&n||(n=n.selectSingleNode(x))&&(n.nodeType!=1&&n||(n=n.firstChild)&&n.nodeType!=1&&n)))&&n.nodeValue||("");}var __valattrrx=/(["'])/g;function __valattrrp(m,a){return m=='"'?"&quot;":"&apos;";}function __valattr(n,x){if(!n){return("");}return(n=(n.nodeType!=1&&n||(n=n.selectSingleNode(x))&&(n.nodeType!=1&&n||(n=n.firstChild)&&n.nodeType!=1&&n)))&&n.nodeValue.replace(__valattrrx,__valattrrp)||("");}function __valm(m,x){var n;if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){return("");}return(n=(n.nodeType!=1&&n||(n=n.selectSingleNode(x))&&(n.nodeType!=1&&n||(n=n.firstChild)&&n.nodeType!=1&&n)))&&n.nodeValue||("");}function __nod(n,x){return n?n.selectSingleNode(x):(null);}function _nods(n,x){return n?n.selectNodes(x):([]);}function __nodm(m,x){var n;if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){return(null);}return n.selectSingleNode(x);}function _nodsm(m,x){var n;if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){return([]);}return n.selectNodes(x);}function __cnt(n,x){return n?n.selectNodes(x).length:(0);}function __cntm(m,x){var n;if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){return(0);}return n.selectNodes(x).length;}function _xpt(n,x){return{xpath:x,toString:function(){return"LM Xpath object: "+this.x;}};}function _xptm(m,x){return{model:m,xpath:x,toString:function(){return"LM Xpath object with model: "+this.x;}};}function _xml(n,m,x){if(n){x=m;}else{if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){return("");}}return(n&&(n=n.selectSingleNode(x)))&&n.xml||("");}function _xmls(n,m,x){if(n){x=m;}else{if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){return("");}}for(var i=0,j=((n=n.selectNodes(x))).length,o=[];i<j;i++){o[i]=n[i].xml;}return o.join("");}function _valcr(n,cr,m,x){if(n){x=m;}else{if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){return("");}}if(cr){apf.createNodeFromXpath(ni,x);}else{if(n=ni.selectSingleNode(x)){return(n=(n.nodeType!=1&&n||(n=n.selectSingleNode(x))&&(n.nodeType!=1&&n||(n=n.firstChild)&&n.nodeType!=1&&n)))&&n.nodeValue||"";}}return("");}function _nodcr(n,cr,m,x){if(n){x=m;}else{if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){return(null);}}return n.selectSingleNode(x)||(cr&&apf.createNodeFromXpath(n,x));}function _valst(n,x){var m=apf.xmldb.findModel(n);if(!m){return("");}return"["+m.id+"::"+apf.xmlToXpath(n,m.data,true)+"/"+x+"]";}function _valed(n,m,x){if(n){x=m;}return"<div contenteditable='true' class='contenteditable'>CONTENT_EDITABLE_TODO</div>";}function _nod_del(n,m,x){if(n){x=m;}else{if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){return(null);}}if(!(n=n.selectSingleNode(x))){return(null);}apf.xmldb.removeNode(n);}function _nods_del(n,m,x){if(n){x=m;}else{if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){return(null);}}if(!(n=n.selectNodes(x))){return;}apf.xmldb.removeNodeList(n);}function _nod_asn(n,m,x,v){if(n){v=x,x=m;}else{if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){throw new Error(apf.formatErrorString(0,0,"LM Xpath Assign","Cannot assign to nonresolving model:"+m+"\nxpath:"+x+"\nvalue:"+v));}}if(!n||(x&&!(n=apf.createNodeFromXpath(n,x)))){throw new Error(apf.formatErrorString(0,0,"LM Xpath Assign","Cannot assign could not resolve \nxpath:"+x+"\nvalue:"+v));}var c;if(!v||(v.charAt&&(c=v.charAt(0)!="<"))||typeof(v)=="number"){apf.setNodeValue(n,v,true);return v;}if(!c){if(n.nodeType!=1){throw new Error(apf.formatErrorString(0,0,"LM Xpath Assign","Cannot assign to a non-element node\nxpath:"+x+"\nvalue:"+v));}if(!(c=xmlParse(v))){throw new Error(apf.formatErrorString(0,0,"LM Xpath append","Cannot append broken XML.\nxpath:"+x+"\nvalue:"+v));}if(c.tagName!="_apflmlist_"){return apf.xmldb.replaceNode(c,n);}else{c=c.childNodes;apf.xmldb.replaceNode(n=c[0],n);for(var i=0,j=c.length;i<j;i++){n=apf.xmldb.appendChild(n.parentNode,c[0],n.nextSibling);}return n;}}else{if(v.length){throw new Error(apf.formatErrorString(0,0,"LM Xpath Assign","Assign of xpath nodelists not yet supported\nxpath:"+x+"\nvalue:"+v));}else{if(!v.selectNodes){throw new Error(apf.formatErrorString(0,0,"LM Xpath Assign","Cannot assign non-element node\nxpath:"+x+"\nvalue:"+v));}if(v.nodeType==2){if(n.nodeType!=2){throw new Error(apf.formatErrorString(0,0,"LM Xpath Assign","Cannot assign attribute node to replace non attribute, use += xpath:"+x+"\nvalue:"+v));}apf.xmldb.removeAttribute(c=n.ownerElement||n.selectSingleNode(".."),n.nodeName);apf.xmldb.setAttribute(c,v.nodeName,v.nodeValue);c.getAttributeNode(v.nodeName);}else{apf.xmldb.replaceNode(v,n);}}}return v;}function _nods_asn(n,m,x,v){if(n){v=x,x=m;}else{if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){throw new Error(apf.formatErrorString(0,0,"LM Xpath Assign","Cannot assign to nonresolving model:"+m+"\nxpath:"+x+"\nvalue:"+v));}}for(var i=0,j=(n=n.selectNodes(x)).length;i<j;i++){_nod_asn(n[i],null,v);}return v;}function _nod_add(n,m,x,v){if(n){v=x,x=m;}else{if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){throw new Error(apf.formatErrorString(0,0,"LM Xpath append","Cannot append to nonresolving model:"+m+"\nxpath:"+x+"\nvalue:"+v));}}if(!n||(x&&!(n=n.selectSingleNode(x)))){return _nod_asn(n,0,x,v);}var c;if(!v||(v.charAt&&(c=v.charAt(0)!="<"))||typeof(v)=="number"){apf.setNodeValue(n,v=((n=(n.nodeType!=1&&n||(n=n.selectSingleNode(x))&&(n.nodeType!=1&&n||(n=n.firstChild)&&n.nodeType!=1&&n)))&&n.nodeValue||"")+v,true);return v;}if(!c){if(n.nodeType!=1){throw new Error(apf.formatErrorString(0,0,"LM Xpath append","Cannot append to a non-element node\nxpath:"+x+"\nvalue:"+v));}if(!(c=xmlParse(v))){throw new Error(apf.formatErrorString(0,0,"LM Xpath append","Cannot append broken XML.\nxpath:"+x+"\nvalue:"+v));}if(c.tagName!="_apflmlist_"){return apf.xmldb.appendChild(n.parentNode,xmlParse(v),n.nextSibling);}else{c=c.childNodes;for(var i=0,j=c.length;i<j;i++){n=apf.xmldb.appendChild(n.parentNode,c[0],n.nextSibling);}return n;}}else{if(v.length){throw new Error(apf.formatErrorString(0,0,"LM Xpath append","Nodelists not yet supported\nxpath:"+x+"\nvalue:"+v));}else{if(!v.selectNodes){throw new Error(apf.formatErrorString(0,0,"LM Xpath append","Cannot assign non-element node\nxpath:"+x+"\nvalue:"+v));}if(v.nodeType==2){if(n.nodeType!=1){throw new Error(apf.formatErrorString(0,0,"LM Xpath append","Cannot append attribute to anything but element node"));}apf.xmldb.setAttribute(c=n.ownerElement||n.selectSingleNode(".."),v.nodeName,v.nodeValue);apf.xmldb.removeAttribute(v.ownerElement||v.selectSingleNode(".."),v.nodeName);return c.getAttributeNode(v.nodeName);}else{return apf.xmldb.appendChild(n.parentNode,v,n.nextSibling);}}}}function _nods_add(n,m,x,v){if(n){v=x,x=m;}else{if(!m||!(n=(m.charAt&&((m.charAt(0)=="<"&&xmlParse(m))||((n=apf.nameserver.lookup.model[m])&&n.data)))||(m.$isModel?m.data:(m.charAt?0:m)))){throw new Error(apf.formatErrorString(0,0,"LM Xpath Assign","Cannot append to nonresolving model:"+m+"\nxpath:"+x+"\nvalue:"+v));}}for(var i=0,j=(n=n.selectNodes(x)).length;i<j;i++){_nod_add(n[i],null,v);}return v;}function _asn(o,p,v){if(!o||typeof(o)!="object"){throw new Error(apf.formatErrorString(0,0,"LM Property Assign","Cannot assign property on non object, property:"+p));}if(o.setAttribute){o.setAttribute(p,v);}else{o[p]=v;}return v;}function _add(o,p,v){return _asn(o,p,o&&o[p]+v);}function _sub(o,p,v){return _asn(o,p,o&&o[p]-v);}function _div(o,p,v){return _asn(o,p,o&&o[p]/v);}function _mul(o,p,v){return _asn(o,p,o&&o[p]*v);}function _local(n){if(n&&n.charAt&&n.charAt(0)=="<"){return apf.getXmlDom(n).documentElement;}return n;}function _tagName(n1,n2){return(n2&&n2.tagName)||(n1&&n1.tagName);}function _localName(n1,n2){return(n2&&n2[apf.TAGNAME])||(n1&&n1[apf.TAGNAME]);}function _nodeValue(n,n2){if(n2){n=n2;}return(n=(n.nodeType!=1&&n||(n.nodeType!=1&&n||(n=n.firstChild)&&n.nodeType!=1&&n)))&&n.nodeValue||"";}var langrx=/(\\*)\$\[(.*?)\]/g;var lang=apf.language;apf.$lm_has_lang=0;function _lngrx(tok,esc,x){apf.$lm_has_lang=1;if(esc){return"$["+x+"]";}return lang.words[x]||("");}function __ret(r){if(r&&r.indexOf&&r.indexOf("$[")!=-1){return r.replace(langrx,_lngrx);}return r;}function __lng(x,x2){apf.$lm_has_lang=1;return lang.words[x]||("");}function _lnged(x,x2){apf.$lm_has_lang=1;return lang.words[x]||("");}function _injself(s){return s.charAt?s.replace(selfrx,"$1self::"):s;}apf.$lmx=null;function _async(_n,_c,_a,_w,_f,_this,obj,func,args){var i=_a.i,v;if(!_a.ret){_a.ret=[];}if(_a[i]){return _a.ret[i];}_a[i]=true;if(!obj.exec){return _a.ret[i]=(func)?obj[func].apply(obj,args):obj.apply(obj,args);}if(_w&&_w._pc){_w._pc={obj:obj,func:func,args:args,_c:_c};}else{obj.exec(func,args,function(data,state,extra){if(state!=apf.SUCCESS){_c(null,state,extra);}else{apf.$lmx=extra;_a.ret[i]=data;if(_w){_f.call(_this,_n,_c,_w,_a);}else{_f.call(_this,_n,_c,_a);}}});}throw ({x:1});}function _pc(_w){var o;if(typeof(o=_w._pc)!="object"||!o){return;}o.obj.exec(o.func,o.args,o._c);throw ({x:1});}this.compile=function(code){var _ret=__ret,_val=__val,_valm=__valm,_nod=__nod,_nodm=__nodm,_cnt=__cnt,_cntm=__cntm,_lng=__lng,_valattr=__valattr;eval(code);return _f;};var LMBEGINCACHE;var LMENDCACHE;})();apf.crypto.MD5={hexcase:0,b64pad:"",chrsz:8,hex_md5:function(a){return this.binl2hex(this.core_md5(this.str2binl(a),a.length*this.chrsz));},b64_md5:function(a){return this.binl2b64(this.core_md5(this.str2binl(a),a.length*this.chrsz));},str_md5:function(a){return this.binl2str(this.core_md5(this.str2binl(a),a.length*this.chrsz));},hex_hmac_md5:function(a,b){return this.binl2hex(this.core_hmac_md5(a,b));},b64_hmac_md5:function(a,b){return this.binl2b64(this.core_hmac_md5(a,b));},str_hmac_md5:function(a,b){return this.binl2str(this.core_hmac_md5(a,b));},core_md5:function(t,n){t[n>>5]|=128<<((n)%32);t[(((n+64)>>>9)<<4)+14]=n;var s=1732584193,r=-271733879,q=-1732584194,o=271733878;for(var k=0;k<t.length;k+=16){var m=s,l=r,j=q,g=o;s=this.md5_ff(s,r,q,o,t[k+0],7,-680876936);o=this.md5_ff(o,s,r,q,t[k+1],12,-389564586);q=this.md5_ff(q,o,s,r,t[k+2],17,606105819);r=this.md5_ff(r,q,o,s,t[k+3],22,-1044525330);s=this.md5_ff(s,r,q,o,t[k+4],7,-176418897);o=this.md5_ff(o,s,r,q,t[k+5],12,1200080426);q=this.md5_ff(q,o,s,r,t[k+6],17,-1473231341);r=this.md5_ff(r,q,o,s,t[k+7],22,-45705983);s=this.md5_ff(s,r,q,o,t[k+8],7,1770035416);o=this.md5_ff(o,s,r,q,t[k+9],12,-1958414417);q=this.md5_ff(q,o,s,r,t[k+10],17,-42063);r=this.md5_ff(r,q,o,s,t[k+11],22,-1990404162);s=this.md5_ff(s,r,q,o,t[k+12],7,1804603682);o=this.md5_ff(o,s,r,q,t[k+13],12,-40341101);q=this.md5_ff(q,o,s,r,t[k+14],17,-1502002290);r=this.md5_ff(r,q,o,s,t[k+15],22,1236535329);s=this.md5_gg(s,r,q,o,t[k+1],5,-165796510);o=this.md5_gg(o,s,r,q,t[k+6],9,-1069501632);q=this.md5_gg(q,o,s,r,t[k+11],14,643717713);r=this.md5_gg(r,q,o,s,t[k+0],20,-373897302);s=this.md5_gg(s,r,q,o,t[k+5],5,-701558691);o=this.md5_gg(o,s,r,q,t[k+10],9,38016083);q=this.md5_gg(q,o,s,r,t[k+15],14,-660478335);r=this.md5_gg(r,q,o,s,t[k+4],20,-405537848);s=this.md5_gg(s,r,q,o,t[k+9],5,568446438);o=this.md5_gg(o,s,r,q,t[k+14],9,-1019803690);q=this.md5_gg(q,o,s,r,t[k+3],14,-187363961);r=this.md5_gg(r,q,o,s,t[k+8],20,1163531501);s=this.md5_gg(s,r,q,o,t[k+13],5,-1444681467);o=this.md5_gg(o,s,r,q,t[k+2],9,-51403784);q=this.md5_gg(q,o,s,r,t[k+7],14,1735328473);r=this.md5_gg(r,q,o,s,t[k+12],20,-1926607734);s=this.md5_hh(s,r,q,o,t[k+5],4,-378558);o=this.md5_hh(o,s,r,q,t[k+8],11,-2022574463);q=this.md5_hh(q,o,s,r,t[k+11],16,1839030562);r=this.md5_hh(r,q,o,s,t[k+14],23,-35309556);s=this.md5_hh(s,r,q,o,t[k+1],4,-1530992060);o=this.md5_hh(o,s,r,q,t[k+4],11,1272893353);q=this.md5_hh(q,o,s,r,t[k+7],16,-155497632);r=this.md5_hh(r,q,o,s,t[k+10],23,-1094730640);s=this.md5_hh(s,r,q,o,t[k+13],4,681279174);o=this.md5_hh(o,s,r,q,t[k+0],11,-358537222);q=this.md5_hh(q,o,s,r,t[k+3],16,-722521979);r=this.md5_hh(r,q,o,s,t[k+6],23,76029189);s=this.md5_hh(s,r,q,o,t[k+9],4,-640364487);o=this.md5_hh(o,s,r,q,t[k+12],11,-421815835);q=this.md5_hh(q,o,s,r,t[k+15],16,530742520);r=this.md5_hh(r,q,o,s,t[k+2],23,-995338651);s=this.md5_ii(s,r,q,o,t[k+0],6,-198630844);o=this.md5_ii(o,s,r,q,t[k+7],10,1126891415);q=this.md5_ii(q,o,s,r,t[k+14],15,-1416354905);r=this.md5_ii(r,q,o,s,t[k+5],21,-57434055);s=this.md5_ii(s,r,q,o,t[k+12],6,1700485571);o=this.md5_ii(o,s,r,q,t[k+3],10,-1894986606);q=this.md5_ii(q,o,s,r,t[k+10],15,-1051523);r=this.md5_ii(r,q,o,s,t[k+1],21,-2054922799);s=this.md5_ii(s,r,q,o,t[k+8],6,1873313359);o=this.md5_ii(o,s,r,q,t[k+15],10,-30611744);q=this.md5_ii(q,o,s,r,t[k+6],15,-1560198380);r=this.md5_ii(r,q,o,s,t[k+13],21,1309151649);s=this.md5_ii(s,r,q,o,t[k+4],6,-145523070);o=this.md5_ii(o,s,r,q,t[k+11],10,-1120210379);q=this.md5_ii(q,o,s,r,t[k+2],15,718787259);r=this.md5_ii(r,q,o,s,t[k+9],21,-343485551);s=this.safe_add(s,m);r=this.safe_add(r,l);q=this.safe_add(q,j);o=this.safe_add(o,g);}return[s,r,q,o];},md5_cmn:function(k,g,d,c,j,i){return this.safe_add(this.bit_rol(this.safe_add(this.safe_add(g,k),this.safe_add(c,i)),j),d);},md5_ff:function(j,i,n,m,g,l,k){return this.md5_cmn((i&n)|((~i)&m),j,i,g,l,k);},md5_gg:function(j,i,n,m,g,l,k){return this.md5_cmn((i&m)|(n&(~m)),j,i,g,l,k);},md5_hh:function(j,i,n,m,g,l,k){return this.md5_cmn(i^n^m,j,i,g,l,k);},md5_ii:function(j,i,n,m,g,l,k){return this.md5_cmn(n^(i|(~m)),j,i,g,l,k);},core_hmac_md5:function(c,j){var g=this.str2binl(c),a=Array(16),d=Array(16);if(g.length>16){g=this.core_md5(g,c.length*this.chrsz);}for(var b=0;b<16;b++){a[b]=g[b]^909522486;d[b]=g[b]^1549556828;}return this.core_md5(d.concat(this.core_md5(a.concat(this.str2binl(j)),512+j.length*this.chrsz)),512+128);},safe_add:function(a,d){var c=(a&65535)+(d&65535),b=(a>>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535);},bit_rol:function(a,b){return(a<<b)|(a>>>(32-b));},str2binl:function(d){var c=[],b,a=(1<<this.chrsz)-1;for(b=0;b<d.length*this.chrsz;b+=this.chrsz){c[b>>5]|=(d.charCodeAt(b/this.chrsz)&a)<<(b%32);}return c;},binl2str:function(c){var d=[],b,a=(1<<this.chrsz)-1;for(b=0;b<c.length*32;b+=this.chrsz){d.push(String.fromCharCode((c[b>>5]>>>(b%32))&a));}return d.join("");},binl2hex:function(c){var b=this.hexcase?"0123456789ABCDEF":"0123456789abcdef",d=[],a;for(a=0;a<c.length*4;a++){d.push(b.charAt((c[a>>2]>>((a%4)*8+4))&15)+b.charAt((c[a>>2]>>((a%4)*8))&15));}return d.join("");},binl2b64:function(d){var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=[],b;for(b=0;b<d.length*4;b+=3){var g=(((d[b>>2]>>8*(b%4))&255)<<16)|(((d[b+1>>2]>>8*((b+1)%4))&255)<<8)|((d[b+2>>2]>>8*((b+2)%4))&255);for(var a=0;a<4;a++){if(b*8+a*6>d.length*32){k.push(this.b64pad);}else{k.push(c.charAt((g>>6*(3-a))&63));}}}return k.join("");}};apf.BindingRule=function(b,a){this.$init(a||true,apf.NODE_HIDDEN,b);};(function(){this.$bindingRule=true;this.compile=function(a){return(this["c"+a]=apf.lm.compile(this[a],{xpathmode:3,injectself:true}));};this.$compile=function(b,a){return(this["c"+b+"2"]=apf.lm.compile(this[b],a));};this.$attrExcludePropBind=apf.extend({value:1,match:1},this.$attrExcludePropBind);this.$propHandlers.value=this.$propHandlers.match=function(b,c){delete this["c"+c];if(this.$amlLoaded){var a=this;while(a&&a.$bindingRule){a=a.parentNode;}if(!a){return;}apf.queue.add("reload"+a.$uniqueId,function(){a.reload();});if(a.$bindings.$isCompiled){a.$bindings.$compiled=a.$bindings.compile(this.localName!="each"&&this.localName);}}};this.addEventListener("DOMNodeInserted",function(b){var a=this;while(a.$bindingRule){a=a.parentNode;}apf.queue.add("reload"+a.$uniqueId,function(){a.reload();});if(b.currentTarget==this){(a.$bindings[this.localName]||(a.$bindings[this.localName]=[])).push(this);}else{if(!this.attributes.getNamedItem("value")){this.value=apf.serializeChildren(this);}else{return;}}if(a.$bindings.$isCompiled){a.$bindings.$compiled=a.$bindings.compile(this.localName!="each"&&this.localName);}});this.addEventListener("DOMNodeRemoved",function(b){var c,a=this;while(a&&a.$bindingRule){a=a.parentNode;}if(!a){return;}if(b.currentTarget==this){if(a.$bindings&&a.$bindings[this.localName]){a.$bindings[this.localName].remove(this);}else{return;}}else{if(!this.attributes.getNamedItem("value")&&(c=this.firstChild)){if(c.nodeType==this.NODE_PROCESSING_INSTRUCTION){if(c.target=="lm"){this.value="{"+c.nodeValue+"}";}else{this.value=c.nodeValue;}}else{this.value=apf.serializeChildren(this).trim();}}else{return;}}apf.queue.add("reload"+a.$uniqueId,function(){if(!a.$amlDestroyed){a.reload();}});if(a.$bindings.$isCompiled){a.$bindings.$compiled=a.$bindings.compile(this.localName!="each"&&this.localName);}});this.addEventListener("DOMNodeInsertedIntoDocument",function(c){var d;if(!this.value&&(d=this.$aml&&this.$aml.firstChild||this.firstChild)){if(d.nodeType==this.NODE_PROCESSING_INSTRUCTION){if(d.target=="lm"){this.value="{"+d.nodeValue+"}";}else{this.value=d.nodeValue;}}else{this.value=apf.serializeChildren(this.$aml).trim();}}var a=this.parentNode;while(a.$bindingRule){a=a.parentNode;}var g=a.$bindings||(a.$bindings=new apf.ruleList());(g[this.localName]||(g[this.localName]=[])).push(this);if(a.localName!="bindings"&&(this.localName!="each"||!this.childNodes.length)){var b=this;while((b=b.nextSibling)&&b.nodeType!=1){}if(!b||!b.$bindingRule){a.$cbindings=a.$bindings.compile(a.$bindings.$isCompiled?this.localName:null);a.dispatchEvent("bindingsload",{bindings:a.$bindings,compiled:a.$cbindings});a.$checkLoadQueue();}}});}).call(apf.BindingRule.prototype=new apf.AmlElement());apf.aml.setElement("icon",apf.BindingRule);apf.aml.setElement("image",apf.BindingRule);apf.aml.setElement("caption",apf.BindingRule);apf.aml.setElement("css",apf.BindingRule);apf.aml.setElement("selectable",apf.BindingRule);apf.aml.setElement("value",apf.BindingRule);apf.aml.setElement("src",apf.BindingRule);apf.aml.setElement("collapsed",apf.BindingRule);apf.aml.setElement("expanded",apf.BindingRule);apf.aml.setElement("empty",apf.BindingRule);apf.aml.setElement("teleport",apf.AmlElement);apf.BindingQuicksandRule=function(b,a){this.$init(a,apf.NODE_HIDDEN,b);};(function(){function getFilteredNodes(pNode){pNode=pNode||this.$parent;var attr,tmp,res=[],dataIDs=[],xmlNodes=pNode.$getDataNode("quicksand",pNode.xmlRoot,false,null,true),domNodes=pNode.$ext.childNodes,i=0,l=xmlNodes.length;if(!domNodes.length||!l){return res;}for(;i<l;++i){dataIDs.push(xmlNodes[i].getAttribute("a_id"));}for(i=0,l=domNodes.length;i<l;++i){if(!domNodes[i]||!(attr=domNodes[i].getAttribute("id"))){continue;}tmp=attr.split("|");tmp.pop();if(dataIDs.indexOf(tmp.join("|"))>-1){res.push(domNodes[i]);}}return res;}function nodeInFilter(node,filtered){var i=0,l=filtered.length,s=node.getAttribute("id");for(;i<l;++i){if(filtered[i].getAttribute("id")==s){return filtered[i];}}return null;}function quicksand(parent,customOptions){parent=this.$parent.$ext;var i,l,dest,src,offset,_self=this,coll=getFilteredNodes.call(this),parentOffset=apf.getAbsolutePosition(parent),offsets=[],callbackFunction=typeof(arguments[1])=="function"?arguments[1]:typeof arguments[2]=="function"?arguments[2]:apf.K,postCallback=function(){_self.dispatchEvent("afterquicksand");callbackFunction.call(_self);},options={steps:60,anim:apf.tween.easeInOutQuad,onfinish:postCallback,adjustHeight:true};apf.extend(options,customOptions);if(apf.isIE&&apf.isIE<7){parent.innerHTML="";for(i=0,l=coll.length;i<l;i++){parent.appendChild(coll[i]);}return;}var $source=parent.childNodes;var correctionOffset=[0,0];parent.style.height=parent.offsetHeight+"px";apf.tween.clearQueue(parent,true);for(i=0,l=$source.length;i<l;++i){src=$source[i];offsets[i]=apf.getAbsolutePosition(src,parent,false);}for(i=0,l=$source.length;i<l;++i){src=$source[i];with(src.style){position="absolute";margin="0";top=(offsets[i][1]-parentOffset[1])+"px";left=(offsets[i][0]-parentOffset[0])+"px";}}var $dest=parent.cloneNode(false);$dest.setAttribute("id","");for(i=0,l=coll.length;i<l;++i){$dest.appendChild(coll[i].cloneNode(true));coll[i].$offset=apf.getAbsolutePosition(coll[i]);}parent.parentNode.insertBefore($dest,parent);with($dest.style){zIndex=1;opacity=0;margin=0;position="absolute";top=parentOffset[1]-correctionOffset[1]+"px";left=parentOffset[0]-correctionOffset[0]+"px";}if(false){apf.tween.single(parent,{steps:options.steps,anim:options.anim,type:"height",from:parent.offsetHeight,to:$dest.offsetHeight});}var insets=[];for(i=0,l=$source.length;i<l;++i){src=$source[i];if(dest=nodeInFilter(src,coll)){offset=insets.shift()||offsets[i];options.tweens=[{type:"top",from:dest.$offset[1]-parentOffset[1],to:offset[1]-parentOffset[1]},{type:"left",from:dest.$offset[0]-parentOffset[0],to:offset[0]-parentOffset[0]},{type:"opacity",from:apf.getStyle(src,"opacity"),to:1}];if(apf.supportCSSAnim){options.tweens.push({type:"transform",subType:"scale",from:0,to:1});}apf.tween.multi(src,options);}else{options.tweens=[{type:"opacity",from:apf.getStyle(src,"opacity"),to:0}];if(apf.supportCSSAnim){options.tweens.push({type:"transform",subType:"scale",from:1,to:0});}insets.push(offsets[i]);apf.tween.multi(src,options);}}for(i=0,l=coll.length;i<l;++i){var item=coll[i];if(!nodeInFilter(item,$source)){dest=nodeInFilter(item,coll);options.tweens=[{type:"opacity",from:0,to:1}];if(!apf.isIE){}offset=apf.getAbsolutePosition(dest);dest=dest.cloneNode(true);with(dest.style){position="absolute";margin="0";top=(offset[1]-parentOffset[1])+"px";left=(offset[0]-parentOffset[0])+"px";opacity="0";transform="scale(.0)";}parent.appendChild(dest);apf.tween.multi(dest,options);}}}this.addEventListener("DOMNodeInsertedIntoDocument",function(e){var pNode=this;while(pNode&&pNode.$bindingRule){pNode=pNode.parentNode;}this.$parent=pNode;if(!pNode){return;}var _self=this;setTimeout(function(){quicksand.call(_self);});});}).call(apf.BindingQuicksandRule.prototype=new apf.BindingRule());apf.aml.setElement("quicksand",apf.BindingQuicksandRule);apf.page=function(b,a){this.$init(a||"page",apf.NODE_VISIBLE,b);};(function(){this.canHaveChildren=true;this.$focussable=false;this.buttons=false;this.closebtn=false;this.setCaption=function(a){this.setProperty("caption",a,false,true);};this.setIcon=function(a){this.setProperty("icon",a,false,true);};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.$booleanProperties.closebtn=true;this.$supportedProperties.push("fake","caption","icon","type","buttons","closebtn");this.$propHandlers.buttons=function(a){this.buttons=a;};this.$propHandlers.closebtn=function(a){this.closebtn=a;};this.$propHandlers.caption=function(b){if(!this.parentNode){return;}var a=this.parentNode.$getLayoutNode("button","caption",this.$button);if(a.nodeType==1){a.innerHTML=b;}else{a.nodeValue=b;}};this.$propHandlers.icon=function(b){if(!this.parentNode){return;}var a=this.parentNode.$getLayoutNode("button","icon",this.$button);if(a&&a.nodeType==1){apf.skins.setIcon(a,b,this.parentNode.iconPath);}};this.$propHandlers.visible=function(d){if(!this.parentNode){return;}if(d){this.$ext.style.display="";if(this.parentNode.$hasButtons){this.$button.style.display="block";}if(!this.parentNode.$activepage){this.parentNode.set(this);}}else{if(this.$active){this.$deactivate();var c=this.parentNode.activepagenr+1;var b=this.parentNode.getPages();var a=b.length;while(c<a&&!b[c].visible){c++;}if(c==a){c=this.parentNode.activepagenr-1;while(c>=0&&a&&!b[c].visible){c--;}}if(c>=0){this.parentNode.set(c);}else{this.parentNode.activepage=this.parentNode.activepagenr=this.parentNode.$activepage=null;}}this.$ext.style.display="none";if(this.parentNode.$hasButtons){this.$button.style.display="none";}}};this.$propHandlers.fake=function(a){if(this.$ext){apf.destroyHtmlNode(this.$ext);this.$int=this.$ext=null;}};this.$propHandlers.type=function(a){this.setProperty("fake",true);this.relPage=this.parentNode.getPage(a);if(this.$active){this.$activate();}};this.addEventListener("DOMNodeRemoved",function(a){if(a&&a.currentTarget!=this){return;}if(this.$button){if(this.$position&1){this.parentNode.$setStyleClass(this.$button,"",["firstbtn","firstcurbtn"]);}if(this.$position&2){this.parentNode.$setStyleClass(this.$button,"",["lastbtn"]);}}if(!a.$doOnlyAdmin){if(this.$button){this.$button.parentNode.removeChild(this.$button);}if(this.parentNode.$activepage==this){if(this.$button){this.parentNode.$setStyleClass(this.$button,"",["curbtn"]);}this.parentNode.$setStyleClass(this.$ext,"",["curpage"]);}}});this.addEventListener("DOMNodeInserted",function(a){if(a&&a.currentTarget!=this||!this.$amlLoaded||!a.$oldParent){return;}if(!a.$moveWithinParent&&this.skinName!=this.parentNode.skinName){this.$destroy();}else{if(this.$button&&a.$oldParent.$hasButtons){this.parentNode.$buttons.insertBefore(this.$button,a.$beforeNode&&a.$beforeNode.$button||null);}}},true);this.$position=0;this.$first=function(a){if(a){this.$position-=1;this.parentNode.$setStyleClass(this.$button,"",["firstbtn","firstcurbtn"]);}else{this.$position=this.$position|1;this.parentNode.$setStyleClass(this.$button,"firstbtn"+(this.parentNode.$activepage==this?" firstcurbtn":""));}};this.$last=function(a){if(a){this.$position-=2;this.parentNode.$setStyleClass(this.$button,"",["lastbtn"]);}else{this.$position=this.$position|2;this.parentNode.$setStyleClass(this.$button,"lastbtn");}};this.$deactivate=function(a){this.$active=false;if(this.parentNode.$hasButtons){if(this.$position>0){this.parentNode.$setStyleClass(this.$button,"",["firstcurbtn"]);}this.parentNode.$setStyleClass(this.$button,"",["curbtn"]);}if((!this.fake||this.relPage)&&!a){this.parentNode.$setStyleClass(this.fake?this.relPage.$ext:this.$ext,"",["curpage"]);this.dispatchEvent("prop.visible",{value:false});}};this.$activate=function(){this.$active=true;if(!this.$drawn){var b;this.addEventListener("DOMNodeInsertedIntoDocument",b=function(c){this.removeEventListener("DOMNodeInsertedIntoDocument",b);if(!this.$active){return;}this.$activate();});return;}if(this.parentNode.$hasButtons){if(this.$position>0){this.parentNode.$setStyleClass(this.$button,"firstcurbtn");}this.parentNode.$setStyleClass(this.$button,"curbtn");}if(!this.fake||this.relPage){this.parentNode.$setStyleClass(this.fake?this.relPage.$ext:this.$ext,"curpage");if(apf.layout){apf.layout.forceResize(this.fake?this.relPage.$int:this.$int);}}if(this.$render){this.$render();}if(!this.fake){if(apf.isIE){var a=this.$ext.className;this.$ext.className="rnd"+Math.random();this.$ext.className=a;}this.dispatchEvent("prop.visible",{value:true});}};this.addEventListener("$skinchange",function(){if(this.caption){this.$propHandlers.caption.call(this,this.caption);}if(this.icon){this.$propHandlers.icon.call(this,this.icon);}});this.$canLeechSkin=true;this.$draw=function(c){this.skinName=this.parentNode.skinName;var j=this.getAttribute("type");if(j){this.fake=true;this.relPage=this.parentNode.getPage(j)||null;}if(this.parentNode.$hasButtons){this.parentNode.$getNewContext("button");var g=this.parentNode.$getLayoutNode("button");g.setAttribute(this.parentNode.$getOption("main","select")||"onmousedown","var page = apf.lookup("+this.$uniqueId+");                 if (page.disabled) return;                 page.parentNode.set(page);                 page.canHaveChildren = 2;");g.setAttribute("onmouseover","var o = apf.lookup("+this.parentNode.$uniqueId+");if(apf.lookup("+this.$uniqueId+') != o.$activepage) o.$setStyleClass(this, "over", null, true);');g.setAttribute("onmouseout","var o = apf.lookup("+this.parentNode.$uniqueId+');                  o.$setStyleClass(this, "", ["over"], true);                  var page = apf.lookup('+this.$uniqueId+");                  page.canHaveChildren = true;");var d=this.getAttribute("id")||this.getAttribute("name"),a=this.getAttribute("closebtn");if((a=="true"||(this.parentNode.buttons=="close"&&a==null))&&d){var b=this.parentNode.$getLayoutNode("button","btncontainer");this.parentNode.$getNewContext("btnclose");var i=this.parentNode.$getLayoutNode("btnclose");if(!i){return;}i.setAttribute("onclick","var page = apf.lookup("+this.$uniqueId+");                     page.parentNode.remove("+d+");");b.appendChild(i);}this.$button=apf.insertHtmlNode(g,this.parentNode.$buttons);if(!c&&this.nextSibling&&this.nextSibling.$button){this.$button.parentNode.insertBefore(this.$button,this.nextSibling.$button);}this.$button.host=this;}if(this.fake){return;}if(this.$ext){this.$ext.parentNode.removeChild(this.$ext);}this.$ext=this.parentNode.$getExternal("page",this.parentNode.oPages,null,this);this.$ext.host=this;this.$int=this.parentNode.$getLayoutNode("page","container",this.$ext);};this.$loadAml=function(a){};this.$destroy=function(){if(this.$button){this.$button.host=null;this.$button=null;}};}).call(apf.page.prototype=new apf.Presentation());apf.aml.setElement("page",apf.page);apf.bindings=function(b,a){this.$init(a||"bindings",apf.NODE_HIDDEN,b);this.$bindings=new apf.ruleList();this.$amlNodes={};};(function(){this.$smartbinding=null;this.register=function(a){if(a.localName=="smartbinding"){this.$smartbinding=a;this.$smartbinding.add(this);return;}if(!a.hasFeature(apf.__DATABINDING__)){return;}this.$amlNodes[a.$uniqueId]=a;if(!this.$amlLoaded){return;}if(!this.$bindings.$isCompiled){this.$cbindings=this.$bindings.compile();}a.$bindings=this.$bindings;a.$cbindings=this.$cbindings;a.dispatchEvent("bindingsload",{bindings:this.$bindings,compiled:this.$cbindings});this.dispatchEvent("noderegister",{amlNode:a});a.$checkLoadQueue();};this.unregister=function(){this.$amlNodes[this.amlNode.$uniqueId]=null;delete this.$amlNodes[this.amlNode.$uniqueId];this.amlNode.$bindings=this.amlNode.$cbindings=false;this.amlNode.dispatchEvent("bindingsunload",{bindings:this.$bindings,compiled:this.$cbindings});};this.reload=function(){for(var a in this.$amlNodes){this.$amlNodes[a].reload();}};this.addEventListener("DOMNodeInsertedIntoDocument",function(g){var b=this.childNodes;for(var d,c=0,a=b.length;c<a;c++){if(!(d=b[c]).$amlLoaded&&d.nodeType==1){d.dispatchEvent("DOMNodeInsertedIntoDocument");}}this.register(this.parentNode);for(var j in this.$amlNodes){this.register(this.$amlNodes[j]);}});}).call(apf.bindings.prototype=new apf.AmlElement());apf.ruleList=function(){this.$compiled={};};apf.ruleList.prototype={$isCompiled:false,getRule:function(b,d){var k=this[b];if(!k){return false;}for(var g,j,c=0,a=k.length;c<a;c++){j=k[c];if(!j.match){return j;}g=j.cmatch||j.compile("match",{injectself:true,xpathmode:2});if(g&&g(d)){return j;}}},compile:function(b){var k,g,m=this.$compiled;if(b){g=[];k=this[b];for(var j,d=0,a=k.length;d<a;d++){if(!(j=k[d]).match&&!j.value){continue;}g.push(j.match,j.value);}m[b]=apf.lm.compileMatch(g);return m;}for(b in this){if(b=="each"){continue;}k=this[b];if(k.dataType!=apf.ARRAY){continue;}g=[];for(var j,d=0,a=k.length;d<a;d++){if(!(j=k[d]).match&&!j.value){continue;}g.push(j.match,j.value);}m[b]=apf.lm.compileMatch(g);}this.$isCompiled=true;return m;},getRuleIndex:function(b,a){var c=this[b][a];if(c.value){if(!c.cvalue){c.compile("value");}}else{if(c.match){if(!c.cmatch){c.compile("match");}}}return c;},getDataNode:function(a,n,m,g,q){var j,d,c,b,k,o=this[a];if(!o){return;}for(k,j=0,d=o.length;j<d;j++){k=o[j];c=k.cvaluematch;if(!c){if(k.match&&k.value){k.valuematch="{_n = "+k.match+"; %[child::"+k.value.substr(1,k.value.length-2).split("|").join("|child::")+"]}";}else{k.valuematch=k.match||k.value;}c=k.$compile("valuematch",{xpathmode:q?4:3,injectself:k.match?true:false});}if(c&&(b=c(n,m))){if(g){g.push(k);}return b;}}return false;}};apf.aml.setElement("bindings",apf.bindings);apf.propedit=function(b,a){this.$init(a||"propedit",apf.NODE_VISIBLE,b);this.$nodes=[];this.$editors={};this.$dynCssClasses=[];};(function(){this.$init(function(){this.addEventListener("keydown",a,true);});this.$focussable=true;this.$isTreeArch=true;this.$isWindowContainer=-1;this.startClosed=true;this.$animType=apf.tween.NORMAL;this.$animSteps=3;this.$animSpeed=20;this.$useiframe=0;this.$attrExcludePropBind=apf.extend({properties:1},this.$attrExcludePropBind);this.$booleanProperties.iframe=true;this.$propHandlers.properties=function(i){var c=this;var g={load:function(j){if(typeof j=="string"){j=apf.getXml(j);}c.$properties=j;if(c.xmlRoot){c.load(c.xmlRoot);}}};var d;if(typeof i=="string"){if(i.substr(0,1)=="<"){g.load(i);}else{apf.setModel(i,g);}}else{if(i.$isModel){i.register(g);}else{g.load(i);}}};this.$canLoadData=function(){return this.$headings?true:false;};this.$columns=["50%","50%"];this.$propHandlers.columns=function(c){this.$columns=c&&c.splitSafe(",")||["50%","50%"];if(this.$headings){this.$headings[0].setProperty("width",this.$columns[0]);this.$headings[1].setProperty("width",this.$columns[1]);}};function b(){var c=(this.current||this.$selected),d=this.$body;d.scrollTop=(c.offsetTop)-21;}this.$findHtmlNode=function(c){return this.$pHtmlDoc.getElementById(c);};function a(s){var y=s.keyCode,g=s.ctrlKey,m=s.shiftKey;var c=this.$lastEditor&&this.$lastEditor[2],w=this.$useiframe?this.oDoc.documentElement:this.$body,l,q,j,x,u,n,d;switch(y){case 36:return false;case 35:return false;case 107:break;case 37:this.$slideToggle(this.$selected.firstChild);return false;case 107:case 39:this.$slideToggle(this.$selected.firstChild);return false;case 38:var q=c;var t=c.previousSibling;while(t&&t.nodeType!=1){t=t.previousSibling;}if(t){var i=t,o;while((o=i.selectNodes("prop")).length){i=o[o.length-1];}t=i;}else{t=q.parentNode;if(t[apf.TAGNAME]!="prop"){t=t.previousSibling;while(t&&t.nodeType!=1){t=t.previousSibling;}if(t&&t[apf.TAGNAME]!="prop"){t=(o=t.selectNodes("prop"))[o.length-1];while(t&&t.nodeType!=1){t=t.previousSibling;}}}}if(!t){return;}var r=apf.xmldb.findHtmlNode(t,this);while(!r.offsetWidth){r=apf.xmldb.findHtmlNode(t=t.parentNode,this);}var k=apf.getAbsolutePosition(r,this.$body)[1]-(r.offsetHeight/2);if(k<=this.$ext.scrollTop){this.$ext.scrollTop=k;}this.select(r);return false;case 40:var q,t=(q=c).selectSingleNode("prop")||q.nextSibling;do{while(t&&(t.nodeType!=1||t[apf.TAGNAME]!="prop")){t=t.nextSibling;}if(!t){t=q.parentNode.nextSibling;if(t&&t[apf.TAGNAME]!="prop"){t=t.selectSingleNode("prop");}}}while(t&&t.nodeType!=1);if(!t){return;}var r=apf.xmldb.findHtmlNode(t,this);while(!r.offsetWidth){r=apf.xmldb.findHtmlNode(t=t.parentNode,this);}if(t==q){t=q.nextSibling;while(t&&(t.nodeType!=1||t[apf.TAGNAME]!="prop")){t=t.nextSibling;}var r=apf.xmldb.findHtmlNode(t,this);}var k=apf.getAbsolutePosition(r,this.$body)[1]+(r.offsetHeight/2);if(k>this.$ext.scrollTop+this.$ext.offsetHeight){this.$ext.scrollTop=k-this.$ext.offsetHeight;}this.select(r);return false;}}this.$focus=function(){if(!this.$ext||(apf.isIE&&this.$useiframe&&this.cssfix)){return;}this.$setStyleClass(this.oFocus||this.$ext,this.$baseCSSname+"Focus");if(this.oDoc){this.$setStyleClass(this.oDoc.documentElement,this.$baseCSSname+"Focus");}};this.$blur=function(){if(this.renaming){this.stopRename(null,true);}if(!this.$ext||(apf.isIE&&this.$useiframe&&this.cssfix)){return;}this.$setStyleClass(this.oFocus||this.$ext,"",[this.$baseCSSname+"Focus"]);if(this.oDoc){this.$setStyleClass(this.oDoc.documentElement,"",[this.$baseCSSname+"Focus"]);}};this.$slideToggle=function(c){container=c.parentNode.lastChild;if(apf.getStyle(container,"display")=="block"){c.className=c.className.replace(/min/,"plus");this.$slideClose(container);}else{c.className=c.className.replace(/plus/,"min");this.$slideOpen(container);}};this.$slideOpen=function(c){c.style.display="";apf.tween.single(c,{type:"scrollheight",from:3,diff:-2,to:c.scrollHeight,anim:this.$animType,steps:this.$animSteps,interval:this.$animSpeed,onfinish:function(d){d.style.overflow="visible";d.style.height="auto";}});};this.$slideClose=function(c){c.style.height=c.offsetHeight;c.style.overflow="hidden";apf.tween.single(c,{type:"scrollheight",from:c.scrollHeight,diff:-2,to:0,anim:this.$animType,steps:this.$animSteps,interval:this.$animSpeed,onfinish:function(d,g){d.style.display="none";}});};this.$findContainer=function(d){var c=d.nextSibling;if(!c){return d;}return c.nodeType==1?c:c.nextSibling;};this.addEventListener("bindingsload",this.$loaddatabinding=function(g){var j=g.bindings.properties;if(!j||!j.length){return;}for(var d=0,c=j.length;d<c;d++){}});this.$unloaddatabinding=function(){};this.getColumn=function(c){return this.$headings[c||this.$lastcol||0];};this.resizeColumn=function(g,d){var c=this.$headings[g];c.resize(d);};this.hideColumn=function(d){var c=this.$headings[d];c.hide();};this.showColumn=function(d){var c=this.$headings[d];c.show();};this.$getProperties=function(d){if(this.properties){if(!this.$properties){return false;}else{return this.$properties;}}else{if(this.$bindings.properties){var g=this.$bindings.properties;for(var c=0;c<g.length;c++){if(!g[c].match){return xx;}}}}return false;};this.$load=function(j){var l=this.$getProperties();if(!l){return false;}var g=[];var i=this.documentId=apf.xmldb.getXmlDocId(l);apf.xmldb.addNodeListener(j,this);apf.xmldb.addNodeListener(this.xmlRoot,this);var c=this,k=l.ownerDocument;(function d(n,z,t){for(var B,C,A,y,x,w,o,r=0,q=n.length;r<q;r++){o=n[r];c.$getNewContext("row");w=c.$getLayoutNode("row");if(o[apf.TAGNAME]=="group"){c.$getNewContext("cell");apf.setStyleClass(w,"heading");A=w.appendChild(c.$getLayoutNode("cell"));apf.setNodeValue(c.$getLayoutNode("cell","caption",A),(o.getAttribute("caption")||"").trim()||"");x=w.appendChild(k.createElement("blockquote"));d(o.selectNodes("prop"),x,t);w.insertBefore(B=k.createElement("u"),w.firstChild).appendChild(k.createTextNode(" "));B.setAttribute("class","min");}else{apf.xmldb.nodeConnect(i,o,w,c);c.$getNewContext("cell");h=c.$headings[0];A=w.appendChild(c.$setStyleClass(c.$getLayoutNode("cell"),h.$className));apf.setNodeValue(c.$getLayoutNode("cell","caption",A),(o.getAttribute("caption")||"").trim()||"");if(t){A.firstChild.setAttribute("style","padding-left:"+(t*15)+"px");}c.$getNewContext("cell");h=c.$headings[1];A=w.appendChild(c.$setStyleClass(c.$getLayoutNode("cell"),h.$className));apf.setNodeValue(c.$getLayoutNode("cell","caption",A),((apf.lm.compile(o.getAttribute("value"),{nostring:true}))(c.xmlRoot)||"")||"");if((C=o.selectNodes("prop")).length){x=w.appendChild(k.createElement("blockquote"));x.setAttribute("style","display:none;overflow:hidden;height:0;");d(C,c.$getLayoutNode("heading","container",x),t+1);w.insertBefore(B=k.createElement("u"),w.firstChild).appendChild(k.createTextNode(" "));B.setAttribute("class","plus");}}if(!z){g.push(w);}else{z.appendChild(w);}}})(l.selectNodes("group|prop"),null,0);apf.insertHtmlNodes(g,this.$body);this.setProperty("root",this.xmlRoot);var m=l.selectSingleNode(".//prop");if(m){this.select(this.$findHtmlNode(m.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId));}};this.$xmlUpdate=function(m,r,g,o){return;if(this.$lastEditor[0]==o.amlNode){this.$lastEditor[1].firstChild.innerHTML=((apf.lm.compile(this.$lastEditor[2].getAttribute("value"),{nostring:true}))(this.xmlRoot)||"")||"";}else{var d=this.$getProperties();var j,q,c=d.selectNodes(".//prop");for(var n=0,k=c.length;n<k;n++){j=c[n];q=this.$findHtmlNode(j.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);q.childNodes[q.firstChild.tagName=="U"?2:1].firstChild.innerHTML=((apf.lm.compile(j.getAttribute("value"),{nostring:true}))(this.xmlRoot)||"")||"";}}};this.select=function(w){if(this.$selected==w){return;}if(this.$selected){this.$setStyleClass(this.$selected,"",["selected"]);}this.$setStyleClass(w,"selected");this.$selected=w;if(this.$lastEditor){this.$lastEditor[0].setProperty("visible",false);var d=this.$lastEditor[1].childNodes;for(var n=0,k=d.length;n<k;n++){if(!d[n].host){d[n].style.display="";}}}var c=apf.xmldb.getNode(w);var r=this;var t=this.$selected.childNodes[this.$selected.firstChild.tagName=="U"?2:1];var u,q=c.getAttribute("editor");var j=apf.lm.compile(q,{xpathmode:2});if(j.type==2){if(!this.$editors[q]){var s=apf.namespaces[apf.ns.aml].elements[q];var g={htmlNode:t,width:"100%+2",style:"position:relative;z-index:10000",value:"[{"+this.id+".root}::"+(v=c.getAttribute("value")).substr(1,v.length-2)+"]",focussable:false};if(s.prototype.hasFeature(apf.__MULTISELECT__)){g.caption="[text()]";g.eachvalue="[@value]";g.each="item";g.model="{apf.xmldb.getElementById('"+c.getAttribute(apf.xmldb.xmlIdTag)+"')}";}u=this.$editors[q]=new s(g);var o=apf.getBox(apf.getStyle(u.$ext,"margin"));if(o[1]||o[3]){u.setAttribute("width","100%+2-"+(o[1]+o[3]));}else{if(!o[3]){u.$ext.style.marginLeft="-1px";}}u.parentNode=this;u.$focusParent=this;u.setAttribute("focussable","true");}else{u=this.$editors[q];if(u.hasFeature(apf.__MULTISELECT__)){u.setAttribute("model","{apf.xmldb.getElementById('"+c.getAttribute(apf.xmldb.xmlIdTag)+"')}");}u.setAttribute("value","[{"+this.id+".root}::"+(v=c.getAttribute("value")).substr(1,v.length-2)+"]");u.setProperty("visible",true);t.appendChild(u.$ext);}}else{var m=j.call(this,this.xmlRoot);if(m.localName=="template"){}else{}}var d=t.childNodes;for(var n=0,k=d.length;n<k;n++){if(!d[n].host){d[n].style.display="none";}}this.$lastEditor=[u,t,c];};this.$draw=function(){this.$ext=this.$getExternal();this.$body=this.$getLayoutNode("main","body",this.$ext);this.$head=this.$getLayoutNode("main","head",this.$ext);this.$pointer=this.$getLayoutNode("main","pointer",this.$ext);if(this.$head.firstChild){this.$head.removeChild(this.$head.firstChild);}if(this.$body.firstChild){this.$body.removeChild(this.$body.firstChild);}var d=this.$widthdiff=this.$getOption("main","widthdiff")||0;this.$defaultwidth=this.$getOption("main","defaultwidth")||"100";this.$useiframe=apf.isIE&&(apf.isTrue(this.$getOption("main","iframe"))||this.iframe);var c=this;if(this.$useiframe&&!this.oIframe){var g=this.$body.className;this.oIframe=this.$body.appendChild(document.createElement(apf.isIE?"<iframe frameborder='0'></iframe>":"iframe"));this.oIframe.frameBorder=0;this.oWin=this.oIframe.contentWindow;this.oDoc=this.oWin.document;this.oDoc.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                <html xmlns="http://www.w3.org/1999/xhtml">                    <head><script>                        apf = {                            lookup : function(uid){                                return window.parent.apf.lookup(uid);                            },                            Init : {add:function(){},run:function(){}}                        };<\/script>                    </head>                    <body></body>                </html>');this.$body=this.oDoc.body;this.$body.className=g;this.oDoc.documentElement.className=this.$ext.className;apf.skins.loadCssInWindow(this.skinName,this.oWin,this.mediaPath,this.iconPath);if(apf.isIE){this.$setStyleClass(this.oDoc.documentElement,this.$baseCSSname+"Focus");}apf.convertIframe(this.oIframe,true);if(apf.getStyle(this.oDoc.documentElement,apf.isIE?"overflowY":"overflow-y")=="auto"){this.oIframe.onresize=function(){c.$head.style.marginRight=c.oDoc.documentElement.scrollHeight>c.oDoc.documentElement.offsetHeight?"16px":"0";};this.addEventListener("afterload",this.oIframe.onresize);this.addEventListener("xmlupdate",this.oIframe.onresize);}this.oDoc.documentElement.onmousedown=function(i){if(!i){i=c.oWin.event;}if((i.srcElement||i.target).tagName=="HTML"){apf.popup.forceHide();}};this.oDoc.documentElement.onscroll=function(){if(c.$isFixedGrid){c.$head.scrollLeft=c.oDoc.documentElement.scrollLeft;}};}else{if(apf.getStyle(this.$body,apf.isIE?"overflowY":"overflow-y")=="auto"){this.$resize=function(){c.$head.style.marginRight=c.$body.scrollHeight>c.$body.offsetHeight?"16px":"0";};apf.layout.setRules(this.$ext,this.$uniqueId+"_datagrid","var o = apf.all["+this.$uniqueId+"];                     if (o) o.$resize()");apf.layout.queue(this.$ext);this.addEventListener("afterload",this.$resize);this.addEventListener("xmlupdate",this.$resize);}this.$body.onmousedown=function(i){if(!i){i=event;}if((i.srcElement||i.target)==this){apf.popup.forceHide();}};this.$body.onscroll=function(){if(c.$isFixedGrid){c.$head.scrollLeft=c.$body.scrollLeft;}};}var c=this;this.$body.onmousedown=function(j){if(!j){j=event;}var i=j.srcElement||j.target;if(i==this){return;}if(i.tagName=="U"){c.$slideToggle(i);return;}while(i.host||(i.getAttribute(apf.xmldb.htmlIdTag)||"").indexOf("|")==-1){i=i.parentNode;if(i==this){return;}}c.select(i);};};this.$loadAml=function(c){this.$headings=[new apf.BindingColumnRule().$draw(this,"Property",this.$columns[0],"first"),new apf.BindingColumnRule().$draw(this,"Value",this.$columns[1])];};this.$destroy=function(){apf.popup.removeContent(this.$uniqueId);this.$ext.onclick=this.$body.onresize=null;apf.layout.removeRule(this.$body,"dg"+this.$uniqueId);apf.layout.activateRules(this.$body);};}).call(apf.propedit.prototype=new apf.DataBinding());apf.aml.setElement("propedit",apf.propedit);apf.aml.setElement("column",apf.BindingColumnRule);apf.aml.setElement("description",apf.BindingRule);apf.aml.setElement("color",apf.BindingRule);apf.smartbinding=function(b,a){this.$init(a||"smartbinding",apf.NODE_HIDDEN,b);this.$bindNodes={};};(function(){this.$supportedProperties=["bindings","actions","model"];this.$handlePropSet=function(g,c,b){switch(g){case"model":if(typeof c=="string"){c=apf.nameserver.get("model",c);}this.model=apf.nameserver.register("model",this.name,c);var a;for(var d in this.$bindNodes){a=this.$bindNodes[d];this.model.unregister(a);this.model.register(a,this.$modelXpath[a.getHost?a.getHost().$uniqueId:a.$uniqueId]||this.modelBaseXpath);}break;case"bindings":if(this.$bindings){this.remove(this.$bindings);}this.$bindings=typeof c=="object"?c:apf.nameserver.lookup("bindings",c);this.add(this.$bindings);break;case"actions":if(this.$actions){this.remove(this.$actions);}this.$actions=typeof c=="object"?c:apf.nameserver.lookup("actions",c);this.add(this.$actions);break;}this[g]=c;};this.add=function(b){for(var a in this.$bindNodes){b.register(this.$bindNodes[a]);}this["$"+b.localName]=b;};this.remove=function(b){for(var a in this.$bindNodes){b.unregister(this.$bindNodes[a]);}};this.register=function(a){this.$bindNodes[a.$uniqueId]=a;if(this.$bindings){this.$bindings.register(a);}if(this.$actions){this.$actions.register(a);}if(this.$model){this.$model.register(a);}};this.unregister=function(a){this.$bindNodes[a.$uniqueId]=null;delete this.$bindNodes[a.$uniqueId];if(this.$bindings){this.$bindings.unregister(a);}if(this.$actions){this.$actions.unregister(a);}if(this.$model){this.$model.unregister(a);}};this.load=function(a){new apf.model().register(this).load(a);};this.clear=function(a){};this.addEventListener("DOMNodeInsertedIntoDocument",function(a){if(this.parentNode.hasFeature(apf.__DATABINDING__)){this.register(this.parentNode);}});}).call(apf.smartbinding.prototype=new apf.AmlElement());apf.aml.setElement("smartbinding",apf.smartbinding);apf.method=function(b,a){this.$init(a||"method",apf.NODE_HIDDEN,b);this.async=true;this.caching=false;this["ignore-offline"]=false;};(function(){this.$parsePrio="002";this.$booleanProperties.async=true;this.$booleanProperties.caching=true;this.$booleanProperties["ignore-offline"]=true;this.$supportedProperties.push("name","receive","async","caching","ignore-offline","method-name","type","url");this.$propHandlers["ignore-offline"]=function(a){this.ignoreOffline=a;};this.$propHandlers["method-name"]=function(a){this.methodName=a;};this.addEventListener("DOMNodeInserted",function(a){if(this.parentNode.$addMethod){this.parentNode.$addMethod(this);}});this.addEventListener("DOMNodeRemoved",function(a){if(this.parentNode.$removeMethod){this.parentNode.$removeMethod(this);}});this.addEventListener("DOMNodeInsertedIntoDocument",function(a){if(this.parentNode.$addMethod){this.parentNode.$addMethod(this);}});}).call(apf.method.prototype=new apf.AmlElement());apf.aml.setElement("method",apf.method);apf.checkbox=function(b,a){this.$init(a||"checkbox",apf.NODE_VISIBLE,b);};(function(){this.implement(apf.DataAction);this.$notfromext=true;this.$focussable=true;this.checked=false;this.$values=[1,0];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(a!==null&&a.toString()==this.$values[0].toString()){apf.setStyleClass(this.$ext,this.$baseCSSname+"Checked");}else{apf.setStyleClass(this.$ext,"",[this.$baseCSSname+"Checked"]);}};this.$propHandlers.checked=function(a){if(!this.$values){if(this.getAttribute("values")){this.$propHandler.values.call(this,this.getAttribute("values"));}else{this.$values=[false,true];}}this.setProperty("value",this.$values[a?0:1]);};this.$propHandlers.label=function(b){if(!this.$ext){return;}var a=this.$getLayoutNode("main","label",this.$ext);if(a.nodeType==1){a.innerHTML=b;}else{a.nodeValue=b;}};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,false,true);};this.getValue=function(){return this.xmlRoot?this.$values[this.checked?0:1]:this.value;};this.check=function(){this.setProperty("value",this.$values[0],false,true);};this.uncheck=function(){this.setProperty("value",this.$values[1],false,true);};this.addEventListener("$clear",function(){this.setProperty("value",this.$values[1]);});this.$enable=function(){if(this.$input){this.$input.disabled=false;}this.$doBgSwitch(1);};this.$disable=function(){if(this.$input){this.$input.disabled=true;}this.$doBgSwitch(4);};this.$setState=function(a,c,b){this.$doBgSwitch(this.states[a]);this.$setStyleClass(this.$ext,(a!="Out"?this.$baseCSSname+a:""),[this.$baseCSSname+"Down",this.$baseCSSname+"Over"]);this.state=a;this.dispatchEvent(b,c);};this.$clickHandler=function(){this.change(this.$values[(!this.checked)?0:1]);if(this.validate){this.validate(true);}return true;};this.$draw=function(){this.$ext=this.$getExternal();this.$input=this.$getLayoutNode("main","input",this.$ext);this.$setupEvents();};this.$childProperty="label";this.addEventListener("$skinchange",function(){if(this.label){this.$propHandlers.label.call(this,this.label);}});}).call(apf.checkbox.prototype=new apf.BaseButton());apf.aml.setElement("checkbox",apf.checkbox);apf.datagrid=function(b,a){this.$init(a||"datagrid",apf.NODE_VISIBLE,b);this.$headings=[],this.$cssRules=[];this.$lastOpened={};this.$editors={};this.$dynCssClasses=[];};(function(){var b=1<<1,d=1<<2,g=1<<3,i=1<<4,c=this.$treeState;this.bufferselect=false;this.$useTable=false;this.$focussable=true;this.$isWindowContainer=-1;this.$widthdiff=0;this.$defaultwidth=0;this.$useiframe=0;this.$needsDepth=true;this.$renameStartCollapse=false;this.$booleanProperties.iframe=true;function a(m,n){for(var l=0;l<m.length;l++){if(!m[l][1]){continue;}if(apf.isIE){(n||window).document.styleSheets[0].addRule(m[l][0],m[l][1]);}else{(n||window).document.styleSheets[0].insertRule(m[l][0]+" {"+m[l][1]+"}",0);}}}function k(){var l=(this.current||this.$selected),m=this.$container;m.scrollTop=(l.offsetTop)-21;}this.$focus=function(){if(!this.$ext||(apf.isIE&&this.$useiframe&&this.cssfix)){return;}this.$setStyleClass(this.$ext,this.$baseCSSname+"Focus");if(this.oDoc){this.$setStyleClass(this.oDoc.documentElement,this.$baseCSSname+"Focus");}};this.$blur=function(){if(this.renaming){this.stopRename(null,true);}if(!this.$ext||(apf.isIE&&this.$useiframe&&this.cssfix)){return;}this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Focus"]);if(this.oDoc){this.$setStyleClass(this.oDoc.documentElement,"",[this.$baseCSSname+"Focus"]);}j.call(this);};this.addEventListener("bindingsload",this.$loaddatabinding=function(s){var u=s.bindings.column;if(!u||!u.length){return;}this.$headings=u;var q=0,r=false;for(var o,n=0,m=u.length;n<m;n++){o=u[n];if(!o.$isPercentage){q+=parseFloat(o.$width)||0;}else{r=true;}}if(!r){this.$isFixedGrid=true;this.$setStyleClass(this.$ext,"fixed");if(this.$useiframe){this.$setStyleClass(this.oDoc.documentElement,"fixed");}}else{}if(q>0&&!this.$isFixedGrid){var t=q;this.$cssRules.push(["."+this.$baseCSSname+" .row"+this.$uniqueId,"padding-right:"+t+"px;margin-right:-"+t+"px"]);this.$container.style.paddingRight=this.$head.style.paddingRight=t+"px";}this.$fixed=q;this.$first=0;this.$withContainer=s.bindings.description?true:false;a(this.$cssRules,window);if(this.$useiframe){a(this.$cssRules,this.oWin);}});this.$initNode=function(w,m,u,q){this.$getNewContext("item");var n=this.$getLayoutNode("item");n.setAttribute("id",u);n.setAttribute("class",n.getAttribute("class")+" "+c[m]+" item"+this.$uniqueId);this.$setStyleClass(this.$getLayoutNode("item","container"),c[m]);n.setAttribute("ondblclick","var o = apf.lookup("+this.$uniqueId+");o.choose(null, true);"+(this.$withContainer?"o.slideToggle(this, null, true);":"")+(this.celledit&&!this.namevalue?"o.startRename(null, null, true);":""));if(this.hasFeature(apf.__DRAGDROP__)){n.setAttribute("onmouseout","this.hasPassedDown = false;");n.setAttribute("onmousedown","var o = apf.lookup("+this.$uniqueId+");                var xmlNode = apf.xmldb.findXmlNode(this);                 var isSelected = o.isSelected(xmlNode);                 this.hasPassedDown = true;                 if (!o.hasFeature(apf.__DRAGDROP__) || !isSelected && !event.ctrlKey)                     o.select(this, event.ctrlKey, event.shiftKey, -1);"+(this.cellselect||this.namevalue?"o.selectCell(event, this, isSelected);":""));n.setAttribute("onmouseup","if (!this.hasPassedDown) return;                var o = apf.lookup("+this.$uniqueId+");                 var xmlNode = apf.xmldb.findXmlNode(this);                 var isSelected = o.isSelected(xmlNode);                 if (o.hasFeature(apf.__DRAGDROP__))                     o.select(this, event.ctrlKey, event.shiftKey, -1);");}else{n.setAttribute("onmousedown","var o = apf.lookup("+this.$uniqueId+");                var wasSelected = o.$selected == this;                o.select(this, event.ctrlKey, event.shiftKey, -1);"+(this.cellselect||this.namevalue?"o.selectCell(event, this, wasSelected);":""));}for(var x,s,r=0;r<this.$headings.length;r++){s=this.$headings[r];if(s.tree){this.$getNewContext("treecell");x=this.$getLayoutNode("treecell");var l=this.$getLayoutNode("treecell","openclose");l.setAttribute("style","margin-left:"+(((q||0))*15+4)+"px;");l.setAttribute("onmousedown","var o = apf.lookup("+this.$uniqueId+");                    o.slideToggle(this, null, null, true);                    apf.cancelBubble(event, o);");l.setAttribute("ondblclick","event.cancelBubble = true");}else{this.$getNewContext("cell");x=this.$getLayoutNode("cell");}apf.setStyleClass(x,s.$className);if(s.css){apf.setStyleClass(x,(apf.lm.compile(s.css))(w));}if(s.icon){var o=this.$getLayoutNode(s.tree?"treecell":"cell","caption",n.appendChild(x));(o.nodeType==1&&o||o.parentNode).setAttribute("style","padding-left:19px;background:url("+apf.getAbsolutePath(this.iconPath,((s.cicon||s.$compile("icon",{nostring:true}))(w)||""))+") no-repeat 0 0;");}if(s.value){apf.setNodeValue(this.$getLayoutNode(s.tree?"treecell":"cell","caption",n.appendChild(x)),(s.cvalue2||s.$compile("value",{nostring:true}))(w)||"");}}if(this.$bindings&&this.$bindings.color){var t=this.$getDataNode("color",w);this.$setStyleClass(n,t?"highlight":null,t?["highlight"]:null);}var y=this.$applyBindRule("css",w);if(y){this.$setStyleClass(n,y);if(y){this.$dynCssClasses.push(y);}}return n;};this.$updateNode=function(u,t){if(!t){return;}var l=this.$head.childNodes,n=t.childNodes,w,m;if(!this.namevalue&&this.$curBtn){m=this.$curBtn.parentNode;}var q,r,o=0;q=n[0];while(q){if(q.nodeType!=1){q=q.nextSibling;continue;}r=apf.all[l[o].getAttribute("hid")];w=this.$getLayoutNode(r.tree?"treecell":"cell","caption",q)||q;if(r.css){apf.setStyleClass(w,(apf.lm.compile(r.css))(u));}if(r.tree){}if(r.value){w.innerHTML=(r.cvalue2||r.$compile("value",{nostring:true}))(u)||"";}if(r.icon){(w.nodeType==1&&w||w.parentNode).style.backgroundImage="url("+apf.getAbsolutePath(this.iconPath,((r.cicon||r.$compile("icon",{nostring:true}))(u)||""))+")";}o++;q=q.nextSibling;}if(this.$bindings&&this.$bindings.color){var s=this.$getDataNode("color",u);this.$setStyleClass(t,s?"highlight":null,s?["highlight"]:null);}var x=this.$applyBindRule("css",u);if(x||this.$dynCssClasses.length){this.$setStyleClass(t,x,this.$dynCssClasses);if(x&&!this.$dynCssClasses.contains(x)){this.$dynCssClasses.push(x);}}};this.$dblclick=function(t){var q=this,y,m;while(!(y=t.getAttribute(apf.xmldb.htmlIdTag))||y.indexOf("|")==-1){t=(m=t).parentNode;}var E,n=m.className.match(/(col\d+)/)[1];for(var D=0;D<this.$headings.length;D++){if(this.$headings[D].$className==n){E=this.$headings[D];break;}}if(!E.editor){return;}var o=apf.xmldb.getNode(t);var C=m;var x,r=E.editor;var s=apf.lm.compile(r,{xpathmode:2});var A=C.childNodes;for(var D=0,B=A.length;D<B;D++){if(!A[D].host){A[D].style.display="none";}}if(s.type==2){if(!this.$editors[r]){var z=apf.namespaces[apf.ns.aml].elements[r];var F={htmlNode:C,width:"100%-3",style:"position:relative;z-index:10000",value:"[{"+this.id+".selected}::"+(v=E.value).substr(1,v.length-2)+"]",focussable:false};x=this.$editors[r]=new z(F);var u=apf.getBox(apf.getStyle(x.$ext,"margin"));if(u[1]||u[3]){x.setAttribute("width","100%+2-"+(u[1]+u[3]));}x.addEventListener("blur",function(){j.call(q);});x.parentNode=this;x.realtime=false;x.$focusParent=this;x.setAttribute("focussable","true");x.addEventListener("beforechange",function(l){return q.dispatchEvent("beforechange",l);});x.addEventListener("afterchange",function(l){return q.dispatchEvent("afterchange",l);});x.addEventListener("keydown",function(l){if(l.keyCode==13){j.call(q);q.$focus();}else{if(l.keyCode==27){x.removeAttribute("value");j.call(q);}}});}else{x=this.$editors[r];x.setAttribute("value","[{"+this.id+".selected}::"+(v=E.value).substr(1,v.length-2)+"]");x.setProperty("visible",true);C.appendChild(x.$ext);}}else{var w=s.call(this,this.xmlRoot);if(w.localName=="template"){}else{}}if(x.localName=="textbox"){x.select();}x.focus();x.$focus();this.$setStyleClass(t,"editing");this.$lastEditor=[x,C,o,t,this.getActionTracker().undolength];};this.addEventListener("mousedown",function(l){if(this.$lastEditor&&!apf.isChildOf(this.$lastEditor[1],l.htmlEvent.srcElement||l.htmlEvent.target,true)){j.call(this);}});this.addEventListener("beforeselect",function j(q){if(this.$lastEditor){this.$lastEditor[0].setProperty("visible",false);if(!this.$lastEditor){return;}var n=this.$lastEditor[1].childNodes;for(var o=0,m=n.length;o<m;o++){if(!n[o].host){n[o].style.display="";}}this.$setStyleClass(this.$lastEditor[3],"",["editing"]);this.$lastEditor=null;this.$focus();}});this.getColumn=function(l){return this.$headings[l||this.$lastcol||0];};this.resizeColumn=function(n,m){var l=this.$headings[n];l.resize(m);};this.hideColumn=function(m){var l=this.$headings[m];l.hide();};this.showColumn=function(m){var l=this.$headings[m];l.show();};this.sortColumn=function(l){var m=this.$headings[nr];m.sort();};this.moveColumn=function(n,m){var l=this.$headings[nr];l.move(m);};this.$draw=function(){this.$drawBase();var l=this;this.$ext.onmousedown=function(q){l.dispatchEvent("mousedown",{htmlEvent:q||event});};this.$head=this.$getLayoutNode("main","head",this.$ext);this.$pointer=this.$getLayoutNode("main","pointer",this.$ext);if(this.$head.firstChild){this.$head.removeChild(this.$head.firstChild);}if(this.$container.firstChild){this.$container.removeChild(this.$container.firstChild);}var n=this.$widthdiff=this.$getOption("main","widthdiff")||0;this.$defaultwidth=this.$getOption("main","defaultwidth")||"100";this.$useiframe=apf.isIE&&(apf.isTrue(this.$getOption("main","iframe"))||this.iframe);if(this.$useiframe&&!this.oIframe){var o=this.$container.className;this.oIframe=this.$container.appendChild(document.createElement(apf.isIE?"<iframe frameborder='0'></iframe>":"iframe"));this.oIframe.frameBorder=0;this.oWin=this.oIframe.contentWindow;this.oDoc=this.oWin.document;this.oDoc.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                <html xmlns="http://www.w3.org/1999/xhtml">                    <head><script>                        apf = {                            lookup : function(uid){                                return window.parent.apf.lookup(uid);                            },                            Init : {add:function(){},run:function(){}}                        };<\/script>                    </head>                    <body></body>                </html>');this.$container=this.oDoc.body;this.$container.className=o;this.oDoc.documentElement.className=this.$ext.className;apf.skins.loadCssInWindow(this.skinName,this.oWin,this.mediaPath,this.iconPath);if(apf.isIE){this.$setStyleClass(this.oDoc.documentElement,this.$baseCSSname+"Focus");}apf.convertIframe(this.oIframe,true);this.oDoc.body.insertAdjacentHTML("beforeend",this.$txt.outerHTML);var m=this.$txt;m.refCount--;this.$txt=this.oDoc.body.lastChild;this.$txt.parentNode.removeChild(this.$txt);this.$txt.select=m.select;this.$txt.ondblclick=this.$txt.onselectstart=this.$txt.onmouseover=this.$txt.onmouseout=this.$txt.oncontextmenu=this.$txt.onmousedown=function(q){(q||(l.oWin||window).event).cancelBubble=true;};this.$txt.onfocus=m.onfocus;this.$txt.onblur=m.onblur;this.$txt.onkeyup=m.onkeyup;this.$txt.refCount=1;if(apf.getStyle(this.oDoc.documentElement,apf.isIE?"overflowY":"overflow-y")=="auto"){this.oIframe.onresize=function(){l.$head.style.marginRight=l.oDoc.documentElement.scrollHeight>l.oDoc.documentElement.offsetHeight?"16px":"0";};this.addEventListener("afterload",this.oIframe.onresize);this.addEventListener("xmlupdate",this.oIframe.onresize);}this.oDoc.documentElement.onscroll=function(){if(l.$isFixedGrid){l.$head.scrollLeft=l.oDoc.documentElement.scrollLeft;}};}else{if(apf.getStyle(this.$container,apf.isIE?"overflowY":"overflow-y")=="auto"){this.$resize=function(){l.$head.style.marginRight=l.$container.scrollHeight>l.$container.offsetHeight?"16px":"0";};apf.layout.setRules(this.$ext,this.$uniqueId+"_datagrid","var o = apf.all["+this.$uniqueId+"];                     if (o) o.$resize()");apf.layout.queue(this.$ext);this.addEventListener("afterload",this.$resize);this.addEventListener("xmlupdate",this.$resize);}this.$container.onscroll=function(){if(l.$isFixedGrid){l.$head.scrollLeft=l.$container.scrollLeft;}};}this.$container.ondblclick=function(q){if(!q){q=event;}l.$dblclick(q.srcElement||q.target);};};this.$destroy=function(){this.$ext.onclick=this.$container.onresize=null;apf.layout.removeRule(this.$container,"dg"+this.$uniqueId);apf.layout.activateRules(this.$container);};}).call(apf.datagrid.prototype=new apf.BaseTree());apf.aml.setElement("datagrid",apf.datagrid);apf.aml.setElement("description",apf.BindingRule);apf.aml.setElement("color",apf.BindingRule);apf.aml.setElement("contents",apf.BindingRule);apf.errorbox=function(b,a){this.$init(a||"errorbox",apf.NODE_VISIBLE,b);};(function(){this.$positioning="basic";this.display=function(c){this.host=c;var b=c.validityState.$errorHtml||c.$ext;document.body.appendChild(this.$ext);var a=(parseFloat(c.$getOption&&c.$getOption("main","erroffsetx")||0)),d=(parseFloat(c.$getOption&&c.$getOption("main","erroffsety")||0));this.show();apf.popup.show(this.$uniqueId,{x:a,y:d,animate:false,ref:b});this.$setStyleClass(this.$ext,a+this.$ext.offsetWidth>this.$ext.offsetParent.offsetWidth?"rightbox":"leftbox",["leftbox","rightbox"]);};this.setMessage=function(a){if(a&&a.indexOf(";")>-1){a=a.split(";");a="<strong>"+a.shift()+"</strong>"+a.join(";");}this.$int.innerHTML=a||"";};this.$draw=function(){this.$ext=this.$getExternal();this.$int=this.$getLayoutNode("main","container",this.$ext);this.oClose=this.$getLayoutNode("main","close",this.$ext);if(this.oClose){var a=this;this.oClose.onclick=function(){a.hide();if(apf.document.activeElement){apf.document.activeElement.focus(true,{mouse:true});}};}this.$ext.onmousedown=function(b){(b||event).cancelBubble=true;if(apf.hasFocusBug){apf.window.$focusfix();}};apf.popup.setContent(this.$uniqueId,this.$ext,"",null,null);};this.$loadAml=function(a){if(!apf.isTrue(this.getAttribute("visible"))){this.hide();}};this.$destroy=function(){if(this.oClose){this.oClose.onclick=null;}this.$ext.onmousedown=null;apf.popup.removeContent(this.$uniqueId);};}).call(apf.errorbox.prototype=new apf.Presentation());apf.aml.setElement("errorbox",apf.errorbox);apf.BindingColorRule=function(b,a){this.$init(a,apf.NODE_HIDDEN,b);};(function(){this.addEventListener("DOMNodeInsertedIntoDocument",function(b){if(this.$bindings&&this.$bindings.color){var a=this.$bindings.color[0];apf.setStyleRule("."+this.$baseCSSname+(apf.isIE?" .records .highlight SPAN":" .records .highlight span"),"color",a.getAttribute("text"),null,this.oWin);apf.setStyleRule("."+this.$baseCSSname+(apf.isIE?" .records .highlight SPAN":" .records .highlight span"),"backgroundColor",a.getAttribute("row"),null,this.oWin);apf.setStyleRule("."+this.$baseCSSname+(apf.isIE?" .records .highlight":" .records .highlight"),"backgroundColor",a.getAttribute("row"),null,this.oWin);}apf.importStylesheet([["."+this.className,"width:"+this.$width+(this.$isPercentage?"%;":"px;")+"text-align:"+h.align],["."+this.className,"width:"+this.$width+(this.$isPercentage?"%;":"px;")+"text-align:"+h.align]]);this.$draw();});}).call(apf.BindingColorRule.prototype=new apf.BindingRule());apf.aml.setElement("color",apf.BindingColorRule);apf.validation=function(b,a){this.$init(a||"validation",apf.NODE_HIDDEN,b);};(function(){this.$rules=[];var a={};this.register=function(b){if(b.tagName!="model"){return;}a[b.$uniqueId]=b;b.$validation=this;};this.unregister=function(){a[amlNode.$uniqueId]=null;delete a[amlNode.$uniqueId];amlNode.$validation=null;};this.getRule=function(d){var g=apf.xmldb.nodeConnect(apf.xmldb.getXmlDocId(d),d.nodeType==1?d:d.parentNode);for(var c=0,b=this.$rules.length;c<b;c++){if(d.ownerDocument.selectSingleNode("(.//"+this.$rules[c][0].split("|").join("|.//")+")[@"+apf.xmldb.xmlIdTag+"='"+g+"']")){return this.$rules[c][1];}}};this.validate=function(c,d,b){var g=this.getRule(c);if(!g){return b;}return(g.isValid||(g.isValid=apf.validator.compile(g)))(apf.queryValue(c),d,b);};this.addEventListener("DOMNodeInsertedIntoDocument",function(m){var q=this.$aml;var o,n,c,b=q.childNodes;for(var k=0,d=b.length;k<d;k++){if((c=b[k]).nodeType!=1){continue;}this.$rules.push([c.getAttribute("match"),(o={})]);n=c.attributes;for(var g=0;g<n.length;g++){o[n[g].nodeName]=n[g].nodeValue;}o.node=c;}this.register(this.parentNode);});}).call(apf.validation.prototype=new apf.AmlElement());apf.aml.setElement("validation",apf.validation);apf.xforms=function(b,a){this.$init(a||"xforms",apf.NODE_VISIBLE,b);};apf.submitform=function(b,a){this.$init(a||"submitform",apf.NODE_VISIBLE,b);};(function(){this.implement(apf.DataAction,apf.BaseTab,apf.ValidationGroup);this.$focussable=false;this.elements={};var buttons={next:[],previous:[],submit:[],follow:[]};this.$focussable=false;this.inputs=[];this.errorEl={};this.cq={};this.reqs=[];this.conditionDeps={};this.depends={};this.loadValueDeps={};this.loadValues={};this.listsHeldBack={};this.nextHeldBack={};this.activepagenr=0;this.zCount=1000000;this.clear=function(){};this.showLoader=function(checked,nr){if(checked){var page=nr?this.getPage(nr):this.getNextPage();if(!page||page.$rendered){return;}}if(this.loadState){this.loadState.style.display="block";var message=this.getPage().getAttribute("loadmessage");if(message){(apf.queryNode("div[@class='msg']",this.loadState)||this.loadState).innerHTML=message;}}};this.hideLoader=function(){if(this.loadState){this.loadState.style.display="none";}};var nextpagenr;this.getNextPage=function(){var nextpage,pageNr=this.activepagenr;do{nextpage=this.getPage(++pageNr);}while(nextpage&&!this.testCondition(nextpage.condition));nextpagenr=pageNr;return nextpage;};this.next=function(no_error){if(!this.testing&&!this.isValid(null,null,this.getPage())){this.hideLoader();return;}this.set(this.activepagenr+1);for(var prop in buttons){if(!prop.match(/next|previous|submit/)){continue;}this.updateButtons(prop);}nextpagenr=null;};this.previous=function(){this.set(this.activepagenr-1);for(var prop in buttons){if(!prop.match(/next|previous|submit/)){continue;}this.updateButtons(prop);}};this.$enable=function(){forbuttons("enable");};this.$disable=function(){forbuttons("disable");};function forbuttons(feat){var arr=["next","previous","submit","follow"];for(var k=0;k<arr.length;k++){for(var i=0;i<buttons[arr[k]].length;i++){buttons[arr[k]][i][feat]();}}}this.processValueChange=function(oFormEl){if(this.conditionDeps[oFormEl.name]){var c=this.conditionDeps[oFormEl.name];for(var i=0;i<c.length;i++){if(this.testCondition(c[i].condition)){c[i].setActive();}else{c[i].setInactive();}}}for(var prop in buttons){if(!prop.match(/next|previous|submit/)){continue;}this.updateButtons(prop);}this.setLoadValues(oFormEl.name);};this.addInput=function(objEl){var name=objEl.name;objEl.$validgroup=this;if(this.elements[name]&&!this.elements[name].length){this.elements[name]=[this.elements[name]];this.elements[name].getValue=new Function("for (var i = 0; i < this.length; i++)                     if (this[i].$int.checked)                         return this[i].getValue();");}if(this.elements[name]){this.elements[name].push(objEl);}else{this.elements[name]=objEl;}if(this.cq[name]){for(var i=0;i<this.cq[name].length;i++){this.cq[name][i][1].call(this.cq[name][i][0],objEl);objEl.labelEl=this.cq[name][i][0];}}if(objEl.getAttribute("dependson")){var o=self[objEl.getAttribute("dependson")];if(!this.depends[o.name]){this.depends[o.name]=[];}this.depends[o.name].push(objEl);objEl.setInactive();}if(objEl.nodeFunc==apf.NODE_VISIBLE){objEl.setZIndex(--this.zCount);}if(this.listsHeldBack[name]){var ld=this.listsHeldBack[name];this.loadLists(ld[0],ld[1],ld[2]);this.listsHeldBack[name]=null;}if(this.nQuest&&objEl.getAttribute("checknext")=="true"){if(this.lastEl){this.lastEl.nextEl=objEl;objEl.prevEl=this.lastEl;}this.lastEl=objEl;if(objEl.prevEl&&objEl.getAttribute("show")!="true"&&!this.nextHeldBack[name]&&!objHasValue(objEl)){objEl.setInactive(true);}else{if(this.condActiveCheck[objEl.name]){this.condActiveCheck[objEl.name].setActive();}}if(this.condActiveCheck[objEl.name]){objEl.container=this.condActiveCheck[objEl.name];function activateHandler(){if(this.form.hasActiveElement(this.container)){this.container.setActive();}else{this.container.setInactive();}}objEl.addEventListener("activate",activateHandler);objEl.addEventListener("deactivate",activateHandler);}}};this.hasActiveElement=function(objEl){var nodes=objEl.$aml.getElementsByTagName("*");for(var i=0;i<nodes.length;i++){if(!nodes[i].getAttribute("id")){continue;}var comp=this.elements[nodes[i].getAttribute("id")];if(comp&&comp.form==this&&comp.isActive){return true;}}return false;};this.condActiveCheck={};this.getButtons=function(action){return buttons[action];};this.registerButton=function(action,oBtn){buttons[action].push(oBtn);if(oBtn.condition){this.parseCondition(oBtn,oBtn.condition);}this.updateButtons(action,oBtn);if(action=="follow"){return;}var amlNode=this;oBtn.onclick=function(){amlNode.showLoader(true);$setTimeout(function(){amlNode[action]();},10);};};this.updateButtons=function(action,singleBtn){return false;if(!buttons[action]){return false;}var result=true;if(action=="previous"&&this.activepagenr==0){result=false;}else{if(!this.testing&&action=="next"&&!this.isValid()){result=false;}else{if(action=="next"){var cp=this.activepagenr;do{var nextpage=this.getPage(++cp);}while(nextpage&&!this.testCondition(nextpage.condition));if(!nextpage){result=false;}}}}if(this.testing){return true;}var buttons=singleBtn?[singleBtn]:buttons[action];for(var i=0;i<buttons.length;i++){if(result&&(!buttons[i].condition||this.testCondition(buttons[i].condition))){buttons[i].setActive();}else{buttons[i].setInactive();}}return true;};this.setLoadValues=function(item,clearElements,noload){var lvDep=this.loadValueDeps[item];if(!lvDep){return;}for(var i=0;i<lvDep.length;i++){try{if(!eval(lvDep[i][1])){throw new Error();}}catch(e){if(clearElements){var oEl=self[lvDep[i][0].getAttribute("element")];if(oEl){this.clearNextQuestionDepencies(oEl,true);}if(lvDep[i][0].tagName=="LoadValue"){this.dispatchEvent("clearloadvalue",lvDep[i][0]);}}continue;}if(noload){continue;}if(lvDep[i][0].getAttribute("runonrequest")!="true"){this.processLoadRule(lvDep[i][0],lvDep[i][2],lvDep[i]);}else{if(self[lvDep[i][0].getAttribute("element")]){self[lvDep[i][0].getAttribute("element")].clear();}}}};this.processLoadRule=function(xmlCommNode,isList,data){if(!apf.teleport.hasLoadRule(xmlCommNode)){return;}this.dispatchEvent(isList?"beforeloadlist":"beforeloadvalue");var nodes=xmlCommNode.childNodes;if(nodes.length){var arr,arg=xmlCommNode.getAttribute(apf.teleport.lastRuleFound.args);arg=arg?arg.split(";"):[];if(xmlCommNode.getAttribute("argarray")){arr=[];}for(var j=0;j<nodes.length;j++){if(nodes[j].nodeType!=1){continue;}if(nodes[j].getAttribute("argtype").match(/fixed|param|nocheck/)){var el=self[nodes[j].getAttribute("element")];var xpath=el.getMainBindXpath();var xNode=apf.createNodeFromXpath(this.xmlRoot,xpath);var nType=xNode.nodeType;(arr||arg)[nodes[j].getAttribute("argnr")||j]="xpath:"+xpath+(nType==1?"/text()":"");}else{if(nodes[j].getAttribute("argtype")=="xpath"){(arr||arg)[nodes[j].getAttribute("argnr")||j]="xpath:"+nodes[j].getAttribute("select");}}}if(xmlCommNode.getAttribute("argarray")){arg[xmlCommNode.getAttribute("argarray")]="("+arr.join(",")+")";}xmlCommNode.setAttribute(apf.teleport.lastRuleFound.args,arg.join(";"));}var jNode=self[xmlCommNode.getAttribute("element")];if(jNode&&jNode.nodeFunc==apf.NODE_VISIBLE){jNode.$setStyleClass(jNode.$ext,"loading",["loaded"]);}apf.teleport.callMethodFromNode(xmlCommNode,this.xmlRoot,Function("data","state","extra","apf.lookup("+this.$uniqueId+")."+(isList?"loadLists":"loadValues")+"(data, state, extra)"),null,data);};this.registerCondition=function(objEl,strCondition,no_parse){if(!no_parse){this.parseCondition(objEl,strCondition);}var forceActive=false;if(objEl.onlyWhenActive){var nodes=objEl.$aml.getElementsByTagName("*");for(var i=0;i<nodes.length;i++){if(!nodes[i].getAttribute("id")){continue;}if(this.nextHeldBack[nodes[i].getAttribute("id")]){forceActive=true;}else{if(nodes[i].getAttribute("ref")&&this.xmlRoot&&apf.queryValue(this.xmlRoot.selectSingleNode(nodes[i].getAttribute("ref")))!=""){forceActive=true;nodes[i].setAttribute("show","true");}}this.condActiveCheck[nodes[i].getAttribute("id")]=objEl;}}if(forceActive||this.testCondition(objEl.condition)&&(!objEl.onlyWhenActive||this.hasActiveElement(objEl,true))){objEl.setActive();}else{objEl.setInactive();}var matches=!no_parse?strCondition.match(/(\W|^)(\w+)(?:\=|\!\=)/g):strCondition.match(/(\b|^)([\w\.]+)/g);if(!matches){return;}for(var i=0;i<matches.length;i++){if(!no_parse){var m=matches[i].replace(/(?:\=|\!\=)$/,"").replace(/(^\s+|\s+$)/g,"");}else{var m=matches[i].split(".");if(m.length<2){continue;}m=m[0];}if(!this.conditionDeps[m]){this.conditionDeps[m]=Array();}this.conditionDeps[m].push(objEl);}};this.testCondition=function(strCondition){try{return eval(strCondition);}catch(e){return false;}};this.loadValues=function(data,state,extra){if(state!=apf.SUCCESS){if(extra.retries<apf.maxHttpRetries){return extra.tpModule.retry(extra.id);}else{throw new Error(apf.formatErrorString(1010,this,"LoadVaLue","Could not load values with LoadValue query :\n\n"+extra.message));}}if(extra.userdata[0].getAttribute("returntype")=="array"){for(var i=0;i<data.length;i++){var pnode=this.xmlRoot.selectSingleNode("//"+data[i][0]);apf.xmldb.setTextNode(pnode,data[i][1]||"");}}else{if(typeof data!="object"){data=apf.getXmlDom(data).documentElement;}var nodes=data.childNodes;var strUnique=extra.userdata[0].getAttribute("unique");for(var i=nodes.length-1;i>=0;i--){var xmlNode=nodes[i];var unique=strUnique?xmlNode.selectSingleNode(strUnique):false;var node=unique?this.xmlRoot.selectSingleNode("node()["+strUnique+" = '"+unique.nodeValue+"']"):null;if(node){apf.xmldb.copyConnections(node,xmlNode);apf.xmldb.notifyListeners(xmlNode);var valueNode=xmlNode.selectSingleNode("value");if(valueNode){apf.xmldb.copyConnections(node.selectSingleNode("value"),valueNode);apf.xmldb.notifyListeners(valueNode);}}this.xmlRoot.insertBefore(xmlNode,node);if(node){this.xmlRoot.removeChild(node);}apf.xmldb.applyChanges("attribute",xmlNode);}}this.dispatchEvent("afterloadvalue");};this.loadLists=function(data,state,extra){if(state!=apf.SUCCESS){if(extra.retries<apf.maxHttpRetries){return extra.tpModule.retry(extra.id);}else{throw new Error(apf.formatErrorString(1011,this,"Load List","Could not load data with LoadList query :\n\n"+extra.message));}}if(!self[extra.userdata[0].getAttribute("element")]){return this.listsHeldBack[extra.userdata[0].getAttribute("element")]=[data,state,extra];}var jNode=self[extra.userdata[0].getAttribute("element")];if(jNode&&jNode.nodeFunc==apf.NODE_VISIBLE){jNode.$setStyleClass(jNode.$ext,"loaded",["loading"]);$setTimeout("var jNode = apf.lookup("+jNode.$uniqueId+");                jNode.$setStyleClass(jNode.$ext, '', ['loading', 'loaded']);",500);}if(extra.userdata[0].getAttribute("clearonload")=="true"){jNode.clearSelection();this.clearNextQuestionDepencies(jNode,true);}jNode.load(data);this.dispatchEvent("afterloadlist");};this.reset=function(){var name,el;for(name in this.elements){el=this.elements[name];if(el.length){throw new Error(apf.formatErrorString(this,"clearing form","Found controls without a name or with a name that isn't unique. Please give all elements of your submitform an id: '"+name+"'"));}el.clearError();if(this.errorEl[name]){this.errorEl[name].hide();}el.clear();}};this.$xmlUpdate=function(action,xmlNode,listenNode,UndoObj){this.dispatchEvent("xmlupdate");};this.smartBinding={};this.$load=function(XMLRoot,id){apf.xmldb.addNodeListener(XMLRoot,this);};function objHasValue(objEl){var oCheck=objEl;if(!oCheck){return false;}return oCheck.$applyBindRule(oCheck.$mainBind,oCheck.xmlRoot,null,true);}function onafterload(){for(var name in this.elements){if(apf.isWebkit&&(!this.elements[name]||!this.elements[name].$amlLoaders)){continue;}if(this.elements[name].length){throw new Error(apf.formatErrorString(1012,this,"clearing form","Found controls without a name or with a name that isn't unique("+name+"). Please give all elements of your submitform an id: '"+name+"'"));}this.elements[name].clearError();if(this.errorEl[name]){this.errorEl[name].hide();}}if(this.nQuest){for(name in this.elements){var objEl=this.elements[name];if(objEl.getAttribute("checknext")=="true"){if(objHasValue(objEl)){objEl.setActive();if(this.condActiveCheck[name]){this.condActiveCheck[name].setActive();}}else{objEl.setInactive(true);}}else{if(objEl.tagName=="Radiogroup"&&objEl.current){objEl.current.uncheck();}}}}if(this.nQuest&&this.xmlRoot.childNodes.length>0){var element=this.nQuest.getAttribute("final"),amlNode=self[element].$aml;if(amlNode&&!apf.getBoundValue(amlNode,this.xmlRoot)){var fNextQNode=apf.xmldb.selectSingleNode(".//node()[@checknext='true']",this.$aml);if(!fNextQNode){return;}self[fNextQNode.getAttribute("id")].dispatchEvent("afterchange");}}}this.addEventListener("afterload",onafterload);this.addEventListener("afterinsert",onafterload);this.addEventListener("beforeload",function(){if(!this.smartBinding||!this.smartBinding.actions){return;}var nodes=this.smartBinding.actions.LoadList;if(nodes){for(var objEl,i=0;i<nodes.length;i++){if(!nodes[i].getAttribute("element")||!(objEl=this.elements[nodes[i].getAttribute("element")])){continue;}objEl.clear();}}var nodes=this.smartBinding.actions.NextQuestion;if(nodes){for(var objEl,i=0;i<nodes.length;i++){if(!nodes[i].getAttribute("final")||!(objEl=this.elements[nodes[i].getAttribute("element")])){continue;}objEl.clear();}}});this.implement(apf.GuiElement);this.addOther=function(tagName,oAml){if(tagName=="loadstate"){var htmlNode=apf.getFirstElement(oAml);this.loadState=apf.insertHtmlNode(htmlNode,this.$int);this.loadState.style.display="none";}};this.$draw=function(){this.oPages=this.$ext=this.$getExternal();this.$int=this.$getLayoutNode("main","container",this.$ext);this.$ext.host=this;};this.submit=function(submissionId){if(!this.isValid()){return;}if(!this.$model){return;}var type=this.method=="urlencoded-post"?"native":(this.type||"xml");var instruction=submissionId||this.action?((this.method.match(/post/)?"url.post:":"")+this.action):"";this.$model.submit(instruction,type,this.useComponents,this.ref);};this.setModel=function(model,xpath){this.$model=model;};this.$loadAml=function(x){this.testing=x.getAttribute("testing")=="true";this.action=this.getAttribute("action");this.ref=this.getAttribute("ref");this.type=this.getAttribute("submittype")||"native";this.method=(this.getAttribute("method")||"get").toLowerCase();this.useComponents=this.getAttribute("usecomponents")||true;apf.setModel(x.getAttribute("model"),this);this.$loadChildren(function(xmlPage){this.validation=xmlPage.getAttribute("validation")||"true";this.invalidmsg=xmlPage.getAttribute("invalidmsg");});};}).call(apf.submitform.prototype=new apf.StandardBinding());apf.xforms.prototype=apf.submitform.prototype;apf.aml.setElement("xforms",apf.xforms);apf.aml.setElement("submitform",apf.submitform);apf.tree=function(b,a){this.$init(a||"tree",apf.NODE_VISIBLE,b);};(function(){var a=1<<1,c=1<<2,g=1<<3,i=1<<4,b=this.$treeState;this.$mode=0;this.$propHandlers.mode=function(j){if("check|radio".indexOf(j)>-1){this.implement(apf.MultiCheck);this.addEventListener("afterrename",d);this.multicheck=j=="check";this.$mode=this.multicheck?1:2;}else{this.removeEventListener("afterrename",d);this.$mode=0;}};function d(){}this.$initNode=function(x,j,s){this.$getNewContext("item");var n=j&a||this.emptyMessage&&this.$applyBindRule("empty",x),r=this.$getLayoutNode("item");r.setAttribute("onmouseover","var o = apf.lookup("+this.$uniqueId+");            o.$setStyleClass(this, 'hover', null, true);");r.setAttribute("onmouseout","var o = apf.lookup("+this.$uniqueId+");            o.$setStyleClass(this, '', ['hover'], true);");this.$setStyleClass(this.$getLayoutNode("item","class"),b[j]).setAttribute(apf.xmldb.htmlIdTag,s);this.$setStyleClass(this.$getLayoutNode("item","container"),b[j]);var m=this.$getLayoutNode("item","openclose");if(m){m.setAttribute("children",n);m.setAttribute("onmousedown","if (this.getAttribute('children') == false) return;                var o = apf.lookup("+this.$uniqueId+");                o.slideToggle(this, null, null, true);                apf.cancelBubble(event, o);");m.setAttribute("ondblclick","event.cancelBubble = true");}if(this.$mode){var y=this.$getLayoutNode("item","check");if(y){y.setAttribute("onmousedown","var o = apf.lookup("+this.$uniqueId+");                    o.checkToggle(this, true);o.$skipSelect = true;");if(apf.isTrue(this.$applyBindRule("checked",x))){this.$checkedList.push(x);this.$setStyleClass(r,"checked");}else{if(this.isChecked(x)){this.$setStyleClass(r,"checked");}}}else{return false;}}var k=this.opencloseaction||"ondblclick";var t=this.$getLayoutNode("item","icon");if(t&&t!=m){if(k!="ondblclick"){t.setAttribute(k,"var o = apf.lookup("+this.$uniqueId+");"+(k=="onmousedown"?"o.select(this, event.ctrlKey, event.shiftKey, -1);":"")+(true?"o.slideToggle(this, null, null, true);":""));}if(k!="onmousedown"){t.setAttribute("onmousedown","apf.lookup("+this.$uniqueId+").select(this, event.ctrlKey, event.shiftKey, -1);");}t.setAttribute("ondblclick","var o = apf.lookup("+this.$uniqueId+");              o.choose();o.stopRename();"+(true&&!k=="ondblclick"?"o.slideToggle(this, null, null, true);":"")+"apf.cancelBubble(event,o);");}var l=this.$getLayoutNode("item","select"),w;if(this.hasFeature(apf.__RENAME__)||this.hasFeature(apf.__DRAGDROP__)){w="var o = apf.lookup("+this.$uniqueId+");                 var xmlNode = apf.xmldb.findXmlNode(this);                 var isSelected = o.isSelected(xmlNode);                 this.hasPassedDown = true;                 if (!o.renaming && o.hasFocus() && isSelected == 1)                     this.dorename = true;                 if (!o.hasFeature(apf.__DRAGDROP__) || !isSelected && !event.ctrlKey)                     o.select(this, event.ctrlKey, event.shiftKey, -1);";l.setAttribute("onmouseout","this.hasPassedDown = false;"+(l.getAttribute("onmouseout")||""));l.setAttribute("onmouseup","if (!this.hasPassedDown) return;                var o = apf.lookup("+this.$uniqueId+");if (this.dorename && !o.mode)                    o.startDelayedRename(event, null, true);this.dorename = false;                 var xmlNode = apf.xmldb.findXmlNode(this);                 var isSelected = o.isSelected(xmlNode);                 if (o.hasFeature(apf.__DRAGDROP__))                     o.select(this, event.ctrlKey, event.shiftKey, -1);");}else{w="o.select(this, event.ctrlKey, event.shiftKey, -1);";}if(k!="ondblclick"){l.setAttribute(k,"var o = apf.lookup("+this.$uniqueId+");"+(k=="onmousedown"?w:"")+(true?"o.slideToggle(this, null, null, true);":""));}if(k!="onmousedown"){l.setAttribute("onmousedown","var o = apf.lookup("+this.$uniqueId+");"+w);}l.setAttribute("ondblclick","var o = apf.lookup("+this.$uniqueId+");          o.choose();o.stopRename();this.dorename=false;"+(k=="ondblclick"?"o.slideToggle(this, null, null, true);":"")+"apf.cancelBubble(event,o);");if(t){var q=this.$applyBindRule("icon",x);if(q){if(t.tagName.match(/^img$/i)){t.setAttribute("src",this.iconPath+q);}else{t.setAttribute("style","background-image:url("+this.iconPath+q+")");}}}var u=this.$getLayoutNode("item","caption");if(u){apf.setNodeValue(u,this.$applyBindRule("caption",x));}var o=this.$applyBindRule("tooltip",x);if(o){r.setAttribute("title",o);}var z=this.$applyBindRule("css",x);if(z){this.$setStyleClass(this.$getLayoutNode("item",null,r),z);this.$setStyleClass(this.$getLayoutNode("item","container",r),z);this.$dynCssClasses.push(z);}return r;};this.$updateNode=function(l,n){var k=this.$getLayoutNode("item","icon",n),m=this.$applyBindRule("icon",l);if(k&&m){if(k.tagName&&k.tagName.match(/^img$/i)){k.src=this.iconPath+m;}else{k.style.backgroundImage="url("+this.iconPath+m+")";}}var q=this.$getLayoutNode("item","caption",n);if(q){if(q.nodeType!=1){q=q.parentNode;}q.innerHTML=this.$applyBindRule("caption",l);}var o=this.$applyBindRule("tooltip",l);if(o){n.setAttribute("title",o);}var j=this.$applyBindRule("css",l);if(j||this.$dynCssClasses.length){this.$setStyleClass(n,j,this.$dynCssClasses);if(j&&!this.$dynCssClasses.contains(j)){this.$dynCssClasses.push(j);}}};this.$draw=function(){this.$drawBase();};}).call(apf.tree.prototype=new apf.BaseTree());apf.aml.setElement("tree",apf.tree);apf.aml.setElement("checked",apf.BindingRule);var HAS_CHILD=1<<1,IS_CLOSED=1<<2,IS_LAST=1<<3,IS_ROOT=1<<4;apf.markupedit=function(b,a){this.$init(a||"markupedit",apf.NODE_VISIBLE,b);};(function(){this.implement(apf.DataAction,apf.Rename,apf.MultiSelect,apf.Cache);this.$isTreeArch=true;this.$focussable=true;this.startcollapsed=true;this.$animType=0;this.$animSteps=3;this.$animSpeed=20;this.reselectable=true;this.prerender=false;this.each="node()[local-name(.) and not(@nomk = 'true')]";this.$dynCssClasses=[];this.expandAndSelect=function(o){var n=this;(function m(r){var q=n.getTraverseParent(r);if(q!=n.xmlRoot){m(q);}n.slideToggle(apf.xmldb.getHtmlNode(q,n),1,true);})(o);this.select(o);};this.setAttributeValue=function(n,m,o){if(!n){n=this.caret||this.selected;}if(!n||n.getAttribute(m)==o){return;}this.$executeAction("setAttribute",[n,m,o],"setAttributeValue",n);};this.removeAttribute=function(n,m,o){if(!n){n=this.caret||this.selected;}if(!n||n.getAttribute(m)==o){return;}this.$executeAction("removeAttribute",[n,m],"removeAttribute",n);};this.renameAttribute=function(o,n,m){if(!o){o=this.caret||this.selected;}if(!o||n==m){return;}this.$executeAction("multicall",[{func:"removeAttribute",args:[o,n]},{func:"setAttribute",args:[o,m,o.getAttribute(n)]}],"renameAttribute",o);};this.setTextNode=function(m,n){if(!m){m=this.caret||this.selected;}if(!m||apf.queryValue(m,"text()")==n){return;}this.$executeAction("setTextNode",[m,n],"setTextNode",m);};this.slideToggle=function(r,q,n){if(this.nocollapse){return;}if(!r){r=this.$selected;}var s=r.getAttribute(apf.xmldb.htmlIdTag);while(!s&&r.parentNode){var s=(r=r.parentNode).getAttribute(apf.xmldb.htmlIdTag);}var o,m=this.$getLayoutNode("item","container",r);if(apf.getStyle(m,"display")=="block"){if(q==1){return;}o=this.$getLayoutNode("item","openclose",r);o.className=o.className.replace(/min/,"plus");r.className=r.className.replace(/min/,"plus");this.slideClose(m,apf.xmldb.getNode(r),n);}else{if(q==2){return;}o=this.$getLayoutNode("item","openclose",r);o.className=o.className.replace(/plus/,"min");r.className=r.className.replace(/plus/,"min");this.slideOpen(m,apf.xmldb.getNode(r),n);}};this.isCollapsed=function(m){return(apf.getStyle(this.$getLayoutNode("item","container",apf.xmldb.getHtmlNode(m,this)),"display")=="none");};var c={};this.slideOpen=function(n,r,o){if(!r){r=this.selected;}var s=apf.xmldb.findHtmlNode(r,this);if(!n){n=this.$findContainer(s);}if(!n.innerHTML&&!this.getTraverseNodes(r).length){return;}if(this.singleopen){var q=this.getTraverseParent(r),t=(q||this.xmlRoot).getAttribute(apf.xmldb.xmlIdTag);if(c[t]&&c[t][1]!=r&&this.getTraverseParent(c[t][1])==q){this.slideToggle(c[t][0],2);}c[t]=[s,r];}n.style.display="block";if(!this.prerender&&this.$hasLoadStatus(r,"potential")){this.$extend(r,n,o);return;}if(o){n.style.height="auto";return;}var m=this;apf.tween.single(n,{type:"scrollheight",from:0,to:n.scrollHeight,anim:this.$animType,steps:this.$animOpenStep,interval:this.$animSpeed,onfinish:function(u){if(r&&m.$hasLoadStatus(r,"potential")){$setTimeout(function(){m.$extend(r,u);});u.style.height="auto";}else{u.style.height="auto";}}});};this.slideClose=function(m,n){if(this.nocollapse){return;}if(!n){n=this.selected;}if(this.singleopen){var o=(this.getTraverseParent(n)||this.xmlRoot).getAttribute(apf.xmldb.xmlIdTag);c[o]=null;}m.style.height=m.offsetHeight;m.style.overflow="hidden";apf.tween.single(m,{type:"scrollheight",from:m.scrollHeight,to:0,anim:this.$animType,steps:this.$animCloseStep,interval:this.$animSpeed,onfinish:function(q,r){q.style.display="none";}});};this.doUpdate=function(o,n){var s=this.$getBindRule("insert",o);var r=s&&s[1]?s[1](o):null;if(s&&r){this.$setLoadStatus(o,"loading");if(s.getAttribute("get")){this.getModel().$insertFrom(s.getAttribute("get"),{xmlNode:r,insertPoint:r,amlNode:this});}else{var q=this.$applyBindRule("Insert",o);if(q){this.insert(q,{insertPoint:r});}}}else{if(!this.prerender){this.$setLoadStatus(o,"loading");var m=this.$addNodes(o,n,true);b.call(this,"insert",o,m);}}};var i={};i[0]="";i[HAS_CHILD]="min";i[HAS_CHILD|IS_CLOSED]="plus";i[IS_LAST]="last";i[IS_LAST|HAS_CHILD]="minlast";i[IS_LAST|HAS_CHILD|IS_CLOSED]="pluslast";i[IS_ROOT]="root";this.fixItem=function(y,w,u,x,q){if(!w){return;}if(u){var r;if(r=this.getNextTraverse(y,true)){this.fixItem(r,this.$findHtmlNode(r.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId),null,true);}if(!this.emptyMessage&&y.parentNode.selectNodes(this.each).length==1){this.fixItem(y.parentNode,this.$findHtmlNode(y.parentNode.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId),null,false,true);}}else{var t,n=this.$getLayoutNode("item","container",w);if(q){t=false;}else{if(y.selectNodes(this.each).length>0){t=true;}else{if(this.$getBindRule("insert",y)){t=true;}else{t=false;}}}var o=t&&n.style.display!="block";var s=this.getNextTraverse(y,null,x?2:1)?false:true;var m=(t?HAS_CHILD:0)|(o?IS_CLOSED:0)|(s?IS_LAST:0);this.$setStyleClass(this.$getLayoutNode("item","openclose",w),i[m],["min","plus","last","minlast","pluslast"]);this.$setStyleClass(this.$getLayoutNode("item",null,w),i[m],["min","plus","last","minlast","pluslast"]);if(!t){n.style.display="none";}if(m&HAS_CHILD){}}};this.startRenameThis=function(s,n,r,t){if(this.renaming){this.stopRename(null,true);var m=this;return setTimeout(function(){m.startRenameThis(s,n,r);});}this.$getCaptionElement=function(){return s;};var q=s.getAttribute("aname");var o=t?a[t]:apf.xmldb.getNodeById(n);if(!o){throw new Error();}this.$multiLineRename=t&&o.nodeType!=3?true:false;this.$getCaptionXml=function(){return o.nodeType!=1?o:(q?o.getAttributeNode(q):o.firstChild);};this.getSelectFromRule=function(u,w){return[null,o.nodeType!=1?o:(q?o.getAttributeNode(q):o.firstChild)];};this.$validateRename=function(u){return !r||!u||u.match(/^[a-z]/i);};this.rename=function(u,w){this.$noanim=true;if(q){if(r){if(w==""){this.removeAttribute(o,q);}else{this.renameAttribute(o,q,w);}}else{this.setAttributeValue(o,q,w);}}else{this.setTextNode(o,w);}this.$noanim=false;};this.startRename();if(r){this.$txt[apf.hasContentEditable?"innerHTML":"value"]=q;this.$txt.className="";}else{this.$txt.className="attrvalue";}apf.selectTextHtml(this.$txt);};function l(o,n,s,r,m){this.$getNewContext("attribute");var t=this.$getLayoutNode("attribute","name");var q=this.$getLayoutNode("attribute","value");apf.setNodeValue(t,n);apf.setNodeValue(q,(s.length>50?"...":s));if(s.length>50){q.setAttribute("title",s);}t.setAttribute("aname",n);t.setAttribute("onmousedown","apf.lookup("+this.$uniqueId+").startRenameThis(this, '"+m+"', true);            event.cancelBubble=true;");t.setAttribute("onmouseup","            event.cancelBubble=true;            return false;");t.setAttribute("onkeydown","if (event.keyCode==13) {              this.blur();              return false;            };            event.cancelBubble=true;");t.setAttribute("onselectstart","event.cancelBubble = true;");t.setAttribute("ondblclick","event.cancelBubble = true;");q.setAttribute("aname",n);q.setAttribute("onmousedown","apf.lookup("+_self.$uniqueId+").startRenameThis(this, '"+m+"', true);            event.cancelBubble=true;");q.setAttribute("onmouseup","            event.cancelBubble=true;            return false;");q.setAttribute("onkeydown","if (event.keyCode==13) {              this.blur();              return false;            };            event.cancelBubble=true;");q.setAttribute("onselectstart","event.cancelBubble = true;");q.setAttribute("ondblclick","event.cancelBubble = true;");if(o.style){r=apf.insertHtmlNode(this.$getLayoutNode("attribute"),o,this.$getLayoutNode("item","begintag",r).nextSibling);if(!this.$noanim){g(r);g(this.$getLayoutNode("attribute","name",r));g(this.$getLayoutNode("attribute","value",r));}}else{o.appendChild(this.$getLayoutNode("attribute"));}}function j(o,r,n){this.$getNewContext("textnode");var s=this.$getLayoutNode("textnode","text");var m=this.$getLayoutNode("textnode","tag");apf.setNodeValue(s,(r.length>50?"...":r));if(r.length>50){s.setAttribute("title",r);}s.setAttribute("onmousedown","apf.lookup("+this.$uniqueId+").startRenameThis(this, '"+n+"');");s.setAttribute("onmouseup","            event.cancelBubble=true;            return false;");s.setAttribute("onkeydown","if (event.keyCode==13) {              this.blur();              return false;            };            event.cancelBubble=true;");s.setAttribute("onselectstart","event.cancelBubble = true;");s.setAttribute("ondblclick","event.cancelBubble = true;");apf.setNodeValue(m,"&gt;");if(o.style){var q=apf.insertHtmlNode(this.$getLayoutNode("textnode"),o,o.lastChild);if(!this.$noanim){g(this.$getLayoutNode("textnode","text",q));}}else{o.appendChild(this.$getLayoutNode("textnode"));}}this.$initNode=function(y,m,x){this.$getNewContext("item");var t=(m&HAS_CHILD||this.emptyMessage&&this.$applyBindRule("empty",y));var A=this.$getLayoutNode("item");A.setAttribute(apf.xmldb.htmlIdTag,x);this.$setStyleClass(this.$getLayoutNode("item","openclose"),i[m]);this.$setStyleClass(this.$getLayoutNode("item"),i[m]);var o=this.$getLayoutNode("item","openclose");if(t){o.setAttribute(this.opencloseaction||"onmousedown","var o = apf.lookup("+this.$uniqueId+");                o.slideToggle(this);                apf.cancelBubble(event,o);");}var q=this.$getLayoutNode("item","select");if(t){var z="var o = apf.lookup("+this.$uniqueId+");                o.slideToggle(this, true);";}q.setAttribute("onmousedown","var o = apf.lookup("+this.$uniqueId+");            apf.cancelBubble(event, o);            if (o.hasFocus())                 o.select(this);"+(z&&this.opencloseaction=="onmousedown"?z:""));var D=this.$getLayoutNode("item","begintag");apf.setNodeValue(D,"&lt;"+y.tagName);var n=this.$getLayoutNode("item","attributes");var u=y.attributes.length;if(typeof u=="function"){u=y.attributes.length();}for(var s=0;s<u;s++){var w=y.attributes.item(s);if(w.nodeName.match(/a_id|a_listen|a_doc|a_loaded/)){continue;}l.call(this,n,w.nodeName,w.nodeValue,null,x);}var B=this.$getLayoutNode("item","begintail");var r=this.$getLayoutNode("item","endtag");if(!(m&HAS_CHILD)){r.setAttribute("style","display:none");if(y.childNodes.length>1||y.childNodes.length==1&&y.firstChild.nodeValue.trim()){j.call(this,n,y.childNodes[0].nodeValue,x);apf.setNodeValue(B,"&lt;/"+y.tagName+"&gt;");}else{apf.setNodeValue(B," /&gt;");}}else{apf.setNodeValue(r,"&lt;/"+y.tagName+"&gt;");apf.setNodeValue(B,"&gt;");}B.parentNode.appendChild(B);r.setAttribute("onmousedown","var o = apf.lookup("+this.$uniqueId+");apf.cancelBubble(event, o);");var C=this.$applyBindRule("css",y);if(C){this.$setStyleClass(this.$getLayoutNode("item",null,this.$getLayoutNode("item")),C);if(C){this.$dynCssClasses.push(C);}}return this.$getLayoutNode("item");};this.$deInitNode=function(n,q){var m=this.$getLayoutNode("item","container",q);var o=q.parentNode;m.parentNode.removeChild(m);o.removeChild(q);if(n.parentNode!=this.xmlRoot){this.fixItem(n,q,true);}if(this.emptyMessage&&!o.childNodes.length){this.setEmpty(o);}this.fixItem(n,q,true);if(n==this.selected){this.clearSelection();}};function g(m){if(!m.offsetHeight){return;}apf.setStyleClass(m,"highlight");$setTimeout(function(){apf.setStyleClass(m,"",["highlight"]);},1000);}this.$updateNode=function(m,q){var C,B,t={};var E=this.$getLayoutNode("item","attributes",q);var D=this.$getLayoutNode("item","endtag",q);var F=this.$getLayoutNode("item","begintail",q);C=m.attributes.length;for(var B=0;B<C;B++){var y=m.attributes.item(B);if(y.nodeName.match(/a_id|a_listen|a_doc|a_loaded/)){continue;}t[y.nodeName]=y.nodeValue;}var w=false;var o=[];var x=[],A=E.childNodes;for(B=0;B<A.length;B++){x.push(A[B]);}for(B=0;B<x.length;B++){if(x[B].nodeType!=1){continue;}if(x[B].className.indexOf("textnode")>-1){if(m.childNodes.length==1&&m.childNodes[0].nodeType==3){var z=this.$getLayoutNode("textnode","text",x[B]);if(m.firstChild.nodeValue!=z.innerHTML){z.innerHTML=m.firstChild.nodeValue;g(z);}}else{x[B].parentNode.removeChild(x[B]);apf.setNodeValue(F," /&gt;");}w=true;}if(x[B].className.indexOf("attribute")==-1){continue;}var n=this.$getLayoutNode("attribute","name",x[B]);var u=this.$getLayoutNode("attribute","value",x[B]);var G=n.innerHTML;if(!t[G]){o.push(x[B]);}else{if(t[G]!=u.innerHTML){u.innerHTML=t[G];g(u);delete t[G];}else{if(t[G]){delete t[G];}}}n.setAttribute("aname",G);u.setAttribute("aname",G);}for(var y in t){if(o.length){var s=o.pop();var n=this.$getLayoutNode("attribute","name",s);var u=this.$getLayoutNode("attribute","value",s);n.setAttribute("aname",y);u.setAttribute("aname",y);n.innerHTML=y;u.innerHTML=t[y];g(n);}else{l.call(this,E,y,t[y],q,m.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);}}for(var B=0;B<o.length;B++){o[B].parentNode.removeChild(o[B]);}if(!w&&m.childNodes.length==1&&m.childNodes[0].nodeType==3){j.call(this,E,m.childNodes[0].nodeValue);apf.setNodeValue(F,"</"+m.tagName+">");}var r=this.$applyBindRule("css",m);if(r||this.$dynCssClasses.length){this.$setStyleClass(q,r,this.$dynCssClasses);if(r&&!this.$dynCssClasses.contains(r)){this.$dynCssClasses.push(r);}}};this.clearEmpty=function(m){m.innerHTML="";};this.setEmpty=function(m){this.$getNewContext("empty");var n=this.$getLayoutNode("empty");this.$getLayoutNode("empty","caption").nodeValue=this.emptyMessage;apf.insertHtmlNode(n,m);if(!this.startcollapsed){if(m.style){}}};this.$setLoading=function(n,m){this.$getNewContext("loading");this.$setLoadStatus(n,"potential");apf.insertHtmlNode(this.$getLayoutNode("loading"),m);};this.$removeLoading=function(m){if(!m){return;}this.$getLayoutNode("item","container",m).innerHTML="";};this.$extend=function(o,m,n){var r=this.$getBindRule("insert",o),q=r&&r.match?(r.cmatch||r.compile("match"))(o):o;if(r&&q){this.$setLoadStatus(o,"loading");if(r.get){this.getModel().$insertFrom(r.getAttribute("get"),{xmlNode:q,insertPoint:q,amlNode:this});}else{if(this.$applyBindRule("insert",o)){this.insert(data,{insertPoint:q});}}}else{if(!this.prerender){this.$setLoadStatus(o,"loading");this.$removeLoading(apf.xmldb.findHtmlNode(o,this));this.$noanim=true;b.call(this,{action:"insert",xmlNode:o,result:this.$addNodes(o,m,true),anim:!n});delete this.$noanim;}}};function b(o){if(o.action=="move-away"){this.fixItem(o.xmlNode,apf.xmldb.findHtmlNode(o.xmlNode,this),true);}if(o.action!="insert"){return;}var n=this.$findHtmlNode(o.xmlNode.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId);if(!n){return;}if(this.$hasLoadStatus(o.xmlNode,"loading")&&o.result.length>0){var m=this.$getLayoutNode("item","container",n);this.slideOpen(m,o.xmlNode);}else{this.fixItem(o.xmlNode,n);}if(this.$hasLoadStatus(o.xmlNode,"loading")){this.$setLoadStatus(o.xmlNode,"loaded");}}this.addEventListener("xmlupdate",b);this.addEventListener("beforeload",function(m){this.each=m.xmlNode.$regbase?"node()[not(@nomk = 'true')]":"node()[local-name(.) and not(@nomk = 'true')]";});this.addEventListener("keydown",function(u){var A=u.keyCode;var o=u.ctrlKey;var x=u.shiftKey;var w=this.$caret||this.$selected;if(!w||this.renaming){return;}var y=this.caret||this.selected;var q=this.$ext;switch(A){case 13:if(this.$tempsel){this.$selectTemp();}if(this.ctrlselect=="enter"){this.select(this.caret,true);}this.choose(w);break;case 32:if(o){this.select(this.caret,true);}break;case 46:if(this.$tempsel){this.$selectTemp();}this.remove(this.mode?this.caret:null);break;case 109:case 37:if(this.$tempsel){this.$selectTemp();}if(this.caret.selectSingleNode(this.each)){this.slideToggle(this.$caret||this.$selected,2);}break;case 107:case 39:if(this.$tempsel){this.$selectTemp();}if(this.caret.selectSingleNode(this.each)){this.slideToggle(this.$caret||this.$selected,1);}break;case 187:if(x){arguments.callee(39);}break;case 189:if(!x){arguments.callee(37);}break;case 38:if(!y&&!this.$tempsel){return;}var r=this.$tempsel?apf.xmldb.getNode(this.$tempsel):y;var t=this.getNextTraverse(r,true);if(t){var n=this.getTraverseNodes(t);do{var m=this.$getLayoutNode("item","container",this.$findHtmlNode(apf.xmldb.getID(t,this)));if(m&&apf.getStyle(m,"display")=="block"&&n.length){t=n[n.length-1];}else{break;}}while(t&&(n=this.getTraverseNodes(t)).length);}else{if(this.getTraverseParent(r)==this.xmlRoot){this.dispatchEvent("selecttop");return;}else{t=this.getTraverseParent(r);}}if(t&&t.nodeType==1){this.$setTempSelected(t,o,x);}if(this.$tempsel&&this.$tempsel.offsetTop<q.scrollTop){q.scrollTop=this.$tempsel.offsetTop;}return false;break;case 40:if(!y&&!this.$tempsel){return;}var r=this.$tempsel?apf.xmldb.getNode(this.$tempsel):y;var t=this.getFirstTraverseNode(r);if(t){var m=this.$getLayoutNode("item","container",this.$findHtmlNode(apf.xmldb.getID(r,this)));if(m&&apf.getStyle(m,"display")!="block"){t=null;}}while(!t){var z=this.getTraverseParent(r);if(!z){break;}var s=0;var n=this.getTraverseNodes(z);while(n[s]&&n[s]!=r){s++;}t=n[s+1];r=z;}if(t&&t.nodeType==1){this.$setTempSelected(t,o,x);}if(this.$tempsel&&this.$tempsel.offsetTop+this.$tempsel.offsetHeight>q.scrollTop+q.offsetHeight){q.scrollTop=this.$tempsel.offsetTop-q.offsetHeight+this.$tempsel.offsetHeight+10;}return false;break;case 33:break;case 34:break;case 36:break;case 35:break;}},true);var d=[];this.$add=function(E,x,z,F,A,u){var y=this.$getBindRule("insert",E)?true:false,D=this.getTraverseNodes(E),t=D.length?true:false,w=y||t,r=this.$hasBindRule("collapsed")?(this.$getDataNode("collapsed",E)?true:false):(this.$hasBindRule("expanded")?(this.$getDataNode("expanded",E)?false:true):this.startcollapsed),o=(w?HAS_CHILD:0)|(r&&w||y?IS_CLOSED:0)|(u?IS_LAST:0),C=this.$initNode(E,o,x),n=this.$getLayoutNode("item","container"),s;if(!r&&!this.nocollapse){n.setAttribute("style","overflow:visible;height:auto;display:block;");}if(!w||y){n.setAttribute("style","display:none;");}if(!this.prerender){s=D.length;}if(w&&!this.prerender&&s>0&&r||y&&(!this.$hasLoadStatus(E)||this.$hasLoadStatus(E,"potential"))){this.$setLoading(E,n);}else{if(!t&&(msg=this.$applyBindRule("empty",E))){this.setEmpty(n);}}if(!F&&(z==this.xmlRoot||E==this.xmlRoot)){d.push(C);if(!apf.isChildOf(C,n,true)){d.push(n);}this.$setStyleClass(C,"root");this.$setStyleClass(n,"root");}else{if(!F){F=apf.xmldb.findHtmlNode(E.parentNode,this);F=F?this.$getLayoutNode("item","container",F):this.$container;}if(F==this.$container){this.$setStyleClass(C,"root");this.$setStyleClass(n,"root");if(this.renderRoot){var B=apf.xmldb.findHtmlNode(this.xmlRoot,this);F=this.$getLayoutNode("item","container",B);}}if(!A&&this.getNextTraverse(E)){A=apf.xmldb.findHtmlNode(this.getNextTraverse(E),this);}if(A&&A.parentNode!=F){A=null;}if(F.style&&this.getTraverseNodes(E.parentNode).length==1){this.clearEmpty(F);}if(F.style){var m=apf.insertHtmlNode(C,F,A);if(!this.$noanim){g(this.$getLayoutNode("item","select",m));}if(!apf.isChildOf(C,n,true)){var n=apf.insertHtmlNode(n,F,A);}}else{F.insertBefore(C,A);if(!apf.isChildOf(F,n,true)){F.insertBefore(n,A);}}if(F.style){if(!r&&this.openOnAdd&&F!=this.$container&&F.style.display!="block"){this.slideOpen(F,z);}this.fixItem(z,apf.xmldb.findHtmlNode(z,this));if(this.getNextTraverse(E,true)){this.fixItem(this.getNextTraverse(E,true),apf.xmldb.findHtmlNode(this.getNextTraverse(E,true),this));}}}if(this.prerender||s<1||!r){this.$addNodes(E,n,false);}return n;};this.$fill=function(){var m;apf.insertHtmlNodes(d,m||this.$container);d.length=0;};var k={};k[3]="textnode";k[4]="cdata";k[7]="procinstr";k[8]="comment";var a=[null];this.$addNonElement=function(y,z,o,s,q){if(!y.$regbase){return;}if(o){w=false;}if(w){return;}if(y.nodeType==3){this.$getNewContext("textnode");var n=this.$getLayoutNode("textnode");var m=this.$getLayoutNode("textnode","text");}else{this.$getNewContext("anynode");var n=this.$getLayoutNode("anynode");var r=this.$getLayoutNode("anynode","tagstart");var t=this.$getLayoutNode("anynode","tagend");switch(y.nodeType){case 4:apf.setNodeValue(r,"&lt;![CDATA[");apf.setNodeValue(t,"]]&gt;");break;case 7:apf.setNodeValue(r,"&lt;?"+y.target);apf.setNodeValue(t,"?&gt;");break;case 8:apf.setNodeValue(r,"&lt;!--");apf.setNodeValue(t,"--&gt;");break;default:return;}this.$getLayoutNode("anynode","openclose").setAttribute("onmousedown","var o = this.parentNode;                 apf.setStyleClass(o, o.className.indexOf('open') > -1 ? '' : 'open', ['open']);");var m=this.$getLayoutNode("anynode","text");}var x=y.nodeValue;if(x.trim().indexOf("\n")>-1){x=(y.nodeValue=apf.removeStartWhitespaces(x.replace(/^ *\n/,"").replace(/\n *$/,""))).replace(/</g,"&lt;").replace(/\n/g,"<br />");}else{x=x.trim().replace(/</g,"&lt;");}apf.setNodeValue(m,x);this.$setStyleClass(n,k[y.nodeType],"");var u=y.parentNode.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId;m.setAttribute("onmousedown","apf.lookup("+this.$uniqueId+").startRenameThis(this, '"+u+"', false, "+(a.push(y)-1)+");");m.setAttribute("onmouseup","            event.cancelBubble=true;            return false;");m.setAttribute("onkeydown","if (event.keyCode==13) {              this.blur();              return false;            };            event.cancelBubble=true;");m.setAttribute("onselectstart","event.cancelBubble = true;");m.setAttribute("ondblclick","event.cancelBubble = true;");if(z.style){var w=apf.insertHtmlNode(n,z);}else{z.appendChild(n);}};this.$getParentNode=function(m){return m?this.$getLayoutNode("item","container",m):this.$container;};this.$calcSelectRange=function(n,m){return[n,m];};this.$findContainer=function(m){return this.$getLayoutNode("item","container",m);};this.multiselect=false;this.$selectDefault=function(o){if(this.select(this.getFirstTraverseNode(o),null,null,null,true)){return true;}else{var m=this.getTraverseNodes(o);for(var n=0;n<m.length;n++){if(this.$selectDefault(m[n])){return true;}}}};this.$select=function(m){if(!m||!m.style){return;}this.$setStyleClass(this.$getLayoutNode("item","class",m),"selected");return m;};this.$deselect=function(m){if(!m){return;}this.$setStyleClass(this.$getLayoutNode("item","class",m),"",["selected","indicate"]);return m;};this.$indicate=function(m){if(!m){return;}this.$setStyleClass(this.$getLayoutNode("item","class",m),"indicate");return m;};this.$deindicate=function(m){if(!m){return;}this.$setStyleClass(this.$getLayoutNode("item","class",m),"",["indicate"]);return m;};this.$draw=function(){this.$ext=this.$getExternal();this.$container=this.$getLayoutNode("main","container",this.$ext);this.opencloseaction=this.$getOption("Main","openclose");this.$ext.onclick=function(n){this.host.dispatchEvent("click",{htmlEvent:n||event});};var m=this;this.$ext.onmouseover=function(n){m.dispatchEvent("mouseover",{htmlEvent:n||event});};this.$ext.onmouseout=function(n){m.dispatchEvent("mouseover",{htmlEvent:n||event});};};this.$loadAml=function(m){this.openOnAdd=!apf.isFalse(m.getAttribute("openonadd"));this.startcollapsed=!apf.isFalse(this.getAttribute("startcollapsed")||this.$getOption("Main","startcollapsed"));this.nocollapse=apf.isTrue(this.getAttribute("nocollapse"));if(this.nocollapse){this.startcollapsed=false;}this.singleopen=apf.isTrue(this.getAttribute("singleopen"));};this.$destroy=function(){this.$ext.onclick=null;apf.destroyHtmlNode(this.oDrag);this.oDrag=null;};}).call(apf.markupedit.prototype=new apf.GuiElement());apf.aml.setElement("markupdit",apf.markupedit);apf.loader=function(){this.$init("loader",apf.NODE_HIDDEN);this.$parsePrio="001";this.show=function(){this.$ext.style.display="block";};this.hide=function(){this.$ext.style.display="none";};this.addEventListener("DOMNodeInsertedIntoDocument",function(b){var c;if(!(c=this.parentNode.$int)){c=document.body;}this.$ext=apf.insertHtmlNode(null,c,null,this.$aml?(this.$aml.serialize?this.$aml.serialize():this.$aml.xml):this.serialize());if(!apf.loaded){var a=this;apf.addEventListener("load",function(){if(apf.config.autoHideLoading){apf.queue.empty();a.hide();}});}});};apf.loader.prototype=new apf.AmlElement();apf.aml.setElement("loader",apf.loader);apf.panel=function(b,a){this.$init(a||"panel",apf.NODE_VISIBLE,b);};apf.fieldset=function(b,a){this.$init(a||"fieldset",apf.NODE_VISIBLE,b);};apf.frame=function(b,a){this.$init(a||"submit",apf.NODE_VISIBLE,b);};(function(){this.implement(apf.BaseStateButtons);this.$focussable=false;this.$supportedProperties.push("caption","url");this.$propHandlers.caption=function(a){if(!this.oCaption){return;}if(this.oCaption.nodeType==1){this.oCaption.innerHTML=a;}else{this.oCaption.nodeValue=a;}};this.$propHandlers.icon=function(a){var b=this.$getLayoutNode("main","icon",this.$ext);if(!b){return;}if(b.nodeType==1){b.style.display=a?"block":"none";}apf.skins.setIcon(b,a,this.iconPath);};this.$propHandlers.url=function(b){var a=this.oCaption;if(a.tagName=="A"||a.nodeType!=1){a=a.parentNode;}a.innerHTML="<a href='"+b+"' "+(b.match(/^http:\/\//)?"target='_blank'":"")+">"+this.caption+"</a>";this.oCaption=this.oCaption.firstChild;};this.setTitle=function(a){this.setProperty("title",a);};this.$draw=function(){this.$ext=this.$getExternal(null,null,function(a){this.$initButtons(a);});this.oCaption=this.$getLayoutNode("main","caption",this.$ext);this.$int=this.$getLayoutNode("main","container",this.$ext);this.$buttons=this.$getLayoutNode("main","buttons",this.$ext);};this.$loadAml=function(a){};}).call(apf.frame.prototype=new apf.Presentation());apf.panel.prototype=apf.fieldset.prototype=apf.frame.prototype;apf.aml.setElement("panel",apf.panel);apf.aml.setElement("fieldset",apf.fieldset);apf.aml.setElement("frame",apf.frame);apf.AmlConfig=function(){this.$init("config",apf.NODE_VISIBLE);};(function(){this.focussable=false;this.$canLeechSkin=true;this.$draw=function(){this.$ext=this.$int=this.$getExternal(this.$isLeechingSkin?this.localName:"main");};}).call(apf.AmlConfig.prototype=new apf.Presentation());apf.aml.setElement("config",apf.AmlConfig);apf.template=function(b,a){this.$init(a||"template",apf.NODE_HIDDEN,b);};(function(){this.$focussable=false;this.$frags={};this.getNewInstance=function(i,k,d,g){if(this.$frags[k]){var j=this.$frags[k];}else{var c,b,a,j=this.$frags[k]=this.cloneNode(true);j.$int=i;if(d){c=apf.xmldb.findModel(d);b=apf.xmlToXpath(d,c.data,true)||".";j.attributes.push(a=new apf.AmlAttr(j,"model",""));a.inheritedValue=[c.name,b];}j.ownerDocument.$domParser.$continueParsing(j,{delay:true});}return j;};this.destroyInstance=function(b){var a=this.$frags[b];delete this.$frags[b];a.destroy(true);};}).call(apf.template.prototype=new apf.AmlElement());apf.aml.setElement("template",apf.template);apf.flashplayer=function(b,a){this.$init(a||"flashplayer",apf.NODE_VISIBLE,b);};(function(){this.implement(apf.DataAction,apf.StandardBinding);this.setValue=function(a){this.setProperty("value",a,false,true);};this.$supportedProperties.push("value");this.$propHandlers.value=function(a){this.setSource(a);};this.$draw=function(){this.$ext=this.$pHtmlNode.appendChild(document.createElement("div"));this.$ext.onclick=function(){this.host.dispatchEvent("click");};var a=this.getAttribute("src")||"";this.$ext.insertAdjacentHTML("beforeend",'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"               codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"               width="100%"               height="100%"               align="middle">                <param name="allowScriptAccess" value="sameDomain" />                <param name="allowFullScreen" value="false" />                <param name="movie" value="'+a+'" />                <param name="play" value="true" />                <param name="menu" value="false" />                <param name="quality" value="high" />                <param name="wmode" value="transparent" />                <param name="bgcolor" value="#ffffff" />                <embed src="'+a+'" play="true" menu="false"                   quality="high" wmode="transparent" bgcolor="#ffffff" width="100%"                   height="100%" align="middle" allowScriptAccess="sameDomain"                   allowFullScreen="false" type="application/x-shockwave-flash"                   pluginspage="http://www.macromedia.com/go/getflashplayer" />            </object>');};this.$loadAml=function(a){};}).call(apf.flashplayer.prototype=new apf.GuiElement());apf.aml.setElement("flashplayer",apf.flashplayer);apf.radio=function(b,a){this.$init(a||"radio",apf.NODE_HIDDEN,b);};apf.check=function(b,a){this.$init(a||"check",apf.NODE_HIDDEN,b);};apf.item=function(b,a){this.$init(a||"item",apf.NODE_HIDDEN,b);};(function(){this.$focussable=false;this.$childProperty="caption";this.$canLeechSkin="item";this.implement(apf.ChildValue);this.$attrExcludePropBind=apf.extend({match:1},this.$attrExcludePropBind);this.$supportedProperties.push("submenu","value","match","group","icon","checked","selected","disabled","caption");this.$propHandlers.submenu=function(b){apf.setStyleClass(this.$ext,"submenu");};this.$propHandlers.select=function(b){this.select=b?"self::"+b.split("|").join("|self::"):b;};this.$propHandlers.icon=function(b){if(this.$icon){apf.skins.setIcon(this.$icon,b,this.parentNode.iconPath);}};this.$propHandlers.caption=function(b){if(this.$caption){apf.setNodeValue(this.$caption,b);}};this.$propHandlers.checked=function(b){if(this.localName!="check"){return;}if(apf.isTrue(b)){apf.setStyleClass(this.$ext,"checked");}else{apf.setStyleClass(this.$ext,"",["checked"]);}};this.$propHandlers.selected=function(b){if(this.localName!="radio"){return;}if(apf.isTrue(b)){apf.setStyleClass(this.$ext,"selected");}else{apf.setStyleClass(this.$ext,"",["selected"]);}};this.$propHandlers.disabled=function(b){if(apf.isTrue(b)){apf.setStyleClass(this.$ext,"disabled");}else{apf.setStyleClass(this.$ext,"",["disabled"]);}};this.enable=function(b){apf.setStyleClass(this.$ext,this.parentNode.$baseCSSname+"Disabled");};this.disable=function(b){apf.setStyleClass(this.$ext,null,[this.parentNode.$baseCSSname+"Disabled"]);};this.show=function(){this.$ext.style.display="block";};this.hide=function(){this.$ext.style.display="none";};this.addEventListener("AMLReparent",function(b,d,c){if(!this.$amlLoaded){return;}if(!c&&this.skinName!=d.skinName){this.loadAml();}});this.$down=function(){};this.$up=function(){if(this.localName=="radio"){this.parentNode.select(this.group,this.value||this.caption);}else{if(this.localName=="check"){this.$handlePropSet("checked",!this.checked);}}if(this.submenu){this.$over(null,true);return;}this.parentNode.$hideTree=true;this.parentNode.hide();this.parentNode.dispatchEvent("itemclick",{value:this.value||this.caption});};this.$click=function(){this.dispatchEvent("click",{xmlContext:this.parentNode.xmlReference,opener:this.parentNode.opener});};var a;this.$out=function(c){if(apf.isChildOf(this.$ext,c.toElement||c.explicitOriginalTarget)||apf.isChildOf(this.$ext,c.srcElement||c.target)){return;}clearTimeout(a);if(!this.submenu||this.$submenu(true)){apf.setStyleClass(this.$ext,"",["hover"]);var b=this.parentNode.$selected;if(b&&b!=this){apf.setStyleClass(b.$ext,"",["hover"]);}this.parentNode.$selected=null;}};this.$over=function(d,c){if(this.parentNode.$selected==this){return;}if(this.parentNode.$selected){apf.setStyleClass(this.parentNode.$selected.$ext,"",["hover"]);}apf.setStyleClass(this.$ext,"hover");this.parentNode.$selected=this;if(!c&&(apf.isChildOf(this.$ext,d.toElement||d.explicitOriginalTarget)||apf.isChildOf(this.$ext,d.fromElement||d.target))){return;}var g=this.parentNode.$showingSubMenu;if(g){if(g.name==this.submenu){return;}g.hide();this.parentNode.$showingSubMenu=null;}if(this.submenu){if(c){this.$submenu();}else{var b=this;clearTimeout(a);a=$setTimeout(function(){b.$submenu();a=null;},200);}}};this.$submenu=function(b,c){if(!this.submenu){return true;}var d=self[this.submenu];if(!d){return;}if(!b){this.parentNode.$showingSubMenu=d;var g=apf.getAbsolutePosition(this.$ext,this.parentNode.$ext.offsetParent);d.display(g[0]+this.$ext.offsetWidth-3,g[1]+3,false,this,this.parentNode.xmlReference,this.parentNode.$uniqueId);d.setAttribute("zindex",(this.parentNode.zindex||1)+1);}else{if(d.visible&&!c){return false;}if(this.parentNode.$showingSubMenu){this.parentNode.$showingSubMenu=null;}apf.setStyleClass(this.$ext,"",["hover"]);d.hide();return true;}};this.$draw=function(c){var g=this.parentNode;while(g.$canLeechSkin=="item"){g=g.parentNode;}if(g.hasFeature(apf.__MULTISELECT__)){var b=this;if(!this.$hasSetSkinListener){var d;this.parentNode.addEventListener("$skinchange",d=function(){if(b.$amlDestroyed){return;}if(b.$ext.parentNode){this.$deInitNode(b,b.$ext);}var k=g==b.parentNode?g.$container:b.parentNode.$container;var j=k.lastChild;g.$add(b,b.getAttribute(apf.xmldb.xmlIdTag)+"|"+this.$uniqueId,b.parentNode,k!=g.$container&&k,null);g.$fill();if(g.$isTreeArch){b.$container=g.$getLayoutNode("item","container",b.$ext=j&&j.nextSibling||k.firstChild);}else{b.$ext=j&&j.nextSibling||k.firstChild;}var i=b;while((i=i.nextSibling)&&i.nodeType!=1){}if(!i||i.$canLeechSkin!="item"){g.dispatchEvent("afterload");}});this.addEventListener("DOMNodeRemoved",function(i){this.parentNode.removeEventListener("$skinchange",d);});this.$hasSetSkinListener=true;}if(!g.$itemInited){g.canrename=false;g.$removeClearMessage();g.$itemInited=[g.getTraverseNodes,g.getFirstTraverseNode,g.getTraverseParent];g.getTraverseNodes=function(i){return(i||g).getElementsByTagNameNS(apf.ns.apf,"item");};g.getFirstTraverseNode=function(i){return(i||g).getElementsByTagNameNS(apf.ns.apf,"item")[0];};g.getTraverseParent=function(i){return i&&i.parentNode;};g.each=(this.prefix?this.prefix+":":"")+"item";g.$preventDataLoad=true;g.$initingModel=true;g.$setDynamicProperty("icon","[@icon]");g.$setDynamicProperty("image","[@image]");g.$setDynamicProperty("caption","[label/text()|@caption|text()]");g.$setDynamicProperty("eachvalue","[value/text()|@value|text()]");g.$canLoadDataAttr=false;if(!g.xmlRoot){g.xmlRoot=g;}}this.$loadAml=function(){if(!this.getAttribute("caption")){this.setAttribute("caption",this.caption);}var k=g==this.parentNode?g.$container:this.parentNode.$container;var j=k.lastChild;if(!g.documentId){g.documentId=apf.xmldb.getXmlDocId(this);}g.$add(this,apf.xmldb.nodeConnect(g.documentId,this,null,g),this.parentNode,k!=g.$container&&k,null);g.$fill();if(g.$isTreeArch){this.$container=g.$getLayoutNode("item","container",this.$ext=j&&j.nextSibling||k.firstChild);}else{this.$ext=j&&j.nextSibling||k.firstChild;}var i=this;while((i=i.nextSibling)&&i.nodeType!=1){}if(!i||i.$canLeechSkin!="item"){g.dispatchEvent("afterload");if(g.autoselect){g.$selectDefault(this.parentNode);}}};return;}this.$ext=this.$getExternal(this.$isLeechingSkin?"item":"main",null,function(i){var j="var o = apf.lookup("+this.$uniqueId+"); if (o.disabled) return; o";i.setAttribute("onmouseup",j+".$up(event)");i.setAttribute("onmousemove",j+".$over(event)");i.setAttribute("onmouseout",j+".$out(event)");i.setAttribute("onmousedown",j+".$down()");i.setAttribute("onclick",j+".$click()");});apf.setStyleClass(this.$ext,this.localName);this.$caption=this.$getLayoutNode("item","caption",this.$ext);this.$icon=this.$getLayoutNode("item","icon",this.$ext);this.$hotkey=this.$getLayoutNode("item","hotkey",this.$ext);if(!c&&this.nextSibling&&this.nextSibling.$ext){this.$ext.parentNode.insertBefore(this.$ext,this.nextSibling.$ext);}};this.addEventListener("DOMNodeInsertedIntoDocument",function(c){var b=this.$ext?true:false;if(b){if(typeof this.checked!=="undefined"){this.$handlePropSet("checked",this.checked);}else{if(typeof this.selected!=="undefined"){this.$handlePropSet("selected",this.selected);}}if(this.disabled){this.$handlePropSet("disabled",this.disabled);}if(this.caption){this.$handlePropSet("caption",this.caption);}}});}).call(apf.item.prototype=new apf.Presentation());apf.radio.prototype=apf.check.prototype=apf.item.prototype;apf.aml.setElement("radio",apf.radio);apf.aml.setElement("check",apf.check);apf.aml.setElement("item",apf.item);apf.model=function(b,a){this.$init(a||"model",apf.NODE_HIDDEN,b);this.$amlNodes={};this.$propBinds={};this.$listeners={};this.$proplisteners={};if(!apf.globalModel){apf.globalModel=this;apf.nameserver.register("model","@default",this);}};(function(){this.$parsePrio="020";this.$isModel=true;this.canHaveChildren=false;this["save-original"]=true;this.$state=0;this.$attrExcludePropBind=apf.extend({submission:1,src:1,session:1},this.$attrExcludePropBind);this.$booleanProperties.autoinit=true;this.$booleanProperties["save-original"]=true;this.$supportedProperties=["submission","src","session","autoinit","save-original","remote"];this.$propHandlers.src=this.$propHandlers.get=function(a,b){if(this.$amlLoaded){this.$loadFrom(a);}};this.$propHandlers.validation=function(a,b){apf.nameserver.get("validation",a).register(this);};this.$propHandlers.remote=function(a,b){this.unshare();if(a){this.share();}};this.share=function(a){this.rsb=apf.nameserver.get("remote",this.remote);this.rsb.startSession(this,a||"//");};this.unshare=function(a){if(!this.rsb){return;}this.rsb.endSession(this,a||"//");this.rsb=null;};this.validate=function(c,d,b,a){if(!this.$validation){return;}if(!c){}else{b=this.$validation.validate(c,d,b);if(b.valid){a.clearError();return true;}else{a.setError();return false;}}};this.register=function(b,a){if(!b||!b.load){return this;}if(b.$model&&b.$model!=this){b.$model.unregister(b);}var d=this.$amlNodes[b.$uniqueId]={amlNode:b,xpath:a};b.$model=this;if(typeof b.noloading=="undefined"&&b.$setInheritedAttribute&&!b.$setInheritedAttribute("noloading")){b.noloading=false;}if(this.$state==1){if(b.clear&&!b.noloading){b.clear("loading");}}else{if(this.data){this.$loadInAmlNode(d);}else{if(b.clear){b.clear("empty");}}}var i,c,g=b.$propsUsingMainModel;for(var j in g){i=this.$bindXmlProperty(b,j,g[j].xpath,g[j].optimize);if(this.data){if(c=i.root||i.listen?this.data.selectSingleNode(i.root||i.listen):this.data){b.$execProperty(j,c);}else{this.$waitForXml(b,j);}}}return this;};this.$register=function(b,a){this.$amlNodes[b.$uniqueId].xpath=a;};this.unregister=function(a){delete this.$amlNodes[a.$uniqueId];var b=a.$propsUsingMainModel;for(var c in b){this.$unbindXmlProperty(a,c);}};this.getXpathByAmlNode=function(a){var b=this.$amlNodes[a.$uniqueId];if(!b){return false;}return b.xpath;};this.$loadInAmlNode=function(d){var c;var a=d.xpath;var b=d.amlNode;if(this.data&&a){c=this.data.selectSingleNode(a);}else{c=this.data||null;}if(c){delete this.$listeners[b.$uniqueId];b.load(c);}else{this.$waitForXml(b);}};this.$loadInAmlProp=function(i,b){var g,c,d=this.$propBinds[i],a=apf.all[i];if(!a){delete this.$propBinds[i];return;}for(g in d){if(c=d[g].root?b.selectSingleNode(d[g].root):b){apf.xmldb.addNodeListener(b,a,"p|"+i+"|"+g+"|"+this.$uniqueId);delete this.$proplisteners[i];a.$execProperty(g,c);}else{this.$waitForXml(a,g);}}};this.$bindXmlProperty=function(g,a,j,n,k){var b,d,c=g.$uniqueId;if(!this.$propBinds[c]){this.$propBinds[c]={};}d=this.$propBinds[c][a]={bind:j};if(n){if((b=this.$amlNodes[c])&&b.xpath){j=(d.root=b.xpath)+"/"+j;}var i=j.split("/"),m=i.pop();if(m.indexOf("@")==0||m.indexOf("text()")>-1||m.indexOf("node()")>-1){d.listen=i.join("/");}else{d.listen=j;}}else{if((b=this.$amlNodes[c])&&b.xpath){d.listen=b.xpath;}}if(k){d.listen=".";}if(this.data){var o=d.listen?this.data.selectSingleNode(d.listen):this.data;if(o){apf.xmldb.addNodeListener(o,g,"p|"+g.$uniqueId+"|"+a+"|"+this.$uniqueId);return d;}}this.$waitForXml(g,a);return d;};this.$unbindXmlProperty=function(b,g){var d=b.$uniqueId;var c=this.$propBinds[d]&&this.$propBinds[d][g];if(!c){return;}if(this.data){var a=c.listen?this.data.selectSingleNode(c.listen):this.data;if(a){apf.xmldb.removeNodeListener(a,b,"p|"+d+"|"+g+"|"+this.$uniqueId);}}delete this.$proplisteners[d+g];delete this.$propBinds[d][g];return c;};this.getXml=function(){return this.data?apf.xmldb.cleanNode(this.data.cloneNode(true)):false;};this.setQueryValue=function(a,c){if(!this.data){return false;}var b=apf.createNodeFromXpath(this.data,a);if(!b){return null;}apf.setNodeValue(b,c,true);return b;};this.queryValue=function(a){if(!this.data){return false;}return apf.queryValue(this.data,a);};this.queryValues=function(a){if(!this.data){return false;}return apf.queryValue(this.data,a);};this.queryNode=function(a){if(!this.data){return null;}return this.data.selectSingleNode(a);};this.queryNodes=function(a){if(!this.data){return null;}return this.data.selectNodes(a);};this.appendXml=function(c,a){var b=a?apf.createNodeFromXpath(this.data,a):this.data;if(!b){return null;}if(typeof c=="string"){c=apf.getXml(c);}else{c=!c.nodeType?c.getXml():apf.xmldb.getCleanCopy(c);}if(!c){return;}apf.xmldb.appendChild(b,c);};this.removeXml=function(a){if(typeof a=="string"){a=this.data.selectNodes(a);}else{if(!a.length){a=[a];}}if(a){apf.xmldb.removeNodeList(a);}};this.clear=function(){this.load(null);doc=null;};this.reset=function(){this.load(this.$copy);};this.savePoint=function(){this.$copy=apf.xmldb.getCleanCopy(this.data);};this.reloadAmlNode=function(c){if(!this.data){return;}var b=this.$amlNodes[c];var a=b.xpath?this.data.selectSingleNode(b.xpath):this.data;b.amlNode.load(a);};this.addEventListener("DOMNodeInsertedIntoDocument",function(c){var a=this.$aml;if(this.parentNode.hasFeature(apf.__DATABINDING__)){if(!this.name){this.setProperty("id","model"+this.parentNode.$uniqueId);}this.register(this.parentNode);}if(!this.src){var d,b=a;if(b.childNodes.length){if(apf.getNode(b,[0])){if((d=b.xml||b.serialize()).match(/^[\s\S]*?>([\s\S]*)<[\s\S]*?$/)){d=RegExp.$1;if(!apf.supportNamespaces){d=d.replace(/xmlns=\"[^"]*\"/g,"");}}return this.load(apf.getXmlDom(d).documentElement);}else{if(apf.isJson(b.childNodes[0].nodeValue)){return this.load(apf.getXmlDom(b.childNodes[0].nodeValue).documentElement);}}}if(this.submission){this.load("<data />");}}if(!apf.isFalse(this.autoinit)){this.init();}return this;});this.init=function(a){if(this.session){this.$loadFrom(this.session,{isSession:true});}else{if(this.src){this.$loadFrom(this.src,{callback:a});}}};this.$loadFrom=function(b,c){var g=b.split(":");if(!c){c={};}if(!c.isSession){this.src=b;this.$srcOptions=[b,c];}this.dispatchEvent("beforeretrieve");var k,d;for(k in this.$amlNodes){if(!(d=this.$amlNodes[k])||!d.amlNode){continue;}if(!d.amlNode.noloading){d.amlNode.clear("loading");}}this.$state=1;if(!this.$callCount){this.$callCount=1;}else{this.$callCount++;}var a=this,i=this.$callCount,j=c.callback;c.callback=function(n,m,l){if(i!=a.$callCount){return;}a.dispatchEvent("afterretrieve");if(m!=apf.SUCCESS){var o;o=new Error(apf.formatErrorString(1032,a,"Inserting xml data","Could not load data Instruction:"+b+"\nUrl: "+l.url+"\nInfo: "+l.message+"\n\n"+n));if(j&&j.apply(this,arguments)===true){return true;}if(l.tpModule&&l.tpModule.retryTimeout(l,m,a,o)===true){return true;}a.$state=0;throw o;}if(c&&c.isSession&&!n){if(this.src){return a.$loadFrom(this.src);}}else{if(c&&c.cancel){return;}a.load(n);a.dispatchEvent("receive",{data:n});if(j){j.apply(this,arguments);}}};return apf.getData(b,c);};this.reload=function(){if(!this.data){return;}if(this.$srcOptions){this.$loadFrom.apply(this,this.$srcOptions);}else{if(this.src){this.$loadFrom(this.src);}}};this.load=function(m,n){if(typeof m=="string"){if(m.charAt(0)=="<"){if(m.substr(0,5).toUpperCase()=="<!DOC"){m=m.substr(m.indexOf(">")+1);}if(!apf.supportNamespaces){m=m.replace(/xmlns\=\"[^"]*\"/g,"");}m=apf.getXmlDom(m,null,true).documentElement;}else{return this.$loadFrom(m,n);}}if(this.ownerDocument&&this.ownerDocument.$domParser.$shouldWait){var j=this;this.data=this.$copy=m;this.$queueLoading=true;apf.queue.add("modelload"+this.$uniqueId,function(){j.load(m,n);j.$queueLoading=false;});return;}else{if(this.$queueLoading){apf.queue.remove("modelload"+this.$uniqueId);}}this.$state=0;if(this.dispatchEvent("beforeload",{xmlNode:m})===false){return false;}var k=m?m.ownerDocument:null;if(m){if(!apf.supportNamespaces){var c=[],g=m.attributes;for(var d=0,b=g.length;d<b;d++){if(g[d].nodeName.substr(0,5)=="xmlns"){c.push(g[d].xml);}}if(c.length){k.setProperty("SelectionNamespaces",c.join(" "));}}apf.xmldb.addNodeListener(m,this);apf.xmldb.nodeConnect(apf.xmldb.getXmlDocId(m,this),m,null,this);if((!n||!n.nocopy)&&this["save-original"]){this.$copy=apf.xmldb.getCleanCopy(m);}}this.data=m;this.dispatchEvent("afterload",{xmlNode:m});for(var a in this.$amlNodes){this.$loadInAmlNode(this.$amlNodes[a]);}for(a in this.$propBinds){this.$loadInAmlProp(a,m);}return this;};this.$waitForXml=function(a,b){if(b){this.$proplisteners[a.$uniqueId+b]={id:a.$uniqueId,amlNode:a,prop:b};}else{this.$listeners[a.$uniqueId]=a;}};this.$xmlUpdate=function(i,c,g,d){if(this.rsb&&!this.$at&&d){this.$at=d.at;}var j,a;for(var k in this.$listeners){if(c=this.data.selectSingleNode(this.$amlNodes[k].xpath||".")){this.$listeners[k].load(c);delete this.$listeners[k];}}for(k in this.$proplisteners){j=this.$proplisteners[k];a=this.$propBinds[j.id][j.prop];if(c=a.listen?this.data.selectSingleNode(a.listen):this.data){apf.xmldb.addNodeListener(c,j.amlNode,"p|"+j.id+"|"+j.prop+"|"+this.$uniqueId);delete this.$proplisteners[k];j.amlNode.$execProperty(j.prop,a.root?this.data.selectSingleNode(a.root):this.data);}}};this.$insertFrom=function(b,c){if(!b){return false;}this.dispatchEvent("beforeretrieve");var d=c.callback,a=this;c.callback=function(j,i,g){a.dispatchEvent("afterretrieve");if(!g){g={};}if(i!=apf.SUCCESS){var k;if(g.tpModule.retryTimeout(g,i,c.amlNode||a,k)===true){return true;}if(d&&d.call(this,g.data,i,g)===false){return;}throw k;}if(typeof c.insertPoint=="string"){c.insertPoint=a.data.selectSingleNode(c.insertPoint);}if(typeof c.clearContents=="undefined"&&g.userdata){c.clearContents=apf.isTrue(g.userdata[1]);}(c.amlNode||a).insert(j,c);if(d){d.call(this,g.data,i,g);}};apf.getData(b,c);};this.insert=function(c,a){if(typeof c=="string"){if(c.charAt(0)=="<"){c=apf.getXmlDom(c).documentElement;}else{return this.$insertFrom(c,a);}}if(!a.insertPoint){a.insertPoint=this.data;}if(typeof a.copyAttributes=="undefined"){a.copyAttributes=true;}var b=apf.mergeXml(c,a.insertPoint,a);apf.xmldb.applyChanges("insert",a.insertPoint);return c;};this.convertXml=function(a){if(!a){return this.data.xml;}return apf.convertXml(this.data,a);};this.submit=function(a,g,c,d,i){if(!a){a=this.submission;}if(!c){c=this.data;}if(!g){g="form";}if(this.dispatchEvent("beforesubmit",{instruction:a})===false){return false;}var b=this;function k(n,m,l){if((m==apf.TIMEOUT||(b.retryOnError&&m==apf.ERROR))&&l.retries<apf.maxHttpRetries){return l.tpModule.retry(l.id);}else{if(m!=apf.SUCCESS){b.dispatchEvent("submiterror",l);}else{b.dispatchEvent("submitsuccess",apf.extend({data:n},l));}}}var j;if(g.indexOf("xml")>-1){j=apf.getXmlString(c);}else{if(g.indexOf("form")>-1){j=apf.convertXml(apf.xmldb.getCleanCopy(c),"cgiobjects");}else{if(g.indexOf("json")>-1){j=apf.convertXml(c,"json");}}}apf.saveData(a,{xmlNode:c,data:j,callback:k});this.dispatchEvent("aftersubmit");};this.$destroy=function(){if(this.session&&this.data){apf.saveData(this.session,{xmlNode:this.getXml()});}};}).call(apf.model.prototype=new apf.AmlElement());apf.aml.setElement("model",apf.model);apf.rpc=function(b,a){this.$init(a||"rpc",apf.NODE_HIDDEN,b);if(!this.supportMulticall){this.multicall=false;}this.stack={};this.urls={};this.$methods={};};(function(){this.useHTTP=true;this.namedArguments=false;this["route-server"]=apf.host+"/cgi-bin/rpcproxy.cgi";this.autoroute=false;this.$auth=false;this.$booleanProperties.multicall=true;this.$supportedProperties.push("protocol","type","multicall","http-method");this.$propHandlers["route-server"]=function(b){this.autoroute=b?true:false;};this.$propHandlers.protocol=function(b){if(!b){return;}if(!apf[b]){return;}this.implement(apf[b]);};this.$propHandlers.type=function(b){this.$useXml=(typeof b=="string"&&b.toUpperCase()=="XML");};this.setCallback=function(b,c){this.$methods[b].callback=c;};this.setUrl=function(c,b){this.$methods[c].setProperty("url",b);};this.$convertArgs=function(m,k){if(!this.namedArguments){return Array.prototype.slice.call(k);}var d=this.$methods[m].names;if(!d||!d.length){return{};}var o,g,n,c,b={};for(g=0,n=0,c=d.length;n<c;n++){m=d[n].name;o=d[n].value;if(o){o=apf.parseExpression(o);}else{o=k[g++];if(apf.isNot(o)&&d[n]["default"]){o=apf.parseExpression(d[n]["default"]);}}o=apf.isTrue(d[n].encoded)?encodeURIComponent(o):o;b[m]=o;}return b;};function a(b){var d,c;if(typeof b.callback=="string"){d=b.callback.split("."),c=self[d.shift()];while(c&&d.length){c=c[d.shift()];}}else{c=b.callback;}return c||apf.K;}this.call=function(c,l,q){var n,j=this.$methods[c];if(typeof l[l.length-1]=="function"){l=Array.prototype.slice.call(l);n=l.pop();}else{n=a(j);}l=this.$convertArgs(c,l);if(this.multicall){if(!this.stack[this.url]){this.stack[this.url]=this.getMulticallObject?this.getMulticallObject():[];}this.getSingleCall(c,l,this.stack[this.url]);return true;}var m=this,k=this.createMessage(j["method-name"]||c,l);function g(s,r,o){o.data=s;if(r!=apf.SUCCESS){n.call(m,null,r,o);}else{if(m.isValid&&!m.isValid(o)){n.call(m,null,apf.ERROR,o);}else{n.call(m,m.unserialize(o.data),r,o);}}}var i,b=apf.getAbsolutePath(this.baseurl||apf.config.baseurl,this.url),d=apf.extend({callback:g,async:j.async,userdata:j.userdata,nocache:(this.nocache===false)?false:true,data:k,useXML:this.$useXml||j.type=="xml",caching:j.caching,ignoreOffline:j["ignore-offline"]},q);return this.$get(b,d);};this.purge=function(m,l,d,n){var g=this.createMessage("multicall",[this.stack[this.url]]),b=apf.getAbsolutePath(this.baseurl||apf.config.baseurl,this.url);if(n){for(var k=[],j=0;j<n.length;j++){k.push(encodeURIComponent(n[j][0])+"="+encodeURIComponent(n[j][1]||""));}b=b+(b.match(/\?/)?"&":"?")+k.join("&");}var c=this.$get(b,{callback:m,async:d,userdata:l,nocache:true,data:g,useXML:this.$useXml});this.stack[this.url]=this.getMulticallObject?this.getMulticallObject():[];};this.revert=function(b){this.stack[b.url]=this.getMulticallObject?this.getMulticallObject():[];};this.getStackLength=function(){return this.stack[this.url]?this.stack[this.url].length:0;};this.$addMethod=function(j){if(j.localName!="method"){return false;}var d=j.name,b=j.receive||this.receive,g=0,c=j.childNodes.length,k;this[d]=function(){return this.call(d,arguments);};if(b){j.callback=b;}this.$methods[d]=j;if(!j.names){j.names=[];}for(;g<c;g++){k=j.childNodes[g];if(k.localName=="param"||k.localName=="variable"){j.names.push(k);}}return true;};this.$removeMethod=function(c){var b=c.name;delete this[b];delete this.$methods[b];};this.$setAuth=function(b){this.$auth=b;};this.exec=function(j,d,i,c){if(!c){c={};}if(c.multicall){this.forceMulticall=true;}var g=this.$methods[j];if(c.userdata){g.userdata=c.userdata;}if(!this.multicall){g.callback=i;}var b=this.call(j,d,c);if(this.multicall){return this.purge(i,"&@^%!@");}else{if(c.multicall){this.forceMulticall=false;return this;}}if(!this.multicall&&!g.async&&i){i(b,apf.SUCCESS,{tpModule:this});}};}).call(apf.rpc.prototype=new apf.Teleport());apf.config.$inheritProperties.baseurl=1;apf.aml.setElement("rpc",apf.rpc);apf.splitter=function(b,a){this.$init(a||"splitter",apf.NODE_VISIBLE,b);apf.plane.init();};(function(){this.$focussable=true;this.update=function(){var y=(this.type=="vertical")?{fsize:"fwidth",size:"width",offsetPos:"offsetLeft",offsetSize:"offsetWidth",pos:"left"}:{fsize:"fheight",size:"height",offsetPos:"offsetTop",offsetSize:"offsetHeight",pos:"top"};this.$ext.offsetTop;this.$amlNode=this.refNode;var k=this.refHtml;var m=apf.layout.vars;var r=this.oItem;var x=false;var w=k?k[y.offsetPos]:m[y.pos+"_"+r.id];var j=k?k[y.offsetSize]:m[y.size+"_"+r.id];var d=r.parent.children;for(var l=0,t=0;t<d.length;t++){if(!d[t][y.fsize]){l++;}}if(!r[y.fsize]&&l>1){for(var c=0,a=0,t=r.stackId+1;t<d.length;t++){if(!d[t][y.fsize]){c+=d[t].weight||1;a+=(d[t].node?d[t].oHtml[y.offsetSize]:m[y.size+"_"+d[t].id]);}}var n=this.$ext[y.offsetPos]-w-j;var u=(a-n)/c;for(var t=0;t<r.stackId;t++){if(!d[t][y.fsize]){d[t].original.weight=(d[t].node?d[t].oHtml[y.offsetSize]:m[y.size+"_"+d[t].id])/u;}}r.original.weight=(j+n)/u;x=true;}else{var o=r[y.fsize]?r[y.fsize].match(/^\d+$/):false;var B=r[y.fsize]?r[y.fsize].match(/^([\d\.]+)\%$/):false;if(o||B||!r[y.fsize]){var n=this.$ext[y.offsetPos]-w-j;var s=this.$ext[y.offsetPos]-w;for(var C=0,q=0,t=r.stackId+1;t<d.length;t++){if(!d[t][y.fsize]){C+=d[t].weight||1;q+=(d[t].node?d[t].oHtml[y.offsetSize]:m[y.size+"_"+d[t].id]);}}if(C>0){var g=((q-n)/C)/(q/C);for(var t=r.stackId+1;t<d.length;t++){d[t].original.weight=g*(d[t].weight||1);}}else{for(var t=r.stackId+1;t<d.length;t++){if(d[t][y.fsize].match(/^\d+$/)){var A=(d[t].node?d[t].oHtml[y.offsetSize]:m[y.size+"_"+d[t].id])-n;d[t].original[y.fsize]=""+Math.max(0,A,d[t].minheight||0);if(d[t][y.fsize]-A!=0){n=d[t][y.fsize]-A;}else{break;}}else{if(d[t][y.fsize].match(/^([\d\.]+)\%$/)){var A=(d[t].node?d[t].oHtml[y.offsetSize]:m[y.size+"_"+d[t].id])-n;d[t].original[y.fsize]=Math.max(0,((parseFloat(RegExp.$1)/(d[t].node?d[t].oHtml[y.offsetSize]:m[y.size+"_"+d[t].id]))*A))+"%";break;}}}}if(r.original[y.fsize]){r.original[y.fsize]=B?((parseFloat(B[1])/j)*s)+"%":""+s;}x=true;}}if(x){apf.layout.compile(this.$ext.parentNode);apf.layout.activateRules(this.$ext.parentNode);if(apf.hasSingleRszEvent){apf.layout.forceResize();}return;}apf.layout.forceResize(this.$ext.parentNode);};this.init=function(r,m,s){this.min=0;this.max=1000000;this.size=parseInt(r)||3;this.refNode=null;this.refHtml=null;var b;if(m){if(typeof m!="object"){m=apf.lookup(m);}this.refNode=m;this.refHtml=this.refNode.$ext;b=this.refHtml.parentNode;s=m.aData.calcData;}else{b=s.pHtml;}this.oItem=s;if(b&&b!=this.$ext.parentNode){b.appendChild(this.$ext);}var q=apf.getDiff(this.$ext);this.$verdiff=q[0];this.$hordiff=q[1];this.$sizeArr=[];this.type=s.parent.vbox?"horizontal":"vertical";var x=apf.layout.get(this.$ext.parentNode).layout;var y="splitter"+this.$uniqueId;x.addRule("var "+y+" = apf.lookup("+this.$uniqueId+").$ext");var a=[y+".style.left = "];var g=[y+".style.top = "];var j=[y+".style.width = -"+this.$hordiff+" + "];var o=[y+".style.height = -"+this.$verdiff+" + "];var n=s.parent.children[s.stackId+1];if(this.type=="horizontal"){j.push("Math.max(");if(s.node){a.push(s.id+".offsetLeft");g.push(s.id+".offsetTop + "+s.id+".offsetHeight");j.push(s.id+".offsetWidth");}else{a.push("v.left_"+s.id);g.push("v.top_"+s.id+" + v.height_"+s.id);j.push("v.width_"+s.id);}j.push(",",n?(n.node?n.id+".offsetWidth":"v.width_"+n.id):0,")");x.addRule(j.join(""));this.$ext.style.height=(s.splitter-this.$hordiff)+"px";}else{o.push("Math.max(");if(s.node){a.push(s.id+".offsetLeft + "+s.id+".offsetWidth");g.push(s.id+".offsetTop");o.push(s.id+".offsetHeight");}else{a.push("v.left_"+s.id+" + v.width_"+s.id);g.push("v.top_"+s.id);o.push("v.height_"+s.id);}o.push(",",n?(n.node?n.id+".offsetHeight":"v.height_"+n.id):0,")");x.addRule(o.join(""));this.$ext.style.width=(s.splitter-this.$hordiff)+"px";}x.addRule(a.join(""));x.addRule(g.join(""));var k=s.parent.children;if(this.type=="vertical"){x.addRule(y+".host.min = "+(s.node?"document.getElementById('"+s.id+"').offsetLeft":"v.left_"+s.id)+" + "+parseInt(s.minwidth||s.childminwidth||10));var t=[],c=[];for(var l=false,u=s.stackId+1;u<k.length;u++){if(!k[u].fwidth){l=true;}}for(var w,u=s.stackId+1;u<k.length;u++){w=k[u];if(w.minwidth||w.childminheight){t.push(parseInt(w.minwidth||w.childminheight));}else{if(w.fwidth){if(!l&&u==s.stackId+1){t.push(10);}else{if(w.fwidth.indexOf("%")!=-1){t.push("("+w.parent.innerspace+") * "+(parseFloat(w.fwidth)/100));}else{t.push(w.fwidth);}}}else{t.push(10);}}t.push(w.edgeMargin);}x.addRule(y+".host.max = v.left_"+s.parent.id+" + v.width_"+s.parent.id+" - ("+(t.join("+")||0)+")");}else{x.addRule(y+".host.min = "+(s.node?"document.getElementById('"+s.id+"').offsetTop":"v.top_"+s.id)+" + "+parseInt(s.minheight||s.childminheight||10));var t=[],c=[];for(var l=false,u=s.stackId+1;u<k.length;u++){if(!k[u].fheight){l=true;}}if(!l&&n&&n.state>0){return this.$ext.parentNode.removeChild(this.$ext);}for(var w,u=s.stackId+1;u<k.length;u++){w=k[u];if(w.minheight||w.childminheight){t.push(parseInt(w.minheight||w.childminheight));}else{if(w.fheight){if(!l&&u==s.stackId+1){t.push(10);}else{if(w.fheight.indexOf("%")!=-1){t.push("("+w.parent.innerspace+") * "+(parseFloat(w.fheight)/100));}else{t.push(w.fheight);}}}else{t.push(10);}}if(w.edgeMargin){t.push(w.edgeMargin);}}x.addRule(y+".host.max = v.top_"+s.parent.id+" + v.height_"+s.parent.id+" - ("+(t.join("+")||0)+")");}this.$setStyleClass(this.$ext,this.type,[this.type=="horizontal"?"vertical":"horizontal"]);if(this.type=="vertical"){this.$setStyleClass(this.$ext,"w-resize",["n-resize"]);}else{this.$setStyleClass(this.$ext,"n-resize",["w-resize"]);}return this;};this.$draw=function(){this.$ext=this.$getExternal();var a=this;this.$ext.onmousedown=function(c){if(!c){c=event;}var b=a;var d=apf.getAbsolutePosition(this);if(b.type=="vertical"){b.tx=c.clientX-d[0];}else{b.ty=c.clientY-d[1];}b.startPos=b.type=="vertical"?this.offsetLeft:this.offsetTop;c.returnValue=false;c.cancelBubble=true;apf.plane.show(this);b.$setStyleClass(this,"moving");b.$setStyleClass(document.body,b.type=="vertical"?"w-resize":"n-resize",[b.type=="vertical"?"n-resize":"w-resize"]);document.onmouseup=function(){b.$setStyleClass(b.$ext,"",["moving"]);apf.plane.hide();b.update();b.$setStyleClass(document.body,"",["n-resize","w-resize"]);document.onmouseup=document.onmousemove=null;};document.onmousemove=function(g){if(!g){g=event;}if(b.type=="vertical"){if(g.clientX>=0){var i=apf.getAbsolutePosition(b.$ext.offsetParent);b.$ext.style.left=(Math.min(b.max,Math.max(b.min,(g.clientX-i[0])-b.tx)))+"px";}}else{if(g.clientY>=0){var i=apf.getAbsolutePosition(b.$ext.offsetParent);b.$ext.style.top=(Math.min(b.max,Math.max(b.min,(g.clientY-i[1])-b.ty)))+"px";}}g.returnValue=false;g.cancelBubble=true;};};};this.$loadAml=function(b){if(this.left||this.top){var g=this.left||this.top;var d=this.right||this.bottom;g=g.split(/\s*,\s*/);d=d.split(/\s*,\s*/);for(var c=0;c<g.length;c++){g[c]=g[c];}for(var c=0;c<d.length;c++){d[c]=d[c];}var a=this;$setTimeout(function(){this.$amlNode.init(a.type,a.size,a.min,a.max,a.change,g,d);});}};}).call(apf.splitter.prototype=new apf.Presentation());apf.aml.setElement("splitter",apf.splitter);apf.radiobutton=function(c,a){this.$init(a||"radiobutton",apf.NODE_VISIBLE,c);this.$constructor=apf.radiobutton;var b=apf.aml.setElement("radiobutton",function(){this.$init(a||"radiobutton",apf.NODE_VISIBLE,c);});b.prototype=apf.radiobutton.prototype;apf.radiobutton=b;};(function(){this.implement(apf.ChildValue);this.$childProperty="label";this.$focussable=true;this.$booleanProperties.checked=true;this.$supportedProperties.push("value","background","group","label","checked","tooltip","icon");this.$propHandlers.group=function(a){if(this.$group&&this.$group.$removeRadio){this.$group.$removeRadio(this);}if(!a){this.$group=null;return;}var b=typeof a=="string"?apf.nameserver.get("radiogroup",a):a;if(!b){b=apf.nameserver.register("radiogroup",a,new apf.$group());b.setAttribute("id",a);b.dispatchEvent("DOMNodeInsertedIntoDocument");b.parentNode=this;}this.$group=b;if(this.oInput){this.oInput.setAttribute("name",a);}this.$group.$addRadio(this);};this.$propHandlers.tooltip=function(a){this.$ext.setAttribute("title",a);};this.$propHandlers.icon=function(a){if(!this.oIcon){return;}if(a){this.$setStyleClass(this.$ext,this.$baseCSSname+"Icon");}else{this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Icon"]);}apf.skins.setIcon(this.oIcon,a,this.iconPath);};this.$propHandlers.label=function(a){if(a){this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Empty"]);}else{this.$setStyleClass(this.$ext,this.$baseCSSname+"Empty");}if(this.oLabel){this.oLabel.innerHTML=a;}};this.$propHandlers.checked=function(a){if(!this.$group){return;}if(a){this.$group.setProperty("value",this.value);}};this.addEventListener("prop.model",function(a){if(this.$group){this.$group.setProperty("model",a.value);}});this.$propHandlers.background=function(c){var d=this.$getLayoutNode("main","background",this.$ext);if(c){var a=c.split("|");this.$background=a.concat(["vertical",2,16].slice(a.length-1));d.style.backgroundImage="url("+this.mediaPath+a[0]+")";d.style.backgroundRepeat="no-repeat";}else{d.style.backgroundImage="";d.style.backgroundRepeat="";this.$background=null;}};this.setValue=function(a){this.setProperty("value",a,false,true);};this.getValue=function(){return this.value;};this.check=function(){this.setProperty("checked",true,false,true);};this.uncheck=function(){this.setProperty("checked",false,false,true);};this.getGroup=function(){return this.$group;};this.$check=function(a){this.$setStyleClass(this.$ext,this.$baseCSSname+"Checked");this.checked=true;if(this.oInput){this.oInput.checked=true;}this.doBgSwitch(2);};this.$uncheck=function(){this.$setStyleClass(this.$ext,"",[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;}var a=this;this.$ext.onclick=function(b){if(!b){b=event;}if((b.srcElement||b.target)==this){return;}a.dispatchEvent("click",{htmlEvent:b});a.$group.change(a.value);};this.$ext.onmousedown=function(b){if(!b){b=event;}if((b.srcElement||b.target)==this){return;}apf.setStyleClass(this,a.$baseCSSname+"Down");};this.$ext.onmouseover=function(b){if(!b){b=event;}if((b.srcElement||b.target)==this){return;}apf.setStyleClass(this,a.$baseCSSname+"Over");};this.$ext.onmouseout=this.$ext.onmouseup=function(){apf.setStyleClass(this,"",[a.$baseCSSname+"Down",a.$baseCSSname+"Over"]);};};this.$disable=function(){if(this.oInput){this.oInput.disabled=true;}this.$ext.onclick=null;this.$ext.onmousedown=null;};this.doBgSwitch=function(b){if(this.bgswitch&&(this.bgoptions[1]>=b||b==4)){if(b==4){b=this.bgoptions[1]+1;}var a=this.bgoptions[0]=="vertical"?"0 -"+(parseInt(this.bgoptions[2])*(b-1))+"px":"-"+(parseInt(this.bgoptions[2])*(b-1))+"px 0";this.$getLayoutNode("main","background",this.$ext).style.backgroundPosition=a;}};this.$focus=function(){if(!this.$ext){return;}if(this.oInput&&this.oInput.disabled){return false;}this.$setStyleClass(this.$ext,this.$baseCSSname+"Focus");};this.$blur=function(){if(!this.$ext){return;}this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Focus"]);};this.addEventListener("keydown",function(c){var a=c.keyCode;if(a==13||a==32){this.$group.change(this.value);return false;}else{if(a==38){var b=this;while(b&&b.previousSibling){b=b.previousSibling;if(b.localName=="radiobutton"&&!b.disabled&&b.$group==this.$group){b.check();b.focus();return;}}}else{if(a==40){var b=this;while(b&&b.nextSibling){b=b.nextSibling;if(b.localName=="radiobutton"&&!b.disabled&&b.$group==this.$group){b.check();b.focus();return;}}}}}},true);this.$draw=function(){this.$ext=this.$getExternal();this.oInput=this.$getLayoutNode("main","input",this.$ext);this.oLabel=this.$getLayoutNode("main","label",this.$ext);this.oIcon=this.$getLayoutNode("main","icon",this.$ext);if(this.oLabel&&this.oLabel.nodeType!=1){this.oLabel=this.oLabel.parentNode;}this.enable();};this.$childProperty="label";this.$loadAml=function(a){if(this.parentNode.localName=="group"){this.$propHandlers.group.call(this,this.parentNode);}if(!this.$group){this.$propHandlers.group.call(this,"radiogroup"+this.parentNode.$uniqueId);}};this.$destroy=function(){if(this.$group){this.$group.$removeRadio(this);}};}).call(apf.radiobutton.prototype=new apf.Presentation());apf.aml.setElement("radiobutton",apf.radiobutton);apf.$group=function(d,a){this.$init(a||"radiogroup",apf.NODE_VISIBLE,d);this.implement(apf.StandardBinding,apf.DataAction);var c=[];this.$supportedProperties.push("value","selectedItem");this.$propHandlers.value=function(j){for(var g=0;g<c.length;g++){if(c[g].value==j){return this.setProperty("selectedItem",c[g]);}}return this.setProperty("selectedItem",null);};var b;this.$propHandlers.selectedItem=function(j){if(b){b.$uncheck();}if(!j){return;}j.$check();b=j;for(var g=0;g<c.length;g++){c[g].setProperty("selectedItem",j);}};this.$addRadio=function(g){var i=c.push(g)-1;if(!g.value){g.setProperty("value",i);}if(this.value&&g.value==this.value){this.setProperty("selectedItem",g);}else{if(g.checked){this.setProperty("value",g.value);}}};this.$removeRadio=function(g){c.remove(g);if(g.value===g.id){g.setProperty("value","");}if(g.selectedItem==g){this.setProperty("value",null);}};this.setValue=function(g){this.setProperty("value",g);};this.getValue=function(){return this.value;};this.$draw=function(){this.$ext=this.$int=this.$pHtmlNode;};};apf.$group.prototype=new apf.GuiElement();apf.aml.setElement("group",apf.$group);apf.browser=function(b,a){this.$init(a||"browser",apf.NODE_VISIBLE,b);};(function(){this.implement(apf.DataAction,apf.StandardBinding);this.$supportedProperties.push("value","src");this.$propHandlers.src=this.$propHandlers.value=function(value,force){try{this.$browser.src=value||"about:blank";}catch(e){this.$browser.src="about:blank";}};this.getValue=function(){return this.value||this.src;};this.getURL=function(){return this.$browser.src;};this.back=function(){this.$browser.contentWindow.history.back();};this.forward=function(){this.$browser.contentWindow.history.forward();};this.reload=function(){this.$browser.src=this.$browser.src;};this.print=function(){this.$browser.contentWindow.print();};this.runCode=function(str,noError){if(noError){try{this.$browser.contentWindow.eval(str);}catch(e){}}else{this.$browser.contentWindow.eval(str);}};this.$draw=function(parentNode){if(!parentNode){parentNode=this.$pHtmlNode;}if(apf.cannotSizeIframe){this.$ext=parentNode.appendChild(document.createElement("DIV")).appendChild(document.createElement("<iframe frameborder='0'></iframe>")).parentNode;this.$ext.style.width="100px";this.$ext.style.height="100px";this.$browser=this.$ext.firstChild;this.$browser.style.width="100%";this.$browser.style.height="100%";this.$browser.frameBorder=0;}else{this.$ext=parentNode.appendChild(document.createElement("iframe"));this.$ext.style.width="100px";this.$ext.style.height="100px";this.$browser=this.$ext;}var _self=this;apf.addListener(this.$browser,"load",function(){_self.dispatchEvent("load");});apf.addListener(this.$browser,"error",function(){_self.dispatchEvent("error");});this.$ext.host=this;this.$ext.style.borderTop="1px solid #c3c3c3";};}).call(apf.browser.prototype=new apf.GuiElement());apf.aml.setElement("browser",apf.browser);apf.script=function(){this.$init("script",apf.NODE_HIDDEN);};(function(){this.$propHandlers.src=function(a){if(apf.isOpera){$setTimeout(function(){apf.window.loadCodeFile(apf.hostPath+a);},1000);}else{apf.window.loadCodeFile(apf.getAbsolutePath(apf.hostPath,a));}};this.addEventListener("DOMNodeInserted",function(b){if(b.currentTarget.nodeType!=1){var a=b.currentTarget.nodeValue;if(!this.type||this.type=="text/javascript"){apf.exec(a);}else{if(this.type=="application/livemarkup"||this.type=="application/lm"){this.$setDynamicProperty("$data",a);}}}});this.addEventListener("DOMNodeInsertedIntoDocument",function(j){var b=this.childNodes,d=[];for(var c=0,a=b.length;c<a;c++){d[d.length]=b[c].nodeValue;}var g=d.join("\n");if(!this.type||this.type=="text/javascript"){apf.exec(g);}else{if(this.type=="application/livemarkup"||this.type=="application/lm"){this.$setDynamicProperty("$data",g);}}});}).call(apf.script.prototype=new apf.AmlElement());apf.aml.setElement("script",apf.script);apf.text=function(b,a){this.$init(a||"text",apf.NODE_VISIBLE,b);};(function(){this.implement(apf.ChildValue,apf.Cache);this.$focussable=true;this.focussable=false;this.$allowSelect=true;this.$hasStateMessages=true;this.$textTimer=this.$lastMsg=this.$lastClass=this.$changedHeight=null;this.$booleanProperties.scrolldown=true;this.$booleanProperties.secure=true;this.$supportedProperties.push("behavior","scrolldown","secure","value");this.$propHandlers.behavior=function(a){this.addOnly=a=="addonly";};this.$propHandlers.value=function(b){var a=false;if(b){this.$removeClearMessage();}if(typeof b!="string"){b=b?b.toString():"";}if(this.secure){b=b.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(a){a.contents+=b;}else{this.$container.insertAdjacentHTML("beforeend",b);}}else{b=b.replace(/\<\?xml version="1\.0" encoding="UTF-16"\?\>/,"");if(a){a.contents=b;}else{this.$container.innerHTML=b;}}if(apf.cannotSizeIframe&&this.oIframe){this.oIframe.style.width=this.oIframe.offsetWidth+"px";}if(this.scrolldown&&this.$scrolldown){this.oScroll.scrollTop=this.oScroll.scrollHeight;}};this.$propHandlers["empty-message"]=function(a){if(!this.childNodes.length){this.$setClearMessage(this["empty-message"]);}};this.setValue=function(a){this.setProperty("value",a,false,true);};this.getValue=function(){return this.$container.innerHTML;};this.addEventListener("keydown",function(b){var a=b.keyCode;switch(a){case 33:this.$container.scrollTop-=this.$container.offsetHeight;break;case 34:this.$container.scrollTop+=this.$container.offsetHeight;break;case 35:this.$container.scrollTop=this.$container.scrollHeight;break;case 36:this.$container.scrollTop=0;break;case 38:this.$container.scrollTop-=10;break;case 40:this.$container.scrollTop+=10;break;default:return;}return false;},true);this.$xmlUpdate=function(g,b,d,c){if(this.addOnly&&g!="add"){return;}if(c){c.xmlNode=this.addOnly?b:this.xmlRoot;}if(this.addOnly){apf.xmldb.nodeConnect(this.documentId,b,null,this);var a=this.$findHtmlNode(d.getAttribute("id")+"|"+this.$uniqueId);this.$propHandlers.value.call(this,this.$applyBindRule("value",b)||"");}else{this.$propHandlers.value.call(this,this.$applyBindRule("value",this.xmlRoot)||"");}};this.$load=function(b){apf.xmldb.addNodeListener(b,this);var c=this.$applyBindRule("value",b);if(c||typeof c=="string"){if(this.caching){var a=this.$findHtmlNode(b.getAttribute("id")+"|"+this.$uniqueId);if(a){a.contents=c;}}this.$propHandlers.value.call(this,c);}else{this.$propHandlers.value.call(this,"");}};this.$getCurrentFragment=function(){return{nodeType:1,contents:this.$container.innerHTML};};this.$setCurrentFragment=function(a){this.$container.innerHTML=a.contents;if(this.scrolldown){this.$container.scrollTop=this.$container.scrollHeight;}};this.$setClearMessage=this.$updateClearMessage=function(b,a){if(this.$lastClass){this.$removeClearMessage();}apf.setStyleClass(this.$ext,(this.$lastClass=this.$baseCSSname+(a||"Empty").uCaseFirst()));if(b){if(!this.height){if(this.$container.offsetHeight&&apf.getStyle(this.$container,"height")=="auto"&&(this.$changedHeight=true)){this.$container.style.height=(this.$container.offsetHeight-apf.getHeightDiff(this.$container))+"px";}this.$container.innerHTML=b;}this.$lastMsg=this.$container.innerHTML;}};this.$removeClearMessage=function(){if(this.$lastClass){apf.setStyleClass(this.$ext,"",[this.$lastClass]);this.$lastClass=null;}if(this.$container.innerHTML==this.$lastMsg){if(this.$changedHeight&&!(this.$changedHeight=false)){this.$container.style.height="";}this.$container.innerHTML="";}};this.caching=false;this.$draw=function(){var a=this;this.$ext=this.$getExternal();this.$container=this.$getLayoutNode("main","container",this.$ext);if(apf.hasCssUpdateScrollbarBug&&!apf.getStyle(this.$container,"padding")){this.$fixScrollBug();}this.oScroll=this.oFocus?this.oFocus.parentNode:this.$container;this.$scrolldown=true;this.oScroll.onscroll=function(){a.$scrolldown=this.scrollTop>=this.scrollHeight-this.offsetHeight+apf.getVerBorders(this);};clearInterval(this.$textTimer);this.$textTimer=setInterval(function(){if(a.oScroll&&a.$scrolldown&&a.scrolldown){a.oScroll.scrollTop=a.oScroll.scrollHeight;}},60);if(this.$container.tagName.toLowerCase()=="iframe"){if(apf.isIE){this.oIframe=this.$container;var c=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>'+(c?c.firstChild.nodeValue:"")+"</style>                        <script>                            document.onkeydown = function(e){                                if (!e) e = event;                                if (top.apf.disableF5 && e.keyCode == 116) {                                    e.keyCode = 0;                                    return false;                                }                            }                        <\/script>                    </head>                    <body oncontextmenu='return false'></body>");this.$container=this.oIframe.contentWindow.document.body;}else{var b=document.createElement("div");this.$ext.parentNode.replaceChild(b,this.$ext);b.className=this.$ext.className;this.$ext=this.$container=b;}}else{this.$container.onselectstart=function(d){(d?d:event).cancelBubble=true;};this.$container.oncontextmenu=function(d){if(!this.host.contextmenus){(d?d:event).cancelBubble=true;}};this.$container.style.cursor="";this.$container.onmouseover=function(d){if(!self.STATUSBAR){return;}if(!d){d=event;}if(d.srcElement.tagName.toLowerCase()=="a"){if(!this.lastStatus){this.lastStatus=STATUSBAR.getStatus();}STATUSBAR.status("icoLink.gif",d.srcElement.getAttribute("href"));}else{if(this.lastStatus){STATUSBAR.status(this.lastStatus[0],this.lastStatus[1]);this.lastStatus=false;}}};}};this.addEventListener("DOMNodeRemovedFromDocument",function(){clearInterval(this.$textTimer);apf.destroyHtmlNode(this.oDrag);if(this.oScroll){this.oScroll.onscoll=this.oScroll=null;}this.oDrag=this.oIframe=this.oFocus=null;});}).call(apf.text.prototype=new apf.BaseSimple());apf.aml.setElement("text",apf.text);apf.actiontracker=function(b,a){this.$init(a||"actiontracker",apf.NODE_HIDDEN,b);this.$stackDone=[];this.$stackUndone=[];this.$execStack=[];};(function(){this.$lastExecStackItem=null;this.realtime=true;this.undolength=0;this.redolength=0;this.$booleanProperties={};this.$booleanProperties.realtime=true;this.$supportedProperties=["realtime","undolength","redolength","alias"];this.$handlePropSet=function(d,c,b){switch(d){case"undolength":this.undolength=this.$stackDone.length;break;case"redolength":this.redolength=this.$stackUndone.length;break;default:this[d]=c;}};this.addEventListener("DOMNodeInsertedIntoDocument",function(b){if(this.parentNode){this.parentNode.$at=this;}});this.define=function(c,b){apf.actiontracker.actions[c]=b;};this.getParent=function(){return this.parentNode&&this.parentNode.getActionTracker?this.parentNode.getActionTracker(true):(apf.window.$at!=this?apf.window.$at:null);};this.getDone=function(d){if(typeof d!="number"){return[];}for(var g,b,c=b=this.$stackDone.length;c>=0;--c){if(!(g=this.$stackDone[c])||!g.timestamp){continue;}if(g.timestamp>=d){return this.$stackDone.slice(c);}}return[];};this.getUndone=function(d){if(typeof d!="number"){return[];}for(var g,c=0,b=this.$stackDone.length;c<b;++c){if(!(g=this.$stackUndone[c])||!g.timestamp){continue;}if(g.timestamp<=d){return this.$stackUndone.slice(0,c+1);}}return[];};this.execute=function(b){if(this.dispatchEvent("beforechange",b)===false){return;}var c=new apf.UndoData(b,this);if(b.action){apf.actiontracker.actions[b.action](c,false,this);}c.id=this.$stackDone.push(c)-1;this.setProperty("undolength",this.$stackDone.length);if(c.multiple){this.$addToQueue(c.multiple,false,true);}else{this.$addToQueue(c,false);}this.$stackUndone.length=0;this.setProperty("redolength",this.$stackUndone.length);this.dispatchEvent("afterchange",{action:"do"});return c;};this.$addActionGroup=function(b,d){var c=new apf.UndoData("group",null,[apf.copyArray(b,UndoData),apf.copyArray(d,UndoData)]);this.$stackDone.push(c);this.setProperty("undolength",this.$stackDone.length);this.dispatchEvent("afterchange",{action:"group",done:b});};this.purge=function(c,b){if(true){if(this.$execStack.length){this.$execStack[0].undoObj.saveChange(this.$execStack[0].undo,this);this.$lastExecStackItem=this.$execStack[this.$execStack.length-1];}}else{if(parent){this.reset();}}};this.reset=function(){this.$stackDone.length=this.$stackUndone.length=0;this.setProperty("undolength",0);this.setProperty("redolength",0);this.dispatchEvent("afterchange",{action:"reset"});};this.undo=function(d,c,b){a.call(this,d,c,true,b);};this.redo=function(d,c,b){a.call(this,d,c,false,b);};function a(m,l,c,b){var d=c?this.$stackDone:this.$stackUndone,k=c?this.$stackUndone:this.$stackDone;if(!d.length){return;}if(l){var j=d[m];if(!j){return;}d.length--;k.push(j);if(j.action){apf.actiontracker.actions[j.action](j,c,this);}if(!b){if(j.multiple){this.$addToQueue(j.multiple,c,true);}else{this.$addToQueue(j,c);}}this.setProperty("undolength",this.$stackDone.length);this.setProperty("redolength",this.$stackUndone.length);return j;}if(this.dispatchEvent("beforechange")===false){return;}if(m==-1){m=d.length;}if(!m){m=1;}var g=0;while(g<m&&d.length>0){if(!d[d.length-1]){d.length--;this.$stackDone=[];this.$stackUndone=[];return false;}else{a.call(this,d.length-1,true,c,b);g++;}}this.dispatchEvent("afterchange",{action:c?"undo":"redo",rollback:b});}this.$receive=function(g,d,b,c,j){if(d==apf.TIMEOUT&&b.tpModule.retryTimeout(b,d,this)===true){return true;}if(d!=apf.SUCCESS){if(this.dispatchEvent("actionfail",apf.extend(b,{state:d,message:"Could not sent Action RPC request for control "+this.name+"["+this.localName+"] \n\n"+b.message,bubbles:true}))===false){return true;}if(typeof apf.offline!="undefined"&&!apf.offline.reloading){this.undo(c.id,b.userdata,true);}if(j){j(!b.userdata);}if(!b.userdata){this.$execStack=[];var i=new Error(apf.formatErrorString(0,this,"Executing action","Error sending action to the server:\n"+(b.url?"Url:"+b.url+"\n\n":"")+b.message));if((c&&c.xmlActionNode||b.amlNode||apf).dispatchEvent("error",apf.extend({error:i,state:d,bubbles:true},b))===false){return;}throw i;}}else{this.dispatchEvent("actionsuccess",apf.extend(b,{state:d,bubbles:true},b));c.processRsbQueue();if(j){j();}}this.$queueNext(c,j);};this.$addToQueue=function(g,c,l){if(!l&&this.$execStack.length&&!g.state&&this.$execStack[this.$execStack.length-1].undoObj==g){this.$execStack.length--;g.clearRsbQueue();return;}var b,j,k;if(l){k=this.$execStack.shift();for(var d=0;d<g.length;d++){j=g[d];this.$execStack.unshift({undoObj:(j.tagName?j:new apf.UndoData(j,this)).preparse(c,this),undo:c});}if(k){this.$execStack.unshift(k);}return;}k={undoObj:g.preparse(c,this),undo:c};b=this.$execStack.push(k)-1;if(this.$execStack.length==1&&this.realtime){g.saveChange(c,this);}};this.$queueNext=function(c,d){if(!this.$execStack[0]||this.$execStack[0].undoObj!=c){throw new Error(apf.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."));}c.state=null;var b=this.$execStack.shift();if(!this.$execStack[0]||b==this.$lastExecStackItem){return;}this.$execStack[0].undoObj.saveChange(this.$execStack[0].undo,this,d);};}).call(apf.actiontracker.prototype=new apf.AmlElement());apf.aml.setElement("actiontracker",apf.actiontracker);apf.UndoData=function(d,b){this.localName="UndoData";this.extra={};this.rsbQueue={};this.$dontapply=false;apf.extend(this,d);if(b){this.at=b;}else{if(d&&d.tagName=="UndoData"){this.args=d.args.slice();this.rsbArgs=d.rsbArgs.slice();}else{this.selNode=this.selNode||(this.action=="removeNode"?this.args[0]:(this.amlNode?this.amlNode.selected:null));}}var c,a=this;this.processRsbQueue=function(){if(this.rsbModel){this.rsbModel.rsb.processQueue(this);}};this.clearRsbQueue=function(){this.rsbQueue=this.rsbModel=null;};this.saveChange=function(i,g,l){if(this.action=="group"){var k=this.args[1];g.$addToQueue(k,i,true);return g.$queueNext(this);}var j;if(this.xmlActionNode){j=this.xmlActionNode.getAttribute(i?"undo":"set");if(i&&!j){j=this.xmlActionNode.getAttribute("set");}}if(!j){this.processRsbQueue();return g.$queueNext(this);}this.state=i?"restoring":"saving";if(c._pc==-2){return g.$receive(null,apf.SUCCESS,{amlNode:this.amlNode},this,l);}c.callback=function(o,n,m){m.amlNode=a.amlNode;return g.$receive(o,n,m,a,l);};c.ignoreOffline=true;apf.saveData(j,c);};this.preparse=function(i,g,j){var k;if(this.xmlActionNode){k=this.xmlActionNode.getAttribute(i?"undo":"set");if(i&&!k){k=this.xmlActionNode.getAttribute("set");}}if(!k){return this;}c=apf.extend({xmlNode:this.action=="multicall"?this.args[0].xmlNode:this.selNode||this.xmlNode,userdata:apf.isTrue(this.xmlActionNode.getAttribute("ignore-fail")),multicall:j,undo:i,_pc:true,callback:function(n,m,l){c._pc=-2;}},this.extra);apf.saveData(k,c);if(c._pc===true){c._pc=-1;}return this;};};apf.actiontracker.actions={setTextNode:function(c,a){var b=c.args;if(!a){apf.xmldb.setTextNode(b[0],b[1],b[2],c);}else{apf.xmldb.setTextNode(b[0],c.extra.oldValue,b[2]);}},setAttribute:function(c,a){var b=c.args;if(!a){c.extra.name=b[1];c.extra.oldValue=b[0].getAttribute(b[1]);apf.xmldb.setAttribute(b[0],b[1],b[2],b[3],c);}else{if(!c.extra.oldValue){apf.xmldb.removeAttribute(b[0],b[1]);}else{apf.xmldb.setAttribute(b[0],b[1],c.extra.oldValue,b[3]);}}},removeAttribute:function(c,a){var b=c.args;if(!a){c.extra.name=b[1];c.extra.oldValue=b[0].getAttribute(b[1]);apf.xmldb.removeAttribute(b[0],b[1],b[2],c);}else{apf.xmldb.setAttribute(b[0],b[1],c.extra.oldValue,b[2]);}},setAttributes:function(d,b){var g,c=d.args;if(!b){var a={};for(g in c[1]){a[g]=c[0].getAttribute(g);c[0].setAttribute(g,c[1][g]);}d.extra.oldValues=a;apf.xmldb.applyChanges("attribute",c[0],d);}else{for(g in d.oldValues){if(!d.extra.oldValues[g]){c[0].removeAttribute(g);}else{c[0].setAttribute(g,d.extra.oldValues[g]);}}apf.xmldb.applyChanges("attribute",c[0],d);}},replaceNode:function(c,a){var b=c.args;if(!a){apf.xmldb.replaceNode(b[1],b[0],b[2],c);}else{apf.xmldb.replaceNode(b[0],b[1],b[2],c);}},addChildNode:function(c,a){var b=c.args;if(!a){apf.xmldb.addChildNode(b[0],b[1],b[2],b[3],c);}else{apf.xmldb.removeNode(c.extra.addedNode);}},appendChild:function(c,a){var b=c.args;if(!a){apf.xmldb.appendChild(b[0],b[1],b[2],b[3],b[4],c);}else{apf.xmldb.removeNode(c.xmlNode);}},moveNode:function(c,a){var b=c.args;if(!a){apf.xmldb.moveNode(b[0],b[1],b[2],b[3],c);}else{apf.xmldb.moveNode(c.extra.oldParent,b[1],c.extra.beforeNode,b[3]);}},removeNode:function(c,a){var b=c.args;if(!a){apf.xmldb.removeNode(b[0],b[1],c);}else{apf.xmldb.appendChild(c.extra.parent,c.extra.removedNode,c.extra.beforeNode);}},removeNodeList:function(c,a){if(a){var g=c.extra.removeList;for(var b=g.length-1;b>=0;b--){apf.xmldb.appendChild(g[b].pNode,g[b].removedNode,g[b].beforeNode);}}else{apf.xmldb.removeNodeList(c.args,c);}},setUndoObject:function(c,a){var b=c.args;c.xmlNode=b[0];},group:function(d,c,a){if(!d.$stackDone){var b=d.args[0];d.$stackDone=b;d.$stackUndone=[];}a[c?"undo":"redo"](d.$stackDone.length,false,d.$stackDone,d.$stackUndone);},setProperty:function(c,a){var b=c.args;if(!a){c.extra.oldValue=b[0][b[1]];b[0].setProperty(b[1],b[2],b[3],b[4]);}else{b[0].setProperty(b[1],c.extra.oldValue);}},setValueByXpath:function(d,a){var c=d.args;if(!a){if(d.extra.newNode){apf.xmldb.appendChild(d.extra.parentNode,d.extra.newNode);}else{var b=[];apf.setNodeValue(c[0],c[1],true,{undoObj:d,xpath:c[2],newNodes:b,forceNew:c[3]});d.extra.newNode=b[0];}}else{if(d.extra.newNode){d.extra.parentNode=d.extra.newNode.parentNode;apf.xmldb.removeNode(d.extra.newNode);}else{apf.setNodeValue(d.extra.appliedNode,d.extra.oldValue,true);}}},multicall:function(k,c,a){var d,b,j=k.args,g=apf.xmldb.delayUpdate;apf.xmldb.delayUpdate=true;if(!c){for(d=0,b=j.length;d<b;d++){if(!j[d].extra){j[d].extra={};}if(j[0].rsbModel){j[d].rsbQueue=j[0].rsbQueue;}apf.actiontracker.actions[j[d].func](j[d],false,a);}if(j[0].rsbModel){k.rsbModel=j[0].rsbModel;k.rsbQueue=j[0].rsbQueue;}}else{for(d=j.length-1;d>=0;d--){apf.actiontracker.actions[j[d].func](j[d],true,a);}}apf.xmldb.delayUpdate=g;},addRemoveNodes:function(g,b){var c,a,d=g.args;if(!b){for(c=0,a=d[1].length;c<a;c++){apf.xmldb.appendChild(d[0],d[1][c],null,null,null,g);}for(c=0,a=d[2].length;c<a;c++){apf.xmldb.removeNode(d[2][c],null,g);}}else{for(c=0,a=d[2].length;c<a;c++){apf.xmldb.appendChild(d[0],d[2][c]);}for(c=0,a=d[1].length;c<a;c++){apf.xmldb.removeNode(d[1][c]);}}}};apf["switch"]=function(b,a){this.$hasButtons=false;this.$init(a||"switch",apf.NODE_VISIBLE,b);};apf.pages=function(b,a){this.$hasButtons=false;this.$init(a||"pages",apf.NODE_VISIBLE,b);};apf.tab=function(b,a){this.$hasButtons=true;this.$init(a||"tab",apf.NODE_VISIBLE,b);};(function(){this.$focussable=apf.KEYBOARD;this.$draw=function(a){this.$ext=this.$getExternal();this.$loadChildren();};}).call(apf.tab.prototype=new apf.BaseTab());apf["switch"].prototype=apf.pages.prototype=apf.tab.prototype;apf.aml.setElement("switch",apf["switch"]);apf.aml.setElement("pages",apf.pages);apf.aml.setElement("tab",apf.tab);apf.input=function(b,a){this.$init(a||"input",apf.NODE_VISIBLE,b);};apf.secret=function(b,a){this.$init(a||"secret",apf.NODE_VISIBLE,b);};apf.password=function(b,a){this.$init(a||"password",apf.NODE_VISIBLE,b);};apf.textarea=function(b,a){this.$init(a||"textarea",apf.NODE_VISIBLE,b);this.multiline=true;};apf.email=function(b,a){this.$init(a||"email",apf.NODE_VISIBLE,b);};apf.textbox=function(b,a){this.$init(a||"textbox",apf.NODE_VISIBLE,b);};(function(){this.implement(apf.DataAction);this.$focussable=true;this.$masking=false;this.$childProperty="value";this.value="";this.isContentEditable=true;this.multiline=false;this.$booleanProperties.focusselect=true;this.$booleanProperties.realtime=true;this.$supportedProperties.push("value","mask","initial-message","focusselect","realtime","type");this.$propHandlers.value=function(c,d,b){if(!this.$input||!b&&this.getValue()==c){return;}if(!b&&!c){this.clear();}else{if(this.isHTMLBox){if(this.$input.innerHTML!=c){this.$input.innerHTML=c;}}else{if(this.$input.value!=c){this.$input.value=c;}}}if(this.$button){this.$button.style.display=c&&!b?"block":"none";}};this.addEventListener("prop.maxlength",function(b){if(this.$input.tagName.toLowerCase().match(/input|textarea/)){this.$input.maxLength=parseInt(b.value)||null;}});this.$propHandlers.mask=function(b){if(this.mask.toLowerCase()=="password"){return;}if(!b){throw new Error("Not Implemented");}if(!this.$masking){this.$masking=true;this.implement(apf.textbox.masking);this.focusselect=false;}this.setMask(this.mask);};this.$propHandlers["initial-message"]=function(b){if(b){if(apf.hasFocusBug){this.$input.onblur();}}if(!this.value){this.clear();}};this.$propHandlers.focusselect=function(c){var b=this;this.$input.onmousedown=function(){b.focusselect=false;};this.$input.onmouseup=this.$input.onmouseout=function(){b.focusselect=c;};};this.$propHandlers.type=function(b){if(b&&"password|username".indexOf(b)>-1&&typeof this.focusselect=="undefined"){this.focusselect=true;this.$propHandlers.focusselect.call(this,true);}};this.setValue=function(b){return this.setProperty("value",b,false,true);};this.clear=function(){if(this["initial-message"]){this.$propHandlers.value.call(this,this["initial-message"],null,true);apf.setStyleClass(this.$ext,this.$baseCSSname+"Initial");}else{this.$propHandlers.value.call(this,"",null,true);}this.dispatchEvent("clear");};this.getValue=function(){var b=this.isHTMLBox?this.$input.innerHTML:this.$input.value;return b==this["initial-message"]?"":b.replace(/\r/g,"");};this.select=function(){try{this.$input.select();}catch(b){}};this.deselect=function(){this.$input.deselect();};this.$enable=function(){this.$input.disabled=false;};this.$disable=function(){this.$input.disabled=true;};this.$insertData=function(b){return this.setValue(b);};this.insert=function(d){if(apf.hasMsRangeObject){try{this.$input.focus();}catch(c){}var b=document.selection.createRange();if(this.oninsert){d=this.oninsert(d);}b.pasteHTML(d);b.collapse(true);b.select();}else{this.$input.value+=d;}};this.addEventListener("$clear",function(){this.value="";if(this["initial-message"]&&apf.document.activeElement!=this){this.$propHandlers.value.call(this,this["initial-message"],null,true);apf.setStyleClass(this.$ext,this.$baseCSSname+"Initial");}else{this.$propHandlers.value.call(this,"");}if(!this.$input.tagName.toLowerCase().match(/input|textarea/i)){if(apf.hasMsRangeObject){try{var b=document.selection.createRange();b.moveStart("sentence",-1);b.select();}catch(c){}}}this.dispatchEvent("clear");});this.$keyHandler=function(d,k,c,g,i){if(this.$button&&d==27){this.clear();this.blur();}if(false&&apf.isIE&&(d==86&&k||d==45&&c)){var j=window.clipboardData.getData("Text");if((j=this.dispatchEvent("keydown",{text:this.onpaste(j)})===false)){return false;}if(!j){j=window.clipboardData.getData("Text");}this.$input.focus();var b=document.selection.createRange();b.text="";b.collapse();b.pasteHTML(j.replace(/\n/g,"<br />").replace(/\t/g,"&nbsp;&nbsp;&nbsp;"));return false;}};var a;this.$focus=function(d){if(!this.$ext||this.$ext.disabled){return;}this.$setStyleClass(this.$ext,this.$baseCSSname+"Focus");if(this["initial-message"]&&this.$input.value==this["initial-message"]){this.$propHandlers.value.call(this,"",null,true);apf.setStyleClass(this.$ext,"",[this.$baseCSSname+"Initial"]);}var b=this;function c(){try{if(!a||document.activeElement!=b.$input){b.$input.focus();}else{clearInterval(a);return;}}catch(g){}if(b.$masking){b.setPosition();}if(b.focusselect){b.select();}}if((!d||d.mouse)&&apf.isIE){clearInterval(a);a=setInterval(c,1);}else{c();}};this.$blur=function(b){if(!this.$ext){return;}if(!this.realtime){this.change(this.getValue());}this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Focus"]);if(this["initial-message"]&&this.$input.value==""){this.$propHandlers.value.call(this,this["initial-message"],null,true);apf.setStyleClass(this.$ext,this.$baseCSSname+"Initial");}try{if(apf.isIE||!b||b.srcElement!=apf.window){this.$input.blur();}}catch(b){}if(this.oContainer){$setTimeout("var o = apf.lookup("+this.$uniqueId+");                o.oContainer.style.display = 'none'",100);}clearInterval(a);};this.$draw=function(){var b=this;this.$ext=this.$getExternal(null,null,function(g){var d=this.getAttribute("mask");if((typeof d=="string"&&d.toLowerCase()=="password")||"secret|password".indexOf(this.localName)>-1){this.type=="password";this.$getLayoutNode("main","input").setAttribute("type","password");}else{if(this.localName=="email"){this.datatype=(this.prefix?this.prefix+":":"")+"email";this.$propHandlers.datatype.call(this,this.datatype,"datatype");}else{if(this.localName=="url"){this.datatype=(this.prefix?this.prefix+":":"")+"url";this.$propHandlers.datatype.call(this,this.datatype,"datatype");}}}g.setAttribute("onmousedown","if (!this.host.disabled)                 this.host.dispatchEvent('mousedown', {htmlEvent : event});");g.setAttribute("onmouseup","if (!this.host.disabled)                 this.host.dispatchEvent('mouseup', {htmlEvent : event});");g.setAttribute("onclick","if (!this.host.disabled)                 this.host.dispatchEvent('click', {htmlEvent : event});");});this.$input=this.$getLayoutNode("main","input",this.$ext);this.$button=this.$getLayoutNode("main","button",this.$ext);if(this.type=="password"){this.$propHandlers.type.call(this,"password");}if(!apf.hasContentEditable&&"input|textarea".indexOf(this.$input.tagName.toLowerCase())==-1){var c=this.$input;this.$input=c.parentNode.insertBefore(document.createElement("textarea"),c);c.parentNode.removeChild(c);this.$input.className=c.className;if(this.$ext==c){this.$ext=this.$input;}}if(this.$button){this.$button.onmousedown=function(){b.clear();b.focus({mouse:true});};}if(this.$input.tagName.toLowerCase()=="textarea"){this.addEventListener("focus",function(d){});}this.$input.onselectstart=function(d){if(!d){d=event;}d.cancelBubble=true;};this.$input.host=this;this.$input.onkeydown=function(j){j=j||window.event;if(this.host.disabled){j.returnValue=false;return false;}if(!b.realtime){var g=b.getValue();if(j.keyCode==13&&g!=this.value){b.change(g);}}else{if(apf.isWebkit&&b.xmlRoot&&b.getValue()!=this.value){$setTimeout("var o = apf.lookup("+b.$uniqueId+");                    o.change(o.getValue())");}}if(b.multiline=="optional"&&j.keyCode==13&&!j.shiftKey||j.ctrlKey&&(j.keyCode==66||j.keyCode==73||j.keyCode==85)){j.returnValue=false;return false;}if(b.oContainer){var d=b;var i=j.keyCode;$setTimeout(function(){d.fillAutocomplete(i);});}if(!b.mask){return b.$keyHandler(j.keyCode,j.ctrlKey,j.shiftKey,j.altKey,j);}};this.$input.onkeyup=function(g){if(!g){g=event;}if(this.host.disabled){return false;}var d=g.keyCode;if(b.$button){b.$button.style.display=this.value?"block":"none";}if(b.realtime){$setTimeout(function(){var i;if(!b.mask&&(i=b.getValue())!=b.value){b.change(i);}b.dispatchEvent("keyup",{keyCode:d});});}else{b.dispatchEvent("keyup",{keyCode:d});}if(b.isValid&&b.isValid()&&g.keyCode!=13&&g.keyCode!=17){b.clearError();}};if(apf.hasFocusBug){apf.sanitizeTextbox(this.$input);}if(apf.hasAutocompleteXulBug){this.$input.setAttribute("autocomplete","off");}if(!this.$input.tagName.toLowerCase().match(/input|textarea/)){this.isHTMLBox=true;this.$input.unselectable="Off";this.$input.contentEditable=true;this.$input.style.width="1px";this.$input.select=function(){var d=document.selection.createRange();d.moveToElementText(this);d.select();};}this.$input.deselect=function(){if(!document.selection){return;}var d=document.selection.createRange();d.collapse();d.select();};};this.$loadAml=function(){if(typeof this["initial-message"]=="undefined"){this.$setInheritedAttribute("initial-message");}if(typeof this.realtime=="undefined"){this.$setInheritedAttribute("realtime");}};this.addEventListener("DOMNodeRemovedFromDocument",function(){if(this.$button){this.$button.onmousedown=null;}if(this.$input){this.$input.onkeypress=this.$input.onmouseup=this.$input.onmouseout=this.$input.onmousedown=this.$input.onkeydown=this.$input.onkeyup=this.$input.onselectstart=null;}});}).call(apf.textbox.prototype=new apf.StandardBinding());apf.config.$inheritProperties["initial-message"]=1;apf.config.$inheritProperties.realtime=1;apf.input.prototype=apf.secret.prototype=apf.password.prototype=apf.textarea.prototype=apf.email.prototype=apf.textbox.prototype;apf.aml.setElement("input",apf.input);apf.aml.setElement("secret",apf.secret);apf.aml.setElement("password",apf.password);apf.aml.setElement("textarea",apf.textarea);apf.aml.setElement("textbox",apf.textbox);apf.submit=function(b,a){this.$init(a||"submit",apf.NODE_VISIBLE,b);};apf.trigger=function(b,a){this.$init(a||"trigger",apf.NODE_VISIBLE,b);};apf.reset=function(b,a){this.$init(a||"reset",apf.NODE_VISIBLE,b);};apf.button=function(b,a){this.$init(a||"button",apf.NODE_VISIBLE,b);};(function(){this.$useExtraDiv;this.$childProperty="caption";this.$inited=false;this.$isLeechingSkin=false;this.$canLeechSkin=true;this.$focussable=true;this.value=null;this.$init(function(){var g,a=this;this.$propHandlers["default"]=function(i){if(!this.focussable&&i||g){this.setAttribute("focussable",g=i);}this.parentNode.removeEventListener("focus",d);this.parentNode.removeEventListener("blur",b);if(!i){return;}this.parentNode.addEventListener("focus",d);this.parentNode.addEventListener("blur",b);};function d(i){if(i.defaultButtonSet||i.returnValue===false){return;}i.defaultButtonSet=true;if(this.$useExtraDiv){a.$ext.appendChild(apf.button.$extradiv);}a.$setStyleClass(a.$ext,a.$baseCSSname+"Default");if(i.srcElement!=a&&a.$focusParent){a.$focusParent.addEventListener("keydown",c);}}function b(i){if(this.$useExtraDiv&&apf.button.$extradiv.parentNode==a.$ext){a.$ext.removeChild(apf.button.$extradiv);}a.$setStyleClass(a.$ext,"",[a.$baseCSSname+"Default"]);if(i.srcElement!=a&&a.$focusParent){a.$focusParent.removeEventListener("keydown",c);}}function c(j){var k;var i=apf.document.activeElement;if(i){if(i.hasFeature(apf.__MULTISELECT__)){return;}k=i.multiline;}if(!a.$ext.onmouseup){return;}if(k&&k!="optional"&&j.keyCode==13&&j.ctrlKey||(!k||k=="optional")&&j.keyCode==13&&!j.ctrlKey&&!j.shiftKey&&!j.altKey){a.$ext.onmouseup(j.htmlEvent,true);}}this.addEventListener("focus",d);this.addEventListener("blur",b);this.$enable=function(){if(this["default"]){d({});if(apf.document.activeElement){apf.document.activeElement.focus(true);}}if(this.state&&this.value){this.$setState("Down",{});}this.$doBgSwitch(1);};this.$disable=function(){if(this["default"]){b({});}this.$doBgSwitch(4);this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Over",this.$baseCSSname+"Down"]);};});this.$booleanProperties["default"]=true;this.$supportedProperties.push("icon","value","tooltip","state","color","caption","action","target","default","submenu");this.$propHandlers.icon=function(a){if(!this.oIcon){return;}if(a){this.$setStyleClass(this.$ext,this.$baseCSSname+"Icon");}else{this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Icon"]);}apf.skins.setIcon(this.oIcon,a,this.iconPath);};this.$propHandlers.value=function(a){if(a===undefined){a=!this.value;}this.value=a;if(this.value){this.$setState("Down",{});}else{this.$setState("Out",{});}};this.$propHandlers.state=function(a){this.$setStateBehaviour(a==1);};this.$propHandlers.color=function(a){if(this.oCaption){this.oCaption.parentNode.style.color=a;}};this.$propHandlers.caption=function(a){if(a){this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Empty"]);}else{this.$setStyleClass(this.$ext,this.$baseCSSname+"Empty");}if(this.oCaption){this.oCaption.nodeValue=String(a||"").trim();}};this.setValue=function(a){this.setProperty("value",a,false,true);};this.setCaption=function(a){this.setProperty("caption",a,false,true);};this.setIcon=function(a){this.setProperty("icon",a,false,true);};this.$setStateBehaviour=function(a){this.value=a||false;this.isBoolean=true;this.$setStyleClass(this.$ext,this.$baseCSSname+"Bool");if(this.value){this.$setStyleClass(this.$ext,this.$baseCSSname+"Down");this.$doBgSwitch(this.states.Down);}};this.$setNormalBehaviour=function(){this.value=null;this.isBoolean=false;this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Bool"]);};this.$setState=function(b,d,c){if(c&&this.dispatchEvent(c,{htmlEvent:d})===false){return;}this.$doBgSwitch(this.states[b]);var a=this.$baseCSSname;this.$setStyleClass(this.$ext,(b!="Out"?a+b:""),[(this.value?"":a+"Down"),a+"Over"]);if(this.submenu){a=this.$baseCSSname+"menu";this.$setStyleClass(this.$ext,(b!="Out"?a+b:""),[(this.value?"":a+"Down"),a+"Over"]);}};this.$clickHandler=function(){if(this.isBoolean&&!this.submenu){this.setProperty("value",!this.value);return true;}};this.$draw=function(){var b,a=(b=this.parentNode).localName=="toolbar"||b.parentNode&&b.parentNode.localName=="toolbar";if(a){if(typeof this.focussable=="undefined"){this.focussable=false;}this.$focussable=apf.KEYBOARD;}this.$ext=this.$getExternal();this.oIcon=this.$getLayoutNode("main","icon",this.$ext);this.oCaption=this.$getLayoutNode("main","caption",this.$ext);this.$useExtraDiv=apf.isTrue(this.$getOption("main","extradiv"));if(!apf.button.$extradiv&&this.$useExtraDiv){(apf.button.$extradiv=document.createElement("div")).className="extradiv";}if(this.localName=="submit"){this.action="submit";}else{if(this.localName=="reset"){this.action="reset";}}this.$setupEvents();};this.addEventListener("$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.addEventListener("click",function(c){var b=this.action;if(!b){b=this.localName;}var a=this;$setTimeout(function(){(apf.button.actions[b]||apf.K).call(a);});});}).call(apf.button.prototype=new apf.BaseButton());apf.submit.prototype=apf.trigger.prototype=apf.reset.prototype=apf.button.prototype;apf.aml.setElement("submit",apf.submit);apf.aml.setElement("trigger",apf.trigger);apf.aml.setElement("reset",apf.reset);apf.aml.setElement("button",apf.button);apf.submit.action=apf.trigger.actions=apf.reset.actions=apf.button.actions={undo:function(d){var c;if(this.target&&self[this.target]){c=self[this.target].localName=="actiontracker"?self[this.target]:self[this.target].getActionTracker();}else{var a,b=this;while(b.parentNode){a=(b=b.parentNode).$at;}}(c||apf.window.$at)[d||"undo"]();},redo:function(){apf.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(g){var a,b;var c=this.target&&self[this.target]?self[this.target]:this.parentNode;if(c.$isModel){b=c;}else{if(!c.$validgroup){c.$validgroup=c.validgroup?self[c.validgroup]:new apf.ValidationGroup();}a=c.$validgroup;if(!a.childNodes.length){a.childNodes=c.childNodes.slice();}function d(k){for(var n,m=0,j=k.length;m<j;m++){n=k[m];if(n.getModel){b=n.getModel();if(b){return false;}}if(n.childNodes.length){if(d(n.childNodes)===false){return false;}}}}d(c.childNodes);if(!b){b=apf.globalModel;if(!b){return;}}}if(g){b.reset();return;}if(a&&!a.isValid()){return;}b.submit();},reset:function(){apf.button.actions.submit.call(this,true);},ok:function(){var a;if(this.target){a=self[this.target];}else{var a=this.parentNode;while(a&&!a.hasFeature(apf.__TRANSACTION__)){a=a.parentNode;}if(a&&!a.hasFeature(apf.__TRANSACTION__)){return;}}if(a.commit()&&a.close){a.close();}},cancel:function(){var a;if(this.target){a=self[this.target];}else{var a=this.parentNode;while(a&&!a.hasFeature(apf.__TRANSACTION__)){a=a.parentNode;}if(a&&!a.hasFeature(apf.__TRANSACTION__)){return;}}a.rollback();if(a.close){a.close();}},apply:function(){var a;if(this.target){a=self[this.target];}else{var a=this.parentNode;while(a&&!a.hasFeature(apf.__TRANSACTION__)){a=a.parentNode;}if(a&&!a.hasFeature(apf.__TRANSACTION__)){return;}}if(a.autoshow){a.autoshow=-1;}if(a.commit(true)){a.begin("update");}},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();}}};apf.scrollbar=function(b,a){this.$init(a||"scrollbar",apf.NODE_VISIBLE,b);};(function(){this.realtime=true;this.$scrollValue=0;this.$stepValue=0.03;this.$bigStepValue=0.1;this.$curValue=0;this.$timer=null;this.$scrollWait;this.$slideMaxHeight;this.addEventListener("focus",function(){this.$host.host.focus();});this.attach=function(d,g,c){this.$host=g;this.$onscroll=c;this.$viewheight=d.offsetHeight;this.$scrollheight=this.$viewheight;this.$attachedHtml=d;d.parentNode.appendChild(this.$ext);if(this.overflow=="scroll"){this.$ext.style.display="block";}this.$ext.style.zIndex=100000;var a=this;function b(k){if(!k){k=event;}var l=null;if(k.wheelDelta){l=k.wheelDelta/120;if(apf.isOpera){l*=-1;}}else{if(k.detail){l=-k.detail/3;}}if(l!==null){var j={delta:l};var i=apf.dispatchEvent("mousescroll",j);if(i===false||j.returnValue===false){if(k.preventDefault){k.preventDefault();}k.returnValue=false;}}a.$stepValue=(g.limit/g.length)/5;a.$curValue+=((apf.isOpera?1:-1)*l*a.$stepValue);a.setScroll(true);if(k.preventDefault){k.preventDefault();}return false;}if(document.addEventListener){document.addEventListener("DOMMouseScroll",b,false);}else{d.onmousewheel=b;}this.$scrollWait=0;this.$slideMaxHeight=this.$ext.offsetHeight-this.$btnDown.offsetHeight-this.$btnUp.offsetHeight;this.$stepValue=(this.$viewheight/this.$scrollheight)/20;this.$bigStepValue=this.$stepValue*3;if(g.length){this.$caret.style.height=Math.max(5,((g.limit/g.length)*this.$slideMaxHeight))+"px";if(this.$caret.offsetHeight-4==this.$slideMaxHeight){this.$ext.style.display="none";}}return this;};this.setScroll=function(a,b){if(this.$curValue>1){this.$curValue=1;}if(this.$curValue<0){this.$curValue=0;}this.$caret.style.top=(this.$btnUp.offsetHeight+(this.$ext.offsetHeight-(this.$btnUp.offsetHeight*2)-this.$caret.offsetHeight)*this.$curValue)+"px";this.pos=this.$curValue;if(!b){this.$onscroll(a,this.pos);}};this.scrollUp=function(a){if(a>this.$caret.offsetTop){return this.$ext.onmouseup();}this.$curValue-=this.$bigStepValue;this.setScroll();this.$slideFast.style.height=Math.max(1,this.$caret.offsetTop-this.$btnUp.offsetHeight)+"px";this.$slideFast.style.top=this.$btnUp.offsetHeight+"px";};this.scrollDown=function(a){if(a<this.$caret.offsetTop+this.$caret.offsetHeight){return this.$ext.onmouseup();}this.$curValue+=this.$bigStepValue;this.setScroll();this.$slideFast.style.top=(this.$caret.offsetTop+this.$caret.offsetHeight)+"px";this.$slideFast.style.height=Math.max(1,this.$ext.offsetHeight-this.$slideFast.offsetTop-this.$btnUp.offsetHeight)+"px";};this.getPosition=function(){return this.pos;};this.setPosition=function(b,a){this.$curValue=b;setScroll(null,a);};this.update=function(b){var b=this.$attachedHtml;this.$ext.style.left=(b.offsetLeft+b.offsetWidth+1)+"px";this.$ext.style.top=(b.offsetTop-1)+"px";this.$ext.style.height=(b.offsetHeight-2)+"px";var c=this.$host;if(c.length){this.$ext.style.display="block";c.initialLimit=0;c.findNewLimit();var a;this.$slideMaxHeight=this.$ext.offsetHeight-this.$btnDown.offsetHeight-this.$btnUp.offsetHeight;this.$caret.style.height=((a=Math.max(10,(((c.limit-1)/c.length)*this.$slideMaxHeight)))-apf.getHeightDiff(this.$caret))+"px";this.$caret.style.top=(this.$curValue*(this.$slideMaxHeight-Math.round(a))+this.$btnUp.offsetHeight)+"px";this.$stepValue=(c.limit/c.length)/20;this.$bigStepValue=this.$stepValue*3;}if(!c.length||c.limit>=c.length&&b.scrollHeight<b.offsetHeight){if(this.overflow=="scroll"){this.$caret.style.display="none";this.disable();}else{this.$ext.style.display="none";}b.style.overflowY="visible";}else{if(this.overflow=="scroll"){this.$caret.style.display="block";this.enable();}else{this.$ext.style.display="block";this.$caret.style.display="block";}b.style.overflowY="scroll";}};this.updatePos=function(){var b=this.$host;var a=Math.round(Math.max(10,(((b.limit-1)/b.length)*this.$slideMaxHeight)));this.$caret.style.top=(this.$curValue*(this.$slideMaxHeight-a)+this.$btnUp.offsetHeight)+"px";};this.$onscroll=function(a,b){this.$host.scrollTop=(this.$host.scrollHeight-this.$host.offsetHeight+4)*this.$curValue;};this.$draw=function(){this.$getNewContext("main");this.$ext=this.$getExternal();this.$ext.style.display="none";this.$caret=this.$getLayoutNode("main","indicator",this.$ext);this.$slideFast=this.$getLayoutNode("main","slidefast",this.$ext);this.$btnUp=this.$getLayoutNode("main","btnup",this.$ext);this.$btnDown=this.$getLayoutNode("main","btndown",this.$ext);this.$startPos=false;this.$caret.ondragstart=function(){return false;};var a=this;this.$btnUp.onmousedown=function(b){if(!b){b=event;}this.className="btnup btnupdown";clearTimeout(a.$timer);a.$curValue-=a.$stepValue;a.setScroll();b.cancelBubble=true;apf.window.$mousedown();a.$timer=$setTimeout(function(){a.$timer=setInterval(function(){a.$curValue-=a.$stepValue;a.setScroll();},20);},300);};this.$btnDown.onmousedown=function(b){if(!b){b=event;}this.className="btndown btndowndown";clearTimeout(a.$timer);a.$curValue+=a.$stepValue;a.setScroll();b.cancelBubble=true;apf.window.$mousedown();a.$timer=$setTimeout(function(){a.$timer=setInterval(function(){a.$curValue+=a.$stepValue;a.setScroll();},20);},300);};this.$btnUp.onmouseout=this.$btnUp.onmouseup=function(){this.className="btnup";clearInterval(a.$timer);};this.$btnDown.onmouseout=this.$btnDown.onmouseup=function(){this.className="btndown";clearInterval(a.$timer);};this.$caret.onmousedown=function(b){if(!b){b=event;}a.$startPos=[b.offsetX,b.offsetY+a.$btnUp.offsetHeight];if(this.setCapture){this.setCapture();}document.onmousemove=function(i){if(!i){i=event;}if(!a.$startPos){return false;}var g=a.$btnUp.offsetHeight+(i.clientY-a.$startPos[1]-apf.getAbsolutePosition(a.$ext)[1]-2);var d=a.$btnUp.offsetHeight;if(g<d){g=d;}var c=(a.$ext.offsetHeight-(a.$btnUp.offsetHeight)-a.$caret.offsetHeight);if(g>c){g=c;}a.$curValue=(g-d)/(c-d);a.setScroll(true);};document.onmouseup=function(){a.$startPos=false;if(!a.realtime){a.setScroll();}if(this.releaseCapture){this.releaseCapture();}document.onmouseup=document.onmousemove=null;};b.cancelBubble=true;apf.window.$mousedown();return false;};this.$ext.onmousedown=function(b){if(!b){b=event;}clearInterval(a.$timer);var c;if(b.offsetY>a.$caret.offsetTop+a.$caret.offsetHeight){a.$curValue+=a.$bigStepValue;a.setScroll(true);a.$slideFast.style.display="block";a.$slideFast.style.top=(a.$caret.offsetTop+a.$caret.offsetHeight)+"px";a.$slideFast.style.height=(a.$ext.offsetHeight-a.$slideFast.offsetTop-a.$btnUp.offsetHeight)+"px";c=b.offsetY;a.$timer=$setTimeout(function(){a.$timer=setInterval(function(){a.scrollDown(c);},20);},300);}else{if(b.offsetY<a.$caret.offsetTop){a.$curValue-=a.$bigStepValue;a.setScroll(true);a.$slideFast.style.display="block";a.$slideFast.style.top=a.$btnUp.offsetHeight+"px";a.$slideFast.style.height=(a.$caret.offsetTop-a.$btnUp.offsetHeight)+"px";c=b.offsetY;a.$timer=$setTimeout(function(){a.$timer=setInterval(function(){a.scrollUp(c);},20);},300);}}};this.$ext.onmouseup=function(){clearInterval(a.$timer);if(!a.realtime){a.setScroll();}a.$slideFast.style.display="none";};};}).call(apf.scrollbar.prototype=new apf.Presentation());apf.aml.setElement("scrollbar",apf.scrollbar);apf.services=function(b,a){this.$init(a||"services",apf.NODE_VISIBLE,b);this.addEventListener("DOMNodeInsertedIntoDocument",function(d){var c=this.parentNode;if(c.register){c.register(this);}});};apf.services.prototype=new apf.AmlElement();apf.aml.setElement("services",apf.services);apf.appsettings=function(b,a){this.$init(a||"appsettings",apf.NODE_HIDDEN,b);};(function(){this.$parsePrio="001";this.$attrExcludePropBind={language:1,login:1,logout:1,layout:1};this.$supportedProperties=["debug","name","baseurl","resource-path","disable-right-click","allow-select","allow-blur","auto-disable-actions","auto-disable","disable-f5","auto-hide-loading","disable-space","disable-backspace","undokeys","initdelay","default-page","query-append","outline","drag-outline","resize-outline","resize-outline","iepngfix","iepngfix-elements","iphone-fullscreen","iphone-statusbar","iphone-icon","iphone-icon-is-glossy","iphone-fixed-viewport","layout","skinset","language","storage","offline","login"];this.$booleanProperties={debug:1,"disable-right-click":1,"allow-select":1,"allow-blur":1,"auto-disable-actions":1,"auto-disable":1,"disable-f5":1,"auto-hide-loading":1,"disable-space":1,"disable-backspace":1,undokeys:1,initdelay:1,outline:1,iepngfix:1,"iphone-fullscreen":1,"iphone-icon-is-glossy":1,"iphone-fixed-viewport":1};this.$handlePropSet=function(c,b,a){if(this.$booleanProperties[c]){b=apf.isTrue(b);}this[c]=b;apf.config.setProperty(c,b);};this.addEventListener("DOMNodeInsertedIntoDocument",function(a){if(apf.isIphone&&apf.runIphone){apf.runIphone();delete apf.runIphone;}});}).call(apf.appsettings.prototype=new apf.AmlElement());apf.aml.setElement("appsettings",apf.appsettings);apf.WinServer={count:9000,wins:[],setTop:function(c,b){if(c.zindex){return;}if(c.$opened){if(c.$opened.visible){return;}else{delete c.$opened;}}var a;if(!b&&this.wins.length){var a=this.wins[this.wins.length-1];if(a==c){return;}if(!a.modal||!a.visible){a=null;}else{if(a&&c.modal){c.$opener=a;a.$opened=c;a=null;}}}this.count+=2;c.setProperty("zindex",this.count);this.wins.remove(c);this.wins.push(c);if(a){this.setTop(a,true);}return c;},setNext:function(){if(this.wins.length<2){return;}var a,b=this.wins.shift();do{if(this.setTop(a||b).visible){break;}a=this.wins.shift();}while(b!=a);},setPrevious:function(){if(this.wins.length<2){return;}this.wins.unshift(this.wins.pop());var a,b=this.wins.pop();do{if(this.setTop(a||b).visible){break;}a=this.wins.pop();}while(b!=a);},remove:function(a){this.wins.remove(a);}};apf.toolwindow=function(b,a){this.$init(a||"toolwindow",apf.NODE_VISIBLE,b);};apf.modalwindow=function(b,a){this.$init(a||"modalwindow",apf.NODE_VISIBLE,b);};apf.AmlWindow=function(b,a){this.$init(a||"window",apf.NODE_VISIBLE,b);};(function(){this.implement(apf.Docking,apf.BaseStateButtons);this.$isWindowContainer=true;this.collapsedHeight=30;this.canHaveChildren=2;this.visible=false;this.showdragging=false;this.kbclose=false;this.$focussable=apf.KEYBOARD;this.setTitle=function(c){this.setProperty("title",c,false,true);return this;};this.setIcon=function(c){this.setProperty("icon",c,false,true);return this;};this.show=function(c){this.execAction=c;this.setProperty("visible",true,false,true);return this;};this.slideIn=function(j,g){if(!j){j="bottom";}var m=this.center;this.center=false;this.setProperty("visible",true);this.center=m;var d=0,q=0,l=(apf.isIE?this.$ext.offsetParent.offsetWidth:window.innerWidth),i=(apf.isIE?this.$ext.offsetParent.offsetHeight:window.innerHeight),o=Math.max(0,((l-this.$ext.offsetWidth)/2)),n=Math.max(0,((i-this.$ext.offsetHeight)/3)),c="top",k=10;switch(j){case"top":d=-(this.$ext.offsetHeight)-k;q=g?0:n;break;case"left":d=-(this.$ext.offsetWidth)-k;q=g?0:o;c="left";break;case"bottom":d=i+this.$ext.offsetHeight+k;q=g?i-this.$ext.offsetHeight:n;break;case"right":d=l+this.$ext.offsetLeft+k;q=g?l-this.$ext.offsetWidth:o;c="left";break;}apf.tween.single(this.$ext,{steps:apf.isIphone?5:30,interval:10,from:d,to:q,type:c,anim:apf.tween.EASEIN});return this;};this.slideOut=function(d){if(!d){d="bottom";}var k=0,j=0,i="top",g=10;switch(d){case"top":k=this.$ext.offsetTop;j=-(this.$ext.offsetHeight)-g;break;case"left":k=this.$ext.offsetLeft;j=-(this.$ext.offsetWidth)-g;i="left";break;case"bottom":k=this.$ext.offsetTop;j=(apf.isIE?this.$ext.offsetParent.offsetHeight:window.innerHeight)+this.$ext.offsetHeight+g;break;case"right":k=this.$ext.offsetLeft;j=(apf.isIE?this.$ext.offsetParent.offsetWidth:window.innerWidth)+this.$ext.offsetLeft+g;i="left";break;}var c=this;apf.tween.single(this.$ext,{steps:apf.isIphone?5:30,interval:10,from:k,to:j,type:i,anim:apf.tween.EASEOUT,onfinish:function(){c.setProperty("visible",false);}});return this;};this.bringToFront=function(){apf.WinServer.setTop(this);return this;};this.syncAlignment=function(c){if(c.hidden==3){apf.WinServer.setTop(this);}if(c.state>0){this.$setStyleClass(this.$ext,this.$baseCSSname+"Min",[this.$baseCSSname+"Edit",this.$baseCSSname+"Max"]);}else{this.$setStyleClass(this.$ext,"",[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.showdragging=true;this.$booleanProperties.kbclose=true;this.$supportedProperties.push("title","icon","modal","minwidth","minheight","hideselects","center","kbclose","maxwidth","maxheight","showdragging","transaction");this.$propHandlers.modal=function(d){if(d&&!this.oCover){var c=this.$getLayoutNode("cover");if(c){this.oCover=apf.insertHtmlNode(c,this.$pHtmlNode);if(!this.visible){this.oCover.style.display="none";}if(this.zindex){this.oCover.style.zIndex=this.zindex;}}}if(!d&&this.oCover){this.oCover.style.display="none";}};this.$propHandlers.center=function(c){this.$ext.style.position="absolute";};this.$propHandlers.title=function(c){if(this.oTitle){this.oTitle.nodeValue=c;}};this.$propHandlers.icon=function(c){if(!this.oIcon){return;}this.oIcon.style.display=c?"block":"none";apf.skins.setIcon(this.oIcon,c,this.iconPath);};var b=[],a;this.$propHandlers.visible=function(m){if(apf.isTrue(m)){if(this.oCover){if(this.oCover.offsetParent){this.oCover.style.height=Math.max(this.oCover.offsetParent.scrollHeight,document.documentElement.offsetHeight)+"px";this.oCover.style.width=this.oCover.offsetParent.scrollWidth+"px";}this.oCover.style.display="block";}this.state=this.state.split("|").remove("closed").join("|");this.$ext.style.display="block";if(apf.layout&&this.$int){apf.layout.forceResize(this.$int);}if(this.center){var l=!this.$ext.offsetParent||this.$ext.offsetParent.tagName=="BODY"?[apf.getWindowWidth(),apf.getWindowHeight()]:[this.$ext.offsetParent.offsetWidth,this.$ext.offsetParent.offsetHeight,0,0];if(l.length==2){l.push(document.documentElement.scrollLeft,document.documentElement.scrollTop);}this.$ext.style.left=(Math.max(0,((l[0]-parseInt(this.width))/2))+l[2])+"px";this.$ext.style.top=(Math.max(0,((l[1]-parseInt(this.height))/3))+l[3])+"px";}if(!apf.canHaveHtmlOverSelects&&this.hideselects){b=[];var j=document.getElementsByTagName("select");for(var k=0;k<j.length;k++){var g=apf.getStyle(j[k],"display");b.push([j[k],g]);j[k].style.display="none";}}if(this.modal){this.bringToFront();}if(!this.$rendered){this.addEventListener("afterrender",function(){if(this.$amlLoaded&&(this.model||(!this.dockable||!this.aData)&&!this.$isWidget&&this.localName!="toolwindow")){this.focus(false,{mouse:true});}});}else{if(this.$amlLoaded&&(this.model||(!this.dockable||!this.aData)&&!this.$isWidget&&this.localName!="toolwindow")){this.focus(false,{mouse:true});}}if(apf.isIE){var d=this.$ext.className;this.$ext.className="rnd"+Math.random();this.$ext.className=d;}var c=this;$setTimeout(function(){c.dispatchEvent("show");});}else{if(this.oCover){this.oCover.style.display="none";}this.$ext.style.display="none";if(!apf.canHaveHtmlOverSelects&&this.hideselects){for(var k=0;k<b.length;k++){b[k][0].style.display=b[k][1];}}if(this.hasFocus()){apf.window.moveNext(true,this,true);}this.dispatchEvent("close");this.visible=false;}a=m;};this.$propHandlers.zindex=function(c){this.$ext.style.zIndex=c+1;if(this.oCover){this.oCover.style.zIndex=c;}};if(!apf.isIphone){this.addEventListener("keydown",function(g){var d=g.keyCode;var j=g.ctrlKey;var c=g.shiftKey;var i=false;switch(d){case 38:if(c&&this.resizable){this.setProperty("height",Math.max(this.minheight||0,this.$ext.offsetHeight-(j?50:10)));}else{if(this.draggable){this.setProperty("top",this.$ext.offsetTop-(j?50:10));}}break;case 37:if(c&&this.resizable){this.setProperty("width",Math.max(this.minwidth||0,this.$ext.offsetWidth-(j?50:10)));}else{if(this.draggable){this.setProperty("left",this.$ext.offsetLeft-(j?50:10));}}break;case 39:if(c&&this.resizable){this.setProperty("width",Math.min(this.maxwidth||10000,this.$ext.offsetWidth+(j?50:10)));}else{if(this.draggable){this.setProperty("left",this.$ext.offsetLeft+(j?50:10));}}break;case 40:if(c&&this.resizable){this.setProperty("height",Math.min(this.maxheight||10000,this.$ext.offsetHeight+(j?50:10)));}else{if(this.draggable){this.setProperty("top",this.$ext.offsetTop+(j?50:10));}}break;default:i=null;return;}if(apf.hasSingleRszEvent){apf.layout.forceResize(this.$int);}return i;},true);this.addEventListener("keydown",function(c){if(c.keyCode==27&&this.buttons.indexOf("close")>-1&&(!this.dockable||!this.aData)&&this.kbclose){this.close();}});}this.$draw=function(){this.popout=apf.isTrue(this.getAttribute("popout"));if(this.popout){this.$pHtmlNode=document.body;}this.$ext=this.$getExternal(null,null,function(d){this.$initButtons(d);});this.oTitle=this.$getLayoutNode("main","title",this.$ext);this.oIcon=this.$getLayoutNode("main","icon",this.$ext);this.oDrag=this.$getLayoutNode("main","drag",this.$ext);this.$buttons=this.$getLayoutNode("main","buttons",this.$ext);this.oDrag.host=this;if(this.popout){this.$ext.style.position="absolute";}if(this.oIcon){this.oIcon.style.display="none";}if(!apf.isIphone){var c=this;this.oDrag.onmousedown=function(d){if(!d){d=event;}if(!c.$isWidget&&(!c.aData||!c.dockable||c.aData.hidden==3)){apf.WinServer.setTop(c);}if(c.$lastState.maximized){return false;}if(c.aData&&c.dockable){if(c.$lastState.normal){c.startDocking(d);}return false;}};this.$ext.onmousedown=function(){var d=apf.document.activeElement;if(d&&d.$focusParent!=c&&d.$focusParent.modal){return false;}if(!c.$isWidget&&(!c.aData||!c.dockable||c.aData.hidden==3)){apf.WinServer.setTop(c);}if(!c.$lastState.normal){return false;}};this.$ext.onmousemove=function(){if(!c.$lastState.normal){return false;}};}};this.$loadAml=function(d){apf.WinServer.setTop(this);this.$int=this.$getLayoutNode("main","container",this.$ext);if(!apf.isIphone){if(this.oTitle){var c=this;(this.oTitle.nodeType!=1?this.oTitle.parentNode:this.oTitle).ondblclick=function(g){if(c.state.indexOf("normal")==-1){c.restore();}else{if(c.buttons.indexOf("max")>-1){c.maximize();}else{if(c.buttons.indexOf("min")>-1){c.minimize();}}}};}if(typeof this.draggable=="undefined"){(this.$propHandlers.draggable||apf.GuiElement.propHandlers.draggable).call(this,true);this.draggable=true;}if(typeof this.buttons=="undefined"){this.buttons="";}}if(this.modal===undefined&&this.oCover){this.$propHandlers.modal.call(this,true);this.modal=true;}if(!this.visible){this.$ext.style.display="none";if(this.oCover){this.oCover.style.display="none";}}else{if(this.modal){var c=this;apf.queue.add("focus",function(){c.focus(false,{mouse:true});});}}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.$ext.style.display="none";var c=this;$setTimeout(function(){c.setProperty("visible",true);});}};this.addEventListener("$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(c){if(this.oDrag){this.oDrag.host=null;this.oDrag.onmousedown=null;apf.destroyHtmlNode(this.oDrag);this.oDrag=null;}this.oTitle=this.oIcon=this.oCover=null;if(this.$ext&&!c){this.$ext.onmousedown=null;this.$ext.onmousemove=null;}};}).call(apf.modalwindow.prototype=new apf.Presentation());apf.AmlWindow.prototype=apf.toolwindow.prototype=apf.modalwindow.prototype;apf.aml.setElement("toolwindow",apf.toolwindow);apf.aml.setElement("modalwindow",apf.modalwindow);apf.aml.setElement("window",apf.modalwindow);apf.gallery=function(b,a){this.$init(a||"gallery",apf.NODE_VISIBLE,b);this.imageheight="auto";this.defaultthumb=null;this.defaultimage=null;this.scalewidth=false;this.zoomIcon=false;this.previous=null,this.next=null,this.current=null,this.last=null;this.thumbnailMode="grid";this.title="text";this.nodes=[];this.tmrRefresh=null;this.tmrSlide=null;this.stepShow=apf.isIE?10:15;this.stepShowFast=apf.isIE?5:8;this.stepSlide=apf.isIE?25:30;this.stepHide=apf.isIE?5:7;this.intSSlide=apf.isIE?2:10;this.imageStack={};this.isOnStack=false;this.noThumbArrows=false;this.mediaType=null;this.supportedMediaTypes=["image","flash"];};(function(){this.$supportedProperties.push("thumbheight","imageheight","scalewidth","defaultthumb","defaultimage","thumb-mode","title","zoom-icon");this.$booleanProperties.scalewidth=true;this.$booleanProperties["zoom-icon"]=true;this.$propHandlers["zoom-icon"]=function(a){this.zoomIcon=a;this.$oZoomIcon.style.display=this.zoomIcon?"block":"none";};this.$propHandlers.imageheight=function(a){this.imageheight=a=="auto"?"auto":parseInt(a);};this.$propHandlers["thumb-mode"]=function(a){this.thumbnailMode=a;this.$setStyleClass(this.$ext,a+"Mode",["barMode","gridMode"]);};this.isSupportedType=function(c){for(var b=0,a=this.supportedMediaTypes.length;b<a;b++){if(c==this.supportedMediaTypes[b]){return true;}}return false;};this.$setSiblings=function(){var b=this.getNextTraverse(this.current),a=this.getNextTraverse(this.current,true);this.next=b?b:this.getFirstTraverseNode();this.previous=a?a:this.getLastTraverseNode();};this.show=function(){this.$show();};this.hide=function(){};this.calcThumbBarSize=function(){var b=this.$oThumbs.childNodes;var d=b.length;var a=0;for(var c=0;c<d;c++){if((b[c].className||"").indexOf("thumbnail")>-1){a+=b[c].offsetWidth+apf.getMargin(b[c])[0];}}this.$oThumbs.style.width=a+"px";this.noThumbArrows=this.$oThumbs.offsetWidth<this.$oThumbs.parentNode.offsetWidth?true:false;if(this.noThumbArrows){this.$setStyleClass(this.$oBar,"noArrows",null);}else{this.$setStyleClass(this.$oBar,"",["noArrows"]);}this.calculateRange();};this.initiateThumbnailEvents=function(){var k=this.$oThumbs.childNodes;var m=k.length;var n=this;var o,g=null;var a,b;for(var d=0;d<m;d++){if((k[d].className||"").indexOf("thumbnail")>-1){if(o==null||o<=0){o=(k[d].offsetHeight||parseInt(k[d].height))-apf.getVerBorders(k[d]);}k[d].onmouseover=function(i){n.$hoverThumb(i,this);};k[d].onmouseout=function(i){n.$hoverThumb(i,this);};var l=k[d].childNodes;images_len=l.length;for(var c=0;c<images_len;c++){if((l[c].tagName||"").toLowerCase()=="img"){a=l[c].offsetHeight||l[c].height;b=l[c].offsetWidth||l[c].width;if(a>0&&b>0&&o>0){l[c].style.height=o+"px";l[c].parentNode.style.width=l[c].style.width=parseInt(b*o/a)+"px";}else{l[c].onload=function(){a=this.offsetHeight||this.height;b=this.offsetWidth||this.width;if(a>0&&b>0&&o>0){this.style.height=o+"px";if(this.parentNode){this.parentNode.style.width=this.style.width=parseInt(b*o/a)+"px";}}};}}}}}if(n.thumbnailMode=="bar"){n.calcThumbBarSize();}};this.$hoverThumb=function(c,b){c=c||event;var a=c.target||c.srcElement;var g=c.type=="mouseover"?0.7:1;var d=c.type=="mouseover"?1:0.7;if(apf.isChildOf(b,a,false)){if((b.className||"").indexOf("selected")>-1){return;}apf.tween.single(b,{steps:10,type:"fade",from:g,to:d});}};this.loading=false;this.$show=function(){var a=this;this.$showLoader();if(this.imageheight!=="auto"){this.$oImageContainer.style.height=this.$oViewport.style.height=this.imageheight+"px";}this.initiateThumbnailEvents();if(this.thumbnailMode=="bar"){this.calcThumbBarSize();}this.$oImage.onload=function(){a.$hideLoader();a.$oImageBase.src=a.$oImage.src;a.last=a.current;a.$setSiblings();a.$oImageBase.style.display="block";var g=a.$oImageBase.offsetWidth||a.$oImageBase.width;var b=a.$oImageBase.offsetHeight||a.$oImageBase.height;a.$oImageBase.style.display="none";if(a.imageheight!=="auto"){var i=a.$oViewport.offsetWidth;var j=a.$oViewport.offsetHeight;var c=b,d=g;if(c>j){d=parseInt(g*(j/c));c=j;}if(d>i){c=parseInt(c*(i/d));d=i;}if(d>0&&c>0){a.$oImage.style.width=d+"px";a.$oImage.style.height=c+"px";a.$oImage.style.marginTop=parseInt((j-c)/2)+"px";a.$oImage.style.marginLeft=parseInt((i-d)/2)+"px";}}else{if(g>0&&b>0){a.$oImageContainer.style.width=g+"px";a.$oImageContainer.style.height=b+"px";}a.$oImageContainer.style.margin="0 auto";}a.$oImage.style.display="block";if(!a.isOnStack){apf.tween.single(a.$oImage,{steps:a.stepShow,type:"fade",anim:apf.tween.NORMAL,from:0,to:1,onfinish:function(){a.loading=false;}});}else{if(apf.isIE){a.$oImage.style.filter="alpha(opacity=100)";}else{a.$oImage.style.opacity=1;}a.loading=false;}a.imageStack[a.$applyBindRule("src",a.current)]=true;};};this.$showVideo=function(){this.$oImage.style.display="none";this.$hideLoader();this.last=this.current;this.$setSiblings();if(this.mediaType=="flash"){var b=this.$oViewport.offsetWidth;var c=this.$oViewport.offsetHeight;this.$oMedia.style.width=b+"px";this.$oMedia.style.height=c+"px";this.$oMedia.style.display="block";if(!this.isOnStack){var a=this;apf.tween.single(this.$oMedia,{steps:a.stepShow,type:"fade",anim:apf.tween.NORMAL,from:0,to:1,onfinish:function(){a.loading=false;}});}else{this.$oMedia.style.filter="alpha(opacity=100)";this.$oMedia.style.opacity=1;this.loading=false;}}this.imageStack[this.$applyBindRule("src",this.current)]=true;};this.$refresh=function(){this.isOnStack=this.imageStack[this.$applyBindRule("src",this.current)]?true:false;if(!this.isOnStack){this.$showLoader();}var a=this;clearTimeout(this.tmrRefresh);a.tmrRefresh=window.setTimeout(function(){clearTimeout(a.tmrRefresh);if(a.$amlDestroyed){return;}if(!a.isOnStack){apf.tween.single(a.mediaType=="image"?a.$oMedia:a.$oImage,{steps:a.stepHide,type:"fade",anim:apf.tween.NORMAL,from:1,to:0,onfinish:function(){a.setImagePath(a.current);if(a.mediaType!=="image"){a.$showVideo();}else{a.$oMedia.style.display="none";}}});}else{a.setImagePath(a.current);if(a.mediaType!=="image"){a.$showVideo();}else{a.$oMedia.style.display="none";}}},apf.isIE?80:100);};this.setDescription=function(a){var g=this.$applyBindRule("caption",a||this.current);switch(this.title){case"text":var d=g||"No description";break;case"number+text":case"text+number":var c=(apf.language.getWord("sub/slideshow/image")||"Image")+" "+(this.getPos()+1)+" "+(apf.language.getWord("sub/slideshow/of")||"of")+" "+this.getTraverseNodes().length;var b=g||this.defaulttitle||apf.language.getWord("sub/slideshow/defaulttitle")||"No description";var d="<b>"+c+"</b><br />"+b;break;default:var d=apf.language.getWord("sub/slideshow/image")||"Image "+(this.getPos()+1)+" "+(apf.language.getWord("sub/slideshow/of")||"of")+" "+this.getTraverseNodes().length;break;}this.$oDescr.innerHTML=d;};this.getPos=function(){return Array.prototype.indexOf.call(this.getTraverseNodes(),this.current);};this.setImagePath=function(a){var b=this.$applyBindRule("src",a);if(this.mediaType=="image"){this.$oImage.src=b||this.defaultimage||this.defaultthumb;}else{if(this.mediaType=="flash"){this.loadMedia(this.mediaType,b);}else{alert("Not supported media type.");}}};this.loadMedia=function(a,b){this.$oMedia.innerHTML=b;};this.$next=function(){this.select(this.current=this.next);};this.$previous=function(){this.select(this.current=this.previous);};this.centerThumbnail=function(i){var g=apf.xmldb.findHtmlNode(i,this);if(!g||this.noThumbArrows){return;}var l=g.offsetLeft;var k=g.offsetWidth;var c=this;var a=this.$oThumbs.offsetLeft;if(g==this.$oThumbs.firstChild&&a==0){return;}var b=-1*l-parseInt((k+apf.getMargin(g)[0])/2);var j=parseInt(this.$oThumbs.parentNode.offsetWidth/2);var d=b+this.maxLeft+j;d=d>this.maxLeft?this.maxLeft:(d<this.minLeft?this.minLeft:d);apf.tween.single(this.$oThumbs,{steps:15,type:"left",anim:apf.tween.EASEOUT,from:a,to:d,onfinish:function(){}});};this.isLoaderActive=false;this.$showLoader=function(){if(this.isLoaderActive){return;}this.isLoaderActive=true;this.$oLoader.style.display="block";apf.tween.single(this.$oLoader,{steps:6,type:"fade",from:0,to:1});};this.$hideLoader=function(){this.$oLoader.style.display="none";this.isLoaderActive=false;};this.$removeFilters=function(){this.$oLoader.style.filter="";};this.addEventListener("$clear",function(){return false;});this.addEventListener("afterload",function(){this.$setStyleClass(this.$ext,this.$baseCSSname+this.thumbnailMode+"Mode");this.imageStack={};this.$show();});this.addEventListener("beforeselect",function(b){if(this.loading){return true;}if(b.selected){this.current=b.selected;}var a=this.$applyBindRule("mediatype",this.current);this.mediaType=this.isSupportedType(a)?a:"image";});this.addEventListener("afterselect",function(c){if(this.thumbnailMode=="bar"){this.centerThumbnail(this.current);}this.loading=true;if(this.$oZoomIcon){if(this.mediaType=="image"){var a=this;var b=this.$applyBindRule("url",this.current);this.$oZoomIcon.onclick=function(){a.dispatchEvent("zoomclick",{url:b,selected:a.current});if(b){window.location.href=b;}};}}this.setDescription();this.$refresh();});this.$resize=function(){};this.calculateRange=function(){this.maxLeft=this.$oThumbs.offsetLeft;this.minLeft=-1*(this.$oThumbs.offsetWidth-this.$oThumbs.parentNode.offsetWidth);};this.$draw=function(){this.$getNewContext("main");this.$getNewContext("container");this.$ext=this.$getExternal(null,null,function(g){});this.$oImageContainer=this.$getLayoutNode("main","image_container",this.$ext);this.$oViewport=this.$getLayoutNode("main","viewport",this.$ext);this.$oZoomIcon=this.$getLayoutNode("main","zoom_icon",this.$ext);this.$oImage=this.$getLayoutNode("main","image",this.$ext);this.$oImageBase=this.$getLayoutNode("main","image_base",this.$ext);this.$oNext=this.$getLayoutNode("main","next",this.$ext);this.$oPrevious=this.$getLayoutNode("main","previous",this.$ext);this.$oBar=this.$getLayoutNode("main","bar",this.$ext);this.$oDescr=this.$getLayoutNode("main","descr",this.$ext);this.$oLoader=this.$getLayoutNode("main","loader",this.$ext);this.$oThumbs=this.$getLayoutNode("main","thumbs",this.$ext);this.$container=this.$oThumbs;this.$oArrowPrev=this.$getLayoutNode("main","arrow_prev",this.$ext);this.$oArrowNext=this.$getLayoutNode("main","arrow_next",this.$ext);this.$oMedia=this.$getLayoutNode("main","media",this.$ext);var d="var o = apf.all["+this.$uniqueId+"];                     if (o) o.$resize()";apf.layout.setRules(this.$pHtmlNode,this.$uniqueId+"_scaling",d,true);apf.layout.queue(this.$pHtmlNode);var b=this;this.$oNext.onclick=function(){b.$next();};this.$oPrevious.onclick=function(){b.$previous();};this.calculateRange();this.slideFinish=true;this.$oArrowPrev.onmouseover=function(){if(b.noThumbArrows){return;}clearTimeout(b.tmrSlide);b.tmrSlide=window.setTimeout(function(){var g=b.$oThumbs.offsetLeft;if(g+1>b.minLeft&&g<b.maxLeft){b.$oThumbs.style.left=(g+1)+"px";}},b.intSSlide);};this.$oArrowPrev.onmouseout=function(){clearTimeout(b.tmrSlide);};this.$oArrowNext.onmouseover=function(){if(b.noThumbArrows){return;}clearTimeout(b.tmrSlide);b.tmrSlide=window.setTimeout(function(){var g=b.$oThumbs.offsetLeft;if(g>b.minLeft&&g-1<b.maxLeft){b.$oThumbs.style.left=(g-1)+"px";}},b.intSSlide);};this.$oArrowNext.onmouseout=function(){clearTimeout(b.tmrSlide);};this.$oArrowPrev.onclick=function(){if(!b.slideFinish||b.noThumbArrows){return;}b.slideFinish=false;var g=b.$oThumbs.offsetLeft;var i=g+200>b.maxLeft?b.maxLeft:g+200;apf.tween.single(b.$oThumbs,{steps:b.stepSlide,type:"left",anim:apf.tween.EASEOUT,from:g,to:i,onfinish:function(){b.slideFinish=true;}});};this.$oArrowNext.onclick=function(){if(!b.slideFinish||b.noThumbArrows){return;}b.slideFinish=false;var g=b.$oThumbs.offsetLeft;var i=g-200<b.minLeft?b.minLeft:g-200;apf.tween.single(b.$oThumbs,{steps:b.stepSlide,type:"left",anim:apf.tween.EASEOUT,from:g,to:i,onfinish:function(){b.slideFinish=true;}});};this.arrowsAreVisible=false;this.arrowsVisible;this.arrowsInvisible;this.$oImage.onmouseover=function(g){g=g||event;if(b.arrowsAreVisible){return;}b.arrowsVisible={stop:false};if(b.arrowsInvisible){b.arrowsInvisible.stop=true;}b.arrowsAreVisible=true;b.$oNext.style.display="block";b.$oPrevious.style.display="block";apf.tween.multi(b.$oNext,{steps:15,control:b.arrowsVisible,anim:apf.tween.EASEOUT,tweens:[{type:"fade",from:apf.getOpacity(b.$oNext),to:1},{type:"fade",from:apf.getOpacity(b.$oPrevious),to:1,oHtml:b.$oPrevious}],onfinish:function(){b.$oNext.style.display="block";b.$oPrevious.style.display="block";b.$oNext.style.filter="";b.$oPrevious.style.filter="";}});};this.$oImageContainer.onmouseout=function(i){i=i||event;var g=i.target||i.srcElement;if(!b.arrowsAreVisible){return;}g=i.toElement?i.toElement:(i.relatedTarget?i.relatedTarget:null);if(apf.isChildOf(b.$oImageContainer,g,true)){return;}b.arrowsInvisible={stop:false};if(b.arrowsVisible){b.arrowsVisible.stop=true;}b.arrowsAreVisible=false;apf.tween.multi(b.$oNext,{steps:15,control:b.arrowsInvisible,anim:apf.tween.EASEOUT,tweens:[{type:"fade",from:apf.getOpacity(b.$oNext),to:0},{type:"fade",from:apf.getOpacity(b.$oPrevious),to:0,oHtml:b.$oPrevious}],onfinish:function(){b.$oNext.style.display="none";b.$oPrevious.style.display="none";}});};var a=function(i,g,j){b.initiateThumbnailEvents();};this.$isWaitingOnDisplay=true;this.watch("visible",a);var c=this.parentNode;while(c){c.watch("visible",a);c=c.parentNode;}};}).call(apf.gallery.prototype=new apf.BaseList());apf.aml.setElement("gallery",apf.gallery);apf.aml.setElement("url",apf.BindingRule);apf.aml.setElement("mediatype",apf.BindingRule);apf.ActionRule=function(b,a){this.$init(a||true,apf.NODE_HIDDEN,b);};(function(){this.$actionRule=true;this.compile=function(b,a){return(this["c"+b]=apf.lm.compile(this[b],a||{xpathmode:2}));};this.$attrExcludePropBind=apf.extend({set:1,get:1,undo:1,lock:1,match:1,parent:1},this.$attrExcludePropBind);this.$propHandlers.set=this.$propHandlers.get=this.$propHandlers.parent=this.$propHandlers.match=function(a,b){delete this["c"+b];};this.addEventListener("DOMNodeInserted",function(b){if(b.currentTarget==this){var a=this.parentNode;if(!a.$actions){a.$actions=new apf.ruleList();}(a.$actions[this.localName]||(a.$actions[this.localName]=[])).push(this);}else{if(this.attributes.getNamedItem("value")){return;}this.value=apf.serializeChildren(this);}});this.addEventListener("DOMNodeRemoved",function(a){if(a.currentTarget==this){this.parentNode.$actions[this.localName].remove(this);}else{if(this.attributes.getNamedItem("value")){return;}this.value=apf.serializeChildren(this);}});this.addEventListener("DOMNodeInsertedIntoDocument",function(a){if(!this.get){this.get=apf.serializeChildren(this.$aml).trim();}var b=this.parentNode.$actions||(this.parentNode.$actions=new apf.ruleList());(b[this.localName]||(b[this.localName]=[])).push(this);});}).call(apf.ActionRule.prototype=new apf.AmlElement());apf.aml.setElement("rename",apf.ActionRule);apf.aml.setElement("remove",apf.ActionRule);apf.aml.setElement("add",apf.ActionRule);apf.aml.setElement("update",apf.ActionRule);apf.aml.setElement("copy",apf.ActionRule);apf.aml.setElement("move",apf.ActionRule);apf.BindingSeriesRule=function(b,a){this.$init(a||"series",apf.NODE_HIDDEN,b);};(function(){this.$attrExcludePropBind=apf.extend({formula:1},this.$attrExcludePropBind);this.$propHandlers.formula=function(a,b){delete this["c"+b];};}).call(apf.BindingSeriesRule.prototype=new apf.BindingRule());apf.aml.setElement("series",apf.BindingSeriesRule);apf.comment=function(){this.$init("comment",apf.NODE_HIDDEN);};apf.comment.prototype=new apf.AmlComment();apf.aml.setElement("comment",apf.comment);apf.collection=function(b,a){this.$init(a||"collection",apf.NODE_VISIBLE,b);};apf.docklet=function(b,a){this.$init(a||"docklet",apf.NODE_VISIBLE,b);};(function(){this.$focussable=false;this.addEventListener("DOMNodeInsertedIntoDocument",function(a){if(this.parentNode&&this.parentNode.$int!=this.$pHtmlNode){this.$pHtmlNode=this.parentNode.$int;}this.$int=this.$pHtmlNode;this.$originalNodes=this.parentNode.$originalNodes;this.skinName=this.parentNode.skinName;});}).call(apf.collection.prototype=new apf.AmlElement());apf.docklet.prototype=apf.collection.prototype;apf.aml.setElement("collection",apf.collection);apf.aml.setElement("docklet",apf.docklet);apf.actions=function(b,a){this.$init(a||"actions",apf.NODE_HIDDEN,b);this.$actions=new apf.ruleList();this.$amlNodes={};};(function(){this.$smartbinding=null;this.register=function(a){if(a.localName=="smartbinding"){this.$smartbinding=a;this.$smartbinding.add(this);return;}this.$amlNodes[a.$uniqueId]=a;a.$actions=this.$actions;a.dispatchEvent("actionsload",{bindings:this});};this.unregister=function(a){this.$amlNodes[a.$uniqueId]=null;delete this.$amlNodes[a.$uniqueId];delete a.$actions;a.dispatchEvent("actionsunload",{bindings:this});};this.addEventListener("DOMNodeInsertedIntoDocument",function(g){var b=this.childNodes;for(var d,c=0,a=b.length;c<a;c++){if((d=b[c]).nodeType!=1){continue;}d.dispatchEvent("DOMNodeInsertedIntoDocument");}this.register(this.parentNode);});}).call(apf.actions.prototype=new apf.AmlElement());apf.aml.setElement("actions",apf.actions);apf.range=function(b,a){this.$init(a||"range",apf.NODE_VISIBLE,b);};apf.slider=function(b,a){this.$init(a||"slider",apf.NODE_VISIBLE,b);};(function(){this.implement(apf.DataAction);this.$focussable=true;this.$dragging=false;this.$onlySetXml=false;this.disabled=false;this.realtime=true;this.balloon=true;this.value=0;this.mask="%";this.min=0;this.max=1000001;this.isOpened=false;this.hasTSlider=false;this.$supportedProperties.push("step","mask","min","max","slide","value","markers");this.$booleanProperties.realtime=true;this.$booleanProperties.markers=true;this.$booleanProperties.balloon=true;this.$propHandlers.step=function(a){this.step=parseInt(a)||0;if(!this.$hasLayoutNode("marker")){return;}if(!this.slider){this.slideDiscreet=true;}};this.$propHandlers.markers=function(m){var g,d=this.oMarkers.childNodes;for(g=d.length-1;g>=0;g--){if(d[g].tagName=="U"&&d[g].nodeType==1){apf.destroyHtmlNode(d[g]);}}if(!this.step&&this.$aml){this.step=parseInt(this.getAttribute("step"))||0;}if(m&&this.step){var k,c,b=[],l=(this.max==1000001)?1:this.max,j=(l-this.min)/this.step,a=this.$dir=="horizontal"?"left":"top",n=this.$dir=="horizontal"?this.oSlider.offsetWidth-this.oKnob.offsetWidth-apf.getWidthDiff(this.oSlider):this.oSlider.offsetHeight-this.oKnob.offsetHeight;for(g=0;g<j+1;g++){this.$getNewContext("marker");c=this.$getLayoutNode("marker");k=Math.max(0,(g*(1/(j))));c.setAttribute("style",a+":"+Math.round(k*n)+"px");b.push(c);}apf.insertHtmlNodes(b,this.oMarkers);}};this.$resize=function(){this.$propHandlers.value.call(this,this.value);var d=(this.max-this.min)/this.step;if(!d){return;}var j,c,g=this.$dir=="horizontal"?"left":"top",b=this.$dir=="horizontal"?this.oSlider.offsetWidth-this.oKnob.offsetWidth-apf.getWidthDiff(this.oSlider):this.oSlider.offsetHeight-this.oKnob.offsetHeight,a=this.oMarkers.getElementsByTagName("U");for(c=a.length-1;c>=0;c--){j=Math.max(0,c*(1/d));a[c].style[g]=Math.round(j*b)+"px";}};this.$propHandlers.mask=function(a){if(!a){this.mask="%";}if(!this.mask.match(/^(%|#.?#*)$/)){this.mask=a.split(/\||;/);}};this.$propHandlers.progress=function(a){if(!this.oProgress){this.oProgress=apf.insertHtmlNode(this.$getLayoutNode("progress"),this.$getLayoutNode("main","progress",this.$ext));}this.oProgress.style.width=((a||0)*100)+"%";};this.$propHandlers.min=function(a){this.min=parseInt(a)||0;if(this.markers){this.$propHandlers.markers.call(this,this.markers);}if(this.value<this.min||this.value!=this.$value){this.value=-1;this.setProperty("value",this.$value);}};this.$propHandlers.max=function(a){this.max=parseInt(a)||1;if(this.markers){this.$propHandlers.markers.call(this,this.markers);}if(this.value>this.min||this.value!=this.$value){this.value=-1;this.setProperty("value",this.$value);}};this.$propHandlers.slide=function(a){this.slideDiscreet=a=="discrete";this.slideSnap=a=="snap";};this.$propHandlers.value=function(m,b,c,d){if(!this.$dir||this.$onlySetXml){return;}if(this.$dragging&&!c&&!this.realtime){return;}this.$value=m;this.value=Math.max(this.min,Math.min(this.max,m))||0;var l,j,i,k=this,n=this.max==this.min?0:(this.value-this.min)/(this.max-this.min);if(this.$dir=="horizontal"){l=(this.oSlider.offsetWidth-apf.getWidthDiff(this.oSlider))-this.oKnob.offsetWidth;j=parseInt(apf.getBox(apf.getStyle(this.oSlider,"padding"))[3]);i=Math.round(((l-j)*n)+j);if(d){apf.tween.single(this.oKnob,{type:"left",steps:5,interval:10,from:this.oKnob.offsetLeft,to:i,anim:apf.tween.NORMAL,oneach:function(q){if(k.oFill){k.oFill.style.width=(q.offsetLeft+3)+"px";}}});}else{this.oKnob.style.left=i+"px";if(this.oFill){this.oFill.style.width=(i+3)+"px";}}}else{l=(this.oSlider.offsetHeight-apf.getHeightDiff(this.oSlider))-this.oKnob.offsetHeight;j=parseInt(apf.getBox(apf.getStyle(this.oSlider,"padding"))[0]);i=(((l-j)*(1-n))+j);if(d){apf.tween.single(this.oKnob,{type:"top",steps:5,interval:10,from:this.oKnob.offsetTop,to:i,anim:apf.tween.NORMAL,oneach:function(q){if(k.oFill){k.oFill.style.height=(q.offsetTop+3)+"px";}}});}else{this.oKnob.style.top=i+"px";if(this.oFill){this.oFill.style.height=(i+3)+"px";}}}if(this.oLabel){var o=this.mask.split(".");switch(o[0]){case"%":var g=Math.round(n*100)+"%";break;case"#":var a=(this.step?(Math.round(this.value/this.step)*this.step):this.value);var g=new Number(a).toFixed(o[1]?o[1].length:0);break;default:var g=this.mask[Math.round(this.value-this.min)/(this.step||1)];break;}if(this.oLabel.nodeValue!==null){this.oLabel.nodeValue=g;}else{this.oLabel.value=g;}}};this.setValue=function(a){this.setProperty("value",a,false,true);};this.setLabelValue=function(b){var a=this.mask.split(".");switch(a[0]){case"%":b=parseInt(b)*(this.max-this.min)/100;break;case"#":b=new Number(b).toFixed(a[1]?a[1].length:0);break;}this.$propHandlers.value.call(this,b);};this.getValue=function(){return this.step?Math.round(parseInt(this.value)/this.step)*this.step:this.value;};this.addEventListener("keydown",function(b){var a=b.keyCode;var c=b.ctrlKey;switch(a){case 37:if(this.$dir!="horizontal"){return;}this.setValue(this.value-(c?0.01:0.1));break;case 38:if(this.$dir!="vertical"){return;}this.setValue(this.value+(c?0.01:0.1));break;case 39:if(this.$dir!="horizontal"){return;}this.setValue(this.value+(c?0.01:0.1));break;case 40:if(this.$dir!="vertical"){return;}this.setValue(this.value-(c?0.01:0.1));break;case 13:if(this.hasTSlider){this.setLabelValue(this.oLabel.value);}break;default:return;}return false;},true);this.slideToggle=function(a,b){if(!a){a=event;}if(b&&this.disabled){return;}if(this.isOpened){this.slideUp();}else{this.slideDown(a);}};this.slideDown=function(j){if(this.dispatchEvent("slidedown")===false){return false;}this.isOpened=true;this.oSliderContainer.style.display="block";this.oSliderContainer.style[apf.supportOverflowComponent?"overflowY":"overflow"]="hidden";this.oSliderContainer.style.display="block";var g=this.oSliderContainer.offsetWidth;var c=this.oSliderContainer.offsetHeight;var d=this.oKnob.offsetWidth;var i=apf.getDiff(this.oSliderContainer);var b=g-this.$ext.offsetWidth;this.setLabelValue(this.oLabel.value);this.oSliderContainer.style.display="none";if(this.hasTSlider){b-=g-parseInt(this.oKnob.style.left)-d;}this.oSliderContainer.style.display="";this.$setStyleClass(this.$ext,this.$baseCSSname+"Down");var a=this;apf.popup.show(this.$uniqueId,{x:-1*b,y:this.$ext.offsetHeight,animate:true,ref:this.$ext,width:g+1,height:c-i[1],callback:function(k){k.style[apf.supportOverflowComponent?"overflowY":"overflow"]="hidden";}});};this.slideUp=function(){if(!this.isOpened){return false;}if(this.dispatchEvent("slideup")===false){return false;}this.isOpened=false;if(this.selected){var a=apf.xmldb.findHtmlNode(this.selected,this);if(a){this.$setStyleClass(a,"",["hover"]);}}this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Down"]);apf.popup.hide();return false;};this.addEventListener("afterselect",function(a){if(!a){a=event;}this.slideUp();if(!this.isOpened){this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Over"]);}});this.$blur=function(){this.slideUp();if(!this.isOpened){this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Over"]);}this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Focus",this.$baseCSSname+"Down"]);if(this.hasTSlider){this.setLabelValue(this.oLabel.value);}};this.$focus=function(){this.$setStyleClass(this.oFocus||this.$ext,this.$baseCSSname+"Focus");};this.$draw=function(){this.$getNewContext("main");this.$ext=this.$getExternal(null,null,function(g){var d=this.$getLayoutNode("main","button",g);if(d){d.setAttribute("onmousedown","apf.lookup("+this.$uniqueId+").slideToggle(event, true);");}});this.hasTSlider=this.$hasLayoutNode("container");if(this.hasTSlider){this.$getNewContext("container");this.oSliderContainer=this.$getExternal("container",null,function(d){});}this.oLabel=this.$getLayoutNode("main","status",this.$ext);this.oFill=this.$getLayoutNode("main","fill",this.$ext);this.oBalloon=this.$getLayoutNode("main","balloon",this.$ext);this.$ext.onselectstart=function(d){if(!d){d=event;}d.cancelBubble=true;};if(this.hasTSlider){this.oMarkers=this.$getLayoutNode("container","markers",this.oSliderContainer);this.oKnob=this.$getLayoutNode("container","grabber",this.oSliderContainer);this.oSlider=this.$getLayoutNode("container","slider",this.oSliderContainer);this.$pHtmlDoc=apf.popup.setContent(this.$uniqueId,this.oSliderContainer,apf.skins.getCssString(this.skinName));document.body.appendChild(this.oSliderContainer);}else{this.oMarkers=this.$getLayoutNode("main","markers",this.$ext);this.oKnob=this.$getLayoutNode("main","slider",this.$ext);this.oSlider=this.$ext;}this.$dir=this.$getOption("main","direction")||"horizontal";this.oKnob.style.left=(parseInt(apf.getBox(apf.getStyle(this.oSlider,"padding"))[3]))+"px";var a=this;function c(d){this.x=(d.clientX||d.x);this.y=(d.clientY||d.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(apf.getStyle(a.oSlider,"width"))-this.offsetWidth;this.min=parseInt(apf.getBox(apf.getStyle(a.oSlider,"padding"))[3]);}else{this.max=parseInt(apf.getStyle(a.oSlider,"height"))-this.offsetHeight;this.min=parseInt(apf.getBox(apf.getStyle(a.oSlider,"padding"))[0]);}}function b(i,g,k){var j=(a.$dir=="horizontal")?(g.clientX||g.x)-i.x+i.stX:(g.clientY||g.y)-i.y+i.stY;j=(j>i.max?i.max:(j<i.min?i.min:j));var d=(((j-i.min)*100/(i.max-i.min)/100)*(a.max-a.min))+a.min;d=k?(Math.round(d/a.step)*a.step):d;d=(a.$dir=="horizontal")?d:1-d;return d;}this.oKnob.onmousedown=function(g){if(a.disabled){return false;}g=g||window.event;document.dragNode=this;c.call(this,g);a.$setStyleClass(this,"btndown",["btnover"]);apf.dragMode=true;a.$dragging=true;if(a.balloon&&a.oBalloon){a.oBalloon.style.display="block";a.oBalloon.style.left=(a.oKnob.offsetLeft-(a.oBalloon.offsetWidth-a.oKnob.offsetWidth)/2)+"px";}var d=this.value;document.onmousemove=function(k){k=k||window.event;var l=this.dragNode;if(!l){apf.dragMode=document.onmousemove=document.onmouseup=null;return;}var j=b(l,k,a.slideSnap);if(a.realtime){if(a.slideDiscreet){this.$onlySetXml=true;var i=a.change(Math.round((j/a.step)*a.step));this.$onlySetXml=false;if(i!==false){a.$propHandlers.value.call(a,j,"value",true);}}else{a.change(j);}}else{a.$propHandlers.value.call(a,j,"value",true);}if(a.balloon&&a.oBalloon){a.oBalloon.style.left=(a.oKnob.offsetLeft-(a.oBalloon.offsetWidth-a.oKnob.offsetWidth)/2)+"px";}};document.onmouseup=function(k){var l=this.dragNode;this.dragNode=null;l.onmouseout();a.$dragging=false;var j=b(l,k||window.event,a.slideDiscreet||a.slideSnap);a.value=d;var i=d!=j?a.change(j,true):false;if(i!==false&&a.slideDiscreet){a.$propHandlers.value.call(a,j,"value",true);}apf.dragMode=false;document.onmousemove=document.onmouseup=null;if(a.balloon&&a.oBalloon){a.oBalloon.style.left=(a.oKnob.offsetLeft-(a.oBalloon.offsetWidth-a.oKnob.offsetWidth)/2)+"px";$setTimeout(function(){if(apf.isIE){a.oBalloon.style.display="none";}else{apf.tween.single(a.oBalloon,{type:"fade",from:1,to:0,steps:5,onfinish:function(){a.oBalloon.style.display="none";a.oBalloon.style.opacity=1;}});}},a.slideDiscreet?200:0);}};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.oSlider.onmousedown=function(i){if(a.disabled){return false;}i=i||window.event;var j=a.oKnob;if((i.srcElement||i.target)!=j){var g=apf.getAbsolutePosition(j);c.call(j,{x:g[0]+j.offsetWidth/2,y:g[1]+j.offsetHeight/2});var d=b(j,i,a.slideDiscreet||a.slideSnap);a.$propHandlers.value.call(a,b(j,i,a.slideDiscreet),"value",true,true);a.setValue(d);}};if(apf.isIphone){apf.iphone.linkEvents(this.oKnob);}};this.addEventListener("DOMNodeInsertedIntoDocument",function(){if(this.max==1000001){this.setProperty("max",1);}apf.layout.setRules(this.oSlider,"knob","apf.all["+this.$uniqueId+"].$resize()",true);apf.layout.queue(this.$ext);});this.$destroy=function(){this.oKnob.onmousedown=this.oKnob.onmouseup=this.oKnob.onmouseover=this.oKnob.onmouseout=null;apf.layout.removeRule(this.$ext,"knob");};}).call(apf.slider.prototype=new apf.StandardBinding());apf.range.prototype=apf.slider.prototype;apf.aml.setElement("range",apf.range);apf.aml.setElement("slider",apf.slider);apf.BindingLoadRule=function(b,a){this.$init(a,apf.NODE_HIDDEN,b);};(function(){this.$attrExcludePropBind=apf.extend({get:1},this.$attrExcludePropBind);this.$propHandlers.get=function(a,b){delete this["c"+b];};}).call(apf.BindingLoadRule.prototype=new apf.BindingRule());apf.aml.setElement("load",apf.BindingLoadRule);apf.aml.setElement("insert",apf.BindingLoadRule);apf.param=function(b,a){this.$init(a||"param",apf.NODE_HIDDEN,b);};apf.param.prototype=new apf.AmlElement();apf.param.prototype.$parsePrio="002";apf.aml.setElement("variable",apf.param);apf.aml.setElement("param",apf.param);apf.label=function(b,a){this.$init(a||"label",apf.NODE_VISIBLE,b);};(function(){this.implement(apf.DataAction,apf.ChildValue);var a=this;this.$focussable=false;var b;this.setValue=function(c){this.setProperty("value",c,false,true);};this.getValue=function(){return this.value;};this.$supportedProperties.push("caption","value","for");this.$propHandlers.caption=this.$propHandlers.value=function(c){this.$caption.innerHTML=c;};this.$propHandlers["for"]=function(c){b=typeof c=="string"?self[c]:c;};this.$draw=function(){this.$ext=this.$getExternal();this.$caption=this.$getLayoutNode("main","caption",this.$ext);if(this.$caption.nodeType!=1){this.$caption=this.$caption.parentNode;}this.$ext.onmousedown=function(){if(b&&b.$focussable&&b.focussable){b.focus();}};};this.$childProperty="value";}).call(apf.label.prototype=new apf.BaseSimple());apf.aml.setElement("label",apf.label);apf.source=function(b,a){this.$init(a||"source",apf.NODE_HIDDEN,b);};(function(){this.$supportedProperties.push("src","type");this.addEventListener("DOMNodeInsertedIntoDocument",function(a){if(this.parentNode.$addSource){this.parentNode.$addSource(this);}});}).call(apf.source.prototype=new apf.AmlElement());apf.aml.setElement("source",apf.source);apf.defaults=function(b,a){this.$init(a||"services",apf.NODE_HIDDEN,b);};(function(){this.$parsePrio="002";this.$propHandlers["for"]=function(a){if(this.$lastFor){apf.nameserver.remove("defaults_"+this.$lastFor,this);}apf.nameserver.add("defaults_"+a,this);this.$lastFor=a;};this.addEventListener("DOMNodeRemovedFromDocument",function(a){apf.nameserver.remove("defaults_"+this.$lastFor,this);});}).call(apf.defaults.prototype=new apf.AmlElement());apf.aml.setElement("defaults",apf.defaults);apf.menu=function(b,a){this.$init(a||"menu",apf.NODE_VISIBLE,b);};(function(){this.$focussable=apf.KEYBOARD;this.$positioning="basic";this.anim=true;this.zindex=10000000;this.$booleanProperties.anim=true;this.$propHandlers.visible=function(j,l,i,g,c){if(j){this.$ext.style.display="block";if(this.opener&&this.opener.localName.indexOf("item")>-1){this.opener.parentNode.$showingSubMenu=this;}}else{this.$ext.style.display="none";var k=apf.menu.lastFocus;if(k!=this.opener&&this.opener&&this.opener.$blur){this.opener.$blur();}if(this.opener&&this.opener.parentNode.localName=="menu"){if(!this.$hideTree){this.$hideTree=-1;}this.opener.parentNode.focus();}else{if(k){if(apf.window.$settingFocus){if(apf.window.$settingFocus!=k&&k.$blur){k.$blur();}this.$blur();if(apf.window.$settingFocus.localName!="menu"){apf.menu.lastFocus=null;}}else{if(!apf.window.hasFocus()){if(k.$blur){k.$blur();}this.$blur();apf.document.activeElement=k;if(k.$focusParent){k.$focusParent.$lastFocussed=k;}apf.menu.lastFocus=null;}else{if(this.$hideTree){if(!this.$hideTree){this.$hideTree=-1;}var d=(k.disabled||!k.visible)&&k!=apf.document.documentElement;if(g||d){if(k.$blur){k.$blur();}this.$blur();apf.document.activeElement=null;if(d&&apf.window.moveNext()===false){apf.window.$focusRoot();}}else{k.focus(null,null,true);}apf.menu.lastFocus=null;}}}}}if(this.$showingSubMenu){this.$showingSubMenu.hide();this.$showingSubMenu=null;}if(this.opener&&this.opener.$submenu){this.opener.$submenu(true,true);if(this.$hideTree===true&&this.opener.parentNode.localName=="menu"){this.opener.parentNode.$hideTree=true;this.opener.parentNode.hide();}this.opener=null;}this.$hideTree=null;if(this.$selected){apf.setStyleClass(this.$selected.$ext,"",["hover"]);this.$selected=null;}}};var b;this.display=function(s,q,m,r,z,n,u){this.opener=r;this.dispatchEvent("display");var w,k,g,d=this.childNodes,o=0,j=d.length,B;for(k=0;k<j;k++){g=d[k];if(g.nodeType!=1){continue;}B=!z||!g.match||(g.cmatch||(g.cmatch=apf.lm.compile(g.match,{xpathmode:3,injectself:true})))(z);if(B){g.show();if(g.localName=="divider"){w=g;if(o==0){g.hide();}o=0;}else{o++;}}else{g.hide();if(!g.nextSibling&&o==0){w.hide();}}}if(this.oOverlay){if(u){this.oOverlay.style.display="block";this.oOverlay.style.width=u+"px";}else{this.oOverlay.style.display="none";}}this.visible=false;this.show();var t=apf.getAbsolutePosition(document.body);apf.popup.show(this.$uniqueId,{x:s-t[0],y:q-t[1]-(apf.isIE&&apf.isIE<8?1:0),animate:m||!this.anim?false:"fade",ref:this.$ext.offsetParent,allowTogether:n,autoCorrect:false});var A=apf.menu.lastFocus=r&&r.$focussable===true?r:apf.menu.lastFocus||apf.document.activeElement;apf.popup.last=null;this.focus();if(A&&A!=this&&A.$focus){A.$focus();}this.xmlReference=z;};this.getValue=function(c){return this.getSelected(c).value||"";};this.getSelected=function(j){var d=this.childNodes;var g,c=d.length;for(g=0;g<c;g++){if(d[g].group!=j){continue;}if(d[g].selected){return d[g];}}return false;};this.select=function(k,j){var d=this.childNodes;var g,c=d.length;for(g=0;g<c;g++){if(d[g].group!=k){continue;}if(d[g].value==j||!d[g].value&&d[g].caption==j){d[g].$handlePropSet("selected",true);}else{if(d[g].selected){d[g].$handlePropSet("selected",false);}}}};this.addEventListener("keydown",function(i){var g,c=i.keyCode;switch(c){case 13:if(!this.$selected){return;}g=this.$selected;g.$down();g.$up();g.$click();break;case 38:g=this.$selected&&this.$selected.previousSibling||this.lastChild;if(g&&g.localName=="divider"){g=g.previousSibling;}if(!g){return;}if(this.$selected){apf.setStyleClass(this.$selected.$ext,"",["hover"]);}apf.setStyleClass(g.$ext,"hover");this.$selected=g;break;case 40:g=this.$selected&&this.$selected.nextSibling||this.firstChild;if(g&&g.localName=="divider"){g=g.nextSibling;}if(!g){return;}if(this.$selected){apf.setStyleClass(this.$selected.$ext,"",["hover"]);}apf.setStyleClass(g.$ext,"hover");this.$selected=g;break;case 37:if(!this.opener){return;}if(this.opener.localName=="button"){g=this.opener.previousSibling;while(g&&!g.submenu){g=g.previousSibling;}if(g){g.dispatchEvent("mouseover");var d=g.parentNode.menuIsPressed;if(d){self[d.submenu].dispatchEvent("keydown",{keyCode:40});}}}else{if(this.opener.parentNode.localName=="menu"){var j=this.opener;this.hide();apf.setStyleClass(j.$ext,"hover");j.parentNode.$showingSubMenu=null;}}break;case 39:if(this.$selected&&this.$selected.submenu){this.$selected.$submenu(null,true);this.$showingSubMenu.dispatchEvent("keydown",{keyCode:40});return;}if(this.opener){var j=this.opener;while(j&&j.parentNode&&j.parentNode.localName=="menu"){j=j.parentNode.opener;}if(j&&j.localName=="button"){g=j.nextSibling;while(g&&!g.submenu){g=g.nextSibling;}if(g){g.dispatchEvent("mouseover");var d=g.parentNode.menuIsPressed;if(d){self[d.submenu].dispatchEvent("keydown",{keyCode:40});}return;}}}if(!this.$selected){arguments.callee.call(this,{keyCode:40});}break;default:return;}return false;},true);function a(){if(this.$showingSubMenu){return;}if(this.$hideTree!=-1){this.$hideTree=true;this.hide();}return false;}this.addEventListener("focus",function(){apf.popup.last=this.$uniqueId;});this.addEventListener("blur",a);this.addEventListener("popuphide",a);this.$draw=function(){this.$pHtmlNode=document.body;this.$ext=this.$getExternal();this.oOverlay=this.$getLayoutNode("main","overlay",this.$ext);apf.popup.setContent(this.$uniqueId,this.$ext,"",null,null);};this.$loadAml=function(c){this.$int=this.$getLayoutNode("main","container",this.$ext);};this.$destroy=function(){apf.popup.removeContent(this.$uniqueId);};}).call(apf.menu.prototype=new apf.Presentation());apf.aml.setElement("menu",apf.menu);apf.remote=function(b,a){this.$init(a||"remote",apf.NODE_HIDDEN,b);};(function(){this.lookup={};this.select=[];this.sessions={};this.rsbQueue={};this.queueTimer=null;this.pendingSessions={};this.pendingTerminations={};this.$attrExcludePropBind=apf.extend({match:1},this.$attrExcludePropBind);this.startSession=function(c,b){if(!c.id){c.setAttribute("id","rmtRsbGen".appendRandomNumber(5));}b=b||"//";var d=c.id+":"+b;this.sessions[d]=c;if(this.transport&&this.transport.isConnected()){delete this.sessions[d];delete this.pendingSessions[d];d=this.transport.normalizeEntity(d);this.sessions[d]={model:c,xpath:b};var a=this;this.transport.startRSB(d,function(i,g){a.sessionStarted(i,g);});}else{this.pendingSessions[d]=c;}};this.endSession=function(b,a){a=a||"//";var c=b.id+":"+a;if(this.transport&&this.transport.isConnected()){delete this.pendingTerminations[c];this.transport.endRSB(this.transport.normalizeEntity(c));}else{this.pendingTerminations[c]=b;}delete this.sessions[c];};this.sessionStarted=function(d,c){var b;if(!(b=this.sessions[d])){return;}var a=new Date().getTime();b.baseline=c?parseInt(c):a;apf.console.log("session started: "+d+", "+b.baseline);};this.pauseSession=function(){};this.sendChange=function(c,b){if(apf.xmldb.disableRSB){return;}clearTimeout(this.queueTimer);this.queueMessage(c,b,this);if(!apf.isO3){var a=this;this.queueTimer=$setTimeout(function(){a.processQueue(a);});}else{this.processQueue(this);}};this.getSessionByModel=function(b){if(typeof b!="string"){b=b.id;}for(var a in this.sessions){if(this.sessions[a].model.id==b){return this.sessions[a];}}return null;};this.buildMessage=function(c,b){var g=this.getSessionByModel(b.id),d=0,a=c.length;for(;d<a;++d){if(c[d]&&c[d].nodeType){c[d]=this.xmlToXpath(c[d],b.data);}}return{model:b.id,args:c,currdelta:new Date().getTime()-g.baseline};};this.queueMessage=function(b,a,c){if(!c.rsbQueue){c.rsbQueue={};}if(!c.rsbQueue[a.id]){c.rsbQueue[a.id]=[];c.rsbModel=a;}c.rsbQueue[a.id].push(this.buildMessage(b,a));};this.processQueue=function(b){if(b===this){clearTimeout(this.queueTimer);}if(apf.xmldb.disableRSB){return;}for(var a in b.rsbQueue){if(!b.rsbQueue[a].length){continue;}this.transport.sendRSB(a,apf.serialize(b.rsbQueue[a]));}b.rsbQueue={};};this.receiveChange=function(m,d){if(apf.xmldb.disableRSB){return;}if(m.timestamp<this.discardBefore){return;}var g=d?d.model:apf.nameserver.get("model",m.model),a=m.args;var j,n,r,s=apf.xmldb.disableRSB;apf.xmldb.disableRSB=2;m.currdelta=d.baseline+parseInt(m.currdelta);if(d&&g.$at){var o=g.$at.getDone(m.currdelta),c=0,b=o.length;if(b){for(;c<b;++c){o[c].$dontapply=true;}g.$at.undo(b);}}r=this.xpathToXml(a[1],g.data);if(r){switch(a[0]){case"setTextNode":apf.xmldb.setTextNode(r,a[2],a[3]);break;case"setAttribute":apf.xmldb.setAttribute(r,a[2],a[3],a[4]);break;case"addChildNode":apf.xmldb.addChildNode(r,a[2],a[3],this.xpathToXml(a[4],g.data),a[5]);break;case"appendChild":n=(a[3]?this.xpathToXml(a[3],g.data):null);if(typeof a[2]=="string"){a[2]=apf.getXml(a[2]);}apf.xmldb.appendChild(r,apf.xmldb.cleanNode(a[2]),n,a[4],a[5]);break;case"moveNode":n=(a[3]?this.xpathToXml(a[3],g.data):null);var k=this.xpathToXml(a[2],g.data);apf.xmldb.appendChild(r,k,n,a[4],a[5]);break;case"removeNode":apf.xmldb.removeNode(r,a[2]);break;case"setNodeValue":apf.setNodeValue(r,a[2],true);break;}}if(d&&g.$at&&b){g.$at.redo(b);for(c=0;c<b;++c){o[c].$dontapply=false;}}apf.xmldb.disableRSB=s;if(j){throw j;}};this.xmlToXpath=apf.xmlToXpath;this.xpathToXml=apf.xpathToXml;this.addEventListener("DOMNodeInsertedIntoDocument",function(b){var a=this;this.transport=self[this["transport"]];this.transport.addEventListener("connected",function(){var c;for(c in a.pendingTerminations){a.endSession(a.pendingTerminations[c],c.split(":")[1]);}for(c in a.pendingSessions){a.startSession(a.pendingSessions[c],c.split(":")[1]);}});this.transport.addEventListener("datachange",function(j){var k=apf.unserialize(j.body),g=a.sessions[j.session],d=0,c=k.length;for(;d<c;d++){a.receiveChange(k[d],g);}});this.transport.addEventListener("datastatuschange",function(j){apf.console.log("datastatuschange msg: "+j);if(!j.session&&!j.fields.session){return;}var i=j.session||j.fields.session.value,g=a.sessions[i];if(!g){return;}if(j.type=="submit"){var c=j.baseline||j.fields.baseline?g.baseline:0,d=j.modeldata||j.fields.modeldata?g.model.getXml().xml:"";this.sendSyncRSB(j.from,i,c,d);}else{if(j.type=="result"){a.sessions[i].model.load(j.fields.modeldata.value);a.sessionStarted(i,j.fields.baseline.value);}}});});this.addEventListener("DOMNodeRemovedFromDocument",function(c){for(var b=0,a=this.sessions.length;b<a;++b){this.endSession(this.sessions[b].model,this.sessions[b].xpath);}});}).call(apf.remote.prototype=new apf.AmlElement());apf.aml.setElement("remote",apf.remote);apf.aml.setElement("unique",apf.BindingRule);apf.BindingDndRule=function(b,a){this.$init(a,apf.NODE_HIDDEN,b);};(function(){this.compile=function(b){if(!this[b]){return;}var a;if(b=="value"){a=apf.lm.compile(this[b],{xpathmode:3});}else{if(b=="match"){a=apf.lm.compile(this[b],{xpathmode:3,injectself:true});}else{if(b=="target"){a=apf.lm.compile(this[b],{xpathmode:2,injectself:true});}else{if(b=="action"){a=apf.lm.compile(this[b],{nostring:true});}else{if(b=="copy"){a=apf.lm.compile(this[b],{withopt:true,nostring:true});}else{throw new Error("Missing property handler for compile");}}}}}return(this["c"+b]=a);};this.$attrExcludePropBind=apf.extend({target:1,parent:1,action:1,dragcopy:1},this.$attrExcludePropBind);this.$propHandlers.target=this.$propHandlers.parent=this.$propHandlers.action=this.$propHandlers.dragcopy=function(a,b){delete this["c"+b];};this.$noderegister=function(a){apf.GuiElement.propHandlers.drop.call(a.amlNode,true);};this.addEventListener("DOMNodeInsertedIntoDocument",function(d){var c=this;while(c&&c.$bindingRule){c=c.parentNode;}if(!c){return;}if(c.localName=="bindings"){c.addEventListener("noderegister",this.$noderegister);var a=c.$amlNodes;for(var b=0;b<a.length;b++){apf.GuiElement.propHandlers.drop.call(a[b],true);}}else{apf.GuiElement.propHandlers.drop.call(c,true);}});}).call(apf.BindingDndRule.prototype=new apf.BindingRule());apf.aml.setElement("drag",apf.BindingDndRule);apf.aml.setElement("drop",apf.BindingDndRule);apf.notifier=function(b,a){this.$init(a||"notifier",apf.NODE_VISIBLE,b);};(function(){this.timeout=2000;this.position="top-right";this.columnsize=300;this.arrange="vertical";this.margin="10 10 10 10";this.lastPos=null;this.showing=0;this.sign=1;this.$supportedProperties.push("margin","position","timeout","columnsize","arrange");this.$propHandlers.position=function(c){this.lastPos=null;};this.$propHandlers.margin=function(c){this.margin=c;};this.$propHandlers.timeout=function(c){this.timeout=parseInt(c)*1000;};function b(){return[document.documentElement.scrollTop||document.body.scrollTop,document.documentElement.scrollLeft||document.body.scrollLeft];}function a(c,g,l,j,d,k){var i=b();return[(c[0]=="top"?k[0]:(c[0]=="bottom"?g-j-k[2]:g/2-j/2))+i[0],(c[1]=="left"?k[3]:(c[1]=="right"?l-d-k[1]:l/2-d/2))+i[1]];}this.popup=function(l,u,w){if(!this.$ext){return;}this.$ext.style.width=this.columnsize+"px";var g=this,s=this.$pHtmlNode.appendChild(this.$ext.cloneNode(true)),z=apf.isIE?document.documentElement.offsetWidth:window.innerWidth,j=apf.isIE?document.documentElement.offsetHeight:window.innerHeight,t=false,n=this.$getLayoutNode("notification","icon",s),d=this.$getLayoutNode("notification","body",s);this.showing++;if(n&&u){if(n.nodeType==1){n.style.backgroundImage="url("+this.iconPath+u+")";}else{n.nodeValue=this.iconPath+u;}this.$setStyleClass(s,this.$baseCSSname+"ShowIcon");}d.insertAdjacentHTML("beforeend",l||"[No message]");s.style.display="block";var o=apf.getBox(this.margin||"0"),i=s.offsetHeight,y=s.offsetWidth,k=this.position.split("-"),m=false;if(k[1]=="top"||k[1]=="bottom"||k[0]=="left"||k[0]=="right"){k=[k[1],k[0]];}if((k[0]=="center"&&k[1]!=="center")||(k[0]!=="center"&&k[1]=="center")){k=["top","right"];}if(!this.lastPos){this.lastPos=a(k,j,z,i,y,o);this.sign=1;m=true;}if((!m&&k[0]=="bottom"&&this.sign==1)||(k[0]=="top"&&this.sign==-1)){if(this.arrange=="vertical"){this.lastPos[0]+=k[1]=="center"?0:this.sign*(k[0]=="top"?o[0]+i:(k[0]=="bottom"?-o[2]-i:0));}else{this.lastPos[1]+=k[0]=="center"?0:this.sign*(k[1]=="left"?o[3]+y:(k[1]=="right"?-o[1]-y:0));}}var c=b();if(this.lastPos[0]>j+c[0]-i||this.lastPos[0]<c[0]){this.lastPos[1]+=(k[1]=="left"?y+o[3]:(k[1]=="right"?-y-o[3]:0));this.sign*=-1;this.lastPos[0]+=this.sign*(k[0]=="top"?o[0]+i:(k[0]=="bottom"?-o[2]-i:0));}else{if(this.lastPos[1]>z+c[1]-y||this.lastPos[1]<c[1]){this.lastPos[0]+=(k[0]=="top"?i+o[0]:(k[0]=="bottom"?-i-o[0]:0));this.sign*=-1;this.lastPos[1]+=k[0]=="center"?0:this.sign*(k[1]=="left"?o[3]+y:(k[1]=="right"?-o[1]-y:0));}}if(this.lastPos){if((this.lastPos[0]>j+c[0]-i||this.lastPos[0]<c[1])&&this.arrange=="horizontal"){this.lastPos=a(k,j,z,i,y,o);this.sign=1;}if((this.lastPos[1]>z+c[1]-y||this.lastPos[1]<c[1])&&this.arrange=="vertical"){this.lastPos=a(k,j,z,i,y,o);this.sign=1;}}s.style.left=this.lastPos[1]+"px";s.style.top=this.lastPos[0]+"px";if((k[0]=="top"&&this.sign==1)||(k[0]=="bottom"&&this.sign==-1)){if(this.arrange=="vertical"){this.lastPos[0]+=k[1]=="center"?0:this.sign*(k[0]=="top"?o[0]+i:(k[0]=="bottom"?-o[2]-i:0));}else{this.lastPos[1]+=k[0]=="center"?0:this.sign*(k[1]=="left"?o[3]+y:(k[1]=="right"?-o[1]-y:0));}}var q=false;apf.tween.css(s,"fade",{anim:apf.tween.NORMAL,steps:10,interval:10,onfinish:function(x){s.style.filter="";$setTimeout(r,g.timeout);}});function r(){if(q){return;}apf.tween.css(s,"notifier_hidden",{anim:apf.tween.NORMAL,steps:10,interval:20,onfinish:function(x){apf.setStyleClass(s,"",["notifier_hover"]);if(q){return;}if(s.parentNode){if(s.parentNode.removeChild(s)&&!t){g.showing--;t=true;}}if(g.showing==0){this.lastPos=null;}}});}s.onmouseover=function(A){A=(A||event);var x=A.explicitOriginalTarget||A.toElement;if(q){return;}if(x==s||apf.isChildOf(s,x)){apf.tween.css(s,"notifier_hover",{anim:apf.tween.NORMAL,steps:10,interval:20,onfinish:function(B){apf.setStyleClass(s,"",["notifier_shown"]);}});q=true;}};s.onmouseout=function(A){A=(A||event);var x=A.explicitOriginalTarget||A.toElement;if(!q){return;}if(apf.isChildOf(x,s)||(!apf.isChildOf(s,x)&&s!==x)){q=false;r();}};if(w){s.onclick=function(){w.dispatchEvent("click");};}};this.$draw=function(){this.$pHtmlNode=document.body;this.$ext=this.$getExternal("notification");this.$ext.style.display="none";this.$ext.style.position="absolute";this.$ext.style.zIndex=100000;};}).call(apf.notifier.prototype=new apf.Presentation());apf.aml.setElement("notifier",apf.notifier);apf.aml.setElement("event",apf.event);apf.dropdown=function(b,a){this.$init(a||"dropdown",apf.NODE_VISIBLE,b);};(function(){this.$animType=1;this.$animSteps=5;this.$animSpeed=20;this.$itemSelectEvent="onmouseup";this.dragdrop=false;this.reselectable=true;this.$focussable=true;this.autoselect=false;this.multiselect=false;this.disableremove=true;this.delayedselect=false;this.maxitems=5;this.$booleanProperties.disableremove=true;this.$supportedProperties.push("maxitems","disableremove","initial-message","fill");this.$propHandlers.maxitems=function(b){this.sliderHeight=b?(Math.min(this.maxitems||100,b)*this.itemHeight):10;this.containerHeight=b?(Math.min(this.maxitems||100,b)*this.itemHeight):10;};this.slideToggle=function(b,c){if(!b){b=event;}if(c&&this.disabled){return;}if(this.isOpen){this.slideUp();}else{this.slideDown(b);}};this.slideDown=function(c){if(this.dispatchEvent("slidedown")===false){return false;}this.isOpen=true;this.$propHandlers.maxitems.call(this,this.xmlRoot&&this.each?this.getTraverseNodes().length:this.childNodes.length);this.oSlider.style.display="block";if(!this.ignoreOverflow){this.oSlider.style[apf.supportOverflowComponent?"overflowY":"overflow"]="visible";this.$container.style.overflowY="hidden";}this.oSlider.style.display="";this.$setStyleClass(this.$ext,this.$baseCSSname+"Down");this.oSlider.style.height=(this.sliderHeight-1)+"px";this.oSlider.style.width=(this.$ext.offsetWidth-2-this.widthdiff)+"px";var b=this;apf.popup.show(this.$uniqueId,{x:0,y:this.$ext.offsetHeight,animate:true,ref:this.$ext,$int:this.$container,width:this.$ext.offsetWidth-this.widthdiff,height:this.containerHeight,callback:function(d){if(!b.ignoreOverflow){b.$container.style.overflowY="auto";}}});};this.slideUp=function(){if(this.isOpen==2){return false;}if(this.dispatchEvent("slideup")===false){return false;}this.isOpen=false;if(this.selected){var b=apf.xmldb.findHtmlNode(this.selected,this);if(b){this.$setStyleClass(b,"",["hover"]);}}this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Down"]);apf.popup.hide();return false;};this.$setLabel=function(b){this.oLabel.innerHTML=b||this["initial-message"]||"";this.$setStyleClass(this.$ext,b?"":this.$baseCSSname+"Initial",!b?[]:[this.$baseCSSname+"Initial"]);};this.addEventListener("afterselect",function(b){if(!b){b=event;}this.slideUp();if(!this.isOpen){this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Over"]);}this.$setLabel(b.selection.length?this.$applyBindRule("caption",this.selected):"");});function a(){if(this.isOpen==2){this.slideDown();}}this.addEventListener("afterload",a);this.addEventListener("xmlupdate",function(){a.call(this);this.$setLabel(this.$applyBindRule("caption",this.selected));});this.$blur=function(){this.slideUp();if(!this.isOpen){this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Over"]);}this.$setStyleClass(this.$ext,"",[this.$baseCSSname+"Focus"]);};this.$setClearMessage=function(b){this.$setLabel(b);};this.$removeClearMessage=function(){this.$setLabel("");};this.addEventListener("popuphide",this.slideUp);this.addEventListener("keydown",function(k){var g=k.keyCode;if(!this.xmlRoot){return;}var j;switch(g){case 38:if(k.altKey){this.slideToggle(k.htmlEvent);return;}if(!this.selected){return;}j=this.getNextTraverseSelected(this.caret||this.selected,false);if(j){this.select(j);}break;case 40:if(k.altKey){this.slideToggle(k.htmlEvent);return;}if(!this.selected){j=this.getFirstTraverseNode();if(!j){return;}}else{j=this.getNextTraverseSelected(this.selected,true);}if(j){this.select(j);}break;default:if(g==9||!this.xmlRoot){return;}if(!this.lookup||new Date().getTime()-this.lookup.date.getTime()>1000){this.lookup={str:"",date:new Date()};}this.lookup.str+=String.fromCharCode(g);var c,b=this.getTraverseNodes();for(var d=0;d<b.length;d++){c=this.$applyBindRule("caption",b[d]);if(c&&c.indexOf(this.lookup.str)>-1){this.select(b[d]);return;}}return;}return false;},true);this.$draw=function(){this.$getNewContext("main");this.$getNewContext("container");this.$animType=this.$getOption("main","animtype")||1;this.clickOpen=this.$getOption("main","clickopen")||"button";this.$ext=this.$getExternal(null,null,function(c){c.setAttribute("onmouseover","var o = apf.lookup("+this.$uniqueId+');o.$setStyleClass(o.$ext, o.$baseCSSname + "Over", null, true);');c.setAttribute("onmouseout","var o = apf.lookup("+this.$uniqueId+');if(o.isOpen) return;o.$setStyleClass(o.$ext, "", [o.$baseCSSname + "Over"], true);');var b=this.$getLayoutNode("main","button",c);if(b){b.setAttribute("onmousedown","apf.lookup("+this.$uniqueId+").slideToggle(event, true);");}var d=this.$getLayoutNode("main","label",c);if(this.clickOpen=="both"){d.parentNode.setAttribute("onmousedown","apf.lookup("+this.$uniqueId+").slideToggle(event, true);");}});this.oLabel=this.$getLayoutNode("main","label",this.$ext);if(this.oLabel.nodeType==3){this.oLabel=this.oLabel.parentNode;}this.oIcon=this.$getLayoutNode("main","icon",this.$ext);if(this.$button){this.$button=this.$getLayoutNode("main","button",this.$ext);}this.oSlider=apf.insertHtmlNode(this.$getLayoutNode("container"),document.body);this.$container=this.$getLayoutNode("container","contents",this.oSlider);this.$container.host=this;this.$pHtmlDoc=apf.popup.setContent(this.$uniqueId,this.oSlider,apf.skins.getCssString(this.skinName));this.listtype=parseInt(this.$getLayoutNode("main","type"))||1;this.itemHeight=this.$getOption("main","item-height")||18.5;this.widthdiff=this.$getOption("main","width-diff")||0;this.ignoreOverflow=apf.isTrue(this.$getOption("main","ignore-overflow"))||false;};this.addEventListener("DOMNodeInsertedIntoDocument",function(){if(typeof this["initial-message"]=="undefined"){this.$setInheritedAttribute("initial-message");}if(!this.selected&&this["initial-message"]){this.$setLabel();}});this.$destroy=function(){apf.popup.removeContent(this.$uniqueId);apf.destroyHtmlNode(this.oSlider);this.oSlider=null;};}).call(apf.dropdown.prototype=new apf.BaseList());apf.config.$inheritProperties["initial-message"]=1;apf.aml.setElement("dropdown",apf.dropdown);apf.skin=function(b,a){this.$init(a||"skin",apf.NODE_HIDDEN,b);};apf.aml.setElement("skin",apf.skin);(function(){this.$parsePrio="002";this.canHaveChildren=false;this.$propHandlers.src=function(i){this.$path=apf.getAbsolutePath(apf.hostPath,i);a.call(this,this.$path);};this.$propHandlers.name=function(i){if(!this.attributes.getNamedItem("src")){this.$path=apf.getAbsolutePath(apf.hostPath,i)+"/index.xml";a.call(this,this.$path);}};function g(l){if(!l.ownerDocument.documentElement){return false;}var j=l.ownerDocument.documentElement.attributes;for(var m=false,k=0;k<j.length;k++){if(j[k].nodeValue==apf.ns.aml){m=true;break;}}return m;}function a(i){var k=this.ownerDocument.$domParser;if(!apf.skins.$first){apf.skins.$first=this;}var j=this.attributes.getNamedItem("defer");if(!j||!apf.isTrue(j.nodeValue)){k.$shouldWait++;this.$parseContext=k.$parseContext||[this.ownerDocument.documentElement];}c.call(this,i);}function d(i){if(i){apf.skins.Init(i,this,this.$path);}if(!this.defer){var j=this.ownerDocument.$domParser;j.$continueParsing.apply(j,this.$parseContext);}}function b(k,j,l){var i=this;apf.getData(apf.getAbsolutePath(l,k.getAttribute("src")),{callback:function(t,r,m){if(r!=apf.SUCCESS){throw new Error("Could not load skin include");}var n=apf.getXml(t);apf.mergeXml(n,j,{beforeNode:k});k.parentNode.removeChild(k);var q=$xmlns(n,"include",apf.ns.aml);if(q.length){var s=apf.getDirname(m.url);for(var o=0;o<q.length;o++){b.call(i,q[o],j,s);}}else{if(!$xmlns(j,"include",apf.ns.aml).length){d.call(i,j);}}}});}function c(j){var i=this;apf.getData(j,{callback:function(r,o,k){if(o!=apf.SUCCESS){var s=new Error(apf.formatErrorString(1007,i,"Loading skin file","Could not load skin file '"+(q||i.src)+"'\nReason: "+k.message));if(k.tpModule.retryTimeout(k,o,null,s)===true){return true;}if(this.autoload){apf.console.warn("Could not autload skin.");return d.call(i);}throw s;}r=r.replace(/\<\!DOCTYPE[^>]*>/,"").replace(/^[\r\n\s]*/,"").replace(/xmlns\=\"[^"]*\"/g,"");if(!r){throw new Error(apf.formatErrorString(0,i,"Loading skin","Empty skin file. Maybe the file does not exist?",i));}var m=apf.getXml(r);if(!m){throw new Error(apf.formatErrorString(0,i,"Loading skin","Could not parse skin. Maybe the file does not exist?",i));}m.setAttribute("filename",k.url);var n=$xmlns(m,"include",apf.ns.aml);if(n.length){var q=apf.getDirname(k.url);for(var l=0;l<n.length;l++){b.call(i,n[l],m,q);}return;}else{d.call(i,m);}},async:true,ignoreOffline:true});}this.addEventListener("DOMNodeInsertedIntoDocument",function(i){if(this.src||this.name){return;}apf.skins.Init(this.$aml||this);});}).call(apf.skin.prototype=new apf.AmlElement());apf.lineselect=function(b,a){this.$init(a||"lineselect",apf.NODE_VISIBLE,b);};(function(){this.deselect=function(){this.value=this.selected=null;};this.select=function(a){if(this.selected){this.selected.className=this.skin.clsItem;}a.className=this.skin.clsSelected;this.selected=a;this.dispatchEvent("afterselect",a.innerHTML);};this.$focus=function(){if(this.selected){this.selected.className=this.skin.clsSelected;}};this.$blur=function(){if(this.selected){this.selected.className=this.skin.clsBlur;}};this.$focussable=true;this.getHTML=function(a){a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");a=a.replace(/(^|\n)[^\(]*\(/g,"\n(");return a;};this.loadText=function(d){var b=this.getHTML(d).split("\n");for(var c=0;c<b.length;c++){if(b[c].match(/error \E/)){var a="red";}else{if(b[c].match(/warning \P/)){var a="yellow";}else{var a="white";}}b[c]="<div style='color:"+a+"' onmousedown='apf.lookup("+this.$uniqueId+").select(this)' ondblclick=\"apf.lookup("+this.$uniqueId+").dispatchEvent('onchoose', this.innerHTML)\" class='"+this.skin.clsItem+"'>"+b[c]+"</div>";}this.$ext.innerHTML="<div style='color:white' class='"+this.skin.clsItem+"'>APF Packager</div><div nowrap style='color:white' class='"+this.skin.clsItem+"'>(c) 2001-2003 All Rights Reserved.</div><br>"+b.join("");};this.addEventListener("keydown",function(c){var a=c.keyCode;if(this.renaming){if(a==27||a==13){this.stopRename();if(a==13){this.stopRename();}}return;}if(!this.selected){return;}switch(a){case 13:this.dispatchEvent("choose");break;case 38:if(!this.value){return;}var b=this.value;if(b.previousSibling){b=b.previousSibling;}if(b&&b.nodeType==1){this.select(document.getElementById(b.getAttribute("id")));}return false;break;case 40:if(!this.value){return;}var b=this.value;if(b.nextSibling){b=b.nextSibling;}if(b&&b.nodeType==1){this.select(document.getElementById(b.getAttribute("id")));}return false;break;}},true);this.$draw=function(b,a){this.$ext=this.$getExternal();this.$int=this.$ext;};}).call(apf.lineselect.prototype=new apf.GuiElement());apf.aml.setElement("lineselect",apf.lineselect);apf.BindingEachRule=function(c,b){this.$init(b,apf.NODE_HIDDEN,c);var a=this;this.$noderegister=function(d){d.amlNode.$handleBindingRule(a.match,"each");d.amlNode.$sort=a.sort?new apf.Sort(a):null;};};(function(){this.$attrExcludePropBind=apf.extend({sort:1,"data-type":1,"date-format":1,"sort-method":1,order:1,"case-order":1},this.$attrExcludePropBind);this.$propHandlers.sort=this.$propHandlers["data-type"]=this.$propHandlers["date-format"]=this.$propHandlers.order=this.$propHandlers["case-order"]=function(b,c){delete this["c"+c];};this.addEventListener("prop.match",function(g){var d=this.parentNode;if(d.localName=="bindings"){var b=d.$amlNodes;for(var c=0;c<b.length;c++){b[c].$handleBindingRule(this.match,"each");}}else{d.$handleBindingRule(this.match,"each");}});var a;this.addEventListener("DOMNodeInserted",a=function(g){if(g.currentTarget!=this){return;}var d=this.parentNode;if(d.localName=="bindings"){d.addEventListener("noderegister",this.$noderegister);var b=d.$amlNodes;for(var c=0;c<b.length;c++){b[c].$handleBindingRule(this.match,"each");b[c].$sort=this.sort?new apf.Sort(this):null;}}else{d.$handleBindingRule(this.match,"each");d.$sort=this.sort?new apf.Sort(this):null;}});this.addEventListener("DOMNodeRemoved",function(g){if(g.currentTarget!=this){return;}var d=this.parentNode;if(d.localName=="bindings"){d.removeEventListener("noderegister",this.$noderegister);var b=d.$amlNodes;for(var c=0;c<b.length;c++){delete b[c].$sort;}}else{delete d.$sort;}});this.addEventListener("DOMNodeInsertedIntoDocument",a);}).call(apf.BindingEachRule.prototype=new apf.BindingRule());apf.aml.setElement("each",apf.BindingEachRule);apf.event=function(b,a){this.$init(a||"event",apf.NODE_HIDDEN,b);};(function(){this.$hasInitedWhen=false;this.$booleanProperties.repeat=true;this.$supportedProperties.push("when","message","icon","repeat");this.$propHandlers.when=function(b){if(this.$hasInitedWhen&&b&&this.parentNode&&this.parentNode.popup){var a=this;$setTimeout(function(){a.parentNode.popup(a.message,a.icon,a);});}this.$hasInitedWhen=true;if(this.repeat){delete this.when;}};this.$loadAml=function(a){};}).call(apf.event.prototype=new apf.AmlElement());apf.aml.setElement("event",apf.event);apf.BindingColumnRule=function(b,a){this.$init(a,apf.NODE_HIDDEN,b);this.$className="col"+this.$uniqueId;};(function(){this.$defaultwidth="100";this.$width=100;this.$sortable=true;this.$resizable=true;this.$movable=true;this.$cssInit=false;this.$attrExcludePropBind=apf.extend({css:1,icon:1,caption:1},this.$attrExcludePropBind);this.$supportedProperties.push("tree","icon","caption","width","options","editor","colspan","align","css");this.$booleanProperties.tree=true;this.$propHandlers.icon=function(a,b){};this.$propHandlers.caption=function(a,b){};this.$propHandlers.width=function(a,b){if(!a){a=this.$defaultwidth;}this.$isPercentage=a&&String(a).indexOf("%")>-1;this.$width=parseFloat(a);};this.$propHandlers.options=function(a,b){this.$sortable=a.indexOf("sort")>-1;this.$resizable=a.indexOf("size")>-1;this.$movable=a.indexOf("move")>-1;};this.$propHandlers.editor=function(a,b){};this.$propHandlers.colspan=function(a,b){};this.$propHandlers.align=function(a,b){};this.$propHandlers.css=function(a,b){};this.resize=function(b,w){var o;if(this.$isPercentage){var s=(this.$ext.offsetWidth-(w.$widthdiff-3)),r=b/s,q=[],j=[],t=0,c=this.$ext.nextSibling;while(c&&c.getAttribute("hid")){o=apf.all[c.getAttribute("hid")];if(o.$isPercentage){q.push(o);t+=o.$width;}else{j.push(o);}c=c.nextSibling;}if(j.length&&!q.length){return j[0].resize(j[0].$width+(s-b),w);}var g=r*this.$width,m=g-this.$width,l=(t-m)/t;if(l<0.01){if(b<20){return;}return this.resize(b-10,w);}for(var a,k=0;k<q.length;k++){a=q[k];a.$width*=l;apf.setStyleRule("."+a.$className,"width",a.$width+"%");}this.$width=g;apf.setStyleRule("."+this.$className,"width",this.$width+"%");}else{var u=b-this.$width;this.$width=b;if(apf.isIE&&w.oIframe){this.$ext.style.width=b+"px";}else{}apf.setStyleRule("."+this.$className,"width",b+"px",null,w.oWin);w.$fixed+=u;var d=(w.$fixed)+"px";if(!this.$isFixedGrid){apf.setStyleRule("."+w.$baseCSSname+" .row"+w.$uniqueId,"paddingRight",d,null,this.oWin);apf.setStyleRule("."+w.$baseCSSname+" .row"+w.$uniqueId,"marginRight","-"+d,null,w.oWin);w.$int.style.paddingRight=w.$head.style.paddingRight=d;}}};this.hide=function(){apf.setStyleRule("."+this.$baseCSSname+" .records ."+h.$className,"visibility","hidden",null,this.oWin);};this.show=function(){apf.setStyleRule("."+this.$baseCSSname+" .records ."+h.$className,"visibility","visible",null,this.oWin);};this.sort=function(a){if(a.$lastSorted==this){apf.setStyleClass(this.$int,a.toggleSortOrder()?"ascending":"descending",["descending","ascending"]);return;}var b;if(b=a.$lastSorted){apf.setStyleRule("."+b.$className,"background","white");apf.setStyleClass(b.$int,"",["descending","ascending"]);}apf.setStyleRule("."+this.$className,"background","#f3f3f3");apf.setStyleClass(this.$int,"ascending",["descending","ascending"]);if(!a.length){return;}a.resort({order:"ascending",xpath:this.cvalue2.xpaths[1]});a.$lastSorted=this;};this.move=function(c,g){if(c&&this==c){return;}var d=this,b=apf.getChildNumber(d.$int),i=c&&apf.getChildNumber(c.$int);g.$head.insertBefore(d.$int,c&&c.$int||null);if(!g.length){return;}(function a(j){for(var l,k=0;k<j.length;k++){l=j[k];if(g.$isTreeArch&&l.tagName=="BLOCKQUOTE"){a(l.childNodes);}else{l.insertBefore(l.childNodes[b],typeof i!="undefined"&&l.childNodes[i]||null);}}})(g.$int.childNodes);};this.$draw=function(g,c,j,i){var g=g||this.parentNode;while(g.$bindingRule){g=g.parentNode;}if(!g.hasFeature(apf.__PRESENTATION__)){return;}if(j){this.$propHandlers.width.call(this,j);}apf.importStylesheet([["."+this.$className,"width:"+this.$width+(this.$isPercentage?"%;":"px;")+"text-align:"+this.align]]);g.$getNewContext("headitem");var b=g.$getLayoutNode("headitem");b.setAttribute("class",this.$className+(i?" "+i:""));b.setAttribute("hid",this.$uniqueId);var d=g.$getLayoutNode("headitem","caption");d.nodeValue=this.caption||c||"";this.$ext=this.$int=apf.insertHtmlNode(b,g.$head||g.$int);var k=false;var a=this;this.$int.onmouseover=function(l){if(!l){l=event;}if(g.disabled){return;}apf.setStyleClass(this,"hover",["down"]);};this.$int.onmouseup=function(l){if(!l){l=event;}if(g.disabled||!apf.isChildOf(k,this,true)){return;}apf.setStyleClass(this,"hover",["down"]);if(a.$sortable){a.sort(g);}g.dispatchEvent("sortcolumn",a);};this.$int.onmousedown=function(o){if(!o){o=event;}k=target=this;if(g.disabled){return;}var s=apf.getAbsolutePosition(target),q=g.$head.scrollLeft;var r=o.clientX-s[0]+q;if(r<4||target.offsetWidth-r-8<3&&apf.getChildNumber(a.$int)<g.$headings.length-1){var z=r<4&&target.previousSibling||target;if(a.$resizable){s=apf.getAbsolutePosition(z);apf.setStyleClass(g.$pointer,"size_pointer",["move_pointer"]);g.$pointer.style.display="block";g.$pointer.style.left=(z.offsetLeft-q-1)+"px";g.$pointer.style.width=(z.offsetWidth-g.$widthdiff+1)+"px";apf.plane.show(g.$pointer,null,true);k=true;document.onmouseup=function(){if(!o){o=event;}document.onmouseup=document.onmousemove=null;apf.all[z.getAttribute("hid")].resize(g.$pointer.offsetWidth,g);k=false;g.$pointer.style.display="none";apf.plane.hide();};document.onmousemove=function(t){if(!t){t=event;}g.$pointer.style.width=Math.max(10,Math.min(g.$int.offsetWidth-g.$pointer.offsetLeft-20,t.clientX-s[0]-1+q))+"px";};return;}}apf.setStyleClass(target,"down",["hover"]);if(!a.$movable){document.onmouseup=function(t){document.onmouseup=null;k=false;};return;}apf.setStyleClass(g.$pointer,"move_pointer",["size_pointer"]);var w=o.clientX-target.offsetLeft,n=o.clientX,u=o.clientY-target.offsetTop,m=o.clientY,l;document.onmouseup=function(y){if(!y){y=event;}document.onmouseup=document.onmousemove=null;k=false;g.$pointer.style.display="none";if(!l){return;}l.style.top="-100px";var x=document.elementFromPoint(y.clientX,y.clientY);if(x.parentNode==l.parentNode){var A=apf.getAbsolutePosition(x);var t=(y.clientX-A[0]>x.offsetWidth/2?x.nextSibling:x);a.move(t?apf.all[t.getAttribute("hid")]:null,g);}apf.destroyHtmlNode(l);};document.onmousemove=function(y){if(!y){y=event;}if(!l){if(Math.abs(y.clientX-n)<3&&Math.abs(y.clientY-m)<3){return;}l=target.cloneNode(true);l.style.position="absolute";var x=apf.getWidthDiff(target);l.style.width=(target.offsetWidth-x-g.$widthdiff+2)+"px";l.style.left=target.offsetLeft;l.style.top=target.offsetTop;l.style.margin=0;l.removeAttribute("hid");apf.setStyleClass(l,"drag",["ascending","descending"]);target.parentNode.appendChild(l);}l.style.top="-100px";g.$pointer.style.display="none";var t=document.elementFromPoint(y.clientX,y.clientY);if(t.parentNode==l.parentNode){var A=apf.getAbsolutePosition(t);g.$pointer.style.left=(t.offsetLeft+((y.clientX-A[0]>t.offsetWidth/2)?t.offsetWidth-8:0))+"px";g.$pointer.style.display="block";}l.style.left=(y.clientX-w)+"px";l.style.top=(y.clientY-u)+"px";};};this.$int.onmouseout=function(l){if(!l){l=event;}if(g.disabled){return;}g.$ext.style.cursor="";apf.setStyleClass(this,"",["hover","down"]);};this.$int.onmousemove=function(n){if(k||g.disabled){return;}if(!n){n=event;}var q=apf.getAbsolutePosition(this),l=g.$head.scrollLeft;var o=n.clientX-q[0]+l;if(o<4||this.offsetWidth-o-g.$widthdiff<3&&apf.getChildNumber(a.$int)<g.$headings.length-1){var m=o<4?this.previousSibling:this;g.$ext.style.cursor=m&&a.$resizable?"w-resize":"default";}else{g.$ext.style.cursor="default";}};return this;};this.addEventListener("DOMNodeInsertedIntoDocument",function(a){this.$draw();});this.addEventListener("DOMNodeRemovedFromDocument",function(a){if(!this.$int){return;}this.$int.onmouseover=this.$int.onmouseup=this.$int.onmousedown=this.$int.onmousemove=this.$int.onmouseout=null;});}).call(apf.BindingColumnRule.prototype=new apf.BindingRule());apf.aml.setElement("column",apf.BindingColumnRule);apf.application=function(){this.$init("application",apf.NODE_HIDDEN);if(!apf.isO3){this.$int=document.body;this.$tabList=[];this.$focussable=apf.KEYBOARD;this.focussable=true;this.visible=true;this.$isWindowContainer=true;this.focus=function(){this.dispatchEvent("focus");};this.blur=function(){this.dispatchEvent("blur");};apf.window.$addFocus(this);}};apf.application.prototype=new apf.AmlElement();apf.aml.setElement("application",apf.application);apf.list=function(b,a){this.$init(a||"list",apf.NODE_VISIBLE,b);};apf.thumbnail=function(b,a){this.$init(a||"thumbnail",apf.NODE_VISIBLE,b);};apf.select=function(b,a){this.$init(a||"select",apf.NODE_VISIBLE,b);};apf.select1=function(b,a){this.$init(a||"selectl",apf.NODE_VISIBLE,b);};(function(){if(!apf.isIphone){this.implement(apf.Rename);}this.$getCaptionElement=function(){if(!(this.$caret||this.$selected)){return;}var c=this.$getLayoutNode("item","caption",this.$caret||this.$selected);if(!c){return;}return c.nodeType==1?c:c.parentNode;};this.addEventListener("afterselect",function(c){if(this.hasFeature(apf.__VALIDATION__)){this.validate(true);}});this.$supportedProperties.push("appearance","mode","more","thumbsize");this.$propHandlers.thumbsize=function(g){var d=this.thumbclass;if(apf.isIE){d=d.splitSafe(",");for(var c=0;c<d.length;c++){apf.setStyleRule(d[c],"width",g+"px");apf.setStyleRule(d[c],"height",g+"px");}return;}apf.setStyleRule(d,"width",g+"px");apf.setStyleRule(d,"height",g+"px");};this.$propHandlers.appearance=function(c){};this.mode="normal";this.$propHandlers.mode=function(c){this.mode=c||"normal";if("check|radio".indexOf(this.mode)>-1){this.allowdeselect=false;this.addEventListener("afterrename",a);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",a);}};function a(){}this.$propHandlers.more=function(c){if(c){this.delayedselect=false;this.addEventListener("xmlupdate",b);this.addEventListener("afterload",b);this.$setClearMessage=function(d){if(!this.moreItem){this.$fill();}this.$container.appendChild(this.moreItem);};this.$updateClearMessage=function(){};this.$removeClearMessage=function(){};}else{this.removeEventListener("xmlupdate",b);this.removeEventListener("afterload",b);}};function b(c){if((!c.action||"insert|add|synchronize|move".indexOf(c.action)>-1)&&this.moreItem){this.$container.appendChild(this.moreItem);}}this.addEventListener("keydown",this.$keyHandler,true);this.$draw=function(){this.appearance=this.getAttribute("appearance")||"compact";var d=this.getAttribute("mode");this.$ext=this.$getExternal();this.$container=this.$getLayoutNode("main","container",this.$ext);if(apf.hasCssUpdateScrollbarBug&&!this.mode){this.$fixScrollBug();}var c=this;this.$ext.onclick=function(g){c.dispatchEvent("click",{htmlEvent:g||event});};this.$ext.setAttribute("onmouseout",this.$ext.getAttribute("onmouseout")+";var o = apf.lookup("+this.$uniqueId+");o.$selectSeries(event);");this.listtype=parseInt(this.$getOption("main","type"))||1;this.behaviour=parseInt(this.$getOption("main","behaviour"))||1;this.thumbsize=this.$getOption("main","thumbsize");this.thumbclass=this.$getOption("main","thumbclass");};this.$selectSeries=function(d){d=d||event;var c=d.target||d.srcElement;if(d.type=="mouseover"){var c=(c.className||"").indexOf("item")!=-1?c:c.parentNode;this.highlight(c);}else{c=d.toElement?d.toElement:(d.relatedTarget?d.relatedTarget:null);if(!apf.isChildOf(this.$ext,c,true)){this.highlight(this.$selected);}}};this.highlight=function(k){var c=this.$ext.childNodes;var j=c.length;var g=false;for(var d=0;d<j;d++){if((c[d].className||"").indexOf("item")!=-1){if(!g){this.$setStyleClass(c[d],"selected");}else{this.$setStyleClass(c[d],"",["selected"]);}if(c[d]==k){g=true;}}}};this.$loadAml=function(c){};this.$destroy=function(){if(this.$ext){this.$ext.onclick=null;}apf.destroyHtmlNode(this.oDrag);this.oDrag=null;};}).call(apf.list.prototype=new apf.BaseList());apf.thumbnail.prototype=apf.select.prototype=apf.select1.prototype=apf.list.prototype;apf.aml.setElement("thumbnail",apf.thumbnail);apf.aml.setElement("select",apf.select);apf.aml.setElement("select1",apf.select1);apf.aml.setElement("list",apf.list);apf.table=function(b,a){this.$init(a||"table",apf.NODE_VISIBLE,b);};(function(){var a=apf.layout;this.$focussable=false;this.$update=false;this.columns="100,*";this.padding=2;this.margin="5 5 5 5";this.cellheight=19;this.$supportedProperties.push("columns","padding","margin","cellheight","span");this.$propHandlers.columns=this.$propHandlers.padding=this.$propHandlers.margin=this.$propHandlers.cellheight=function(d){if(!this.$update&&apf.loaded){a.queue(this.$ext,this.$updateObj);}this.$update=true;};function b(){var d=this.parentNode;if(!d.$update&&apf.loaded){a.queue(d.$ext,d.$updateObj);}d.$update=true;}this.register=function(d){d.$propHandlers.width=d.$propHandlers.height=d.$propHandlers.margin=d.$propHandlers.span=this.$updateObj.updateTrigger;d.addEventListener("prop.visible",b);a.queue(this.$ext,this.$updateObj);this.$update=true;};this.unregister=function(d){d.$propHandlers.width=d.$propHandlers.height=d.$propHandlers.margin=d.$propHandlers.span=null;d.removeEventListener("prop.visible",b);a.queue(this.$ext,this.$updateObj);this.$update=true;};this.addEventListener("DOMNodeRemoved",function(g){if(this.$isWaitingOnDisplay||!this.$updateObj){return;}if(g.currentTarget==this){var d=this;while(d){d.unwatch("visible",this.$updateObj.propChange);d=d.parentNode;}}else{if(g.relatedNode==this){this.unregister(g.currentTarget);g.currentTarget.$setLayout();}}});this.addEventListener("DOMNodeInserted",function(g){if(this.$isWaitingOnDisplay||g.currentTarget!=this){return;}if(g.currentTarget==this){var d=this;while(d){d.watch("visible",this.$updateObj.propChange);d=d.parentNode;}}else{if(g.relatedNode==this&&!g.$moveWithinParent){g.currentTarget.$setLayout("table");}}});function c(g,d){return typeof g=="string"?g.replace(apf.percentageMatch,"(("+d+" * $1)/100)"):g;}this.$isWaitingOnDisplay=false;this.$updateTable=function(){if(!this.$update){return;}if(!this.$ext.offsetWidth){this.$isWaitingOnDisplay=true;this.watch("visible",this.$updateObj.propChange);var H=this.parentNode;while(H){H.watch("visible",this.$updateObj.propChange);H=H.parentNode;}return;}this.cellheight=parseInt(this.cellheight);this.padding=parseInt(this.padding);var I;var K="pWidth",u="pHeight",B=c(this.columns,K).split(/\s*,\s*/),Q=B.length,F=apf.getBox(this.margin),q=[],r=[],S=this.childNodes,t,y,k,C,N,L,A,P,x;this.ids=[this.$ext];for(var J=[],R=0,O=0,M=S.length;O<M;O++){x=S[O];if(x.nodeType!=1&&x.nodeType!=7||x.nodeFunc==apf.NODE_HIDDEN||x.visible===false){continue;}if(x.hasFeature(apf.__ANCHORING__)){x.$disableAnchoring();}L=apf.getBox(String(x.margin));C=apf.getDiff(x.$ext);k=x.$ext;if(!k.getAttribute("id")){apf.setUniqueHtmlId(k);}if(apf.isIE){k.style.position="absolute";}P=x.span;A={span:P=="*"?Q-(R%Q):parseInt(P)||1,m:L,height:c(x.height,u),width:x.width,oHtml:k,hordiff:C[0],verdiff:C[1],id:(apf.hasHtmlIdsInJs?k.getAttribute("id"):"document.getElementById('"+k.getAttribute("id")+"')")};J.push(A);y=Math.floor(R/Q);R+=A.span;if(A.height=="*"||q[y]=="*"){q[y]="*";A.height=null;}else{if(A.height&&parseInt(A.height)!=A.height){q[y]=A.height;}else{if(typeof q[y]!="string"){q[y]=Math.max(q[y]||0,parseFloat(A.height||this.cellheight));}}}}var E=new Date().getTime();if(J.length==0){return;}var T,o,D=null,G=null;var w=["var ids = apf.all["+this.$uniqueId+"].ids","var total = 0, pHeight = ids[0].offsetHeight - "+((q.length-1)*this.padding+F[0]+F[2]),"var pWidth  = ids[0].offsetWidth - "+((Q-1)*this.padding+F[1]+F[3])];for(T=0,O=0;O<Q;O++){if(B[O]=="*"){D=O;}else{if(parseFloat(B[O])!=B[O]){w.push("var colw"+O+"; total += colw"+O+" = "+B[O]);B[O]="colw"+O;}else{T+=B[O]=parseFloat(B[O]);}}}if(D!==null){w.push("var colw"+D+" = "+K+" - total - "+T);B[D]="colw"+D;}var s=[F[3]];w.push("var coll0 = "+F[3]);for(O=1;O<Q;O++){if(typeof s[O-1]=="number"&&typeof B[O-1]=="number"){s[O]=s[O-1]+B[O-1]+this.padding;}else{w.push("var coll"+O+" = coll"+(O-1)+" + colw"+(O-1)+" + "+this.padding);s[O]="coll"+O;}}w.push("total = 0");var d=false;for(T=0,O=0;O<q.length;O++){if(q[O]=="*"){G=O;}else{if(parseFloat(q[O])!=q[O]){d=true;w.push("var rowh"+O+"; total += rowh"+O+" = "+q[O]);q[O]="rowh"+O;}else{T+=q[O]=parseFloat(q[O]);}}}if(G!==null){d=true;w.push("var rowh"+G+" = "+u+" - total - "+T);q[G]="rowh"+G;}if(!d&&!this.aData){this.$ext.style.height=(T+((q.length-1)*this.padding)+F[0]+F[2])+"px";}var n=[F[0]];w.push("var rowt0 = "+F[0]);for(O=1;O<q.length;O++){if(typeof n[O-1]=="number"&&typeof q[O-1]=="number"){n[O]=n[O-1]+q[O-1]+this.padding;}else{w.push("var rowt"+O+" = rowt"+(O-1)+" + rowh"+(O-1)+" + "+this.padding);n[O]="rowt"+O;}}for(R=0,O=0;O<J.length;O++){A=J[O];t=R%Q;y=Math.floor(R/Q);R+=A.span;I=A.id;if(typeof n[y]=="number"){A.oHtml.style.top=(n[y]+A.m[0])+"px";}else{w.push(I+".style.top    = rowt"+y+" + "+A.m[0]+" + 'px'");}if(typeof s[t]=="number"){A.oHtml.style.left=(s[t]+A.m[3])+"px";}else{w.push(I+".style.left   = coll"+t+" + "+A.m[3]+" + 'px'");}if(A.span&&A.span>1&&!A.width){var z=0;for(o=[],N=0;N<A.span;N++){if(typeof B[t+N]=="number"){z+=B[t+N];}else{o.push("colw"+(t+N));z-=1000000;}}var g=(A.span-1)*this.padding;if(z>0){A.oHtml.style.width=(z+g-(A.m[1]+A.m[3]+A.hordiff))+"px";}else{if(z>-1000000){o.push(z+1000000);}w.push(I+".style.width = ("+o.join(" + ")+" + "+g+" - "+(A.m[1]+A.m[3]+A.hordiff)+") + 'px'");}}else{if(parseFloat(A.width)==A.width||typeof B[t]=="number"){A.oHtml.style.width=((A.width||B[t])-(A.m[1]+A.m[3]+A.hordiff))+"px";}else{w.push(I+".style.width = ("+(A.width||"colw"+t)+" - "+(A.m[1]+A.m[3]+A.hordiff)+") + 'px'");}}if(parseFloat(A.height)==A.height||typeof q[y]=="number"){A.oHtml.style.height=((A.height||q[y]-(A.m[0]+A.m[2]))-A.verdiff)+"px";}else{w.push(I+".style.height = ("+(A.height||"rowh"+y)+" - "+(A.m[0]+A.m[2]+A.verdiff)+") + 'px'");}}apf.layout.setRules(this.$ext,"table",(w.length?"try{"+w.join(";}catch(e){};\ntry{")+";}catch(e){};":""),true);apf.layout.queue(this.$ext);this.$update=false;};this.$draw=function(){var d=this;this.$updateObj={$updateLayout:function(){d.$updateTable();},updateTrigger:function(g){if(!d.$update&&apf.loaded){a.queue(d.$ext,d.$updateObj);}d.$update=true;},propChange:function(i,g,j){if(d.$update&&apf.isTrue(j)&&d.$ext.offsetWidth){d.$updateTable();apf.layout.activateRules(d.$ext);var k=d;while(k){k.unwatch("visible",d.$updateObj.propChange);k=k.parentNode;}d.$isWaitingOnDisplay=false;}}};this.$ext=this.$pHtmlNode.appendChild(document.createElement("div"));this.$ext.className="table "+(this.getAttributeNode("class")||"");this.$int=this.$ext;this.$ext.host=this;if(!this.$ext.getAttribute("id")){apf.setUniqueHtmlId(this.$ext);}this.$htmlId=apf.hasHtmlIdsInJs?this.$ext.getAttribute("id"):"document.getElementById('"+this.$ext.getAttribute("id")+"')";this.$ext.style.position="relative";this.$ext.style.minHeight="10px";if(this.getAttribute("class")){apf.setStyleClass(this.$ext,this.getAttribute("class"));}if(!apf.isIE&&!apf.table.$initedcss){apf.importCssString(".table>*{position:absolute}");apf.table.$initedcss=true;}};this.$loadAml=function(d){if(!this.width&&(apf.getStyle(this.$ext,"position")=="absolute"||this.left||this.top||this.right||this.bottom||this.anchors)){this.$ext.style.width="100%";}};}).call(apf.table.prototype=new apf.GuiElement());apf.aml.setElement("table",apf.table);apf.style=function(b,a){this.$init(a||"style",apf.NODE_HIDDEN,b);};(function(){this.$focussable=false;this.addEventListener("DOMNodeInsertedIntoDocument",function(a){if(this.type!="text/chartcss"&&this.firstChild){apf.importCssString(this.firstChild.nodeValue);}});}).call(apf.style.prototype=new apf.AmlElement());apf.aml.setElement("style",apf.style);apf.xhtml.setElement("style",apf.style);apf.modalwindow.widget=function(){var j,i,b,g,c;var a=this;this.$isWindowContainer=false;this.kbclose=false;this.$isWidget=true;this.dragStart=function(n){if(!n){n=event;}if(a.state.indexOf("maximized")>-1||!a.draggable){return;}j=a.$ext.offsetLeft-n.clientX-document.documentElement.scrollLeft;i=a.$ext.offsetTop-n.clientY-document.documentElement.scrollTop;var l=a.$ext;var m=a.positionHolder;if(!m){var m=this.positionHolder=document.body.appendChild(document.createElement("div"));}m.className="position_holder";l.parentNode.insertBefore(m,l);m.style.height=(l.offsetHeight-(apf.isIE6?0:apf.getHeightDiff(m)))+"px";var k=[l.style.width,l.style.height];l.style.width=(l.offsetWidth-apf.getWidthDiff(l))+"px";l.style.left=(n.clientX+j)+"px";l.style.top=(n.clientY+i)+"px";l.style.position="absolute";l.style.zIndex=l.parentNode.style.zIndex=100000;l.parentNode.style.left="0";l.parentNode.style.minHeight=(l.parentNode.offsetHeight-apf.getHeightDiff(l.parentNode))+"px";if(apf.isIE<8){apf.setStyleClass(l,"dockletDrag");}if(!apf.hasStyleFilters){apf.tween.fade(l,0.8);}apf.dragMode=true;c=[l,m];document.onmousemove=a.dragMove;document.onmouseup=function(){document.onmousemove=document.onmouseup=null;l.style.position="";l.style.left=0;l.style.top=0;l.style.width=k[0];l.style.zIndex=l.parentNode.style.zIndex=1;l.parentNode.style.minHeight="";m.parentNode.insertBefore(l,m);m.parentNode.removeChild(m);apf.tween.fade(l,1);if(apf.isIE<8){apf.setStyleClass(l,"",["dockletDrag"]);}a.parentNode.$moveDocklet(a);if(!apf.supportOpacity||l.className.indexOf("dockblank")>-1){l.style.filter="";}if(a.$ext){apf.layout.forceResize(a.$ext);}apf.dragMode=false;};if(apf.isIE){document.onmousemove();}n.cancelBubble=true;return false;};function d(n,t){var u=apf.getAbsolutePosition(n);var q=t-u[1];var k=n.childNodes;for(var m=0,s=0,r=k.length;s<r;s++){var o=k[s];if(o.nodeType!=1||apf.getStyle(o,"position")=="absolute"){continue;}m=o.offsetTop+o.offsetHeight;if(m>q){n.insertBefore(c[1],m-(o.offsetHeight/2)>q?o:o.nextSibling);break;}}if(s==k.length){n.appendChild(c[1]);}}this.dragMove=function(n){if(!n){n=event;}a.$ext.style.top="10000px";var l=n.clientX;var k=n.clientY;var m=document.elementFromPoint(l,k);if(m){if(m.isColumn){d(m,k);}else{while(m.parentNode&&!m.isColumn){m=m.parentNode;}if(m.isColumn){d(m,k);}}}a.$ext.style.left=(n.clientX+j+document.documentElement.scrollLeft)+"px";a.$ext.style.top=(n.clientY+i+document.documentElement.scrollTop)+"px";n.cancelBubble=true;};this.$loadAml=function(k){this.$create();};this.$create=function(){apf.WinServer.setTop(this);var k=apf.getDiff(this.$ext);g=k[0];b=k[1];this.oDrag.onmousedown=this.dragStart;this.collapsedHeight=this.$getOption("Main","collapsed-height");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");};};apf.cgi=function(){this.supportMulticall=false;this.namedArguments=true;this.unserialize=function(a){return a;};this.getSingleCall=function(b,a,c){c.push(a);};this.createMessage=function(d,a){var j,g=[];function c(l,i){if(l&&l.dataType==apf.ARRAY){for(var k=0;k<l.length;k++){c(l[k],i+"%5B"+k+"%5D");}}else{if(typeof l=="object"){for(j in l){if(typeof l[j]=="function"){continue;}c(l[j],i+"%5B"+encodeURIComponent(j)+"%5D");}}else{if(typeof l!="undefined"&&l!==null){g.push(i+"="+encodeURIComponent(l));}}}}if(this.multicall){g.push("func="+this.mcallname);for(var b=0;b<a[0].length;b++){c(a[0][b],"f%5B"+b+"%5D");}}else{for(j in a){c(a[j],j);}}if(!this.baseUrl){this.baseUrl=this.url;}this.url=this.$methods[d].url?this.$methods[d].url:this.baseUrl;if(this.method!="GET"){return g.join("&");}this.url=this.url+(g.length?(this.url.indexOf("?")>-1?"&":"?")+g.join("&"):"");return"";};this.addEventListener("DOMNodeInsertedIntoDocument",function(){this.method=(this["http-method"]||"GET").toUpperCase();this.contentType=this.method=="GET"?null:"application/x-www-form-urlencoded";});this.submitForm=function(g,m){if(!this["postform"]){this.addMethod("postform",m);}var c=[];for(var d=0,a=g.elements.length;d<a;d++){if(!g.elements[d].name){continue;}if(g.elements[d].tagname=="input"&&(g.elements[d].type=="checkbox"||g.elements[d].type=="radio")&&!g.elements[d].checked){continue;}if(g.elements[d].tagname="select"&&g.elements[d].multiple){for(var b=0;b<g.elements[d].options.length;b++){if(g.elements[d].options[b].selected){c.push(g.elements[d].name+"="+encodeURIComponent(g.elements[d].options[b].value));}}}else{c.push(g.elements[d].name+"="+encodeURIComponent(g.elements[d].value));}}var k=(g.action||location.href);this.urls.postform=k+(k.indexOf("?")>-1?"&":"?")+c.join("&");this["postform"].call(this);return false;};};apf.textbox.autocomplete=function(){var a={};this.initAutocomplete=function(b){b.parentNode.removeChild(b);a.nodeset=b.getAttribute("nodeset").split(":");a.method=b.getAttribute("method");a.value=b.getAttribute("value");a.count=parseInt(b.getAttribute("count"))||5;a.sort=b.getAttribute("sort");a.lastStart=-1;this.oContainer=apf.insertHtmlNode(this.$getLayoutNode("container"),this.$ext.parentNode,this.$ext.nextSibling);};this.fillAutocomplete=function(o){if(o){switch(o){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 m=a.suggestData[a.lastStart++];this.$int.value=m;this.change(m);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 m=a.suggestData[a.lastStart--];this.$int.value=m;this.change(m);this.oContainer.style.display="none";return;}break;}if(o>10&&o<20){return;}}if(a.method){var c=0,n=self[a.method]();a.count=n.length;}else{if(this.$int.value.length==0){this.oContainer.style.display="none";return;}if(!a.suggestData){var b=self[a.nodeset[0]].data.selectNodes(a.nodeset[1]);for(var m,n=[],g=0;g<b.length;g++){m=apf.queryValue(b[g],a.value);if(m){n.push(m.toLowerCase());}}if(a.sort){n.sort();}a.suggestData=n;}else{n=a.suggestData;}var m=this.$int.value.toUpperCase();for(var c=n.length-a.count,g=0;g<n.length;g++){if(m<=n[g].toUpperCase()){c=g;break;}}a.lastStart=c;}this.oContainer.innerHTML="";this.oContainer.style.left=this.$int.offsetLeft+"px";this.oContainer.style.top=this.$int.offsetTop+"px";for(var k=[],d=c;d<Math.min(c+a.count,n.length);d++){this.$getNewContext("item");var l=this.$getLayoutNode("item");apf.setNodeValue(this.$getLayoutNode("item","caption"),n[d]);l.setAttribute("onmouseover",'this.className = "hover"');l.setAttribute("onmouseout",'this.className = ""');l.setAttribute("onmousedown","event.cancelBubble = true");l.setAttribute("onclick","var o = apf.lookup("+this.$uniqueId+");                o.$int.value = this.innerHTML;                o.change(this.innerHTML);                o.$int.select();                o.$int.focus();                o.oContainer.style.display = 'none';");k.push(this.$getLayoutNode("item"));}apf.insertHtmlNode(k,this.oContainer);this.oContainer.style.display="block";};this.setAutocomplete=function(b,d,c){a.lastStart=-1;a.suggestData=null;a.nodeset=[b,d];a.value=c;this.oContainer.style.display="none";};};apf.textbox.masking=function(){var i=9128748732;var u={"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 o=-1;var b=false;var c=this.$ext;var m,n=[],a,s,t,g;this.setPosition=function(w){r(w||o||0);};this.addEventListener("$clear",function(){this.value="";if(this.mask){return this.setValue("");}});this.$propHandlers.value=function(y){var x="";if(this.includeNonTypedChars){for(var w=0;w<m.length;w++){if(m.substr(w,1)!=y.substr(w,1)){x+=y.substr(w,1);}}}this.$insertData(x||y);};var d={"96":"0","97":"1","98":"2","99":"3","100":"4","101":"5","102":"6","103":"7","104":"8","105":"9","106":"*","107":"+","109":"-","110":".","110":"/"};this.addEventListener("keydown",function(A){var x=A.keyCode,w=false;switch(x){case 39:r(o+1);w=true;break;case 37:r(o-1);w=true;break;case 35:case 34:r(a.length);w=true;break;case 33:case 36:r(0);w=true;break;case 8:l(o-1);r(o-1);w=true;break;case 46:l(o);r(o);w=true;break;default:if(x==67&&A.ctrlKey){window.clipboardData.setData("Text",this.getValue());w=true;}break;}var y=d[x]||String.fromCharCode(x);if(q(y)){r(o+1);}var z,B=o;if(this.realtime&&(z=this.getValue())!=this.value){this.change(z);r(B);}if(apf.isCharacter(A.keyCode)||w){return false;}},true);this.$initMasking=function(){this.$keyHandler=null;b=true;this.$int[apf.isIphone?"onclick":"onmouseup"]=function(w){var x=Math.min(k(),a.length);r(x);return false;};this.$int.onpaste=function(w){w=w||window.event;w.returnValue=false;this.host.setValue(window.clipboardData.getData("Text")||"");$setTimeout(function(){r(o);},1);};this.getValue=function(){if(this.includeNonTypedChars){return m==this.$int.value?"":this.$int.value.replace(new RegExp(g,"g"),"");}else{return a.join("");}};this.setValue=function(y){if(this.includeNonTypedChars){for(var x="",w=0;w<m.length;w++){if(m.substr(w,1)!=y.substr(w,1)){x+=y.substr(w,1);}}}this.$insertData(x);};};this.setMask=function(z){if(!b){this.$initMasking();}z=z.split(";");g=z.pop();this.includeNonTypedChars=parseInt(z.pop())!==0;var F=z.join("");var A="",w="",y="-",E=false,x=false,B;n=[],s="",t="";for(var D=-1,C=0;C<F.length;C++){B=F.substr(C,1);if(!B.match(/[\!\'\"\>\<\\]/)){D++;}else{if(B=="!"){x=true;}else{if(B=="<"||B==">"){y=B;}else{if(B=="'"||B=='"'){E=!E;}}}continue;}if(!E&&u[B]){n.push(D);w+=g;s+=B;t+=y;A+=u[B];}else{w+=B;}}this.$int.value=w;m=w;a=[];g=g;};function j(w,y){var x=s.substr(y,1);var z=t.substr(y,1);if(w.match(new RegExp(u[x]))==null){return i;}if(z==">"){return w.toUpperCase();}if(z=="<"){return w.toLowerCase();}return w;}function r(x){if(x<0){x=0;}if(apf.hasMsRangeObject){var w=c.createTextRange();w.expand("textedit");w.select();if(n[x]==null){w.collapse(false);w.select();o=n.length;return false;}w.collapse();w.moveStart("character",n[x]);w.moveEnd("character",1);w.select();}else{if(typeof n[x]=="undefined"){c.selectionStart=c.selectionEnd=n[n.length-1]+1;o=n.length;return false;}c.selectionStart=n[x];c.selectionEnd=n[x]+1;}o=x;}function q(y){if(n[o]==null){return false;}y=j(y,o);if(y==i){return false;}if(apf.hasMsRangeObject){var x=c.createTextRange();x.expand("textedit");x.collapse();x.moveStart("character",n[o]);x.moveEnd("character",1);x.text=y;if(apf.document.activeElement==this){x.select();}}else{var z=c.value,A=c.selectionStart,w=c.selectionEnd;c.value=z.substr(0,A)+y+z.substr(w);c.selectionStart=A;c.selectionEnd=w;}a[o]=y;return true;}function l(y){if(n[y]==null){return false;}if(apf.hasMsRangeObject){var x=c.createTextRange();x.expand("textedit");x.collapse();x.moveStart("character",n[y]);x.moveEnd("character",1);x.text=g;x.select();}else{var z=c.value,A=n[y],w=n[y]+1;c.value=z.substr(0,A)+g+z.substr(w);c.selectionStart=A;c.selectionEnd=w;}a[y]=" ";}this.$insertData=function(B){if(B==this.getValue()){return;}var y,w;try{if(!apf.hasMsRangeObject&&c.selectionStart==c.selectionEnd){r(0);}}catch(x){if(!B){return;}var z,A;for(y=0,w=B.length;y<w;y++){o=y;if(n[o]==null){continue;}z=j(B.substr(y,1),y);if(z==i){continue;}A=c.value;c.value=A.substr(0,n[y])+z+A.substr(n[y]+1);}if(B.length){o++;}return;}B=this.dispatchEvent("insert",{data:B})||B;if(!B){if(!this.getValue()){return;}for(y=this.getValue().length-1;y>=0;y--){l(y);}r(0);return;}for(y=0,w=B.length;y<w;y++){o=y;q(B.substr(y,1));if(!apf.hasMsRangeObject){r(y+1);}}if(B.length){o++;}};function k(){var y,w=0;if(!apf.hasMsRangeObject){w=c.selectionStart;}else{y=document.selection.createRange();var x=y.duplicate();x.expand("textedit");x.setEndPoint("EndToStart",y);w=x.text.length;}for(var z=0;z<n.length;z++){if(n[z]>w){return(z==0)?0:z-1;}}return a.length;}};apf.LiveTextPi=function(){this.$init();};(function(){this.mainBind="data";this.implement(apf.StandardBinding);this.$propHandlers.calcdata=function(a){this.$ext.innerHTML=a&&apf.htmlentities(a)||"";};}).call(apf.LiveTextPi.prototype=new apf.AmlProcessingInstruction(true));apf.aml.setProcessingInstruction("lt",apf.LiveTextPi);apf.aml.setProcessingInstruction("livetext",apf.LiveTextPi);apf.LiveMarkupPi=function(){this.$init();};(function(){this.mainBind="data";this.implement(apf.StandardBinding);this.getDocument=function(){return this.$data&&this.$data.ownerDocument;};this.clear=function(b){var d;if(b=="loading"&&(d=apf.getInheritedAttribute(this,"loading-message"))){var c=this.$ext.offsetHeight;this.$propHandlers.calcdata.call(this,"<span class='loading'>"+d+"</span>");this.calcdata="";var a=apf.getStyle(this.$ext,"height");this.$tempSetHeight=c&&(!a||a=="auto")&&b!="empty";if(this.$tempSetHeight){this.$ext.style.display="block";this.$ext.style.height=(Math.max(10,(c-apf.getHeightDiff(this.$ext)))+"px");}}};this.$propHandlers.calcdata=function(c){if(this.$data){var a=this.$data.childNodes;for(var b=a.length-1;b>=0;b--){a[b].destroy(true);}}if(c&&c.indexOf("<a:")>-1){this.$ext.innerHTML="";this.$data=this.ownerDocument.$domParser.parseFromString("<a:application xmlns:a='"+apf.ns.apf+"'>"+c+"</a:application>","text/xml",{htmlNode:this.$ext}).documentElement;}else{if(this.$data){var a=this.$data.childNodes;for(var b=0;b<a.length;b++){a[b].destroy(true);}}this.$ext.innerHTML=c||"";}if(this.$tempSetHeight){this.$ext.style.height="";this.$ext.style.display="";}};}).call(apf.LiveMarkupPi.prototype=new apf.AmlProcessingInstruction(true));apf.aml.setProcessingInstruction("lm",apf.LiveMarkupPi);apf.aml.setProcessingInstruction("livemarkup",apf.LiveMarkupPi);if(document.all){var oldWinError=window.onerror;window.onerror=function(a){apf.console.error("Error caught from early startup. Might be a html parser syntax error (not your fault). "+a);if(!arguments.caller){return true;}};}apf.Init.addConditional(function(){if(document.all){window.onerror=oldWinError;}apf.dispatchEvent("domready");},null,["body","class"]);apf.addDomLoadEvent(function(){apf.Init.run("body");});apf.start();var nbdApp=new apf.Class().$init();(function(o){if(document.location.host&&document.location.host!="file://"){window.onerror=function(){return true;};}var z=1,f="frame.html",i=false,v=false,g=null,u=[],p=[],b={},m={short_description:"Omschrijving",characteristics:"Kenmerken",composition:"Samenstelling",shape:"Vorm en afmeting",performance:"Prestaties",application:"Toepassing",assembly:"Verwerking en montage",maintenance:"Onderhoud",quality:"Kwaliteit en garantie",economic_factor:"Economische factoren",environment:"Milieu en gezondheid",reference:"Referenties",aspect:"Overige aspecten",transaction:"Contact gegevens",company:"Bedrijf",delivery_program:"Leveringsprogramma",delivery_payment:"Levering en betaling",guarantee:"Garantie",products:"Producten",suppliers:"Leveranciers",news:"Productnieuws",attachments:"Bestekken en CAD",bestekcad:"Bestekken en CAD",sfb_code:"Sfb-code",stabu_code:"Stabu-code",nbd_number:"NBD nummer"},k={artikelbeheer:"Artikelbeheer",bestekservice:"Bestekservice",bestekteksten:"Bestekteksten",cad:"CAD","cad-services":"Cad-services","cad-service":"Cad-services",extrainfo:"ExtraInfo",extrainformatie:"ExtraInformatie",ifps:"IFPS",productbrochure:"ProductBrochure",productfilm:"Productfilm",uitvoeringsvoorschriften:"Uitvoeringsvoorschriften"},d=false,j=true;o.counters={};o.expanded=[];o.descNames={short_description:"Omschrijving",characteristics:"Kenmerken",composition:"Samenstelling",shape:"Vorm en afmeting",performance:"Prestaties",application:"Toepassing",assembly:"Verwerking en montage",maintenance:"Onderhoud",quality:"Kwaliteit en garantie",economic_factor:"Economische factoren",environment:"Milieu en gezondheid",reference:"Referenties",aspect:"Overige aspecten",transaction:"Contact gegevens",company:"Bedrijf",delivery_program:"Leveringsprogramma",delivery_payment:"Levering en betaling",guarantee:"Garantie",bestekteksten:"Bestekteksten",bestekservice:"Bestekservice",cad:"CAD-service",ifps:"iFPS: interactieve Fabrikantgebonden Product Specificatie"};o.documentatieTypes=["artikelbeheer","attesten","productbrochure","cad","cad-services","fps","ifps","bestekservice","bestekteksten","extrainfo","extrainformatie","technische handleidingen","uitvoeringsvoorschriften","white papers"];o.searchMap={products:["keyword","product"],suppliers:["keyword","supplier"],news:["keyword","news"],bestekcad:["keyword","supplier_attachment"],sfb_code:["sfb_code","product"],stabu_code:["stabu_code","product"],nbd_number:["nbd_number","product"],whitepapers:["keyword","whitepaper"]};o.fileTypes={pdf:"pdf",html:"html",excel:"xsl",word:"doc",zip:"zip",video:"video"};var s=[],n,c,e,h,q;o.homeCollapse=function(A,B){if(!c||!h||!q){c=document.getElementById("homeTreeCont");e=document.getElementById("closeOverlay");h=document.getElementById("closeOverlayButton");q=document.getElementById("homeTreeRight");}clearTimeout(n);n=setTimeout(function(){var D=(treeHomeCats1.$ext.offsetWidth+treeHomeCats2.$ext.offsetWidth+treeHomeCats3.$ext.offsetWidth+70),C=Math.max(treeHomeCats1.$ext.offsetHeight,Math.max(treeHomeCats2.$ext.offsetHeight,treeHomeCats3.$ext.offsetHeight)),E=treeHomeCats1.$ext.parentNode.parentNode;if(apf.isIE){D+=45;}if(apf.isIE<=7){D+=80;}E.style.width=D+"px";E.parentNode.style.width=(D+16)+"px";e.style.width=(D-(apf.isIE?74:72))+"px";q.style.height=(C+12)+"px";clearTimeout(n);},200);if(!arguments.length){s=[];treeHomeCats1.collapseAll();treeHomeCats2.collapseAll();treeHomeCats3.collapseAll();apf.setStyleClass(c,null,["ovbg"]);e.style.visibility=h.style.visibility=q.style.visibility="hidden";return;}if(A==-1){s.remove(B.xmlNode);}else{s.pushUnique(B.xmlNode);}if(s.length>0){o.homeTreeInited=true;apf.setStyleClass(c,"ovbg");e.style.visibility=h.style.visibility=q.style.visibility="visible";}else{apf.setStyleClass(c,null,["ovbg"]);e.style.visibility=h.style.visibility=q.style.visibility="hidden";}};var w=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");apf.require(w+"google-analytics.com/ga.js");var r=setInterval(function(){if(!self._gat){return;}clearTimeout(r);pageTracker=_gat._getTracker("UA-4142829-4");pageTrackerOpt=_gat._getTracker("UA-10379645-1");pageTracker._initData();pageTrackerOpt._initData();var C=document.referrer;if(C.indexOf("images.google")!=-1&&C.indexOf("prev")!=-1){var B=C.match(/images\.google\.([^\/]+).*&prev=([^&]+)/),A="http://images.google."+B[1]+unescape(B[2]);pageTracker._setReferrerOverride(A);pageTrackerOpt._setReferrerOverride(A);}},100);o.track=function(B,D,I,G,C,H,E){if(true){return;}var A=sitestat_server+B;var F=mdlPersonalData.getByXPath("//Username/text()");if(!isNot(F)&&(""+F).length>0){A+="&account="+F;}else{A+="&account=bezoeker";}if(!isNot(D)){A+="&"+D+"="+((isNot(I)||(""+I).length==0)?"onbekend":escape((""+I).replace(/ /g,"_")));}if(!isNot(G)){A+="&"+G+"="+((isNot(C)||(""+C).length==0)?"onbekend":escape((""+C).replace(/ /g,"_")));}if(!isNot(H)){A+="&"+H+"="+((isNot(E)||(""+E).length==0)?"onbekend":escape((""+E).replace(/ /g,"_")));}};apf.extend(o.track,{textBanner:function(A){document.getElementById("trackBanner").src="/search/click-textbanner.php?id="+A+"&rnd="+Math.random();},hrefs:function(A){new apf.http().get("/search/click-link.php?link="+A);},attachment:function(B,A){new apf.http().get("/search/click-attachment.php?id="+B+"&item="+A);},sponsoredlinks:function(B,A){new apf.http().get("/search/click-sponsoredlinks.php?id="+B+(!A?"":"&item="+A));},lead_news:function(A){new apf.http().get("/mijn-nbd/lead_news.php?id="+A);},banner:function(A){}});o.doCount=function(A){if(v!==false){g=txtSearch.getValue();return;}if(!A){A=txtSearch.getValue();}if(A.length<1){for(var B in o.counters){o.counters[B].innerHTML="";}return;}A=A.replace("__","-");comm.count.userdata=A;v=comm.count(decodeURIComponent(A),this.searchMap[ddSearch.value||"products"][0],this.searchMap[ddSearch.value||"products"][1]);};var y=null;o.processCount=function(H,C,E){if(C!=apf.SUCCESS){if(E.retries<apf.maxHttpRetries){return E.tpModule.retry(E.id);}else{if(apf.debug&&confirm("Communication Error, Would you like to debug?")){return;}else{return;}}}clearTimeout(y);H=apf.getXml(H);var D,F,J,G,M,I=document.body,N=apf.queryValue(H,"products/@count"),L=apf.queryValue(H,"suppliers/@count"),B=apf.queryValue(H,"news/@count"),K=apf.queryValue(H,"whitepapers/@count"),A=ddSearch.value,O;if(A=="suppliers"||A=="bestekcad"){O=(apf.queryValue(H,"suppliers/@to_many")?"&gt;5000 leveranciers":L+(L==1?" leverancier":" leveranciers"))+" gevonden";}else{if(A=="news"){O=(apf.queryValue(H,"news/@to_many")?"&gt;5000 nieuws items":B+(B==1?" nieuws item":" nieuws items"))+" gevonden";}else{if(A=="whitepapers"){O=apf.queryValue(H,"whitepapers/@to_many")?"&gt;5000 whitepapers items":K+(K==1?" whitepapers item":" whitepapers items");}else{O=(apf.queryValue(H,"products/@to_many")?"&gt;5000 producten":N+(N==1?" product":" producten"))+" gevonden";}}}for(D in o.counters){F=o.counters[D];clearTimeout(F.timer);if(F.parentNode!=I){I.appendChild(F);}F.innerHTML=O;J=self[F.getAttribute("rel")].$ext,M=apf.getAbsolutePosition(J,F);if(M[1]<100){continue;}F.style.display="block";G=apf.getOpacity(F);F.style.top=(M[1]+28)+"px";F.style.left=(M[0]+20)+"px";if(G!=1){if(!apf.supportOpacity&&apf.hasStyleFilters){F.style.display="block";}else{apf.tween.single(F,{type:"opacity",from:0,to:1,steps:20,anim:apf.tween.easeInQuad});}}}y=$setTimeout(o.hideCounters,2000);b[E.userdata]=[N,L,B];v=false;if(g){o.doCount(g);g=null;}};o.deleteCounters=function(){for(var B in o.counters){if(B!="counter1"){var A=document.getElementById("searchtime"+B.split("counter")[1]);if(A){A.style.display="none";}delete o.counters[B];}}};o.hideCounters=function(A){clearTimeout(y);var C,B;for(C in o.counters){B=o.counters[C];if(A){if(!apf.supportOpacity&&apf.hasStyleFilters){}else{B.style.opacity=0;}B.style.display="none";}else{if(!apf.supportOpacity&&apf.hasStyleFilters){B.style.display="none";}else{apf.tween.single(B,{type:"opacity",from:1,to:0,steps:20,anim:apf.tween.easeOutQuad,onfinish:function(D){D.style.display="none";}});}}}};o.countCatsFrontPage=function(){var A,B=mdlRootCategories.queryNodes("category"),E=0,C=0,F=ddSearch.getValue();if(B&&(A=B.length)){for(var D=0;D<A;D++){var G=B[D];if(!F||!G.getAttribute(F)){F="products";}if(G.getAttribute("profile")=="installatie"){C+=parseInt(G.selectSingleNode(F).getAttribute("count"));}else{E+=parseInt(G.selectSingleNode(F).getAttribute("count"));}}document.getElementById("bouwCount").getElementsByTagName("span")[0].innerHTML="("+(E+"").replace(/(\d+)(\d\d\d)/,"$1.$2")+")";document.getElementById("instalCount").getElementsByTagName("span")[0].innerHTML="("+(C+"").replace(/(\d+)(\d\d\d)/,"$1.$2")+")";}};o.doSearch=function(E,D,C){o.hideCounters(true);E=o.util.cleanSearchParam(E||txtSearch.getValue());var B=o.nav.divideChar,A=o.nav.levelTwoChar;apf.history.setHash("search"+B+E+A+(D||"1")+A+"1"+A+ddSearch.value+(C?A+apf.getCgiString(C).replace(/attachment-type/g,"attachment__type"):"")+B+"0");};o.myNBD={processLogin:function(C,B,A){if(A.http.status==401){return o.util.showAlert("De server heeft uw login gegevens niet geaccepteerd. Probeert u het nog eens","Mijn NBD");}else{if(B!=apf.SUCCESS){if(A.retries<apf.maxHttpRetries){return A.tpModule.retry(A.id);}else{if(apf.debug&&confirm("Communication Error, Would you like to debug?")){return;}else{return;}}}else{i=true;winLogin.hide();txtUsername.clear();txtPassword.clear();comm.getProperties();comm.getFavorites();}}},logout:function(){comm.logout();if(self.txtUsername){txtUsername.clear();txtPassword.clear();}i=false;mdlFavorites.clear();mdlPersonalData.load("<empty/>");},processFavorites:function(D,F,A){if(A.http.status==401){return;}if(A.retries<apf.maxHttpRetries){return A.tpModule.retry(A.id);}else{if(apf.debug&&confirm("Communication Error, Would you like to debug?")){return;}else{if(!apf.debug){o.util.showAlert("Er heeft zich een fout voorgedaan. Probeert u het a.u.b. opnieuw.");}return;}}lFavProds.onafterload=function(){this.selectAll();};mdlFavorites.load(D);if(mdlFavorites.queryNode("product")){lFavProds.show();tabMijnNBD.show();tabMijnNBD.set(0);var C=mdlFavorites.queryNode("product"),E=0,B=C.length;for(;E<B;++E){ProductCache[C[E].getAttribute("id")]=C[E];}}else{if(mdlFavorites.queryNode("supplier")){tabMijnNBD.show();tabMijnNBD.set(1);}}},addToFavorites:function(B){if(!B||mdlFavorites.data.selectSingleNode(B.tagName+"[@id='"+B.getAttribute("id")+"']")){return;}var A=apf.xmldb.copyNode(B);apf.xmldb.appendChild(mdlFavorites.data,A);if(B.tagName=="product"){if(i){comm.addFavorite(A.getAttribute("id"));}lFavProds.select(A);cacheProduct(B.getAttribute("id"));lFavProds.show();tabMijnNBD.show();tabMijnNBD.set(0);}else{if(i){comm.addFavorite(null,A.getAttribute("id"));}tabMijnNBD.show();tabMijnNBD.set(1);}},removeFavorite:function(B){var A=B.style?apf.xmldb.findXmlNode(B):B;lFavProds.remove(A);if(i){if(A.tagName=="product"){comm.removeFavorite(A.getAttribute("id"));}else{comm.removeFavorite(null,A.getAttribute("id"));}}if(!lFavProds.getTraverseNodes().length){lFavProds.hide();if(!mdlFavorites.data.childNodes.length){tabMijnNBD.hide();}else{tabMijnNBD.set(1);}}},clearFavorites:function(){mdlFavorites.reset();}};apf.addEventListener("beforeprint",function(){document.getElementById("topbanner").style.display="none";});apf.addEventListener("afterprint",function(){document.getElementById("topbanner").style.display="block";});o.banners={sets:{top:{url:"/banners/top.html",width:"468",height:"60",single:true},square:{url:"/banners/square.html",width:"336",height:"280",single:false,nodeCache:{}},square_re:{url:"/banners/square_re.html",width:"336",height:"280",single:false,nodeCache:{}},search:{url:"/banners/search.html",width:"120",height:"600",single:true},enquete:{url:"/banners/enquete.html",width:"340",height:"260",single:true}},load:function(E,B,C){if(!E){return;}E=E.toLowerCase();var A=this.sets[E];if(!A||(!B&&!A.single)){return;}var F=A.single?(A.node||(A.node=document.getElementById(E+"banner"))):(A.nodeCache[B]||(A.nodeCache[B]=document.getElementById(B)));if(!F){return;}var D=F.getElementsByTagName("iframe")[0];if(E.indexOf("search")>-1&&!C){C=txtSearch?txtSearch.getValue():"";}if(!D){D=this.createIframe(A,F,C);}else{if(apf.supportHashChange){D.removeNode();D=this.createIframe(A,F,C);}else{D.setAttribute("src",apf.getNoCacheUrl(A.url+(C?"?q="+C:"")));}}},createIframe:function(B,D,A){var C=document.createElement("iframe");C.className="banner_iframe";C.setAttribute("frameborder","0");C.setAttribute("border","0");C.setAttribute("width",B.width);C.setAttribute("height",B.height);C.setAttribute("marginwidth","0");C.setAttribute("marginheight","0");C.setAttribute("scrolling","no");C.setAttribute("style","border:0;margin:0;padding:0;width:"+B.width+"px;height:"+B.height+"px");C.frameBorder=0;D.appendChild(C);C.setAttribute("src",apf.getNoCacheUrl(B.url+(A?"?q="+A:"")));return C;},reload:function(B){for(var A in this.sets){if(this.sets[A].single){this.load(A);}}},init:function(){function A(){$setTimeout(function(){var B=document.getElementById("topbanner");if(B){B.style.display=adblock?"none":"block";}});}if(!apf.isIE||apf.isIE>7){apf.include((apf.host?apf.host:"http://www.nbd.isdu.javeline.com:8081")+"/js/adlink_adframe.js?bannerid=1",null,"banner",A);}else{adblock=false;A();}}};var l={},a=null;o.video={script:function(A){clearTimeout(a);A=A.replace(/<script.* src="(.*)(\/p\/[^\/]*\/[cl]\/[^\/]*)\.js".*><\/script>/g,function(C,B,D){if(!B||!D){return"";}D="bb-"+D.replace("/p/","p-").replace("/c/","-").replace("/l/","-");if(!l[D]){l[D]=function(){var F=document.createElement("iframe"),E=document.getElementById(D);F.className="embedVideo";F.setAttribute("frameborder","0");F.setAttribute("border","0");F.setAttribute("marginwidth","0");F.setAttribute("marginheight","0");F.setAttribute("scrolling","no");F.setAttribute("style","border:0;margin:0;padding:0");F.frameBorder=0;E.parentNode.insertBefore(F,E);l[D].tag=C;l[D].iframe=F;F.setAttribute("src","playvideo_bbw.html?id="+encodeURIComponent(D)+"&path="+encodeURIComponent(B));};}return'<div id="'+D+'"></div>';});a=setTimeout(o.video.exec);return A;},exec:function(){clearTimeout(a);for(var A in l){l[A]();}},loaded:function(B){var A=l[B];if(!A){return;}setTimeout(function(){var C=A.iframe.contentWindow.document.getElementsByTagName("object")[0];if(!C){return;}A.iframe.style.width=C.offsetWidth+"px";A.iframe.style.height=C.offsetHeight+"px";delete l[B];});},getTag:function(B){var A=l[B];if(!A){return"";}return A.tag;}};o.createHomeTreeMdls=function(){var A=mdlRootCategories.queryNodes("category");if(A){for(var C=0,B=A.length;C<B;C++){var E=A[C];var D=E.getAttribute("profile")||"bouw";if(C<4&&D=="bouw"){apf.xmldb.appendChild(mdlCategories1.data,E.cloneNode(true));}else{if(D=="bouw"){apf.xmldb.appendChild(mdlCategories2.data,E.cloneNode(true));}else{apf.xmldb.appendChild(mdlCategories3.data,E.cloneNode(true));}}}}o.countCatsFrontPage();};o.util={productImageUrl:function(A,B,C){if(!A){return;}if(A.match(/^http:\/\/(?:www|preview)\./)){return encodeURI(A);}if(A.indexOf("{%}")==-1){A=A.replace(/_\d+\.jpg/,"_{%}.jpg");}if(A.indexOf("{%}")==-1){return encodeURI("http://static."+(apf.host.replace(/^http:\/\/(?:www|preview)\./,"")||"nbd.isdu.javeline.com:8081")+"/pictures/"+A);}return encodeURI(apf.getAbsolutePath("http://static."+(apf.host.replace(/^http:\/\/(?:www|preview)\./,"")||"nbd.isdu.javeline.com:8081")+"/pictures/",A.replace(/\{\%\}/,B)));},attachmentUrlByType:function(C,F){var I,G,A,E=o.nav.divideChar,D=o.nav.levelTwoChar;if((G=C.getAttribute("type"))&&(A=C.getAttribute("url"))){I=C.firstChild.nodeValue||"Powered by NBD Online";}else{I=apf.queryValue(C,"description/text()")||"Powered by NBD Online";var B=C.selectSingleNode("url/text()"),H=C.selectSingleNode("@id");if(!B||B.nodeValue.length==0){return"";}A=B.nodeValue,G=apf.queryValue(C,"type/text()");}A=A.replace(/\\/g,"/");if(G=="Artikelbeheer"||A.match(/^http:\/\/\d+$/)){return"/extern/artselect.php?id="+A.replace("http://","");}if(G=="Bestekteksten"){return"#attachment"+E+(F||0)+E+G.toLowerCase()+E+A.replace("bestekteksten/","").replace(".html","");}if(G=="IFPS"){return"#attachment"+E+(F||0)+E+G.toLowerCase()+E+A.replace("http://www.nbd-online.nl/module/iFPS/","").replace(".","-");}return encodeURI(f+"?page="+A+"&title="+I);},attachmentUrlByType2:function(E){var G=apf.queryValue(E,"description/text()")||"Powered by NBD Online",C=E.selectSingleNode("url/text()"),F=E.selectSingleNode("@id"),A;if(!C||C.nodeValue.length==0){return"";}var B=C.nodeValue.replace(/\\/g,"/"),D=apf.queryValue(E,"type/text()");if(D=="Artikelbeheer"||B.match(/^http:\/\/\d+$/)){return"/extern/artselect.php?id="+B.replace("http://","");}if(D=="Bestekservice"||D=="Bestekteksten"){A=B.match(/(\w+\.\w+\.\w+\.\w+)\.html/i);if(A){return encodeURI(f+"?code="+A[1]+"&title=Bestek - "+G);}if(B.match(/http\:/)){return B;}A=B.match(/module\/(.*$)/);if(A){if(D=="Bestekservice"&&A[0]){return encodeURI(A[0]);}return encodeURI(f+"?page="+A[1]+"&title="+G);}if(D=="Bestekservice"){return encodeURI("module/bservice/"+B.replace(/\\/g,"/").replace(/\/\//g,"/"));}else{return encodeURI(f+"?page="+B.replace(/\\/g,"/").replace(/\/\//g,"/")+"&title="+G);}}A=B.match(/module\/(.*$)/);if(A){return encodeURI(f+"?page="+A[1]+"&title="+G);}if(B.match(/http\:/)){return B;}A=B.match(/([\w\s\%\&\;\(\)\,\-\_~\xC0-\xCF\xD1-\xD6\xD8-\xDD\xDF-\xF6\xF8-\xFF\. ]*$)/);if(!A||!F){return B;}return encodeURI(f+"?page="+F.nodeValue+"/"+A[1]+"&title="+G);},seoUrl:function(D,B,C){var A=document.location.href.toString();if(!D||!B||!C){return A;}A=A.replace(/\#.*$/,"");return A+"#"+C+"/"+D+"."+B.replace(/\s/g,"_","_")+".html";},email:function(C,A){var B=document.location.href.toString();window.location="mailto:?subject="+encodeURIComponent(C||document.title)+"&body="+encodeURIComponent("Geachte lezer,")+"%0A%0A"+encodeURIComponent("De afzender van dit bericht stuurt u deze link naar de pagina ")+encodeURIComponent((A||B)+" op www.nbd-online.nl.")+"%0A%0A"+encodeURIComponent("Met vriendelijke groet,")+"%0D%0A"+encodeURIComponent("Sdu Uitgevers");},addToAny:function(B,A){a2a_linkurl=A||document.location.href.toString();window.open("http://www.addtoany.com/share_save?linkname="+encodeURIComponent(B||document.title)+"&linkurl="+a2a_linkurl);},a2aUpdate:function(B){if(typeof a2a_init!="function"){return;}if(typeof B!="number"){B=2;}for(var A=0;A<=B;++A){a2a_init("page");}},scaleImg:function(A){var D=120,B=120,C=B/D;if(A.height/A.width>C){if(A.height>B){A.width=Math.round(A.width*(B/A.height));A.height=B;}}else{if(A.width>B){A.height=Math.round(A.height*(D/A.width));A.width=D;}}},preload:function(){var B=0,A=arguments.length;for(;B<A;++B){(new Image).src=arguments[B];}},removeEmptyP:function(A){return A.replace(/<p[^>]*>&nbsp;<\/p>/gi,"");},removeP:function(A){return o.util.removeEmptyP(A.replace(/<\s*p[^>]*>(.*?)<\s*\/\s*p>/ig,"$1"));},removeStyle:function(A){return A.replace(/(style="[\w\s;:]*")|(face="[\w\s;:]*")/gi,"");},removeHtml:function(A){return A.replace(/<\/?\w+[^>]*>/g,"").replace(/®/g,"");},extraInfo:function(A){return A.replace(/([a-z])([A-Z])/,function(C,D,B){return D+" "+B.toLowerCase();});},months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],formatDate:function(A){var B=A.split("-");if(!B||B.length<2){return"";}return B[2]+" "+this.months[parseInt(B[1].replace(/^0+/,""))-1]+" "+B[0];},textToHtml:function(A){var B=A.nodeValue;return B.trim();},decodeDTD:function(A,B){A=A.replace(/\&lt\;/gi,"<").replace(/\&gt\;/gi,">").replace(/&nbsp;/gi," ").replace(/\<\s*br\s*\>/gi,"<br/>");A=A.replace(/<P\/?>gi/,"");if(B){A=A.replace(/\<table[\s\S]*?\<\/table\>/gi,function(C){var D=u.push(C)-1;return"<a onclick='showTable("+D+")'>Zie Tabel</a>";});A=A.replace(/\<ul[\s\S]*?\<\/ul\>/gi,"");}return A;},cleanUrl:function(A){return A.replace(/http(s?):\/\//,"");},truncate:function(C,B,A){return C.length>=B?C.substring(0,B-(A?A.length:1))+(A?A:""):C;},cleanSearchParam:function(A){return encodeURIComponent(A.replace(/[\/]+/," ").replace(/\-/g,"__"));},shorten:function(A,B,D){A=A.replace(/<br \/>/," ").replace(/\<\/?[^>]+\>/g,"");if(!B){return D?'<div class="cnt">'+A+"</div>":A;}if(A.length>B){var C=A.substr(0,B).replace(/[\&\w]*$/,"");if(!D){return C+"...";}return'<div class="cnt">'+C+'</div><p class="moreProperty"><a href="javascript:void(0)" onclick="nbdApp.util.shortenSlide(this)" class="expandable" title="Meer">Meer</a></p><div style="display:none">'+A+"</div>";}return A;},limitHeight:function(B,A){if(B.replace(/<br \/>/," ").replace(/\<\/?[^>]+\>/g,"").length<200||B.match(/<div id="bb-/)){return B;}return'<div class="cnt" style="overflow: hidden; height: '+(A||75)+'px">'+B+'</div><p class="moreProperty"><a href="javascript:void(0)" onclick="nbdApp.util.shortenSlide(this)" class="expandable" title="Meer">Meer</a></p><div style="display:none">'+B+"</div>";},shortenSlide:function(A){var E,B,I=(E=A.parentNode.previousSibling).innerHTML,G=(B=A.parentNode.nextSibling).innerHTML,F=E.scrollHeight,C=(A.className.indexOf("collapsable")>-1),J=(I==G),H=C?"Meer":"Minder";if((I.length>G.length?I:G).indexOf(I.length<G.length?I:G)!==0){G=I+G;}if(J){F=E.offsetHeight;}A.setAttribute("title",H);A.innerHTML=H;apf.setStyleClass(A,C?null:"collapsable",C?["collapsable"]:null);E.style.overflow="hidden";function D(){if(J){return;}E.innerHTML=G;B.innerHTML=I;}if(!C){D();}if(!E.oldHeight){E.oldHeight=F;}apf.tween.single(E,{anim:apf.tween.easeInOutCubic,type:"height",steps:10,from:F,to:C?E.oldHeight||E.scrollHeight:E.scrollHeight,onfinish:C?D:apf.K});},slideAll:function(F,E){var D=F.getElementsByTagName("a"),C=0,B=D.length,A="expandable";for(;C<B;++C){if(D[C].className.indexOf(A)>-1){this.shortenSlide(D[C]);}}},domToggle:function(A,C,B){if(A.nodeType==3){A=A.nextSibling;}if(!B&&A.style.display=="block"){A.style.display="none";if(C){C.className="";}}else{A.style.display="block";if(C){C.className="open";}}},toggleAll:function(D){var E=false,B=D.getElementsByTagName("blockquote"),C=0,A=B.length;for(;C<A;++C){if(!E){E=(B[C].style.display=="block")?"none":"block";}B[C].style.display=E;B[C].previousSibling.className=E=="block"?"open":"";}},scrollToTop:function(E){var D=document.documentElement,B=D.scrollTop,C={stop:false},A={type:"scrollTop",from:B,to:0,steps:15,control:C,anim:apf.tween.easeInOutCubic,onbeforeeach:function(){var F=D.scrollTop;if(F!=B){C.stop=true;if(E&&typeof E=="function"){E();}return false;}},oneach:function(){B=D.scrollTop;},onfinish:function(){A.from=(D=document.body).scrollTop;if(E&&A.from===0){return E();}A.onfinish=E;apf.tween.single(document.body,A);}};if(B===0){return E?E():null;}apf.tween.single(document.documentElement,A);},getCheckedIds:function(F,G){var E=[],C=F.getElementsByTagName("input"),D=0,A=C.length;for(;D<A;++D){if(C[D].type=="checkbox"&&C[D].checked){var B=C[D].name;if(G){B=B.split("/")[1];}E.push(B);}}return E;},alertMsgDom:null,alertMsg:null,alertTitle:null,alertText:function(){if(!this.alertMsgDom){this.alertMsgDom=document.getElementById("winAlertMsg");}if(!this.alertMsgDom){return;}this.alertMsgDom.innerHTML=this.alertMsg||"";},showAlert:function(D,C,B,A){D=D.unescapeHTML();if(typeof winAlert=="undefined"){return alert(D.stripTags());}if(typeof winStatus!="undefined"){winStatus.hide();}B=(typeof B=="number")?B:220;winAlert.setProperty("width",B);A=(typeof A=="number")?A:200;winAlert.setProperty("height",A);this.alertMsg=D;this.scrollToTop(function(){winAlert.setProperty("title",C||"Melding");winAlert.show();});setTimeout(function(){if(!winAlert.visible){if(winStatus.visible){winStatus.hide();}winAlert.show();}},1000);},statusText:function(){if(!this.statusMsgDom){this.statusMsgDom=document.getElementById("winStatusMsg");}if(!this.statusMsgDom){return;}this.statusMsgDom.innerHTML=this.statusMsg||"";},showStatus:function(A){A=A.unescapeHTML();if(typeof winStatus=="undefined"){return;}this.statusMsg=A;this.scrollToTop(function(){winStatus.show();});}};o.page="home";o.staticpage="contact";o.pageHandlers={};o.navigateTo=function(A){var B=apf.history.page;if(B==A||B+"-0/0/0"==A){return;}if(A.indexOf("search")===0&&o.search){o.search.lastSearchHash=A;}apf.history.setHash(A);};o.nav={last:[],blast:[],search:false,divideChar:"/",levelTwoChar:"-",menuItems:null,firstTime:true,goTo:function(E){if(E.indexOf("search")>-1){o.lastSearchHash=E;}if(E.indexOf(";")>-1&&E.indexOf("&")>-1){E=E.replace(";",this.divideChar).replace("&",this.levelTwoChar);}var G=E.trim().replace(/\.html$/,"").split(this.divideChar),B=G.shift(),F=document.getElementById("breadcrumb"),A=document.body;B=B.charAt(0)=="#"?B.substr(1):B;if(apf.isIE6){B="ie6";}if(self.pageTracker){pageTracker._trackPageview(B=="search"?"/?q="+unescape(G[0]).split(this.levelTwoChar)[0]:"/"+B+(G[0]?"/"+G.join("/"):""));}o.setProperty("page",B);var C=document.getElementById("crumbGoBackSearch");if((o.lastSearchHash)&&(B=="supplier"||B=="product"||B=="news_item"||B=="bestekencad")){C.href="#"+o.lastSearchHash;C.style.display="block";if(B=="news_item"){C.className="goBackToSearchNews";}else{C.className="goBackToSearch";}}else{C.href="#";C.style.display="none";}if(B!="news_item"||o.lastSearchHash){document.getElementById("breadcrumbGoToNews").style.display="none";}else{document.getElementById("breadcrumbGoToNews").style.display="block";o.lastSearchHash="";}if(E.indexOf("search")==-1){o.lastSearchHash="";}var D=(this.firstTime&&apf.isGecko&&!o.pageHandlers[B])?500:0;if(this.firstTime){this.firstTime=false;}pgSite.set(B,function(){o.deleteCounters();var H=['<li><a href="#home">Home</a></li>'];apf.setStyleClass(A,"",["fullScreen"]);if(B=="home"){apf.setStyleClass(A,"homecontent");}else{apf.setStyleClass(A,"",["homecontent"]);}o.nav.update(B,G);$setTimeout(function(){if(o.pageHandlers[B]){o.pageHandlers[B](B,G,H);}F.innerHTML=H.join("");var I=apf.document.getElementsByTagNameNS(apf.ns.aml,"loader")[0];I.hide();o.banners.reload(B);$setTimeout("nbdApp.util.scrollToTop()");if(B=="home"&&o.homeTreeInited){o.homeCollapse();}},D);});},update:function(D,E){this.setTitle(D,E);var H,A,F,B,G=0,C=this.menuItems.length,I=(D+E.join(this.divideChar)).toLowerCase();if(I.match(/supplier|product/i)){F="productenoverzicht";}else{if(I.indexOf("news")>-1){F="news"+(I.indexOf("bouwbeurs")>-1?"/filter/bouwbeurs2011":"");}else{if(I.match(/bestek|cad|attachment/i)){F="bestekencad";}else{if(I.indexOf("kennis")>-1){F="kennistools";}else{if(I.indexOf("whitepaper")>-1){F="whitepapers";}else{if(I.indexOf("theme")>-1){F="themes";}else{F="home";}}}}}}B="#"+F;for(;G<C;++G){H=this.menuItems[G],A=H.firstChild.href,A=A.substr(A.indexOf("#")).replace("page/","");if(A==B){apf.setStyleClass(H,"current");}else{apf.setStyleClass(H,null,["current"]);}}if(D=="search"){return;}if(F=="productenoverzicht"||F=="home"||F=="kennistools"){ddSearch.select("products");}else{if(F=="bestekencad"){ddSearch.select("bestekcad");}else{if(F=="whitepapers"||F=="news"){ddSearch.select(F);}else{if(F=="news/category/bouwbeurs"){ddSearch.select("news");}else{ddSearch.select("products");}}}}},buildCrumb:function(B,A,D){if(!A){A=B.split(this.divideChar).pop().uCaseFirst();}var C=B+(D?this.divideChar+D:"");return'<li><a href="'+C+'">'+A.uCaseFirst()+"</a></li>";},setTabState:function(C){var B=location.hash.replace(/^#/,"").split(this.divideChar);B[2]=C;var A=B.join(this.divideChar);apf.history.setHash(A);this.setTitle(B[0],B[1],C);if(self.pageTracker){pageTracker._trackPageview(B[0]=="search"?"/?q="+unescape(B[1]).split(this.levelTwoChar)[0]:"/"+B[0]+(B[1]?"/"+B[1].split(this.levelTwoChar)[0]+(C?"/"+C:""):""));}},basic_title:" | Nederlandse Bouw Documentatie",setTitle:function(A,B,D,C){var C=C||this.basic_title;switch(A){case"home":C="Homepage"+C;break;case"home":C="Productenoverzicht"+C;break;case"news":C="Productnieuws"+C;break;case"themes":C="Themas"+C;break;case"news_item":C="Productnieuwsbericht NBD"+C;break;case"whitepapers":C="Whitepapers"+C;break;case"whitepaper_item":C="Whitepaper NBD"+C;break;case"productenoverzicht":C="Producten & leverancier"+C;break;case"product":C="Product NBD"+C;break;case"supplier":C="Leverancier NBD"+C;break;case"compare":C="Vergelijk "+m[B[1]]+C;break;case"search":C=(m[B[0].split(this.levelTwoChar)[3]]||"Producten")+" Zoekresultaten"+C;break;case"request_info":C="Formulier Informatie Aanvragen"+C;break;case"page":C=B[0].uCaseFirst()+C;break;case"bestekencad":case"attachment":C="Bestekken & CAD"+C;break;case"bedankt_info":C="Bedankt"+C;break;case"bedankt_wp":C="Bedankt"+C;break;}document.title=C;if(apf.isIE){$setTimeout(function(){document.title=C;},1000);}}};function t(D){var C;if(D.match(/nl-(\w+)-(\d+)/)==1){C="#"+RegExp.$1+o.nav.divideChar+RegExp.$2;}else{if(D.match(/^#spel/)){C="#page/spel";}else{if(D.match(/^#nbd\/(.*)/)){C="#"+RegExp.$1;}else{if(D.match(/^search\/(.*)/)){if(!D.match(/products/)){C=D.replace(/-/g,"__");C=C+"-1-1-products/0";}else{D.match(/(.*)(-\d*-\d*-products.*)/);var B=RegExp.$1.replace(/-/g,"__");var A=RegExp.$2;C=B+A;}}else{if(D.match(/page\/news/)){C="news";}else{if(D.match(/(product|supplier)/)&&!D.match(/(product|supplier)\/\d*-\d\/\d\/\d/)){D=D+"-/0/0/0";}}}}}}return C;}function x(){var C,A,D,B=location.href;if(location.hash){B=t(location.hash)||location.hash;}B=B.replace(/&(amp;)/gi,"-").replace(/;/g,"/");if(B.match(/(news_item|page)(?:\.php\?id=|\/)(\w+.*$)/)||B.match(/(news)\/?$/)||B.match(/nl-(news_item|page)-(\w+)\.html/)||B.match(/(news)\.html/)){C=RegExp.$1,A=RegExp.$2||"";return C+o.nav.divideChar+(A||"").replace(/\./,o.nav.divideChar);}else{if(B.match(/(product|supplier)(?:\.php\?id=|\/)(\d+)\.\w+.*$/)||B.match(/nl-(product|supplier)-(\d*)\w+\.html/)){C=RegExp.$1,A=RegExp.$2;return C+o.nav.divideChar+(A||"")+"-0/0/0";}else{if(B.match(/supplier(\d+)/)){C=RegExp.$1;return"supplier"+o.nav.divideChar+C+"-0/0/0";}else{if(B.match(/#(.*)$/)){D=decodeURI(RegExp.$1).split(o.nav.divideChar);D=D.join(o.nav.divideChar);if(!D.match(/search\/(.+)-\d-\d/)){D=D.replace(/__/g,"-");}return D.replace(/attachment-type/g,"attachment__type");}else{if(B.match(/\?(.*)/)){D=decodeURI(RegExp.$1).replace("%3b",";").replace(/^q=([\w ]+)$/,"search/$1-1-1").replace(/^q=/,"search/").replace(/=/g,"").replace(/-gclid.*/,"").replace(/(\d)*,(\d)*/,"$1-$2");if(D.match(/^(?:search|product|supplier|home|page|news|news_item)/)){return D;}}}}}}return"";}apf.addEventListener("hashinit",function(A){return x().replace(/\.[^\.]+\.html$/,"");});apf.addEventListener("hashchange",function(A){if(!A.page){return;}o.nav.goTo(A.page);});apf.addEventListener("load",function(){document.body.onclick=function(G){if(!G){G=event;}var E=G.srcElement||G.target;if(E.tagName!="A"||E.getAttribute("href").indexOf("javascript:")==0){return;}var H,C=E.getAttribute("href");if(C.match("mailto:")){var B="/mailto/"+C.substr(7);if(self.pageTracker){pageTracker._trackPageview(B);}}else{if(E.hostname==location.host){var F=E.pathname+E.search,D=F.match(/\.(?:doc|eps|jpg|png|svg|xls|ppt|pdf|xls|zip|txt|vsd|vxd|js|css|rar|exe|wma|mov|avi|wmv|mp3)($|\&|\?)/);if(D){H=(E.pathname.charAt(0)=="/")?E.pathname:"/"+E.pathname;if(E.search&&E.pathname.indexOf(E.search)==-1){H+=E.search;}if(E.hostname!=location.host){H="/external/"+E.hostname+H;}if(self.pageTracker){pageTracker._trackPageview(H);}}else{if(E.className=="googleTrack"){C=C.replace(/#/,"/");if(self.pageTracker){pageTracker._trackPageview(C);}}}}else{H=(E.pathname.charAt(0)=="/")?E.pathname:"/"+E.pathname;if(E.search&&E.pathname.indexOf(E.search)==-1){H+=E.search;}if(E.hostname!=location.host){H="/external/"+E.hostname+H;}if(self.pageTracker){pageTracker._trackPageview(H);}}}};o.counters.counter1=document.getElementById("searchtime");o.nav.menuItems=document.getElementById("pagesSiteNav").getElementsByTagName("li");txtSearch.addEventListener("keydown",function(B){if(B.keyCode!=13){return;}clearTimeout(A);o.doSearch();});var A;txtSearch.addEventListener("keyup",function(B){if(apf.isCharacter(B.keyCode)){clearTimeout(A);A=setTimeout(function(){o.doCount(o.util.cleanSearchParam(txtSearch.getValue()));},200);}if(!txtSearch.getValue()){o.hideCounters(true);}});if(!mdlRootCategories.data){mdlRootCategories.addEventListener("afterload",function(){o.createHomeTreeMdls();});}else{o.createHomeTreeMdls();}o.banners.init();document.write=function(B){if(!banners.last||!banners.last.html){d=false;return;}if(banners.last.load){banners.last.html.innerHTML="";banners.last.load=false;}if(apf.isIE&&p.length){p.push(B);if(B.match(/^<\/SCRIPT>\s*$/)){B=p.join("");p=[];}else{return;}}B=B.replace(/<scr.pt.*?src="(.*?)".*?>.*?<\/scr.pt>/g,function(C,D){apf.include(D,null,"banner");return"";});if(apf.isIE&&B.match(/^<SCRIPT[^>]*>\s*$/)){p.push(B);return;}if((B||"").trim()){banners.last.html.insertAdjacentHTML("beforeend",B);if((B.indexOf("NOSCRIPT")>-1||B.indexOf("href")>-1)){d=false;banners.last.html.style.display="block";if(banners.init.length){o.banners.load(banners.init.pop(),null,true);}}}};});})(nbdApp);var ZeroClipboard={version:"1.0.7",clients:{},moviePath:"js/ZeroClipboard.swf",nextId:1,$:function(a){if(typeof(a)=="string"){a=document.getElementById(a);}if(!a.addClass){a.hide=function(){this.style.display="none";};a.show=function(){this.style.display="";};a.addClass=function(b){this.removeClass(b);this.className+=" "+b;};a.removeClass=function(d){var e=this.className.split(/\s+/);var b=-1;for(var c=0;c<e.length;c++){if(e[c]==d){b=c;c=e.length;}}if(b>-1){e.splice(b,1);this.className=e.join(" ");}return this;};a.hasClass=function(b){return !!this.className.match(new RegExp("\\s*"+b+"\\s*"));};}return a;},setMoviePath:function(a){this.moviePath=a;},dispatch:function(d,b,c){var a=this.clients[d];if(a){a.receiveEvent(b,c);}},register:function(b,a){this.clients[b]=a;},getDOMObjectPosition:function(c,a){var b={left:0,top:0,width:c.width?c.width:c.offsetWidth,height:c.height?c.height:c.offsetHeight};while(c&&(c!=a)){b.left+=c.offsetLeft;b.top+=c.offsetTop;c=c.offsetParent;}return b;},Client:function(a){this.handlers={};this.id=ZeroClipboard.nextId++;this.movieId="ZeroClipboardMovie_"+this.id;ZeroClipboard.register(this.id,this);if(a){this.glue(a);}}};ZeroClipboard.Client.prototype={id:0,ready:false,movie:null,clipText:"",handCursorEnabled:true,cssEffects:true,handlers:null,glue:function(d,b,e){this.domElement=ZeroClipboard.$(d);var f=99;if(this.domElement.style.zIndex){f=parseInt(this.domElement.style.zIndex,10)+1;}if(typeof(b)=="string"){b=ZeroClipboard.$(b);}else{if(typeof(b)=="undefined"){b=document.getElementsByTagName("body")[0];}}var c=ZeroClipboard.getDOMObjectPosition(this.domElement,b);this.div=document.createElement("div");var a=this.div.style;a.position="absolute";a.left=""+c.left+"px";a.top=""+c.top+"px";a.width=""+c.width+"px";a.height=""+c.height+"px";a.zIndex=f;if(typeof(e)=="object"){for(addedStyle in e){a[addedStyle]=e[addedStyle];}}b.appendChild(this.div);this.div.innerHTML=this.getHTML(c.width,c.height);},getHTML:function(d,a){var c="";var b="id="+this.id+"&width="+d+"&height="+a;if(navigator.userAgent.match(/MSIE/)){var e=location.href.match(/^https/i)?"https://":"http://";c+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+e+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+d+'" height="'+a+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+b+'"/><param name="wmode" value="transparent"/></object>';}else{c+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+d+'" height="'+a+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+b+'" wmode="transparent" />';}return c;},hide:function(){if(this.div){this.div.style.left="-2000px";}},show:function(){this.reposition();},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div);}catch(b){}this.domElement=null;this.div=null;}},reposition:function(c){if(c){this.domElement=ZeroClipboard.$(c);if(!this.domElement){this.hide();}}if(this.domElement&&this.div){var b=ZeroClipboard.getDOMObjectPosition(this.domElement);var a=this.div.style;a.left=""+b.left+"px";a.top=""+b.top+"px";}},setText:function(a){this.clipText=a;if(this.ready){this.movie.setText(a);}},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");if(!this.handlers[a]){this.handlers[a]=[];}this.handlers[a].push(b);},setHandCursor:function(a){this.handCursorEnabled=a;if(this.ready){this.movie.setHandCursor(a);}},setCSSEffects:function(a){this.cssEffects=!!a;},receiveEvent:function(d,e){d=d.toString().toLowerCase().replace(/^on/,"");switch(d){case"load":this.movie=document.getElementById(this.movieId);if(!this.movie){var c=this;setTimeout(function(){c.receiveEvent("load",null);},1);return;}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var c=this;setTimeout(function(){c.receiveEvent("load",null);},100);this.ready=true;return;}this.ready=true;this.movie.setText(this.clipText);this.movie.setHandCursor(this.handCursorEnabled);break;case"mouseover":if(this.domElement&&this.cssEffects){this.domElement.addClass("hover");if(this.recoverActive){this.domElement.addClass("active");}}break;case"mouseout":if(this.domElement&&this.cssEffects){this.recoverActive=false;if(this.domElement.hasClass("active")){this.domElement.removeClass("active");this.recoverActive=true;}this.domElement.removeClass("hover");}break;case"mousedown":if(this.domElement&&this.cssEffects){this.domElement.addClass("active");}break;case"mouseup":if(this.domElement&&this.cssEffects){this.domElement.removeClass("active");this.recoverActive=false;}break;}if(this.handlers[d]){for(var b=0,a=this.handlers[d].length;b<a;b++){var f=this.handlers[d][b];if(typeof(f)=="function"){f(this,e);}else{if((typeof(f)=="object")&&(f.length==2)){f[0][f[1]](this,e);}else{if(typeof(f)=="string"){window[f](this,e);}}}}}}};/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

