$(window).load(function() {
	// cache container
	var $container = $('#intern-grid');
	// initialize isotope
	$container.isotope({
		itemSelector : '.intern-iso-element',
		//layoutMode: 'fitRows'
		masonry: {
     		columnWidth: 80
    	}
	});
	
	// filter items when filter link is clicked
	$('#intern-filters a').click(function(){
		$('#intern-filters span').removeClass('highlight');
		var selector = $(this).attr('data-filter');
		$container.isotope({ filter: selector });
		$(this).parent().addClass('highlight');
		return false;
	});
	
	$('.intern-article').click(function(){
		$('#intern-grid .article-content').hide();
		$('.intern-article').removeClass('big');
	    var $this = $(this),
	        tileStyle = $this.hasClass('big') ? { width: 460, height: 90} : { width: 460, height: 310};
	    $this.toggleClass('big');
	    $this.find('.article-content').show();
	    $this.find('.item-expand').stop().animate( tileStyle );
	    $container.isotope( 'reLayout' )
	  });
});
