﻿// JScript 文件

function RegCheckValid()
{
	if (document.form1.usernameTxt.value=="" || document.form1.usernameTxt.value.length<4 || document.form1.usernameTxt.value.length>20){
		alert("请输入帐号（至少4个字符并且小于20个字符）！");
		document.form1.usernameTxt.focus();
		return false;
	}
	if (document.form1.passwordTxt.value=="" || document.form1.passwordTxt.value.length<6 || document.form1.passwordTxt.value.length>20){
		alert("请输入登录密码（至少大于6个字符并且小于20个字符）！");
		document.form1.passwordTxt.focus();
		return false;
	}
	if (document.form1.passwordTxt.value != document.form1.verifyPwdTxt.value){
		alert("密码确认与登录密码不符！");
		document.form1.verifyPwdTxt.focus();
		return false;
	}
	if (document.form1.companyNameTxt.value.replace(/\s/g,"")==""){
		alert("请输入公司名称！");
		document.form1.companyNameTxt.focus();
		return false;
	}
	if (document.form1.contactPersonTxt.value.replace(/\s/g,"")==""){
		alert("请输入联系人！");
		document.form1.contactPersonTxt.focus();
		return false;
	}
	if (document.form1.phoneTxt.value.replace(/\s/g,"")==""){
		alert("请输入联系电话！");
		document.form1.phoneTxt.focus();
		return false;
	}
	if(document.form1.emailTxt.value=="" || !document.form1.emailTxt.value.match(/^[\w\.\-]+@([\w\-]+\.)+[a-z]{2,4}$/ig)){
		alert("请输入正确电子信箱!");
		document.form1.emailTxt.focus();
		return false;
	}
}

function MemberInfoCheckValid()
{
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_usernameTxt.value=="" || document.aspnetForm.ctl00_ContentPlaceHolder1_usernameTxt.value.length<4 || document.aspnetForm.ctl00_ContentPlaceHolder1_usernameTxt.value.length>20){
		alert("请输入帐号（至少4个字符并且小于20个字符）！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_usernameTxt.focus();
		return false;
	}
	if(document.aspnetForm.ctl00_ContentPlaceHolder1_passwordTxt.value!="")
	{
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_passwordTxt.value.length<6 || document.aspnetForm.ctl00_ContentPlaceHolder1_passwordTxt.value.length>20){
		alert("请输入旧登录密码（至少大于6个字符并且小于20个字符）！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_passwordTxt.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_newPasswordTxt.value.length<6 || document.aspnetForm.ctl00_ContentPlaceHolder1_newPasswordTxt.value.length>20){
		alert("请输入新登录密码（至少大于6个字符并且小于20个字符）！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_newPasswordTxt.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_newPasswordTxt.value != document.aspnetForm.ctl00_ContentPlaceHolder1_verifyPwdTxt.value){
		alert("密码确认与新登录密码不符！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_verifyPwdTxt.focus();
		return false;
	}
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_companyNameTxt.value.replace(/\s/g,"")==""){
		alert("请输入公司名称！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_companyNameTxt.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_contactPersonTxt.value.replace(/\s/g,"")==""){
		alert("请输入联系人！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_contactPersonTxt.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_phoneTxt.value.replace(/\s/g,"")==""){
		alert("请输入联系电话！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_phoneTxt.focus();
		return false;
	}
	if(document.aspnetForm.ctl00_ContentPlaceHolder1_emailTxt.value=="" || !document.aspnetForm.ctl00_ContentPlaceHolder1_emailTxt.value.match(/^[\w\.\-]+@([\w\-]+\.)+[a-z]{2,4}$/ig)){
		alert("请输入正确电子信箱!");
		document.aspnetForm.ctl00_ContentPlaceHolder1_emailTxt.focus();
		return false;
	}
}


function MemberLogin(){
	if (document.form1.usernameTxt.value==""){
		alert("请输入用户名！");
		document.form1.usernameTxt.focus();
		return false;
	}
	if (document.form1.passwordTxt.value==""){
		alert("请输入密码！");
		document.form1.passwordTxt.focus();
		return false;
	}
}

function IndexMemberLogin(){
 if(document.form1.header1_keywordTxt.value==""){  
	if (document.form1.login1$usernameTxt.value==""){
		alert("请输入用户名！");
		document.form1.login1$usernameTxt.focus();
		return false;
	}
	if (document.form1.login1$passwordTxt.value==""){
		alert("请输入密码！");
		document.form1.login1$passwordTxt.focus();
		return false;
	}
  }
}


function NewsCheckValid(){
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_titleTxt.value.replace(/\s/g,"")==""){
		alert("请输入标题！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_titleTxt.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_tagTxt.value.replace(/\s/g,"")==""){
		alert("请输入标签！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_tagTxt.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_authorTxt.value.replace(/\s/g,"")==""){
		alert("请输入作者！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_authorTxt.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_contentTxt.value.replace(/\s/g,"")==""){
		alert("请输入内容！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_contentTxt.focus();
		return false;
	}
}

function ProductCheckValid(){
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_classList.value=="0"){
		alert("请选择" + document.aspnetForm.ctl00_ContentPlaceHolder1_classTxt.value);
		document.aspnetForm.ctl00_ContentPlaceHolder1_classList.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_proTitleTxt.value.replace(/\s/g,"")==""){
		alert("请输入产品代理标题！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_proTitleTxt.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_proNameTxt.value.replace(/\s/g,"")==""){
		alert("请输入产品名称！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_proNameTxt.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_tzjeList.value=="0"){
		alert("请选择投资金额！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_tzjeList.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_proLogoTxt.value.replace(/\s/g,"")==""){
		alert("请上传产品LOGO！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_logoFileUpload.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_proAdTxt.value.replace(/\s/g,"")==""){
		alert("请上传产品广告！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_adFileUpload.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_proIntroTxt.value.replace(/\s/g,"")==""){
		alert("请输入产品介绍内容！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_proIntroTxt.focus();
		return false;
	}
}

function AgentCheckValid(){
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_classList.value=="0"){
		alert("请选择" + document.aspnetForm.ctl00_ContentPlaceHolder1_classTxt.value);
		document.aspnetForm.ctl00_ContentPlaceHolder1_classList.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_proTitleTxt.value.replace(/\s/g,"")==""){
		alert("请输入代理需求标题！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_proTitleTxt.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_proNameTxt.value.replace(/\s/g,"")==""){
		alert("请输入代理需求名称！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_proNameTxt.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_tzjeList.value=="0"){
		alert("请选择投资金额！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_tzjeList.focus();
		return false;
	}
	if (document.aspnetForm.ctl00_ContentPlaceHolder1_proIntroTxt.value.replace(/\s/g,"")==""){
		alert("请输入代理优势！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_proIntroTxt.focus();
		return false;
	}
}

function ProMsgCheckValid(){
	if (document.form1.nameTxt.value.replace(/\s/g,"")==""){
		alert("请输入姓名！");
		document.form1.nameTxt.focus();
		return false;
	}
	if (document.form1.phoneTxt.value.replace(/\s/g,"")==""){
		alert("请输入联系电话！");
		document.form1.phoneTxt.focus();
		return false;
	}
	if (document.form1.contentTxt.value.replace(/\s/g,"")==""){
		alert("请输入留言内容！");
		document.form1.contentTxt.focus();
		return false;
	}
	if (document.form1.verifyTxt.value.replace(/\s/g,"")==""){
		alert("请验证码！");
		document.form1.verifyTxt.focus();
		return false;
	}
}

function FindPwd(){
	if (document.form1.usernameTxt.value.replace(/\s/g,"")==""){
		alert("请输入用户名！");
		document.form1.usernameTxt.focus();
		return false;
	}
}

function FindPwd2(){
	if (document.form1.answerTxt.value.replace(/\s/g,"")==""){
		alert("请输入回答问题的答案！");
		document.form1.answerTxt.focus();
		return false;
	}
}