function clicPopup(e) {
  Event.stop(e);
  
  var link = Event.element(e);  
  var link = link.up('a');

  var width = 500;
  var height = 700;
  var re = new RegExp('taille([0-9]+)x([0-9]+)');	
  link.classNames().each(function(className) {		
    var m = re.exec(className);
    if (m != null) {
      width = m[1];
      height = m[2];          
      throw $break;
    }    
  });
  
  var time = new Date(); // Date du client
  var h = time.getHours(); // Heure
  var m = time.getMinutes(); // Minutes
  var s = time.getSeconds(); // Secondes
  
  window.open(link.href, 'popup'+h+m+s,
    'width='+width+', height='+height+', toolbar=no, menubar=no, resizeable=yes');
}

Event.observe(window, 'load', function() {
  $$('a.popup').each(function(link) {
    Event.observe(link, 'click', clicPopup);
  });
});


