//<meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
// JavaScript Document
//*******reg.jsp***************//

function reg_save(){
	if(document.form1.username.value==""||document.form1.password.value==""||document.form1.repassword.value==""||document.form1.name.value==""){
		alert("代*号内容必须填写");
		return false;
	}
	if(document.form1.password.value!=document.form1.repassword.value){
		alert("密码与密码确认不符");
		return false;
	}
	if(document.form1.username.value.indexOf("'")!=-1||document.form1.password.value.indexOf("'")!=-1||
		document.form1.repassword.value.indexOf("'")!=-1||document.form1.email.value.indexOf("'")!=-1||
		document.form1.name.value.indexOf("'")!=-1||document.form1.age.value.indexOf("'")!=-1||document.form1.homepage.value.indexOf("'")!=-1){
			alert("禁止填写非法字符");
			return false;
	}
	if(document.form1.username.value.indexOf("<")!=-1||document.form1.password.value.indexOf("<")!=-1||
		document.form1.repassword.value.indexOf("<")!=-1||document.form1.email.value.indexOf("<")!=-1||
		document.form1.name.value.indexOf("<")!=-1||document.form1.age.value.indexOf("<")!=-1||document.form1.homepage.value.indexOf("<")!=-1){
			alert("禁止填写非法字符");
			return false;
	}
	if(document.form1.username.value.indexOf(">")!=-1||document.form1.password.value.indexOf(">")!=-1||
		document.form1.repassword.value.indexOf(">")!=-1||document.form1.email.value.indexOf(">")!=-1||
		document.form1.name.value.indexOf(">")!=-1||document.form1.age.value.indexOf(">")!=-1||document.form1.homepage.value.indexOf(">")!=-1){
			alert("禁止填写非法字符");
			return false;
	}
	if(document.form1.username.value.indexOf("\"")!=-1||document.form1.password.value.indexOf("\"")!=-1||
		document.form1.repassword.value.indexOf("\"")!=-1||document.form1.email.value.indexOf("\"")!=-1||
		document.form1.name.value.indexOf("\"")!=-1||document.form1.age.value.indexOf("\"")!=-1||document.form1.homepage.value.indexOf("\"")!=-1){
			alert("禁止填写非法字符");
			return false;
	}
	if(document.form1.age.value!=""){
		if(isNaN(document.form1.age.value)){
			alert("年龄请输入数字");
			return false;
		}
	}
	if(document.form1.email.value!=""){
		if(document.form1.email.value.indexOf("@")==-1||document.form1.email.value.indexOf(".")==-1){
			alert("您的Email地址错误");
			return false;
		}
	}
		return true;
}

//********login.jsp******************//
function login()
{
    if(document.form1.username.value!=""&&document.form1.password.value!="")
    {
     return true;
    }
    else
    {
     return false;
    }
}

//********gys_login.jsp******************//
function gys_login()
{
  if(document.form2.username.value!=""&&document.form2.password.value!="")
  {
          return true;
  }
  else
  {
       return false;
  }
}

//*****************供应商注册************************//
function reg()
{
  if(document.form2.button)
  {
    document.location='gys_zcxy.jsp';
  }
}





//*******email.jsp***************//
function email()
 {
	if(document.form1.jname.value==""||document.form1.jname.value.indexOf("@")==-1||document.form1.jname.value.indexOf(".")==-1){
		alert("请输入寄信人正确Email");
		return false;
	}
	if(document.form1.sname.value==""||document.form1.sname.value.indexOf("@")==-1||document.form1.sname.value.indexOf(".")==-1){
		alert("请输入收信人正确Email");
		return false;
	}
	if(document.form1.title.value==""){
		alert("请输入主题");
		return false;
	}

	return true;
}


