jQuery(document).ready(function()
{
	/*
	// featured event carousel
	if (jQuery("#featured .wrapper").length)
	{
		function carouselCallback(carousel)
		{
			jQuery('#featured .next').bind('click', function()
			{
				carousel.next();
		        	return false;
			});

			jQuery('#featured .previous').bind('click', function()
			{
				carousel.prev();
				return false;
			});
		};
		
		jQuery("#featured .wrapper").jcarousel(
		{
			scroll:4,
			initCallback:carouselCallback,
			buttonNextHTML:null,
			buttonPrevHTML:null
		});
	}
	*/

	// tabs
	var tabs = $('ul.tabs');
	tabs.each(function(i)
	{
		//Get all tabs
		var tab = $(this).find('> li > a');
		tab.click(function(e)
		{
			//Get Location of tab's content
			var contentLocation = $(this).attr('href');
			//Let go if not a hashed one
			if(contentLocation.charAt(0)=="#")
			{
				e.preventDefault();
				//Make Tab Active
				tab.removeClass('active');
				$(this).addClass('active');
				//Show Tab Content & add active class
				$(contentLocation).show().addClass('active').siblings().hide().removeClass('active');
			}
		});
	});
	
	// youtube links on event listings
	$(".video a[href*=youtube]").click(function(e)
	{
		e.preventDefault();
		jQuery.fancybox(
		{
			'padding':0,
			'autoScale':false,
			'transitionIn':'none',
			'transitionOut':'none',
			'title':this.title,
			'width':640,
			'height':385,
			'href':this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type':'swf',
			'swf':
			{
				'wmode':'transparent',
				'allowfullscreen':'true'
			}
		});
	});
	// expand 'more' links
	$(".expand a").click(function(e)
	{
		e.preventDefault();
		$(this).parents('.event').find('.more').slideToggle(200);
	});
	// expand even 'more' links
	$(".expandblog a").click(function(e)
	{
		e.preventDefault();
		$(this).parents('.featpostbox').find('.more').slideToggle(200);
		$(this).parents('.featpostbox').find('.excerpt').toggle();
	});

	// toggle featuredInfo
	
	
	// toggle featuredInfo
	$(".featuredBtn").mouseenter(function(e)
	{
		e.preventDefault();
		$('.featuredgroup').css("overflow","visible");
		$(this).parents('.event').find('.featuredInfo').stop(true,true).fadeIn().delay(3000).fadeOut();

	});
	$(".featuredBtn").mouseleave(function(e)
	{
		e.preventDefault();
		$(this).parents('.event').find('.featuredInfo').stop(true,true).fadeOut();

	});

	// carousel
	jQuery(function($)
	{ 
  		$('ul.featuredgroup').easyPaginate(
		{
			step:4,
			numeric:false,
		});

  	});

	$(".venue .map").click(function(e)
	{
		jQuery.fancybox(
		{
			'type':'iframe',
			'href':'http://maps.google.com/maps?q=204+N.+WATER+ST.+ROCHESTER,+NY+14604&amp;&amp;output=embed',
			'width':640,
			'height':480
		});
	});

});

