function _Popup (href, name, width, height) {

  var options =  ' width='  + width
              +  ',height=' + height
              +  ',scrollbars=yes'
              +  ',resizable=yes'
              +  ',titlebar=no' ;

  if (window.screen) {
    // center
    var x = Math.round((window.screen.width  - width ) / 2);
    var y = Math.round((window.screen.height - height) / 2);
    if (name != window.name) options += ',screenX=' + x
                                     +  ',screenY=' + y
                                     +  ',left='    + x
                                     +  ',top='     + y ;
  }

  var wnd = window.open(href, name, options);
  if (wnd && wnd.focus) wnd.focus();
  return (wnd);

}

function ShowMap(Lat, Lon, Zoom) {

  // La carte prendra 3/4 de l'ecran
  var width = (window.screen.width  * 3) / 4 ;
  var height= (window.screen.height * 3) / 4 ;

  return _Popup('/cgi-bin/cargo/mapit.pl?' + Lat + '~' + Lon + '~' + Zoom,  'map', width, height);

}

//
// Calcule la hauteur d'un iframe
// usage <iframe width="100%" height="1" scrolling="no" onLoad="setHeight(this);">
// http://developer.mozilla.org/en/docs/DOM:element.scrollHeight


function setHeight(iframe){
  var hauteur = iframe.contentWindow.document.body.scrollHeight;
  if( document.all ){
    hauteur += 32  // IE (+32)
  }else{
    hauteur += 36  // FF
  }
  iframe.style.height =  hauteur + "px";  
} 
