$(document).ready(function() {
	
	$('#projectContainer div.item').each(function() {
	
		$(this).click(function() {
			if ($(this).attr('class') != 'item current' & $(this).find('div.details').length >0) {
				$('#projectContainer div.current')
					.find('div.details')
					.slideUp(function(){$(this).parent().removeClass('current')});
					$('#popBlow').fadeOut('fast', function() {$('#popBlow').remove()});
				$(this)
					.find('div.details')
					.slideDown(function(){$(this).parent().addClass('current')});
			}
					
		});
		
		if ($(this).find('div.details').length <1 ) {
			$(this).css({'cursor':'default','border':'0px'});
		}
		
	});
	
	$('.detailColumn1 .block .itemImage a').click(function() {
		if ($('#popBlow').length <1 ) {
		
			$(this).parent().append('<div id="popBlow"><div id="closeMe">X</div><img src="' + $(this).attr('href') + '" /></div>');
			$('#popBlow').css('opacity','0');
			$('#popBlow').animate( {opacity: 1}, 800 );
			
			$('div#closeMe').click(function() {
				//$('#popBlow').fadeOut('fast', function() {$('#popBlow').remove()});;
				$('#popBlow')
					.animate( {width: '0', height: '0'}, 500, function() {$('#popBlow').remove()});
			});		
		}
		
		return false;
		
	});
	

	
});