jQuery.fn._height=jQuery.fn.height;
jQuery.fn._width=jQuery.fn.width;
jQuery.fn.height=function(){if(this[0]==window){return self.innerHeight||jQuery.boxModel&&document.documentElement.clientHeight||document.body.clientHeight
}if(this[0]==document){return Math.max(document.body.scrollHeight,document.body.offsetHeight)
}return this._height(arguments[0])
};
jQuery.fn.width=function(){if(this[0]==window){return self.innerWidth||jQuery.boxModel&&document.documentElement.clientWidth||document.body.clientWidth
}if(this[0]==document){return Math.max(document.body.scrollWidth,document.body.offsetWidth)
}return this._width(arguments[0])
};
jQuery.fn.innerHeight=function(){return this[0]==window||this[0]==document?this.height():this.css("display")!="none"?this[0].offsetHeight-(parseInt(this.css("borderTopWidth"))||0)-(parseInt(this.css("borderBottomWidth"))||0):this.height()+(parseInt(this.css("paddingTop"))||0)+(parseInt(this.css("paddingBottom"))||0)
};
jQuery.fn.innerWidth=function(){return this[0]==window||this[0]==document?this.width():this.css("display")!="none"?this[0].offsetWidth-(parseInt(this.css("borderLeftWidth"))||0)-(parseInt(this.css("borderRightWidth"))||0):this.height()+(parseInt(this.css("paddingLeft"))||0)+(parseInt(this.css("paddingRight"))||0)
};
jQuery.fn.outerHeight=function(){return this[0]==window||this[0]==document?this.height():this.css("display")!="none"?this[0].offsetHeight:this.height()+(parseInt(this.css("borderTopWidth"))||0)+(parseInt(this.css("borderBottomWidth"))||0)+(parseInt(this.css("paddingTop"))||0)+(parseInt(this.css("paddingBottom"))||0)
};
jQuery.fn.outerWidth=function(){return this[0]==window||this[0]==document?this.width():this.css("display")!="none"?this[0].offsetWidth:this.height()+(parseInt(this.css("borderLeftWidth"))||0)+(parseInt(this.css("borderRightWidth"))||0)+(parseInt(this.css("paddingLeft"))||0)+(parseInt(this.css("paddingRight"))||0)
};
jQuery.fn.scrollLeft=function(){if(this[0]==window||this[0]==document){return self.pageXOffset||jQuery.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft
}return this[0].scrollLeft
};
jQuery.fn.scrollTop=function(){if(this[0]==window||this[0]==document){return self.pageYOffset||jQuery.boxModel&&document.documentElement.scrollTop||document.body.scrollTop
}return this[0].scrollTop
};
jQuery.fn.offset=function(N,G){var J=0,I=0,C=this[0],K=this[0],E=false,H=false,F,D=0,M=0,N=jQuery.extend({margin:true,border:true,padding:false,scroll:true},N||{});
do{J+=K.offsetLeft||0;
I+=K.offsetTop||0;
if(jQuery.browser.mozilla||jQuery.browser.msie){var L=parseInt(jQuery.css(K,"borderTopWidth"))||0;
var B=parseInt(jQuery.css(K,"borderLeftWidth"))||0;
J+=B;
I+=L;
if(jQuery.browser.mozilla&&K!=C&&jQuery.css(K,"overflow")!="visible"){J+=B;
I+=L
}if(jQuery.css(K,"position")=="absolute"){E=true
}if(jQuery.css(K,"position")=="relative"){H=true
}}if(N.scroll){F=K.offsetParent;
do{D+=K.scrollLeft||0;
M+=K.scrollTop||0;
K=K.parentNode;
if(jQuery.browser.mozilla&&K!=C&&K!=F&&jQuery.css(K,"overflow")!="visible"){J+=parseInt(jQuery.css(K,"borderLeftWidth"))||0;
I+=parseInt(jQuery.css(K,"borderTopWidth"))||0
}}while(F&&K!=F)
}else{K=K.offsetParent
}if(K&&(K.tagName.toLowerCase()=="body"||K.tagName.toLowerCase()=="html")){if((jQuery.browser.safari||(jQuery.browser.msie&&jQuery.boxModel))&&jQuery.css(C,"position")!="absolute"){J+=parseInt(jQuery.css(K,"marginLeft"))||0;
I+=parseInt(jQuery.css(K,"marginTop"))||0
}if((jQuery.browser.mozilla&&!E)||(jQuery.browser.msie&&jQuery.css(C,"position")=="static"&&(!H||!E))){J+=parseInt(jQuery.css(K,"borderLeftWidth"))||0;
I+=parseInt(jQuery.css(K,"borderTopWidth"))||0
}break
}}while(K);
if(!N.margin){J-=parseInt(jQuery.css(C,"marginLeft"))||0;
I-=parseInt(jQuery.css(C,"marginTop"))||0
}if(N.border&&(jQuery.browser.safari||jQuery.browser.opera)){J+=parseInt(jQuery.css(C,"borderLeftWidth"))||0;
I+=parseInt(jQuery.css(C,"borderTopWidth"))||0
}else{if(!N.border&&!(jQuery.browser.safari||jQuery.browser.opera)){J-=parseInt(jQuery.css(C,"borderLeftWidth"))||0;
I-=parseInt(jQuery.css(C,"borderTopWidth"))||0
}}if(N.padding){J+=parseInt(jQuery.css(C,"paddingLeft"))||0;
I+=parseInt(jQuery.css(C,"paddingTop"))||0
}if(N.scroll&&jQuery.browser.opera&&jQuery.css(C,"display")=="inline"){D-=C.scrollLeft||0;
M-=C.scrollTop||0
}var A=N.scroll?{top:I-M,left:J-D,scrollTop:M,scrollLeft:D}:{top:I,left:J};
if(G){jQuery.extend(G,A);
return this
}else{return A
}};
