function $(a){return document.getElementById(a)}var global=function(){var a={};a.trim=function(b){return b.replace(/^\s+|\s+$/g,"")};a.d2h=function(b){return b.toString(16)};a.h2d=function(b){return parseInt(b,16)};a.getquerystring=function(){return window.location.search.replace(/^\?/,"")};return a}();global.event=function(){var e={},d=document,c=window,f=[],g="DOMMouseScroll";e.add=function(k,i,j){if(c.addEventListener){k.addEventListener(i,j,false);if(b(i)){k.addEventListener(g,j,false)}return}if(c.attachEvent){var l=i+j,h="e"+l;k[h]=j;k[l]=function(){return k[h](c.event)};k.attachEvent("on"+i,k[l]);f[f.length]={o:k,type:i,func:j}}};e.remove=function(j,h,i){if(c.removeEventListener){j.removeEventListener(h,i,false);if(b(h)){j.removeEventListener(g,i,false)}return}if(c.detachEvent){var k=h+i;j.detachEvent("on"+h,j[k]);j[k]=null;j["e"+k]=null}};function b(h){return(h=="mousewheel")}e.preventdefault=function(h){if(h.preventDefault){h.preventDefault();return}h.returnValue=false};e.gettarget=function(i){var h=i.target||i.srcElement;return(h.nodeType==3)?h.parentNode:h};e.getrelatedtarget=function(h){return h.relatedTarget||((h.type=="mouseover")?h.fromElement:((h.type=="mouseout")?h.toElement:false))};e.getmouseposition=function(j){if(j.pageX||j.pageY){return{x:j.pageX,y:j.pageY}}var i=d.body,h=d.documentElement;if(j.clientX||j.clientY){return{x:j.clientX+i.scrollLeft+h.scrollLeft,y:j.clientY+i.scrollTop+h.scrollTop}}return{x:0,y:0}};e.getmousewheeldir=function(h){return(((h.detail)?(h.detail*-1):h.wheelDelta)<0)?1:-1};e.ismouseenterleave=function(i,j){var h=e.getrelatedtarget(j);return !(!h||a(i,h))};function a(h,i){if(!i){return false}if(h==i){return true}return a(h,i.parentNode)}e.getkeycode=function(h){return h.keyCode||h.which};if(c.detachEvent){e.add(c,"unload",function(){for(var k=0,h=f.length;k<h;k++){e.remove(f[k].o,f[k].type,f[k].func)}f=null})}return e}();