function CheckLoginForm()
{
	if(document.loginform.username.value=="")
	{
		alert("请输入您的用户名！");
		document.loginform.username.focus();
		return false;
	}
	if(document.loginform.password.value == "")
	{
		alert("请输入您的密码！");
		document.loginform.password.focus();
		return false;
	}
}

function Checkallsearch()
{
	if(document.formallsearch.ClassID1.value=="")
	{
		alert("请选择栏目！");
		document.formallsearch.ClassID1.focus();
		return false;
	}
	
	if(document.formallsearch.SearchKeywords.value == "输入关键字")
	{
		alert("请填写查询关键字！");
		document.formallsearch.SearchKeywords.focus();
		return false;
	}
	
	
	if(document.formallsearch.SearchKeywords.value == "")
	{
		alert("请填写查询关键字！");
		document.formallsearch.SearchKeywords.focus();
		return false;
	}
}

function chksearch(theForm)
{
        if (theForm.ClassID2.value == ""){
                alert("请选择栏目!");
                theForm.ClassID2.focus();
                return (false);
        } 
		
        if (theForm.SearchKeywords.value == ""){
                alert("请输入查询关键字!");
                theForm.SearchKeywords.focus();
                return (false);
        } 
		
}


function logout(){
	if (confirm("系统提示：您确定要退出登陆吗？"))
	top.location = "/login/logout.asp";
	return false;
}

function CheckSelectQuestionForm()
{
	if(document.SelectQuestion.QuestionID.value=="")
	{
		alert("请输入题号！");
		document.SelectQuestion.QuestionID.focus();
		return false;
	}
}
 function CheckGoAnswerForm(objRadio){
　    //单选按钮中是否有某个值被选中
　        for(var    n =    0; n <  objRadio.length;    n++){
　            if(objRadio[n].checked){
　              return true;
　            }
　        }
		  alert("请选择答案再提交！");
　        return false;
　    }

function CheckAll(form) {  
	for (var i=0;i<form.elements.length;i++)  {  
		var e = form.elements[i];  
		if (e.name != 'chkall')  
		e.checked = true // form.chkall.checked;  
	}  
} 
 
function ContraSel(form) {
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		if (e.name != 'chkall')
		e.checked=!e.checked;
	}
}


