$(document).ready(function(){
	
	var fadeDuration = 1000;
	if ($('.post_page').length > 1) {
		$('.post_page').hide();
		$('.post_page:first').show();
		$('#center').prepend('<ul id="jmenu" class="horizontal"></ul>');
		var count = 0;	
		var aPosts = new Array();
		$('.post_page').each(function(){
			$(this).attr('no',count);
			aPosts[count] = $(this);
			$('#jmenu').append('<li class=li_'+count+'"></li>');
			$('#jmenu li:last').append($('img:first', this).clone())
			.attr('no',count);		
			count++	
		});
		//$('#jmenu li').addClass('float_left');
		
		$('#jmenu li').click(function(e){
			
			var no = $(this).attr('no');
			if (aPosts[no].css('display') == 'none') {
				
				$('.post_page:not($(this))').hide();
			
				aPosts[no].stop().fadeIn(fadeDuration);		
			}
		});
		$('#jmenu li').hover(function(){
			$(this).addClass('jmenu_img_hover');					  
		},function(){
			$(this).removeClass('jmenu_img_hover');
		});
		$('#jmenu img').removeClass('ngg-singlepic');
	};
});
