var startTime,endTime;
var d=new Date();
startTime=d.getTime();
function openwin(URL)
  { showModalDialog(URL,"","dialogWidth:10px;status:no;dialogHeight:10px;resizable:no");}

function pic(URL3)
  { window.open(URL3,"pic","");
  }
      function js(URL4)
  { window.open(URL4,"js","toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=250,height=100,left=0,top=0,");
  }
      function dj(URL5)
  { window.open(URL5,"dj","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=500,height=400,left=0,top=0,");
  }  
//***********默认设置定义.*********************
tPopWait=0;//停留tWait豪秒后显示提示。
tPopShow=2000000;//显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=99;


//***************内部变量定义*****************
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText {background: #f8f8f3; color:#030303;border: 1px #000000 solid;padding:4px; height:20px;filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");
function showPopupText(){
var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
        if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
	if(o.dypop!=sPop) {
			sPop=o.dypop;
			clearTimeout(curShow);
			clearTimeout(tFadeOut);
			clearTimeout(tFadeIn);
			clearTimeout(tFadeWaiting);	
			if(sPop==null || sPop=="") {
				dypopLayer.innerHTML="";
				dypopLayer.style.filter="Alpha()";
				dypopLayer.filters.Alpha.opacity=0;	
				}
			else {
				if(o.dyclass!=null) popStyle=o.dyclass 
					else popStyle="cPopText";
				curShow=setTimeout("showIt()",tPopWait);
			}
	}
}

function showIt(){
		dypopLayer.className=popStyle;
		dypopLayer.innerHTML=sPop;
		popWidth=dypopLayer.clientWidth;
		popHeight=dypopLayer.clientHeight;
		if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
			else popLeftAdjust=0;
		if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
			else popTopAdjust=0;
		dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
		dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
		dypopLayer.style.filter="Alpha(Opacity=0)";
		fadeOut();
}

function fadeOut(){
	if(dypopLayer.filters.Alpha.opacity<popOpacity) {
		dypopLayer.filters.Alpha.opacity+=showPopStep;
		tFadeOut=setTimeout("fadeOut()",1);
		}
		else {
			dypopLayer.filters.Alpha.opacity=popOpacity;
			tFadeWaiting=setTimeout("fadeIn()",tPopShow);
			}
}

function fadeIn(){
	if(dypopLayer.filters.Alpha.opacity>0) {
		dypopLayer.filters.Alpha.opacity-=1;
		tFadeIn=setTimeout("fadeIn()",1);
		}
}
document.onmouseover=showPopupText;
// 判断连接函数
function link()
			{
			if (form.fl_name.value=="")
			{	alert("请填写网站名称");
				form.fl_name.focus();
				return false;
			}

			if (form.fl_url.value=="http://")
			{	alert("请填写网站地址");
				form.fl_url.focus();
				return false;
			}
                        if (form.fl_name.value.length>10)
			{	alert("网站名称不可以超过6个字");
				form.fl_name.focus();
				return false;
			}
                        alert("野草提示：\n\n⒈您已经做好了本站连接。\n\n⒉您的网站内容没有非法内容。 \n\n⒊您的站点具有一定的访问量。\n\n如果达不到以上三点则不会被通过！");
                        form.submit.disabled=true;
			return true;
			}

// 新闻、文章的字体大小改变函数
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 copyUrl(obj) 
{
var rng = document.body.createTextRange();rng.moveToElementText(obj);rng.scrollIntoView();rng.select();rng.execCommand("Copy");rng.collapse(false);
alert("复制成功，请把此网址在你喜欢的论坛或QQ里面发给你的朋友！");
}
function chk()
{
	if(document.form.adminname.value == "")
	{
	alert("“站长姓名”不能为空！");
	document.form.adminname.focus();
	document.form.adminname.select();
	return false;
	}
	if(document.form.adminemail.value == "")
	{
	alert("“站长信箱”不能为空！");
	document.form.adminemail.focus();
	document.form.adminemail.select();
	return false;
	}
	if(document.form.webname.value == "")
	{
	alert("“网站名称”不能为空！");
	document.form.webname.focus();
	document.form.webname.select();
	return false;
	}	
	if(document.form.site.value == "")
	{
	alert("“网站地址”不能为空！");
	document.form.site.focus();
	document.form.site.select();
	return false;
	}	
	if(document.form.content.value == "")
	{
	alert("“网站介绍”不能为空！");
	document.form.content.focus();
	document.form.content.select();
	return false;
	}
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 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
// 滚动脚本
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)};
	}
}