
$(document).ready(function(){initBagSports()});
var bagsport_fadeInTime = 200;
var bagsport_currentPod = "";
function initBagSports()
{
$(".sportInfo").hide();
$("#infoPods").hide();
$(".sport").focus(
function() {
var sport = $(this).attr("id");
$("#" + sport).click();
return false;
}
);
$(".sport").click(
function(e) {
var sport = $(this).attr("id");
var height = $("#" + sport + "Info").height();
if( height == 0 || height == null )
height = 810;
if( $("#infoPods").height() != height )
$("#infoPods").animate({height:height}, "slow");
showSport(sport);
return false;
}
);
$(".closeInfo").show();
$(".closeInfo a").click(
function(e)
{
$("#" + bagsport_currentPod + "Info").fadeOut(bagsport_fadeInTime);
$("#infoPods").slideUp(bagsport_fadeInTime*2);
bagsport_currentPod = "";
return false;
}
);
}
function showSport(sport)
{
var c = bagsport_currentPod;
bagsport_currentPod = sport;
if( sport != c )
{
if ( c != "" )
$("#" + c + "Info").fadeOut(bagsport_fadeInTime,function(){fadeInInfo(sport);});
else
fadeInInfo(sport);
}
}
function fadeInInfo(sport)
{
$("#" + sport + "Info").fadeIn(bagsport_fadeInTime,
function() {
$("#" + sport + "Info").css("opacity","1");
if( $(".sportInfo:visible").length > 1 ) {
$(".sportInfo:visible").each(
function() {
if( $(this).attr("id").indexOf(bagsport_currentPod) == -1 )
$(this).hide();
}
);
}
$("#infoPods").animate({height:$(this).height()}, "fast");
}
);
}