$(document).ready(function() {
	// easy toggle for categories
	$('#triggerCatID').click(function() {
		$(this).toggleClass('focus');
		$('#headerStrip').animate({ height: 'toggle', opacity: '100'}, 100);
		return false;
	});
	$('#triggerCatID2').click(function() {
		$(this).toggleClass('focus');
		$('#footerStrip').animate({ height: 'toggle', opacity: '100'}, 100);
		return false;
	});
	
	$('#main-column').masonry({
		columnWidth: 200,
		itemSelector: '.post' 
	});

	$('#main-column').infinitescroll({
		navSelector  : '#paginateIndex',    // selector for the paged navigation 
		nextSelector : '#paginateIndex .left a',    // selector for the NEXT link (to page 2)
		itemSelector : '.post',       // selector for all items you'll retrieve
		loadingImg : 'http://lememe.com/wp-content/themes/lememe-v1/images/ajax-loader.gif',
		donetext  : 'No more pages to load.',
		debug: true,
		errorCallback: function() { 
			// fade out the error message after 2 seconds
			$('#infscr-loading').animate({opacity: .8},2000).fadeOut('normal');
		}
	},
	// call masonry as a callback
	function() { $('#main-column').masonry({ appendedContent: $(this) }); }
	);
});