$(document).ready( function() {

	// hide all photos at document ready	
	$(".cat_list ul").hide();
	// except for the first one
//	$("#photos div").eq(0).show();

	// hide all photos at document ready	
	$("#photos div").hide();
	// except for the first one
	$("#photos div").eq(0).show();	
	
	
});

function showPost(guid) {
//	alert(guid);
	$("#container").load("index.php?p=" + guid, function() {
		// hide all photos at document ready	
		$("#photos div").hide();
		// except for the first one
		$("#photos div").eq(0).show();			
	});		
}

function showAbout() {
//	alert(guid);
	$("#container").load("index.php?page_id=2" , function() {
		// hide all photos at document ready	
		$("#photos div").hide();
		// except for the first one
		$("#photos div").eq(0).show();			
	});		
}


function showImage(imageId) {
	// hide all photos
	$("#photos div").hide();	
	// show the clicked image
	$("#photos #" + imageId).show();
}

function showCat(catId) {
	// slide all categories up
//	$(".cat_list ul").eq(":not .selected").slideUp(200);
	// slide selected category down
	if ($(".cat_list #" + catId).is(".selected")) {
		$(".cat_list #" + catId).slideToggle(300);	
	} else {
		$(".cat_list .selected").removeClass('selected');
		$(".cat_list #" + catId).addClass('selected');	
		$(".cat_list ul").slideUp(200);
		$(".cat_list #" + catId).slideDown(300);	
	}
}

