/**
 * Javascript Menu functions for MJet website
 *
 * Author: Mathieu St-Gelais <avamat@hotmail.com>
 * Last updated on: 2008-10-06
 */

/* Show or hides a div. */
function showHideDiv(action, divId) {
  var theWrap = document.getElementById(divId);
  
  if(action == 'in') {
    theWrap.style.visibility = 'visible';
  }
  else {
    theWrap.style.visibility = 'hidden';
  }
}

/* This is to counter a bug in IE when resizing the browser window */
function monitorPosition() {
  // Services menu
  var menuServices = document.getElementById('menuServices');
  menuServices.style.display = 'none';
  menuServices.style.display = 'block';
  
  // Company menu
  var menuCompany = document.getElementById('menuCompany');
  menuCompany.style.display = 'none';
  menuCompany.style.display = 'block';
  
  // Portfolio menu
  var menuPortfolio = document.getElementById('menuPortfolio');
  menuPortfolio.style.display = 'none';
  menuPortfolio.style.display = 'block';
  
  // News Center menu
  var menuNews = document.getElementById('menuNews');
  menuNews.style.display = 'none';
  menuNews.style.display = 'block';
  
  // Careers menu
  var menuCareers = document.getElementById('menuCareers');
  menuCareers.style.display = 'none';
  menuCareers.style.display = 'block';
  
  // Contact menu
  var menuContact = document.getElementById('menuContact');
  menuContact.style.display = 'none';
  menuContact.style.display = 'block';
  
  // Also with custom scrollers if any
  var scroller0 = document.getElementById('root0');
  
  if(scroller0 != null) {
    scroller0.style.display = 'none';
    scroller0.style.display = 'block';
  }
  
  var toMonitor = document.getElementById('monitorMe');

  if(toMonitor != null) {
    toMonitor.style.display = 'none';
    toMonitor.style.display = 'block';
  }
}

function roll(theImage, imgSource) {
  theImage.src = imgSource;
}

