function $bySelector(a){var b=document.getElementsByTagName(a),c=[],d=b.length;for(var e=0;e<d;e++)c[e]=b[e];return c}function $me(a){a=$(a);if(!a||!a.tagName)return a;if(a.$hasInit)return a;for(var b in MEC.prototype)a[b]=MEC.prototype[b];return a}function $callevent(a){var b=$list2arr(arguments).$sublist(1).$map($wraphe);return function(c){var d=b.$map($unwraphe),e=d.shift();d=[c?c:window.event].concat(d);return a.apply(e,d)}}function $callmethod(a){var b=$list2arr(arguments).$sublist(1).$map($wraphe);return function(){var c=b.$map($unwraphe),d=c.shift();return a.apply(d,c)}}function $list2arr(a){var b=[],c=a.length;for(var d=0;d<c;d++)b[d]=a[d];return b}function $def(a){return typeof a!="undefined"}function $max(a,b){return a>b?a:b}function $unwraphe(a){if(a instanceof HEWrap)return a.$deref();return a}function $wraphe(a){if(a.tagName)return new HEWrap(a);return a}function $id(a){a=$(a);return a.id?a.id:a.id=$newid()}function $(a){return typeof a=="string"?document.getElementById(a):a}function HEWrap(a){this.Id=$id(a)}function MEC(){}var ME=new MEC;MEC.prototype.$hasInit=1,MEC.prototype.$event=function(a,b,c){var d=this;c=c||!1,d==document&&!document.all&&(d=window),d.addEventListener?d.addEventListener(a,b,c):d.attachEvent&&d.attachEvent("on"+a,b)},MEC.prototype.$revent=function(a,b,c){var d=this;c=c||!1,d==document&&!document.all&&(d=window),d.removeEventListener?d.removeEventListener(a,b,c):d.detachEvent&&d.detachEvent("on"+a,b)},MEC.prototype.$show=function(){this.style.display=""},MEC.prototype.$hide=function(){this.style.display="none"},MEC.prototype.$cadd=function(a){if(this.className.indexOf(a)==-1){this.className=this.className+" "+a;return 1}return 0},MEC.prototype.$crem=function(a){var b=this.className.indexOf(a);if(b!=-1){b!=0?b--:b,this.className=this.className.substr(0,b)+" "+this.className.substr(b+a.length+1);return 1}return 0},MEC.prototype.$cstyle=function(a){var b=!1;document.defaultView&&document.defaultView.getComputedStyle?b=document.defaultView.getComputedStyle(this,"").getPropertyValue(a.replace(/[A-Z]/g,function(a,b){return"-"+a.toLowerCase()})):this.currentStyle&&(b=this.currentStyle[a]);return b},MEC.prototype.$parentToSelector=function(a){a=a.toUpperCase();var b=this.parentNode;while(b&&b.tagName&&b.tagName.toUpperCase()!=a)b=b.parentNode;return b},MEC.prototype.$siblingToSelector=function(a){a=a.toUpperCase();var b=this.nextSibling;while(b&&(!b.tagName||b.tagName.toUpperCase()!=a))b=b.nextSibling;return b},HEWrap.prototype.$deref=function(){return $(this.Id)},$newid=function(){var a=1;return function(){return"GeneratedId"+a++}}(),$def(Array.prototype.push)||(Array.prototype.push=function(a){this[this.length]=a}),$def(Array.prototype.pop)||(Array.prototype.pop=function(){if(this.length==0)return"";var a=this[this.length-1];this.length--;return a}),$def(Array.prototype.shift)||(Array.prototype.shift=function(){if(this.length==0)return"";var a=this[0];for(var b=1;b<this.length;b++)this[b-1]=this[b];this.length--;return a}),Array.prototype.$for=function(a){var b=this.length;for(var c=0;c<b;c++)a(this[c])},Array.prototype.$map=function(a){var b=[],c=this.length;for(var d=0;d<c;d++)b[d]=a(this[d]);return b},Array.prototype.$reduce=function(a){var b,c=this.length;for(var d=0;d<c;d++)b=a(b,this[d]);return b},Array.prototype.$each=function(a){var b=this.length;for(var c=0;c<b;c++)a(this[c]);return this},Array.prototype.$clone=function(){return this.concat()},Array.prototype.$sublist=function(a,b){var c=[];if(a>b)return c;$def(b)||(b=this.length-1);for(var d=a,e=0;d<=b;d++,e++)c[e]=this[d];return c},navigator&&(document.meIsIE=navigator.userAgent.indexOf("MSIE")!=-1?1:0,document.meIsMoz=navigator.userAgent.indexOf("Gecko/")!=-1?1:0,document.meIsOpera=navigator.userAgent.indexOf("Opera")!=-1?1:0,document.meIsKonq=navigator.userAgent.indexOf("KHTML")!=-1?1:0)
