$(function(){
	$('#showcase_thumbs a').hover(function(){
		$('#showcase_thumbs a.current').removeClass('current');
		$(this).addClass('current');
		var file = $(this).attr('href');
		var current = $('#showcase_img .current');
		var target = $('#showcase_img img[src=' + file + ']');
		var title = $(this).attr('title');
		if( !target.hasClass('current') ){
			$('#showcase_img_title').html('').css({opacity:0, zIndex:1});
			if( target.length == 1 ){
				target.css({zIndex:9}).animate({opacity:1},250, function(){
					current.removeClass('current').animate({opacity:0},250);
					$('#showcase_img_title').html(title).animate({opacity:1},250).css({zIndex:10});
				}).addClass('current');
			} else {
				var image = new Image();
				image.src = file;
				$(image).load(function(){
					$(image).css({position:"absolute", left:"0", top:"0", opacity:0});
					$(image).appendTo('#showcase_img');
					$(image).css({zIndex:9}).animate({opacity:1}, 250, function(){
						current.removeClass('current').animate({opacity:0},250).css({zIndex:1});
						$('#showcase_img_title').html(title).animate({opacity:1},250).css({zIndex:10});
					}).addClass('current');
					
				});
			}
		}
		
	},
	function(){});
	
	$('#showcase_thumbs a').click(function(){
		return false;
	});
});