
window.addEvent('domready', function() {	

  if ($('opener-menu') == null) return;
  if ($('ms-menu-container') == null) return;
	
  $('opener-menu').setStyle('visibility', 'visible');
  $('opener-menu').setStyle('display', 'block');
  
  $('ms-menu-container').setStyle('visibility', 'visible');
    
  var radio = new Fx.Slide('ms-menu-container', {
    transition: Fx.Transitions.Pow.easeOut
  });
  
  radio.hide();
  
  $('opener-menu').addEvent('mouseenter', function(e) {
    e.stop();
    radio.show();
    $('ms-menu-container').setStyle('visibility', 'visible');
    $('opener-menu').setStyle('border-bottom', '0px solid #000');
    
  });
  
  $('opener-menu').addEvent('mouseleave', function(e) {
    e.stop();
    radio.hide();
    $('opener-menu').setStyle('border-bottom', '1px solid #000');
  });
  
  $('ms-menu-container').addEvent('mouseleave', function(e) {
    e.stop();
    radio.hide();
    $('opener-menu').setStyle('border-bottom', '1px solid #000');

  });
  $('ms-menu-container').addEvent('mouseenter', function(e) {
    e.stop();
    radio.show();
    $('opener-menu').setStyle('border-bottom', '0px solid #000');
  });
});



function fillDestinationField(id, place_destination, name_destination, type_destination) {
  return true;
}

function fillOriginField(id, place_origin, name_origin, type_origin) {
  return true;
}

function detailsUpdated() {
   if (typeof Slimbox == "undefined") return;
   Slimbox.scanPage();
}

function webcamsinit() {
   if (typeof imageReloader == "undefined") return;
   imgRelObj = new imageReloader('webcams','webcam');
   window.setInterval("imgRelObj.loadSrc ()",4000);
   window.setInterval("imgRelObj.reloadWebcams()",5000);
}

function popup_detail(id, jsessionid) {
  var url = "details;jsessionid=" + jsessionid + "?id=" + id ;
  if(typeof ms_app_path != 'undefined') url = ms_app_path + url;
  if(typeof ms_locale != 'undefined')   url = url + "&locale=" + ms_locale;
  window.open(url, "MapSight_Details", "HEIGHT=640 ,WIDTH=630 ,RESIZABLE=1,SCROLLBARS=1,STATUS=0,LOCATION=0,TOOLBAR=0,MENUBAR=0");
};

function popup_window(url, name, width, height) {
  var myWindow = window.open(url, name, "HEIGHT="+height+" ,WIDTH="+width+" ,RESIZABLE=1,SCROLLBARS=1,STATUS=0,LOCATION=0,TOOLBAR=0,MENUBAR=0");
  if (myWindow != null) myWindow.focus();
};

