﻿

function BianMinGongGaoMove_initScollLeft(marqueesDiv,templayerDiv,spaceBetween){
	var marqueesTmp,templayerTmp;
	marqueesWidth=spaceBetween; 
	stopscrollLeft=false; 
	marqueesTmp = document.all.item(marqueesDiv);
	templayerTmp = document.all.item(templayerDiv);
	templayerTmp.style.width=marqueesWidth;
	with(marqueesTmp){
	noWrap=true;
	style.width=marqueesWidth; 
	//style.height=0;
	style.overflowX="hidden"; 
	style.display="";
	onmouseover=new Function("stopscrollLeft=true"); 
	onmouseout=new Function("stopscrollLeft=false"); 
	}
	var i =0;
	while(templayerTmp.offsetWidth<marqueesWidth && i<2){
		templayerTmp.innerHTML+=marqueesTmp.innerHTML;
		i++;
	} 
	
	marqueesTmp.innerHTML=templayerTmp.innerHTML+templayerTmp.innerHTML;
	setInterval("BianMinGongGaoMove_scrollLeft('"+marqueesDiv+"','"+templayerDiv+"')",80);
}

BianMinGongGaoMove_preLeft=0; 
function BianMinGongGaoMove_scrollLeft(marqueesDiv,templayerDiv){ 
	var marqueesTmp,templayerTmp;
	marqueesTmp = document.all.item(marqueesDiv);
	templayerTmp = document.all.item(templayerDiv);
	if(stopscrollLeft==true) return; 
	BianMinGongGaoMove_preLeft=marqueesTmp.scrollLeft; 
	marqueesTmp.scrollLeft+=1; 
	if(BianMinGongGaoMove_preLeft==marqueesTmp.scrollLeft){
	    marqueesTmp.scrollLeft=templayerTmp.offsetWidth-marqueesWidth+1;
	}
	//alert(marqueesTmp.scrollLeft);
	//alert("2"+marqueesDiv+templayerDiv);
	//alert(BianMinGongGaoMove_preLeft);
}

BianMinGongGaoMove_initScollLeft("marquees2","templayer2",500);