var selectedId = '0';
$(function() {
	$("ul[id^='TopCate_']").each(function() {
		$(this).click(function() {
			var id = $(this).attr("id").split("_")[1];
			
			if (selectedId == id) return false;
			
			if ($("#SubCateWrap_" + id).size() > 0) {
				if (selectedId != 0) $("#SubCateWrap_" + selectedId).slideToggle("fast");
				$("#SubCateWrap_" + id).slideToggle("fast");
				selectedId = id;
				
				return false;
			}
		});
	});
	
	if ($("#searchBtn").size() > 0 && $("#searchTxt").size() > 0) {
		$("#searchBtn").click(function(e) {
			var text = $("#searchTxt").val();
			if (text == "") {
				e.stopPropagation();
				return false;
			}
		});
	}
});
