$(function(){
	$('#now_tasting_viewer').viewer({itemsSelector: '.viewer_items li', displayNum: 7, createButtons: true, showNumbers: false, disableFadeTo: 0});
//	$("div#logoParade").smoothDivScroll({intervalSpeed: 30, visibleHotSpots: "", scrollingSpeed: 10, autoScroll: "always", autoScrollDirection: "endlessloop", pauseAutoScroll: "mouseover"});
	$('.scrollableArea').marquee({elementWidth: 135, speed: 50});
	$('.scrollableArea').hover(
		function(){
			$(this).stopMarquee(); 
		},
		function (){
			$(this).startMarquee();
		}
	);
	$('.accordian').simpleaccordian();

	var first = true;
	$('.toggle_plus_minus_red').click(function(){
		var animate = (first) ? 0 : 'fast';
		$this = $(this);
		$content = $('.expando');
		if ($content.is(':hidden')){
			$this.removeClass('toggle_plus_red');
			$content.slideDown(animate);
		} else {
			$this.addClass('toggle_plus_red');
			$content.slideUp(animate);
		}
	});
	$('.toggle_plus_minus_blue').click(function(){
		var animate = (first) ? 0 : 'fast';
		$this = $(this);
		$content = $('.expando');
		if ($content.is(':hidden')){
			$this.removeClass('toggle_plus_blue');
			$content.slideDown(animate);
		} else {
			$this.addClass('toggle_plus_blue');
			$content.slideUp(animate);
		}
	});
//	if (hideMyHome) $('#my_home').find('.toggle_plus_minus_red').click();
	first = false;
})


function validate(form)
{
	try
	{
		if (form.id == 'form_join')
		{
			var email = jQuery.trim($('#signup_newsletter').val());
			if (email == "")
				return false;
			if (email.indexOf("@") < 0)
				return false;
		}
		else if (form.id == 'form_wine_interest')
		{
			var text = jQuery.trim($('#wine_or_winery').val());
			if (text == "")
				return false;
		}
	}
	catch(ex) {}
	return true;
}
