(function(g){var a=g.fn.height,e=g.fn.width;g.fn.extend({height:function(){if(!this[0]){d()}if(this[0]==window){if(g.browser.opera||(g.browser.safari&&parseInt(g.browser.version)>520)){return self.innerHeight-((g(document).height()>self.innerHeight)?b():0)}else{if(g.browser.safari){return self.innerHeight}else{return g.boxModel&&document.documentElement.clientHeight||document.body.clientHeight}}}if(this[0]==document){return Math.max((g.boxModel&&document.documentElement.scrollHeight||document.body.scrollHeight),document.body.offsetHeight)}return a.apply(this,arguments)},width:function(){if(!this[0]){d()}if(this[0]==window){if(g.browser.opera||(g.browser.safari&&parseInt(g.browser.version)>520)){return self.innerWidth-((g(document).width()>self.innerWidth)?b():0)}else{if(g.browser.safari){return self.innerWidth}else{return g.boxModel&&document.documentElement.clientWidth||document.body.clientWidth}}}if(this[0]==document){if(g.browser.mozilla){var j=self.pageXOffset;self.scrollTo(99999999,self.pageYOffset);var i=self.pageXOffset;self.scrollTo(j,self.pageYOffset);return document.body.offsetWidth+i}else{return Math.max(((g.boxModel&&!g.browser.safari)&&document.documentElement.scrollWidth||document.body.scrollWidth),document.body.offsetWidth)}}return e.apply(this,arguments)},innerHeight:function(){if(!this[0]){d()}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(){if(!this[0]){d()}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(i){if(!this[0]){d()}i=g.extend({margin:false},i||{});return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight+(i.margin?(c(this,"marginTop")+c(this,"marginBottom")):0):this.height()+c(this,"borderTopWidth")+c(this,"borderBottomWidth")+c(this,"paddingTop")+c(this,"paddingBottom")+(i.margin?(c(this,"marginTop")+c(this,"marginBottom")):0)},outerWidth:function(i){if(!this[0]){d()}i=g.extend({margin:false},i||{});return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth+(i.margin?(c(this,"marginLeft")+c(this,"marginRight")):0):this.width()+c(this,"borderLeftWidth")+c(this,"borderRightWidth")+c(this,"paddingLeft")+c(this,"paddingRight")+(i.margin?(c(this,"marginLeft")+c(this,"marginRight")):0)},scrollLeft:function(i){if(!this[0]){d()}if(i!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(i,g(window).scrollTop())}else{this.scrollLeft=i}})}if(this[0]==window||this[0]==document){return self.pageXOffset||g.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft}return this[0].scrollLeft},scrollTop:function(i){if(!this[0]){d()}if(i!=undefined){return this.each(function(){if(this==window||this==document){window.scrollTo(g(window).scrollLeft(),i)}else{this.scrollTop=i}})}if(this[0]==window||this[0]==document){return self.pageYOffset||g.boxModel&&document.documentElement.scrollTop||document.body.scrollTop}return this[0].scrollTop},position:function(i){return this.offset({margin:false,scroll:false,relativeTo:this.offsetParent()},i)},offset:function(j,p){if(!this[0]){d()}var o=0,n=0,z=0,s=0,A=this[0],m=this[0],l,i,w=g.css(A,"position"),v=g.browser.mozilla,q=g.browser.msie,u=g.browser.opera,C=g.browser.safari,k=g.browser.safari&&parseInt(g.browser.version)>520,r=false,t=false,j=g.extend({margin:true,border:false,padding:false,scroll:true,lite:false,relativeTo:document.body},j||{});if(j.lite){return this.offsetLite(j,p)}if(j.relativeTo.jquery){j.relativeTo=j.relativeTo[0]}if(A.tagName=="BODY"){o=A.offsetLeft;n=A.offsetTop;if(v){o+=c(A,"marginLeft")+(c(A,"borderLeftWidth")*2);n+=c(A,"marginTop")+(c(A,"borderTopWidth")*2)}else{if(u){o+=c(A,"marginLeft");n+=c(A,"marginTop")}else{if((q&&jQuery.boxModel)){o+=c(A,"borderLeftWidth");n+=c(A,"borderTopWidth")}else{if(k){o+=c(A,"marginLeft")+c(A,"borderLeftWidth");n+=c(A,"marginTop")+c(A,"borderTopWidth")}}}}}else{do{i=g.css(m,"position");o+=m.offsetLeft;n+=m.offsetTop;if((v&&!m.tagName.match(/^t[d|h]$/i))||q||k){o+=c(m,"borderLeftWidth");n+=c(m,"borderTopWidth");if(v&&i=="absolute"){r=true}if(q&&i=="relative"){t=true}}l=m.offsetParent||document.body;if(j.scroll||v){do{if(j.scroll){z+=m.scrollLeft;s+=m.scrollTop}if(u&&(g.css(m,"display")||"").match(/table-row|inline/)){z=z-((m.scrollLeft==m.offsetLeft)?m.scrollLeft:0);s=s-((m.scrollTop==m.offsetTop)?m.scrollTop:0)}if(v&&m!=A&&g.css(m,"overflow")!="visible"){o+=c(m,"borderLeftWidth");n+=c(m,"borderTopWidth")}m=m.parentNode}while(m!=l)}m=l;if(m==j.relativeTo&&!(m.tagName=="BODY"||m.tagName=="HTML")){if(v&&m!=A&&g.css(m,"overflow")!="visible"){o+=c(m,"borderLeftWidth");n+=c(m,"borderTopWidth")}if(((C&&!k)||u)&&i!="static"){o-=c(l,"borderLeftWidth");n-=c(l,"borderTopWidth")}break}if(m.tagName=="BODY"||m.tagName=="HTML"){if(((C&&!k)||(q&&g.boxModel))&&w!="absolute"&&w!="fixed"){o+=c(m,"marginLeft");n+=c(m,"marginTop")}if(k||(v&&!r&&w!="fixed")||(q&&w=="static"&&!t)){o+=c(m,"borderLeftWidth");n+=c(m,"borderTopWidth")}break}}while(m)}var B=h(A,j,o,n,z,s);if(p){g.extend(p,B);return this}else{return B}},offsetLite:function(q,l){if(!this[0]){d()}var n=0,m=0,k=0,p=0,o=this[0],j,q=g.extend({margin:true,border:false,padding:false,scroll:true,relativeTo:document.body},q||{});if(q.relativeTo.jquery){q.relativeTo=q.relativeTo[0]}do{n+=o.offsetLeft;m+=o.offsetTop;j=o.offsetParent||document.body;if(q.scroll){do{k+=o.scrollLeft;p+=o.scrollTop;o=o.parentNode}while(o!=j)}o=j}while(o&&o.tagName!="BODY"&&o.tagName!="HTML"&&o!=q.relativeTo);var i=h(this[0],q,n,m,k,p);if(l){g.extend(l,i);return this}else{return i}},offsetParent:function(){if(!this[0]){d()}var i=this[0].offsetParent;while(i&&(i.tagName!="BODY"&&g.css(i,"position")=="static")){i=i.offsetParent}return g(i)}});var d=function(){throw"Dimensions: jQuery collection is empty"};var c=function(i,j){return parseInt(g.css(i.jquery?i[0]:i,j))||0};var h=function(m,l,j,n,i,k){if(!l.margin){j-=c(m,"marginLeft");n-=c(m,"marginTop")}if(l.border&&((g.browser.safari&&parseInt(g.browser.version)<520)||g.browser.opera)){j+=c(m,"borderLeftWidth");n+=c(m,"borderTopWidth")}else{if(!l.border&&!((g.browser.safari&&parseInt(g.browser.version)<520)||g.browser.opera)){j-=c(m,"borderLeftWidth");n-=c(m,"borderTopWidth")}}if(l.padding){j+=c(m,"paddingLeft");n+=c(m,"paddingTop")}if(l.scroll&&(!g.browser.opera||m.offsetLeft!=m.scrollLeft&&m.offsetTop!=m.scrollLeft)){i-=m.scrollLeft;k-=m.scrollTop}return l.scroll?{top:n-k,left:j-i,scrollTop:k,scrollLeft:i}:{top:n,left:j}};var f=0;var b=function(){if(!f){var i=g("<div>").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1000,left:-1000}).appendTo("body");f=100-i.append("<div>").find("div").css({width:"100%",height:200}).width();i.remove()}return f}})(jQuery);