/*
 * ×èÖ¹ÊÂ¼þ¸¡Éý
 */
function stopBubble(e) {
	var e = e ? e : window.event;
	if (window.event) { // IE
		e.cancelBubble = true;
	} else { // FF
		// e.preventDefault();
		e.stopPropagation();
	}
}

function boundClick(items){
	items.click(function(){
		var li = $(this);
		var ulChild = li.children("ul.children");
		var link = li.children("a");
		link[0].onclick = function(e){
			stopBubble(e);
		}
		
		if(ulChild.is(":visible")){
			ulChild.hide();
			li.css("background", "url('/wp-content/themes/basic2col/gfx/jia.png') no-repeat");
		}else{
			ulChild.show();
			li.css("background", "url('/wp-content/themes/basic2col/gfx/jian.png') no-repeat");
		}
		
	});
}

$(function(){
	liCats = $("ul#sb1 li.cat-item");
	liPages = $("ul#sb1 li.page-item");
	boundClick(liCats);
	boundClick(liPages);
	
});


