$(document).ready(function(){
	$("#searchSubmit").hover(
		function(){
			$("#searchBox").addClass("over");
		},
		function(){
			$("#searchBox").removeClass("over");
		}
	);
	$("#searchSubmit").click(function(){
		if ($("#searchKey").val()!="" && $("#searchKey").val()!="全站搜索"){
			$("#search_form").submit();
			return true;
		}else{
			alert("请输入搜索内容");
			return false;
		}
	});
	
	$.each($("#kssz img") , function(i,n){
		$(n).attr("outSrc",$(n).attr("src"));
		var img = new Image();
		img.src=$(n).attr("overSrc");
	});
	$("#kssz a").hover(
		function(){
			$(this).find("img").attr("src" , $(this).find("img").attr("overSrc"));
		},
		function(){
			$(this).find("img").attr("src" , $(this).find("img").attr("outSrc"));
		}
	);
	
	$("#friend").hover(
		function(){
			$(this).addClass("over");
			$(this).find("ul").slideDown("normal");
		},
		function(){
			$(this).removeClass("over");
			$(this).find("ul").slideUp("fast");
		}
	);
	
	$.each($("#gdzt img") , function(i,n){
		$(n).attr("outSrc",$(n).attr("src"));
		var img = new Image();
		img.src=$(n).attr("overSrc");
	});
	$("#gdzt img").hover(
		function(){
			$(this).attr("src" , $(this).attr("overSrc"));
		},
		function(){
			$(this).attr("src" , $(this).attr("outSrc"));
		}
	);
	
	$("#zjczb").dongTabs(0)
	jQuery.dongSlide("slide", 2000);
	
	
	/*********************************/
	$("#moveBox").css({ "top":$("#menuBox").offset().top , "left":$("#menuBox").offset().left });
	$("#moveBox").hide();
	$("#menu .menuSub").css({ 'opacity':0.8 , 'position':'relative' });
	
	$("#menu>li").hover(
		function(){
			$("#moveBox").show();
			$("#moveBox a").html("");
			var oThis = $(this);
			var left = oThis.offset().left;
			$("#moveBox").stop();
			$("#moveBox").queue(function(){
				$(this).dequeue();
			});
			
			var menuSub = oThis.find(".menuSub");
			menuSub.height(22*menuSub.children("ul").children("li").size());
			//menuSub.children("ul").css({ 'position':'absolute' , 'left':-100 , 'top':10 });
			
			$("#moveBox").css({ "opacity":0.5 });
			
			if ($("#moveBox").css("left")!=left+"px"){
				$("#moveBox").animate({ "opacity":1 , "left":left },"normal",function(){
					$(this).hide();
					oThis.children("a").addClass("hover");
					menuSub.slideDown('fast',function(){
						//$(this).children("ul").animate({ 'left':0 },'fast');
					});
				});
			}else{
				$("#moveBox").hide();
				oThis.children("a").addClass("hover");
				menuSub.slideDown('fast',function(){
					//$(this).children("ul").animate({ 'left':0 },'fast');
				});
			}
		},
		function(){
			$("#menu>li>a").removeClass("hover");
			//$("#menu .menuSub").hide();
			//$("#menu .menuSub>ul").css({ 'left':-100 });
		}
	);
	
	$('#menu li .menuSub li a').hover(
		function(){
			$(this).stop();
			//$(this).animate({ 'font-size':13 , 'line-height':25 , 'height':25 },'normal');
			$('#menu li .menuSub li .menuThree').hide();
			$(this).next('.menuThree').show();
		},
		function(){
			$(this).stop();
			//$(this).animate({ 'font-size':12 , 'line-height':20 , 'height':20 },'normal');
			//$(this).next('.menuThree').hide();
		}
	);
	$('#menu .menuThree').hover(
		function(){
			//$(this).parent('.menuSub').show()
		},
		function(){
			$(this).hide()
		}
	);
	$.each($('#menu .menuSub li'),function(i,n){
		if ($(n).children('ul').size()>0){
			$(n).addClass('ico');
		}
	});
	/*********************************/
});

function test(s){
	$("#test").html($("#test").html()+"<br>"+s);
}