$ = jQuery.noConflict();
$(function() {
	if (!$('body').hasClass('page-template-page-product-php')) {
		$('.nav').hover(function() {
			}, function() {
				$('.nav > li ul').hide();
			}).children('li').hover(function() {
				$('.nav > li ul').hide();
				$(this).addClass('hover').children('ul').css({ 'left':'0' }).show();
			}, function() {
				$(this).removeClass('hover').children('ul').hide();
		});
		
		$('.nav li ul').each(function() {
			$(this).width( $(this).parent().width() );
		});
	}
	
	hentryWidth = ($('body').hasClass('home')) ? '425px' : '200px';
	$('.showcase').slideshow({ items:'div.item', showControls: true });
	$('.showcase .hentry').append('<a class="close">click to close</a>').children('.close').click(function() {
		if ($(this).hasClass('open')) {
			$('.close').removeClass('open');
			$('.hentry').animate({ width:hentryWidth }, 500, 'swing');
		} else {	
			$('.hentry').animate({ width:'20px' }, 500, 'swing', function() { $('.close').addClass('open'); });
		}
		
		return false;
	});
	
	if (!$('body').hasClass('home')) {
		$('.showcase .hentry').css('width','20px').children('.close').addClass('open');
	}
	
	//$('#mlemail').innerLabel('Join Our Mailing List');
	
	colHeight = 0;
	$('.widget_text').each(function() {
		colHeight = ($(this).height() > colHeight) ? $(this).height() : colHeight;
	});
	$('.widget_text').height(colHeight);
});

(function($) {
	$.fn.innerLabel = function(text) {
		return this.each(function() {
			$(this).blur(function() {
				if ($(this).val() == '') {
					$(this).val(text);
				}
			});
			
			$(this).focus(function() {
				if ($(this).val() == text) {
					$(this).val('');
				}
			});
		});
	}
})(jQuery);
