function checkForm(){
	var str = document.loginform;
	var name = str.account.value;
	var password = str.password.value;
	var code = str.imgcode.value;
	var type = str.type.value;
	if (name == ""){
		alert("对不起，用户名称不能为空！");
        str.account.focus();
		return false;

	}
	
	if ((password.length < 4) || (password.length > 16)){
		alert("对不起，密码长度应在4-16之间！");
        str.password.focus();
		return false;
	}
	
	if ((code == "")){
		alert("对不起，校验码不能为空！");
        str.imgcode.focus();
		return false;
	}	
	
 	if (type=="0")
	{
		str.action="http://e.huojutv.com/account/login.jsp";
		str.submit();
		return true ;
	}
	else if(type=="1"){
		str.action="http://site.huojutv.com/account/login.jsp";
		str.submit();
		return true ;
	}else
			return false ;
}

function missPwd(){
	alert('如果您忘记密码，请联系您的代理商管理员');
}

function changeImg(host){
//	if (!this.isOpera && document.all && navigator.userAgent.match(/msie/gi)) { //ie
//		var _img = document.getElementById("imgcodespan");	
//		_img.innerHTML='<img src="' + host + '/imgcode.jpg" border="0"/>&nbsp;';
//	} else {
		var _img = document.getElementById("code");
		var date = new Date();
		_img.src = host + "/imgcode.jpg?t=" + date;
//	}
}

 function change(elem)
  {
  	var type = elem.options[elem.selectedIndex].value;
  	var img = document.getElementById('code');
  	var alink = document.getElementById('alink');
   switch(type)
   {
    case "0":
    	img.src="http://e.huojutv.com/imgcode.jpg";
    	alink.href = 'javascript:changeImg("http://e.huojutv.com")';
		break;
    case "1":
		img.src="http://site.huojutv.com/imgcode.jpg";
		alink.href = 'javascript:changeImg("http://site.huojutv.com")';
		break;
   
   }  
  }