global.dom=function(){function s(b,c,g){for(;b=g?b.previousSibling:b.nextSibling;)if(b.nodeName.toLowerCase()==c)return b;return null}var i={},m=window,k=document;i.getprevioussibling=function(b,c){return s(b,c,true)};i.getnextsibling=function(b,c){return s(b,c)};i.getnodeposition=function(b){for(var c=0,g=0;b.offsetParent;){c+=b.offsetLeft;g+=b.offsetTop;b=b.offsetParent}return{left:c,top:g}};i.insertbefore=function(b,c){c.parentNode.insertBefore(b,c)};i.insertafter=function(b,c){c.parentNode.insertBefore(b,
c.nextSibling)};i.removechildren=function(b){for(;b.firstChild;)b.removeChild(b.firstChild)};i.isnodecomplete=function(b){for(;b&&!b.nextSibling;)b=b.parentNode;return b?true:false};i.node=function(b,c,g){b=k.createElement(b);if(c)for(var h in c){var o=c[h];if(h=="opacity")i.setopacity(b,o);else{if(h=="class")h="className";if(h=="for")h="htmlFor";b[h]=o}}if(g){h=0;for(c=g.length;h<c;h++){o=g[h];b.appendChild(typeof o=="string"?k.createTextNode(o):o)}}return b};i.setnodecss=function(b,c){for(var g in c){var h=
c[g];if(g=="opacity")i.setopacity(b,h);else b.style[g]=h}};i.setopacity=function(b,c){c=c>1?1:c<0?0:Math.round(c*1E3)/1E3;b=b.style;b.filter="alpha(opacity="+Math.floor(c*100)+")";b.KhtmlOpacity=c;if(c==1)c=0.9999999;b.opacity=c;b.MozOpacity=c};i.getviewportdim=function(){var b=k.documentElement||null,c=b&&b.clientWidth?b.clientWidth:null,g=0,h=0;if(m.innerWidth){g=c||m.innerWidth;h=m.innerHeight}else if(c){g=c;h=b.clientHeight}else if(k.body){g=k.body.clientWidth;h=k.body.clientHeight}return{width:g,
height:h}};i.getpagedim=function(){var b=k.body||null,c=0,g=0;if(b)if(m.innerHeight&&m.scrollMaxY){c=b.scrollWidth;g=m.innerHeight+m.scrollMaxY}else if(b.scrollHeight>b.offsetHeight){c=b.scrollWidth;g=b.scrollHeight}else{c=b.offsetWidth;g=b.offsetHeight}return{width:c,height:g}};i.getpagescroll=function(){if(m.pageYOffset)return m.pageYOffset;var b=k.documentElement||null;if(b&&b.scrollTop)return b.scrollTop;if(k.body)return k.body.scrollTop;return 0};return i}();
global.dom.animation=function(){function s(){for(var a=0,f=0,e=[],d=0,l=h.length;d<l;d++){var j=h[d];if(j){a++;var p=j.el,q=j.css,r=j.current,n=j.easing(j.frame,r.framecount,r.from,r.to-r.from);n=q!="opacity"?Math.floor(n):n;j.value=n;if(p&&q)if(q=="bgx")m(p,n,"*");else if(q=="bgy")m(p,"*",n);else if(q=="opacity")global.dom.setopacity(p,n);else p.style[q]=n+"px";j.handler&&j.handler(n,p);if(j.frame++>=r.framecount){i(j);f++;if(j.finish)e[e.length]=j}}}if(a==f){window.clearInterval(g);g=null}a=0;for(l=
e.length;a<l;a++)e[a].finish(e[a])}function i(a){if(!(a.index<0)){a.running=false;h[a.index]=false;a.index=-1}}function m(a,f,e){a=a.style;var d;if(!(d=c.exec(a.backgroundPosition)))d=[,0,"px",0,"px"];if(f!="*"){d[1]=f;d[2]="px"}if(e!="*"){d[3]=e;d[4]="px"}a.backgroundPosition=d[1]+d[2]+" "+d[3]+d[4]}function k(a){for(var f=-1,e=a.current,d=e.framecount,l=e.to>e.from;f++<d;){var j=a.easing(f,d,e.from,e.to-e.from);if(l&&j>a.value||!l&&j<a.value){a.frame=f;return}}a.frame=0}var b={},c=/^(\d+)([^ ]*) (\d+)(.*)$/,
g=null,h=[],o={none:function(a,f,e,d){return d*a/f+e},easein:function(a,f,e,d){return d*(a/=f)*a+e},easeout:function(a,f,e,d){return-d*(a/=f)*(a-2)+e},backin:function(a,f,e,d){return d*(a/=f)*a*(2.70158*a-1.70158)+e},backout:function(a,f,e,d){return d*((a=a/f-1)*a*(2.70158*a+1.70158)+1)+e},bouncein:function(a,f,e,d){return d-o.bounceout(f-a,f,0,d)+e},bounceout:function(a,f,e,d){if((a/=f)<1/2.75)return d*7.5625*a*a+e;if(a<2/2.75)return d*(7.5625*(a-=1.5/2.75)*a+0.75)+e;if(a<2.5/2.75)return d*(7.5625*
(a-=2.25/2.75)*a+0.9375)+e;return d*(7.5625*(a-=2.625/2.75)*a+0.984375)+e}};b.tween=function(a,f,e,d,l){this.el=a.el||null;if(a.css)this.css=a.css;if(a.handler)this.handler=a.handler;if(a.finish)this.finish=a.finish;this.frame=0;this.index=-1;this.value=f;this.easing=o[l||"none"];this.base={from:f,to:e,framecount:Math.floor(d*1E3/30)}};b.tween.prototype={start:function(){function a(p,q,r,n){p.current={from:q,to:r,framecount:n}}var f=this.base,e=f.framecount;this.forward=!this.forward;if(this.running)a(this,
this.value,this.forward?f.to:f.from,Math.floor(Math.max(this.frame/this.current.framecount*e,e*0.6)));else{for(var d=h.length,l=0,j=h.length;l<j;l++)if(!h[l]){d=l;break}h[d]=this;this.index=d;a(this,this.forward?f.from:f.to,this.forward?f.to:f.from,e)}this.running=true;this.frame=0;g||(g=window.setInterval(s,30))},reset:function(){this.running=false;this.frame=0;this.value=this.base.from;this.forward=false;i(this)},setfrom:function(a){this.base.from=a;if(this.running){this.current.from=a;k(this)}},
setto:function(a){this.base.to=a;if(this.running){this.current.to=a;k(this)}}};return b}();
