$(function(){

	$('.band .tab_content').hide();
	$('.band .tab_content.show').show();
	$('.band .tabs a').click(function(){
		$(this).closest('ul').children('li').removeClass('active');
		$(this).closest('li').addClass('active');
		
		$(this).closest('.band').children('.right').children('.tab_content').hide();
		$($(this).attr('href')).show();
		
		return false;
	})
	
	$(".band a.video").click(function() {
		
		var href; 
		
		//Youtube
		if($(this).attr('href').indexOf('youtube') > 0){
			href = $(this).attr('href').replace(new RegExp("watch\\?v=", "i"), 'v/');
		}
		
		//Vimeo
		if($(this).attr('href').indexOf('vimeo') > 0){
			//http://vimeo.com/moogaloop.swf?clip_id=[id]
			href = $(this).attr('href').replace("http://vimeo.com/", 'http://vimeo.com/moogaloop.swf?clip_id=');
		}
		
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic',
			'title'			: this.title,
			'width'			: 680,
			'height'		: 495,
			'href'			: href,
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

		return false;
	});
	
});
