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