function setScrollBoxWidth(obj, parmsTag, parmsWidth){
		obj = $(obj);
		var elements = obj.getElementsByTagName(parmsTag);
		var totalWidth = parmsWidth * elements.length;
		obj.style.width = totalWidth + "px";
		parentObj = obj.parentNode;
		parentObj.style.width = totalWidth + "px";
		MainObj = parentObj.parentNode;
		MainObj.style.width = totalWidth + (178*2) + "px";
		MainObj.style.borderTop = "1px solid #CCC";
		//var mainDiv = $("parmsDiv");
		//$scroll.MainObj = mainDiv;
		//$scroll.init();
}

$scroll = {
		sW:27,
		sH:145,
		scrollBg:"http://qiche.eastmoney.com/images/scroll.gif",
		LR:28,
		MainObj:null,
		TObj:null,
		padding:10,
		speed:10,
		top_margin:305,
		bottom_margin:100,
		scroll_pixel:null,
		gtpos:null,
		gbpos:null,
		moving_spd:null,
		maxSH:0,
		init:function(){
				this.maxSH = this.pagescroll() - this.sH - this.bottom_margin;
				this.ScrollBarAdd();
				this.scrollmove();
		},pagescroll:function(){
				var yScroll = 0;
				if (self.pageYOffset) {
						yScroll = self.pageYOffset;
				} else if (document.documentElement && document.documentElement.scrollHeight){   // Explorer 6 Strict
						yScroll = document.documentElement.scrollHeight;
				} else if (document.body) {// all other Explorers
						yScroll = document.body.scrollHeight;
				}
				return yScroll;
				arrayPageScroll = new Array('',yScroll)
				return arrayPageScroll;
		},ScrollBarAdd:function(){
				var GoLeft = this.LeftAdd();
				var GoRight = this.RightAdd();
				var scrollBar = document.createElement("div");
				scrollBar.style.height = this.sH + "px";
				scrollBar.style.width = this.sW*2 + this.MainObj.clientWidth + 1 + "px";
				scrollBar.style.marginLeft = "-" + this.LR + "px";
				scrollBar.style.position = "absolute";
				scrollBar.style.top = this.top_margin + "px";
				scrollBar.style.zIndex = "1000";
				scrollBar.id = "jj_scroll_001";
				scrollBar.appendChild(GoLeft);
				scrollBar.appendChild(GoRight);
				this.MainObj.appendChild(scrollBar);
				this.TObj = scrollBar;
		},LeftAdd:function(){
				var goLeft = document.createElement("div");
				goLeft.style.backgroundImage = "url("+this.scrollBg+")";
				if(Browser.IE){
						goLeft.style.styleFloat = "left";
				}else{
						goLeft.style.cssFloat = "left";
				}
				goLeft.style.styleFloat = "left";
				goLeft.style.cursor = "pointer";
				goLeft.style.height = this.sH + "px";
				goLeft.style.width = this.sW + "px";
				return goLeft;
		},RightAdd:function(){
				var bp = "-146px";
				var goRight = document.createElement("div");
				goRight.style.backgroundImage = "url("+this.scrollBg+")";
				if(Browser.IE){
						goRight.style.styleFloat = "right";
				}else{
						goRight.style.cssFloat = "right";
				}
				goRight.style.cursor = "pointer";
				goRight.style.height = this.sH + "px";
				goRight.style.width = this.sW + "px";
				goRight.style.backgroundPosition = "0 " + bp;
				return goRight;
		},scrollmove:function (){ 
        var div_id = this.TObj;
        //alert(div_id.id);
        //throw(this.maxSH);
        this.scroll_pixel = document.documentElement.scrollTop || document.body.scrollTop;
        this.gtpos = this.scroll_pixel + this.top_margin;
        this.gbpos = this.scroll_pixel + this.top_margin;
        if(parseInt(div_id.style.top) < this.gtpos && parseInt(div_id.style.top) < this.maxSH){ 
            this.moving_spd = (this.gbpos - parseInt(div_id.style.top)) / this.padding;
            div_id.style.top = parseInt(div_id.style.top) + this.moving_spd + "px";    
        }
        if(parseInt(div_id.style.top) > this.gtpos){
            this.moving_spd = (parseInt(div_id.style.top) - this.gtpos) / this.padding;
            div_id.style.top = parseInt(div_id.style.top) - this.moving_spd + "px";
        }
        //this.display();

        this.loop = setTimeout("$scroll.scrollmove()", this.speed);
    }
}