$(function(){
	jQuery('.mainImg').cycle({ 
	    fx:     'fade', 
	    speed:  'slow', 
	    timeout: 5000, 
		random: 0 
	});
	
	jQuery('a.lightbox,#post-31 .entry a').lightBox();
	
	// Pictures page: every 6 pictures add last and clear
	everySixPictures(jQuery('#post-31 .entry'))
	
	jQuery('form.focusmagic').focusMagic();
});


// Global: A function to add a 'last' class to every fourth product on the product grid
function everySixPictures($item){
	$item.find('.picture').each(function(i){
		if(i%6==5){
			jQuery(this).addClass('last');
		}
	});
};
