//  div expand contract toggle

$(document).ready(function()
{
	$('.description').hide();
	
	
	/*$(".more").hide();
	
	//Switch the "Open" and "Close" state per click
	$(".more").toggle(function(){
		$(this).addClass("active");
		}, function () {
		$(this).removeClass("active");
	});

	//Slide up and down on click
	$(".expander").click(function(){
		$(this).nextAll('.more:first').slideToggle();
	});*/
	
	//grabs portfolio short descritpion and puts it in description div
	$(".portLink").mouseover(function(){
		var title = $(this).nextAll('p.title:first').text();
		var desc = $(this).nextAll('p.description:first').text();
		
		//alert(title);
		
		//$("Hello").appendTo('h4.portTitle');
		$('<h4 class="portDescriptTitle">'+title+'</h4>').appendTo('.portTitle');
		$('.portDescriptTitle').hide(); 
		     
		$('<p class="portDescript">'+desc+'</p>').appendTo('.portDescription');
		$('.portDescript').hide(); 
		
		
		$('.portDescriptTitle').fadeIn("slow");
		$('.portDescript').fadeIn("slow");
	
	});
	
	$(".portLink").mouseout(function(){	
		
		/*$('.portDescriptTitle').fadeOut("fast", function(){
			$('.portDescriptTitle').remove();	
		});
		$('.portDescript').fadeOut("fast", function(){
			$('.portDescript').remove();
		});*/
		
		
		$('.portDescriptTitle').remove();
		$('.portDescript').remove();
	
	});
	
	$('.glimpse').innerfade({
		animationtype: 'fade',
		speed: 1000,
		timeout: 10000,
		type: 'sequence',
		containerheight: '250px'	
	});
	
});
