(function(){var c=this,g=c.JUI,f=c.$,b=1,e="_JUI_"+(+new Date),d=JUI=c.JUI=c.$=function(h,i){if(h==c){return d.Window?new d.Window(h):c}if(d.Element){return d.Element(h,false)}if(d.Selector){return h.indexOf("#")===0?document.getElementById(tag.replace("#","")):d.Selector(h)}return d.type(h)==="string"?document.getElementById(h.replace(/^#/,"")):h};var a={initialize:function(m){m=m||{};var i=m.initialize;var h=m.legacy;var l=m.name||JUI.name;var k=i||h;var j=m.protect;var n=m.afterImplement||function(){};k.constructor=this.initialize;k.$family={name:l.toLowerCase()};if(h&&i){k.prototype=h.prototype}k.prototype.constructor=k;k.prototype.$family=k.$family;var o=function(r,p,s,q){if(!j||q||!r.prototype[p]){r.prototype[p]=s}n.call(r,p,s);return r};k.alias=function(r,p,s){if(typeof r=="string"){if((r=this.prototype[r])){return o(this,p,r,s)}}for(var q in r){this.alias(q,r[q],p)}return this};k.genericize=function(q,p){if(typeof q=="string"){if((!p||!this[q])&&typeof this.prototype[q]=="function"){this[q]=function(){var s=Array.prototype.slice.call(arguments);return this.prototype[q].apply(s.shift(),s)}}return}for(var r=0;r<q.length;r++){this.genericize(q[r],p)}return this};k.implement=function(r,q,t){if(typeof r=="string"){return o(this,r,q,t)}for(var s in r){o(this,s,r[s],q)}return this}},genericize:function(h,i){h&&h.genericize(i)},implement:function(j,i){var h=j.length;while(h--){j[h].implement(i)}}};d.Native=a;(function(){var h={Array:Array,Boolean:Boolean,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String,JUI:d};for(var m in h){a.initialize({name:m,initialize:h[m],protect:true})}var l={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};for(var k in l){for(var j=l[k].length;j--;){a.genericize(c[k],l[k])}}})();d.name="jui";d.version="1.0.2.0";d.type=function(h){if(h==undefined){return false}if(h.$family){return(h.$family.name=="number"&&!isFinite(h))?false:h.$family.name}if(h.nodeName){switch(h.nodeType){case 1:return"element";case 3:return(/\S/).test(h.nodeValue)?"textnode":"whitespace"}}else{if(typeof h.length=="number"){if(h.callee){return"arguments"}else{if(h.item){return"collection"}}}}return typeof h};d.empty=function(){};d.noConfilict=function(h){c.$=f;h&&(c.JUI=g);return this};d.extend=function(l,j){if(!j){throw"Failed! Inherit from a null object"}var h=j.prototype,k=function(){};k.prototype=h;var i=new k();l.prototype=i;i.constructor=l;l.superclass=h;if(j!=Object&&h.constructor==Object.prototype.constructor){h.constructor=j}return l};d.now=function(){return +new Date};d.getUid=(c.ActiveXObject)?function(h){return(h[e]||(h[e]=[b++]))[0]}:function(h){return h[e]||(h[e]=b++)}})();(function(b){var a=function(e){if(e&&!e.$family){var c=a.prototype;for(var d in c){e[d]=c[d]}}return e};b.Native.initialize({name:"Window",legacy:window.Window?window.Window:null,initialize:a,afterImplement:function(d,c){window[d]=a.prototype[d]=c}});a.implement({dimension:function(e){var d=document.documentElement.clientWidth||document.body.clientWidth||window.innerWidth,c=document.documentElement.clientHeight||document.body.clientHeight||window.innerHeight;if(e){d=e.width===undefined?d:e.width;c=e.height===undefined?c:e.height;window.resizeTo(d,c);return this}return{width:d,height:c}},scrollPos:function(e){if(e){(e.x!==undefined)&&(window.scrollLeft=e.x);(e.y!==undefined)&&(window.scrollTop=e.y);return this}var d=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop;return{x:d,y:c}}});b.Window=a})(JUI);(function(b){var a=(function(){var r={},l={},k={},e={"class":"className"},d=/^(?:(?:([-]?\d*)(n{1}))?([-+]?\d*)|(odd|even))$/,q=/((?:[_a-zA-Z][\w-]*)|\*)|(?:#([\w-]+))|(?:\.([\w-]+))|(?:\[([a-z]+\w*)+([~\|\^\$\*!]?=)?['"]?([^\]]*?)["']?\])|(?::([\-\w]+)(?:\(['"]?(.+?)["']?\))*)|(?:\s*((?:[>+~\s,])|$)\s*)/g;(function(){var v=document.createElement("div"),w=(new Date()).getTime();v.innerHTML='<a name="'+w+'" class="€ b"></a>';l.qsa=!!(v.querySelectorAll&&v.querySelectorAll(".€").length)})();function u(w){var v=b.getUid(w);return(r[v])?null:(r[v]=true)}function f(v){return v.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&")}function m(v){return{combinator:v||" ",tag:"*",id:null,classes:[],attributes:[]}}function p(y){if(k[y]){return k[y]}var x=[],B=[],v,w,A,z=sli=ci=ai=pi=0;v=m();q.lastIndex=0;while(w=q.exec(y)){if(w[1]){v.tag=w[1].toUpperCase()}else{if(w[2]){v.id=w[2]}else{if(w[3]){v.classes[ci++]=w[3]}else{if(w[4]){v.attributes[ai++]={key:w[4],op:w[5],value:w[6]}}else{if(w[9]){B[z++]=v;if(w[9]==","){x[sli++]=B;B=[];z=0;A=null}else{A=w[9]}v=m(A);ci=ai=pi=0}else{break}}}}}}B[z++]=v;x[sli++]=B;return k[y]=x}var s={" ":function(w,x,z,B){var y,C,A=0,v=z.length;y=x.getElementsByTagName(w);if(B){while(C=y[A++]){C.nodeType==1&&B(C)&&(z[v++]=C)}}else{while(C=y[A++]){C.nodeType==1&&(z[v++]=C)}}return z}};var i={" ":function(w,v){while(w=w.parentNode){if(w==v||(v==document&&w.documentElement)){return true}}return false}};var h={"=":function(v){return v},"~=":function(v){return new RegExp("(?:^|\\s+)"+f(v)+"(?:\\s+|$)")},"!=":function(v){return v},"^=":function(v){return new RegExp("^"+f(v))},"$=":function(v){return new RegExp(f(v)+"$")},"*=":function(v){return new RegExp(f(v))},"|=":function(v){return new RegExp("^"+f(v)+"-?")}};var o={"=":function(v,w){return v==w},"~=":function(v,w){return w.test(v)},"!=":function(v,w){return v!=w},"^=":function(v,w){return w.test(v)},"$=":function(v,w){return w.test(v)},"*=":function(v,w){return w.test(v)},"|=":function(v,w){return w.test(v)}};var n={klass:function(v,w){var B,y=0,x=[],z=0,A;A=new RegExp("(?:^|\\s+)"+f(w)+"(?:\\s+|$)");while(B=v[y++]){A.test(B.className)&&(x[z++]=B)}return x},attribute:function(w,A){var x,y=0,z=[],v=0,C,D=e[A.key]||A.key,B=/^(?:src|href|action)$/.test(D)?2:0;if(A.op){C=h[A.op](A.value);while(x=w[y++]){o[A.op](x[D]||x.getAttribute(D,B),C)&&(z[v++]=x)}}else{while(x=w[y++]){((x[D]||x.getAttribute(D,B))!=null)&&(z[v++]=x)}}return z}};function t(z,B){var D=[],E,C=0,F,H=u,w=z.combinator,v=z.id,G=z.tag,y=z.classes,A=z.attributes;if(v){var x=document.getElementById(v);if(G=="*"||x.tagName==G){while(cxt=B[C++]){if(i[w](x,cxt)){D=[x];break}}}}else{if(G){C=0;r={};if(B.length==1){H=false}while(cxt=B[C++]){D=s[w](G,cxt,D,H)}}}if(y.length>(C=0)){while(F=y[C++]){D=n.klass(D,F)}}if(A.length>(C=0)){while(F=A[C++]){D=n.attribute(D,F)}}return D}function j(x,y){var w=0,v;r={};nthNodesCache={};while(v=x[w++]){y=t(v,y)}return y}function g(v,A){var y=[],x=0,z,w=p(v);while(z=w[x++]){if(y.length>0){y=j(z,A).concat(y)}else{y=j(z,A)}}return y}function c(A,w){var y=0,z,x,B,v;w=w[0][0];if(w.id&&w.id!=A.id){return false}if(w.classes.length>(y=0)){while(z=w.classes[y++]){if(!(new RegExp("(?:^|\\s+)"+f(z)+"(?:\\s+|$)")).test(A.className)){return false}}}if(w.attributes.length>(y=0)){while(z=w.attributes[y++]){x=e[z.key];v=/^(?:src|href|action)$/.test(x)?2:0;x=A[x]||A.getAttribute(x,v);if(z.op){if(!o[z.op](x,h[z.op](z.value))){return false}}else{if(x==null){return false}}}}return true}return function(v,w){if(!v||typeof v!=="string"){return[]}w=w||document;if(w.nodeType!==1&&w.nodeType!==9){return[]}if(l.qsa){try{return w.querySelectorAll(v)}catch(x){return g(v,[w])}}else{return g(v,[w])}}})();b.Selector=a})(JUI);(function(e){var k={};(function(){var n=document.createElement("div"),p="_jui_"+(new Date()).getTime(),m;n.innerHTML='   <link/><table></table><a name="'+p+'" class="€ b" href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select>';k={opacity:(typeof n.style.opacity)!=="undefined"?true:false,innerText:(typeof n.innerText)!=="undefined"?true:false,leadingWhitespace:n.firstChild&&n.firstChild.nodeType==3,cssFloat:!(n.style.cssFloat===undefined),cloneEvent:false,tbody:false,htmlSerialize:false};if(n.getElementsByTagName){k.tbody=!!n.getElementsByTagName("tbody").length;k.htmlSerialize=!!n.getElementsByTagName("link").length}if(n.attachEvent&&n.fireEvent){n.attachEvent("onclick",function o(){k.cloneEvent=true;n.detachEvent("onclick",o)});n.cloneNode(true).fireEvent("onclick")}})();function i(m){return m.replace(/-\D/g,function(n){return n.charAt(1).toUpperCase()})}function d(m){return m.replace(/[A-Z]/g,function(n){return("-"+n.charAt(0).toLowerCase())})}var f={"class":"className","for":"htmlFor","float":k.cssFloat?"cssFloat":"styleFloat",text:k.innerText?"innerText":"textContent"},j={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"},h={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};(function(){var z=["Top","Right","Bottom","Left"],q="margin",n="padding",y="border",s=z.length,v;while(v=z[--s]){var x=q+v,w=n+v,u=y+v;h[q][x]=j[x]="@px";h[n][w]=j[w]="@px";h[y][u]=j[u]="@px @ rgb(@, @, @)";var r=u+"Width",t=u+"Style",o=u+"Color";h[u]={};h.borderWidth[r]=h[u][r]=j[r]="@px";h.borderStyle[t]=h[u][t]=j[t]="@";h.borderColor[o]=h[u][o]=j[o]="rgb(@, @, @)"}})();var b={compact:true,nowrap:true,ismap:true,declare:true,noshade:true,checked:true,disabled:true,readonly:true,multiple:true,selected:true,noresize:true,defer:true};var c=function(m,t){if(t!==false){if(e.type(m)!=="string"){var n=[];for(var s in m){n.push(new c(s,m[s]))}return new a(n)}var r=l(document.createElement(m));if(t){if(t.style){r.css(t.style);delete t.style}if(t.html){r.html(t.html)}}r.attr(t);return r}if(e.type(m)!=="string"){return e.type(m)=="collection"?new a(m,false):l(m)}var r,o,q=/^#([\w-]+)$/;if(q.test(m)||!e.Selector){return l(document.getElementById(m.replace("#","")))}else{o=e.Selector(m);return new a(o,false)}};var a=function(n){if(n&&n.$family!=="elements"){var m=0,r=[];while((r[m]=l(n[m++]))){}r.length--;var o=a.prototype;for(var q in o){r[q]=o[q]}n=r}return n};function l(m){if(m&&!m.$family&&!(/^object|embed$/i).test(m.tagName)){var n=c.prototype;for(var o in n){m[o]=n[o]}}return m}e.Native.initialize({name:"Element",initialize:c,protect:true,afterImplement:function(m,n){if(Array[m]){return}a.implement(m,function(){var o=[],s=true;for(var q=0,p=this.length;q<p;q++){var r=this[q][m].apply(this[q],arguments);o.push(r);if(s){s=(e.type(r)=="element")}}return(s)?new a(o,false):o})}});e.Native.initialize({name:"Elements",initialize:a,protect:true});function g(s){var t=/^<(\w+)\s*\/?>$/.exec(s);if(t){return document.createElement(t[1])}var u=[],p=[],m=document.createElement("div");s=s.replace(/(<(\w+)[^>]*?)\/>/g,function(x,y,w){return w.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?x:y+"></"+w+">"});var v=s.replace(/^\s+/,"").substring(0,10).toLowerCase();var o=!v.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!v.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||v.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!v.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!v.indexOf("<td")||!v.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!v.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!k.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];m.innerHTML=o[1]+s+o[2];while(o[0]--){m=m.lastChild}if(k.tbody){var n=/<tbody/i.test(s),r=!v.indexOf("<table")&&!n?m.firstChild&&m.firstChild.childNodes:o[1]=="<table>"&&!n?m.childNodes:[];for(var q=r.length-1;q>=0;--q){if((r[q].tagName=="TBODY")&&!r[q].childNodes.length){r[q].parentNode.removeChild(r[q])}}}if(!k.leadingWhitespace&&/^\s/.test(s)){m.insertBefore(document.createTextNode(s.match(/^\s*/)[0]),m.firstChild)}return m.firstChild}c.implement({hasClass:function(m){return(" "+this.className+" ").indexOf(" "+m+" ")>-1},addClass:function(m){if(!this.hasClass(m)){this.className=this.className===""?m:(this.className+" "+m)}return this},removeClass:function(m){this.className=this.className.replace(new RegExp("(^|\\s)"+m+"(?:\\s|$)","g"),"$1");return this},setStyle:function(q,r){if(q=="opacity"){if(k.opacity){this.style.opacity=r/100}else{this.style.filter=(this.style.filter||"").replace(/alpha\([^)]*\)/,"")+(r+""=="NaN"?"":"alpha(opacity="+r+")");this.zoom=1}return}q=f[q]||i(q);var p=e.type(r);if(p!="string"){r=(p!="array"&&p!="arguments")?[r]:r;var m=(j[q]||"@").split(" "),o=m.length,n;while(o--){n=r[o];if(!(n===0||n)){m[o]=""}else{m[o]=e.type(n)=="number"?m[o].replace("@",Math.round(n)):n}}r=m.join(" ")}else{if(r==""+Number(r)){r=Math.round(r)}}try{this.style[q]=r}catch(s){}return this},getStyle:function(p){if(p=="opacity"){if(k.opacity){return(this.style.opacity=="")?100:this.style.opacity*100}else{return this.style.filter&&this.style.filter.indexOf("opacity=")>=0?parseFloat(this.style.filter.match(/opacity=([^)]*)/)[1]):100}}p=f[p]||i(p);var m=this.style[p];if(!(m===0||m)){m=[];for(var n in h){if(p!=n){continue}for(var o in h[n]){m.push(this.getStyle(o))}return m.join(" ")}if(this.currentStyle){return this.currentStyle[p]}var q=this.getDocument().defaultView.getComputedStyle(this,null);return(q)?q.getPropertyValue([d(p)]):null}return m},css:function(m,n){if(e.type(m)=="object"){for(var o in m){this.setStyle(o,m[o])}return this}if(n===undefined){return this.getStyle(m)}else{this.setStyle(m,n);return this}},getProperty:function(m){var n=f[m]||m;var o=(this[n]===undefined)?this.getAttribute(m,2):this[n];return(b[m])?!!o:(n)?o:o||null},setProperty:function(m,p){var o=f[m]||m;if(o&&b[o]){p=!!p}var n=/href|src|style/.test(o);(o in this&&!n)?this[o]=p:this.setAttribute(m,""+p);return this},attr:function(m,o){if(e.type(m)=="object"){for(var n in m){this.setProperty(n,m[n])}return this}if(o===undefined){return this.getProperty(m)}else{this.setProperty(m,o);return this}},dimension:function(m){if(!(m===0||m)){return{width:this.offsetWidth,height:this.offsetHeight}}if(m.width!==undefined){this.css("width",m.width)}if(m.height!==undefined){this.css("height",m.height)}return this},position:function(q){if(q===undefined){if(this.parentNode===null||this.style.display=="none"){return false}if(this.getBoundingClientRect){box=this.getBoundingClientRect();var n=Math.max(document.documentElement.scrollTop,document.body.scrollTop);var o=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);return{x:box.left+o,y:box.top+n}}else{if(document.getBoxObjectFor){box=document.getBoxObjectFor(this);var m=(this.style.borderLeftWidth)?parseInt(this.style.borderLeftWidth):0;var p=(this.style.borderTopWidth)?parseInt(this.style.borderTopWidth):0;q=[box.x-m,box.y-p]}else{q=[this.offsetLeft,this.offsetTop];parent=this.offsetParent;if(parent!=this){while(parent){q[0]+=parent.offsetLeft;q[1]+=parent.offsetTop;parent=parent.offsetParent}}if(this.style.position=="absolute"){q[0]-=document.body.offsetLeft;q[1]-=document.body.offsetTop}}}if(this.parentNode){parent=this.parentNode}else{parent=null}while(parent&&parent.tagName!="BODY"&&parent.tagName!="HTML"){q[0]-=parent.scrollLeft;q[1]-=parent.scrollTop;if(parent.parentNode){parent=parent.parentNode}else{parent=null}}return{x:q[0],y:q[1],left:q[0],top:q[1]}}if(q.x!==undefined){this.css("left",q.x)}if(q.y!==undefined){this.css("top",q.y)}return this}});c.implement({getDocument:function(){return this.ownerDocument},getElement:function(m){var n=[];if(e.Selector){n=e.Selector(m,this)}else{n=this.getElementsByTagName(m)}return n[0]?new c(n[0],false):null},getElements:function(m){if(e.Selector){return new a(e.Selector(m,this),false)}else{return new a(this.getElementsByTagName(m),false)}}});c.implement({txt:function(m){if(m===undefined){return this[k.innerText?"innerText":"textContent"]}else{this.html(m.escapeHTML());return m}},html:function(m){if(m!==undefined){this.innerHTML=m}return this.innerHTML},clone:function(n){n=n!==false;if(k.cloneEvent){var m=this.outerHTML;if(!m){var o=this.ownerDocument.createElement("div");o.appendChild(this.cloneNode(n));m=o.innerHTML}return new c(g(m.replace(new RegExp(e.expando+'="(?:\d+|null)"',"g"),"").replace(/^\s*/,"")),false)}else{return new c(this.cloneNode(n),false)}},prepend:function(m){if(this.firstChild){this.insertBefore(m,this.firstChild)}else{this.appendChild(m)}return this},append:function(m){this.appendChild(m);return this},inject:function(m,n){if(n=="top"){this.prependTo(m)}else{this.appendTo(m)}return this},insert:function(m,n){if(n=="after"){this.after(m)}else{this.before(m)}return this},before:function(m){this.parentNode.insertBefore(m,this);return this},after:function(m){var n=this.parentNode;if(this.nextSibling){n.insertBefore(m,this.nextSibling)}else{n.appendChild(m)}return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},empty:function(){var n=this.childNodes,m;for(var m=n.length;m>0;m--){n[m]&&e(n[m]).destroy()}return this},destroy:function(){this.empty();this.dispose();this.removeEvents();return null}});c.alias({dispose:"remove"});e.Element=c;e.Elements=a})(JUI);(function(c){var d=[],a={};c.Element&&d.push(c.Element);c.Window&&d.push(c.Window);function b(e,g){var f=e.length;while(f){if(e[f--]==g){return true}}return false}c.Native.implement(d,{cache:function(e,g){var f=c.getUid(this);if(e&&!a[f]){a[f]={}}if(g!==undefined){a[f][e]=g;return g}return e?a[f][e]:f},erase:function(e){var f=c.getUid(this);if(e){if(a[f]){delete a[f][e];e="";for(e in a[f]){break}(!e)&&this.erase()}}else{delete a[f]}return this}});c.Native.implement(d,{addEvent:function(i,h,k,j){var f=this.cache("events")||this.cache("events",{});k=k?k:this;f[i]=f[i]||{keys:[],values:[]};if(!j&&b(f[i].keys,h)){return this}var g=function(l){if(c.Event){l=new c.Event(l)}h.call(k,l)};if(i=="unload"){var e=g;g=function(){self.removeListener("unload",g);e()}}if(this.addEventListener){this.addEventListener(i,g,false)}else{this.attachEvent("on"+i,g)}f[i].keys.push(h);f[i].values.push(g);return this},removeEvent:function(k,j){var h=this.cache("events");if(!h||!h[k]){return this}if(!j){var g=0,e=h[k].keys;while(j=e[g++]){this.removeEvent(k,j)}delete h[k];k="";for(k in h){break}if(!k){this.erase()}else{this.cache("events",h)}return this}var m=-1,g=0,l;while(l=h[k].keys[g]){if(l==j){m=g;break}g++}if(m==-1){return this}h[k].keys.splice(m,1);j=h[k].values.splice(m,1)[0];if(this.removeEventListener){this.removeEventListener(k,j,false)}else{this.detachEvent("on"+k,j)}return this},addEvents:function(e){for(var f in e){this.addEvent(f,e[f])}return this},removeEvents:function(e){if(c.type(e)=="object"){for(var g in e){this.removeEvent(g,e[g])}return this}var f=this.cache("events");if(!f){return this}if(!e){for(var g in f){this.removeEvent(g)}this.erase("events")}else{this.removeEvent(e)}return this},fireEvent:function(j,h,f){var n=this.cache("events");if(!n||!n[j]){return this}var e=0,l=n[j].keys,k,g,m=this;while(k=l[e++]){g=function(i){return function(){i.apply(m,h)}};setTimeout(g(k),f)}return this}})})(JUI);(function(c){var b={"8":"backspace","9":"tab","13":"enter","27":"esc","32":"space","38":"up","40":"down","37":"left","39":"right","46":"delete"};var a=function(d){if(d.$family==="event"){return d}var n=document,i=window,m=d.type;var j=d.target||d.srcElement;while(j&&j.nodeType==3){j=j.parentNode}if(/key/.test(m)){var e=d.which||d.keyCode;var o=b[e];if(m=="keydown"){var g=e-111;if(g>0&&g<13){o="f"+g}}o=o||String.fromCharCode(e).toLowerCase()}else{if(m.match(/(click|mouse|menu)/i)){n=(!n.compatMode||n.compatMode=="CSS1Compat")?n.documentElement:n.body;var l={x:d.pageX||d.clientX+n.scrollLeft,y:d.pageY||d.clientY+n.scrollTop};var f={x:(d.pageX)?d.pageX-i.pageXOffset:d.clientX,y:(d.pageY)?d.pageY-i.pageYOffset:d.clientY};if(m.match(/DOMMouseScroll|mousewheel/)){var k=(d.wheelDelta)?d.wheelDelta/120:-(d.detail||0)/3}var h=(d.which==3)||(d.button==2)}}return(function(r,q){for(var s in q){r[s]=q[s]}return r})(this,{event:d,type:m,page:l,client:f,rightClick:h,wheel:k,target:j,code:e,key:o,shift:d.shiftKey,control:d.ctrlKey,alt:d.altKey,meta:d.metaKey})};c.Native.initialize({name:"Event",initialize:a,protect:true});a.implement({stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});c.Event=a})(JUI);
