/* pharmacy infos popup */
function showDialog(sender, name, address, address2, tel, fax)
{
  keepDialog();
  if(sender==cur_sender)
    return;
  if(cur_dialog!=undefined)
    cur_dialog.remove();
  var html = '<div class="popup" onmouseover="keepDialog()" onmouseout="hideDialog()">';
  html += '<div class="popup_top"></div>';
  html += '<div class="popup_body">';
  html += '<strong>' + name + '<\/strong><br/>';
  html += address + '<br/>';
  html += address2 + '<br/>';
  html += 'Tél. : <strong>' + tel + '<\/strong>';
  html += ' - Fax : ' + fax;
  html += '</div>';
  html += '<div class="popup_bottom"><\/div>';
  html += '<\/div>';
  new Insertion.Before(sender, html);
  cur_sender = sender;
  cur_dialog = sender.previous();
}
function keepDialog()
{
  if(t!=undefined)
  {
    window.clearTimeout(t);
    t = undefined;
  }
}
function hideDialog()
{
  t = window.setTimeout('hideDialogReal()', 250);
}
function hideDialogReal()
{
  if(cur_dialog!=undefined)
    cur_dialog.remove();
  cur_dialog = undefined;
  cur_sender = undefined;
  t = undefined;
}
var cur_sender = undefined;
var cur_dialog = undefined;
var t = undefined;


/* popup forecast */
function showDialog2(sender, name, address, address2, tel, fax)
{
  var html = '<div class="popup" id="popup_forecast">';
  html += '<div class="popup_top"><\/div>';
  html += '<div class="popup_body">';
  html += '<strong>' + name + '<\/strong><br/>';
  html += address + '<br/>';
  html += address2 + '<br/>';
  html += 'Tél. : <strong>' + tel + '<\/strong>';
  html += ' - Fax : ' + fax;
  html += '<\/div>';
  html += '<div class="popup_bottom"><\/div>';
  html += '<\/div>';
  new Insertion.Before(sender, html);
  
  // Solution affichage à gauche de la page
  /*
  new Insertion.Before($('previsions_table'), html);
  par = sender.up();
  par_top = par.offsetTop;
  $('popup_forecast').setStyle({top: par_top + 'px'});
  */
}


function hideDialog2()
{
  $('popup_forecast').remove();
}

function showZoom()
{
  if(!$('zoomout').visible())
  {
    if(animating)
      return false;
    animating = true;
    new Effect.BlindDown($('zoomout'),
    {
      afterFinish: function()
      {
        animating = false;
      }
    });
    return false;
  }
}

function hideZoom()
{
  new Effect.BlindUp($('zoomout'));
  return false;
}


var animating = false;