$(function() {
	tooltip('.cap', 'name', true);
	
	$('#logo_left').live('click', function() {
		goTo('Home');
	});
	
	$('#header').hide().fadeIn('slow');
	
	keepSlide('#nav');
	
	$('.cap').live({
		mouseenter: function() {
		$(this).stop().animate({opacity: 1.0}, 250);	
	}, 
	mouseleave: function() {
		$(this).stop().animate({opacity: 0.5}, 250);
		}
	});
	
	$('.cap').live('click', function() {
		if ($(this).attr('id').split('_')[0] == 'Facebook') {
			window.location = 'http://facebook.com/' + $(this).attr('account');
		} else if ($(this).attr('id').split('_')[0] == 'Untappd') {
			window.location = 'http://untappd.com/venue/' + $(this).attr('account');
		} else if ($(this).attr('id').split('_')[0] == 'Youtube') {
			window.location = 'http://youtube.com/user/' + $(this).attr('account');
		} else if ($(this).attr('id').split('_')[0] == 'Twitter') {
			window.location = 'http://twitter.com/#!/' + $(this).attr('account');
		}
	});
	
	var delay = 500;
	$('.cap').each(function() {
		var cap = $(this);
		setTimeout(function() {
			cap.animate({opacity: 1.0}, 500, function() {
				$(this).animate({opacity: 0.5}, 500);
			});
		}, delay);
		delay += 250;
	});
	
	setTimeout(function() {
		$('#logo_left').animate({left: 0}, 1000);
		$('#logo_right').animate({right: 0}, 1000);
	}, 1000);
});



