jQuery.getPos=function(a){for(var e=0,b=0,c=jQuery.intval(jQuery.css(a,"width")),d=jQuery.intval(jQuery.css(a,"height")),f=a.offsetWidth,g=a.offsetHeight;a.offsetParent;){e+=a.offsetLeft+(a.currentStyle?jQuery.intval(a.currentStyle.borderLeftWidth):0);b+=a.offsetTop+(a.currentStyle?jQuery.intval(a.currentStyle.borderTopWidth):0);a=a.offsetParent}e+=a.offsetLeft+(a.currentStyle?jQuery.intval(a.currentStyle.borderLeftWidth):0);b+=a.offsetTop+(a.currentStyle?jQuery.intval(a.currentStyle.borderTopWidth): 0);return{x:e,y:b,w:c,h:d,wb:f,hb:g}};jQuery.getClient=function(a){if(a){w=a.clientWidth;h=a.clientHeight}else{w=window.innerWidth?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.offsetWidth;h=window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.offsetHeight}return{w:w,h:h}}; jQuery.getScroll=function(a){if(a){t=a.scrollTop;l=a.scrollLeft;w=a.scrollWidth;h=a.scrollHeight}else if(document.documentElement&&document.documentElement.scrollTop){t=document.documentElement.scrollTop;l=document.documentElement.scrollLeft;w=document.documentElement.scrollWidth;h=document.documentElement.scrollHeight}else if(document.body){t=document.body.scrollTop;l=document.body.scrollLeft;w=document.body.scrollWidth;h=document.body.scrollHeight}return{t:t,l:l,w:w,h:h}}; jQuery.intval=function(a){a=parseInt(a);return isNaN(a)?0:a};jQuery.fn.ScrollTo=function(a){o=jQuery.speed(a);return this.each(function(){new jQuery.fx.ScrollTo(this,o)})}; jQuery.fx.ScrollTo=function(a,e){var b=this;b.o=e;b.e=a;b.p=jQuery.getPos(a);b.s=jQuery.getScroll();b.clear=function(){clearInterval(b.timer);b.timer=null};b.t=(new Date).getTime();b.step=function(){var c=(new Date).getTime(),d=(c-b.t)/b.o.duration;if(c>=b.o.duration+b.t){b.clear();setTimeout(function(){b.scroll(b.p.y,b.p.x)},13)}else{st=(-Math.cos(d*Math.PI)/2+0.5)*(b.p.y-b.s.t)+b.s.t;sl=(-Math.cos(d*Math.PI)/2+0.5)*(b.p.x-b.s.l)+b.s.l;b.scroll(st,sl)}};b.scroll=function(c,d){window.scrollTo(d,c)}; b.timer=setInterval(function(){b.step()},13)};
