/*******登录框的JS的代码*******/

var station = false; //隐藏层的状态
	var totalH = 0;
	String.prototype.trim = function() {      
		//return this.replace(/[(^\s+)(\s+$)]/g,"");//會把字符串中間的空白符也去掉      
		//return this.replace(/^\s+|\s+$/g,""); //      
		return this.replace(/^\s+/g,"").replace(/\s+$/g,"");      
	}    

   
   $(document).ready(function(){
      
	  
	  jQuery("#close").click(function(){
	      if(station==true){
	    	  jQuery(".info").fadeOut('normal');
			  $("#Yangan").css("display","none");
			station =false;
		  }
		  return false;
	  });
	
	  jQuery("#closeBtn").click(function(){
	      if(station==true){
	    	  jQuery(".info").fadeOut('normal');
			  $("#Yangan").css("display","none");
			station =false;
		  }
	  });
	  
	  jQuery("#okBtn").click(function(){
	      if(station==true){
			if(jQuery("#userName1").val().trim()==""){
				alert("请输入用户名!");
				return ;
			}
			if(jQuery("#userPwd1").val().trim()==""){
				alert("请输入密码!");
				return ;
			}
			jQuery("#loginForm1").submit();
			jQuery(".info").fadeOut('normal');
			$("#Yangan").css("display","none");
			station =false;
		  }
	  });
	 	
	  $(window).scroll(function(){
			$("#Yangan").css("top",$(window).scrollTop());
			$(".info").css("top",$(window).scrollTop()+totalH);
	  })
	
   });
	 	function wytjsy(userId){
	   // var userId = '';
		if(userId == ''){
		 	var scrollWidth = document.documentElement.clientWidth;
			 var scrollHeight = document.documentElement.clientHeight;
			 var divWidth = jQuery(".info").width();
			 var divHeight = jQuery(".info").height();
			 var divLeft = scrollWidth/2+jQuery(document).scrollLeft()-divWidth/2;
			 var divTop = scrollHeight/2+jQuery(document).scrollTop()-divHeight/2;
			 totalH = scrollHeight/2-divHeight/2;
			 jQuery(".info").css({"position":"absolute","top":divTop,"left":divLeft}).fadeIn('normal');
			 $("#Yangan").css("display","block");
		     station=true;
			return false;
		}
		return true;
   	};
