﻿//颜色供选函数：
function showColorForSel()
{
  document.write("<SELECT onchange=\"if(this.options[this.selectedIndex].value!=''){do_color('fontZoom',this.options[this.selectedIndex].value);}\" size=\"1\" name=\"do_color_frm\">");
  document.write("	<OPTION value=\"Black\" selected>请选择</OPTION>");
  document.write("	<OPTION style=\"COLOR: black; BACKGROUND-COLOR: black\" value=\"Black\">黑色</OPTION>");
  document.write("	<OPTION style=\"COLOR: red; BACKGROUND-COLOR: red\" value=\"Red\">红 色</OPTION>");
  document.write("	<OPTION style=\"COLOR: yellow; BACKGROUND-COLOR: yellow\" value=\"Yellow\">黄色</OPTION>");
  document.write("	<OPTION style=\"COLOR: green; BACKGROUND-COLOR: green\" value=\"Green\">绿色</OPTION>");
  document.write("	<OPTION style=\"COLOR: orange; BACKGROUND-COLOR: orange\" value=\"Orange\">橙色</OPTION>");
  document.write("	<OPTION style=\"COLOR: purple; BACKGROUND-COLOR: purple\" value=\"Purple\">紫色</OPTION>");
  document.write("	<OPTION style=\"COLOR: blue; BACKGROUND-COLOR: blue\" value=\"Blue\">蓝色</OPTION>");
  document.write("	<OPTION style=\"COLOR: brown; BACKGROUND-COLOR: brown\" value=\"Brown\">褐色</OPTION>");
  document.write("	<OPTION style=\"COLOR: teal; BACKGROUND-COLOR: teal\" value=\"Teal\">墨绿</OPTION>");
  document.write("	<OPTION style=\"COLOR: navy; BACKGROUND-COLOR: navy\" value=\"Navy\">深蓝</OPTION>");
  document.write("	<OPTION style=\"COLOR: maroon; BACKGROUND-COLOR: maroon\" value=\"Maroon\">赭石</OPTION>");
  document.write("	<OPTION style=\"COLOR: #00ffff; BACKGROUND-COLOR: #00ffff\" value=\"#00FFFF\">粉绿</OPTION>");
  document.write("	<OPTION style=\"COLOR: #7fffd4; BACKGROUND-COLOR: #7fffd4\" value=\"#7FFFD4\">淡绿</OPTION>");
  document.write("	<OPTION style=\"COLOR: #ffe4c4; BACKGROUND-COLOR: #ffe4c4\" value=\"#FFE4C4\">黄灰</OPTION>");
  document.write("	<OPTION style=\"COLOR: #7fff00; BACKGROUND-COLOR: #7fff00\" value=\"#7FFF00\">翠绿</OPTION>");
  document.write("	<OPTION style=\"COLOR: #d2691e; BACKGROUND-COLOR: #d2691e\" value=\"#D2691E\">综红</OPTION>");
  document.write("	<OPTION style=\"COLOR: #ff7f50; BACKGROUND-COLOR: #ff7f50\" value=\"#FF7F50\">砖红</OPTION>");
  document.write("	<OPTION style=\"COLOR: #6495ed; BACKGROUND-COLOR: #6495ed\" value=\"#6495ED\">淡蓝</OPTION>");
  document.write("	<OPTION style=\"COLOR: #dc143c; BACKGROUND-COLOR: #dc143c\" value=\"#DC143C\">暗红</OPTION>");
  document.write("	<OPTION style=\"COLOR: #ff1493; BACKGROUND-COLOR: #ff1493\" value=\"#FF1493\">玫瑰红</OPTION>");
  document.write("	<OPTION style=\"COLOR: #ff00ff; BACKGROUND-COLOR: #ff00ff\" value=\"#FF00FF\">紫红</OPTION>");
  document.write("	<OPTION style=\"COLOR: #ffd700; BACKGROUND-COLOR: #ffd700\" value=\"#FFD700\">桔黄</OPTION>");
  document.write("	<OPTION style=\"COLOR: #daa520; BACKGROUND-COLOR: #daa520\" value=\"#DAA520\">军黄</OPTION>");
  document.write("	<OPTION style=\"COLOR: #808080; BACKGROUND-COLOR: #808080\" value=\"#808080\">烟灰</OPTION>");
  document.write("	<OPTION style=\"COLOR: #778899; BACKGROUND-COLOR: #778899\" value=\"#778899\">深灰</OPTION>");
  document.write("	<OPTION style=\"COLOR: #b0c4de; BACKGROUND-COLOR: #b0c4de\" value=\"#B0C4DE\">灰蓝</OPTION>");
  document.write("</SELECT>");
}

//改变图片大小
function resizepic(thispic)
{
if(thispic.width>600) thispic.width=600;
}
//无级缩放图片大小
function bbimg(o)
{
  var zoom=parseInt(o.style.zoom, 10)||100;
  zoom+=event.wheelDelta/12;
  if (zoom>0) o.style.zoom=zoom+'%';
  return false;
}
//双击鼠标滚动屏幕的代码
var currentpos,timer;
function initialize()
{
timer=setInterval ("scrollwindow ()",30);
}
function sc()
{
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos !=document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize

//更改字体大小
var status0='';
var curfontsize=15;
var curlineheight=25;
function fontZoom(curfz,curlh){	//设置字体
	curfontsize=curfz;
	//curlineheight=curlh;
	document.getElementById('fontZoom').style.fontSize=curfz+'px';
	//document.getElementById('fontzoom').style.lineHeight=curlh+'pt';
}
function fontZoomA(){
  if(curfontsize>8){
    	document.getElementById('fontzoom').style.fontSize=(--curfontsize)+'px';
	//document.getElementById('fontzoom').style.lineHeight=(--curlineheight)+'pt';
  }
}
function fontZoomB(){
  if(curfontsize<64){
    	document.getElementById('fontzoom').style.fontSize=(++curfontsize)+'px';
	//document.getElementById('fontzoom').style.lineHeight=(++curlineheight)+'pt';
  }
}

	                        //内容颜色
function do_color(vobject,vvar)
{ document.getElementById(vobject).style.color=vvar; }

function do_zooms(vobject,vvar)
{ document.getElementById(vobject).style.fontsize=vvar+'px'; }

function doZoom(size)
{
	var artibody = document.getElementById('contents');
	if(!artibody) return;
	var artibodyChild = artibody.childNodes;
	artibody.style.fontSize = size + 'px';
	for(var i = 0; i < artibodyChild.length; i++){
		if(artibodyChild[i].nodeType == 1){
			artibodyChild[i].style.fontSize = size + 'px';
		}
	}	
}
