function method(a,b){return function(){a[b].apply(a,arguments)}}var StopIteration={toString:function(){return"StopIteration"}};function forEach(a,b){if(a.next)try{for(;;)b(a.next())}catch(c){if(c!=StopIteration)throw c;}else for(var d=0;d<a.length;d++)b(a[d])}function map(a,b){var c=[];forEach(a,function(d){c.push(b(d))});return c}function matcher(a){return function(b){return a.test(b)}}function hasClass(a,b){var c=a.className;return c&&RegExp("(^| )"+b+"($| )").test(c)}
function insertAfter(a,b){b.parentNode.insertBefore(a,b.nextSibling);return a}function removeElement(a){a.parentNode&&a.parentNode.removeChild(a)}function clearElement(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function isAncestor(a,b){for(;b=b.parentNode;)if(a==b)return true;return false}var nbsp="\u00a0",matching={"{":"}","[":"]","(":")","}":"{","]":"[",")":"("};
function normalizeEvent(a){if(!a.stopPropagation){a.stopPropagation=function(){this.cancelBubble=true};a.preventDefault=function(){this.returnValue=false}}if(!a.stop)a.stop=function(){this.stopPropagation();this.preventDefault()};if(a.type=="keypress"){a.code=a.charCode==null?a.keyCode:a.charCode;a.character=String.fromCharCode(a.code)}return a}
function addEventHandler(a,b,c,d){function e(f){c(normalizeEvent(f||window.event))}if(typeof a.addEventListener=="function"){a.addEventListener(b,e,false);if(d)return function(){a.removeEventListener(b,e,false)}}else{a.attachEvent("on"+b,e);if(d)return function(){a.detachEvent("on"+b,e)}}}function nodeText(a){return a.textContent||a.innerText||a.nodeValue||""}function nodeTop(a){for(var b=0;a.offsetParent;){b+=a.offsetTop;a=a.offsetParent}return b}
function isBR(a){a=a.nodeName;return a=="BR"||a=="br"}function isSpan(a){a=a.nodeName;return a=="SPAN"||a=="span"};