// FROM http://xpertize.gb.int/_ajax/contact.php?showstub=true&objectname=ContactsController
if(typeof(ShareController) == 'undefined')
  ShareController = new Object();


Object.extend(ShareController,
{
    shareJob: function(missionId)
    {
        try
        {
            if(userControler.isLogged)
          		this._shareJob(missionId, null)
            else
            	userControler.loginAndCallback(this._shareJob.bind(this, missionId));
        }
        catch(e)
        {
            console.debug(e);
        }
        return false;
    },
     _shareJob: function(missionId, fromLogin)
    {
        if(fromLogin)
        {
            this._reload = true;
            myLightWindow.openWindow($('share_'+missionId));
        }
        else
            myLightWindow.activate(null, $('share_'+missionId));
    }
});
