/*
  DOM fixes and enhancements
 (c) Sean Hogan, December 2008
*/
if(!window.Meeko){window.Meeko={}}if(!Meeko.XPL){Meeko.XPL=(function(){var d=function(){};d.enhance=function(f,k){for(var g in k){var j=k[g];var i=f[g];if(i){for(var h in j){if("prototype"==h){continue}if(i[h]){continue}else{i[h]=j[h]}}if(j.prototype&&null==i.prototype){i.prototype={}}for(var h in j.prototype){if(i.prototype[h]){continue}else{i.prototype[h]=j.prototype[h]}}}else{f[g]=j}}};var c=function(f){this.ref=f};c.DEBUG=0;c.INFO=1;c.WARN=2;c.ERROR=3;c.prototype.log=function(){this._log({message:arguments})};c.prototype.debug=function(){this._log({level:c.DEBUG,message:arguments})};c.prototype.info=function(){this._log({level:c.INFO,message:arguments})};c.prototype.warn=function(){this._log({level:c.WARN,message:arguments})};c.prototype.error=function(){this._log({level:c.ERROR,message:arguments})};c.prototype._log=function(f){f.date=new Date;f.ref=this.ref;f.message=Array.prototype.join.call(f.message," ");if(this._trace){this._trace.log(f)}};var b=function(f){this.params={};this.requiredContexts=[];this.installed=false;this.logger=new c(f)};var e=function(){this.prefetch={};this.contexts={};this.documentURI=document.documentURI||document.baseURI||document.URL;this.boundDocumentURI=this.documentURI};e.prototype.createContext=function(g){if(null==g){g=0;for(var h in this.contexts){g++}}var f=new b(g);this.contexts[g]=f;f.logger._trace=this.trace;return f};e.prototype.createNamespace=function(g){var f=g.split(".");var j=window;for(var l=f.length,h=0;h<l;h++){var k=f[h];if(!j[k]){j[k]={}}j=j[k]}return j};e.prototype.init=function(){var h=this;function g(j){var l=h.contexts[j];if(l.installed){return true}for(var o=l.requiredContexts.length,k=0;k<o;k++){g(l.requiredContexts[k])}var m=l.wrappedScript.call(window);l.installed=true;return m}for(var f in h.contexts){g(f)}};var a=function(){this.readyState="initialized"};a.runList=[];a.prototype.run=function(i){function f(k,l){k.text=l;if(!k.innerHTML){k.appendChild(document.createTextNode(l))}}var h=document.createElement("script");h.type="text/javascript";this.scriptElement=h;this.scriptIndex=a.runList.length;a.runList.push(this);this.readyState="loaded";f(h,"try {\n"+i+"\n Meeko.XPL.Script.runList["+this.scriptIndex+'].readyState = "complete";\n}\ncatch (__xplError__) {\n Meeko.XPL.Script.runList['+this.scriptIndex+'].readyState = "error";\n}\n');var j=document.createElement("script");j.type="text/javascript";this.callbackElement=j;f(j,"window.setTimeout(function() { Meeko.XPL.Script.runList["+this.scriptIndex+"].callback(); }, 10);");var g=document.getElementsByTagName("head")[0];g.appendChild(h);g.appendChild(j)};a.prototype.callback=function(){var f=this.scriptElement.parentNode;f.removeChild(this.scriptElement);f.removeChild(this.callbackElement);if(this.readyState=="error"){}else{if(this.readyState=="loaded"){this.readyState="syntax-error"}}if(this.onreadystatechange){this.onreadystatechange()}};return{Namespace:d,XPLContext:b,XPLSystem:e,Script:a}})()}if(!Meeko.stuff){Meeko.stuff={}}Meeko.stuff.xplSystem=new Meeko.XPL.XPLSystem();var traceWindow=this;do{if(traceWindow&&traceWindow.Meeko&&traceWindow.Meeko.stuff&&traceWindow.Meeko.stuff.trace){Meeko.stuff.xplSystem.trace={_log:traceWindow.Meeko.stuff.trace.log,log:function(a){a.url=Meeko.stuff.xplSystem.documentURI;a.boundDocumentURI=Meeko.stuff.xplSystem.boundDocumentURI;this._log(a)}};break}if(traceWindow==top){break}}while(traceWindow=traceWindow.parent);if(!Meeko.stuff.xplSystem.trace){Meeko.stuff.xplSystem.trace={log:function(a){}}}Meeko.stuff.execScript=function(b,c){var a=new Meeko.XPL.Script;if(c){a.onreadystatechange=function(){c(a.readyState)}}a.run(b)};Meeko.stuff.evalScript=function(){return eval(arguments[0])};if(XMLHttpRequest&&!XMLHttpRequest.wrapped){var XMLHttpRequest=(function(){var b=window.XMLHttpRequest;var a=function(){return new b};a.wrapped=b;return a})()}Meeko.stuff.xplSystem.createContext("DOM.xhtml");Meeko.stuff.xplSystem.contexts["DOM.xhtml"].requiredContexts.push("lib/Meeko/DOM.xhtml");Meeko.stuff.xplSystem.createContext("lib/Meeko/DOM.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM.xhtml"].requiredContexts.push("lib/Meeko/Javascript-1.6/Javascript.xhtml");Meeko.stuff.xplSystem.createContext("lib/Meeko/Javascript-1.6/Javascript.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/Javascript-1.6/Javascript.xhtml"].wrappedScript=function(){var c=Meeko.stuff.xplSystem;var b=c.contexts["lib/Meeko/Javascript-1.6/Javascript.xhtml"];var a=b.logger;if(!this.Meeko){this.Meeko={}}Meeko["Javascript 1.6"]=(function(){var e=function(){};e.prototype=new this.Array();e.indexOf=function(l,h,k){var j=l.length;if(k==null){k=0}for(var g=k;g<j;g++){if(h==l[g]){return g}}return -1};e.lastIndexOf=function(l,h,k){var j=l.length;if(k==null){k=j-1}for(var g=k;g>=0;g--){if(h==l[g]){return g}}return -1};e.filter=function(o,m,j){var g=[];var l=o.length;for(var h=0;h<l;h++){var k=m.call(j,o[h],h,o);if(k){g.push(o[h])}}return g};e.every=function(m,l,h){var k=m.length;for(var g=0;g<k;g++){var j=l.call(h,m[g],g,m);if(!j){return false}}return true};e.forEach=function(l,k,h){var j=l.length;for(var g=0;g<j;g++){k.call(h,l[g],g,l)}};e.map=function(o,m,j){var g=[];var l=o.length;for(var h=0;h<l;h++){var k=m.call(j,o[h],h,o);g[h]=k}return g};e.some=function(m,l,h){var k=m.length;for(var g=0;g<k;g++){var j=l.call(h,m[g],g,m);if(j){return true}}return false};e.compare=function(o,l,k){if(!k){k=function(n,i){return(n<i)?-1:(n>i)?1:0}}var m=0;var j=o.length,h=l.length,p=(j<=h)?j:h;for(var g=0;g<p;g++){if(m=k(o[g],l[g])){return m}}return m};e.prototype.indexOf=function(g,h){return e.indexOf(this,g,h)};e.prototype.lastIndexOf=function(g,h){return e.lastIndexOf(this,g,h)};e.prototype.every=function(h,g){return e.every(this,h,g)};e.prototype.filter=function(h,g){return e.filter(this,h,g)};e.prototype.forEach=function(h,g){return e.forEach(this,h,g)};e.prototype.map=function(h,g){return e.map(this,h,g)};e.prototype.some=function(h,g){return e.some(this,h,g)};e.prototype.compare=function(h,g){return e.compare(this,h,g)};var d=function(){};d.prototype=new this.Object();d.copy=function(j,m,g,l){function o(r,q,i,n){if(!n&&(r.hasOwnProperty&&r.hasOwnProperty(i)||r[i]!=null)){return}r[i]=q[i]}if(g&&g.length){for(var p=g.length,k=0;k<p;k++){var h=g[k];o(j,m,h,l)}}else{for(var h in m){o(j,m,h,l)}}return j};d.toLoggerString=function(i){var h="";for(var l in i){var m=i[l];var j=typeof m;var k;try{if(j=="object"&&m.length){j="array"}}catch(g){}try{var k=""+m}catch(g){j="null"}if(j=="function"){h+=l+": function() {}\n"}else{if(j=="array"){h+=l+": [ "+m+" ]\n"}else{if(j=="null"){h+=l+": null\n"}else{h+=l+": "+m+"\n"}}}}return h};d.forEach=function(g,k,i){for(var h in g){var j=g[h];if(typeof j!="function"){k.call(i,j,h,g)}}};var f=function(g,i,h){if(g.forEach instanceof Function){g.forEach(i,h)}else{if(null!=g.length){e.forEach(g,i,h)}else{d.forEach(g,i,h)}}};return{Array:e,Object:d,forEach:f}})();Meeko.XPL.Namespace.enhance(window,Meeko["Javascript 1.6"])};Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM.xhtml"].requiredContexts.push("lib/Meeko/DOM/System.xhtml");Meeko.stuff.xplSystem.createContext("lib/Meeko/DOM/System.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/System.xhtml"].requiredContexts.push("lib/Meeko/Javascript-1.6/Javascript.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/System.xhtml"].wrappedScript=function(){var c=Meeko.stuff.xplSystem;var b=c.contexts["lib/Meeko/DOM/System.xhtml"];var a=b.logger;(function(){if(!document.parentWindow){document.parentWindow=window}var e=document.documentURI||document.baseURI||document.URL||document.url||document.location;if(!document.documentURI){document.documentURI=e}document.createElement("select").options;document.createTextNode("text");document.createAttribute("attribute");var g={Node:"[[DOMNode.prototype]]",Text:"[[DOMText.prototype]]",Document:"[[DOMDocument.prototype]]",Element:"[[DOMElement.prototype]]",Event:"[[DOMEvent.prototype]]"};for(var d in g){var f=g[d];if(!window[f]){continue}if(!window[d]){window[d]=function(){}}window[d].prototype=window[f]}})();Meeko.stuff.domSystem=(function(){var P={};var z=[{name:"Window",nodeType:0},{name:"Text",base:"Node",nodeType:3},{name:"Document",base:"Node",nodeType:9},{name:"HTMLDocument",base:"Document",nodeType:9},{name:"Element",base:"Node",nodeType:1},{name:"HTMLElement",base:"Element",nodeType:1},{name:"HTMLLinkElement",element:"link",base:"HTMLElement",nodeType:1},{name:"HTMLStyleElement",element:"style",base:"HTMLElement",nodeType:1},{name:"HTMLFormElement",element:"form",base:"HTMLElement",nodeType:1}];var h={};Object.forEach(z,function(i){h[i.name]=i});var A={};for(var m in h){A[m]=[];var O=A[m];do{O.unshift(m);var p=h[m];m=(p)?p.base:null}while(m)}function C(i){return(i.localName)?i.localName:i.tagName.replace(i.prefix+":","")}var v={_test:function(i){return C(i)},link:"HTMLLinkElement",style:"HTMLStyleElement",form:"HTMLFormElement",LINK:"HTMLLinkElement",STYLE:"HTMLStyleElement",FORM:"HTMLFormElement",_default:"HTMLElement"};var n={_test:function(i){return(i!=window)?i.nodeType:0},0:"Window",1:{_test:function(i){return i.namespaceURI},"http://www.w3.org/1999/xhtml":v,_null:v,_default:"Element"},9:{_test:function(i){return i.namespaceURI},"http://www.w3.org/1999/xhtml":"HTMLDocument",_null:"HTMLDocument",_default:"Document"}};var f=new Array(13);for(var M=0;M<13;M++){f[M]=[]}var t={};t.getStorage=function(i){return i._domBindings};t.addNode=function(U,V,T){if(this.getStorage(U)){return false}var i=(U!=window)?U.nodeType:0;var S=f[i];S.push(U);var R={};U._domBindings=R;if(V){V.call(T,U)}return true};t.releaseNodesByType=function(V,X,U){var S=f[V];for(var T=S.length-1;T>=0;T--){var W=S[T];if(X){X.call(U,W)}delete S[T];var R=W._domBindings;W._domBindings=null}};var k=Math.random();function g(T,W,R,V){function X(ab,aa,i,Z){if(aa[i]==null){return}if(!Z&&(ab.hasOwnProperty&&ab.hasOwnProperty(i)||ab[i]!=null)){return}if("function"==typeof aa[i]){ab[i]=function(){return aa[i].apply(aa,arguments)}}else{if(ab.__defineGetter__){ab.__defineGetter__(i,function(){return aa[i]})}else{ab[i]=aa[i]}}}if(R&&R.length){for(var Y=R.length,U=0;U<Y;U++){var S=R[U];X(T,W,S,V)}}else{for(var S in W){X(T,W,S,V)}}return T}function u(T,V,R){function W(Z,Y,i){if(Z[i]==null){return}Z[i]=null}if(R&&R.length){for(var X=R.length,U=0;U<X;U++){var S=R[U];W(T,V,S)}}else{for(var S in V){W(T,V,S)}}return T}function J(V,R){for(var W=R.length,U=0;U<W;U++){var T=R[U];var S="_"+T;if(V[T]){V[S]=V[T];V[T]=null}}}function r(V,R){for(var W=R.length,U=0;U<W;U++){var T=R[U];var S="_"+T;if(V[S]){V[T]=V[S];V[S]=null}}}var w=[];var Q=function(i){this.name=i;this.prototype={};this.interfaces=[];this.mergedInterfaces=[];this.implementation=function(R){}};Q.prototype.xblRequired=function(T){for(var U=this.interfaces.length,S=0;S<U;S++){var R=this.interfaces[S];if(R.xblRequired&&R.xblRequired(T)){return true}}if(this.baseBinding){return this.baseBinding.xblRequired(T)}else{return false}};Q.prototype.attach=function(V){if(this.baseBinding){this.baseBinding.attach(V)}Object.copy(V,this.prototype);var S=new this.implementation(V);for(var X=this.mergedInterfaces.length,U=0;U<X;U++){var R=this.mergedInterfaces[U];if(R.prototype.xblCreate){R.prototype.xblCreate.call(S,V)}}for(var X=this.interfaces.length,U=0;U<X;U++){var R=this.interfaces[U];var W=new R(V);S[U]=W;if(W.xblReadyState&&W.xblReadyState()!="complete"){w.push(W)}}var T="_"+this.name;t.getStorage(V)[T]=S};Q.prototype.detach=function(V){var T="_"+this.name;var S=t.getStorage(V);var R=S[T];S[T]=null;if(!R){a.warn("Failure removing non-existant "+this.name+" interface from "+V.tagName);return}for(var Y=this.interfaces.length,U=Y-1;U>=0;U--){var X=R[U];if(X&&X.xblDestroy){X.xblDestroy(V)}R[U]=null}for(var W in this.prototype){if(V[W]===this.prototype[W]){V[W]=null}}if(this.baseBinding){this.baseBinding.detach(V)}};Q.prototype.addImplementation=function(i){this.interfaces.push(i);var S="_"+this.name;var R=this.interfaces.length-1;return function(V){var T=t.getStorage(V);if(!T){return}var U=T[S];if(!U){return}return U[R]}};Q.prototype.mergeImplementation=function(i){this.mergedInterfaces.push(i);var R="_"+this.name;return Function("node","return node['"+R+"']; ")};Q.init=function(S,T,W){for(var V=W.length,R=0;R<V;R++){var U=W[R];if(U&&U.prototype){Object.copy(S.implementation.prototype,U.prototype)}}};Q.prototype.init=function(){Q.init(this,this.interfaces,this.mergedInterfaces)};var x={};for(var m in h){var p=h[m];var E=new Q(m);x[m]=E;if(!window[m]){window[m]=E}if(!window[m].prototype){window[m].prototype=E.prototype}var G=p.base;if(G){E.baseBinding=x[G]}}function y(i){var S=n;while("string"!=typeof S){var R=S._test(i);if(R!=null){S=S[R]||S._default||""}else{S=S._null||""}}return x[S]}var s={acceptNode:function(R){var i=y(R);if(!i){a.warn("filterDOMBindings: Could not find DOMBinding for nodeType: "+R.nodeType);return NodeFilter.FILTER_REJECT}return(i.xblRequired(R))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}};function o(R){var i=y(R);if(!i){a.error("attachDOMBindings: Could not find DOMBinding for nodeType: "+R.nodeType);throw"Error attaching DOMBindings"}if(t.addNode(R)){i.attach(R)}}function l(R){var i=y(R);if(!i){a.error("detachDOMBindings: Could not find DOMBinding for nodeType: "+R.nodeType);throw"Error detaching DOMBindings"}i.detach(R)}function j(i){t.releaseNodesByType(i,l)}var d=null,F="uninitialized",I=false,D=null;function L(){if(null==document.readyState){document.readyState="loading";document.addEventListener("DOMContentLoaded",function(i){document.readyState="loaded"},true);window.addEventListener("load",function(i){if(i.target==document||i.target==window){document.readyState="complete"}},true)}if(window.addEventListener){window.addEventListener("unload",e,true)}if(window.attachEvent){window.attachEvent("onunload",e)}d=window.setTimeout(q,50)}function e(){a.debug("Beginning exit process");j(Node.ELEMENT_NODE);j(Node.DOCUMENT_NODE);j(0);a.debug("DOMBindings detached");if(window.removeEventListener){window.removeEventListener("unload",e,false)}if(window.detachEvent){window.detachEvent("onunload",e)}a.debug("Finished exit process")}function q(){if(I){a.debug("Re-entrancy during initialization");return false}I=true;K();I=false}function K(){d=window.setTimeout(q,50);MAIN:switch(F){case"uninitialized":a.debug("initializing");if(!document.body){return false}for(var R in x){x[R].init()}o(window);o(document);window.addEventListener("DOMNodeInserted",function(i){if(i.target.nodeType==1){a.debug("DOMNodeInserted");var U=document._createTreeWalker(i.target,NodeFilter.SHOW_ELEMENT,s,false);U.forEach(o)}},true);D=document._createTreeWalker(document.documentElement,NodeFilter.SHOW_ELEMENT,s,false);F="loading";case"loading":a.debug("loading");D.forEach(o);switch(document.readyState){case"loaded":case"interactive":case"complete":a.debug("Dispatching compat DOMContentLoaded event");var T=document.createEvent("Event");T.initEvent("DOMContentLoaded",true,true);document.dispatchEvent(T);F="loaded";break;default:break MAIN}case"loaded":a.debug("loaded");for(var S=w.length-1;S>=0;S--){if("complete"==w[S].xblReadyState()){w.splice(S,1)}}if(w.length){break MAIN}F="complete";a.debug("complete")}a.debug("Dispatching compat progress event");var T=document.createEvent("Event");T.initEvent("progress",true,true);document.dispatchEvent(T);if(F=="complete"){a.debug("Dispatching compat load event");var T=document.createEvent("Event");T.initEvent("load",true,true);document.dispatchEvent(T);window.clearTimeout(d)}}function H(U,R){for(var W=R.length,V=0;V<W;V++){var T=R[V];var S="_"+T;U[S]=U[T];U[T]=function(){var i=this[S]();P.attach(i);return i}}}L();Object.copy(P,{addImplementation:function(R,i){return x[R].addImplementation(i)},mergeImplementation:function(R,i){return x[R].mergeImplementation(i)},bindInterface:g,releaseInterface:u,hideInterface:J,restoreInterface:r,wrapInterface:H,attach:o,document:{}});var N=function(i){if(null==i){return null}if(this==window){return arguments.callee.getInterface(i)}else{arguments.callee.prototype.xblCreate.call(this,i)}};N.getInterface=P.addImplementation("Document",N);N.methods=["createTreeWalker","createNodeIterator"];N.prototype.xblCreate=function(R){this.target=R;var i=N.methods;P.hideInterface(R,i);P.bindInterface(R,this,i,true)};N.prototype.xblDestroy=function(R){this.target=null;var i=N.methods;P.releaseInterface(R,this,i,true);P.restoreInterface(R,i)};N._createInterface=function(R){var V=function(){};for(var U=R.length,T=0;T<U;T++){var S=R[T];V.prototype[S]=new Function('var node = this.baseBinding["'+S+'"](); if (node) { this.currentNode = node; Meeko.stuff.domSystem.attach(node); } return node;')}return V};N.TreeWalker=N._createInterface(["firstChild","lastChild","parentNode","nextSibling","previousSibling","nextNode","previousNode"]);N.TreeWalker.prototype.forEach=function(R,i){return this.baseBinding.forEach.call(this,R,i)};N.NodeIterator=N._createInterface(["nextNode","previousNode"]);N.NodeIterator.prototype.forEach=function(R,i){return this.baseBinding.forEach.call(this,R,i)};N.prototype.createTreeWalker=function(R,U,S,T){var V={};V.baseBinding=S;V.acceptNode=function(W){var X=D.currentNode;if(X===W||X.compareDocumentPosition(W)&Node.DOCUMENT_POSITION_PRECEDING){if(this.baseBinding){return this.baseBinding.acceptNode(W)}else{return NodeFilter.FILTER_ACCEPT}}else{return NodeFilter.FILTER_REJECT}};var i=new N.TreeWalker();i.baseBinding=document._createTreeWalker(R,U,V,T);return i};N.prototype.createNodeIterator=function(R,U,S,T){var V={};V.baseBinding=S;V.acceptNode=function(X){var Y=D.currentNode;var W=(Y.compareDocumentPosition)?Y.compareDocumentPosition(X):Element.prototype.compareDocumentPosition.call(Y,X);if(Y===X||W&Node.DOCUMENT_POSITION_PRECEDING){if(this.baseBinding){return this.baseBinding.acceptNode(X)}else{return NodeFilter.FILTER_ACCEPT}}else{return NodeFilter.FILTER_REJECT}};var i=new N.NodeIterator();i.baseBinding=document._createNodeIterator(R,U,V,T);return i};var B=function(i){if(!(this instanceof arguments.callee)){return new arguments.callee(i)}if(!(i&&i.length!=null)){throw"Target does not have NodeList interface"}this.target=i;this.length={target:i,valueOf:function(){return this.target.length}}};B.prototype.item=function(R){var T=this.target;var S=(T.item)?T.item(R):T[R];if(S){Meeko.stuff.domSystem.attach(S)}return S};B.prototype.forEach=function(T,S){var V=this.target;for(var W=V.length,R=0;R<W;R++){var U=(V.item)?V.item(R):V[R];if(U){Meeko.stuff.domSystem.attach(U)}T.call(S,U,R)}};if(window.NodeList){window._NodeList=window.NodeList}window.NodeList=B;return P})()};Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM.xhtml"].requiredContexts.push("lib/Meeko/DOM/Core.xhtml");Meeko.stuff.xplSystem.createContext("lib/Meeko/DOM/Core.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Core.xhtml"].requiredContexts.push("lib/Meeko/Javascript-1.6/Javascript.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Core.xhtml"].requiredContexts.push("lib/Meeko/DOM/System.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Core.xhtml"].wrappedScript=function(){var c=Meeko.stuff.xplSystem;var b=c.contexts["lib/Meeko/DOM/Core.xhtml"];var a=b.logger;Meeko.stuff.xplSystem.createNamespace("Meeko.DOM.Core");Meeko.DOM.Core=(function(){var f=function(){};f.ELEMENT_NODE=1;f.ATTRIBUTE_NODE=2;f.TEXT_NODE=3;f.CDATA_SECTION_NODE=4;f.ENTITY_REFERENCE_NODE=5;f.ENTITY_NODE=6;f.PROCESSING_INSTRUCTION_NODE=7;f.COMMENT_NODE=8;f.DOCUMENT_NODE=9;f.DOCUMENT_TYPE_NODE=10;f.DOCUMENT_FRAGMENT_NODE=11;f.NOTATION_NODE=12;f.DOCUMENT_POSITION_DISCONNECTED=1;f.DOCUMENT_POSITION_PRECEDING=2;f.DOCUMENT_POSITION_FOLLOWING=4;f.DOCUMENT_POSITION_CONTAINS=8;f.DOCUMENT_POSITION_CONTAINED_BY=16;f.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var h=function(){};var d=function(){};d.prototype.importNode=function(l,o){var p=this;var r;switch(l.nodeType){case f.ELEMENT_NODE:r=p.createElement(l.nodeName);var q=l.attributes;for(var m=0;m<q.length;m++){var n=q[m];r.setAttribute(n.nodeName,n.nodeValue)}var k=l.childNodes;if(o){for(var m=0;m<k.length;m++){var j=k[m];r.appendChild(p.importNode(j,true))}}break;case f.CDATA_SECTION_NODE:case f.TEXT_NODE:r=p.createTextNode(l.nodeValue);break}return r};var e=function(){};var g=function(){};if(!document.documentElement.compareDocumentPosition&&document.documentElement.contains){e.prototype.compareDocumentPosition=function(j){if(j==undefined){return 1}if(this===j){return 0}if(j.sourceIndex<=0||this.sourceIndex<=0){return 1}if(j.contains(this)){return 10}if(this.contains(j)){return 20}if(j.sourceIndex<this.sourceIndex){return 2}if(j.sourceIndex>this.sourceIndex){return 4}return 1}}g.INDEX_SIZE_ERR=1;g.DOMSTRING_SIZE_ERR=2;g.HIERARCHY_REQUEST_ERR=3;g.WRONG_DOCUMENT_ERR=4;g.INVALID_CHARACTER_ERR=5;g.NO_DATA_ALLOWED_ERR=6;g.NO_MODIFICATION_ALLOWED_ERR=7;g.NOT_FOUND_ERR=8;g.NOT_SUPPORTED_ERR=9;g.INUSE_ATTRIBUTE_ERR=10;g.INVALID_STATE_ERR=11;g.SYNTAX_ERR=12;g.INVALID_MODIFICATION_ERR=13;g.NAMESPACE_ERR=14;g.INVALID_ACCESS_ERR=15;g.VALIDATION_ERR=16;g.TYPE_MISMATCH_ERR=17;var i=function(j,k){this._getText=j;this._setText=k;this.valueOf=j;this.toString=j;this.length={internal:this,valueOf:function(){return this.internal._getTokens().length},toString:function(){return String(this.valueOf())}}};i.prototype.xblDestroy=function(){this.valueOf=null;this.toString=null;this._getText=null;this._setText=null;this.length.internal=null;this.length.valueOf=null;this.length.toString=null;this.length=null};i.prototype.item=function(j){return this._getTokens()[j]};i.prototype.has=function(j){return(-1!=Array.indexOf(this._getTokens(),j))};i.prototype.add=function(j){var k=this._getTokens();if(!this.has(j)){var l=this._getText().replace(/\s*$/," "+j);this._setText(l)}};i.prototype.remove=function(j){if(this.has(j)){var l,k=this._getText();l=RegExp("\\s+"+j+"\\s+","g");k=k.replace(l," ");l=RegExp("^\\s*"+j+"\\s+");k=k.replace(l,"");l=RegExp("\\s+"+j+"\\s*$");k=k.replace(l,"");if(k==j){k=""}this._setText(k)}};i.prototype.toggle=function(j){if(this.has(j)){this.remove(j)}else{this.add(j)}};i.prototype._getTokens=function(){var m=this._getText();if(!m){return[]}var j=m.split(/\s+/);var k=j.sort();for(var l=k.length-1;l>0;l--){if(k[l]==k[l-1]){k.splice(l)}}return k};return{Node:f,Text:h,Document:d,Element:e,DOMException:g,DOMTokenList:i}})();Meeko.XPL.Namespace.enhance(window,Meeko.DOM.Core)};Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM.xhtml"].requiredContexts.push("lib/Meeko/DOM/Events.xhtml");Meeko.stuff.xplSystem.createContext("lib/Meeko/DOM/Events.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Events.xhtml"].requiredContexts.push("lib/Meeko/Javascript-1.6/Javascript.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Events.xhtml"].requiredContexts.push("lib/Meeko/DOM/System.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Events.xhtml"].requiredContexts.push("lib/Meeko/DOM/Core.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Events.xhtml"].wrappedScript=function(){var c=Meeko.stuff.xplSystem;var b=c.contexts["lib/Meeko/DOM/Events.xhtml"];var a=b.logger;Meeko.stuff.xplSystem.createNamespace("Meeko.DOM.Events");Meeko.DOM.Events=(function(){var l=Math.random();var Q=[{type:"DOMActivate",bubbles:true,cancelable:true,module:"UIEvent"},{type:"DOMFocusIn",bubbles:true,cancelable:false,module:"UIEvent"},{type:"DOMFocusOut",bubbles:true,cancelable:false,module:"UIEvent"},{type:"focus",bubbles:false,cancelable:false,module:"UIEvent"},{type:"blur",bubbles:false,cancelable:false,module:"UIEvent"},{type:"textInput",bubbles:true,cancelable:true,module:"TextEvent"},{type:"click",bubbles:true,cancelable:true,module:"MouseEvent"},{type:"dblclick",bubbles:true,cancelable:true,module:"MouseEvent"},{type:"mousedown",bubbles:true,cancelable:true,module:"MouseEvent"},{type:"mouseup",bubbles:true,cancelable:true,module:"MouseEvent"},{type:"mouseover",bubbles:true,cancelable:true,module:"MouseEvent"},{type:"mousemove",bubbles:true,cancelable:true,module:"MouseEvent"},{type:"mouseout",bubbles:true,cancelable:true,module:"MouseEvent"},{type:"keydown",bubbles:true,cancelable:true,module:"KeyboardEvent"},{type:"keyup",bubbles:true,cancelable:true,module:"KeyboardEvent"},{type:"mousemultiwheel",bubbles:true,cancelable:true,module:"MouseMultiWheelEvent"},{type:"mousewheel",bubbles:true,cancelable:true,module:"MouseWheelEvent"},{type:"DOMSubtreeModified",bubbles:true,cancelable:false,module:"MutationEvent"},{type:"DOMNodeInserted",bubbles:true,cancelable:false,module:"MutationEvent"},{type:"DOMNodeRemoved",bubbles:true,cancelable:false,module:"MutationEvent"},{type:"DOMNodeRemovedFromDocument",bubbles:false,cancelable:false,module:"MutationEvent"},{type:"DOMNodeInsertedIntoDocument",bubbles:false,cancelable:false,module:"MutationEvent"},{type:"DOMAttrModified",bubbles:true,cancelable:false,module:"MutationEvent"},{type:"DOMCharacterDataModified",bubbles:true,cancelable:false,module:"MutationEvent"},{type:"DOMElementNameChanged",bubbles:true,cancelable:false,module:"MutationNameEvent"},{type:"DOMAttributeNameChanged",bubbles:true,cancelable:false,module:"MutationNameEvent"},{type:"load",bubbles:false,cancelable:false,module:"Event"},{type:"unload",bubbles:false,cancelable:false,module:"Event"},{type:"abort",bubbles:true,cancelable:false,module:"Event"},{type:"error",bubbles:true,cancelable:false,module:"Event"},{type:"select",bubbles:true,cancelable:false,module:"Event"},{type:"change",bubbles:true,cancelable:false,module:"Event"},{type:"submit",bubbles:true,cancelable:true,module:"Event"},{type:"reset",bubbles:true,cancelable:true,module:"Event"},{type:"resize",bubbles:true,cancelable:false,module:"UIEvent"},{type:"scroll",bubbles:true,cancelable:false,module:"UIEvent"},{type:"keypress",bubbles:true,cancelable:true,module:"KeyboardEvent"},{type:"DOMContentLoaded",bubbles:true,cancelable:false,module:"Event"}];var P={};for(var I=0,G=Q.length;I<G;I++){var s=Q[I];var R=s.type;P[R]=s}var O={};for(var I=0,G=Q.length;I<G;I++){var s=Q[I];var R=s.type;var e=s.module;if(!O[e]){O[e]={}}O[e][R]=s}var K={"U+007F":46,"U+0008":8,"U+001B":27,Down:40,End:35,Enter:13,Home:36,Insert:45,Left:37,PageUp:33,PageDown:34,Right:39,Up:38,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123};var w={};for(var r in K){var g=K[r];w[g]=r}var q="0123456789ABCDEF".split(/\s*/);for(var I=0;I<=15;I++){for(var H=0;H<=15;H++){var D=""+q[I]+q[H];var g=Number("0x"+D);var r="U+00"+D;if(!w[g]){w[g]=r}}}var v=(/AppleWebKit/.test(navigator.userAgent))?Number(navigator.userAgent.match(/AppleWebKit\/([0-9]+\.[0-9]+)/)[1]):null;var F;if(v&&v<500){F=Object.copy({},K);delete F["U+0008"]}var x=function(){};x.DEFAULT_PREVENTED=1;x.PROPAGATION_STOPPED=2;x.FAKE_EVENT=4;x.COMPATIBILITY_EVENT=8;x.FIXED_WINDOW_CAPTURING=16;x.FIXED_WINDOW_BUBBLING=16;var M=function(){var j=this;this.registeredEvents={};this.keyEventHistory=[];if(window.addEventListener){for(var i in M.handlers){(function(T,S,n){window.addEventListener(S,function(U){n[S].call(T,U)},true)})(this,i,M.handlers)}for(var i in {DOMContentLoaded:true,load:true}){(function(T,S,n){document.addEventListener(S,function(U){n[S].call(T,U)},true);document.addEventListener(S,function(U){n[S].call(T,U)},false)})(this,i,M.handlers)}}};M.prototype.handleEvent=function(i,T){var S=T||i.currentTarget;var n=d(S);var j=(n)?n.handleEvent(i):null;a.debug((i.eventStatus&x.FAKE_EVENT?"Compatibility":"Browser")+" "+i.type+" event received"+(S==window?" on window":"")+" during "+(i.eventPhase==1?"capture":"bubbling")+" phase"+(n?" and forwarded":""));return j};var f=["type","keyCode","charCode","keyIdentifier"];M.handlers={load:function(i){if(i.eventStatus&x.FAKE_EVENT){if(i.eventPhase==1){if(!(i.eventStatus&x.FIXED_WINDOW_CAPTURING)){this.handleEvent(i,window);i.eventStatus|=x.FIXED_WINDOW_CAPTURING}var j=i.currentTarget||window;if(j!=window){this.handleEvent(i,j)}}else{var j=i.currentTarget||window;if(j!=window){this.handleEvent(i,j)}if(!(i.eventStatus&x.FIXED_WINDOW_BUBBING)){this.handleEvent(i,window);i.eventStatus|=x.FIXED_WINDOW_BUBBLING}}}else{a.debug("Browser load event received and blocked.");i.stopPropagation()}return false},DOMContentLoaded:function(i){if(i.eventStatus&x.FAKE_EVENT){var j=i.currentTarget||window;this.handleEvent(i,j)}else{a.debug("Browser DOMContentLoaded event received and blocked.");i.stopPropagation()}return false},keydown:function(j){var U=j.currentTarget||window;var X;if(j.keyIdentifier){X=j.keyIdentifier}else{X=w[j.keyCode||j.charCode];j.keyIdentifier=X}var T=this.keyEventHistory;var W=T.length;var i=(W)?T[W-1]:null;var S=0;var V=1;if(F&&X in F){S=-0.5;V=0.5}if(i&&i.type=="keydown"){S=i.repeat+V}else{if(i&&i.type=="keypress"){S=i.repeat+V}}j.repeat=S;T.push(Object.copy({type:"keydown",repeat:S},j,f));if(j.eventStatus&x.DEFAULT_PREVENTED){j.preventDefault()}if(S%1){j.stopPropagation()}else{this.handleEvent(j,U)}},keypress:function(j){j.stopPropagation();var X;if(j.keyIdentifier){X=j.keyIdentifier}else{X=w[j.charCode];j.keyIdentifier=X}var U=this.keyEventHistory;var W=U.length;var i=(W)?U[W-1]:null;var T=0;var V=1;if(F&&X in F){T=-0.5;V=0.5}if(i&&i.type=="keydown"){T=i.repeat}else{if(i&&i.type=="keypress"){T=i.repeat+V}}if(!(i&&i.type=="keydown")){var S=document.createEvent("KeyboardEvent");S.initKeyboardEvent("keydown",true,true,window,X,0,"");S.eventStatus=1|4|8;j.target.dispatchEvent(S)}U.push(Object.copy({type:"keypress",repeat:T},j,f));if(j.charCode&&!(j.metaKey||j.altKey||j.ctrlKey)){if(!v||v<500){var S=document.createEvent("TextEvent");S.initTextEvent("textInput",true,true,window,String.fromCharCode(j.charCode));j.target.dispatchEvent(S);if(S.eventStatus&x.DEFAULT_PREVENTED){j.preventDefault()}}}},textInput:function(j){var T=j.currentTarget||window;var S=this.keyEventHistory;var U=S.length;var i=(U)?S[U-1]:null;if(i&&i.type=="keydown"){this.handleEvent(j,T);S.push(Object.copy({type:"textInput"},j,f))}},keyup:function(j){var T=j.currentTarget||window;var V;if(j.keyIdentifier){V=j.keyIdentifier}else{V=w[j.keyCode];j.keyIdentifier=V}var S=this.keyEventHistory;var U=S.length;var i=S[U-1];if(i&&(i.type!="keyup"||i.keyIdentifier!=V)){S.push(Object.copy({type:"keyup"},j,f));this.handleEvent(j,T)}},DOMMouseScroll:function(V){V.stopPropagation();var W=document.createEvent("MouseWheelEvent");var j=["type","bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","wheelDelta"];var X=j.length;var S=[];S[0]="mousewheel";for(var U=1;U<X-1;U++){var T=j[U];S[U]=V[T]}S[X-1]=-40*V.detail;W.initMouseWheelEvent.apply(W,S);return V.target.dispatchEvent(W)}};var N=new M;M.prototype.registerEvent=function(j){if(this.registeredEvents[j]){return}var n=function(U){var T=document.createEvent("Event");T.initEvent(U.type,U.bubbles,U.cancelable);Object.copy(T,U);N.dispatchEvent(U.srcElement,T);return T.returnValue};var i={DOMAttrModified:function(){},DOMActivate:{type:"activate",bubbles:true,cancelable:true},DOMFocusIn:{type:"focusin",bubbles:true,cancelable:false},DOMFocusOut:{type:"focusout",bubbles:true,cancelable:false},keydown:function(){document.attachEvent("onkeydown",function(U){var T=document.createEvent("UIEvent");T.initEvent("keydown",true,true);T.keyCode=U.keyCode;T.keyIdentifier=w[U.keyCode];T.returnValue=N.dispatchEvent(U.srcElement,T);return T.returnValue})},keyup:function(){document.attachEvent("onkeyup",function(U){var T=document.createEvent("UIEvent");T.initEvent("keyup",true,true);T.keyCode=U.keyCode;T.keyIdentifier=w[U.keyCode];T.returnValue=N.dispatchEvent(U.srcElement,T);return T.returnValue})},textInput:function(){document.attachEvent("onkeypress",function(U){var T=document.createEvent("UIEvent");T.initEvent("textInput",true,true);T.data=String.fromCharCode(U.keyCode);U.returnValue=N.dispatchEvent(U.srcElement,T)})},focus:function(){document.attachEvent("onfocusin",function(U){var T=document.createEvent("UIEvent");T.initEvent("focus",false,false);U.returnValue=N.dispatchEvent(U.srcElement,T)})},blur:function(){document.attachEvent("onfocusout",function(U){var T=document.createEvent("UIEvent");T.initEvent("blur",false,false);U.returnValue=N.dispatchEvent(U.srcElement,T)})},mouseover:function(){document.attachEvent("onmouseover",function(U){var T=document.createEvent("MouseEvent");y.copyMouseEvent(T,U);T.relatedTarget=U.fromElement;U.returnValue=N.dispatchEvent(U.srcElement,T);T.relatedTarget=null})},mouseout:function(){document.attachEvent("onmouseout",function(U){var T=document.createEvent("MouseEvent");y.copyMouseEvent(T,U);T.relatedTarget=U.toElement;U.returnValue=N.dispatchEvent(U.srcElement,T);T.relatedTarget=null})},click:function(){document.attachEvent("onclick",function(U){var T=document.createEvent("MouseEvent");y.copyMouseEvent(T,U);T.button=([null,0,2,null,1])[U.button];T.detail=1;U.returnValue=N.dispatchEvent(U.srcElement,T)})},dblclick:function(){document.attachEvent("ondblclick",function(U){var T=document.createEvent("MouseEvent");y.copyMouseEvent(T,U);T.button=([null,0,2,null,1])[U.button];T.detail=2;U.returnValue=N.dispatchEvent(U.srcElement,T)})},mousewheel:function(){document.attachEvent("onmousewheel",function(U){var T=document.createEvent("MouseWheelEvent");h.copyMouseWheelEvent(T,U);U.returnValue=N.dispatchEvent(U.srcElement,T)})}};var S=i[j]||{type:j,bubbles:true,cancelable:true};if(typeof S=="function"){S()}else{document.attachEvent("on"+S.type,n)}this.registeredEvents[j]=true};M.prototype.dispatchEvent=function(j,i){this._dispatchEvent(j,i);i.currentTarget=null;i.target=null;return i.returnValue};M.prototype._dispatchEvent=function(W,T){T.target=W;var V=[];var U=W;if(W!=window){for(U=W;U!=document;U=U.parentNode){V.push(U)}V.push(document)}V.push(window);function j(Y,i){i.currentTarget=Y;var n=d(Y);if(n){n.handleEvent(i)}}T.eventPhase=E.CAPTURING_PHASE;for(var X=V.length,S=X-1;S>0;S--){j(V[S],T);if(T.cancelBubble){return T.returnValue}}T.eventPhase=E.AT_TARGET;j(V[0],T);if(T.cancelBubble){return T.returnValue}if(!T.bubbles){return T.returnValue}T.eventPhase=E.BUBBLING_PHASE;for(var X=V.length,S=1;S<X;S++){j(V[S],T);if(T.cancelBubble){return T.returnValue}}return T.returnValue};var E=function(i){if(i!=l){throw"Event is not a constructor"}};E.CAPTURING_PHASE=1;E.AT_TARGET=2;E.BUBBLING_PHASE=3;E.prototype.initEvent=function(n,j,i){this.eventStatus=0;this.timeStamp=Number(new Date);this.type=n;this.bubbles=Boolean(j);this.cancelable=Boolean(i)};E.prototype.preventDefault=function(){this.eventStatus|=x.DEFAULT_PREVENTED};E.prototype.stopPropagation=function(){this.eventStatus|=x.PROPAGATION_STOPPED};var J=function(i){if(i!=l){throw"CustomEvent is not a constructor"}};J.prototype=new E(l);J.prototype.initCustomEvent=function(S,j,i,n){this.initEvent(S,j,i);this.detail=n};var B=function(i){if(i!=l){throw"UIEvent is not a constructor"}};B.prototype=new E(l);B.prototype.initUIEvent=function(T,n,j,i,S){this.initEvent(T,n,j);this.view=i;this.detail=S};var z=function(i){if(i!=l){throw"TextEvent is not a constructor"}};z.prototype=new B(l);z.DOM_KEY_LOCATION_STANDARD=0;z.DOM_KEY_LOCATION_LEFT=1;z.DOM_KEY_LOCATION_RIGHT=2;z.DOM_KEY_LOCATION_NUMPAD=3;z.prototype.initTextEvent=function(S,n,j,i,T){this.initUIEvent(S,n,j,i,0);this.data=T};var C=function(i){if(i!=l){throw"KeyboardEvent is not a constructor"}};C.prototype=new B(l);C.DOM_KEY_LOCATION_STANDARD=0;C.DOM_KEY_LOCATION_LEFT=1;C.DOM_KEY_LOCATION_RIGHT=2;C.DOM_KEY_LOCATION_NUMPAD=3;C.prototype.initKeyboardEvent=function(Y,U,j,Z,V,W,X){this.initUIEvent(Y,U,j,Z,0);this.keyIdentifier=V;this.keyLocation=W;this._modifiers=X.split(" ");for(var S=this._modifiers.length,T=0;T<S;T++){switch(this._modifiers[T]){case"Alt":this.altKey=true;break;case"Control":this.ctrlKey=true;break;case"Meta":this.metaKey=true;break;case"Shift":this.shiftKey=true;break}}};C.prototype.getModifierState=function(S){for(var T=this._modifiers.length,j=0;j<T;j++){if(S==this._modifiers[j]){return true}}return false};var y=function(i){if(i!=l){throw"MouseEvent is not a constructor"}};y.prototype=new B(l);y.initArgs=["type","bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget"];y.copyMouseEvent=function(X,j){var Z=y.initArgs;var U=Z.length;var W=(null!=j.bubbles)?j.bubbles:"true";var T=(null!=j.cancelable)?j.cancelable:"true";var Y=(null!=j.view)?j.view:window;X.initUIEvent(j.type,W,T,Y,j.detail);for(var V=5;V<U;V++){var S=Z[V];X[S]=j[S]}};y.prototype.initMouseEvent=function(W,Y,ah,aa,ag,j,aj,ad,ac,U,T,ab,V,S,X){var Z=y.initArgs;var ae=Z.length;if(arguments.length<ae){throw"Improper argument list in call to initMouseEvent"}this.initUIEvent(W,Y,ah,aa,ag);for(var af=5;af<ae;af++){var ai=Z[af];this[ai]=arguments[af]}};var h=function(i){if(i!=l){throw"MouseWheelEvent is not a constructor"}};h.initArgs=["type","bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","wheelDelta"];h.copyMouseWheelEvent=function(X,j){var Z=h.initArgs;var U=Z.length;var W=(null!=j.bubbles)?j.bubbles:"true";var T=(null!=j.cancelable)?j.cancelable:"true";var Y=(null!=j.view)?j.view:window;X.initUIEvent(j.type,W,T,Y,j.detail);for(var V=5;V<U;V++){var S=Z[V];X[S]=j[S]}};h.prototype=new y(l);h.prototype.initMouseWheelEvent=function(X,Z,ai,ab,ah,j,ak,ae,ad,V,U,ac,W,S,Y,T){var aa=h.initArgs;var af=aa.length;if(arguments.length<af){throw"Improper argument list in call to initMouseWheelEvent"}this.initUIEvent(X,Z,ai,ab,ah);for(var ag=5;ag<af;ag++){var aj=aa[ag];this[aj]=arguments[ag]}};var o=function(i){if(i!=l){throw"MutationEvent is not a constructor"}};o.MODIFICATION=1;o.ADDITION=2;o.REMOVAL=3;o.prototype=new E(l);o.prototype.initMutationEvent=function(W,T,S){var j=["type","bubbles","cancelable","relatedNode","prevValue","newValue","attrName","attrChange"];var X=j.length;this.initEvent(W,T,S);for(var V=3;V<X;V++){var U=j[V];this[U]=arguments[V]}};var u={Event:new E(l),CustomEvent:new J(l),UIEvent:new B(l),TextEvent:new z(l),KeyboardEvent:new C(l),MouseEvent:new y(l),MouseWheelEvent:new h(l),MutationEvent:new o(l)};var k={Events:"Event",HTMLEvents:"Event",UIEvents:"UIEvent",MouseEvents:"MouseEvent",MutationEvents:"MutationEvent"};var p=function(){};if(document.createEvent){p.prototype.createEvent=function(W){var j=k[W]||W;var V=u[j];if(!V){throw"Invalid event module: "+W}var X;var T=[j,W,"Event","HTMLEvents"];for(var Y=T.length,U=0;U<Y;U++){try{X=document._createEvent(T[U])}catch(S){}if(X){break}}if(!X){throw"Could not create event in "+W}Object.copy(X,V);X.eventStatus|=x.FAKE_EVENT;X._preventDefault=X.preventDefault;X._stopPropagation=X.stopPropagation;X.preventDefault=function(){E.prototype.preventDefault.call(this);this._preventDefault()};X.stopPropagation=function(){E.prototype.stopPropagation.call(this);this._stopPropagation()};return X};var m=false;forEach(O,function(S,j){try{var n=document.createEvent(j);if(!n["init"+j]){m=true}}catch(i){m=true}});if(m){document._createEvent=document.createEvent;document.createEvent=p.prototype.createEvent}}else{if(document.createEventObject){p.prototype.createEvent=function(n){var i=k[n]||n;var j=u[i];if(!j){throw"Invalid event module: "+n}var S={};Object.copy(S,j);S.eventStatus|=x.FAKE_EVENT;S.preventDefault=function(){E.prototype.preventDefault.call(this);this.returnValue=false};S.stopPropagation=function(){E.prototype.stopPropagation.call(this);this.cancelBubble=true};return S};document.createEvent=p.prototype.createEvent}}var t=function(j,i){this.target=j;this.eventSystem=i;this.listenerTable={}};t.prototype.xblDestroy=function(i){this.target=null;this.eventSystem=null;this.listenerTable=null};t.prototype.handleEvent=function(W){var j=(W.eventPhase==E.CAPTURING_PHASE)?1:0;var V=this.listenerTable[W.type];if(!V){return}var U=V[j];for(var Y=U.length,T=0;T<Y;T++){var X=U[T];try{if(X.handleEvent){return X.handleEvent(W)}else{return X(W)}}catch(S){a.error("Error in event listener: "+S);return}}};t.prototype.addEventListener=function(n,S,i){if(!this.listenerTable[n]){this.listenerTable[n]=[[],[]]}var j=(i)?1:0;this.listenerTable[n][j].push(S)};t.prototype.removeEventListener=function(U,V,j){var n=(j)?1:0;var T=this.listenerTable[U][n];for(var S=T.length-1;S>=0;S--){if(T[S]==V){T.splice(S,1);break}}};t.prototype.hasEventListener=function(V,W,j){if(null==W){var T=this.listenerTable[V];if(!(T&&(T[0]&&T[0].length||T[1]&&T[1].length))){return false}}var n=(j)?1:0;var U=this.listenerTable[V][n];for(var S=U.length-1;S>=0;S--){if(U[S]==W){return true}}return false};t.prototype.dispatchEvent=function(i){return this.eventSystem.dispatchEvent(this.target,i)};var d=function(i){if(null==i){return null}if(this==window){return arguments.callee.getInterface(i)}else{arguments.callee.prototype.xblCreate.call(this,i)}};d.interfaceLookup=new Array(13);d.getInterface=function(n){var i=(n==window)?0:n.nodeType;var j=this.interfaceLookup[i];return(j)?j(n):null};d.methods=["addEventListener","removeEventListener","dispatchEvent"];d.prototype.xblCreate=function(n){this.target=n;var i=d.methods;Meeko.stuff.domSystem.hideInterface(n,i);Meeko.stuff.domSystem.bindInterface(n,this,i,true);this.baseBinding=new t(n,N);var j=this;this.eventListener=function(S){j.handleEvent(S)}};d.prototype.xblDestroy=function(j){this.target=null;this.eventListener=null;this.baseBinding.xblDestroy(j);var i=d.methods;Meeko.stuff.domSystem.releaseInterface(j,this,i,true);Meeko.stuff.domSystem.restoreInterface(j,i)};d.prototype.handleEvent=function(i){this.baseBinding.handleEvent(i)};if(window.addEventListener){d.interfaceLookup[0]=Meeko.stuff.domSystem.addImplementation("Window",d);d.interfaceLookup[Node.DOCUMENT_NODE]=Meeko.stuff.domSystem.addImplementation("Document",d);d.prototype.addEventListener=function(j,n,i){if(!this.baseBinding.hasEventListener(j,null,i)){if(!M.handlers[j]){this.target._addEventListener(j,this.eventListener,i)}}this.baseBinding.addEventListener(j,n,i)};d.prototype.removeEventListener=function(j,n,i){this.baseBinding.removeEventListener(j,n,i);if(!this.baseBinding.hasEventListener(j,null,i)){if(!M.handlers[j]){this.target._removeEventListener(j,this.eventListener,i)}}};d.prototype.dispatchEvent=function(i){if(this.target._dispatchEvent){this.target._dispatchEvent(i)}else{document.dispatchEvent(i)}}}else{if(window.attachEvent){d.interfaceLookup[0]=Meeko.stuff.domSystem.addImplementation("Window",d);d.interfaceLookup[Node.DOCUMENT_NODE]=Meeko.stuff.domSystem.addImplementation("Document",d);d.interfaceLookup[Node.ELEMENT_NODE]=Meeko.stuff.domSystem.addImplementation("Element",d);d.prototype._xblCreate=d.prototype.xblCreate;d.prototype.xblCreate=function(n){this._xblCreate(n);if(n.nodeType!=Node.ELEMENT_NODE){return}this.onattrmodified=function(Z){var ac=eventTarget.target;var X=Z.propertyName;var ab=ac[X];switch(typeof ab){case"string":case"number":case"boolean":case"undefined":break;case"object":if(null===ab){break}default:return}var aa=this.prevValues[X];this.prevValues[X]=ab;var W=(ab!=null)?((aa!=null)?1:2):3;var Y=document.createEvent("MutationEvent");Y.initMutationEvent("DOMAttrModified",true,false,null,aa,ab,X,W);Y.target=ac;Y.eventPhase=2;Y.currentTarget=ac;eventTarget.handleEvent(Y);Y.currentTarget=null;Y.target=null};this.prevValues={};var V=this.target.cloneNode(false);var T=V.outerHTML.replace(/^\S+/,"");var U=/\s+([-_a-zA-Z0-9]+)=(?:"([^"]*)"|'([^']*)'|([^\s>]+))(\>)?/g;RegExp.lastIndex=0;var i;while(i=U.exec(T)){var j=i[1];var S=i[2];if(""==S){S=i[3]}if(""==S){S=i[4]}this.prevValues[j]=S;if(">"==i[5]){break}}};d.prototype.addEventListener=function(j,n,i){if(!this.baseBinding.hasEventListener(j)){N.registerEvent(j);if(j=="DOMAttrModified"){this.target.attachEvent("onpropertychange",this.onattrmodified)}}this.baseBinding.addEventListener(j,n,i)};d.prototype.removeEventListener=function(j,n,i){this.baseBinding.removeEventListener(j,n,i);if(j=="DOMAttrModified"&&!this.baseBinding.hasEventListener(j)){this.target.detachEvent("onpropertychange",this.onattrmodified)}};d.prototype.dispatchEvent=function(i){N.dispatchEvent(this.target,i)}}else{throw"EventTarget only implemented with addEventListener of attachEvent"}}if(!document.addEventListener&&document.attachEvent){var A=function(i){if(null==i){return null}if(this==window){return arguments.callee.getInterface(i)}else{arguments.callee.prototype.xblCreate.call(this,i)}};A.interfaceLookup=new Array(13);A.interfaceLookup[Node.DOCUMENT_NODE]=Meeko.stuff.domSystem.addImplementation("Document",A);A.interfaceLookup[Node.ELEMENT_NODE]=Meeko.stuff.domSystem.addImplementation("Element",A);A.getInterface=function(n){var i=(n==window)?0:n.nodeType;var j=this.interfaceLookup[i];return(j)?j(n):null};A.methods=["insertBefore","replaceChild","removeChild","appendChild","cloneNode"];A.prototype.xblCreate=function(i){var j=this;this.boundElement=i;Meeko.stuff.domSystem.hideInterface(i,A.methods);Meeko.stuff.domSystem.bindInterface(i,this,A.methods,true);this.domMutation_listener=function(n){j.onpropertychange(n)};i.attachEvent("onpropertychange",this.domMutation_listener)};A.prototype.xblDestroy=function(){var i=this.boundElement;i.detachEvent("onpropertychange",this.domMutation_listener);Meeko.stuff.domSystem.releaseInterface(i,this,A.methods,true);Meeko.stuff.domSystem.restoreInterface(i,A.methods)};A.prototype.cloneNode=function(Y){var W=this.boundElement;var S={thead:["table"],tbody:["table"],tfoot:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table"],td:["table","tr"],option:["select"],li:["ul"]};var aa=S[W.tagName.toLowerCase()];var Z=document.createElement("div");var T="",U="";for(var j=aa.length,V=0;V<j;V++){T+="<"+aa[V]+">"}for(var V=aa.length-1;V>=0;V--){U+="</"+aa[V]+">"}Z.innerHTML=T+(Y?W.outerHTML:W.cloneNode(false).outerHTML)+U;var X=Z.firstChild;for(var V=0;V<aa.length;V++){X=X.firstChild}X.parentNode.removeChild(X);return X};A.prototype.onpropertychange=function(n){if(n.propertyName=="innerHTML"){var i=this.boundElement;for(var j=i.firstChild;j;j=j.nextSibling){if(Node.ELEMENT_NODE!=j.nodeType){continue}if(j._Element){continue}this.notify("DOMNodeInserted",j,i)}}};A.prototype.insertBefore=function(n,j){var i=this.boundElement._insertBefore(n,j);this.notify("DOMNodeInserted",n,this.boundElement);return i};A.prototype.replaceChild=function(n,j){this.notify("DOMNodeRemoved",j,this.boundElement);var i=this.boundElement._replaceChild(n,j);this.notify("DOMNodeInserted",n,this.boundElement);return i};A.prototype.removeChild=function(j){var n=this.boundElement;this.notify("DOMNodeRemoved",j,this.boundElement);var i=n._removeChild(j);return i};A.prototype.appendChild=function(j){var i=this.boundElement._appendChild(j);this.notify("DOMNodeInserted",j,this.boundElement);return i};A.prototype.notify=function(i,n){if(!document.documentElement.contains(n)){return}var j=document.createEvent("MutationEvent");j.initMutationEvent(i,true,false,this.boundElement);N.dispatchEvent(n,j)}}if(!document.addEventListener&&document.attachEvent){var L=function(i){if(null==i){return null}if(this==window){return arguments.callee.getInterface(i)}else{arguments.callee.prototype.xblCreate.call(this,i)}};L.getInterface=Meeko.stuff.domSystem.addImplementation("HTMLFormElement",L);L.xblRequired=function(i){return true};L.prototype.xblCreate=function(j){this.target=j;var i=this;this.eventBubbler_listener=function(S){var n=document.createEvent("Event");n.initEvent(S.type,true,true);return N.dispatchEvent(S.srcElement,n)};j.attachEvent("onsubmit",this.eventBubbler_listener);j.attachEvent("onreset",this.eventBubbler_listener)};L.prototype.xblDestroy=function(i){i.detachEvent("onsubmit",this.eventBubbler_listener);i.detachEvent("onreset",this.eventBubbler_listener);this.eventBubbler_listener=null;this.target=null}}Meeko.stuff.eventSystem=N;return{Event:E,CustomEvent:J,UIEvent:B,TextEvent:z,KeyboardEvent:C,MouseEvent:y,MutationEvent:o}})();Meeko.XPL.Namespace.enhance(window,Meeko.DOM.Events)};Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM.xhtml"].requiredContexts.push("lib/Meeko/DOM/Traversal.xhtml");Meeko.stuff.xplSystem.createContext("lib/Meeko/DOM/Traversal.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Traversal.xhtml"].requiredContexts.push("lib/Meeko/Javascript-1.6/Javascript.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Traversal.xhtml"].requiredContexts.push("lib/Meeko/DOM/System.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Traversal.xhtml"].requiredContexts.push("lib/Meeko/DOM/Core.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Traversal.xhtml"].wrappedScript=function(){var e=Meeko.stuff.xplSystem;var d=e.contexts["lib/Meeko/DOM/Traversal.xhtml"];var c=d.logger;Meeko.stuff.xplSystem.createNamespace("Meeko.DOM.Traversal");Meeko.DOM.Traversal=(function(){var f=Math.random();var j=function(){};j.FILTER_ACCEPT=1;j.FILTER_REJECT=2;j.FILTER_SKIP=3;j.SHOW_ALL=4294967295;j.SHOW_ELEMENT=1;j.SHOW_ATTRIBUTE=2;j.SHOW_TEXT=4;j.SHOW_CDATA_SECTION=8;j.SHOW_ENTITY_REFERENCE=16;j.SHOW_ENTITY=32;j.SHOW_PROCESSING_INSTRUCTION=64;j.SHOW_COMMENT=128;j.SHOW_DOCUMENT=256;j.SHOW_DOCUMENT_TYPE=512;j.SHOW_DOCUMENT_FRAGMENT=1024;j.SHOW_NOTATION=2048;var g=function(k){if(k!=f){throw"TreeWalker is not a constructor"}};g.prototype._init=function(){var k=["root","whatToShow","filter","expandEntityReferences"];var o=k.length;for(var m=0;m<o;m++){var l=k[m];this[l]=arguments[m]}if(Node.ATTRIBUTE_NODE==this.root.nodeType){this.root=null;throw"TreeWalker does not handle attributes"}if(this.filter&&"function"!=typeof this.filter.acceptNode){c.warn("filter parameter does not have valid acceptNode() for TreeWalker");this.filter=null}this.currentNode=this.root};g.prototype._acceptNode=function(k){if(1<<(k.nodeType-1)&this.whatToShow){return(this.filter)?this.filter.acceptNode(k):j.FILTER_ACCEPT}else{return j.FILTER_SKIP}};g.prototype.firstChild=function(){for(var k=this.currentNode.firstChild;k;k=k.nextSibling){var l=this._acceptNode(k);if(l==j.FILTER_ACCEPT){break}}if(k){this.currentNode=k}return k};g.prototype.lastChild=function(){for(var k=this.currentNode.lastChild;k;k=k.previousSibling){var l=this._acceptNode(k);if(l==j.FILTER_ACCEPT){break}}if(k){this.currentNode=k}return k};g.prototype.nextSibling=function(){for(var k=this.currentNode.nextSibling;k;k=k.nextSibling){var l=this._acceptNode(k);if(l==j.FILTER_ACCEPT){break}}if(k){this.currentNode=k}return k};g.prototype.previousSibling=function(){for(var k=this.currentNode.previousSibling;k;k=k.previousSibling){var l=this._acceptNode(k);if(l==j.FILTER_ACCEPT){break}}if(k){this.currentNode=k}return k};g.prototype.parentNode=function(){for(var k=this.currentNode.parentNode;k;k=k.parentNode){var l=this._acceptNode(k);if(l==j.FILTER_ACCEPT){break}if(k==this.root){return null}}if(k){this.currentNode=k}return k};g.prototype.nextNode=function(){var k=this.currentNode;var m=false;for(;;){if(!m&&k.firstChild){k=k.firstChild}else{for(;k;k=k.parentNode){if(k==this.root){return null}if(!k.nextSibling){continue}k=k.nextSibling;break}}m=false;var l=this._acceptNode(k);if(l==j.FILTER_ACCEPT){break}if(l==j.FILTER_SKIP){continue}if(l==j.FILTER_REJECT){m=true}}if(k){this.currentNode=k}return k};g.prototype.previousNode=function(){if(!this.root){throw"TreeWalker is not attached to DOM"}if(!this.currentNode){return null}var l=this.currentNode;for(;;){var m;if(k.previousSibling){var k=k.previousSibling;m=this._acceptNode(k);if(m==j.FILTER_REJECT){continue}if(k.lastChild){while(k.lastChild){k=k.lastChild}}}else{k=k.parentNode}m=this._acceptNode(k);if(m==j.FILTER_ACCEPT){break}if(k==this.root){return null}}if(k){this.currentNode=k}return k};g.forEach=function(k,m,l){if(!k.nextNode){throw"Object doesn't have TreeWalker interface"}var n;while(n=k.nextNode()){m.call(l,n)}};g.prototype.forEach=function(l,k){return g.forEach(this,l,k)};var i=function(k){if(k!=f){throw"NodeIterator is not a constructor"}};i.prototype._init=function(){var k=["root","whatToShow","filter","expandEntityReferences"];var o=k.length;for(var m=0;m<o;m++){var l=k[m];this[l]=arguments[m]}if(Node.ATTRIBUTE_NODE==this.root.nodeType){this.root=null;throw"NodeIterator does not handle attributes"}if(this.filter&&"function"!=typeof this.filter.acceptNode){c.warn("filter parameter does not have valid acceptNode() for NodeIterator");this.filter=null}this.currentNode=null};i.prototype.nextNode=function(){if(!this.root){throw"NodeIterator is not attached to DOM"}var l=(this.currentNode)?this.currentNode:this.root;function k(n){if(n.firstChild){return n.firstChild}for(;n!=this.root;n=n.parentNode){if(n.nextSibling){return n.nextSibling}}return null}do{if(!(1<<(l.nodeType-1)&this.whatToShow)){continue}if(this.filter){var m=this.filter.acceptNode(l);if(m==j.FILTER_ACCEPT){break}else{continue}}break}while(l=k.call(this,l));if(l){this.currentNode=l}return l};i.prototype.previousNode=function(){if(!this.root){throw"NodeIterator is not attached to DOM"}if(!this.currentNode){return null}var l=this.currentNode;function k(n){if(n==this.root){return null}if(n.previousSibling){n=n.previousSibling;while(n.lastChild){n=n.lastChild}return n}return(n.parentNode)}while(l=k.call(this,l)){if(!(1<<(next.nodeType-1)&this.whatToShow)){continue}if(this.filter){var m=this.filter.acceptNode(next);if(m==j.FILTER_ACCEPT){break}else{continue}}break}if(l){this.currentNode=l}return l};i.prototype.detach=function(){this.root=null};i.forEach=function(k,m,l){if(!k.nextNode){throw"Object doesn't have NodeIterator interface"}var n;while(n=k.nextNode()){m.call(l,n)}};i.prototype.forEach=function(l,k){return i.forEach(this,l,k)};var h={};h.createTreeWalker=function(){var k=new g(f);k._init.apply(k,arguments);return k};h.createNodeIterator=function(){var k=new i(f);k._init.apply(k,arguments);return k};return{NodeFilter:j,TreeWalker:g,NodeIterator:i,document:h}})();Meeko.XPL.Namespace.enhance(window,Meeko.DOM.Traversal);try{var a=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,false);if(!a.forEach){document.__createTreeWalker=document.createTreeWalker;document.createTreeWalker=function(g,j,h,i){var k=function(l){return arguments.callee.acceptNode(l)};Object.copy(k,h);var f=this.__createTreeWalker(g,j,k,i);f.forEach=TreeWalker.prototype.forEach;return f}}}catch(b){document.createTreeWalker=Meeko.DOM.Traversal.document.createTreeWalker}try{var a=document.createNodeIterator(document,NodeFilter.SHOW_ALL,null,false);if(!a.forEach){document.__createNodeIterator=document.createNodeIterator;document.createNodeIterator=function(g,j,h,i){var k=function(l){return arguments.callee.acceptNode(l)};Object.copy(k,h);var f=this.__createNodeIterator(g,j,k,i);f.forEach=NodeIterator.prototype.forEach;return f}}}catch(b){document.createNodeIterator=Meeko.DOM.Traversal.document.createNodeIterator}};Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM.xhtml"].requiredContexts.push("lib/Meeko/DOM/HTML.xhtml");Meeko.stuff.xplSystem.createContext("lib/Meeko/DOM/HTML.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/HTML.xhtml"].requiredContexts.push("lib/Meeko/Javascript-1.6/Javascript.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/HTML.xhtml"].requiredContexts.push("lib/Meeko/DOM/System.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/HTML.xhtml"].wrappedScript=function(){var c=Meeko.stuff.xplSystem;var b=c.contexts["lib/Meeko/DOM/HTML.xhtml"];var a=b.logger;Meeko.stuff.xplSystem.createNamespace("Meeko.DOM.HTML");Meeko.DOM.HTML=(function(){document.createElement("abbr");document.createElement("output");var e=function(){};var h=function(){};var d=function(){};var f=function(){};if(document.documentElement.classList==null){var g=function(i){if(null==i){return null}if(this==window){return null}else{arguments.callee.prototype.xblCreate.call(this,i)}};g.prototype.xblCreate=function(i){this.boundElement=i;this.getClassName=function(){return this.boundElement.className};this.setClassName=function(k){this.boundElement.className=k};var j=this;this.classList=new DOMTokenList(function(){return j.getClassName()},function(k){j.setClassName(k)});Meeko.stuff.domSystem.bindInterface(i,this,["classList"])};g.prototype.xblDestroy=function(i){this.boundElement.classList=null;this.classList.xblDestroy();this.boundElement=null};Meeko.stuff.domSystem.addImplementation("HTMLElement",g)}return{HTMLCollection:e,HTMLOptionsCollection:h,HTMLDocument:d,HTMLElement:f}})()};Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM.xhtml"].requiredContexts.push("lib/Meeko/DOM/Selectors.xhtml");Meeko.stuff.xplSystem.createContext("lib/Meeko/DOM/Selectors.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Selectors.xhtml"].requiredContexts.push("lib/Meeko/Javascript-1.6/Javascript.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Selectors.xhtml"].requiredContexts.push("lib/Meeko/CSS.xhtml");Meeko.stuff.xplSystem.createContext("lib/Meeko/CSS.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/CSS.xhtml"].requiredContexts.push("lib/Meeko/Javascript-1.6/Javascript.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/CSS.xhtml"].wrappedScript=function(){var xplSystem=Meeko.stuff.xplSystem;var xplContext=xplSystem.contexts["lib/Meeko/CSS.xhtml"];var logger=xplContext.logger;if(!this.Meeko){this.Meeko={}}Meeko.CSS=(function(){var Parser=function(){this.conditionFactory=_conditionFactory};Parser.prototype.parseSelectors=function(text){var selectorList=this._parseSelectors(text);Array.forEach(selectorList,function(selector){selector.__refresh()});return selectorList};Parser.prototype._parseSelectors=function(selectorText){var text=selectorText;var cf=this.conditionFactory;var selectorList=[];var selector=new Selector();var relSelector=new RelativeSelector();relSelector.relationType=RelativeSelector.DESCENDANT_RELATIVE;var ci=null;function mergeCondition(c){relSelector.addCondition(c)}var ns=null;var name=null;var state=0;do{var m=null;switch(state){case 0:m=/^\s*/.exec(text);if(m){state=1;text=text.substr(m[0].length);break}break;case 1:m=/^(\*|[a-zA-Z0-9_]+)(\|(\*|[a-zA-Z0-9_-]+))?/.exec(text);if(m){if(m[3]){ns=m[1];name=m[3]}else{ns=null;name=m[1]}ci=cf.createNodeTestCondition(name,ns);mergeCondition(ci);state=2;text=text.substr(m[0].length);break}case 2:m=/^#([a-zA-Z0-9_-]+)/.exec(text);if(m){ci=cf.createIdCondition(m[1]);mergeCondition(ci);state=2;text=text.substr(m[0].length);break}m=/^\.([a-zA-Z0-9_-]*)/.exec(text);if(m){ci=cf.createClassCondition(null,m[1]);mergeCondition(ci);state=2;text=text.substr(m[0].length);break}m=/^\[\s*([a-z0-9_-]+)(\|([a-z0-9_-]+))?\s*(([~|^$*]?=)\s*("([^"]*)"|'([^']*)'|(\S+))\s*)?\]/.exec(text);if(m){if(m[3]){ns=m[1];name=m[3]}else{ns=null;name=m[1]}if(m[4]){value=m[7]||m[8]||m[9];switch(m[5]){case"~=":ci=cf.createOneOfAttributeCondition(name,ns,true,value);break;case"|=":ci=cf.createBeginHyphenAttributeCondition(name,ns,true,value);break;case"^=":ci=cf.createStartsWithAttributeCondition(name,ns,true,value);break;case"$=":ci=cf.createEndsWithAttributeCondition(name,ns,true,value);break;case"*=":ci=cf.createContainsAttributeCondition(name,ns,true,value);break;case"=":ci=cf.createAttributeCondition(name,ns,true,value);break}}else{ci=cf.createAttributeCondition(name,ns,false,null)}mergeCondition(ci);state=2;text=text.substr(m[0].length);break}m=/^::([a-zA-Z_-]+)/.exec(text)||/^:(first-line)/.exec(text)||/^:(first-letter)/.exec(text)||/^:(before)/.exec(text)||/^:(after)/.exec(text);if(m){ci=cf.createPseudoElementCondition(m[1]);mergeCondition(ci);state=3;text=text.substr(m[0].length);break}m=/^:only-(child|of-type)/.exec(text);if(m){var same_type=("of-type"==m[1]);ci=(same_type)?cf.createOnlyTypeCondition():cf.createOnlyChildCondition();mergeCondition(ci);state=2;text=text.substr(m[0].length);break}m=/^:first-(child|of-type)/.exec(text);if(m){var same_type=("of-type"==m[1]);var a=0,b=0;ci=cf.createPositionalCondition([a,b],same_type,true);mergeCondition(ci);state=2;text=text.substr(m[0].length);break}m=/^:nth-(child|of-type)\(/.exec(text);if(m){var same_type=("of-type"==m[1]);text=text.substr(m[0].length);m=/^\s*(odd|even)\s*\)/.exec(text);var a=0,b=0;switch(m[1]){case"even":a=2;b=0;break;case"odd":a=2;b=1;break}ci=cf.createPositionalCondition([a,b],same_type,true);mergeCondition(ci);state=2;text=text.substr(m[0].length);break}m=/^:([a-zA-Z_-]+)/.exec(text);if(m){ci=cf.createPseudoClassCondition(null,m[1]);mergeCondition(ci);state=2;text=text.substr(m[0].length);break}case 3:m=/^\s*,/.exec(text);if(m){selector.addStep(relSelector);selectorList.push(selector);relSelector=new RelativeSelector();relSelector.relationType=RelativeSelector.DESCENDANT_RELATIVE;selector=new Selector();state=0;text=text.substr(m[0].length);break}case 4:m=/^\s*([\s>~+])/.exec(text);if(m){selector.addStep(relSelector);relSelector=new RelativeSelector();switch(m[1]){case">":relSelector.relationType=RelativeSelector.CHILD_RELATIVE;break;case"~":relSelector.relationType=RelativeSelector.INDIRECT_ADJACENT_RELATIVE;break;case"+":relSelector.relationType=RelativeSelector.DIRECT_ADJACENT_RELATIVE;break;default:relSelector.relationType=RelativeSelector.DESCENDANT_RELATIVE;break}state=0;text=text.substr(m[0].length);break}break}}while(text.length&&m);selector.addStep(relSelector);selectorList.push(selector);return selectorList};var SelectorList=function(){};SelectorList.prototype.addSelector=function(selector){this.push(selector)};SelectorList.prototype.test=function(element){var n=this.length;for(var i=0;i<n;i++){var selector=this[i];var rc=selector.test(element);if(rc){return true}}return false};var Selector=function(){this.steps=[];this.specificity=new Specificity()};Selector.prototype.__refresh=function(){this.specificity=Selector.__get_specificity(this)};Selector.__get_specificity=function(selector){var aCount=0,bCount=0,cCount=0;Array.forEach(selector.steps,function(step){Array.forEach(step.conditions,function(condition){switch(condition.conditionType){case Condition.NODE_TEST_CONDITION:if(1==condition.nodeType&&condition.localName&&"*"!=condition.localName){cCount++}break;case Condition.ID_CONDITION:aCount++;break;case Condition.PSEUDO_ELEMENT_CONDITION:break;default:bCount++;break}})});return new Specificity(aCount,bCount,cCount)};Selector.prototype.addStep=function(step){if(step instanceof RelativeSelector){this.steps.push(step)}else{throw"Error in Selector.addStep"}};Selector.prototype.test=function(element){var curElt=element;var rel=null;var n=this.steps.length;with(RelativeSelector){for(var i=n-1;i>=0;i--){var step=this.steps[i];do{var rc=step.test(curElt);switch(rel){default:if(!rc){return false}else{rel=null}break;case DESCENDANT_RELATIVE:if(!rc){if(9==curElt.parentNode){return false}curElt=curElt.parentNode;if(!curElt){return false}}else{rel=null}break;case CHILD_RELATIVE:if(!rc){return false}else{rel=null}break;case INDIRECT_ADJACENT_RELATIVE:if(!rc){curElt=curElt.previousSibling;if(!curElt){return false}}else{rel=null}break;case DIRECT_ADJACENT_RELATIVE:if(!rc){return false}else{rel=null}break}}while(rel);rel=step.relationType;switch(rel){default:break;case DESCENDANT_RELATIVE:case CHILD_RELATIVE:if(9==curElt.parentNode){return false}curElt=curElt.parentNode;if(!curElt){return false}break;case INDIRECT_ADJACENT_RELATIVE:case DIRECT_ADJACENT_RELATIVE:while(curElt=curElt.previousSibling){if(1==curElt.nodeType){break}}if(!curElt){return false}break}}}return true};var Specificity=function(a,b,c){this.aCount=a||0;this.bCount=b||0;this.cCount=c||0};Specificity.cmp=function(first,second){if(first.aCount>second.aCount){return 1}if(first.aCount<second.aCount){return -1}if(first.bCount>second.bCount){return 1}if(first.bCount<second.bCount){return -1}if(first.cCount>second.cCount){return 1}if(first.cCount<second.cCount){return -1}return 0};var RelativeSelector=function(){this.relationType=null;this.conditions=[]};RelativeSelector.NO_RELATIVE=0;RelativeSelector.DESCENDANT_RELATIVE=1;RelativeSelector.CHILD_RELATIVE=2;RelativeSelector.DIRECT_ADJACENT_RELATIVE=3;RelativeSelector.INDIRECT_ADJACENT_RELATIVE=4;RelativeSelector.prototype.addCondition=function(condition){if(condition instanceof Condition){this.conditions.push(condition)}else{throw"Error in RelativeSelector.addCondition"}};RelativeSelector.prototype.test=function(element){var n=this.conditions.length;for(var i=0;i<n;i++){var rc=this.conditions[i].test(element);if(!rc){return false}}return true};var Condition=function(){};Condition.NODE_TEST_CONDITION=1;Condition.ID_CONDITION=2;Condition.CLASS_CONDITION=3;Condition.PSEUDO_ELEMENT_CONDITION=4;Condition.ATTRIBUTE_CONDITION=5;Condition.ONE_OF_ATTRIBUTE_CONDITION=6;Condition.BEGIN_HYPHEN_ATTRIBUTE_CONDITION=7;Condition.STARTS_WITH_ATTRIBUTE_CONDITION=8;Condition.ENDS_WITH_ATTRIBUTE_CONDITION=9;Condition.CONTAINS_ATTRIBUTE_CONDITION=10;Condition.LANG_CONDITION=11;Condition.ONLY_CHILD_CONDITION=12;Condition.ONLY_TYPE_CONDITION=13;Condition.POSITIONAL_CONDITION=14;Condition.PSEUDO_CLASS_CONDITION=15;Condition.IS_ROOT_CONDITION=16;Condition.IS_EMPTY_CONDITION=17;Condition.prototype.test=function(element){var attrValue;switch(this.conditionType){case Condition.NODE_TEST_CONDITION:if(1!=this.nodeType){return false}if(!this.localName||"*"==this.localName){return true}if(element.tagName.toLowerCase()==this.localName.toLowerCase()){return true}return false;break;case Condition.ID_CONDITION:attrValue=element.getAttribute("id");if(attrValue==this.value){return true}return false;break;case Condition.CLASS_CONDITION:var rex=new RegExp(" "+this.value+" ");var attrValue=element.className;if(rex.test(" "+attrValue+" ")){return true}return false;break;case Condition.PSEUDO_CLASS_CONDITION:break;case Condition.PSEUDO_ELEMENT_CONDITION:break;case Condition.LANG_CONDITION:break;case Condition.ONLY_CHILD_CONDITION:break;case Condition.ONLY_TYPE_CONDITION:break;case Condition.POSITIONAL_CONDITION:break;case Condition.IS_ROOT_CONDITION:if(9==element.parentNode){return true}return false;break;case Condition.IS_EMPTY_CONDITION:if(0==element.childNodes.length){return true}return false;break;case Condition.ATTRIBUTE_CONDITION:if(!this.specified||null==this.value){return true}attrValue=element.getAttribute(this.localName);if(attrValue==this.value){return true}return false;break;case Condition.ONE_OF_ATTRIBUTE_CONDITION:var rex=new RegExp(" "+this.value+" ");attrValue=element.getAttribute(this.localName);if(rex.test(" "+attrValue+" ")){return true}return false;break;case Condition.BEGIN_HYPHEN_ATTRIBUTE_CONDITION:attrValue=element.getAttribute(this.localName);if(attrValue==this.value){return true}var rex=new RegExp("^"+this.value+"-");if(rex.test(" "+attrValue+" ")){return true}return false;break;case Condition.STARTS_WITH_ATTRIBUTE_CONDITION:var rex=new RegExp("^"+this.value);attrValue=element.getAttribute(this.localName);if(rex.test(attrValue)){return true}return false;break;case Condition.ENDS_WITH_ATTRIBUTE_CONDITION:var rex=new RegExp(this.value+"$");attrValue=element.getAttribute(this.localName);if(rex.test(attrValue)){return true}return false;break;case Condition.CONTAINS_ATTRIBUTE_CONDITION:var rex=new RegExp(this.value);attrValue=element.getAttribute(this.localName);if(rex.test(attrValue)){return true}return false;break}throw"Error in Condition.test()"};var _conditionFactory={createNodeTestCondition:function(name,ns){var c=new Condition();c.conditionType=Condition.NODE_TEST_CONDITION;c.nodeType=1;c.localName=name;c.namespaceURI=ns;return c},createIdCondition:function(value){var c=new Condition();c.conditionType=Condition.ID_CONDITION;c.value=value;return c},createClassCondition:function(ns,value){var c=new Condition();c.conditionType=Condition.CLASS_CONDITION;c.namespaceURI=ns;c.value=value;return c},createAttributeCondition:function(name,ns,specified,value,conditionType){var c=new Condition();c.conditionType=conditionType||Condition.ATTRIBUTE_CONDITION;c.localName=name;c.namespaceURI=ns;c.specified=specified;c.value=value;return c},createBeginHyphenAttributeCondition:function(name,ns,specified,value){return this.createAttributeCondition(name,ns,specified,value,Condition.BEGIN_HYPHEN_ATTRIBUTE_CONDITION)},createOneOfAttributeCondition:function(name,ns,specified,value){return this.createAttributeCondition(name,ns,specified,value,Condition.ONE_OF_ATTRIBUTE_CONDITION)},createStartsWithAttributeCondition:function(name,ns,specified,value){return this.createAttributeCondition(name,ns,specified,value,Condition.STARTS_WITH_ATTRIBUTE_CONDITION)},createEndsWithAttributeCondition:function(name,ns,specified,value){return this.createAttributeCondition(name,ns,specified,value,Condition.ENDS_WITH_ATTRIBUTE_CONDITION)},createContainsAttributeCondition:function(name,ns,specified,value){return this.createAttributeCondition(name,ns,specified,value,Condition.CONTAINS_ATTRIBUTE_CONDITION)},createOnlyChildCondition:function(){},createPositionalCondition:function(position,typeNode,type){},createPseudoClassCondition:function(ns,value){}};return{Parser:Parser,SelectorList:SelectorList,Selector:Selector,Specificity:Specificity,RelativeSelector:RelativeSelector,Condition:Condition}})()};Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Selectors.xhtml"].requiredContexts.push("lib/Meeko/DOM/System.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM/Selectors.xhtml"].wrappedScript=function(){var c=Meeko.stuff.xplSystem;var b=c.contexts["lib/Meeko/DOM/Selectors.xhtml"];var a=b.logger;Meeko.stuff.xplSystem.createNamespace("Meeko.DOM.Selectors");Meeko.DOM.Selectors=(function(){var f=function(k){if(!(this instanceof arguments.callee)){return new arguments.callee(k)}if(k){if(k.nodeType){this._target=k}else{throw"Target does not have NodeSelector interface"}}};f.querySelector=function(l,k){return f(l).querySelector(k)};f.querySelectorAll=function(l,k){return f(l).querySelectorAll(k)};f.prototype.querySelector=function(k){var l=this._target||this;if(null==k){return false}return i(l,k,true)};f.prototype.querySelectorAll=function(k){var l=this._target||this;if(null==k){return false}return i(l,k,false)};var e=function(k){if(!(this instanceof arguments.callee)){return new arguments.callee(k)}if(k){if(k.nodeType==Node.ELEMENT_NODE){this._target=k}else{throw"Target does not have ElementSelector interface"}}};e.prototype=new f();e.matchesSelector=function(l,k){return e(l).matchesSelector(k)};e.prototype.matchesSelector=function(n){var o=this._target||this;if(null==n){return false}var m=j(n);if(!m){return false}for(var l=0,k;k=m[l];l++){if(k.test(o)){return true}}return false};var d=Meeko.CSS;var g=new d.Parser();var h={};function j(l){var k=h[l];if(!k){k=g.parseSelectors(l);h[l]=k}return k}function i(z,k,y){if(null==k){return false}var v=j(k);var p=[];if(!v){return(y)?null:p}var m="*";FOUND:if(v.length==1){var q=v[0];var x=q.steps;var w=x[x.length-1].conditions;for(var l=w.length,s=0;s<l;s++){var u=w[s];if(u.conditionType==d.Condition.NODE_TEST_CONDITION&&u.nodeType==Node.ELEMENT_NODE){m=u.localName;break FOUND}}}var o=z.getElementsByTagName(m);for(var s=0,t;t=o[s];s++){for(var r=0,q;q=v[r];r++){if(q.test(t)){if(y){return t}p.push(t)}}}return(y)?null:p}return{NodeSelector:f,ElementSelector:e,Document:f,Element:e}})();Meeko.XPL.Namespace.enhance(window,Meeko.DOM.Selectors)};Meeko.stuff.xplSystem.contexts["lib/Meeko/DOM.xhtml"].wrappedScript=function(){var c=Meeko.stuff.xplSystem;var b=c.contexts["lib/Meeko/DOM.xhtml"];var a=b.logger};Meeko.stuff.xplSystem.contexts["DOM.xhtml"].requiredContexts.push("lib/Meeko/Net.xhtml");Meeko.stuff.xplSystem.createContext("lib/Meeko/Net.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/Net.xhtml"].wrappedScript=function(){var c=Meeko.stuff.xplSystem;var b=c.contexts["lib/Meeko/Net.xhtml"];var a=b.logger;Meeko.stuff.xplSystem.createNamespace("Meeko.Net");Meeko.Net.URIParser=(function(){var d=function(j){var k=d.options,h=k.parser[k.strictMode?"strict":"loose"].exec(j);for(var f=0,g={};f<14;f++){g[k.key[f]]=h[f]||""}g[k.q.name]={};g[k.key[12]].replace(k.q.parser,function(l,i,m){if(i){g[k.q.name][i]=m}});return g};d.options={strictMode:true,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*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var e=function(f){this.base=f};e.parseUri=function(f,g){if(null!=f&&"string"!=typeof f){f=f.toString()}if(null!=g&&"string"!=typeof g){g=g.toString()}var l=f.match(/^([^:\/?#]+):/);var h=(l&&l.length>1)?l[1]:"";switch(h){case"http":case"https":case"ftp":case"file":case"":var i=d(f);var j=d(g);if(!i.protocol){i.protocol=j.protocol;i.authority=j.authority;i.userInfo=j.userInfo;i.user=j.user;i.password=j.password;i.host=j.host;i.port=j.port;var o=(i.path.match(/^\//))?i.directory:j.directory+i.directory;var k=(i.file)?i.file:(i.anchor||i.query)?j.file:"";i.directory=o;i.file=k;i.path=o+k;var p=(i.query)?"?"+i.query:"";var n=(i.anchor)?"#"+i.anchor:"";i.relative=o+k+p+n;i.source=f}i.href=i.protocol+"://"+i.authority+i.path;if(i.query){i.href+="?"+i.query}i.toString=function(){return this.protocol+"://"+this.authority+this.relative};return i;break;default:return{protocol:h,source:f,href:f,toString:function(){return this.source}};break}};e.prototype.parseUri=function(f){return e.parseURI(f,this.base)};return e})()};Meeko.stuff.xplSystem.contexts["DOM.xhtml"].requiredContexts.push("lib/Meeko/XML.xhtml");Meeko.stuff.xplSystem.createContext("lib/Meeko/XML.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/XML.xhtml"].requiredContexts.push("lib/Meeko/Net.xhtml");Meeko.stuff.xplSystem.contexts["lib/Meeko/XML.xhtml"].wrappedScript=function(){var c=Meeko.stuff.xplSystem;var b=c.contexts["lib/Meeko/XML.xhtml"];var a=b.logger;if(!this.Meeko){this.Meeko={}}Meeko.XML=(function(){var e=function(m){var j=["Msxml2.%name%","Microsoft.%name%"];var l;for(var q=j.length,o=0;o<q;o++){var p=j[o].replace("%name%",m);try{l=new ActiveXObject(p)}catch(k){continue}break}if(!l){throw""+m+" not supported on this platform"}return l};var f=Meeko.Net.URIParser;var h=this.DOMParser||(function(){var j=function(){};j.prototype.parseFromString=function(m,l){var k;if(!ActiveXObject){throw"DOMParser.parseFromString not supported"}k=e("XMLDOM");k.async="false";k.loadXML(m);return k};return j})();var i=function(){};i.hosts={};i.prototype.open=function(p,l,n){var o=i.getLocation(l,location.href);var k=i.hosts[o.host];if(!k){throw"HttpRequest not valid for that host"}var m=new k(o.host);this._httpRequest=m;var j=this;m.onreadystatechange=function(q){j.handler(q)};m.open(p,o.relative,n)};i.prototype.send=function(k){var j=this._httpRequest;j.send(k)};i.prototype.handler=function(l){var k=this._httpRequest;if(4==k.readyState){var j=k;this._request=j._request;this._response=j._response;this.status=j.status;this.statusText=j.statusText;this.responseText=j.responseText;this.readyState=4;if(this.onreadystatechange){this.onreadystatechange({type:"readystatechange"})}}};i.getLocation=function(j,l){var k=f.parseUri(j,l);return k};var d=this.XMLHttpRequest||function(){return e("XMLHTTP")};var g=function(){var j=this;this.readyState=0;this._async=false;this._useXHR=true;this._xhrHandler=function(k){j._xhrReadyStateChange(k)};this._xhr=new d();this._xhr.onreadystatechange=this._xhrHandler;this._hrHandler=function(k){j._hrReadyStateChange(k)};this._hr=new i();this._hr.onreadystatechange=this._hrHandler};g.UNSENT=0;g.OPENED=1;g.HEADERS_RECEIVED=2;g.LOADING=3;g.DONE=4;if(d.wrapped){g.wrapped=d.wrapped}else{g.wrapped=d}g.prototype._xhrReadyStateChange=function(k){if(this.readyState==this._xhr.readyState){return}this.readyState=this._xhr.readyState;if(4==this.readyState){var j=this._xhr;this._request=j._request;this._response=j._response;this.status=j.status;this.statusText=j.statusText;this.responseText=j.responseText;this.responseXML=j.responseXML}if(this.onreadystatechange){this.onreadystatechange({type:"readystatechange"})}};g.prototype._hrReadyStateChange=function(k){if(this.readyState==this._hr.readyState){return}this.readyState=this._hr.readyState;if(4==this.readyState){var j=this._hr;this._request=j._request;this._response=j._response;this.status=j.status;this.statusText=j.statusText;this.responseText=j.responseText;this.responseXML=(new h()).parseFromString(j.responseText.toString(),"text/xml")}if(this.onreadystatechange){this.onreadystatechange({type:"readystatechange"})}};g.prototype.open=function(m,j,k){this._method=m.toUpperCase();this._url=j;this._async=k;try{this._xhr.open(m,j,k);this._xhr.onreadystatechange=this._xhrHandler;this._useXHR=true;if(0==this._xhr.readyState){this._useXHR=false}}catch(l){this._useXHR=false}try{this._hr.open(m,j,k)}catch(l){}};g.prototype.send=function(l){var j=c.prefetch[this._url];if("GET"==this._method&&j){this.readyState=4;this.status="200";this.statusText="OK";this.responseText=j;try{this.responseXML=(new h()).parseFromString(j,"text/xml")}catch(k){}if(this.onreadystatechange){this.onreadystatechange({type:"readystatechange"})}return}if(this._useXHR){try{this._xhr.send(l)}catch(k){this._useXHR=false}}if(!this._useXHR){this._hr.send(l)}if(!this._async){if(this._useXHR){this._xhrReadyStateChange()}else{this._hrReadyStateChange()}}};return{DOMParser:h,HttpRequest:i,XMLHttpRequest:g}})();window.XMLHttpRequest=Meeko.XML.XMLHttpRequest;Meeko.XPL.Namespace.enhance(window,Meeko.XML)};Meeko.stuff.xplSystem.contexts["DOM.xhtml"].wrappedScript=function(){var c=Meeko.stuff.xplSystem;var b=c.contexts["DOM.xhtml"];var a=b.logger};Meeko.stuff.xplSystem.init();
