$(document).ready(function(){
    lastOpenBlock = $(openItem);
		currentBlock = $(openItem);
    maxWidth = 90;
    minWidth = 20;	
		$(currentBlock).css("width",maxWidth);
    $("#menu ul li a").hover(
      function(){
        $(lastOpenBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
				$(this).animate({width: maxWidth+"px"}, { queue:false, duration:400});
				lastOpenBlock = this;
      }
    );
		$("#menu").mouseout(
			function() {
				resetToCurrent();							
			}
		);
		
		$('#txt, #txt_vert').jScrollPane({showArrows:false,scrollbarWidth: 5});

		$('#txt_vert li a').hover(
			function() {
				showDetail(this);							
			},
			function() {
				hideDetail();							
			}
		);
		$('#txt_vert li a').click(function(event){
			event.preventDefault();
		});
		
});

function resetToCurrent() {
	$(lastOpenBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
	$(currentBlock).animate({width: maxWidth+"px"}, { queue:false, duration:400});
	lastOpenBlock = currentBlock;
}

function showDetail(element) {
	$('#detail').hide();
	$('#detail_img').attr('src','bo/phpThumb/phpThumb.php?src=../../upload/'+$(element).attr('href')+'&w=150&h=100&far=1&q=100');
	$('#detail_text').html($(element).attr('rel'));
	$('#detail').fadeIn();
}
function hideDetail() {
	$('#detail').fadeOut();
}
