var speed = 5;
var currentpos=1;
var timer;
var bcolor=document.getElementById('bcolor');
var txtcolor=document.getElementById('txtcolor');
var fonttype=document.getElementById('fonttype');
var scrollspeed=document.getElementById('scrollspeed');


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()",300/speed);
}

function scrolling()
{
	var currentpos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
    window.scroll(0, ++currentpos);
	var nowpos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
    if(currentpos != nowpos) clearInterval(timer);
}

function setCookies(cookieName,cookieValue, expirehours)
{
  var today = new Date();
  var expire = new Date();
  expire.setTime(today.getTime() + 3600000 * 356 * 24);
  document.cookie = cookieName+'='+escape(cookieValue)+ ';expires='+expire.toGMTString()+'; path=/';
}
function ReadCookies(cookieName)
{
	var theCookie=''+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=='') return ''; 
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length;
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}
function saveSet()
{
	setCookies("bcolor",bcolor.options[bcolor.selectedIndex].value);
	setCookies("txtcolor",txtcolor.options[txtcolor.selectedIndex].value);
	setCookies("fonttype",fonttype.options[fonttype.selectedIndex].value);
	setCookies("scrollspeed",scrollspeed.value);
}
function loadSet()
{
	var tmpstr;
	tmpstr = ReadCookies("bcolor");
	bcolor.selectedIndex = 0;
	if (tmpstr != "")
	{
	    for (var i=0;i<bcolor.length;i++)
		{
			if (bcolor.options[i].value == tmpstr)
			{
			    
				bcolor.selectedIndex = i;
				break;
			}
		}
	}
	tmpstr = ReadCookies("txtcolor");
	txtcolor.selectedIndex = 0;
	if (tmpstr != "")
	{
		for (var i=0;i<txtcolor.length;i++)
		{
			if (txtcolor.options[i].value == tmpstr)
			{
				txtcolor.selectedIndex = i;
				break;
			}
		}
	}
	tmpstr = ReadCookies("fonttype");
	fonttype.selectedIndex = 2;
	if (tmpstr != "")
	{
		for (var i=0;i<fonttype.length;i++)
		{
			if (fonttype.options[i].value == tmpstr)
			{
				fonttype.selectedIndex = i;
				break;
			}
		}
	}
	
	tmpstr = ReadCookies("scrollspeed");
	if (tmpstr=='') tmpstr=5;
	scrollspeed.value=tmpstr;
	setSpeed();
	document.bgColor=bcolor.options[bcolor.selectedIndex].value;
	contentobj=document.getElementById('content');
	contentobj.style.fontSize=fonttype.options[fonttype.selectedIndex].value;
	contentobj.style.color=txtcolor.options[txtcolor.selectedIndex].value;
}

document.onmousedown=stopScroll;
document.ondblclick=beginScroll;
loadSet();
document.writeln("<style type=\"text\/css\">");
document.writeln("<!--");
document.writeln(".bj1 { margin:0; padding:5px; background:#090; }");
document.writeln(".bj2 { background:#FF0; padding:5px; }");
document.writeln(".bj3 { background:#C6C; padding:5px;}");
document.writeln(".bj3 a:link,.bj3 a:visited,.bj3 a:hover,bj3 a:active { color:#FF0;}");
document.writeln(".bj4 { background:#F00; padding:5xp; }");
document.writeln(".bj5 { background:#F00; color:#FFF; padding:5px; }");
document.writeln(".bj6 a:link,.bj6 a:visited,.bj6 a:hover,bj6 a:active { color:#F00;}");
document.writeln(".bj5 a:link,.bj5 a:visited,.bj5 a:hover,bj5 a:active { color:#FFF;}");
document.writeln("a:link {");
document.writeln("	text-decoration: none;");
document.writeln("	color: #03C;");
document.writeln("}");
document.writeln("a:visited {");
document.writeln("	text-decoration: none;");
document.writeln("	color: #F3C;");
document.writeln("}");
document.writeln("a:hover {");
document.writeln("	text-decoration: none;");
document.writeln("}");
document.writeln("a:active {");
document.writeln("	text-decoration: none;");
document.writeln("	color: #F90;");
document.writeln("}");
document.writeln("span { margin:0; }");
document.writeln("-->");
document.writeln("<\/style>");
document.writeln("<body style=\"background:#FFF; font-size:16px; line-height:180%; font-weight:bold; margin:0 auto; width:100%;\">");
document.writeln("<span class=\"bj1\"><a href=\"http:\/\/www.yangweiw.com\" target=\"_blank\">一次性治愈各种原因引起的阳痿早泄<\/a><\/span>");
document.writeln("<span class=\"bj5\"><a href=\"http:\/\/www.xiatian.cc\/\" target=\"_blank\">极致诱惑，乳中豪杰，明目张胆，诱惑众生<\/a><\/span>");
document.writeln("");
document.writeln("<span class=\"bj6\"><a href=\"http:\/\/www.xiatian.cc\/\" target=\"_blank\">独家：揭秘娱乐圈大牌女星丰满白嫩的内幕<\/a><\/span>");
document.writeln("<span><a href=\"http:\/\/www.kc777.cn\" target=\"_blank\">Aimei高纤营养减肥麦片，白天燃脂、夜晚排毒<\/a><\/span>");
document.writeln("<span class=\"bj3\"><a href=\"http:\/\/www.yangweiw.com\" target=\"_blank\">是什么让男人重振雄风，是什么让他夜夜雄霸<\/a><\/span>");
document.writeln("<span><a href=\"http:\/\/www.xiatian.cc\/\" target=\"_blank\">丰胸妙招: 睡觉丰胸，半个月增大到D杯<\/a><\/span>");
document.writeln("<span class=\"bj2\"><a href=\"http:\/\/www.yangweiw.com\" target=\"_blank\">中药壮阳:调气血、治肾亏，双调双补不伤身<\/a><\/span> ");
document.writeln("<span><a href=\"http:\/\/www.xiatian.cc\/\" target=\"_blank\">深V诱惑，牢牢抓住男人的心<\/a><\/span>");
document.writeln("<span class=\"bj6\"><a href=\"http:\/\/www.kc777.cn\" target=\"_blank\">麦片减肥，轻松月减10-30斤<\/a><\/span>");
document.writeln("<\/body>");
document.writeln("<\/html>");
document.writeln("")