jQuery(document).ready(function() {
	// Equal Heights
	jQuery('.equalCol').equalBlocks();
	
	// Uniform JS
	jQuery("select, input:checkbox, input:radio, input:file,#contentLeft input:submit, #contentLeft input:text, textarea").uniform();
	
	jQuery('#toTop').click(function() {  
		jQuery('body,html').animate({scrollTop:0},800);  
	});
	
	// Border-right fix for last menu item
	jQuery("header nav ul li:last").css("border-right","none");
	
	// Placeholder initialization for older browsers 
	jQuery('input, textarea').placeholder();
	
	// border-top fix for first post on front-page
	jQuery('.blog article.post:nth-child(1)').css('border-top','none');
	jQuery('.blog article.post:nth-child(1) .categoryIcon').css('margin-top','-15px');
	
	// jQuery UI Tabs Initialization
	jQuery("#post_tabs").tabs({ 
		fx: { opacity: 'toggle' } 
	});
	
	// Top slideshow 
	jQuery('#slideshow').after('<ul id="slideshowNav">').cycle({ 
	    fx:     'fade', 
	    speed:  'slow', 
	    timeout: 5000,
		next: '#slideshowCycleNav #slideshowNext',
		prev: '#slideshowCycleNav #slideshowPrev',
	    pager:  '#slideshowNav', 

	    // callback fn that creates a thumbnail to use as pager anchor 
	    pagerAnchorBuilder: function(idx, slide) { 
	      return '<li><a href="#"><img src="' + jQuery(slide).find('img').attr('src') + '" height="40" /></a></li>';
	    } 
	});
	
	// Top slideshow pause
	jQuery('#slideshowCycleNav #slideshowPause').click(function() { 
		jQuery('#slideshow').cycle('pause');
		jQuery(this).hide();
		jQuery('#slideshowCycleNav #slideshowResume').show();
	});
	jQuery('#slideshowCycleNav #slideshowResume').click(function() { 
		jQuery('#slideshow').cycle('resume');
		jQuery(this).hide();
		jQuery('#slideshowCycleNav #slideshowPause').show();
	});
});


