Commits

Cao Li  committed 0bb0a8c

split lib.js

  • Participants
  • Parent commits 1378613

Comments (0)

Files changed (9)

File javascripts/app.js

+function buffer(fun, ms, context){
+   var buffer;
+   return function(){
+    if(buffer) return;
+  buffer = setTimeout(function(){
+     fun.call(this)
+     buffer = undefined;
+  }, ms);
+   };
+}
+
+(function(){
+  var oDiv=document.getElementById("float");
+  if ( oDiv == undefined ) return false;
+  var H=0,iE6;
+  var Y=oDiv;
+  while(Y){H+=Y.offsetTop;Y=Y.offsetParent};
+  iE6=window.ActiveXObject&&!window.XMLHttpRequest;
+  function myscroll(){
+    var s=document.body.scrollTop||document.documentElement.scrollTop;
+    if (s >H ){
+      oDiv.className = "div1 div2";
+      if(iE6){oDiv.style.top=(s-H)+"px";}
+    }
+    else
+      oDiv.className = "div1";  
+  }
+  if(!iE6 || true){
+    window.onscroll= buffer(myscroll,150,this );
+  }
+  
+
+})();
+
+
+$(function(){
+    $('a.picture').fancybox();
+})

File javascripts/comment.js

+
+function article_comments_path(id){
+  return '/articles/'+id+'/comments';
+}
+
+function loadComments(e){
+  var l=$(this);
+  var id = /\d+/.exec(l.attr('id'));
+  if(!id) return;
+  id=id[0];
+  var comments_el = $('#qiushi_comments_'+id);
+  if(comments_el.size() == 0){
+      var xx = l.html();
+      l.text('...');
+      $.get(article_comments_path(id), null, function(data){
+
+        $('#qiushi_counts_'+id).after(data).toggleClass('qiushi_counts_afterclick');
+    $("#l"+id).height( $('#r'+id).height() ) ;
+          comments_el.show();
+          l.html(xx).trigger('loaded');
+          // l.html(xx);
+          if(typeof decrypt == 'function'){l.ready(decrypt)}
+          l.ready(floorLink);
+      });
+  }else{
+      comments_el.toggle();
+  $('#qiushi_counts_'+id).toggleClass('qiushi_counts_afterclick');
+  }
+//  window.location.hash = l.attr('id');
+  l.blur();
+  e.preventDefault();
+}
+
+function showall(id){
+  $('.hide', '#qiushi_comments_'+id).toggle();
+}
+
+function closeComments(e){
+  var l = $(this) ;
+  var id = /\d+/.exec( l.attr('id' )) ;
+  id = id[0];
+  $('#qiushi_comments_'+id).toggle() ;
+  window.location.hash = '#qiushi_counts_'+id;
+}

File javascripts/debounce.js

+/*
+ * jQuery throttle / debounce - v1.1 - 3/7/2010
+ * http://benalman.com/projects/jquery-throttle-debounce-plugin/
+ * 
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);

File javascripts/hoverintent.js

+/**
+* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
+* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
+* 
+* @param  f  onMouseOver function || An object with configuration options
+* @param  g  onMouseOut function  || Nothing (use configuration options object)
+* @author    Brian Cherne <brian@cherne.net>
+*/
+(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

File javascripts/jquery.bgiframe.min.js

+/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
+ * Licensed under the MIT License (LICENSE.txt).
+ *
+ * Version 2.1.2
+ */
+(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild)}})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery);

File javascripts/lib.js

-/**
-* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
-* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
-* 
-* @param  f  onMouseOver function || An object with configuration options
-* @param  g  onMouseOut function  || Nothing (use configuration options object)
-* @author    Brian Cherne <brian@cherne.net>
-*/
-(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
-
-/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
- * Licensed under the MIT License (LICENSE.txt).
- *
- * Version 2.1.2
- */
-
-(function($){
-
-$.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) {
-    s = $.extend({
-        top     : 'auto', // auto == .currentStyle.borderTopWidth
-        left    : 'auto', // auto == .currentStyle.borderLeftWidth
-        width   : 'auto', // auto == offsetWidth
-        height  : 'auto', // auto == offsetHeight
-        opacity : true,
-        src     : 'javascript:false;'
-    }, s);
-    var html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+
-                   'style="display:block;position:absolute;z-index:-1;'+
-                       (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+
-                       'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+
-                       'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+
-                       'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+
-                       'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+
-                '"/>';
-    return this.each(function() {
-        if ( $(this).children('iframe.bgiframe').length === 0 )
-            this.insertBefore( document.createElement(html), this.firstChild );
-    });
-} : function() { return this; });
-
-// old alias
-$.fn.bgIframe = $.fn.bgiframe;
-
-function prop(n) {
-    return n && n.constructor === Number ? n + 'px' : n;
-}
-
-})(jQuery);
-
-/**
- * jQuery.ScrollTo - Easy element scrolling using jQuery.
- * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
- * Dual licensed under MIT and GPL.
- * Date: 5/25/2009
- * @author Ariel Flesler
- * @version 1.4.2
- *
- * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
- */
-;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
-
-/*
- * jQuery throttle / debounce - v1.1 - 3/7/2010
- * http://benalman.com/projects/jquery-throttle-debounce-plugin/
- * 
- * Copyright (c) 2010 "Cowboy" Ben Alman
- * Dual licensed under the MIT and GPL licenses.
- * http://benalman.com/about/license/
- */
-(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);
-
-/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
- * Dual licensed under the MIT (MIT_LICENSE.txt)
- * and GPL Version 2 (GPL_LICENSE.txt) licenses.
- *
- * Version: 1.1.1
- * Requires jQuery 1.3+
- * Docs: http://docs.jquery.com/Plugins/livequery
- */
-(function(a){a.extend(a.fn,{livequery:function(e,d,c){var b=this,f;if(a.isFunction(e)){c=d,d=e,e=undefined}a.each(a.livequery.queries,function(g,h){if(b.selector==h.selector&&b.context==h.context&&e==h.type&&(!d||d.$lqguid==h.fn.$lqguid)&&(!c||c.$lqguid==h.fn2.$lqguid)){return(f=h)&&false}});f=f||new a.livequery(this.selector,this.context,e,d,c);f.stopped=false;f.run();return this},expire:function(e,d,c){var b=this;if(a.isFunction(e)){c=d,d=e,e=undefined}a.each(a.livequery.queries,function(f,g){if(b.selector==g.selector&&b.context==g.context&&(!e||e==g.type)&&(!d||d.$lqguid==g.fn.$lqguid)&&(!c||c.$lqguid==g.fn2.$lqguid)&&!this.stopped){a.livequery.stop(g.id)}});return this}});a.livequery=function(b,d,f,e,c){this.selector=b;this.context=d;this.type=f;this.fn=e;this.fn2=c;this.elements=[];this.stopped=false;this.id=a.livequery.queries.push(this)-1;e.$lqguid=e.$lqguid||a.livequery.guid++;if(c){c.$lqguid=c.$lqguid||a.livequery.guid++}return this};a.livequery.prototype={stop:function(){var b=this;if(this.type){this.elements.unbind(this.type,this.fn)}else{if(this.fn2){this.elements.each(function(c,d){b.fn2.apply(d)})}}this.elements=[];this.stopped=true},run:function(){if(this.stopped){return}var d=this;var e=this.elements,c=a(this.selector,this.context),b=c.not(e);this.elements=c;if(this.type){b.bind(this.type,this.fn);if(e.length>0){a.each(e,function(f,g){if(a.inArray(g,c)<0){a.event.remove(g,d.type,d.fn)}})}}else{b.each(function(){d.fn.apply(this)});if(this.fn2&&e.length>0){a.each(e,function(f,g){if(a.inArray(g,c)<0){d.fn2.apply(g)}})}}}};a.extend(a.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(a.livequery.running&&a.livequery.queue.length){var b=a.livequery.queue.length;while(b--){a.livequery.queries[a.livequery.queue.shift()].run()}}},pause:function(){a.livequery.running=false},play:function(){a.livequery.running=true;a.livequery.run()},registerPlugin:function(){a.each(arguments,function(c,d){if(!a.fn[d]){return}var b=a.fn[d];a.fn[d]=function(){var e=b.apply(this,arguments);a.livequery.run();return e}})},run:function(b){if(b!=undefined){if(a.inArray(b,a.livequery.queue)<0){a.livequery.queue.push(b)}}else{a.each(a.livequery.queries,function(c){if(a.inArray(c,a.livequery.queue)<0){a.livequery.queue.push(c)}})}if(a.livequery.timeout){clearTimeout(a.livequery.timeout)}a.livequery.timeout=setTimeout(a.livequery.checkQueue,20)},stop:function(b){if(b!=undefined){a.livequery.queries[b].stop()}else{a.each(a.livequery.queries,function(c){a.livequery.queries[c].stop()})}}});a.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove","html");a(function(){a.livequery.play()})})(jQuery);
-
-/*
- * Copyright (C) 1999-2009 Jive Software. All rights reserved.
- *
- * This software is the proprietary information of Jive Software. Use is subject to license terms.
- */
-
-/*
-* $ lightbox_me
-* By: Buck Wilson
-* Version : 2.2
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-
-(function($) {
-
-    $.fn.lightbox_me = function(options) {
-
-        return this.each(function() {
-
-            var
-                opts = $.extend({}, $.fn.lightbox_me.defaults, options),
-                $overlay = $('div.' + opts.classPrefix + '_overlay'),
-                $self = $(this),
-                $iframe = $('iframe#lb_iframe'),
-                ie6 = ($.browser.msie && $.browser.version < 7);
-            
-            if ($overlay.length > 0) {
-                $overlay[0].removeModal(); // if the overlay exists, then a modal probably exists. Ditch it!
-            } else {
-                $overlay =  $('<div class="' + opts.classPrefix + '_overlay" style="display:none;"/>'); // otherwise just create an all new overlay. 
-            }
-
-            $iframe = ($iframe.length > 0) ? $iframe : $iframe = $('<iframe id="lb_iframe" style="z-index: ' + (opts.zIndex + 1) + '; display: none; border: none; margin: 0; padding: 0; position: absolute; width: 100%; height: 100%; top: 0; left: 0;"/>');
-
-            /*----------------------------------------------------
-               DOM Building
-            ---------------------------------------------------- */
-            if (ie6) {
-                var src = /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank';
-                $iframe.attr('src', src);
-                $('body').append($iframe);
-            } // iframe shim for ie6, to hide select elements
-            $('body').append($self).append($overlay);
-
-            /*----------------------------------------------------
-               CSS stuffs
-            ---------------------------------------------------- */
-
-            // set css of the modal'd window
-
-            setSelfPosition();
-            $self.css({left: '50%', marginLeft: ($self.outerWidth() / 2) * -1,  zIndex: (opts.zIndex + 3) });
-
-            // set css of the overlay
-
-            setOverlayHeight(); // pulled this into a function because it is called on window resize.
-            $overlay.css({ position: 'absolute', width: '100%', top: 0, left: 0, right: 0, bottom: 0, zIndex: (opts.zIndex + 2) })
-                    .css(opts.overlayCSS);
-
-            /*----------------------------------------------------
-               Animate it in.
-            ---------------------------------------------------- */
-
-            if ($overlay.is(":hidden")) {
-                $overlay.fadeIn(opts.overlaySpeed, function() {
-                    $self[opts.appearEffect](opts.lightboxSpeed, function() { setOverlayHeight(); opts.onLoad()});
-                });
-            } else {
-                $self[opts.appearEffect](opts.lightboxSpeed, function() { setOverlayHeight(); opts.onLoad()});
-            }
-
-            /*----------------------------------------------------
-               Bind Events
-            ---------------------------------------------------- */
-
-            $(window).resize(setOverlayHeight)
-                     .resize(setSelfPosition)
-                     .scroll(setSelfPosition)
-                     .keydown(observeEscapePress);
-                     
-            $self.find(opts.closeSelector).click(function() { removeModal(true); return false; });
-            $overlay.click(function() { if(opts.closeClick){ removeModal(true); return false;} });
-
-            
-            $self.bind('close', function() { removeModal(true) });
-            $self.bind('resize', setSelfPosition);
-            $overlay[0].removeModal = removeModal;
-
-            /*----------------------------------------------------------------------------------------------------------------------------------------
-              ---------------------------------------------------------------------------------------------------------------------------------------- */
-
-            /*----------------------------------------------------
-               Private Functions
-            ---------------------------------------------------- */
-
-
-            function removeModal(removeO) {
-                // fades & removes modal, then unbinds events
-                $self[opts.disappearEffect](opts.lightboxDisappearSpeed, function() {
-                    
-                    if (removeO) {
-                      removeOverlay();  
-                    } 
-                    
-                    opts.destroyOnClose ? $self.remove() : $self.hide()
-                    
-                    
-                    $self.find(opts.closeSelector).unbind('click');
-                    $self.unbind('close');
-                    $self.unbind('resize');
-                    $(window).unbind('scroll', setSelfPosition);
-                    $(window).unbind('resize', setSelfPosition);
-                    
-                    
-                });
-            }
-            
-            
-            function removeOverlay() {
-                // fades & removes overlay, then unbinds events
-                $overlay.fadeOut(opts.overlayDisappearSpeed, function() {
-                    $(window).unbind('resize', setOverlayHeight);
-
-                    $overlay.remove();
-                    $overlay.unbind('click');
-                    
-                    
-                    opts.onClose();
-
-                })
-            }
-            
-
-
-            /* Function to bind to the window to observe the escape key press */
-            function observeEscapePress(e) {
-                if((e.keyCode == 27 || (e.DOM_VK_ESCAPE == 27 && e.which==0)) && opts.closeEsc) removeModal(true);
-            }
-
-            /* Set the height of the overlay
-                    : if the document height is taller than the window, then set the overlay height to the document height.
-                    : otherwise, just set overlay height: 100%
-            */
-            function setOverlayHeight() {
-                if ($(window).height() < $(document).height()) {
-                    $overlay.css({height: $(document).height() + 'px'});
-                } else {
-                    $overlay.css({height: '100%'});
-                    if (ie6) {$('html,body').css('height','100%'); } // ie6 hack for height: 100%; TODO: handle this in IE7
-                }
-            }
-
-            /* Set the position of the modal'd window ($self)
-                    : if $self is taller than the window, then make it absolutely positioned
-                    : otherwise fixed
-            */
-            function setSelfPosition() {
-                var s = $self[0].style;
-
-                if (($self.height() + 80  >= $(window).height()) && ($self.css('position') != 'absolute' || ie6)) {
-                    var topOffset = $(document).scrollTop() + 40;
-                    $self.css({position: 'absolute', top: topOffset + 'px', marginTop: 0})
-                    if (ie6) {
-                        s.removeExpression('top');
-                    }
-                } else if ($self.height()+ 80  < $(window).height()) {
-                    if (ie6) {
-                        s.position = 'absolute';
-                        if (opts.centered) {
-                            s.setExpression('top', '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')
-                            s.marginTop = 0;
-                        } else {
-                            var top = (opts.modalCSS && opts.modalCSS.top) ? parseInt(opts.modalCSS.top) : 0;
-                            s.setExpression('top', '((blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"')
-                        }
-                    } else {
-                        if (opts.centered) {
-                            $self.css({ position: 'fixed', top: '50%', marginTop: ($self.outerHeight() / 2) * -1})
-                        } else {
-                            $self.css({ position: 'fixed'}).css(opts.modalCSS);
-                        }
-                    }
-                }
-            }
-        });
-    };
-
-
-    $.fn.lightbox_me.defaults = {
-
-        // animation when appears
-        appearEffect: "fadeIn",
-        overlaySpeed: 300,
-        lightboxSpeed: "fast",
-        
-        // animation when dissapears
-        disappearEffect: "fadeOut",
-        overlayDisappearSpeed: 300,
-        lightboxDisappearSpeed: "fast",
-
-        // close
-        closeSelector: ".close",
-        closeClick: true,
-        closeEsc: true,
-
-        // behavior
-        destroyOnClose: false,
-
-        // callbacks
-        onLoad: function() {},
-        onClose: function() {},
-
-        // style
-        classPrefix: 'lb',
-        zIndex: 999,
-        centered: false,
-        modalCSS: {top: '40px'},
-        overlayCSS: {background: 'black', opacity: .6}
-    }
-
-
-})(jQuery);
-
-
-function buffer(fun, ms, context){
-   var buffer;
-   return function(){
-  	if(buffer) return;
-	buffer = setTimeout(function(){
-	   fun.call(this)
-	   buffer = undefined;
-	}, ms);
-   };
-}
-
-(function(){
-	var oDiv=document.getElementById("float");
-	if ( oDiv == undefined ) return false;
-	var H=0,iE6;
-	var Y=oDiv;
-	while(Y){H+=Y.offsetTop;Y=Y.offsetParent};
-	iE6=window.ActiveXObject&&!window.XMLHttpRequest;
-	function myscroll(){
-		var s=document.body.scrollTop||document.documentElement.scrollTop;
-		if (s >H ){
-			oDiv.className = "div1 div2";
-			if(iE6){oDiv.style.top=(s-H)+"px";}
-		}
-		else
-			oDiv.className = "div1";	
-	}
-	if(!iE6 || true){
-		window.onscroll= buffer(myscroll,150,this );
-	}
-	
-
-})();
-
+

File javascripts/lib2nd.js

 // app.js
 // report
 // ajaxlogin
-// jquery.poshytip.min
+
 var l = window.location.href;
 var currentUser;
 var VoteHistory = {
 //$(floorLink);
 
 //app.js
-function article_comments_path(id){
-  return '/articles/'+id+'/comments';
-}
-function loadComments(e){
-  var l=$(this);
-  var id = /\d+/.exec(l.attr('id'));
-  if(!id) return;
-  id=id[0];
-  var comments_el = $('#qiushi_comments_'+id);
-  if(comments_el.size() == 0){
-      var xx = l.html();
-      l.text('...');
-      $.get(article_comments_path(id), null, function(data){
-
-	      $('#qiushi_counts_'+id).after(data).toggleClass('qiushi_counts_afterclick');
-		$("#l"+id).height( $('#r'+id).height() ) ;
-          comments_el.show();
-          l.html(xx).trigger('loaded');
-          // l.html(xx);
-          if(typeof decrypt == 'function'){l.ready(decrypt)}
-          l.ready(floorLink);
-      });
-  }else{
-      comments_el.toggle();
-	$('#qiushi_counts_'+id).toggleClass('qiushi_counts_afterclick');
-  }
-//  window.location.hash = l.attr('id');
-  l.blur();
-  e.preventDefault();
-}
-function showall(id){
-  $('.hide', '#qiushi_comments_'+id).toggle();
-}
-function closeComments(e){
-	var l = $(this) ;
-	var id = /\d+/.exec( l.attr('id' )) ;
-	id = id[0];
-	$('#qiushi_comments_'+id).toggle() ;
-	window.location.hash = '#qiushi_counts_'+id;
-}
-
 
 function dbclose(e)
 {
  */
 
 (function(e){var a=[],d=/^url\(["']?([^"'\)]*)["']?\);?$/i,c=/\.png$/i,b=e.browser.msie&&e.browser.version==6;function f(){e.each(a,function(){this.refresh(true)})}e(window).resize(f);e.Poshytip=function(h,g){this.$elm=e(h);this.opts=e.extend({},e.fn.poshytip.defaults,g);this.$tip=e(['<div class="',this.opts.className,'">','<div class="tip-inner tip-bg-image"></div>','<div class="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left"></div>',"</div>"].join("")).appendTo(document.body);this.$arrow=this.$tip.find("div.tip-arrow");this.$inner=this.$tip.find("div.tip-inner");this.disabled=false;this.content=null;this.init()};e.Poshytip.prototype={init:function(){a.push(this);var g=this.$elm.attr("title");this.$elm.data("title.poshytip",g!==undefined?g:null).data("poshytip",this);if(this.opts.showOn!="none"){this.$elm.bind({"mouseenter.poshytip":e.proxy(this.mouseenter,this),"mouseleave.poshytip":e.proxy(this.mouseleave,this)});switch(this.opts.showOn){case"hover":if(this.opts.alignTo=="cursor"){this.$elm.bind("mousemove.poshytip",e.proxy(this.mousemove,this))}if(this.opts.allowTipHover){this.$tip.hover(e.proxy(this.clearTimeouts,this),e.proxy(this.mouseleave,this))}break;case"focus":this.$elm.bind({"focus.poshytip":e.proxy(this.show,this),"blur.poshytip":e.proxy(this.hide,this)});break}}},mouseenter:function(g){if(this.disabled){return true}this.$elm.attr("title","");if(this.opts.showOn=="focus"){return true}this.clearTimeouts();this.showTimeout=setTimeout(e.proxy(this.show,this),this.opts.showTimeout)},mouseleave:function(g){if(this.disabled||this.asyncAnimating&&(this.$tip[0]===g.relatedTarget||jQuery.contains(this.$tip[0],g.relatedTarget))){return true}var h=this.$elm.data("title.poshytip");if(h!==null){this.$elm.attr("title",h)}if(this.opts.showOn=="focus"){return true}this.clearTimeouts();this.hideTimeout=setTimeout(e.proxy(this.hide,this),this.opts.hideTimeout)},mousemove:function(g){if(this.disabled){return true}this.eventX=g.pageX;this.eventY=g.pageY;if(this.opts.followCursor&&this.$tip.data("active")){this.calcPos();this.$tip.css({left:this.pos.l,top:this.pos.t});if(this.pos.arrow){this.$arrow[0].className="tip-arrow tip-arrow-"+this.pos.arrow}}},show:function(){if(this.disabled||this.$tip.data("active")){return}this.reset();this.update();this.display();if(this.opts.timeOnScreen){setTimeout(e.proxy(this.hide,this),this.opts.timeOnScreen)}},hide:function(){if(this.disabled||!this.$tip.data("active")){return}this.display(true)},reset:function(){this.$tip.queue([]).detach().css("visibility","hidden").data("active",false);this.$inner.find("*").poshytip("hide");if(this.opts.fade){this.$tip.css("opacity",this.opacity)}this.$arrow[0].className="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left";this.asyncAnimating=false},update:function(j,k){if(this.disabled){return}var i=j!==undefined;if(i){if(!k){this.opts.content=j}if(!this.$tip.data("active")){return}}else{j=this.opts.content}var h=this,g=typeof j=="function"?j.call(this.$elm[0],function(l){h.update(l)}):j=="[title]"?this.$elm.data("title.poshytip"):j;if(this.content!==g){this.$inner.empty().append(g);this.content=g}this.refresh(i)},refresh:function(h){if(this.disabled){return}if(h){if(!this.$tip.data("active")){return}var k={left:this.$tip.css("left"),top:this.$tip.css("top")}}this.$tip.css({left:0,top:0}).appendTo(document.body);if(this.opacity===undefined){this.opacity=this.$tip.css("opacity")}var l=this.$tip.css("background-image").match(d),m=this.$arrow.css("background-image").match(d);if(l){var i=c.test(l[1]);if(b&&i){this.$tip.css("background-image","none");this.$inner.css({margin:0,border:0,padding:0});l=i=false}else{this.$tip.prepend('<table border="0" cellpadding="0" cellspacing="0"><tr><td class="tip-top tip-bg-image" colspan="2"><span></span></td><td class="tip-right tip-bg-image" rowspan="2"><span></span></td></tr><tr><td class="tip-left tip-bg-image" rowspan="2"><span></span></td><td></td></tr><tr><td class="tip-bottom tip-bg-image" colspan="2"><span></span></td></tr></table>').css({border:0,padding:0,"background-image":"none","background-color":"transparent"}).find(".tip-bg-image").css("background-image",'url("'+l[1]+'")').end().find("td").eq(3).append(this.$inner)}if(i&&!e.support.opacity){this.opts.fade=false}}if(m&&!e.support.opacity){if(b&&c.test(m[1])){m=false;this.$arrow.css("background-image","none")}this.opts.fade=false}var o=this.$tip.find("table");if(b){this.$tip[0].style.width="";o.width("auto").find("td").eq(3).width("auto");var n=this.$tip.width(),j=parseInt(this.$tip.css("min-width")),g=parseInt(this.$tip.css("max-width"));if(!isNaN(j)&&n<j){n=j}else{if(!isNaN(g)&&n>g){n=g}}this.$tip.add(o).width(n).eq(0).find("td").eq(3).width("100%")}else{if(o[0]){o.width("auto").find("td").eq(3).width("auto").end().end().width(document.defaultView&&document.defaultView.getComputedStyle&&parseFloat(document.defaultView.getComputedStyle(this.$tip[0],null).width)||this.$tip.width()).find("td").eq(3).width("100%")}}this.tipOuterW=this.$tip.outerWidth();this.tipOuterH=this.$tip.outerHeight();this.calcPos();if(m&&this.pos.arrow){this.$arrow[0].className="tip-arrow tip-arrow-"+this.pos.arrow;this.$arrow.css("visibility","inherit")}if(h){this.asyncAnimating=true;var p=this;this.$tip.css(k).animate({left:this.pos.l,top:this.pos.t},200,function(){p.asyncAnimating=false})}else{this.$tip.css({left:this.pos.l,top:this.pos.t})}},display:function(h){var i=this.$tip.data("active");if(i&&!h||!i&&h){return}this.$tip.stop();if((this.opts.slide&&this.pos.arrow||this.opts.fade)&&(h&&this.opts.hideAniDuration||!h&&this.opts.showAniDuration)){var m={},l={};if(this.opts.slide&&this.pos.arrow){var k,g;if(this.pos.arrow=="bottom"||this.pos.arrow=="top"){k="top";g="bottom"}else{k="left";g="right"}var j=parseInt(this.$tip.css(k));m[k]=j+(h?0:(this.pos.arrow==g?-this.opts.slideOffset:this.opts.slideOffset));l[k]=j+(h?(this.pos.arrow==g?this.opts.slideOffset:-this.opts.slideOffset):0)+"px"}if(this.opts.fade){m.opacity=h?this.$tip.css("opacity"):0;l.opacity=h?0:this.opacity}this.$tip.css(m).animate(l,this.opts[h?"hideAniDuration":"showAniDuration"])}h?this.$tip.queue(e.proxy(this.reset,this)):this.$tip.css("visibility","inherit");this.$tip.data("active",!i)},disable:function(){this.reset();this.disabled=true},enable:function(){this.disabled=false},destroy:function(){this.reset();this.$tip.remove();delete this.$tip;this.content=null;this.$elm.unbind(".poshytip").removeData("title.poshytip").removeData("poshytip");a.splice(e.inArray(this,a),1)},clearTimeouts:function(){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}if(this.hideTimeout){clearTimeout(this.hideTimeout);this.hideTimeout=0}},calcPos:function(){var n={l:0,t:0,arrow:""},h=e(window),k={l:h.scrollLeft(),t:h.scrollTop(),w:h.width(),h:h.height()},p,j,m,i,q,g;if(this.opts.alignTo=="cursor"){p=j=m=this.eventX;i=q=g=this.eventY}else{var o=this.$elm.offset(),l={l:o.left,t:o.top,w:this.$elm.outerWidth(),h:this.$elm.outerHeight()};p=l.l+(this.opts.alignX!="inner-right"?0:l.w);j=p+Math.floor(l.w/2);m=p+(this.opts.alignX!="inner-left"?l.w:0);i=l.t+(this.opts.alignY!="inner-bottom"?0:l.h);q=i+Math.floor(l.h/2);g=i+(this.opts.alignY!="inner-top"?l.h:0)}switch(this.opts.alignX){case"right":case"inner-left":n.l=m+this.opts.offsetX;if(n.l+this.tipOuterW>k.l+k.w){n.l=k.l+k.w-this.tipOuterW}if(this.opts.alignX=="right"||this.opts.alignY=="center"){n.arrow="left"}break;case"center":n.l=j-Math.floor(this.tipOuterW/2);if(n.l+this.tipOuterW>k.l+k.w){n.l=k.l+k.w-this.tipOuterW}else{if(n.l<k.l){n.l=k.l}}break;default:n.l=p-this.tipOuterW-this.opts.offsetX;if(n.l<k.l){n.l=k.l}if(this.opts.alignX=="left"||this.opts.alignY=="center"){n.arrow="right"}}switch(this.opts.alignY){case"bottom":case"inner-top":n.t=g+this.opts.offsetY;if(!n.arrow||this.opts.alignTo=="cursor"){n.arrow="top"}if(n.t+this.tipOuterH>k.t+k.h){n.t=i-this.tipOuterH-this.opts.offsetY;if(n.arrow=="top"){n.arrow="bottom"}}break;case"center":n.t=q-Math.floor(this.tipOuterH/2);if(n.t+this.tipOuterH>k.t+k.h){n.t=k.t+k.h-this.tipOuterH}else{if(n.t<k.t){n.t=k.t}}break;default:n.t=i-this.tipOuterH-this.opts.offsetY;if(!n.arrow||this.opts.alignTo=="cursor"){n.arrow="bottom"}if(n.t<k.t){n.t=g+this.opts.offsetY;if(n.arrow=="bottom"){n.arrow="top"}}}this.pos=n}};e.fn.poshytip=function(h){if(typeof h=="string"){var g=arguments,k=h;Array.prototype.shift.call(g);if(k=="destroy"){this.die("mouseenter.poshytip").die("focus.poshytip")}return this.each(function(){var l=e(this).data("poshytip");if(l&&l[k]){l[k].apply(l,g)}})}var i=e.extend({},e.fn.poshytip.defaults,h);if(!e("#poshytip-css-"+i.className)[0]){e(['<style id="poshytip-css-',i.className,'" type="text/css">',"div.",i.className,"{visibility:hidden;position:absolute;top:0;left:0;}","div.",i.className," table, div.",i.className," td{margin:0;font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;font-variant:inherit;}","div.",i.className," td.tip-bg-image span{display:block;font:1px/1px sans-serif;height:",i.bgImageFrameSize,"px;width:",i.bgImageFrameSize,"px;overflow:hidden;}","div.",i.className," td.tip-right{background-position:100% 0;}","div.",i.className," td.tip-bottom{background-position:100% 100%;}","div.",i.className," td.tip-left{background-position:0 100%;}","div.",i.className," div.tip-inner{background-position:-",i.bgImageFrameSize,"px -",i.bgImageFrameSize,"px;}","div.",i.className," div.tip-arrow{visibility:hidden;position:absolute;overflow:hidden;font:1px/1px sans-serif;}","</style>"].join("")).appendTo("head")}if(i.liveEvents&&i.showOn!="none"){var j=e.extend({},i,{liveEvents:false});switch(i.showOn){case"hover":this.live("mouseenter.poshytip",function(){var l=e(this);if(!l.data("poshytip")){l.poshytip(j).poshytip("mouseenter")}});break;case"focus":this.live("focus.poshytip",function(){var l=e(this);if(!l.data("poshytip")){l.poshytip(j).poshytip("show")}});break}return this}return this.each(function(){new e.Poshytip(this,i)})};e.fn.poshytip.defaults={content:"[title]",className:"tip-yellow",bgImageFrameSize:10,showTimeout:500,hideTimeout:100,timeOnScreen:0,showOn:"hover",liveEvents:false,alignTo:"cursor",alignX:"right",alignY:"top",offsetX:-22,offsetY:18,allowTipHover:true,followCursor:false,fade:true,slide:true,slideOffset:8,showAniDuration:300,hideAniDuration:300}})(jQuery);
-
-$(function(){
-    $('a.picture').fancybox();
-})

File javascripts/lightbox_me.js

+(function($){$.fn.lightbox_me=function(options){return this.each(function(){var opts=$.extend({},$.fn.lightbox_me.defaults,options),$overlay=$('div.'+opts.classPrefix+'_overlay'),$self=$(this),$iframe=$('iframe#lb_iframe'),ie6=($.browser.msie&&$.browser.version<7);if($overlay.length>0){$overlay[0].removeModal()}else{$overlay=$('<div class="'+opts.classPrefix+'_overlay" style="display:none;"/>')}$iframe=($iframe.length>0)?$iframe:$iframe=$('<iframe id="lb_iframe" style="z-index: '+(opts.zIndex+1)+'; display: none; border: none; margin: 0; padding: 0; position: absolute; width: 100%; height: 100%; top: 0; left: 0;"/>');if(ie6){var src=/^https/i.test(window.location.href||'')?'javascript:false':'about:blank';$iframe.attr('src',src);$('body').append($iframe)}$('body').append($self).append($overlay);setSelfPosition();$self.css({left:'50%',marginLeft:($self.outerWidth()/2)*-1,zIndex:(opts.zIndex+3)});setOverlayHeight();$overlay.css({position:'absolute',width:'100%',top:0,left:0,right:0,bottom:0,zIndex:(opts.zIndex+2)}).css(opts.overlayCSS);if($overlay.is(":hidden")){$overlay.fadeIn(opts.overlaySpeed,function(){$self[opts.appearEffect](opts.lightboxSpeed,function(){setOverlayHeight();opts.onLoad()})})}else{$self[opts.appearEffect](opts.lightboxSpeed,function(){setOverlayHeight();opts.onLoad()})}$(window).resize(setOverlayHeight).resize(setSelfPosition).scroll(setSelfPosition).keydown(observeEscapePress);$self.find(opts.closeSelector).click(function(){removeModal(true);return false});$overlay.click(function(){if(opts.closeClick){removeModal(true);return false}});$self.bind('close',function(){removeModal(true)});$self.bind('resize',setSelfPosition);$overlay[0].removeModal=removeModal;function removeModal(removeO){$self[opts.disappearEffect](opts.lightboxDisappearSpeed,function(){if(removeO){removeOverlay()}opts.destroyOnClose?$self.remove():$self.hide()$self.find(opts.closeSelector).unbind('click');$self.unbind('close');$self.unbind('resize');$(window).unbind('scroll',setSelfPosition);$(window).unbind('resize',setSelfPosition)})}function removeOverlay(){$overlay.fadeOut(opts.overlayDisappearSpeed,function(){$(window).unbind('resize',setOverlayHeight);$overlay.remove();$overlay.unbind('click');opts.onClose()})}function observeEscapePress(e){if((e.keyCode==27||(e.DOM_VK_ESCAPE==27&&e.which==0))&&opts.closeEsc)removeModal(true)}function setOverlayHeight(){if($(window).height()<$(document).height()){$overlay.css({height:$(document).height()+'px'})}else{$overlay.css({height:'100%'});if(ie6){$('html,body').css('height','100%')}}}function setSelfPosition(){var s=$self[0].style;if(($self.height()+80>=$(window).height())&&($self.css('position')!='absolute'||ie6)){var topOffset=$(document).scrollTop()+40;$self.css({position:'absolute',top:topOffset+'px',marginTop:0})if(ie6){s.removeExpression('top')}}else if($self.height()+80<$(window).height()){if(ie6){s.position='absolute';if(opts.centered){s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')s.marginTop=0}else{var top=(opts.modalCSS&&opts.modalCSS.top)?parseInt(opts.modalCSS.top):0;s.setExpression('top','((blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"')}}else{if(opts.centered){$self.css({position:'fixed',top:'50%',marginTop:($self.outerHeight()/2)*-1})}else{$self.css({position:'fixed'}).css(opts.modalCSS)}}}}})};$.fn.lightbox_me.defaults={appearEffect:"fadeIn",overlaySpeed:300,lightboxSpeed:"fast",disappearEffect:"fadeOut",overlayDisappearSpeed:300,lightboxDisappearSpeed:"fast",closeSelector:".close",closeClick:true,closeEsc:true,destroyOnClose:false,onLoad:function(){},onClose:function(){},classPrefix:'lb',zIndex:999,centered:false,modalCSS:{top:'40px'},overlayCSS:{background:'black',opacity:.6}}})(jQuery);

File javascripts/scrollto.js

+/**
+ * jQuery.ScrollTo - Easy element scrolling using jQuery.
+ * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
+ * Dual licensed under MIT and GPL.
+ * Date: 5/25/2009
+ * @author Ariel Flesler
+ * @version 1.4.2
+ *
+ * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
+ */
+;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);