//防止错误出现
function killErrors() {
return true;}
window.onerror = killErrors;
var pltsPop=null;
var pltsoffsetX = 10;   // 弹出窗口位于鼠标左侧或者右侧的距离；3-12 合适
var pltsoffsetY = 15;  // 弹出窗口位于鼠标下方的距离；3-12 合适
var pltsPopbg="#FFFFEE"; //背景色
var pltsPopfg="#000000"; //前景色
var pltsTitle="cvvvv";
document.write('<div id=pltsTipLayer style="display: none;position: absolute; z-index:10001"></div>');
function pltsinits()
{document.onmouseover=plts;
document.onmousemove=moveToMouseLoc;}
function plts()
{var o=event.srcElement;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
pltsPop=o.dypop;
if(pltsPop!=null&&pltsPop!=""&&typeof(pltsPop)!="undefined")
{pltsTipLayer.style.left=-1000;
pltsTipLayer.style.display='';
var Msg=pltsPop.replace(/\n/g,"<br>");
Msg=Msg.replace(/\0x13/g,"<br>");
var re=/\{(.[^\{]*)\}/ig;
if(!re.test(Msg))pltsTitle="";
else{
re=/\{(.[^\{]*)\}(.*)/ig;
pltsTitle=Msg.replace(re,"$1")+"&nbsp;";
re=/\{(.[^\{]*)\}/ig;
Msg=Msg.replace(re,"");
Msg=Msg.replace("<br>","");}
var content =
'<table style="background:url(img/titlebj.gif) #ffffff;border:1px solid #444444;" id=toolTipTalbe><tr id=pltsPoptop><th id=topleft><p id=topright style="display:none"></th></tr><tr><td  style="padding:4px;line-height:135%">'+Msg+'</td></tr>'+
'<tr id=pltsPopbot style="display:none"><th><p id=botleft></p><p id=botright align=rightstyle="display:none"></th></tr></table>';
pltsTipLayer.innerHTML=content;
toolTipTalbe.style.width=Math.min(pltsTipLayer.clientWidth,document.body.clientWidth/2.2);
moveToMouseLoc();
return true;}else{pltsTipLayer.innerHTML='';
pltsTipLayer.style.display='none';
return true;}}
function moveToMouseLoc()
{if(pltsTipLayer.innerHTML=='')return true;
var MouseX=event.x;
var MouseY=event.y;
//window.status=event.y;
var popHeight=pltsTipLayer.clientHeight;
var popWidth=pltsTipLayer.clientWidth;
if(MouseY+pltsoffsetY+popHeight>document.body.clientHeight)
{popTopAdjust=-popHeight-pltsoffsetY*1.5;
pltsPoptop.style.display="none";
pltsPopbot.style.display="";}else{
popTopAdjust=0;pltsPoptop.style.display="";pltsPopbot.style.display="none";}
if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth){
popLeftAdjust=-popWidth-pltsoffsetX*2;topleft.style.display="none";
botleft.style.display="none";
topright.style.display="";
botright.style.display="";}else
{popLeftAdjust=0;topleft.style.display="";botleft.style.display="";
topright.style.display="none";botright.style.display="none";}
pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
return true;}
pltsinits();
// 新闻、文章的字体大小改变函数
function ContentSize(size)
{
var obj=document.getElementById("size");obj.style.fontSize=size+"px";
}
// 新闻、文章的复制文本函数
function copyText(obj) 
{
var rng = document.body.createTextRange();rng.moveToElementText(obj);rng.scrollIntoView();rng.select();rng.execCommand("Copy");rng.collapse(false);
}
// 判断连接函数
function link()
{
	if(document.form.adminname.value=="")
	{
	alert("“站长姓名”不能为空！");
	document.form.adminname.focus();
	document.form.adminname.select();
	return false;
	}
	if(document.form.webname.value=="")
	{
	alert("“网站名称”不能为空！");
	document.form.webname.focus();
	document.form.webname.select();
	return false;
	}	
	if(document.form.url.value=="")
	{
	alert("“网站地址”不能为空！");
	document.form.url.focus();
	document.form.url.select();
	return false;
	}
if(document.form.url.value=="http://")
	{
	alert("“网站地址”不能为空！");
	document.form.url.focus();
	document.form.url.select();
	return false;
	}	
	if(document.form.content.value=="")
	{
	alert("“网站介绍”不能为空！");
	document.form.content.focus();
	document.form.content.select();
	return false;
	}
alert("重要提示：\n\n⒈您已经做好了本站连接。\n\n⒉您的网站内容没有非法内容。 \n\n⒊您的站点具有一定的访问量。\n\n  如果达不到以上三点则不会被通过！");
form.submit.disabled=true;
return true;}
// 判断留言函数
function checkBook()
{var form=document.getElementById("form");
if (form.words.value=="")
{alert("请填写留言内容");
form.words.focus();
return false;}
if (form.uc.value=="")
{alert("请填写主题");
form.uc.focus();
return false;}
if (form.words.value.length>255)
{alert("留言内容不可以超过255个汉字");
form.words.focus();
return false;}
if (form.name.value=="")
{alert("请填写姓名");
form.name.focus();
return false;}
if (form.name.value.length>10)
{alert("姓名不可以超过10个字");
form.name.focus();
return false;}
if (form.words.value.length<4)
{alert("留言内容不可以低于2个汉字");
form.words.focus();
return false;}
if (form.VerifyCode.value=="")
{alert("请输入正确的认证码");
form.VerifyCode.focus();
return false;}
form.submit.disabled=true;
return true;}
function bookshowLen(obj)
{document.getElementById("wordsLen").value=obj.value.length;}
function bookcount(message,total,used,remain)
{
	var max;
	max = total.value;
	if (message.value.length > max) {
	message.value = message.value.substring(0,max);
	used.value = max;
	remain.value = 0;
	alert("内容不能超过" +max+ "个字!");
	}
	else {
	used.value = message.value.length;
	remain.value = max - used.value;
	}
}
//改变图片大小
function resizepic(thispic)
{if(thispic.width>700) thispic.width=700;}
//缩放图片大小
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
function window.onhelp() {//屏蔽F1帮助
return false}
function document.onkeydown() {
	if (event.keyCode==116) {//屏蔽F5键
		event.keyCode = 0;
		event.cancelBubble = true;
		return false;
	}
	if (event.keyCode==122) {//屏蔽F11键
		event.keyCode = 0;
		event.cancelBubble = true;
		return false;
	}
	if ((event.ctrlKey && event.keyCode==82)) {//屏蔽Ctrl+R
		event.keyCode = 0;
		event.cancelBubble = true;
		return false;
	}
	if ((event.ctrlKey && event.keyCode==78)) {//屏蔽Ctrl+N
		event.keyCode = 0;
		event.cancelBubble = true;
		return false;
	}
	if ((event.keyCode == 8) && (event.srcElement.type != "text" && event.srcElement.type != "textarea" && event.srcElement.type != "password")) {//屏蔽BackSpace键
		event.keyCode = 0;
		event.cancelBubble = true;
		return false;
	}
}
// 滚动脚本
var rollspeed=30
var myInter;
function MarqueeV(){
	var ooRollV=document.getElementById("oRollV");
	var ooRollV1=document.getElementById("oRollV1");
	var ooRollV2=document.getElementById("oRollV2");
	if(ooRollV2.offsetTop-ooRollV.scrollTop<=0) {
		ooRollV.scrollTop-=ooRollV1.offsetHeight;
	}else{
		ooRollV.scrollTop++;
	}
}
function StartRollV() {
	var ooRollV=document.getElementById("oRollV");
	var ooRollV1=document.getElementById("oRollV1");
	var ooRollV2=document.getElementById("oRollV2");
	if (ooRollV) {
		if (parseInt(ooRollV.style.height)>=ooRollV2.offsetTop) {
			ooRollV.style.height = ooRollV2.offsetTop;
			return;
		}
		ooRollV2.innerHTML=ooRollV1.innerHTML;
		myInter=setInterval(MarqueeV,rollspeed);
		ooRollV.onmouseover=function() {clearInterval(myInter)};
		ooRollV.onmouseout=function() {myInter=setInterval(MarqueeV,rollspeed)};
	}
}
function MarqueeH(){
	var ooRollH=document.getElementById("oRollH");
	var ooRollH1=document.getElementById("oRollH1");
	var ooRollH2=document.getElementById("oRollH2");
	if(ooRollH2.offsetLeft-ooRollH.scrollLeft<=0) {
		ooRollH.scrollLeft-=ooRollH1.offsetWidth;
	}else{
		ooRollH.scrollLeft++;
	}
}
function StartRollH() {
	var ooRollH=document.getElementById("oRollH");
	var ooRollH1=document.getElementById("oRollH1");
	var ooRollH2=document.getElementById("oRollH2");
	if (ooRollH) {
		if (parseInt(ooRollH.style.width)>=ooRollH2.offsetLeft) {
			oRollH.style.width = oRollH2.offsetLeft;
			return;
		}
		ooRollH2.innerHTML=ooRollH1.innerHTML;
		myInter=setInterval(MarqueeH,rollspeed);
		ooRollH.onmouseover=function() {clearInterval(myInter)};
		ooRollH.onmouseout=function() {myInter=setInterval(MarqueeH,rollspeed)};
	}
}
window.onload=function(){doubleBgColor(document.getElementById("yecaotable"),"#FCFCFC","#ffffff")}
function doubleBgColor(Table,Bg1,Bg2){for (var i=0;i<Table.rows.length;i++) Table.rows[i].bgColor=i%2?Bg2:Bg1;}