function checkFrm(objFrm){
if(objFrm.uid.value==""){
alert("請(qǐng)您填寫用戶名!");
objFrm.uid.focus();
return false;
}
if(objFrm.pwd.value==""){
alert("請(qǐng)您填寫密碼!");
objFrm.pwd.focus();
return false;
}
return true;
}
function login(form){
if(!checkFrm(form)){
return false;
}
if(form.uid.value=='' || form.pwd.value == ''){
alert("用戶名和密碼不能為空!");
return false;
}
if(form.user_class.value=='c'){
form.action="/enterprise/login.php";
form.submit();
}else{
if(form.user_class.value=='p'){
form.user_name.value=form.uid.value;
form.user_passwd.value=form.pwd.value;
form.action="/personal/user_login.php";
form.submit();
}else{
window.alert("請(qǐng)選擇用戶類型");
}
}
}
function change_action(form){
if(!checkFrm(form)){
return false;
}
if(form.user_class.value=='c'){
form.action="/enterprise/login.php";
form.submit();
return true;
}else{
if(form.user_class.value=='p'){
form.user_name.value=form.uid.value;
form.user_passwd.value=form.pwd.value;
form.action="/personal/user_login.php";
form.submit();
return true;
}else{
window.alert("請(qǐng)選擇用戶類型");
return false;
}
}
}
function change_register(form){
form.target="_blank";
if(form.user_class.value=='c'){
form.action="/enterprise/register/enterprise_reg.php";
form.submit();
}else if(form.user_class.value=='p'){
form.action="/personal/register/user_register_login.php";
form.submit();
}else{
return false;
}
}
function go_to_pass(form){
window.location="/personal/getpass.php?user_type="+form.user_class.value;
}