/**
 * fonctions utilis�es dans les pages sur les company, le matching, etc...
 */

/**
 * appelle en ajax une page qui affichera un contenu detaill�e sur la company pass�e en parametre
 * @param {Object} cpn_id
 */
function showInfo(cpn_id)
{
  if($('popinfo_'+cpn_id) && url_popcompany && url_popcompany.length > 0)
  {
    //$('popinfo_'+cpn_id).innerHTML = "sfd fdsfsd ffds fsdqff qsfsdfs fsdf<br/> fdf qsf";
    new Ajax.Updater('popinfo_'+cpn_id, url_popcompany,
                {parameters:{cpn_id: cpn_id},
                  asynchronous:true, 
                  evalScripts:true,
                  onCreate:function() {},
                  onComplete:function() {}
                  }
                );
  }
}

/**
 * permet l'envoi d'une meeting request depuis la popup directory/meeting
 */
function sendMasByPop()
{
  var grp_id = ($('grp_id')) ? $F('grp_id') : null;
  var cpn_id = ($('cpn_id')) ? $F('cpn_id') : null;
  var msg_title = ($('msg_title')) ? $F('msg_title') : null;
  var msg_content = ($('msg_content')) ? $F('msg_content') : null;
  var int_id = ($('int_id')) ? $F('int_id') : null;
  if(grp_id && msg_title && msg_content)
  {
    new Ajax.Updater('popup', url_popmeeting_sendrequest,
                {parameters:{cpn_id: cpn_id, grp_id: grp_id, msg_title: msg_title, msg_content: msg_content, int_id: int_id},
                  asynchronous:true, 
                  evalScripts:true,
                  onCreate:function() {$('popup').innerHTML = "<img src='/images/ajax.gif' />"},
                  onComplete:function() {
                      if ($('imgstatus_' + cpn_id)) 
                      {
                        $('imgstatus_' + cpn_id).src = '/images/bonhomme_gris.png';
                        $('imgstatus_' + cpn_id).onmouseover = "Tip('Pending')";
                      }
                    }
                  }
                );
  }
}

