// 列表全选
function ClickAll(obj)
	{
		var cObj = document.getElementById("CAll").checked;
		var obj = document.getElementsByName(obj);
		var len = obj.length;
		if (cObj)
		{
			for (i=0;i<len;i++)
			{
				obj[i].checked = true;
			}
		}
		else
		{
			for (i=0;i<len;i++)
			{
				obj[i].checked = false;
			}
		}
	}

//确认点击
function CheckClick(msg)
	{
		if(confirm(msg))
		{
			event.returnValue=true;
		}
		else
		{
			event.returnValue=false;
		}
	}

// 缩放图片
function PicZoom(obj)
{
	iWidth = 680;
	if (obj!=null)
	{
		if (obj.width >iWidth )
		{
			obj.width = iWidth;
		}
	}
	else
	{
		if (document.all.docpic!=null)
		{
			if (docpic.length!=null)
			{
				for (i=0;i<docpic.length;i++)
				{
					if (docpic[i].width>iWidth)
					{
						docpic[i].width=iWidth;
					}
				}
			}
			else
			{
				if (docpic.width>iWidth)
				{
					docpic.width=iWidth;
				}
			}
		}
	}
}

//UBB 代码获取字符
function storeCaret (txtobj)   
{
	if (txtobj.createTextRange)
	{
		txtobj.curRange = document.selection.createRange().duplicate();
	}
}

//UBB 代码写入字符
function insertAtCaret (txtobj,txt1,txt2,overcast)
{
	if (txtobj.curRange)   
	{
		if (overcast == 0)
		{
			txtobj.curRange.text = txt1+txtobj.curRange.text+txt2;
		}
		else
		{
			txtobj.curRange.text = txt1+txt2;
		}
		txtobj.curRange.select();
	}
	else
	{
		txtobj.focus();
		storeCaret(txtobj);
		insertAtCaret (txtobj,txt1,txt2,overcast);
	}
}

//打开关闭说明列表
function fExpCon()
{
	if (ExpCon.innerText == "打开说明文档")
	{
		oExpCon.style.display = "";
		ExpCon.innerText = "关闭说明文档"
	}
	else
	{
		oExpCon.style.display = "none";
		ExpCon.innerText = "打开说明文档"
	}
}

//向上不间断滚动的函数
var Marquee_obj;
var Marquee_name;
var Marquee_height;

function InitMarquee(obj,name,height)
{
	Marquee_obj = obj;
	Marquee_name = name;
	Marquee_height = height;

	eval("var "+Marquee_name+"_MyMar = setInterval(FunMarquee,50)");

	if (document.getElementById(Marquee_obj).childNodes[1].offsetHeight > 200)
	{
	document.getElementById(Marquee_obj).childNodes[1].innerHTML = document.getElementById(Marquee_obj).childNodes[0].innerHTML;
	}
	document.getElementById(Marquee_obj).scrollTop = document.getElementById(Marquee_obj).scrollHeight;
											
	document.getElementById(Marquee_obj).onmouseover=function() {eval("clearInterval("+Marquee_name+"_MyMar)");}
	document.getElementById(Marquee_obj).onmouseout=function() {eval(Marquee_name+"_MyMar=setInterval(FunMarquee,50)");}
}

function FunMarquee()
{
	if (document.getElementById(Marquee_obj).scrollTop >= document.getElementById(Marquee_obj).childNodes[1].offsetHeight)
	{
		document.getElementById(Marquee_obj).scrollTop = 0;
	}
	else
	{
		document.getElementById(Marquee_obj).scrollTop++;
	}
}

//向左不间断滚动
function MarqueeGo(obj)
{
	if (obj.children[0].children[1].innerHTML == "")
	{
		obj.children[0].children[1].innerHTML = obj.children[0].children[0].innerHTML;
	}
	
	obj.scrollLeft++;
	if (obj.children[0].children[0].offsetWidth <= obj.scrollLeft)
	{
		obj.scrollLeft=1;
	}
}
//显示鼠标选中区域
function ShowPageBox(Count,Id,BoxName,ButName)
{
	for (I=1;I<=Count;I++)
	{
		document.getElementById(BoxName+"_"+I).style.display = "none";
		document.getElementById(ButName+"_"+I).className = "sTitles";
		document.getElementById(ButName+"_"+I).background = "Images/Nav_bgsss.gif";
	}
	document.getElementById(BoxName+"_"+Id).style.display = "";
	document.getElementById(ButName+"_"+Id).className = "sTitle";
	document.getElementById(ButName+"_"+Id).background = "Images/Nav_bgss.gif";
	//document.title = document.getElementById(ButName+"_"+Id).className;
}
//改变热点盒子
function ChangeBox(BoxName,ButName,BoxCount,BoxID,BoxMore)
{
	for (i=1;i<=BoxCount;i++)
	{
		if (i != BoxID)
		{
			document.getElementById(BoxName+"_"+i).style.display = "none";
			document.getElementById(ButName+"_"+i).style.fontWeight = 100;
			document.getElementById(ButName+"_"+i).style.color = "#336699";
			document.getElementById(ButName+"_"+i).background = "Images/Nav_bgsss.gif";
		}
		else
		{
			document.getElementById(BoxName+"_"+i).style.display="";
			document.getElementById(ButName+"_"+i).style.fontWeight = "bold";
			document.getElementById(ButName+"_"+i).style.color = "#FFFFFF";
			document.getElementById(ButName+"_"+i).background = "Images/Nav_bgss.gif";
			if (BoxMore != "")
			{
				document.getElementById(BoxName+"_More").href = BoxMore;
			}
		}
	}
}
//改变正文字体大小
function ChangeTextBox()
{
	if (tBut.innerText == "放大")
	{
		tBut.innerText = "还原"
		tBox.style.left = (document.body.clientWidth - 960) / 2;
		tBox.style.top = 122;
		tBox.style.width = 960;
		tBox.style.height = document.body.clientHeight;
		tBox.style.zIndex = 1;
		tBox.style.position = "absolute";
	}
	else
	{
		tBut.innerText = "放大"
		//tBox.style.left = (document.body.clientWidth - 960) / 2;
		//tBox.style.top = 122;
		tBox.style.width = 710;
		//tBox.style.height = document.body.clientHeight;
		//tBox.style.zIndex = 1;
		tBox.style.position = "";
	}
}