var speed = 5;
var currentpos=1;
var timer;

function img_zoom(e, o)		//图片鼠标滚轮缩放
{
	var zoom = parseInt(o.style.zoom, 10) || 100;
	zoom += event.wheelDelta / 12;
	if (zoom > 0) o.style.zoom = zoom + '%';
		return false;
}
function setSpeed()
{
	speed = parseInt(scrollspeed.value);
	if (speed < 1 || speed > 10){
	   speed=5;
	   scrollspeed.value=5;
	}
	
}

function stopScroll()
{
    clearInterval(timer);
}

function beginScroll()
{
	timer=setInterval("scrolling()",250/speed);
}

function scrolling()
{
	//currentpos=document.documentElement.scrollTop;
	currentpos=document.body.scrollTop;
    window.scroll(0,++currentpos);
    //if(currentpos!=document.documentElement.scrollTop) clearInterval(timer);
	if(currentpos!=document.body.scrollTop) clearInterval(timer);
}

function saveSet()
{
	parent.bcolor1=backgroundImage.selectedIndex;
	parent.txtcolor1=txtcolor.selectedIndex;
	parent.fontsize1=fontsize.selectedIndex;
	parent.scrollspeed1=scrollspeed.value;
}
function loadSet()
{
    backgroundImage.selectedIndex=parent.bcolor1;
	txtcolor.selectedIndex=parent.txtcolor1;
	fontsize.selectedIndex=parent.fontsize1;
	if(parent.scrollspeed1!=undefined)
	scrollspeed.value=parent.scrollspeed1;
    else scrollspeed.value=5;	
	setSpeed();
	//document.bgColor=bgcolor.options[bgcolor.selectedIndex].value;
	document.fgColor=txtcolor.options[txtcolor.selectedIndex].value;
	document.all.content.style.fontSize=fontsize.options[fontsize.selectedIndex].value;
	document.all.bbground.style.backgroundImage=backgroundImage.options[backgroundImage.selectedIndex].value;
}

document.onmousedown=stopScroll;
document.ondblclick=beginScroll;
loadSet();

