function updateCountdown() {
	var now = new Date();
	var span = Math.floor((Date.parse('Nov 19, 2011 19:10:00') - now.getTime()) / 1000);
	
	var string = '';
	if (span > 86400) {
		string = Math.floor(span / 86400) + ' day';
		span = span % 86400;
	}
	if (span > 3600 || string.length) {
		string = string + (string.length?', ':'') + Math.floor(span / 3600) + ' hour' + (Math.floor(span / 3600) != 1?'s':'');
		span = span % 3600;
	}
	if (span > 60 || string.length) {
		string = string + (string.length?', ':'') + Math.floor(span / 60) + ' minute' + (Math.floor(span / 60) != 1?'s':'');
		span = span % 60;
	}
	string = string + (string.length?', and ':'') + span + ' second' + (span != 1?'s':'') + '!';
	
	$('#countdown p').html(string);
}

$(function() {
	$('.jsHide').css('display', 'none');
	
	var now = new Date();
	var span = Math.floor((Date.parse('Nov 19, 2011 19:10:00') - now.getTime()) / 1000);
	if (span > 0) setInterval('updateCountdown()', 1000);
	
	if ($('#page_venue').size()) {
		$('#travelLinks .dropLinks').click(function () {
			$('#travelLinks > div').slideUp();
			$($(this).attr('href')).slideToggle();
			
			return false;
		});
/*		$('#travelLinks a').colorbox({
			inline: true,
			href: $(this).attr('href'),
			width: '800px'
		});*/
	} else if ($('#page_aboutUs').size()) {
/*		var fades = {'roshni': 'out', 'urvi': 'out', 'komal': 'out', 'aman': 'out', 'napur': 'out', 'vandana': 'out', 'rina': 'out', 'rahul': 'out', 'beena': 'out', 'zain': 'out', 'alicia': 'out', 'prapti': 'out', 'rohan': 'out', 'mira': 'out'};
		$('.teamRow > div').mouseover(function () {
			curID = this.id;
			if (fades[curID] == 'out') {
				fades[curID] = 'fadingIn';
				$(this).find('img').fadeIn(500, function () {
					if (fades[curID] == 'fadeOut') {
						fades[curID] = 'fadingOut';
						$(this).fadeOut();
					}
				});
			}
		}).mouseout(function () {
//			$(this).find('img').fadeOut();
		});*/
		
		$('.teamRow a').click(function () {
			profClicked = this.id;
			$('.showing').fadeOut(function () {
				$(this).removeClass('showing');
				$('#'+profClicked+'_img, #'+profClicked+'_data').fadeIn().addClass('showing');
			});
			
			return false;
		});
	} else if ($('#page_teams').size()) {
		$('#prevYears a').click(function () {
			showYear = this.id.split('_')[1];
			$('.current').removeClass('current').slideUp(function () {
				$('#winners_' + showYear).slideDown().addClass('current');
			});
			
			return false;
		});
	}
});
