

function SubmitForm()
{
	
	var txtNickName;
	
	if(document.frmInput.txtAction.value=="Insert")
	{
		if (!ISEnglISh(document.frmInput.txtUserName.value))
		{
			alert(report);
			report="";
			return false;
		}	
		if (!ISPassword(document.frmInput.txtPassWord.value))
		{
			alert(report);
			report="";
			return false;
		}	
	 	if (!JudgePassword(document.frmInput.txtPassWord.value,document.frmInput.txtResure.value))
		{
			alert(report);
			report="";
			return false;
		}
		
		
	}

	
	if(ISEmpty(document.frmInput.txtRealName.value))
	{
		alert("请输入您的真实姓名");
		return false;
	}	

	if(!ISEmpty(document.frmInput.txtNickName.value))
	{
		
		strNickName=Trim(document.frmInput.txtNickName.value.toUpperCase());
		if(strNickName=="ADMIN" || strNickName=="版主" || strNickName=="系统管理员" || strNickName=="ADMINISTRATOR")
		{
			alert("请输入合法昵称");
			return false;
		}
	}

	if(!ISEmpty(document.frmInput.txtEmail.value))
	{
		if(!ISEmail(document.frmInput.txtEmail.value))
		{
			alert(report);
			report="";
			return false;
		}
	}		
	
	return true;

}	



function SubmitForm2()
{
	if(ISEmpty(document.frmInput.txtProductName.value))
	{
		alert("请输入产品名称");
		return false;
	}
	
	if(ISEmpty(document.frmInput.txtDescription.value))
	{
		alert("请输入产品详细介绍");
		return false;
	}
	
	if(!ISEmpty(document.frmInput.txtTorque.value))
	{

		if(!isNumber(document.frmInput.txtTorque.value))
		{	
			alert("请输入产品保持转距的正确数值");
			return false;
		}
	}
	if(!ISEmpty(document.frmInput.txtCurrent.value))
	{

		if(!isNumber(document.frmInput.txtCurrent.value))
		{	
			alert("请输入产品额定电流的正确数值");
			return false;
		}
	}
	if(!ISEmpty(document.frmInput.txtResist.value))
	{

		if(!isNumber(document.frmInput.txtResist.value))
		{	
			alert("请输入产品每向电阻的正确数值");
			return false;
		}
	}
	if(!ISEmpty(document.frmInput.txtInduct.value))
	{

		if(!isNumber(document.frmInput.txtInduct.value))
		{	
			alert("请输入产品每向电感的正确数值");
			return false;
		}
	}				
/*	if(!ISEmpty(document.frmInput.txtTemp.value))
	{

		if(!isNumber(document.frmInput.txtTemp.value))
		{	
			alert("请输入产品温度等级的正确数值");
			return false;
		}
	}				*/
}

function SubmitForm3()
{
	
	if(document.frmInput.txtAction.value=="Insert")
	{
		if (!ISEnglISh(document.frmInput.txtUserName.value))
		{
			alert(report);
			report="";
			return false;
		}	
		if (!ISPassword(document.frmInput.txtPassWord.value))
		{
			alert(report);
			report="";
			return false;
		}
			
	 	if (!JudgePassword(document.frmInput.txtPassWord.value,document.frmInput.txtResure.value))
		{
			alert(report);
			report="";
			return false;
		}
		
		
	}	
	
	return true;
	/*else
		document.frmInput.submit();*/
	
	
}	

function SubmitForm4()
{
	if(ISEmpty(document.frmInput.txtOldPassWord.value))
	{
		alert("请输入您的原有口令");
		return false;
	}
	
	if (!ISPassword(document.frmInput.txtPassWord.value))
	{
		alert(report);
		report="";
		return false;
	}	
 	if (!JudgePassword(document.frmInput.txtPassWord.value,document.frmInput.txtResure.value))
	{
		alert(report);
		report="";
		return false;
	}
		
}

function SubmitForm5()
{

	
	if(ISEmpty(document.frmInput.txtNewsType.value))
	{
		alert("请输入新闻类别");
		return false;
	}

			
}

function SubmitForm6()
{
	var strErr="发布日期不能晚于失效日期！";
	
	if(document.frmInput.selYear.selectedIndex>document.frmInput.selYear1.selectedIndex)
	{
		alert(strErr);
		return false;
	}
	else

		if(document.frmInput.selYear.selectedIndex==document.frmInput.selYear1.selectedIndex)
		{
	
			if(document.frmInput.selMonth.selectedIndex>document.frmInput.selMonth1.selectedIndex)
			{
				alert(strErr);
				return false;
			}
			else
			{
				if(document.frmInput.selMonth.selectedIndex==document.frmInput.selMonth1.selectedIndex)
				{
	
					if(document.frmInput.selDay.selectedIndex>document.frmInput.selDay1.selectedIndex)
					{			
						alert(strErr);
						return false;
					}					
				}
			}
		}

	if(ISEmpty(document.frmInput.txtTitle.value))
	{
		alert("请输入新闻标题");
		return false;
	}	
	if(document.frmInput.selType.selectedIndex==0)
	{
		alert("请选择新闻类别");
		return false;
	}	
		
}

function SubmitForm7()
{
	if(ISEmpty(document.frmInput.txtUpload.value))
	{
		alert("请输入需要上传的文件");
		return false;
	}
	
	if(ISEmpty(document.frmInput.txtDescription.value))
	{
		alert("请输入文件描述");
		return false;
	}
		
}

function SubmitForm8(gifcount)
{

	if(ISEmpty(document.frmInput.txtUpload.value))
	{
		alert("请输入需要上传的文件");
		return false;
	}
	if(gifcount!=0)
	{	
		
		document.frmInput.doContinue.value="true";

	}


	document.frmInput.submit();
		
}

function SubmitForm9()
{

	if(ISEmpty(document.frmSearch.txtSearch.value))
	{
		alert("请输入查询内容");
		return ;
	}
	else
		document.frmSearch.submit();
		
}


function SubmitForm10()
{

	if(ISEmpty(document.frmInput.forumName.value))
	{
		alert("请输入需要创建的版面名称");
		return false;
	}
			
}


function SubmitForm11()
{
	if(ISEmpty(document.frmPost.subject.value))
	{
		alert("请输入贴子的主题");
		return false;
	}		
}

function SubmitForm12()
{

	if(ISEmpty(document.frmInput.subject.value))
	{
		alert("请输入通告的主题");
		return false;
	}
			
}



function SubmitForm14()
{
	if(ISEmpty(document.frmInput.txtUpload1.value)&&ISEmpty(document.frmInput.txtUpload2.value)&&ISEmpty(document.frmInput.txtUpload3.value))
	{
		alert("请输入需要上传的图片");
		return false;
	}			
}

function SubmitForm15()
{
	if(ISEmpty(document.frmInput.txtUpload1.value))
	{
		alert("请输入需要上传的主题图片");
		return false;
	}			
}

function SubmitForm16()
{

	if(ISEmpty(document.frmInput.subject.value))
	{
		alert("请输入标题新闻的主题");
		return false;
	}
	if(ISEmpty(document.frmInput.body.value))
	{
		alert("请输入标题新闻的内容");
		return false;
	}	
	if(ISEmpty(document.frmInput.description.value))
	{
		alert("请输入标题新闻的简介");
		return false;
	}			
}

function SubmitForm17()
{
	if(ISEmpty(document.frmInput.txtSearch.value))
	{
		alert("请输入需要查询的产品名");
		return false;
	}			
}

function SubmitForm18()
{
	if(ISEmpty(document.frmInput.txtUserName.value))
	{
		alert("请输入您的用户名");
		return false;
	}			
}


function SubmitForm19()
{
	if(ISEmpty(document.frmInput.txtAnswer.value))
	{
		alert("请输入您自设问题的答案");
		return false;
	}			
}



function ChangeForum()
{
	if((document.frmInput.selForum.options[document.frmInput.selForum.selectedIndex].value)!=-1)
		location.href="forumview.jsp?forum="+document.frmInput.selForum.options[document.frmInput.selForum.selectedIndex].value;	
	
}

function ChangeForum2()
{
	if((document.frmInput2.selForum.options[document.frmInput2.selForum.selectedIndex].value)!=-1)
		location.href="forumview.jsp?forum="+document.frmInput2.selForum.options[document.frmInput2.selForum.selectedIndex].value;	
	
}

function changeday() 
{
	strYear=document.frmInput.selYear.options[document.frmInput.selYear.selectedIndex].value;
	n=document.frmInput.selMonth.options[document.frmInput.selMonth.selectedIndex].value;
	var days = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	if (((strYear % 4 == 0) && (strYear % 100 != 0)) || (strYear % 400 == 0))
    		days[1] = 29;
	maxDay=days[n-1];
	document.frmInput.selDay.length=maxDay;
	for (i=0; i<maxDay; i++) 
	{
		document.frmInput.selDay.options[i].value=i+1;
		document.frmInput.selDay.options[i].text=i+1;
	}

}

function changeday1() 
{
	strYear=document.frmInput.selYear1.options[document.frmInput.selYear1.selectedIndex].value;
	n=document.frmInput.selMonth1.options[document.frmInput.selMonth1.selectedIndex].value;
	var days = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	if (((strYear % 4 == 0) && (strYear % 100 != 0)) || (strYear % 400 == 0))
    		days[1] = 29;
	maxDay=days[n-1];
	document.frmInput.selDay1.length=maxDay;
	for (i=0; i>maxDay; i++) 
	{
		document.frmInput.selDay1.options[i].value=i+1;
		document.frmInput.selDay1.options[i].text=i+1;
	}

}

function changeday2() 
{
	strYear=document.frmInput.selYear2.options[document.frmInput.selYear2.selectedIndex].value;
	n=document.frmInput.selMonth2.options[document.frmInput.selMonth2.selectedIndex].value;
	var days = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	if (((strYear % 4 == 0) && (strYear % 100 != 0)) || (strYear % 400 == 0))
    		days[1] = 29;
	maxDay=days[n-1];
	document.frmInput.selDay2.length=maxDay;
	for (i=0; i<maxDay; i++) 
	{
		document.frmInput.selDay2.options[i].value=i+1;
		document.frmInput.selDay2.options[i].text=i+1;
	}

}

