$(function(){
	$(".search-submit").click(function(event){
		$(this).removeAttr("name");
		event.preventDefault();
		var val = $.trim($(".search-title").val());
		if(val!==""){
			$(".wp-search").find("form").submit();
		}else{
			alert("请输入关键词");
		}
		return false;
	});
	
	/*导航
	$.fn.sudyNav = function(){};
	$(".wp-menu li").hover(function() {
		$(this).siblings().find('.sub-menu').stop(true,true).slideUp(150)
		$(this).children('.sub-menu').stop(true,true).slideDown(200);
		$(this).addClass('hover');
	}, function() {
		$(this).children('.sub-menu').stop(true,true).slideUp(150);
		$(this).removeClass('hover');
    });
	
	$(".wp-menu li").each(function(){
		$(this).children(".menu-switch-arrow").appendTo($(this));
	});*/
	
		//搜索输入框滑出前总宽度
	$("body,html").click(function(){
			$(".search-window").animate({"width":"22px"});
			$(".searchbtn").stop(true,true).fadeIn();
			$(".navlist").slideUp();
	});
	
	
	//搜索输入框滑出效果及滑出后总宽度
	$(".searchbtn").click(function(){
			$(this).stop(true,true).fadeOut();
			$(".search-window").stop(true,true).animate({"width":"160px"});
			return false;
	});	
	$(".search-title").click(function(){
			return false;
	});

	/*媒体链接*/
	$(".shares li").each(function(){
		$(this).children("a").hover(function(){
			$(this).parent().find(".con").stop(true,true).fadeIn();			
		},function(){
			$(this).parent().find(".con").stop(true,true).fadeOut();
		});
	});	

});