(function($){
var _2=$.fn.height,_3=$.fn.width;
$.fn.extend({height:function(){
if(!this[0]){
_4();
}
if(this[0]==window){
if($.browser.opera||($.browser.safari&&parseInt($.browser.version)>520)){
return self.innerHeight-(($(document).height()>self.innerHeight)?_5():0);
}else{
if($.browser.safari){
return self.innerHeight;
}else{
return $.boxModel&&document.documentElement.clientHeight||document.body.clientHeight;
}
}
}
if(this[0]==document){
return Math.max(($.boxModel&&document.documentElement.scrollHeight||document.body.scrollHeight),document.body.offsetHeight);
}
return _2.apply(this,arguments);
},width:function(){
if(!this[0]){
_4();
}
if(this[0]==window){
if($.browser.opera||($.browser.safari&&parseInt($.browser.version)>520)){
return self.innerWidth-(($(document).width()>self.innerWidth)?_5():0);
}else{
if($.browser.safari){
return self.innerWidth;
}else{
return $.boxModel&&document.documentElement.clientWidth||document.body.clientWidth;
}
}
}
if(this[0]==document){
if($.browser.mozilla){
var _6=self.pageXOffset;
self.scrollTo(99999999,self.pageYOffset);
var _7=self.pageXOffset;
self.scrollTo(_6,self.pageYOffset);
return document.body.offsetWidth+_7;
}else{
return Math.max((($.boxModel&&!$.browser.safari)&&document.documentElement.scrollWidth||document.body.scrollWidth),document.body.offsetWidth);
}
}
return _3.apply(this,arguments);
},innerHeight:function(){
if(!this[0]){
_4();
}
return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight-_8(this,"borderTopWidth")-_8(this,"borderBottomWidth"):this.height()+_8(this,"paddingTop")+_8(this,"paddingBottom");
},innerWidth:function(){
if(!this[0]){
_4();
}
return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth-_8(this,"borderLeftWidth")-_8(this,"borderRightWidth"):this.width()+_8(this,"paddingLeft")+_8(this,"paddingRight");
},outerHeight:function(_9){
if(!this[0]){
_4();
}
_9=$.extend({margin:false},_9||{});
return this[0]==window||this[0]==document?this.height():this.is(":visible")?this[0].offsetHeight+(_9.margin?(_8(this,"marginTop")+_8(this,"marginBottom")):0):this.height()+_8(this,"borderTopWidth")+_8(this,"borderBottomWidth")+_8(this,"paddingTop")+_8(this,"paddingBottom")+(_9.margin?(_8(this,"marginTop")+_8(this,"marginBottom")):0);
},outerWidth:function(_a){
if(!this[0]){
_4();
}
_a=$.extend({margin:false},_a||{});
return this[0]==window||this[0]==document?this.width():this.is(":visible")?this[0].offsetWidth+(_a.margin?(_8(this,"marginLeft")+_8(this,"marginRight")):0):this.width()+_8(this,"borderLeftWidth")+_8(this,"borderRightWidth")+_8(this,"paddingLeft")+_8(this,"paddingRight")+(_a.margin?(_8(this,"marginLeft")+_8(this,"marginRight")):0);
},scrollLeft:function(_b){
if(!this[0]){
_4();
}
if(_b!=undefined){
return this.each(function(){
if(this==window||this==document){
window.scrollTo(_b,$(window).scrollTop());
}else{
this.scrollLeft=_b;
}
});
}
if(this[0]==window||this[0]==document){
return self.pageXOffset||$.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft;
}
return this[0].scrollLeft;
},scrollTop:function(_c){
if(!this[0]){
_4();
}
if(_c!=undefined){
return this.each(function(){
if(this==window||this==document){
window.scrollTo($(window).scrollLeft(),_c);
}else{
this.scrollTop=_c;
}
});
}
if(this[0]==window||this[0]==document){
return self.pageYOffset||$.boxModel&&document.documentElement.scrollTop||document.body.scrollTop;
}
return this[0].scrollTop;
},position:function(_d){
return this.offset({margin:false,scroll:false,relativeTo:this.offsetParent()},_d);
},offset:function(_e,_f){
if(!this[0]){
_4();
}
var x=0,y=0,sl=0,st=0,_14=this[0],_15=this[0],op,_17,_18=$.css(_14,"position"),mo=$.browser.mozilla,ie=$.browser.msie,oa=$.browser.opera,sf=$.browser.safari,sf3=$.browser.safari&&parseInt($.browser.version)>520,_1e=false,_1f=false,_e=$.extend({margin:true,border:false,padding:false,scroll:true,lite:false,relativeTo:document.body},_e||{});
if(_e.lite){
return this.offsetLite(_e,_f);
}
if(_e.relativeTo.jquery){
_e.relativeTo=_e.relativeTo[0];
}
if(_14.tagName=="BODY"){
x=_14.offsetLeft;
y=_14.offsetTop;
if(mo){
x+=_8(_14,"marginLeft")+(_8(_14,"borderLeftWidth")*2);
y+=_8(_14,"marginTop")+(_8(_14,"borderTopWidth")*2);
}else{
if(oa){
x+=_8(_14,"marginLeft");
y+=_8(_14,"marginTop");
}else{
if((ie&&jQuery.boxModel)){
x+=_8(_14,"borderLeftWidth");
y+=_8(_14,"borderTopWidth");
}else{
if(sf3){
x+=_8(_14,"marginLeft")+_8(_14,"borderLeftWidth");
y+=_8(_14,"marginTop")+_8(_14,"borderTopWidth");
}
}
}
}
}else{
do{
_17=$.css(_15,"position");
x+=_15.offsetLeft;
y+=_15.offsetTop;
if((mo&&!_15.tagName.match(/^t[d|h]$/i))||ie||sf3){
x+=_8(_15,"borderLeftWidth");
y+=_8(_15,"borderTopWidth");
if(mo&&_17=="absolute"){
_1e=true;
}
if(ie&&_17=="relative"){
_1f=true;
}
}
op=_15.offsetParent||document.body;
if(_e.scroll||mo){
do{
if(_e.scroll){
sl+=_15.scrollLeft;
st+=_15.scrollTop;
}
if(oa&&($.css(_15,"display")||"").match(/table-row|inline/)){
sl=sl-((_15.scrollLeft==_15.offsetLeft)?_15.scrollLeft:0);
st=st-((_15.scrollTop==_15.offsetTop)?_15.scrollTop:0);
}
if(mo&&_15!=_14&&$.css(_15,"overflow")!="visible"){
x+=_8(_15,"borderLeftWidth");
y+=_8(_15,"borderTopWidth");
}
_15=_15.parentNode;
}while(_15!=op);
}
_15=op;
if(_15==_e.relativeTo&&!(_15.tagName=="BODY"||_15.tagName=="HTML")){
if(mo&&_15!=_14&&$.css(_15,"overflow")!="visible"){
x+=_8(_15,"borderLeftWidth");
y+=_8(_15,"borderTopWidth");
}
if(((sf&&!sf3)||oa)&&_17!="static"){
x-=_8(op,"borderLeftWidth");
y-=_8(op,"borderTopWidth");
}
break;
}
if(_15.tagName=="BODY"||_15.tagName=="HTML"){
if(((sf&&!sf3)||(ie&&$.boxModel))&&_18!="absolute"&&_18!="fixed"){
x+=_8(_15,"marginLeft");
y+=_8(_15,"marginTop");
}
if(sf3||(mo&&!_1e&&_18!="fixed")||(ie&&_18=="static"&&!_1f)){
x+=_8(_15,"borderLeftWidth");
y+=_8(_15,"borderTopWidth");
}
break;
}
}while(_15);
}
var _20=_21(_14,_e,x,y,sl,st);
if(_f){
$.extend(_f,_20);
return this;
}else{
return _20;
}
},offsetLite:function(_22,_23){
if(!this[0]){
_4();
}
var x=0,y=0,sl=0,st=0,_28=this[0],_29,_22=$.extend({margin:true,border:false,padding:false,scroll:true,relativeTo:document.body},_22||{});
if(_22.relativeTo.jquery){
_22.relativeTo=_22.relativeTo[0];
}
do{
x+=_28.offsetLeft;
y+=_28.offsetTop;
_29=_28.offsetParent||document.body;
if(_22.scroll){
do{
sl+=_28.scrollLeft;
st+=_28.scrollTop;
_28=_28.parentNode;
}while(_28!=_29);
}
_28=_29;
}while(_28&&_28.tagName!="BODY"&&_28.tagName!="HTML"&&_28!=_22.relativeTo);
var _2a=_21(this[0],_22,x,y,sl,st);
if(_23){
$.extend(_23,_2a);
return this;
}else{
return _2a;
}
},offsetParent:function(){
if(!this[0]){
_4();
}
var _2b=this[0].offsetParent;
while(_2b&&(_2b.tagName!="BODY"&&$.css(_2b,"position")=="static")){
_2b=_2b.offsetParent;
}
return $(_2b);
}});
var _4=function(){
throw "Dimensions: jQuery collection is empty";
};
var _8=function(el,_2d){
return parseInt($.css(el.jquery?el[0]:el,_2d))||0;
};
var _21=function(_2e,_2f,x,y,sl,st){
if(!_2f.margin){
x-=_8(_2e,"marginLeft");
y-=_8(_2e,"marginTop");
}
if(_2f.border&&(($.browser.safari&&parseInt($.browser.version)<520)||$.browser.opera)){
x+=_8(_2e,"borderLeftWidth");
y+=_8(_2e,"borderTopWidth");
}else{
if(!_2f.border&&!(($.browser.safari&&parseInt($.browser.version)<520)||$.browser.opera)){
x-=_8(_2e,"borderLeftWidth");
y-=_8(_2e,"borderTopWidth");
}
}
if(_2f.padding){
x+=_8(_2e,"paddingLeft");
y+=_8(_2e,"paddingTop");
}
if(_2f.scroll&&(!$.browser.opera||_2e.offsetLeft!=_2e.scrollLeft&&_2e.offsetTop!=_2e.scrollLeft)){
sl-=_2e.scrollLeft;
st-=_2e.scrollTop;
}
return _2f.scroll?{top:y-st,left:x-sl,scrollTop:st,scrollLeft:sl}:{top:y,left:x};
};
var _34=0;
var _5=function(){
if(!_34){
var _35=$("<div>").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1000,left:-1000}).appendTo("body");
_34=100-_35.append("<div>").find("div").css({width:"100%",height:200}).width();
_35.remove();
}
return _34;
};
})(jQuery);

