	var scrollerheight=193;		
	var html,total_area=0,wait_flag_d=false,wait_flag_u=true;	
	var bMouseOver = 1;
	var scrollspeed = 5;		   
	var waitingtime = 2000;		
	var scroll_content=new Array();
	var startPanel=0, n_panel=0, i=0;
	var advstemp = 0;
	var active_u = false, active_d = false;
	var firsttime = true;
	
	function startscroll()
	{ 
		i=0;
		for (i in scroll_content) n_panel++;
		n_panel = n_panel-1;
		i=0;
		for (i in scroll_content) 	insert_area(total_area, total_area++); 
		window.setTimeout("scrolling_up()",waitingtime);
	}
	
	function scrolling_up(){ 
		if(wait_flag_d) return;
		if (bMouseOver && wait_flag_u)
		{			
			for (i=0;i<total_area;i++){
				tmp = document.getElementById('scroll_area'+i).style;
				tmp.top = parseInt(tmp.top)-scrollspeed;				
				if (parseInt(tmp.top) <= -scrollerheight){
					tmp.top = scrollerheight*(total_area-1);
				} 
			}
			advstemp += scrollspeed;
			if(advstemp >= scrollerheight) {
				
				wait_flag_u = false;
				active_u= false;
				advstemp = 0;
				setArrange();
				if(firsttime) window.setTimeout("wait_flag_u=true;scrolling_up();",waitingtime);
				return;					
			}
		}
		window.setTimeout("scrolling_up()",1);
	}
	
	function scrolling_down(){
		if(wait_flag_u) return;
		if (bMouseOver && wait_flag_d)
		{			
			for (i=0;i < total_area; i++){
				tmp = document.getElementById('scroll_area'+i).style;
				tmp.top = parseInt(tmp.top) + scrollspeed;				
				if (parseInt(tmp.top) >= scrollerheight*(total_area-1)){
					tmp.top = -scrollerheight;
				}
			}
			advstemp -= scrollspeed;
			if(advstemp <= -scrollerheight) {
				
				wait_flag_d = false;
				active_d = false;
				advstemp = 0;
				setArrange();
				//window.setTimeout("wait_flag_d=true;wait_flag_u=false;scrolling_down()",waitingtime);				
				return;					
			}
		}
		window.setTimeout("scrolling_down()",1);
	}
	
	function insert_area(idx, n){ // area 火涝
		html = '';
		html='<div style="left: 0px; width: 100%; position: absolute; top:'+(scrollerheight*n)+'px" id="scroll_area'+n+'">\n';
		html+=scroll_content[idx];
		html+='</div>\n';
		document.write(html);
	}
	function setBit(a, b, c, d)
	{
		if(firsttime) {
			firsttime = false;
//			window.setTimeout("setBit("+a+","+ b+","+ c+", "+d+")",1);
			return;
		}
		
		if( c && !active_u)
		{
			wait_flag_u = a;
			wait_flag_d = b;
			active_u = true;
			active_d = d;
			scrolling_up();
			return;
		}
		if( d && !active_d)
		{
			wait_flag_u = a;
			wait_flag_d = b;
			active_u = c;
			active_d = true;
			scrolling_down();
			return;
		}
	}
	function setArrange()
	{
		for(i=0; i < total_area; i++)
		{
			tmp = document.getElementById('scroll_area'+i).style;
			tmp.top = Math.round(parseFloat(tmp.top)/scrollerheight) * scrollerheight;
		}
	}




