$(function()
{
    var out = false;
    
    function SetOut()
    {
        out = true;
    }
    function SetIn()
    {
        out = false;
    }
    
    function Show()
    {
        //most effect types need no options passed by default
        var options =
        {
            marginLeft: "130px"
        };
        
        //run the effect
        if(!out)
            $("#socialSidebar").animate(options,300,SetOut);
    };
    
    function Hide()
    {
        //most effect types need no options passed by default
        var options =
        {
            marginLeft: "0px"
        };
        
        //run the effect
        if(out)
            $("#socialSidebar").animate(options,200,SetIn);
    };
    
    $("#socialSidebar").mouseover(function()
    {
        setTimeout ( Show, 10);
        return false;
    });
    
    $("#socialSidebar").mouseout(function()
    {
        setTimeout ( Hide, 200);
        return false;
    });
    
    $("#socialSidebar a").mouseover(function()
    {
        SetIn();
        //alert("x");
        return false;
    });
    
    $("#socialSidebar a").mouseout(function()
    {
        SetOut();
        //alert("x");
        return false;
    });
    
});
