﻿$(function(){
	$(".tooltip").mouseover(function(){
	    $("#tooltip a").attr("href",""+$(this).parent().next().next().text()+"");
	    $("#tooltip img").attr("src",""+$(this).parent().next().text()+"_1.png");
		var y=$(this).offset().top;
        var x=$(this).offset().left;			 
		$("#tooltip")
			.css({
				"top": (y-19) + "px",
				"left": (x-30)+ "px",
				"display":"block"
			})
   })
   $(".ng_middle_1").mouseout(function(){
         $("#tooltip").mouseout(function(){
            $("#tooltip").css("display","none");
         })
   }) 

        
        //公告栏向上滚动   
        var $this = $(".scrollNews");
		var scrollTimer;
		$this.hover(function(){
			  clearInterval(scrollTimer);
		 },function(){
		   scrollTimer = setInterval(function(){
						 scrollNews( $this );
					}, 3000 );
		}).trigger("mouseleave");
		
		
		
		$(".ng_ddLlinks").change(function(){
	         if($(this).attr("value")!="")
	         {
	         //location.href=$(this).attr("value");	
	         window.open($(this).attr("value"));	    
	         }
		});
  
});

function scrollNews(obj){
   var $self = obj.find("ul:first"); 
   var lineHeight = $self.find("li:first").height(); //获取行高
   $self.animate({ "marginTop" : -lineHeight +"px" }, 600 , function(){
         $self.css({marginTop:0}).find("li:first").appendTo($self); //appendTo能直接移动元素
   })
}



function link_s(){
  var linkes=document.getElementById("linkes");
  location.href=linkes.value;
}

function login()
{ 
if (document.getElementById("<%=txtusername.ClientID %>").value.length== 0) 
{ 
   alert("用户名不能为空!");
   document.getElementById("<%=txtusername.ClientID %>").focus();
   return false;
}
if (document.getElementById("<%=txtpassword.ClientID %>").value.length== 0) 
{ 
   alert("密码不能为空!");
   document.getElementById("<%=txtpassword.ClientID %>").focus();
   return false;
}
return true;
}
