var B=BigNews={
	current:0,
	next:0,
	scrollInterval:0,
	autoScroller:0
};
BigNews.turn=function(index,obj){
	clearInterval(BigNews.autoScroller);
	BigNews.scroll(index,obj);
}
BigNews.scroll=function(index,obj){
	if(obj.smallpic==null || obj.smallpic==""){
		clearInterval(BigNews.autoScroller);
		return;
	}
	var count=0;
	var step=obj.step;
	var duration=16;
	var b=BigNews;
	b.next=index;
	if(index!=b.current&&count>duration/8){
		return;
	}
	clearInterval(b.scrollInterval);
	for(var i=0;i<obj.showsize;i++){
		$$(obj.smallpic+"_"+i).className='';
		$$(obj.smallpic+"_"+i).childNodes[0].childNodes[0].style.opacity=".5";
		$$(obj.smallpic+"_"+i).childNodes[0].childNodes[0].style.filter="alpha(opacity=50)";
		if(obj.pictxt!=null && obj.pictxt!="")		
			$$(obj.pictxt+"_"+i).style.display = "none" ;
	}
	$$(obj.smallpic+"_"+(index%obj.showsize)).className=obj.selectstyle;
	$$(obj.smallpic+"_"+(index%obj.showsize)).childNodes[0].childNodes[0].style.opacity="";
	$$(obj.smallpic+"_"+(index%obj.showsize)).childNodes[0].childNodes[0].style.filter="alpha(opacity=100)";
	if(obj.pictxt!=null && obj.pictxt!="")	
		$$(obj.pictxt+"_"+index).style.display = "block" ;
	var span=index-b.current;
	var begin_value=$$(obj.bigpic).scrollTop;
	var chang_in_value=span*step+(b.current*step-begin_value);
	b.scrollInterval=setInterval(function(){doit(begin_value,chang_in_value)},50);
	function doit(b,c){
		$$(obj.bigpic).scrollTop=cpu(count,b,c,duration);
		count++;
		if(count==duration){
			clearInterval(BigNews.scrollInterval);
			scrollInterval=0;
			count=0;
			$$(obj.bigpic).scrollTop=b+c-obj.showsize*step*(index<obj.showsize?0:1);
			BigNews.current=index%obj.showsize;
		}
	}
	function cpu(t,b,c,d) {return c*((t=t/d-1)*t*t+1)+b;};
}
BigNews.auto=function(obj){
	clearInterval(BigNews.autoScroller);
	BigNews.autoScroller=setInterval(function(){
		BigNews.scroll(BigNews.current==(obj.totalcount-1)?0:BigNews.current+1,obj);},obj.autotimeintval);
}
BigNews.pauseSwitch = function() {	
	clearTimeout(BigNews.autoScroller);
}
BigNews.init=function(obj){
	$$(obj.bigpic).onmouseover = new Function("BigNews.pauseSwitch();") ;		
	$$(obj.bigpic).onmouseout = new Function("BigNews.auto("+obj.objname+");") ;	
	for (i=0;i<obj.showsize;i++) {	
		if(obj.smallpic!=null && obj.smallpic!="") {
		 $$(obj.smallpic+"_"+i).onmouseover = new Function("BigNews.turn("+i+","+obj.objname+");BigNews.pauseSwitch();") ;		
		 $$(obj.smallpic+"_"+i).onmouseout = new Function("BigNews.auto("+obj.objname+");") ;	
		}
	} 
	BigNews.auto(obj);
}
function $$(item){
	return document.getElementById(item);
}
