// Uses http://jQuery.com

$(function()
{
    //$('div.mod-fastfacts-content').css("left", $('div.mod-fastfacts-content').width());
    $('div.mod-fastfacts > a').toggle(
        function()
        {
            ShowFastFacts($(this));
        },
        function()
        {
            HideFastFacts($(this));
        }
    )
});

function ShowFastFacts(objFastFacts)
{
    var objContent = objFastFacts.parent().siblings('div.mod-fastfacts-content');
    
    var objContentWidth = objContent.width();
    objContent.stop();
    
    if (objContent.is(':hidden'))
    {
        objContent.css("left", -objContentWidth);
        objContent.show();
    }
    
    objContent.animate( {"left": "0"}, 500);
   
    objFastFacts.parent().addClass('open');
}

function HideFastFacts(objFastFacts)
{
    var objContent = objFastFacts.parent().siblings('div.mod-fastfacts-content');

    var objContentWidth = objContent.width();
    objContent.stop();
    objContent.animate( {"left": "-"+objContentWidth}, 500, function() { objContent.show();} );

    objFastFacts.parent().removeClass('open');
}
