$(function() {

var url = window.location.pathname, 
urlRegExp = new RegExp(url.replace(/\/$/,'') + "$");
$('#menu a').each(function(){
	if(urlRegExp.test(this.href.replace(/\/$/,''))){
		$(this).addClass('current');
	}
});


$('.expand-menu').hide();
$('.expand-menu').delay(500).fadeIn(1000, function() { $(this).delay(3000).fadeOut(2000); });
$('#logo-photopage').hover(function() {
	$('.expand-menu').stop();
	$('.expand-menu').hide();
	$('#menu').show();
	$('#menu-photopage-container').stop(true, false).animate({
		width: '500px'
	}, 500, function() {
		$('#menu-photopage-container').css('height', '');
	});
}, function() {
	$('#menu-photopage-container').css({'height': ''});
	$('#menu-photopage-container').stop(true, false).animate({
		width: '1px'
	}, 500, function() {
		$('#menu').hide();
	});
});

$('.andrew-bio, .chris-bio, .dave-bio, .nick-bio').hide();
$('.member').click(function() {
	if ($(this).hasClass('andrew')) {
		$('.member').removeClass('active');
		$('.andrew').addClass('active');
		$('.bios').hide();
		$('.andrew-bio').show();
		$.backstretch('imgs/andrew.jpg', {speed:1000});
	} else if ($(this).hasClass('chris')) {
		$('.member').removeClass('active');
		$('.chris').addClass('active');
		$('.bios').hide();
		$('.chris-bio').show();
		$.backstretch('imgs/chris.jpg', {speed:1000});
	} else if ($(this).hasClass('dave')) {
		$('.member').removeClass('active');
		$('.dave').addClass('active');
		$('.bios').hide();
		$('.dave-bio').show();
		$.backstretch('imgs/dave.jpg', {speed:1000});
	} else if ($(this).hasClass('nick')) {
		$('.member').removeClass('active');
		$('.nick').addClass('active');
		$('.bios').hide();
		$('.nick-bio').show();
		$.backstretch('imgs/nick.jpg', {speed:1000});
	} else if ($(this).hasClass('theband')) {
		$('.member').removeClass('active');
		$('.theband').addClass('active');
		$('.bios').hide();
		$('.theband-bio').show();
		$.backstretch('imgs/about-page.jpg', {speed:1000});
	}
});

$('.choose-vendor').hover(function() {
	$('.choices').show();
	$('.choices').stop(true, false).animate({
		height: '70px'
	}, 500, function() {
		//done
	});
}, function() {
	$('.choices').stop(true, false).animate({
		height: '0'
	}, 500, function() {
		$('.choices').hide();
	});
});

$('#1').hide();
$('.choices span').click(function() {
	$('#go-button').removeClass();
	$('#go-button').addClass($(this).attr('class'));
	$('.chosen').html($(this).html());
	$('.choices span').show();
	$(this).hide();
	$('.choices').hide();
	$('a.go-link').attr('href', $(this).attr('title'));
});

});






