FacebookButtonRolloverSound = "facebook/common/button_rollover.ogg";
FacebookButtonClickSound = "facebook/common/button_click.ogg";

-- Main Menu "CONNECT" Button location
facebook_connectbutton_style_position =
{
    -- x = 553,	-- sdk is broken wrt aligning buttons
    x = kCenter,
    y = kMax,
    align = kHAlignCenter + kVAlignBottom,
};

-- Main Menu "hint to connect" location
facebook_friendfeed_tutorial_position =
{
    x = 512,
    y = 768 - 25,
    align = kHAlignCenter + kVAlignBottom,
};

-- unused
facebook_friendfeed_tutorial_arrow_position =
{
    posx = 725, posy = 85,
};

-- Main menu "Friend Feed" location
facebook_friendfeed_style_position =
{
    x = kCenter,
    y = kMax,
    align = kHAlignCenter + kVAlignBottom,
};

--- In Game button location, positioned relative to the Objectives window.
facebook_ingame_style =
{
    x = kMax, y = 0,
    align = kHAlignRight + kVAlignTop,
    sound = FacebookButtonClickSound,  
    rolloversound = FacebookButtonRolloverSound,
};

-- medal button location
facebook_medal_style =
{
    x = 100,
    y = 100,
    align = kHAlignCenter + kVAlignCenter,
};

function Facebook_CreateMedalButton(x_link, y_link)
    if IsFacebookEnabled() then
        local style = facebook_medal_style;
        if not style then
            style = {} ;
        end;

        local graphics = { 'facebook/game/facebook_post_medal' };
        if style.graphics then
            graphics = style.graphics;
        end;
        
        return Group
            {
                SetStyle(style),
                FBButton
                {
                    x = x_link,
                    y = y_link,
                    name = 'fb_medal_post',
                    graphics = graphics,
                    command = 
                        function()
                            local s = Facebook_Callback_GetMedalName();
                            -- extra protection against accidentally posting a non-postable medal
                            if s ~= "" then
                                if Facebook_PostStreamUI_Paused(s) then
                                    HideControl("dlg_medal");
                                end;
                            end;
                            --HideControl("dlg_medal");
                        end
                },
            };
    else
        return Group {};
    end;
end;

function Facebook_HideMedalButton()
    EnableWindow('fb_medal_post', false);
end;
