var stopscroll = false;
function scrollPic(pic, widths, heights){
	var divee = div();
	divee.id = "xue";
	divee.style.width = widths + "px";
	divee.style.height = heights + "px";
	divee.style.overflow = "hidden";
	var dive = div();
	var zhang = listArray(pic); 
	for(var i = 0; i < zhang.length; i++){
		var picc = "images/" + zhang[i];
		var imgs = img(picc)
		dive.appendChild(imgs);
	}
	divee.appendChild(dive);
	divee.appendChild(dive.cloneNode(true));
	document.getElementById("display").appendChild(divee);
	document.getElementById("display").onmouseover = new Function('stopscroll = true');
	document.getElementById("display").onmouseout = new Function('stopscroll = false');
	setInterval('scrollUp()', 25);
}

function scrollUp(){
	if(stopscroll) return;
	var sese = document.getElementById("xue").scrollHeight/2;
	document.getElementById("xue").scrollTop += 1;
	if(sese == document.getElementById("xue").scrollTop){
		document.getElementById("xue").scrollTop = 0;
	}
}	


function img(s){
	var img = document.createElement("IMG");
	img.src = s;
	return img;
} 

function div(){
	var div = document.createElement("DIV");
	return div;
}

function listArray(Str){
	var pics = Str.split("/");
	return pics;
}