
////////////////////////////以下为自定义阅读参数内容不能修改//////////////////////////
function fontZoom(size) 
{ 
document.getElementById("content").style.fontSize=size+"px";
}
function fontZface(fface) 
{ 
document.getElementById("content").style.fontfamily="+fface+";
}
function fontZcolor(fcolor) 
{ 
document.getElementById("content").style.color=fcolor;
}

var speed = 5;
var currentpos=1;
var timer;
var backcolor;
var backsize;
var backfontcolor;
var backfontface;

function setSpeed()
{
	speed = parseInt(scrollspeed.value);
	if (speed < 1 || speed > 10){
	   speed=5;
	   scrollspeed.value=5;
	}
}

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();
}

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("backcolor",booktexts.backcolor.options[booktexts.backcolor.selectedIndex].value);
	setCookies("backsize",booktexts.backsize.options[booktexts.backsize.selectedIndex].value);
	setCookies("backfontcolor",booktexts.backfontcolor.options[booktexts.backfontcolor.selectedIndex].value);
	setCookies("backfontface",booktexts.backfontface.options[booktexts.backfontface.selectedIndex].value);
}

function loadSet()
{
	var tmpstr;
	tmpstr = ReadCookies("backcolor");
	if (tmpstr != "")
	{
		for (var i=0;i<document.booktexts.backcolor.length;i++)
		{
			if (document.booktexts.backcolor.options[i].value == tmpstr)
			{
				document.booktexts.backcolor.selectedIndex = i;
				break;
			}
		}
     document.bgColor=tmpstr;
	}


	tmpstr = ReadCookies("backsize");
	if (tmpstr != "")
	{
	 for (var i=0;i<document.booktexts.backsize.length;i++)
		{
			if (document.booktexts.backsize.options[i].value == tmpstr)
			{
				document.booktexts.backsize.selectedIndex = i;
				break;
			}
		}
      fontZoom(tmpstr);
	}


	tmpstr = ReadCookies("backfontcolor");
	if (tmpstr != "")
	{
	 for (var i=0;i<document.booktexts.backfontcolor.length;i++)
		{
			if (document.booktexts.backfontcolor.options[i].value == tmpstr)
			{
				document.booktexts.backfontcolor.selectedIndex = i;
				break;
			}
		}
      fontZcolor(tmpstr);
	}

	tmpstr = ReadCookies("backfontface");
	if (tmpstr != "")
	{
	 for (var i=0;i<document.booktexts.backfontface.length;i++)
		{
			if (document.booktexts.backfontface.options[i].value == tmpstr)
			{
				document.booktexts.backfontface.selectedIndex = i;
				break;
			}
		}
     document.fontface=tmpstr;
//////      fontZface(tmpstr);
	}

}

loadSet();