$(document).ready(function(){
	//头部菜单效果--
	$("a > img", "#HeaderTabs").each(function(i) {
		$(this).mouseover(function() {
			$("a > img", "#HeaderTabs").each(function(i) {
				$(this).attr("src", $(this).attr("src").replace("_over", ""));
			});
			$(this).attr("src", $(this).attr("src").replace(".jpg", "_over.jpg"));
		});
		$(this).mouseout(function() {
			$("a > img", "#HeaderTabs").each(function(i) {
				$(this).attr("src", $(this).attr("src").replace("_over", ""));
			});
		});
	});
	//显示边栏--单个框
	$(".LSbuttom", ".containLeft").click(function() {
		$("."+$(this).attr("id").replace("LS", ""), ".containLeft").css("display", "");
		$(this).parent().parent().css("display", "none");
	});
	//隐藏边栏--单个框
	$(".LHbuttom", ".containLeft").click(function() {
		$("#"+$(this).attr("id").replace("LH", "LS"), ".containLeft").parent().parent().css("display", "");
		$(this).parent().parent().css("display", "none");
	});



	/** ---------------- 其他页面同步 -------------------- **/
	//监听输入框按键
	$("#xxx").keydown(function(event) {
		if(event.keyCode == '13') {
			$("#HeaderFroumSearch").click();
		}
	});
	//头部点击搜索
	$("#HeaderFroumSearch").click(function() {
		if($.trim($("#HeaderFroumSearchText").val()) == "") {
			alert("请输入搜索内容!");
			$("#HeaderFroumSearchText").val("");
			$("#HeaderFroumSearchText").focus();
			return;
		}
		var _srchtxt = encodeURI($('#HeaderFroumSearchText').val());
		var _srchfid = $('#HeaderForumSearchfid').val();
		window.location.href = "/forum/search.php?searchsubmit=yes&everyone=true&srchtxt="+_srchtxt+"&srchfid[]="+_srchfid;
	});
	//头部搜索点击分类
	$("#HeaderForumType").click(function() {
		$("#HeaderForumTypeCon").css("display", "").css("left", $(this).offset().left).css("top", $(this).offset().top+24);
	});
	//头部搜索分类--鼠标放在上面效果..
	$("#HeaderForumTypeCon").mouseout(function() {
		$("#HeaderForumTypeCon").css("display", "none");
	}).mouseover(function() {
		$("#HeaderForumTypeCon").css("display", "");
	});
	//头部搜索分类各个条目--鼠标放在上面效果等..
	$("li", "#HeaderForumTypeCon").mouseover(function() {
		$("li[class^='']", "#HeaderForumTypeCon").attr("class", "");
		$(this).attr("class", "select");
	}).click(function() {
		$("#HeaderForumTypeCon").css("display", "none");
		$("#HeaderForumSearchfid").val($(this).attr("value"));
		$("span", "#HeaderForumType").html($(this).html());
	});
}); 
