// JavaScript Document

//验证会员登陆
function checkloginjs(){
    var text="";

    var M1 = checklogin.username.value; 
    var M2 = checklogin.password.value; 
	
    if (M1 == ""){text=text+"请输入用户名 !\n\n"} 
    if (M1 == ""){text=text+"请输入用户密码 !\n"} 
//向页面反馈信息	
   if (text == "") {return true;}
   else {
    alert(text);
    return false;
    }           
}

/*验证注册信息*/
function checkregjs(){
    var text="";

    var M1 = checkreg.username.value; 
    var M2 = checkreg.userpass.value; 
    var M3 = checkreg.repassword.value; 
    var M4 = checkreg.tel.value; 
    var M5 = checkreg.email.value; 

    if (M1 == ""){text=text+"姓名不能为空 !\n"} 
    if (M2 == ""){text=text+"密码不能为空 !\n"} 
    if (M3 == ""){text=text+"确认密码不能为空 !\n"} 
    if (M2 != M3){text=text+"两次密码输入不一致 !\n"} 
    if (M4 == ""){text=text+"电话不能为空 !\n"} 
    if (M5 == ""){text=text+"电子信箱不能为空 !\n"} 

//向页面反馈信息	
   if (text == "") {return true;}
   else {
    alert(text);
    return false;
    }           
}

/*验证报名*/
function checkbaomingjs(){
    var text="";

    var M1 = checkbaoming.username.value; 
    var M2 = checkbaoming.renshu.value; 
    var M3 = checkbaoming.xueli.value; 
    var M4 = checkbaoming.tel.value; 
    var M5 = checkbaoming.email.value; 
    var M6 = checkbaoming.address.value; 

    if (M1 == ""){text=text+"姓名不能为空 !\n"} 
    if (M2 == ""){text=text+"人数不能为空 !\n"} 
    if (M3 == ""){text=text+"学历不能为空 !\n"} 
    if (M4 == ""){text=text+"手机不能为空 !\n"} 
    if (M5 == ""){text=text+"电子信箱不能为空 !\n"} 
    if (M6 == ""){text=text+"所在地区不能为空 !"} 
//向页面反馈信息	
   if (text == "") {return true;}
   else {
    alert(text);
    return false;
    }           
}

/*验证新闻*/
function checkbookjs(){
    var text="";

    var M1 = checkbook.title.value; 
    var M2 = checkbook.content.value; 

    if (M1 == ""){text=text+"主题不能为空 !\n\n"} 
    if (M2 == ""){text=text+"咨询容不能为空 !"} 
//向页面反馈信息	
   if (text == "") {return true;}
   else {
    alert(text);
    return false;
    }           
}


/*验证新闻*/
function Checknews(myform){
    var text="";

    var M1 = myform.title.value; 
    var M2 = myform.content.value; 

    if (M1 == ""){text=text+"信息名称不能为空 !\n\n"} 
    if (M2 == ""){text=text+"信息内容不能为空 !"} 
//向页面反馈信息	
   if (text == "") {return true;}
   else {
    alert(text);
    return false;
    }           
}

/*验证密码*/
function checkpassjs(){
    var text="";

    var M1 = checkpass.userpass.value; 
    var M2 = checkpass.repassword.value; 
    if (M1 == ""){text=text+"密码不能为空 !\n"} 
    if (M2 == ""){text=text+"确认密码不能为空 !\n"} 
    if (M1 != M2){text=text+"两次密码输入不一致 !\n"} 
//向页面反馈信息	
   if (text == "") {return true;}
   else {
    alert(text);
    return false;
    }           
}
function CheckAll(form)
{
  for (var i=0;i<form.elements.length;i++)
    {
		var e = form.elements[i];
		if (e.Name != "ChkAll"&&e.disabled==false)
		e.checked = form.ChkAll.checked;
    }
}
function unselectall()
{
    if(document.form.ChkAll.checked)
	{
		document.form.ChkAll.checked = document.form.ChkAll.checked&0;
    } 	
}
function downdel()
{
if(document.form.action.value=="Del")
	{
		if(confirm("确定要删除选中的记录吗？"))
		return true;
		else
		return false;
	}
}

var tt='start';
var ii='start';
function turnit(ss,bb) {

  if (ss.style.display=="none") {
    if(tt!='start') tt.style.display="none";
    if(ii!='start') ii.src="images/d_icon.gif";
    ss.style.display="";
    tt=ss;
    bb.src="";
  }
  else {
    ss.style.display="none";
    bb.src="";
  }
}

var t='stop';
var i='stop';
function to(x,b) {

  if (x.style.display=="none") {
    if(t!='stop') t.style.display="none";
    if(i!='stop') i.src="images/d_icon.gif";
    x.style.display="";
    t=x;
    i=ww;
    b.src="";
  }
  else {
    x.style.display="none";
    b.src="";
  }
}
