// JavaScript Document

var killTimer;

$().ready(function() {
	
	//Nav Rollover Binding
	$('#Nav .topnav').hover(function() {
		HoverNav($(this).attr('id'));
	},
	function() {
		LeaveNav($(this).attr('id'));
	});
	
	//Social Networking Icon Rollover Binding
	$('#SocialNetworks .socialIcon').hover(function() {
		HoverSocial($(this).attr('id'));
	},
	function() {
		LeaveSocial($(this).attr('id'));
	});
	
	//Member Section Rollovers
	$('.members #Content .group .member').mouseover(function() {
		window.clearTimeout(killTimer);
		HideDescriptions($(this).attr('id'));
		ShowDescription($(this).attr('id'));
	});
	$('.members #Content .group .member').mouseout(function() {
		window.clearTimeout(killTimer);
		killTimer = window.setTimeout("HideDescriptions()", 500);
	});
	$('.members #Content .group .memberHover').mouseover(function() {
		window.clearTimeout(killTimer);
	});
	$('.members #Content .group .memberHover').mouseout(function() {
		window.clearTimeout(killTimer);
		killTimer = window.setTimeout("HideDescriptions()", 500);
	});
});



function HoverNav(id) {
	$('#' + id + ' img').attr('src', '/images/' + id + '-hover.png');
}

function LeaveNav(id) {
	$('#' + id + ' img').attr('src', '/images/' + id + '.png');
}

function HoverSocial(id) {
	$('#' + id + ' img').attr('src', '/images/social/' + id + '-hover.png');
}

function LeaveSocial(id) {
	$('#' + id + ' img').attr('src', '/images/social/' + id + '.png');
}

//Member Rollover Functions
function ShowDescription(bandMember) 
{
	$('.members #Content .group #' + bandMember + 'Desc').show();
}

function HideDescriptions(optionalExcludeDescriptionId) 
{
	if(typeof(optionalExcludeDescriptionId) != "undefined")
		$('.members #Content .group .memberHover').not($("#" + optionalExcludeDescriptionId)).hide();
	else
		$('.members #Content .group .memberHover').hide();
}

