function check(theForm){
	if(theForm.userName.value=="")
	{
		alert("请填写用户名！");
		theForm.userName.focus();
		return false;
	}
	if(theForm.password.value=="")
	{
		alert("请填写密码！");
		theForm.password.focus();
		return false;
	}
	if(theForm.radiobutton[0].checked)
	{
		theForm.action="http://web.etiantian.com/ett20/study/common/login.jsp";
        theForm.userName.name="userName"
        theForm.password.name="password"
	}
	else if(theForm.radiobutton[1].checked)
	{     
       theForm.action="http://web.etiantian.com/parentschool/login.action";
       theForm.userName.name="user.userName"
       theForm.password.name="user.password"
	}
	else
	{
		alert("请您选择您的身份！");
		return false;
	}
	return true;
}
function  register()
{
	var theForm=document.loginForm;
	if(theForm.radiobutton[0].checked==true)
		window.open("http://web.etiantian.com/ett20/study/usermanage/studentregister.jsp");
	else if(theForm.radiobutton[1].checked==true)
            window.open("http://web.etiantian.com/parentschool/common/parentregister.jsp");
    	else
		alert("请您选择您的身份！");
}
function login() {
    if(check(document.loginForm)) 	document.loginForm.submit();
}
function loginmail() {
	theForm=document.loginForm;
	if(theForm.userName.value=="")
	{
		alert("请填写用户名！");
		theForm.userName.focus();
		return;
	}
	if(theForm.password.value=="")
	{
		alert("请填写密码！");
		theForm.password.focus();
		return;
	}
	theForm.action="http://web.etiantian.com/ett20/study/mail/login.jsp";
	document.loginForm.submit();
}

