if(!window.Meeko){window.Meeko={};}if(!Meeko.XPL){Meeko.XPL=(function(){var c=function(){};c.enhance=function(e,j){for(var f in j){var i=j[f];var h=e[f];if(h){for(var g in i){if("prototype"==g){continue;}if(h[g]){continue;}else{h[g]=i[g];}}if(i.prototype&&null==h.prototype){h.prototype={};}for(var g in i.prototype){if(h.prototype[g]){continue;}else{h.prototype[g]=i.prototype[g];}}}else{e[f]=i;}}};var b=function(e){this.ref=e;};b.DEBUG=0;b.INFO=1;b.WARN=2;b.ERROR=3;b.prototype.log=function(){this._log({message:arguments});};b.prototype.debug=function(){this._log({level:b.DEBUG,message:arguments});};b.prototype.info=function(){this._log({level:b.INFO,message:arguments});};b.prototype.warn=function(){this._log({level:b.WARN,message:arguments});};b.prototype.error=function(){this._log({level:b.ERROR,message:arguments});};b.prototype._log=function(e){e.date=new Date;e.ref=this.ref;e.message=Array.prototype.join.call(e.message," ");if(this._trace){this._trace.log(e);}};var a=function(e){this.params={};this.requiredContexts=[];this.installed=false;this.logger=new b(e);};var d=function(){this.prefetch={};this.contexts={};this.documentURI=document.documentURI||document.baseURI||document.URL;};d.prototype.createContext=function(f){if(null==f){f=0;for(var g in this.contexts){f++;}}var e=new a(f);this.contexts[f]=e;e.logger._trace=this.trace;return e;};d.prototype.createNamespace=function(f){var e=f.split(".");var h=window;for(var k=e.length,g=0;g<k;g++){var j=e[g];if(!h[j]){h[j]={};}h=h[j];}return h;};d.prototype.init=function(){var g=this;function f(h){var k=g.contexts[h];if(k.installed){return true;}for(var m=k.requiredContexts.length,j=0;j<m;j++){f(k.requiredContexts[j]);}var l=k.wrappedScript.call(window);k.installed=true;return l;}for(var e in g.contexts){f(e);}};return{Namespace:c,XPLContext:a,XPLSystem:d};})();}if(!Meeko.stuff){Meeko.stuff={};}if(!Meeko.stuff.xplSystem){Meeko.stuff.xplSystem=(function(){var b=new Meeko.XPL.XPLSystem();var a=window;do{if(a&&a.Meeko&&a.Meeko.stuff&&a.Meeko.stuff.trace){b.trace={_log:a.Meeko.stuff.trace.log,log:function(c){c.url=b.documentURI;this._log(c);}};break;}if(a==top){break;}}while(a=a.parent);if(!b.trace){b.trace={log:function(c){}};}return b;})();}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("/Users/shogun70/devel/XBLUI/1.1.0/source/libXBLUI.xhtml");Meeko.stuff.xplSystem.prefetch["http://dist.meekostuff.net/XBLUI/1.1-default/UI.js"]='\n(function(namespace, defn) {\n\tvar parts = namespace.split(".");\n\tvar parent = window;\n\tvar part = parts.shift();\n\twhile (parts.length) {\n\t\tif (parent[part] == null) parent[part] = {};\n\t\tparent = parent[part];\n\t\tpart = parts.shift();\n\t}\n\tparent[part] = defn();\n}) ("Meeko.UI", function() {\n\t\n\n\nvar treeitem = (function() {\nvar treeitem = function() {\n\t\n};\n\ttreeitem.prototype.getRefElement = function() {\n\t\n\treturn this.boundElement.querySelector("a, label"); // FIXME :context > a, etc\n\t\t\t\n}\n\ttreeitem.prototype.getView = function() {\n\t\n\tvar element = this.boundElement;\n\tvar document = element.ownerDocument;\n\tvar ref = this.getRefElement();\n\tvar tagName = ref.tagName.toLowerCase();\n\tif ("a" == tagName) {\n\t\tvar href = ref.href;\n//\t\tvar base = document.documentURI + "#";\n\t\tvar base = document.URL + "#";\n\t\tif (href.indexOf(base) == 0) {\n\t\t\tvar id = href.replace(base, "");\n\t\t\treturn document.getElementById(id);\n\t\t}\n\t}\n\telse if ("label" == tagName) {\n\t\tvar id = ref.htmlFor;\n\t\tif (id) return document.getElementById(id);\n\t}\n\treturn null;\n\t\t\t\n}\n\ttreeitem.prototype.getList = function() {\n\t\n\n\tvar element = this.boundElement;\n\tswitch (element.tagName.toLowerCase()) {\n\t}\n\tvar children = element.children;\n\tfor (var node, i=0; node=children.item(i); i++) {\n\t\tswitch (node.tagName.toLowerCase()) {\n\t\t\tcase "ol": case "ul": case "select": return node;\t\n\t\t}\n\t}\n\t\n\treturn null;\n\n\t\t\t\n}\n\ttreeitem.prototype.setOpenState = function(state) {\n\t\n\tvar element = this.boundElement;\n\tvar list = this.getList();\n\tif (!list) throw " ";\n\tif (state) {\n\t\telement.classList.remove("closed");\n\t\telement.classList.add("open");\n\t}\n\telse {\n\t\telement.classList.remove("open");\n\t\telement.classList.add("closed");\n\t}\n\t\t\t\n}\ntreeitem.prototype.getOpenState = function() {\n\t\n\tvar element = this.boundElement;\n\tvar list = this.getList();\n\tif (!list) throw " ";\n\tvar state = element.classList.contains("open");\n\treturn state;\n\t\t\t\n}\n\n\nif (treeitem.prototype.__defineGetter__) {\n\ttreeitem.prototype.__defineGetter__("refElement", treeitem.prototype.getRefElement);\n\ttreeitem.prototype.__defineGetter__("view", treeitem.prototype.getView);\n\ttreeitem.prototype.__defineGetter__("list", treeitem.prototype.getList);\n\t\n}\n\n\t\n\nreturn treeitem;\n})();\n\n\n\nvar tree = (function() {\nvar tree = function() {\n\t\n};\n\ttree.prototype = new treeitem;\n\ttree.prototype.getItems = function() {\n\t\n\tvar list = this.getList();\n\treturn list.children;\n\t\t\t\n}\ntree.prototype.getSelectedIndex = function() {\n\t\n\n\tvar items = this.getItems();\n\tvar n = items.length;\n\tfor (var i=0; i<n; i++) {\n\t\tif (items.item(i).classList.contains("current")) return i;\n\t}\n\treturn null;\n\n\t\t\t\n}\n\ttree.prototype.getSelectedItem = function() {\n\t\n\n\tvar items = this.getItems();\n\tvar n = items.length;\n\tfor (var i=0; i<n; i++) {\n\t\tvar node = items.item(i);\n\t\tif (node.classList.contains("current")) return node;\n\t}\n\treturn null;\n\n\t\t\t\n}\n\ttree.prototype.selectItem = function(item) {\n\t\n\n\tvar list = this.getList();\n\tif (item.parentNode != list) throw "Element doesn\'t exist in list";\n\tvar items = this.getItems();\n\tvar n = items.length;\n\tfor (var i=0; i<n; i++) {\n\t\tvar node = items.item(i);\n\t\tif (node === item) node.classList.add("current");\n\t\tif (node !== item) node.classList.remove("current");\n\t}\n\tthis.signalChange();\n\n\t\t\t\n}\ntree.prototype.signalChange = function() {\n\t\n\tvar element = this.boundElement;\n\tvar document = element.ownerDocument;\n\tvar event = document.createEvent("Event");\n\tevent.initEvent("change", false, true);\n\treturn element.dispatchEvent(event);\n\t\t\t\n}\ntree.prototype.ondocumentready = function() {\n\t\n\tvar item = this.getSelectedItem();\n\tif (item) {\n\t\tthis.signalChange();\n\t}\n\telse {\n\t\titem = this.getItems().item(0);\n\t\tthis.selectItem(item);\n\t}\t\n\t\t\t\n}\ntree.prototype.xblEnteredDocument = function() {\n\t\n\tvar binding = this;\n\tthis._init = function() {\n\t\tbinding.ondocumentready();\n\t}\n\tthis.boundElement.ownerDocument.addEventListener("load", this._init, false);\n\t\t\t\n}\n\n\nif (tree.prototype.__defineGetter__) {\n\ttree.prototype.__defineGetter__("selectedIndex", tree.prototype.getSelectedIndex);\n\ttree.prototype.__defineGetter__("selectedItem", tree.prototype.getSelectedItem);\n\t\n}\n\n\t\n\nreturn tree;\n})();\n\n\n\n\nvar navlistitem = (function() {\nvar navlistitem = function() {\n\t\n};\n\tnavlistitem.prototype = new treeitem;\n\t\n\nif (navlistitem.prototype.__defineGetter__) {\n\t\n}\n\n\t\n\nreturn navlistitem;\n})();\n\n\n\nvar navlist = (function() {\nvar navlist = function() {\n\t\n};\n\tnavlist.prototype = new tree;\n\t\n\nif (navlist.prototype.__defineGetter__) {\n\t\n}\n\n\t\n\nreturn navlist;\n})();\n\n\n\nvar scrollBox = (function() {\nvar scrollBox = function() {\n\t\n};\n\tscrollBox.prototype.setView = function(item) {\n\t\n\n\tvar element = this.boundElement;\n\tvar document = element.ownerDocument;\n\tif (element.compareDocumentPosition(node) & 0x10) { // Node.DOCUMENT_POSITION_CONTAINED_BY\n\t\tthrow "setView failed: item is not descendant of scrollBox";\n\t}\n\n\telement.scrollTop = item.offsetTop - element.offsetTop;\n\n\t\t\t\n}\n\n\nif (scrollBox.prototype.__defineGetter__) {\n\t\n}\n\n\t\n\nreturn scrollBox;\n})();\n\n\n\nvar scrollBoxWithResize = (function() {\nvar scrollBoxWithResize = function() {\n\t\n};\n\tscrollBoxWithResize.prototype.setView = function(item) {\n\t\n\n\tvar element = this.boundElement;\n\tvar document = element.ownerDocument;\n\tif (element.compareDocumentPosition(node) & 0x10) { // Node.DOCUMENT_POSITION_CONTAINED_BY\n\t\tthrow "setView failed: item is not descendant of scrollBoxWithResize";\n\t}\n\telement.style.height = "" + item.clientHeight + "px";\n\telement.scrollTop = item.offsetTop - element.offsetTop;\n\n\t\t\t\n}\nscrollBoxWithResize.prototype.xblBindingAttached = function() {\n\t\n\tvar element = this.boundElement;\n\tvar elementHeight = element.clientHeight;\n\telement.style.overflow = "hidden";\n\telement.style.height = "0px";\n\t\t\t\n}\n\n\nif (scrollBoxWithResize.prototype.__defineGetter__) {\n\t\n}\n\n\t\n\nreturn scrollBoxWithResize;\n})();\n\n\n\nvar switchBox = (function() {\nvar switchBox = function() {\n\t\n};\n\tswitchBox.prototype.setView = function(item) {\n\t\n\tvar element = this.boundElement;\n\tif (element != item.parentNode) throw "setView failed: item is not child of switchBox";\n\tArray.forEach(element.children, function(child) {\n\t\tif (item == child) child.style.display = "";\n\t\telse child.style.display = "none";\n\t});\n\t\t\t\n}\nswitchBox.prototype._getPanels = function() {\n\t\n\treturn this.boundElement.children;\n\t\t\t\n}\nswitchBox.prototype.setViewByIndex = function(index) {\n\t\n\n\tvar panels = this._getPanels();\n\tif (index >= panels.length) throw "setViewByIndex failed: index is not valid for switchBox";\n\tArray.forEach(panels, function(panel, i) {\n\t\tif (index == i) panel.style.display = "";\n\t\telse panel.style.display = "none";\n\t});\n\treturn;\n\n\t\t\t\n}\n\n\nif (switchBox.prototype.__defineGetter__) {\n\t\n}\n\n\t\n\nreturn switchBox;\n})();\n\n\n\nvar table = (function() {\nvar table = function() {\n\t\n};\n\ttable.prototype.getColumns = function() {\n\t\n\tvar element = this.boundElement;\n\treturn element.tHead.rows.item(0).cells;\n\t\t\t\n}\ntable.prototype._sort = function(column, type, reverse) {\n\t\n\n\tvar element = this.boundElement;\n\tvar tBodies = element.tBodies;\n\tfor (var j=0, m=tBodies.length; j<m; j++) {\n\t\tvar tBody = tBodies.item(j);\n\t\tvar rows = tBody.rows;\n\t\tvar values = [];\n\t\tfor (var i=0, n=rows.length; i<n; i++) {\n\t\t\tvar row = rows.item(i); var cell = row.cells.item(column);\n\t\t\tvar val = new String(cell.firstChild.nodeValue);\n\t\t\tval.row = row;\n\t\t\tvalues.push(val);\n\t\t}\n\t\tswitch (type) {\n\t\t\tcase "string":\n\t\t\t\tvalues = values.sort();\n\t\t\t\tbreak;\n\t\t\tcase "number":\n\t\t\t\tvalues = values.sort(function(a, b) { return Number(a) - Number(b); });\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow "Unrecognized sort type: " + type;\n\t\t\t\tbreak;\n\t\t}\n\t\tif (reverse) values = values.reverse();\n\t\tfor (var n=values.length, i=0; i<n; i++) {\n\t\t\tvar val = values[i];\n\t\t\tvar row = val.row;\n\t\t\ttBody.removeChild(row);\n\t\t\tif (i == n-1) tBody.appendChild(row);\n\t\t\telse tBody.insertBefore(row, tBody.rows.item(i));\n\t\t}\n\t}\n\n\t\t\t\n}\ntable.prototype.toggleColumnSortState = function(column) {\n\t\n\n\tvar type = "string";\n\tvar cols = this.getColumns();\n\tvar classList = cols.item(column).classList;\n\tif (classList.contains("number")) type = "number";\n\tif (classList.contains("string")) type = "string";\n\tvar sortable = classList.contains("sortable");\n\tvar sorted = classList.contains("sorted");\n\tvar reversed = classList.contains("reversed");\n\tif (!sortable) return;\n\tif (!sorted) {\n\t\tthis._sort(column, type, false);\n\t\tclassList.add("sorted");\n\t\tclassList.remove("reversed");\n\t}\n\telse {\n\t\tthis._sort(column, type, !reversed);\n\t\tif (reversed) classList.remove("reversed");\n\t\telse classList.add("reversed");\n\t}\n\tfor (var n=cols.length, i=0; i<n; i++) {\n\t\tif (column != i) {\n\t\t\tvar classList = cols.item(i).classList;\n\t\t\tclassList.remove("sorted");\n\t\t\tclassList.remove("reversed");\n\t\t}\n\t}\n\n\t\t\t\n}\n\n\nif (table.prototype.__defineGetter__) {\n\t\n}\n\n\ttable.prototype.xblPublic = [\n\t\t\n\t"getColumns", \n\t"toggleColumnSortState"\n]\n\t\n\nreturn table;\n})();\n\n\n\nvar RepetitionElement = (function() {\nvar RepetitionElement = function() {\n\t\n};\n\tRepetitionElement.REPETITION_NONE = 0;\n\tRepetitionElement.REPETITION_TEMPLATE = 1;\n\tRepetitionElement.REPETITION_BLOCK = 2;\n\tRepetitionElement.prototype.addRepetitionBlock = function(previousBlock) {\n\t\nif (this.repetitionType != RepetitionElement.REPETITION_TEMPLATE) return null;\nif (previousBlock.repetitionType != RepetitionElement.REPETITION_BLOCK) throw "previousBlock is not repetition block";\nreturn this.addRepetitionBlockByIndex(previousBlock, previousBlock.repetitionIndex + 1);\n\t\t\t\n}\nRepetitionElement.prototype.addRepetitionBlockByIndex = function(previousBlock, index) {\n\t\n\t\t\t\t\nvar element = this.boundElement;\nvar document = element.ownerDocument;\nif (this.repetitionType != RepetitionElement.REPETITION_TEMPLATE) return null;\nvar nBlocks = this.repetitionBlocks.length;\nvar maxBlocks = this.repeatMax;\nif (maxBlocks && nBlocks >= maxBlocks) return null;\nvar index = this.repetitionIndex;\nvar newBlock = element.cloneNode(true);\nnewBlock.setAttribute("repeat", index);\nnewBlock.removeAttribute("repeat-min");\nnewBlock.removeAttribute("repeat-max");\nnewBlock.removeAttribute("repeat-start");\n\n// recurse and substitute instances of "[name]"\nvar name = newBlock.id;\nname = name.replace(/\\[/, "\\\\[");\nname = name.replace(/\\]/, "\\\\]");\nvar pattern = new RegExp("\\\\[" + name + "\\\\]", "g");\nvar elt, iter = document.createTreeWalker(newBlock, NodeFilter.SHOW_ELEMENT, null, false);\nwhile (elt = iter.nextNode()) {\n\tArray.forEach (["id", "name", "for", "value"], function(attrName) {\n\t\tvar val = this.getAttribute(attrName);\n\t\tthis.setAttribute(attrName, val.replace(pattern, index));\n\t}, elt);\n}\n\nnewBlock.setAttribute("repeat-template", name);\nnewBlock.removeAttribute("id");\nif (previousBlock) previousBlock.parentNode.insertBefore(newBlock, previousBlock.nextSibling);\nelse element.parentNode.insertBefore(newBlock, element);\nvar e = document.createEvent("UIEvent");\ne.initEvent("added", true, false);\nelement.dispatchEvent(e);\n\nreturn newBlock;\n\n\t\t\t\n}\nRepetitionElement.prototype.removeRepetitionBlock = function() {\n\t\nvar element = this.boundElement;\nif (this.repetitionType != RepetitionElement.REPETITION_BLOCK) return null;\nvar template = this.repetitionTemplate;\n\n// remove block\nelement.parentNode.removeChild(element);\n\n// fire "removed" event\nif (template) {\n\tvar e = document.createEvent("UIEvent");\n\te.initEvent("removed", true, false);\n\telement.dispatchEvent(e);\n}\n\n// TODO: adjust number of blocks to comply with repeatMin, repeatMax\n\nreturn;\n\t\t\t\n}\nRepetitionElement.prototype.getRepetitionType = function() {\n\t\nvar element = this.boundElement;\nvar repeat = element.getAttribute("repeat");\nif ("template" == repeat) return RepetitionElement.REPETITION_TEMPLATE;\nif (!isNaN(repeat)) return RepetitionElement.REPETITION_BLOCK;\nreturn RepetitionElement.REPETITION_NONE;\n\t\t\t\n}\n\tRepetitionElement.prototype.getRepetitionIndex = function() {\n\t\n\nvar element = this.boundElement;\nvar repeat = element.getAttribute("repeat");\nif (!isNaN(repeat)) return Number(repeat); // repeat is numeric, i.e. this is a repeat-block\nif ("template" != repeat) return 0; // repeat is invalid\nvar index = 0;\nvar nBlocks = 0;\nvar sibling = element;\nwhile (sibling = sibling.previousSibling) { // FIXME is the logic right here\n\tif (!sibling.repetitionType) continue;\n\tif (RepetitionElement.REPETITION_BLOCK == sibling.repetitionType) {\n\t\tnBlocks++;\n\t\tif (index <= sibling.repetitionIndex) index = 1 + sibling.repetitionIndex;\n\t}\n}\nif (index < nBlocks) index = nBlocks;\nreturn index;\n\n\t\t\t\n}\n\tRepetitionElement.prototype.getRepetitionTemplate = function() {\n\treturn this.boundElement.getAttribute("repeat-template");\n}\n\tRepetitionElement.prototype.getRepetitionBlocks = function() {\n\t\nvar element = this.boundElement;\nvar blocks = [];\nvar sibling = element;\nwhile (sibling = sibling.previousSibling) {\n\tif (!sibling.repetitionType) continue;\n\tif (RepetitionElement.REPETITION_BLOCK == sibling.repetitionType) blocks.push(sibling);\n}\nreturn blocks;\n\t\t\t\n}\n\tRepetitionElement.prototype.getRepeatStart = function() {\n\treturn this.boundElement.getAttribute("repeat-start");\n}\n\tRepetitionElement.prototype.getRepeatMin = function() {\n\treturn this.boundElement.getAttribute("repeat-min");\n}\n\tRepetitionElement.prototype.getRepeatMax = function() {\n\treturn this.boundElement.getAttribute("repeat-max");\n}\n\tRepetitionElement.prototype.xplInit = function() {\n\t\n\nvar element = this.boundElement;\nvar nBlocks = (this.repeatStart) ? this.repeatStart : 1;\nif (nBlocks < this.repeatMin) nBlocks = this.repeatMin;\nif (nBlocks > this.repeatMax) nBlocks = this.repeatMax;\nwhile (this.repetitionBlocks.length < nBlocks) this.addRepetitionBlock();\n\n\t\t\t\n}\n\n\nif (RepetitionElement.prototype.__defineGetter__) {\n\tRepetitionElement.prototype.__defineGetter__("repetitionType", RepetitionElement.prototype.getRepetitionType);\n\tRepetitionElement.prototype.__defineGetter__("repetitionIndex", RepetitionElement.prototype.getRepetitionIndex);\n\tRepetitionElement.prototype.__defineGetter__("repetitionTemplate", RepetitionElement.prototype.getRepetitionTemplate);\n\tRepetitionElement.prototype.__defineGetter__("repetitionBlocks", RepetitionElement.prototype.getRepetitionBlocks);\n\tRepetitionElement.prototype.__defineGetter__("repeatStart", RepetitionElement.prototype.getRepeatStart);\n\tRepetitionElement.prototype.__defineGetter__("repeatMin", RepetitionElement.prototype.getRepeatMin);\n\tRepetitionElement.prototype.__defineGetter__("repeatMax", RepetitionElement.prototype.getRepeatMax);\n\t\n}\n\n\t\n\nreturn RepetitionElement;\n})();\n\n\n\nvar WF2FormElement = (function() {\nvar WF2FormElement = function() {\n\t\n};\n\tWF2FormElement.prototype.getReplace = function() {\n\treturn this.boundElement.getAttribute("replace");\n}\n\tWF2FormElement.prototype.setReplace = function(val) {\n\tthis.boundElement.setAttribute("replace", val);\n}\n\tWF2FormElement.prototype.getAction = function() {\n\treturn this.boundElement.getAttribute("action");\n}\n\tWF2FormElement.prototype.setAction = function(val) {\n\tthis.boundElement.setAttribute("action", val);\n}\n\tWF2FormElement.prototype.getMethod = function() {\n\treturn this.boundElement.getAttribute("method");\n}\n\tWF2FormElement.prototype.setMethod = function(val) {\n\tthis.boundElement.setAttribute("method", val);\n}\n\tWF2FormElement.prototype.getEnctype = function() {\n\treturn this.boundElement.getAttribute("enctype");\n}\n\tWF2FormElement.prototype.setEnctype = function(val) {\n\tthis.boundElement.setAttribute("enctype", val);\n}\n\tWF2FormElement.prototype.getElements = function() {\n\t\n\nvar elts = this.boundElement.getElementsByTagName("*");\nvar nodeList = [];\nfor (var i=0, n=elts.length; i<n; i++) {\n\tvar el = elts[i];\n\tswitch (el.tagName) {\n\t\tcase "INPUT": case "BUTTON": case "SELECT": case "TEXTAREA": case "FIELDSET": case "OUTPUT":\n\t\t\tnodeList.push(el);\n\t\t\tbreak;\n\t}\n}\nreturn nodeList;\n\n\t\t\t\n}\n\tWF2FormElement.prototype.checkValidity = function() {\n\t\n\n\tvar valid = true;\n\tvar elements = this.boundElement.elements;\n\tfor (var i=0, el; el=elements[i]; i++)  {\n\t\tif (el.checkValidity && !el.checkValidity()) valid = false;\n\t}\n\treturn valid;\n\n\t\t\t\n}\nWF2FormElement.prototype.resetFromData = function(doc) {\n\t\n\nvar root = doc.documentElement;\n\nvar aClear = root.getElementsByTagName("clear");\nvar n = aClear.length;\nfor (var i=0; i<n; i++) {\n\tvar clear = aClear[i];\n\tvar templateId = clear.getAttribute("template");\n\tvar template = RepetitionElement(document.getElementById(templateId));\n\tif (!template) continue;\n\tif (template.repetitionType != RepetitionElement.REPETITION_TEMPLATE) continue;\n\tvar blocks = template.repetitionBlocks;\n\tvar m = blocks.length;\n\tfor (var j=0; j<m; j++) RepetitionElement(blocks[j]).removeRepetitionBlock();\n}\n\nvar aRepeat = root.getElementsByTagName("repeat");\nn = aRepeat.length;\nfor (i=0; i<n; i++) {\n\tvar repeat = aRepeat[i];\n\tvar templateId = repeat.getAttribute("template");\n\tvar index = repeat.getAttribute("index");\n\tvar template = RepetitionElement(document.getElementById(templateId));\n\tif (!template) continue;\n\tif (template.repetitionType != RepetitionElement.REPETITION_TEMPLATE) continue;\n\ttemplate.addRepetitionBlockByIndex(null, index);\n\n}\n\n\n// build a hash of field names\n// TODO: incorporate index\nvar aField = root.getElementsByTagName("field");\nn = aField.length;\nvar fieldHash = {};\nfor (var i=0; i<n; i++) {\n\tvar field = aField[i];\n\tvar name = field.getAttribute("name");\n\tvar index = field.getAttribute("index");\n\tvar value = field.textContent;\n\tif (!fieldHash[name]) fieldHash[name] = [];\n\tfieldHash[name].push(value);\n}\n\t\nvar aElt = this.elements;\nArray.forEach (aElt, function(elt) {\n\tvar face = WF2FormControlElement(elt);\n\tif (!face) return;\n\tvar name = face.name || elt.id;\n\tif (name) {\n\t\tvar field = fieldHash[name];\n\t\tif (field) face.value = field.shift();\n\t}\n});\n\n\n\t\t\t\n}\nWF2FormElement.prototype.submit = function(button) {\n\t\n\n// TODO handle replace="document"\n\nif (!this.checkValidity()) {\n\tvar message = this.title || "Invalid data";\n\talert(message);\n\treturn false;\n}\n\nvar replace = (button.getReplace && button.getReplace()) || this.getReplace() || "document";\nif ("values" != replace) return this.boundElement.submit(); // FIXME\n\nvar action = (button.getAction && button.getAction()) || this.getAction() || "";\nvar method = (button.getMethod && button.getMethod()) || this.getMethod() || "get";\nvar enctype = (button.getEncType && button.getEnctype()) || this.getEnctype() || "application/x-www-form-urlencoded";\nif ("application/x-www-form-urlencoded" != enctype) throw "UNIMPLEMENTED ENCTYPE: "+enctype;\n\nvar txt = this.encode();\nvar httpRequest = this.httpRequest;\nswitch (method) {\n\tcase "get": case "GET":\n\t\taction += "?" + txt;\n\t\thttpRequest.open(method, document.base + "/" + action, false);\n\t\thttpRequest.send("");\n\tbreak;\n\t\n\tcase "post": case "POST":\n\t\thttpRequest.open(method, document.base + "/" + action, false);\n\t\thttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");\n\t\thttpRequest.setRequestHeader("Content-Length", txt.length);\n\t\thttpRequest.send(txt);\n\tbreak;\n \n\tdefault:\n\tbreak;\n}\nif (httpRequest.readyState != 4 || httpRequest.status != 200 || !httpRequest.responseXML) {\n\talert("Could not complete that operation.\\n"+\n\t\t"Please contact the administrator.\\n"+\n\t\t"Details: \\naction: "+action+"\\nreadyState: "+httpRequest.readyState\n\t);\n\treturn false;\n}\n\ntry {\n\tvar e = document.createEvent("UIEvents");\n\te.initEvent("received", false, true);\n\te.receivedDocument = httpRequest.responseXML;\n\tvar allowDefault = this.boundElement.dispatchEvent(e);\n\tif (!allowDefault) return false;\n}\ncatch (err) {\n}\n\nreturn this.resetFromData(httpRequest.responseXML);\n\n\t\t\t\n}\nWF2FormElement.prototype.xblBindingAttached = function() {\n\t\nthis.httpRequest = new this.boundElement.ownerDocument.parentWindow.XMLHttpRequest();\n\t\t\t\n}\nWF2FormElement.prototype.encode = function() {\n\t\n\nvar a = [];\nArray.forEach(this.elements, function(el) {\n\tif (el.name) a.push(el.name + "=" + encodeURIComponent(el.value));\n});\nvar txt = a.join(\'&\');\nreturn txt;\n\n\t\t\t\n}\nWF2FormElement.prototype.decode = function(txt) {\n\t\n\nvar hash = eval("({" + txt + "})");\nArray.forEach(this.elements, function(el) {\n\tvar name = el.name;\n\tif (name) {\n\t\tel.value = (undefined != hash[name]) ?\n\t\t\thash[name] :\n\t\t\t"";\n\t}\n});\n\n\t\t\t\n}\n\n\nif (WF2FormElement.prototype.__defineGetter__) {\n\tWF2FormElement.prototype.__defineGetter__("replace", WF2FormElement.prototype.getReplace);\n\tWF2FormElement.prototype.__defineSetter__("replace", WF2FormElement.prototype.setReplace);\n\tWF2FormElement.prototype.__defineGetter__("action", WF2FormElement.prototype.getAction);\n\tWF2FormElement.prototype.__defineSetter__("action", WF2FormElement.prototype.setAction);\n\tWF2FormElement.prototype.__defineGetter__("method", WF2FormElement.prototype.getMethod);\n\tWF2FormElement.prototype.__defineSetter__("method", WF2FormElement.prototype.setMethod);\n\tWF2FormElement.prototype.__defineGetter__("enctype", WF2FormElement.prototype.getEnctype);\n\tWF2FormElement.prototype.__defineSetter__("enctype", WF2FormElement.prototype.setEnctype);\n\tWF2FormElement.prototype.__defineGetter__("elements", WF2FormElement.prototype.getElements);\n\t\n}\n\n\tWF2FormElement.prototype.xblPublic = [\n\t\t\n\t"replace", \n\t"action", \n\t"method", \n\t"enctype", \n\t"elements", \n\t"checkValidity", \n\t"resetFromData", \n\t"submit", \n\t"xblBindingAttached"\n]\n\t\n\nreturn WF2FormElement;\n})();\n\n\n\nvar WF2SubmitButton = (function() {\nvar WF2SubmitButton = function() {\n\t\n};\n\tWF2SubmitButton.prototype.getReplace = function() {\n\treturn this.boundElement.getAttribute("replace");\n}\n\tWF2SubmitButton.prototype.setReplace = function(val) {\n\tthis.boundElement.setAttribute("replace", val);\n}\n\tWF2SubmitButton.prototype.getAction = function() {\n\treturn this.boundElement.getAttribute("action");\n}\n\tWF2SubmitButton.prototype.setAction = function(val) {\n\tthis.boundElement.setAttribute("action", val);\n}\n\tWF2SubmitButton.prototype.getMethod = function() {\n\treturn this.boundElement.getAttribute("method");\n}\n\tWF2SubmitButton.prototype.setMethod = function(val) {\n\tthis.boundElement.setAttribute("method", val);\n}\n\tWF2SubmitButton.prototype.getEnctype = function() {\n\treturn this.boundElement.getAttribute("enctype");\n}\n\tWF2SubmitButton.prototype.setEnctype = function(val) {\n\tthis.boundElement.setAttribute("enctype", val);\n}\n\t\n\nif (WF2SubmitButton.prototype.__defineGetter__) {\n\tWF2SubmitButton.prototype.__defineGetter__("replace", WF2SubmitButton.prototype.getReplace);\n\tWF2SubmitButton.prototype.__defineSetter__("replace", WF2SubmitButton.prototype.setReplace);\n\tWF2SubmitButton.prototype.__defineGetter__("action", WF2SubmitButton.prototype.getAction);\n\tWF2SubmitButton.prototype.__defineSetter__("action", WF2SubmitButton.prototype.setAction);\n\tWF2SubmitButton.prototype.__defineGetter__("method", WF2SubmitButton.prototype.getMethod);\n\tWF2SubmitButton.prototype.__defineSetter__("method", WF2SubmitButton.prototype.setMethod);\n\tWF2SubmitButton.prototype.__defineGetter__("enctype", WF2SubmitButton.prototype.getEnctype);\n\tWF2SubmitButton.prototype.__defineSetter__("enctype", WF2SubmitButton.prototype.setEnctype);\n\t\n}\n\n\t\n\nreturn WF2SubmitButton;\n})();\n\n\n\nvar WF2TextInput = (function() {\nvar WF2TextInput = function() {\n\t\n};\n\tWF2TextInput.prototype.getFilter = function() {\n\treturn this.boundElement.getAttribute("filter");\n}\n\tWF2TextInput.prototype.setFilter = function(val) {\n\tthis.boundElement.setAttribute("filter", val);\n}\n\t\n\nif (WF2TextInput.prototype.__defineGetter__) {\n\tWF2TextInput.prototype.__defineGetter__("filter", WF2TextInput.prototype.getFilter);\n\tWF2TextInput.prototype.__defineSetter__("filter", WF2TextInput.prototype.setFilter);\n\t\n}\n\n\t\n\nreturn WF2TextInput;\n})();\n\n\n\nvar WF2NumberInput = (function() {\nvar WF2NumberInput = function() {\n\t\n};\n\tWF2NumberInput.prototype.getMin = function() {\n\treturn this.boundElement.getAttribute("min");\n}\n\tWF2NumberInput.prototype.setMin = function(val) {\n\tthis.boundElement.setAttribute("min", val);\n}\n\tWF2NumberInput.prototype.getMax = function() {\n\treturn this.boundElement.getAttribute("max");\n}\n\tWF2NumberInput.prototype.setMax = function(val) {\n\tthis.boundElement.setAttribute("max", val);\n}\n\tWF2NumberInput.prototype.getStep = function() {\n\treturn this.boundElement.getAttribute("step");\n}\n\tWF2NumberInput.prototype.setStep = function(val) {\n\tthis.boundElement.setAttribute("step", val);\n}\n\tWF2NumberInput.prototype.getValue = function() {\n\treturn this.boundElement.value;\n}\n\tWF2NumberInput.prototype.setValue = function(val) {\n\tthis.boundElement.value = val;\n}\n\tWF2NumberInput.prototype._validity = \n\t\t\t\t{\n\t\t\t\t\tvalueMissing: false,\n\t\t\t\t\ttypeMismatch: false,\n\t\t\t\t\ttooLong: false,\n\t\t\t\t\tpatternMismatch: false,\n\t\t\t\t\trangeUnderflow: false,\n\t\t\t\t\trangeOverflow: false,\n\t\t\t\t\tstepMismatch: false,\n\t\t\t\t\tcustomError: false,\n\t\t\t\t\tvalid: true\n\t\t\t\t}\n\t\t;\n\tWF2NumberInput.prototype.getValidity = function() {\n\treturn this._validity;\n}\n\tWF2NumberInput.prototype.checkValidity = function() {\n\t\nthis.test(this.getValue(), this._validity);\n// TODO conditionally dispatch invalid event\nreturn this._validity.valid;\n\t\t\t\n}\nWF2NumberInput.prototype.stepUp = function(n) {\n\t\n\nif (!n || isNaN(n) || (n % 1)) throw "INDEX_SIZE_ERR";\n\nvar szStep = this.getStep();\nvar step = (null != szStep) ? Number(szStep) : 1;\nvar szValue = this.getValue();\nvar validity = this.test(szValue);\nif (null == szValue || "" == szValue || "any" == szStep || !validity.valid) throw "INVALID_STATE_ERR";\n\nvar value = Number(szValue);\nvalue += n * step;\nvalidity = this.test(String(value));\nif (!validity.valid) throw "INVALID_MODIFICATION_ERR";\n\nthis.setValue(value);\n\n\t\t\t\n}\nWF2NumberInput.prototype.stepDown = function(n) {\n\t\n\nif (!n || isNaN(n) || (n % 1)) throw "INDEX_SIZE_ERR";\nthis.stepUp(-n);\n\n\t\t\t\n}\nWF2NumberInput.prototype.test = function(szValue, validity) {\n\t\n\nif (null == validity) validity = {};\n\nvar value = Number(szValue);\nvar required = this.boundElement.required;\nvalidity.valueMissing = required && (null == szValue || "" == szValue);\nvalidity.typeMismatch = null != szValue && "" != szValue && isNaN(szValue);\nvar szMin = this.getMin();\nvar min = (null != szMin && "" != szMin && !isNaN(szMin)) ? Number(szMin) : null;\nvalidity.rangeUnderflow = (!validity.valueMissing & !validity.typeMismatch && null != min && value < min);\nvar szMax = this.getMax();\nvar max = (null != szMax && "" != szMax && !isNaN(szMax)) ? Number(szMax) : null;\nvalidity.rangeOverflow = (!validity.valueMissing & !validity.typeMismatch && null != max && value > max);\nvar szStep = this.getStep();\nvar step = ("any" == szStep) ? 0 :\n\t\t\t(null != szStep && "" != szStep && !isNaN(szStep)) ? Number(szStep) :\n\t\t\t1;\n\nvar stepsFromMin = (null != min && 0 != step) ? (value - min) / step : 0;\nvar stepsFromMax = (null != max && 0 != step) ? (max - value) / step : 0;\nvar stepsFromZero =\t(0 != step) ? value / step : 0;\nvar stepMismatch = (stepsFromMin) ? (Math.round(stepsFromMin) != stepsFromMin) :\n\t\t\t\t\t(stepsFromMax) ? (Math.round(stepsFromMax) != stepsFromMax) :\n\t\t\t\t\t(stepsFromZero) ? (Math.round(stepsFromZero) != stepsFromZero) :\n\t\t\t\t\tfalse;\nvalidity.stepMismatch = !validity.valueMissing && !validity.typeMismatch && !validity.rangeUnderflow && !validity.rangeOverflow &&\n\t\t\t0 != step && stepMismatch;\nvalidity.valid = !(validity.valueMissing || validity.typeMismatch || validity.rangeUnderflow || validity.rangeOverflow || validity.stepMismatch);\n\nreturn validity;\n\n\t\t\t\n}\n\n\nif (WF2NumberInput.prototype.__defineGetter__) {\n\tWF2NumberInput.prototype.__defineGetter__("min", WF2NumberInput.prototype.getMin);\n\tWF2NumberInput.prototype.__defineSetter__("min", WF2NumberInput.prototype.setMin);\n\tWF2NumberInput.prototype.__defineGetter__("max", WF2NumberInput.prototype.getMax);\n\tWF2NumberInput.prototype.__defineSetter__("max", WF2NumberInput.prototype.setMax);\n\tWF2NumberInput.prototype.__defineGetter__("step", WF2NumberInput.prototype.getStep);\n\tWF2NumberInput.prototype.__defineSetter__("step", WF2NumberInput.prototype.setStep);\n\tWF2NumberInput.prototype.__defineGetter__("value", WF2NumberInput.prototype.getValue);\n\tWF2NumberInput.prototype.__defineSetter__("value", WF2NumberInput.prototype.setValue);\n\tWF2NumberInput.prototype.__defineGetter__("validity", WF2NumberInput.prototype.getValidity);\n\t\n}\n\n\tWF2NumberInput.prototype.xblPublic = [\n\t\t\n\t"min", \n\t"max", \n\t"step", \n\t"value", \n\t"validity", \n\t"checkValidity", \n\t"stepUp", \n\t"stepDown"\n]\n\t\n\nreturn WF2NumberInput;\n})();\n\n\n\nvar WF2SelectElement = (function() {\nvar WF2SelectElement = function() {\n\t\n};\n\tWF2SelectElement.prototype.getValue = function() {\n\treturn this.boundElement.getAttribute("value");\n}\n\tWF2SelectElement.prototype.setValue = function(val) {\n\tthis.boundElement.setAttribute("value", val);\n}\n\tWF2SelectElement.prototype.getName = function() {\n\treturn this.boundElement.getAttribute("name");\n}\n\tWF2SelectElement.prototype.getData = function() {\n\treturn this.boundElement.getAttribute("data");\n}\n\tWF2SelectElement.prototype.setData = function(val) {\n\t\nvar rc = this.load(val);\nif (rc) this.boundElement.setAttribute("data", val);\n\t\t\t\n}\n\tWF2SelectElement.prototype.load = function(src) {\n\t\n\nvar element = this.boundElement;\nvar document = element.ownerDocument;\nvar href =\n\tsrc.match(/^\\//) ? src :\n\tdocument.documentURI.replace(/[^\\/]*$/, "") + src;\nthis.httpRequest = new this.boundElement.ownerDocument.parentWindow.XMLHttpRequest();\nvar rq = this.httpRequest;\nrq.open("GET", href, false);\nrq.send("");\nif (rq.readyState != 4) return false;\nif (rq.status != 200) return false;\nif (!rq.responseXML) return false;\nvar srcSelect = rq.responseXML.documentElement;\nvar aNode = srcSelect.childNodes;\nvar n = aNode.length;\nfor (var i=0; i<n; i++) {\n\tif (Node.ELEMENT_NODE != aNode[i].nodeType) continue;\n\tvar tmp = document.importNode(aNode[i], true);\n\tthis.boundElement.appendChild(tmp);\n}\nreturn true;\n\t\n\t\t\t\n}\nWF2SelectElement.prototype.xblEnteredDocument = function() {\n\t\nif (this.getData()) this.load(this.getData());\n\t\t\t\n}\n\n\nif (WF2SelectElement.prototype.__defineGetter__) {\n\tWF2SelectElement.prototype.__defineGetter__("value", WF2SelectElement.prototype.getValue);\n\tWF2SelectElement.prototype.__defineSetter__("value", WF2SelectElement.prototype.setValue);\n\tWF2SelectElement.prototype.__defineGetter__("name", WF2SelectElement.prototype.getName);\n\tWF2SelectElement.prototype.__defineGetter__("data", WF2SelectElement.prototype.getData);\n\tWF2SelectElement.prototype.__defineSetter__("data", WF2SelectElement.prototype.setData);\n\t\n}\n\n\tWF2SelectElement.prototype.xblPublic = [\n\t\t\n\t"value", \n\t"name", \n\t"data", \n\t"xblEnteredDocument"\n]\n\t\n\nreturn WF2SelectElement;\n})();\n\n\n\nvar WF2OutputElement = (function() {\nvar WF2OutputElement = function() {\n\t\n};\n\tWF2OutputElement.prototype.getName = function() {\n\treturn this.boundElement.getAttribute("name");\n}\n\tWF2OutputElement.prototype.setName = function(val) {\n\tthis.boundElement.setAttribute("name", val);\n}\n\tWF2OutputElement.prototype.getValue = function() {\n\t\nvar val = this.boundElement.textContent;\nif (val == "\\u00a0") return null;\nreturn val;\n\t\t\t\n}\n\tWF2OutputElement.prototype.setValue = function(val) {\n\treturn (this.boundElement.textContent = val ? val : "\\u00a0");\n}\n\tWF2OutputElement.prototype.xblEnteredDocument = function() {\n\t\nif (!this.boundElement.textContent) this.textContent = "\\u00a0";// non-breaking-space\n\t\t\t\n}\n\n\nif (WF2OutputElement.prototype.__defineGetter__) {\n\tWF2OutputElement.prototype.__defineGetter__("name", WF2OutputElement.prototype.getName);\n\tWF2OutputElement.prototype.__defineSetter__("name", WF2OutputElement.prototype.setName);\n\tWF2OutputElement.prototype.__defineGetter__("value", WF2OutputElement.prototype.getValue);\n\tWF2OutputElement.prototype.__defineSetter__("value", WF2OutputElement.prototype.setValue);\n\t\n}\n\n\t\n\nreturn WF2OutputElement;\n})();\n\n\n\nvar WF2DatalistElement = (function() {\nvar WF2DatalistElement = function() {\n\t\n};\n\t\ndocument.createElement("datalist"); // NOTE fix for IE. Assumes HTML document\n\t\nWF2DatalistElement.prototype.getName = function() {\n\treturn this.boundElement.getAttribute("name");\n}\n\tWF2DatalistElement.prototype.setName = function(val) {\n\tthis.boundElement.setAttribute("name", val);\n}\n\t\n\nif (WF2DatalistElement.prototype.__defineGetter__) {\n\tWF2DatalistElement.prototype.__defineGetter__("name", WF2DatalistElement.prototype.getName);\n\tWF2DatalistElement.prototype.__defineSetter__("name", WF2DatalistElement.prototype.setName);\n\t\n}\n\n\t\n\nreturn WF2DatalistElement;\n})();\n\n\n\nreturn {\n\ttreeitem: treeitem, \n\ttree: tree, \n\tnavlistitem: navlistitem, \n\tnavlist: navlist, \n\tscrollBox: scrollBox, \n\tscrollBoxWithResize: scrollBoxWithResize, \n\tswitchBox: switchBox, \n\ttable: table, \n\tRepetitionElement: RepetitionElement, \n\tWF2FormElement: WF2FormElement, \n\tWF2SubmitButton: WF2SubmitButton, \n\tWF2TextInput: WF2TextInput, \n\tWF2NumberInput: WF2NumberInput, \n\tWF2SelectElement: WF2SelectElement, \n\tWF2OutputElement: WF2OutputElement, \n\tWF2DatalistElement: WF2DatalistElement\n\t\n}\n});\n';Meeko.stuff.xplSystem.prefetch["http://dist.meekostuff.net/XBLUI/1.1-default/UI.xml"]='<?xml version="1.0"?>\n<?access-control allow="*"?>\n<!--\nXBL2 UI stuff\nCopyright 2007, Sean Hogan (http://www.meekostuff.net/)\nAll rights reserved\n-->\n<xbl xmlns="http://www.w3.org/ns/xbl">\n\n<script src="UI.js"/>\n\n<binding id="tree">\n\t<implementation>(Meeko.UI.tree.prototype)</implementation>\n\t<handlers>\n\t\t<handler event="click">\nvar element = this.boundElement;\nvar item = event.target;\nwhile (item.tagName.toLowerCase() != "li") {\n\tif (item == element) return;\n\titem = item.parentNode;\n}\nthis.selectItem(item);\n\t\t</handler>\n\t</handlers>\n</binding>\n\n<binding id="treeitem">\n\t<implementation>(Meeko.UI.treeitem.prototype)</implementation>\n</binding>\n\n<binding id="navlist">\n\t<implementation>(Meeko.UI.navlist.prototype)</implementation>\n\t<handlers>\n\t\t<handler event="click">\nvar element = this.boundElement;\nvar item = event.target;\nwhile (item.tagName.toLowerCase() != "li") {\n\tif (item == element) return;\n\titem = item.parentNode;\n}\nthis.selectItem(item);\n\t\t</handler>\n\t</handlers>\n</binding>\n\n<binding id="navlistitem">\n\t<implementation>(Meeko.UI.navlistitem.prototype)</implementation>\n</binding>\n\n<binding id="navlink">\n\t<handlers>\n\t\t<handler event="click" default-action="cancel"></handler>\n\t</handlers>\n</binding>\n\n<binding id="scrollBox">\n\t<implementation>(Meeko.UI.scrollBox.prototype)</implementation>\n</binding>\n\t\n<binding id="scrollBoxWithResize">\n\t<implementation>(Meeko.UI.scrollBoxWithResize.prototype)</implementation>\n</binding>\n\t\n<binding id="switchBox">\n\t<implementation>(Meeko.UI.switchBox.prototype)</implementation>\n</binding>\n\n<binding id="table">\n\t<implementation>(Meeko.UI.table.prototype)</implementation>\n</binding>\n\n<binding id="RepetitionElement">\n\t<implementation>(Meeko.UI.RepetitionElement.prototype)</implementation>\n</binding>\n\n<binding id="WF2FormElement">\n\t<implementation>(Meeko.UI.WF2FormElement.prototype)</implementation>\n\t<handlers>\n\t\t<handler event="submit">\n<![CDATA[\nvar element = this.boundElement;\n// FIXME assumes that the activeElement is a submit button in the form. Is this valid??\nvar button = element.ownerDocument.parentWindow.activeElement; // NOTE relies on window.activeElement as per HTML5 and IE\nthis.submit(button);\n]]>\n\t\t</handler>\n\t\t<handler event="received">\n<![CDATA[\nvar rxStatement = this.boundElement.getAttribute("onreceived");\nif (rxStatement) {\n\tvar rxHandler = eval("function(event) {" + rxStatement + "}");\n\tvar returnValue = rxHandler.call(this.boundElement, event);\n\tif (!returnValue) event.preventDefault();\n}\n]]>\n\t\t</handler>\t\n\t</handlers>\t\n</binding>\n\n<binding id="WF2SubmitButton" element="input[type=submit], button[type=submit]">\n\t<implementation>(Meeko.UI.WF2SubmitButton.prototype)</implementation>\n</binding>\n\n<binding id="WF2TextInput">\n\t<implementation>(Meeko.UI.WF2TextInput.prototype)</implementation>\n\t<handlers>\n\t\t<handler event="textInput">\n<![CDATA[\nvar filter = this.getFilter();\nif (!filter) return true;\nvar r = new RegExp("["+filter+"]");\nif (r.test(event.data)) return true;\nevent.preventDefault();\nreturn false;\n]]>\n\t\t</handler>\n\t</handlers>\n</binding>\n\n<binding id="WF2NumberInput" element="input[type=number]">\n\t<implementation>(Meeko.UI.WF2NumberInput.prototype)</implementation>\n\t<handlers>\n\t\t<handler event="textInput">\n<![CDATA[\nif (event.data.match(/[^0-9.]/)) event.preventDefault();\n]]>\n\t\t</handler>\n\t\t<handler event="keydown" key="Up">this.stepUp(1);</handler>\n\t\t<handler event="keydown" key="Down">this.stepDown(1);</handler>\n\t\t<handler event="mousewheel" default-action="cancel">\n<![CDATA[\nvar delta = Math.round(event.wheelDelta / 40); // FIXME what is an appropriate divisor??\nif (delta > 0) this.stepUp(delta);\nelse this.stepDown(-delta);\n]]>\n\t\t</handler>\n\t</handlers>\n</binding>\n\t\n\t\n<binding id="WF2AddElement" element="input[type=add]" extends="#WF2InputElement">\n\t<handlers>\n\t\t<handler event="click">this.htmlTemplate.addRepetitionBlock(null);</handler>\t\t\t\n\t</handlers>\n</binding>\n\n<binding id="WF2TextAreaElement">\n</binding>\n\t\n<binding id="WF2ButtonElement">\n</binding>\n\t\n<binding id="WF2SelectElement" element="select">\n\t<implementation>(Meeko.UI.WF2SelectElement.prototype)</implementation>\n</binding>\n\t\n<binding id="WF2OutputElement">\n\t<implementation>(Meeko.UI.WF2OutputElement.prototype)</implementation>\n</binding>\n\n<binding id="WF2DatalistElement">\n\t<implementation>(Meeko.UI.WF2DatalistElement.prototype)</implementation>\n</binding>\n\n\n</xbl>\n\t\n';Meeko.stuff.xplSystem.prefetch["http://dist.meekostuff.net/XBLUI/1.1-default/WF2.xml"]='<?xml version="1.0" encoding="UTF-8"?>\r\n<?access-control allow="*"?>\r\n<!--\r\nXBL2 Webforms2 implementation\r\nCopyright 2007, Sean Hogan (http://www.meekostuff.net/)\r\nAll rights reserved\r\n-->\r\n\r\n<xbl xmlns="http://www.w3.org/ns/xbl">\r\n\r\n<binding element="*[@repeat]" extends="UI.xml#RepetitionElement"/>\r\n<binding element="form" extends="UI.xml#WF2FormElement"/>\r\n<binding element="input[type=submit], button[type=submit]" extends="UI.xml#WF2SubmitButton"/>\r\n<binding element="input[type=text]" extends="UI.xml#WF2TextInput"/>\r\n<binding element="input[type=number]" extends="UI.xml#WF2NumberInput"/>\r\n<binding element="textarea" extends="UI.xml#WF2TextAreaElement"/>\r\n<binding element="button" extends="UI.xml#WF2ButtonElement"/>\r\n<binding element="select" extends="UI.xml#WF2SelectElement"/>\r\n<binding element="output" extends="UI.xml#WF2OutputElement"/>\r\n<binding element="datalist" extends="UI.xml#WF2DatalistElement"/>\r\n\r\n</xbl>\r\n';Meeko.stuff.xplSystem.contexts["/Users/shogun70/devel/XBLUI/1.1.0/source/libXBLUI.xhtml"].requiredContexts=[];Meeko.stuff.xplSystem.contexts["/Users/shogun70/devel/XBLUI/1.1.0/source/libXBLUI.xhtml"].params={pkglibdir:"http://dist.meekostuff.net/XBLUI/1.1-default",pkglibdir_aliases:"http://dist.meekostuff.net/XBLUI/default http://dist.meekostuff.net/XBLUI/1.1-default"};Meeko.stuff.xplSystem.contexts["/Users/shogun70/devel/XBLUI/1.1.0/source/libXBLUI.xhtml"].wrappedScript=function(){var xplSystem=Meeko.stuff.xplSystem;var xplContext=xplSystem.contexts["/Users/shogun70/devel/XBLUI/1.1.0/source/libXBLUI.xhtml"];var logger=xplContext.logger;if(!this.Meeko){this.Meeko={};}if(!this.Meeko.stuff){this.Meeko.stuff={};}this.Meeko.stuff.xblSystem=(function(){var system={};system.logger={log:function(){},debug:function(){this.log.apply(this,arguments);},info:function(){this.log.apply(this,arguments);},warn:function(){this.log.apply(this,arguments);},error:function(){this.log.apply(this,arguments);}};system.URL={resolve:function(src,base){var rex=/^([a-z]+):\/\/([^\/]+)(\/.*)$/i;var srcParts=src.match(rex);if(srcParts&&srcParts.length){return src;}if(!base){throw"Base URL is null in URL.resolve()";}var szBase=""+base;var baseParts=szBase.match(rex);if(!(baseParts&&baseParts.length)){throw"Base URL "+szBase+" could not be parsed in URL.resolve()";}var url=baseParts[1]+"://"+baseParts[2];if(src[0]=="/"){url+=src;}else{url+=baseParts[3].replace(/[^\/]*$/,src);}return url;},load:function(options){var method=options.method||"GET";if("GET"!=method&&"get"!=options.method){throw""+method+" method not supported in URL.load()";}var async=options.async||false;if(async){throw"Asynchronous URL.load() not supported.";}var url=options.url;var rq=new XMLHttpRequest();rq.open("GET",url,false);rq.send("");if(rq.status!=200){throw"Error loading "+url;}return rq;}};var loadURL=function(url){var xplSystem=Meeko.stuff.xplSystem;if(xplSystem){var data=xplSystem.prefetch[url];if(data){return{responseText:data};}}return system.URL.load({url:url});};system.XMLDocument={load:function(uri){var rq=new XMLHttpRequest();rq.open("GET",uri,false);rq.send("");if(rq.status!=200){throw"Error loading "+uri;}if(!rq.responseXML){throw"Document is not XML: "+uri;}return rq.responseXML;},loadXML:function(data){var domParser=new DOMParser;var xmlDoc=domParser.parseFromString(data,"application/xml");return xmlDoc;}};var loadXMLDocument=function(uri){var xplSystem=Meeko.stuff.xplSystem;if(xplSystem){var data=xplSystem.prefetch[uri];if(data){return system.XMLDocument.loadXML(data);}}return system.XMLDocument.load(uri);};system.XBLDocument={load:function(uri){var xmlDoc=loadXMLDocument(uri);var xblDoc=new XBLDocument(xmlDoc,uri);return xblDoc;},loadXML:function(data){var xmlDoc=system.XMLDocument.loadXML(data);var xblDoc=new XBLDocument(xmlDoc,window.location);return xblDoc;}};var DomWalker=function(element){this.root=element||document.documentElement;this.current=null;this.index=0;};DomWalker.prototype.forEach=function(fn,context){if(!this.current){this.current=this.root;this.index++;fn.call(context,this.current,this.index,this.root);}OUTER:for(;;){var next=this.current.firstChild;var up=this.current;INNER:while(!next){if(this.root==up){break OUTER;}next=up.nextSibling;up=up.parentNode;}this.current=next;this.index++;if(1==this.current.nodeType){fn.call(context,this.current,this.index,this.root);}}return this.current;};system.Document={addEventListener:function(doc,type,handler,useCapture){return doc.addEventListener(type,handler,useCapture);},removeEventListener:function(doc,type,handler,useCapture){return doc.removeEventListener(type,handler,useCapture);},registerXBLMethods:function(doc,methods){var domListener={};for(var name in methods){domListener[name]=methods[name];}domListener.domWalker=new DomWalker(doc.documentElement);domListener.handleEvent=function(event){switch(event.type){case"DOMNodeInserted":var localWalker=new DomWalker(event.target);localWalker.forEach(this.xblEnteredDocument);break;case"progress":case"DOMContentLoaded":case"load":if(event.target!=document){break;}this.domWalker.forEach(this.xblEnteredDocument);break;case"DOMNodeRemoved":var localWalker=new DomWalker(event.target);localWalker.forEach(this.xblLeftDocument);break;case"unload":this.domWalker.current=null;this.domWalker.forEach(this.xblLeftDocument);break;}};system.Document.addEventListener(doc,"DOMNodeInserted",domListener,true);system.Document.addEventListener(doc,"DOMNodeRemoved",domListener,true);system.Document.addEventListener(doc,"unload",domListener,false);system.Document.addEventListener(doc,"progress",domListener,false);system.Document.addEventListener(doc,"DOMContentLoaded",domListener,false);system.Document.addEventListener(doc,"load",domListener,false);if(doc.readyState=="complete"){domListener.domWalker.forEach(domListener.xblEnteredDocument);}}};system.Element={matchesSelector:function(elt,selector){return elt.matchesSelector(selector);},bind:function(elt){}};function initialize(){registerXBLProcessingInstructions();registerXBLLinkElements();registerXBLStyleElements();configureEventDelegation();}function registerXBLProcessingInstructions(){for(var node=document.firstChild;node;node=node.nextSibling){if(node==document.documentElement){break;}if(node.nodeType!=7){continue;}if("xbl"!=node.target){continue;}var m=node.data.match(/^\s*href=['"]([^'"]*)['"]/);loadBindingDocument(m[1]);}}function registerXBLLinkElements(){var head=document.getElementsByTagName("head")[0];for(var node=head.firstChild;node;node=node.nextSibling){if(node.nodeType!=1){continue;}if(node.tagName.toLowerCase()!="link"){continue;}if(node.rel!="bindings"){continue;}loadBindingDocument(node.href);}}function registerXBLStyleElements(){var head=document.getElementsByTagName("head")[0];for(var node=head.firstChild;node;node=node.nextSibling){if(node.nodeType!=1){continue;}if(node.tagName.toLowerCase()!="style"){continue;}if(node.type!="application/xml"){continue;}var text=node.textContent||node.innerHTML;loadBindingDocumentFromData(text,document.URL);}}var bindingDocuments=[];var xblDocuments={};function loadBindingDocument(uri){var xblDoc=importXBLDocument(uri);if(!xblDoc||!xblDoc.bindings){system.logger.error("Failure loading binding document "+uri);return;}bindingDocuments.push(xblDoc);importDependencies(xblDoc);}function loadBindingDocumentFromData(data,uri){var xblDoc=system.XBLDocument.loadXML(data,uri);if(!xblDoc||!xblDoc.bindings){system.logger.error("Failure loading binding document from data");return;}bindingDocuments.push(xblDoc);importDependencies(xblDoc);}function importXBLDocument(uri){var xblDoc;var absoluteURI=system.URL.resolve(uri,document.URL);xblDoc=xblDocuments[absoluteURI];if(typeof xblDoc!="undefined"){return xblDoc;}try{xblDoc=system.XBLDocument.load(absoluteURI);xblDocuments[absoluteURI]=xblDoc;}catch(error){xblDocuments[absoluteURI]=null;system.logger.error("Failure loading xbl document "+uri);}return xblDoc;}function importDependencies(xblDoc){for(var i=0,binding;binding=xblDoc.bindings[i];i++){if(!binding.element){continue;}importBaseBinding(binding);}}function importBaseBinding(binding){if(!binding.baseBindingURI){return;}if(typeof binding.baseBinding!="undefined"){return;}var m=binding.baseBindingURI.match(/^(.*)#(.*)$/);var xblDoc;if(m[1]==""){xblDoc=binding.xblDocument;}else{var absoluteURI=system.URL.resolve(m[1],binding.xblDocument.documentURI);xblDoc=importXBLDocument(absoluteURI);}var baseBinding=xblDoc.namedBindings[m[2]];if(baseBinding){binding.baseBinding=baseBinding;importBaseBinding(baseBinding);}else{binding.baseBinding=null;}}var handlerTable={};function configureEventDelegation(){for(var i=0,xblDoc;xblDoc=bindingDocuments[i];i++){for(var j=0,binding;binding=xblDoc.bindings[j];j++){if(!binding.element){continue;}registerBinding(binding);}}system.Document.registerXBLMethods(document,{xblEnteredDocument:function(element){callXBLMethod(element,"xblEnteredDocument");},xblLeftDocument:function(element){callXBLMethod(element,"xblLeftDocument");}});}function registerBinding(binding,selector){if(!selector){selector=binding.element;}if(binding.baseBinding){registerBinding(binding.baseBinding,selector);}for(var k=0,handler;handler=binding.handlers[k];k++){var type=handler.event;if(!type){continue;}var phase=handler.phase;if(!handlerTable[type]){system.Document.addEventListener(document,type,dispatchEvent,true);handlerTable[type]=new Array(4);handlerTable[type][1]=[];handlerTable[type][2]=[];handlerTable[type][3]=[];}var handlerRef={selector:selector,binding:binding,handler:handler};if(phase){handlerTable[type][phase].push(handlerRef);}else{handlerTable[type][2].push(handlerRef);handlerTable[type][3].push(handlerRef);}}var xblMethods=["xblEnteredDocument","xblLeftDocument"];for(var method,k=0;method=xblMethods[k];k++){if(!binding.implementation.prototype[method]){continue;}if(!handlerTable[method]){handlerTable[method]=[];}var handlerRef={selector:selector,binding:binding};handlerTable[method].push(handlerRef);}}function callXBLMethod(current,method){var isBound=false;var handlerRefs=handlerTable[method];if(!handlerRefs){return;}for(var i=0,handlerRef;handlerRef=handlerRefs[i];i++){var binding=handlerRef.binding;var selector=handlerRef.selector;if(selector&&!system.Element.matchesSelector(current,selector)){continue;}if(!isBound){system.Element.bind(current);isBound=true;}var internal=new binding.implementation;internal.boundElement=current;var b0=binding,i0=internal;do{var b1=b0.baseBinding;if(!b1){break;}var i1=new b1.implementation;i1.boundElement=current;i0.baseBinding=i1;b0=b1;i0=i1;}while(b0);try{internal[method]();}catch(error){system.logger.debug(error);}}}function dispatchEvent(event){if(event.type!="focus"){event.stopPropagation();}var phase=0,target=event.target,current=target,path=[];for(current=target;current!=document;current=current.parentNode){path.push(current);}function callHandlers(){system.Element.bind(current);var handlerRefs=handlerTable[event.type][phase];for(var i=0,handlerRef;handlerRef=handlerRefs[i];i++){var binding=handlerRef.binding;var selector=handlerRef.selector;var handler=handlerRef.handler;if(selector&&!system.Element.matchesSelector(current,selector)){continue;}if(!handler.matchesEvent(event,{eventPhase:false})){continue;}var internal=new binding.implementation;internal.boundElement=current;var b0=binding,i0=internal;do{var b1=b0.baseBinding;if(!b1){break;}var i1=new b1.implementation;i1.boundElement=current;i0.baseBinding=i1;b0=b1;i0=i1;}while(b0);if(handler.action){try{handler.action.call(internal,event);}catch(error){system.logger.debug(error.message);}}if(handler.defaultPrevented){event.preventDefault();}if(handler.propagationStopped){event.stopPropagation();}}}if(event.__defineGetter__){event.__defineGetter__("currentTarget",function(){return current;});event.__defineGetter__("eventPhase",function(){return phase;});}event.eventStatus=0;event.__preventDefault=event.preventDefault;event.preventDefault=function(){this.eventStatus|=1;};event.__stopPropagation=event.stopPropagation;event.stopPropagation=function(){this.eventStatus|=2;};var evHandlerTable=handlerTable[event.type];phase=1;if(evHandlerTable[phase].length){if(!event.__defineGetter__){event.phase=phase;}for(var n=path.length,i=n-1;i>0;i--){current=path[i];if(!event.__defineGetter__){event.currentTarget=current;}callHandlers();if(event.eventStatus&1){event.__preventDefault();}if(event.eventStatus&2){return;}}}phase=2;if(evHandlerTable[phase].length){if(!event.__defineGetter__){event.phase=phase;}current=path[0];if(!event.__defineGetter__){event.currentTarget=current;}callHandlers();if(event.eventStatus&1){event.__preventDefault();}if(event.eventStatus&2){return;}if(!event.bubbles){return;}}phase=3;if(evHandlerTable[phase].length){if(!event.__defineGetter__){event.phase=phase;}for(var n=path.length,i=1;i<n;i++){current=path[i];if(!event.__defineGetter__){event.currentTarget=current;}callHandlers();if(event.eventStatus&1){event.__preventDefault();}if(event.eventStatus&2){return;}}}return;}var XBLNS="http://www.w3.org/ns/xbl";var HTMLNS="http://www.w3.org/1999/xhtml";var XBLDocument=function(_document,documentURI){if(!(this instanceof arguments.callee)){return new arguments.callee(_document,documentURI);}this._target=_document;this.documentURI=documentURI;this.xblElement=XBLXblElement(_document.documentElement,this);this.bindings=this.xblElement.bindings;this.namedBindings=this.xblElement.namedBindings;};var XBLXblElement=function(_element,_document){if(!(this instanceof arguments.callee)){return new arguments.callee(_element,_document);}var localName=getLocalName(_element);if("xbl"!=localName||XBLNS!=_element.namespaceURI){throw'XBLXblElement interface only valid for "xbl" elements';}this._target=_element;this.xblDocument=_document;this.bindings=[];this.namedBindings=[];this.srcHTMLStyleElements=[];for(var node=_element.firstChild;node;node=node.nextSibling){if(node.nodeType!=1){continue;}var localName=getLocalName(node);if("script"==localName&&XBLNS==node.namespaceURI){var src=node.getAttribute("src");var jsText="";if(src){var uri=system.URL.resolve(src,_document.documentURI);var rq=loadURL(uri);jsText=rq.responseText;execScript(jsText);}else{jsText=getTextContent(node);execScript(jsText);}continue;}if("binding"==localName&&XBLNS==node.namespaceURI){var binding=XBLBindingElement(node,this.xblDocument);this.bindings.push(binding);if(binding.id&&!this.namedBindings[binding.id]){this.namedBindings[binding.id]=binding;}continue;}if("style"==localName&&HTMLNS==node.namespaceURI){var cssText=getTextContent(node);var text=cssText.replace(/url\(\s*['"]?([^)]+)['"]?\s*\)/g,function(all,href){return'url("'+(system.URL.resolve(href,_document.documentURI))+'")';});var styleElt=document.createElement("style");try{styleElt.innerText=text;}catch(error){}if(!styleElt.innerHTML){try{styleElt.innerHTML=text;}catch(error){}}document.getElementsByTagName("head")[0].appendChild(styleElt);if(!styleElt.innerHTML){try{var styleSheets=document.styleSheets;var sheet=styleSheets[styleSheets.length-1];if(sheet.owningElement==styleElt){sheet.cssText=text;}else{throw"Can't import stylesheet from XBL document";}}catch(error){}}continue;}system.logger.warn("Ignoring "+node.tagName+" element: invalid child of xbl:xbl");}};var XBLBindingElement=function(_element,_document){if(!(this instanceof arguments.callee)){return new arguments.callee(_element,_document);}var localName=getLocalName(_element);if("binding"!=localName||XBLNS!=_element.namespaceURI){throw'XBLBindingElement interface only valid for "binding" elements';}this._target=_element;this.xblDocument=_document;var binding=this;var _element=this._target;var _document=this.xblDocument;this.id=_element.getAttribute("id");this.element=_element.getAttribute("element");this.baseBindingURI=_element.getAttribute("extends");this.implementation=function(){};this.handlers=[];this.resources=[];this.template=null;var XBLHandlers=function(_element){for(var node=_element.firstChild;node;node=node.nextSibling){if(node.nodeType!=1){continue;}var localName=getLocalName(node);if("handler"==localName&&XBLNS==node.namespaceURI){var handler=XBLHandlerElement(node,_document);binding.handlers.push(handler);continue;}system.logger.warn("Ignoring "+node.tagName+" element: invalid child of xbl:handlers");}};var implementationElts=[];var handlersElts=[];var resourcesElts=[];var templateElts=[];for(var node=_element.firstChild;node;node=node.nextSibling){if(node.nodeType!=1){continue;}if(XBLNS!=node.namespaceURI){system.logger.warn("Ignoring "+tagName+" element: invalid namespace for child of xbl:binding");continue;}var localName=getLocalName(node);switch(localName){case"implementation":implementationElts.push(node);if(implementationElts.length<=1){var jsText=getTextContent(node);try{this.implementation.prototype=evalScript.call(window,jsText);}catch(error){system.logger.warn("Error in xbl:implementation script");}if(this.implementation.prototype.xblBindingAttached){system.logger.warn("xblBindingAttached not supported");}if(this.implementation.prototype.xblEnteredDocument){system.logger.warn("xblEnteredDocument not supported");}}else{system.logger.warn("Ignoring xbl:implementation element: only first instance is valid");}break;case"template":implementationElts.push(node);if(templateElts.length<=1){system.logger.warn("Ignoring xbl:template element: feature not implemented");this.template=node;}else{system.logger.warn("Ignoring xbl:template element: only first instance is valid");}break;case"handlers":handlersElts.push(node);if(handlersElts.length<=1){XBLHandlers(node);}else{system.logger.warn("Ignoring xbl:handlers element: only first instance is valid");}break;case"resources":resourcesElts.push(node);if(resourcesElts.length<=1){system.logger.warn("Ignoring xbl:resources element: feature not implemented");}else{system.logger.warn("Ignoring xbl:resources element: only first instance is valid");}break;default:system.logger.warn("Ignoring "+node.tagName+" element: invalid child of xbl:binding");break;}}return this;};var XBLHandlerElement=function(_element,_document){if(!(this instanceof arguments.callee)){return new arguments.callee(_element,_document);}var localName=getLocalName(_element);if("handler"!=localName||XBLNS!=_element.namespaceURI){throw'XBLHandlerElement interface only valid for "handler" elements';}this._target=_element;this.xblDocument=_document;this.event=_element.getAttribute("event");if(null==this.event){system.logger.warn("Invalid handler: empty event attribute");}function lookupValue(attrName,lookup){var attrValue=_element.getAttribute(attrName);var result;if(attrValue){result=lookup[attrValue];if(null==result){system.logger.info("Ignoring invalid @"+attrName+": "+attrValue);}}return result;}this.phase=lookupValue("phase",{capture:1,target:2,bubble:3,"default-action":2019716164})||0;this.defaultPrevented=lookupValue("default-action",{cancel:true,perform:false})||false;this.propagationStopped=lookupValue("propagate",{stop:true,"continue":false})||false;function attrText_to_numArray(attr){var attrText=_element.getAttribute(attr);if(!attrText){return null;}var result=[];var strings=attrText.split(/\s+/);for(var n=strings.length,i=0;i<n;i++){var text=strings[i];var num=Number(text);if(NaN!=num&&Math.floor(num)==num){result.push(num);}}return result;}this.button=attrText_to_numArray("button");this.clickCount=attrText_to_numArray("click-count");this.key=_element.getAttribute("key");this.keyLocation=[];var keyLocationText=_element.getAttribute("key-location");var keyLocationStrings=(keyLocationText)?keyLocationText.split(/\s+/):[];for(var n=keyLocationStrings.length,i=0;i<n;i++){var text=keyLocationStrings[i];switch(text){case"standard":this.keyLocation.push(KeyboardEvent.DOM_KEY_LOCATION_STANDARD);break;case"left":this.keyLocation.push(KeyboardEvent.DOM_KEY_LOCATION_LEFT);break;case"right":this.keyLocation.push(KeyboardEvent.DOM_KEY_LOCATION_RIGHT);break;case"numpad":this.keyLocation.push(KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);break;}}this.text=_element.getAttribute("text");this.filter=new RegExp(_element.getAttribute("filter"),"");this.attrName=_element.getAttribute("attr-name");this.attrChange=[];var attrChangeText=_element.getAttribute("attr-change");var attrChangeStrings=(attrChangeText)?attrChangeText.split(/\s+/):[];for(var n=attrChangeStrings.length,i=0;i<n;i++){var text=attrChangeStrings[i];switch(text){case"modification":this.attrChange.push(MutationEvent.MODIFICATION);break;case"addition":this.attrChange.push(MutationEvent.ADDITION);break;case"removal":this.attrChange.push(MutationEvent.REMOVAL);break;}}this.prevValue=_element.getAttribute("prev-value");this.newValue=_element.getAttribute("new-value");if(null!=_element.getAttribute("modifiers")){this.modifiers=[];var modifiersText=_element.getAttribute("modifiers");var modifiersStrings=(modifiersText)?modifiersText.split(/\s+/):[];for(var n=modifiersStrings,i=0;i<n;i++){var text=modifiersStrings[i];var m;m=/^([+-]?)([a-z]+)(\??)$/.exec(text);if(m){var key=m[2];var condition=1;if(m[3]){condition=0;}else{if(m[1]=="+"){condition=1;}else{if(m[1]=="-"){condition=-1;}}}this.modifiers.push({key:key,condition:condition});}}}else{this.modifiers=null;}var jsText=getTextContent(_element);if(jsText){try{this.action=Function("event",jsText);}catch(error){system.logger.warn("Parse error in handler");}}return this;};XBLHandlerElement.prototype.matchesEvent=function(event,fields){var handler=this;var xblEvents={click:true,dblclick:true,mousedown:true,mouseup:true,mouseover:true,mouseout:true,mousemove:true,keydown:true,keyup:true,textInput:true,DOMAttrModified:true,load:true,unload:true,abort:true,error:true,select:true,change:true,submit:true,reset:true,resize:true,scroll:true};var xblMouseEvents={click:true,dblclick:true,mousedown:true,mouseup:true,mouseover:true,mouseout:true,mousemove:true,mousewheel:true};var xblKeyboardEvents={keydown:true,keyup:true};var xblTextEvents={textInput:true};var xblMutationEvents={DOMAttrModified:true};var xblHTMLEvents={load:true,unload:true,abort:true,error:true,select:true,change:true,submit:true,reset:true,resize:true,scroll:true};if(event.type!=handler.event){return false;}if(fields.eventPhase!=false){if(handler.phase&&event.eventPhase!=handler.phase){return false;}else{if(Event.BUBBLING_PHASE!=event.eventPhase&&Event.AT_TARGET!=event.eventPhase){return false;}}}var evType=event.type;if(evType in xblMouseEvents){if(handler.button&&handler.button.length){if(handler.button.indexOf(event.button)==-1){return false;}}if(handler.clickCount&&handler.clickCount.length){var count=1;if("dblclick"==event.type){count=2;}if("click"==event.type){count=(event.detail)?event.detail:1;}if(handler.clickCount.indexOf(count)==-1){return false;}}if(handler.modifiers){if(!this.modifiersMatchEvent(event,handler.modifiers)){return false;}}}var ourKeyIdentifiers={Backspace:"U+0008",Delete:"U+007F",Escape:"U+001B",Space:"U+0020",Tab:"U+0009"};if(evType in xblKeyboardEvents){if(handler.key){var success=false;var keyId=event.keyIdentifier;if(/^U\+00....$/.test(keyId)){keyId=keyId.replace(/^U\+00/,"U+");}if(handler.key!=keyId&&ourKeyIdentifiers[handler.key]!=keyId){return false;}}if(handler.modifiers||handler.key){if(!this.modifiersMatchEvent(event,handler.modifiers||["none"])){return false;}}}if(evType in xblTextEvents){if(handler.text&&handler.text!=event.data){return false;}}if(evType in xblMutationEvents){if(handler.attrName){if(handler.attrName!=event.attrName){return false;}if(handler.attrChange.length>0&&handler.attrChange.indexOf(event.attrChange)<0){return false;}if(MutationEvent.MODIFICATION==event.attrChange||MutationEvent.REMOVAL==event.attrChange){if(null!=handler.prevValue&&handler.prevValue!=event.prevValue){return false;}}if(MutationEvent.MODIFICATION==event.attrChange||MutationEvent.ADDITION==event.attrChange){if(null!=handler.newValue&&handler.newValue!=event.newValue){return false;}}}}if(evType in xblHTMLEvents){}if(!(evType in xblEvents)){}return true;};XBLHandlerElement.prototype.modifiersMatchEvent=function(event){var evMods={control:event.ctrlKey,shift:event.shiftKey,alt:event.altKey,meta:event.metaKey};var modifiers=this.modifiers;var evMods_any=event.ctrlKey||event.shiftKey||event.altKey||event.metaKey;var evMods_none=!evMods_any;var any=false;if(modifiers){for(var i=0,n=modifiers.length;i<n;i++){var modifier=modifiers[i];switch(modifier.key){case"none":if(evMods_any){return false;}break;case"any":any=true;break;default:var active=evMods[modifier.key];switch(modifier.condition){case -1:if(active){return false;}break;case 0:if(active){evMods[modifier.key]=-1;}break;case 1:if(!active){return false;}evMods[modifier.key]=-1;break;}}}}if(any){return true;}for(var key in evMods){if(evMods[key]>0){return false;}}return true;};function execScript(text){var scriptElt=document.createElement("script");scriptElt.type="text/javascript";scriptElt.text=text;if(!scriptElt.innerHTML){scriptElt.appendChild(document.createTextNode(text));}var head=document.getElementsByTagName("head")[0];head.appendChild(scriptElt);}function evalScript(){return eval(arguments[0]);}function getTextContent(element){var text="";if(null!=element.textContent){text=element.textContent;}else{if(null!=element.text){text=element.text;}else{for(var textNode=element.firstChild;null!=textNode;textNode=textNode.nextSibling){if(textNode.nodeType==3||textNode.nodeType==4){text+=textNode.nodeValue;}}}}return text;}function getLocalName(element){return(element.localName)?element.localName:element.tagName.replace(element.prefix+":","");}system.initialize=initialize;return system;})();(function(){var pkglibdir=xplContext.params.pkglibdir;var pkglibdir_aliases=xplContext.params.pkglibdir_aliases.split(" ");for(var base,i=0;base=pkglibdir_aliases[i];i++){xplSystem.prefetch[base+"/UI.js"]=xplSystem.prefetch[pkglibdir+"/UI.js"];xplSystem.prefetch[base+"/UI.xml"]=xplSystem.prefetch[pkglibdir+"/UI.xml"];xplSystem.prefetch[base+"/WF2.xml"]=xplSystem.prefetch[pkglibdir+"/WF2.xml"];}})();};Meeko.stuff.xplSystem.init();