(function(e){var b=e.fn.height,d=e.fn.width;e.fn.extend({height:function(){if(this[0]==window){return self.innerHeight||e.boxModel&&document.documentElement.clientHeight||document.body.clientHeight}if(this[0]==document){return Math.max(document.body.scrollHeight,document.body.offsetHeight)}return b.apply(this,arguments)},width:function(){if(this[0]==window){return self.innerWidth||e.boxModel&&document.documentElement.clientWidth||document.body.clientWidth}if(this[0]==document){return Math.max(document.body.scrollWidth,document.body.offsetWidth)}return d.apply(this,arguments)},innerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight-c(this,"borderTopWidth")-c(this,"borderBottomWidth"):this.height()+c(this,"paddingTop")+c(this,"paddingBottom")},innerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth-c(this,"borderLeftWidth")-c(this,"borderRightWidth"):this.width()+c(this,"paddingLeft")+c(this,"paddingRight")
},outerHeight:function(){return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight:this.height()+c(this,"borderTopWidth")+c(this,"borderBottomWidth")+c(this,"paddingTop")+c(this,"paddingBottom")},outerWidth:function(){return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth:this.width()+c(this,"borderLeftWidth")+c(this,"borderRightWidth")+c(this,"paddingLeft")+c(this,"paddingRight")},scrollLeft:function(f){if(f!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(f,e(window).scrollTop())}else{this.scrollLeft=f}})}if(this[0]==window||this[0]==document){return self.pageXOffset||e.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft}return this[0].scrollLeft},scrollTop:function(f){if(f!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(e(window).scrollLeft(),f)}else{this.scrollTop=f}})}if(this[0]==window||this[0]==document){return self.pageYOffset||e.boxModel&&document.documentElement.scrollTop||document.body.scrollTop
}return this[0].scrollTop},position:function(k,f){var m=this[0],i=m.parentNode,o=m.offsetParent,k=e.extend({margin:false,border:false,padding:false,scroll:false},k||{}),h=m.offsetLeft,g=m.offsetTop,n=m.scrollLeft,j=m.scrollTop;if(e.browser.mozilla||e.browser.msie){h+=c(m,"borderLeftWidth");g+=c(m,"borderTopWidth")}if(e.browser.mozilla){do{if(e.browser.mozilla&&i!=m&&e.css(i,"overflow")!="visible"){h+=c(i,"borderLeftWidth");g+=c(i,"borderTopWidth")}if(i==o){break}}while((i=i.parentNode)&&(i.tagName.toLowerCase()!="body"||i.tagName.toLowerCase()!="html"))}var l=a(m,k,h,g,n,j);if(f){e.extend(f,l);return this}else{return l}},offset:function(l,r){var q=0,p=0,t=0,j=0,u=this[0],o=this[0],n,i,s=e.css(u,"position"),m=e.browser.mozilla,f=e.browser.msie,w=e.browser.safari,k=e.browser.opera,h=false,g=false,l=e.extend({margin:true,border:false,padding:false,scroll:true,lite:false},l||{});if(l.lite){return this.offsetLite(l,r)}if(u.tagName.toLowerCase()=="body"){q=u.offsetLeft;p=u.offsetTop;if(m){q+=c(u,"marginLeft")+(c(u,"borderLeftWidth")*2);
p+=c(u,"marginTop")+(c(u,"borderTopWidth")*2)}else{if(k){q+=c(u,"marginLeft");p+=c(u,"marginTop")}else{if(f&&jQuery.boxModel){q+=c(u,"borderLeftWidth");p+=c(u,"borderTopWidth")}}}}else{do{i=e.css(o,"position");q+=o.offsetLeft;p+=o.offsetTop;if(m||f){q+=c(o,"borderLeftWidth");p+=c(o,"borderTopWidth");if(m&&i=="absolute"){h=true}if(f&&i=="relative"){g=true}}n=o.offsetParent;if(l.scroll||m){do{if(l.scroll){t+=o.scrollLeft;j+=o.scrollTop}if(m&&o!=u&&e.css(o,"overflow")!="visible"){q+=c(o,"borderLeftWidth");p+=c(o,"borderTopWidth")}o=o.parentNode}while(o!=n)}o=n;if(o.tagName.toLowerCase()=="body"||o.tagName.toLowerCase()=="html"){if((w||(f&&e.boxModel))&&s!="absolute"&&s!="fixed"){q+=c(o,"marginLeft");p+=c(o,"marginTop")}if((m&&!h&&s!="fixed")||(f&&s=="static"&&!g)){q+=c(o,"borderLeftWidth");p+=c(o,"borderTopWidth")}break}}while(o)}var v=a(u,l,q,p,t,j);if(r){e.extend(r,v);return this}else{return v}},offsetLite:function(n,i){var k=0,j=0,g=0,m=0,l=this[0],h,n=e.extend({margin:true,border:false,padding:false,scroll:true},n||{});
do{k+=l.offsetLeft;j+=l.offsetTop;h=l.offsetParent;if(n.scroll){do{g+=l.scrollLeft;m+=l.scrollTop;l=l.parentNode}while(l!=h)}l=h}while(l&&l.tagName.toLowerCase()!="body"&&l.tagName.toLowerCase()!="html");var f=a(this[0],n,k,j,g,m);if(i){e.extend(i,f);return this}else{return f}}});var c=function(f,g){return parseInt(e.css(f.jquery?f[0]:f,g))||0};var a=function(h,g,k,j,i,f){if(!g.margin){k-=c(h,"marginLeft");j-=c(h,"marginTop")}if(g.border&&(e.browser.safari||e.browser.opera)){k+=c(h,"borderLeftWidth");j+=c(h,"borderTopWidth")}else{if(!g.border&&!(e.browser.safari||e.browser.opera)){k-=c(h,"borderLeftWidth");j-=c(h,"borderTopWidth")}}if(g.padding){k+=c(h,"paddingLeft");j+=c(h,"paddingTop")}if(g.scroll){i-=h.scrollLeft;f-=h.scrollTop}return g.scroll?{top:j-f,left:k-i,scrollTop:f,scrollLeft:i}:{top:j,left:k}}})(jQuery);