// equal height plugin
(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).css("overflow","auto");
		});
	}
	
})(jQuery);
// end equal height plugin


$(function(){
	
	// $("#feature_photo img").imageparallax();
	
	$('#specials_board').slides({
				preload: true,
				autoHeight: true,
				generateNextPrev: false,
				generatePagination: true,
				hoverPause: true,
				play: 7000,
				preloadImage: '/core/gfx/ajax-loader.gif'
			});
	if ( !($.browser.msie && $.browser.version == 7.0) ){
		// ie7 crapping out
		$("select").uniform();
	}
	
	$("input:text, input:submit, input:checkbox, input:radio, input:file, textarea").uniform();
	
	$('.content_image a').fancybox();
	$('.product_image_gallery a').fancybox();
	
	$('.row_1').equalHeights();
	$('.row_2').equalHeights();
	$('.row_3').equalHeights();
	$('.row_4').equalHeights();
	$('.row_5').equalHeights();
	$('.row_6').equalHeights();
	$('.row_7').equalHeights();
	
	$('.hxome_wrapper .home_col').equalHeights();
		
	$('.acc_container').hide(); //Hide/close all containers
	$('.acc_trigger').click(function(){
		if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
			$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
			$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
		}
		return false; //Prevent the browser jump to the link anchor
	});
	
});

