(function($){
	$.scrollBtn = function(options) {
		var opts = $.extend({}, $.scrollBtn.defaults, options);

		var $scrollBtn = $('<div onmouseover="this.className=\'scroll-up_\';" onmouseout="this.className=\'scroll-up\';"></div>').css({
							bottom: opts.bottom + 'px',
							left: opts.left + 'px'
						}).addClass('scroll-up')
						.attr('title', opts.title)
						.click(function() {
							$('html, body').animate({scrollTop: 0}, opts.duration);
						}).appendTo('body');
																			
		$(window).bind('scroll', function() {
			var scrollTop = $(document).scrollTop(),
				viewHeight = $(window).height();
				
		    //$(".scroll-up").css("left",$("#PageHeadBox").offset().left+964);

			if(scrollTop <= opts.showScale) {
				if($scrollBtn.is(':visible'))
					$scrollBtn.fadeOut(500);
			} else {
				if($scrollBtn.is(':hidden')) 
					$scrollBtn.fadeIn(500);
			}

			if(isIE6()) {
				var top = viewHeight + scrollTop - $scrollBtn.outerHeight() - opts.bottom;
				$scrollBtn.css('top', top + 'px');
			}
		});

		function isIE6() {
			if($.browser.msie) {
				if($.browser.version == '6.0') return true;
			}
		}
	};			
	$.scrollBtn.defaults = {
		showScale: 100,  
		left:20,
		bottom:20,
		duration:100,
		title:'返回顶部'
	}
})(jQuery);
$(document).ready(function(){
    var _b=148;if($.browser.msie)_b=152;
    $.scrollBtn({
	    showScale: 50,
	    bottom:_b,
	    left:$("#PageHeadBox").offset().left+964
    });
    function SetScrollLeft()
    {
        if($(".scroll-up"))
        {
            $(".scroll-up").css("left",$("#PageHeadBox").offset().left+964);
        }
    }
    setInterval(SetScrollLeft,1000);
});