/**
 * Start all the scripts that require initializing when jQuery is ready
 * For exclusive use with the Magzimus theme
 *
 * Author: Oscar Alcala
 * Website: http://www.themeforest.net?ref=BioXD
**/

jQuery(document).ready(function($) {
	
	// Start the sliders	
	
		$('.slider_thumbnail[rel=0]').animate({
			opacity: 1
		}, 600);
	
		
	// Start Cufon
	Cufon.now();
	Cufon.refresh();
	
	$("#categories_menu li").hover(function(event) {
		$('.sub-menu', this).slideToggle(300);
	});
	
	// Start the gallery 
	$(".pretty").colorbox({slideshow:true, preloading: true, slideshowSpeed: 5000});	

		
	//$("#sidebar, #content").equalHeights();
	$(window).load(function () {
		$("#sidebar, #content").css('height', 'auto').equalHeights();
	});
	jQuery('.MailPressFormSubmit').click(function(){
		_gat._getTrackerByName()._trackEvent('Blog', 'Subscribe', document.location);
		return false;
    });
	
});


(function($) {
	$.fn.equalHeights = function(minHeight, maxHeight) {
		tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
			$(this).height(tallest);
		});
	}
})(jQuery);

