/* TPEEC */

function displayOffre(url, update_id, el) {
  new Ajax.Updater(
    update_id, 
    url, 
    {
      asynchronous:true, 
      evalScripts:false,
      onCreate: function() {
        $(update_id).show();
      },
      onSuccess: function(transport) {
      }
    }
  );
    elDetail = document.getElementById(update_id).parentNode;
    if (elDetail.className.indexOf('open') == -1)
    {
            el.className += ' selected';
            elDetail.className = 'details open';
    }
}

function closeOffre(update_id, highlight_id) {
  $(update_id).hide();
  $(update_id).innerHTML = '';
  setTimeout(
    'new Effect.Highlight(\'' + highlight_id +'\', {startcolor:\'#831F65\', endcolor:\'#ead9e5\', duration: 1.5})',
    500);

    elDetail = document.getElementById(update_id).parentNode;

    if (elDetail.className.indexOf('open') != -1)
    {
            tr = document.getElementById('head_'+update_id);
            tr.className = tr.className.replace('selected', '');
            elDetail.className = 'details';
    }
}
