function openwin(urlStr) 
{  
window.open(urlStr,'blank','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=640,height=440,top=184,left=192') 
}

function VerifyInput()
{

if (document.form.uname.value == "")
{
alert("请输入您的会员帐号!");
document.form.uname.focus();
return false;
}


if (document.form.pwd.value == "")
{
alert("请输入密码!");
document.form.pwd.focus();
return false;
}
return  true;
}

//----------------------注册会员
function CheckForm(){
if (document.form1.refno.value == "")
{
	alert("请输入推荐您注册的合伙人会员号码!");
	document.form1.refno.focus();
	return false;
}
if (document.form1.refno.value.length < 12)
{
	alert("合伙人会员号码的字符数不能小于12!");
	document.form1.refno.focus();
	return false;
}

for (i=1;i<=document.form1.refno.value.length;i++){
if (!((document.form1.refno.value.charAt(i-1)>='0'&&document.form1.refno.value.charAt(i-1)<='9'))){
alert("该会员号码中只能包含数字!");
document.form1.refno.focus();
return false;
}
}

if (document.form1.email.value == "")
{
alert("请输入您的真实Email地址!");
document.form1.email.focus();
return false;
}

if (document.form1.email.value.indexOf('@',0) == -1 || document.form1.email.value.indexOf('.',0) == -1)
{
alert("你输入的Email有错误\n请重新输入你的Email!");
document.form1.email.focus();
return false;
}

if (document.form1.pw1.value == "")
{
alert("请输入您的密码!");
document.form1.pw1.focus();
return false;
}

for (i=1;i<=document.form1.pw1.value.length;i++){
if (!((document.form1.pw1.value.charAt(i-1)>='0'&&document.form1.pw1.value.charAt(i-1)<='9')||(document.form1.pw1.value.charAt(i-1)>='a'&&document.form1.pw1.value.charAt(i-1)<='z')||(document.form1.pw1.value.charAt(i-1)>='A'&&document.form1.pw1.value.charAt(i-1)<='Z'))){
alert("密码中包含非法字符!");
document.form1.pw1.focus();
return false;
}  
}

if (document.form1.pw1.value.length < 3 || document.form1.pw1.value.length > 20)
{
alert("密码的字符数不能小于3或大于20!");
document.form1.pw1.focus();
return false;
}


if (document.form1.pw2.value == "")
{
alert("请输入您的确认密码!");
document.form1.pw2.focus();
return false;
}

if (document.form1.pw1.value != document.form1.pw2.value)
{
alert("密码和确认密码必须一致!");
document.form1.pw2.focus();
return false;
}

if (document.form1.name.value == "")
{
alert("请输入您的昵称或真实姓名!");
document.form1.name.focus();
return false;
}
	/*年份*/
	if (document.form1.age_year.value=="")
	{
		alert("出生年份不能为空!");
		document.form1.age_year.focus();
		return false;
	}
	
	for (i=1;i<=document.form1.age_year.value.length;i++){
	if (!((document.form1.age_year.value.charAt(i-1)>='0'&&document.form1.age_year.value.charAt(i-1)<='9'))){
	alert("出生年份必须是数字!");
	document.form1.age_year.focus();
	return false;
	}
	}

	if (document.form1.age_year.value<=1900)
	{
		alert("您输入的年份有错误!");
		document.form1.age_year.focus();
		return false;
	}
	/*月份*/
	if (document.form1.age_month.value=="")
	{
		alert("出生月份不能为空!");
		document.form1.age_month.focus();
		return false;
	}
	for (i=1;i<=document.form1.age_month.value.length;i++){
	if (!((document.form1.age_month.value.charAt(i-1)>='0'&&document.form1.age_month.value.charAt(i-1)<='9'))){
	alert("出生月份必须是数字!");
	document.form1.age_month.focus();
	return false;
	}
	}
	if (document.form1.age_month.value>12)
	{
		alert("您输入的月份有错误!");
		document.form1.age_month.focus();
		return false;
	}
	/*日期*/
	if (document.form1.age_day.value=="")
	{
		alert("出生日期不能为空!");
		document.form1.age_day.focus();
		return false;
	}
	for (i=1;i<=document.form1.age_day.value.length;i++){
	if (!((document.form1.age_day.value.charAt(i-1)>='0'&&document.form1.age_day.value.charAt(i-1)<='9'))){
	alert("出生日期必须是数字!");
	document.form1.age_day.focus();
	return false;
	}
	}
	if (document.form1.age_day.value>31)
	{
		alert("您输入的日期有错误!");
		document.form1.age_day.focus();
		return false;
	}
	
if (document.form1.city2.value == "")
{
alert("请输入您所在的城市!");
document.form1.city2.focus();
return false;
}

if (document.form1.tel.value == "")
{
alert("请输入您的联系电话!");
document.form1.tel.focus();
return false;
}
//return true;
document.form1.action='reg1_submit.asp?reg=add';
document.form1.submit();
}
//-------------首页搜索
function SearchProduct() {
	if (document.form1.SearchValue.value == "" || document.form1.SearchValue.value == "请输入课程名称")
	{
		alert("请输入课程名称!");
		document.form1.SearchValue.focus();
		return false;
	}
return true;
}
