﻿// JavaScript Document
//滚动
function GetGundong(demoStr,demoStr1,demoStr2,speed)
{
  var demo=document.getElementById(demoStr);
  var demo1=document.getElementById(demoStr1);
  var demo2=document.getElementById(demoStr2);
  demo2.innerHTML=demo1.innerHTML
  function Marquee(){
  if(demo2.offsetWidth-demo.scrollLeft<=0)
  demo.scrollLeft-=demo1.offsetWidth
  else{
  demo.scrollLeft++
  }
  }
  var MyMar=setInterval(Marquee,speed)
  demo.onmouseover=function() {clearInterval(MyMar)}
  demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
 }

function resize(o) {
	if (o.width>580) {
	o.style.width='580px';
	o.style.height='auto';
	}
}

//改变验证码
function Chyzm()
{
	document.getElementById('ImgYzm').src='code.asp?rnd='+Math.random();
}

//注册验证
function CkRegister(TheForm)
{
	if(TheForm.UserName.value=="")
	{
		alert("请输入用户名！");
		TheForm.UserName.focus();
		return false;
	}
	if(TheForm.PassWord1.value == "")
	{
		alert("请输入密码！");
		TheForm.PassWord1.focus();
		return false;
	}
	if(TheForm.PassWord1.value !=TheForm.PassWord2.value)
	{
		alert("两次输入密码不一致！");
		TheForm.PassWord1.focus();
		return false;
	}
	if (TheForm.Nickname.value=="")
	{
	   alert ("请输入邮箱！");
	   TheForm.Nickname.focus();
	   return(false);
	}
	if (TheForm.TheYzm.value=="")
	{
	   alert ("请输入验证码！");
	   TheForm.TheYzm.focus();
	   return(false);
	}
}

function CkLogin(TheForm)
{
	if(TheForm.UserName.value=="")
	{
		alert("请输入用户名！");
		TheForm.UserName.focus();
		return false;
	}
	if(TheForm.PassWord1.value == "")
	{
		alert("请输入密码！");
		TheForm.PassWord1.focus();
		return false;
	}
	if (TheForm.TheYzm.value=="")
	{
	   alert ("请输入验证码！");
	   TheForm.TheYzm.focus();
	   return(false);
	}
}
function CkLogin2(TheForm)
{
	if(TheForm.UserName.value=="")
	{
		alert("请输入用户名！");
		TheForm.UserName.focus();
		return false;
	}
	if(TheForm.PassWord1.value == "")
	{
		alert("请输入密码！");
		TheForm.PassWord1.focus();
		return false;
	}
}
function CkNewPicBook(TheForm)
{
	if(TheForm.BookTitle.value=="")
	{
		alert("请输入相册名称！");
		TheForm.BookTitle.focus();
		return false;
	}
	if(TheForm.ThePic.value=="")
	{
		alert("请上传封面图！");
		TheForm.ThePic.focus();
		return false;
	}
}
function CkNewPic(TheForm)
{
	if(TheForm.BookName.value=="0")
	{
		alert("请选择相册！");
		TheForm.BookName.focus();
		return false;
	}
	if(TheForm.BookTitle.value=="")
	{
		alert("请输入佳作名称！");
		TheForm.BookTitle.focus();
		return false;
	}
	if(TheForm.PicNote.value=="")
	{
		alert("请输入佳作说明！");
		TheForm.PicNote.focus();
		return false;
	}
	if(TheForm.ThePic.value=="")
	{
		alert("请上传图片！");
		TheForm.ThePic.focus();
		return false;
	}
}