//need add <script type="text/javascript" src='../dwr/interface/user.js'></script> together
			tipId="loginTip";
			href="";
			type="";
			var AjaxLogin ={
				coverId:"loginCover",
				loginId:"loginPanel",
				bodyRoot:"container",
				init:function(aObj){
					href = aObj.href;
					//cover = this.createCover().appendChild(this.createLogin());
					
					user.isUserLogin(function(data){
						if(data){	
							window.location.href=href;
						}else{
							if(href.indexOf("service/compare.action")>0||href.indexOf("service/comparePanel.action")>0
								||href.indexOf("service/occEnvironment.action")>0||(href.indexOf("occupation/dispatch.action?id=")>0&&href.indexOf("&sign=5")>0)
								||href.indexOf("user/recharge.action")>0||href.indexOf("group/toPost")>0||href.indexOf("group/saveLeaveword")>0||href.indexOf("group/addLeaveword")>0
								||href.indexOf("service/occEnvironmentDetails.action")>0||href.indexOf("group/threadtoadd")>0||href.indexOf("group/create")>0
								||href.indexOf("group/activate")>0){
								showOrHiddenSelect("hidden");
								document.body.innerHTML ="<div class='cover' id='loginCover'><div class='sectionDiv' id='sectionDiv2'><div class='section'>"+getLoginHtm()+"</div></div></div>"+document.body.innerHTML;
								$(loginCover).style.height=document.body.scrollHeight;
								$(loginCover).style.width=document.body.scrollWidth;
								$(sectionDiv2).style.top=(document.body.clientHeight-188)/2+document.body.scrollTop; 
								if(navigator.userAgent.indexOf("Firefox")>0){
									$(sectionDiv2).style.left=(document.body.clientWidth-300)/2+document.body.scrollLeft;
								}
							}else{
								window.location.href=href;
							}
						}
					});
					return false;
				},
				
				//excute login
				excute:function(){
				
					$(tipId).innerHTML="";
					if(this.isEmpty('login_mail')){
						$(tipId).className="form-note";
						$(tipId).innerHTML="请输入登录名";
						return ;
						}
					if(this.isEmpty('login_pass')){
						$(tipId).className="form-note";
						$(tipId).innerHTML="请输入密码";
						return;
						}
					if(this.isEmpty('login_code')){
						$(tipId).className="form-note";
						$(tipId).innerHTML="请输入验证码";
						return;
						}
					user.login($('login_mail').value,$('login_pass').value,$('login_code').value,function(str){
						
						if(str==(new String("vcoder"))){
							$(tipId).className="form-note";
							$(tipId).innerHTML="验证码输入不正确，请重新输入";
						}		
						if(str==(new String("notexist"))){
							$(tipId).className="form-note";
							$(tipId).innerHTML="登录名无效，请重新输入";
						}
						if(str==(new String("error"))){
							$(tipId).className="form-note";
							$(tipId).innerHTML="操作出错,请重试";
						}
						if(str==(new String("passworderror"))){
							$(tipId).className="form-note";
							$(tipId).innerHTML="密码错误，请重新输入";
						}	
						if(str==(new String("active"))){
							$(tipId).className="form-note";
							$(tipId).innerHTML="帐号尚未激活，请到您的邮箱进行激活";
						}	
						if(str==(new String("success"))){
							$(tipId).className = "";
							closeWindow();
							if(href!=''&&href.indexOf('group/threadtoadd')<0&&href.indexOf('group/toPost')<0){
								window.location.href=href;
							}else{
								window.location.href=window.location.href;
							}
						}
					});
				},
				//close window
				close:function(){
					if(navigator.userAgent.indexOf("Firefox")>0){
						window.location.href=window.location.href;
					}else{
						var url=window.location.href;
						if(url.indexOf("group/index")>0){
							window.location.href=url;
						}else{						
							showOrHiddenSelect("visible");
							document.body.removeChild($(this.coverId));
						}
					}
				},
				
				isEmpty:function(sObj){
					return ($(sObj).value=='')?true:false;
				},
				
				isFresh:function(){
					$(tipId).className="";
					$(tipId).innerHTML="";
				}
			};
			function closeWindow(){
				document.body.removeChild($("loginCover"));
			}
			function showOrHiddenSelect(attributes){
			/*
				for(var i=0;i<document.forms.length;i++){
					for(var j=0;j<document.forms[i].elements.length;j++){
						var ele=document.forms[i].elements[j];
						if(ele.type.startsWith("select")){
							ele.style.visibility = attributes;
						}
					}
				}
			*/
				for(var i=0;i<document.getElementsByTagName("select").length;i++){
					var ele=document.getElementsByTagName("select")[i];
					ele.style.visibility = attributes;
				}
			}
			//get login html content
			function getLoginHtm(){
					var htm='<h1>您还未登录，请先登录<div class="side-options"><img src="../images/icon-cancel.gif"  onclick="AjaxLogin.close()"/></div></h1><table cellpadding="0" cellspacing="5" align="center" width="95%"><tr><td width="65" height="32" valign="middle">登录名 </td><td colspan="3" width="127" valign="middle"><input type="text" id="login_mail" style=" width:200px; border:#C0C0C0 solid 1px;" onKeyDown="AjaxLogin.isFresh()"/></td></tr>';
htm+='<tr><td width="65" height="32" valign="middle">密&nbsp&nbsp码 </td><td colspan="3"><input type="password" id="login_pass" style=" width:200px; border:#C0C0C0 solid 1px; " onKeyDown="AjaxLogin.isFresh()"/></td></tr><tr><td width="65" height="32" valign="middle">验证码 </td><td width="180" colspan="3"><input type="text" id="login_code" style=" width:40px; border:#C0C0C0 solid 1px;" onKeyDown="AjaxLogin.isFresh()" maxlength="4"/><img id="pic" src="../user/code.action" align="middle"  style="cursor:pointer;" onclick="tochange();"/><span style="cursor:hand;" onclick="tochange();">看不清楚？</span></td></tr><tr><td width="250" height="30" colspan="3" align="left"><div id="loginTip" class="form-note" style="width:240px;"></div></td></tr><tr><td width="65" height="30" align="center">';
htm+='</td><td height="30"><input name="登 录" type="button" class="inputregister" value="登 录" onClick="AjaxLogin.excute()"/></td><td width="65" height="30" align="left" ><a href="../user/regPanel.action">免费注册</a></td></tr></table>';
					return htm;
			}
	function tochange(){
			var date=new Date();
			$('pic').src="../user/code.action?d="+date;
			$('loginTip').className="";
			$('loginTip').innerHTML="";
	}
	