function hideVideo() {
  var video = document.getElementById('mediaplayer');
  if (video != null) {
    video.style.display = 'none';
  }
  embedvideo = document.getElementById('embedplayer');
  if (embedvideo != null) {
    embedvideo.style.display = 'none';
  }

}

function showVideo() {
  var video = document.getElementById('mediaplayer');
  if (video != null) {
    video.style.display = '';
  }
  embedvideo = document.getElementById('embedplayer');
  if (embedvideo != null) {
    embedvideo.style.display = '';
  }
}



function menuShow(id) {

  var element = document.getElementById(id);
  if (element) { element.className = 'menu visible'; }
  element = document.getElementById('content');
  if (element) { element.className = 'menudown'; }

}

function menuHide(id) {

  var element = document.getElementById(id);
  if (element) { element.className = 'menu'; }
  element = document.getElementById('content');
  if (element) { element.className = ''; }

}

function menuitemSelectID(id, documentURI) {
  var element = document.getElementById(id);
  if (element) { 
    for (i=0; i<element.childNodes.length; i++) {
      if (element.childNodes[i])      
        if (element.childNodes[i].pathname) {
          if (element.childNodes[i].pathname == documentURI | '/' + element.childNodes[i].pathname == documentURI) {
            element.childNodes[i].className += ' selected';
          }
        }
      
    } 
  }
}

function menuitemSelect(documentURI) {
  menuitemSelectID('sidebar',documentURI); 
  menuitemSelectID('mhAbout',documentURI);
  menuitemSelectID('mhSolutions',documentURI);
  menuitemSelectID('mhMedia',documentURI);
  menuitemSelectID('mhCareers',documentURI);
}

function injectPrintable() {
  document.write('<img id="printable" src="/images/printer.gif" alt="Print this page..." onclick="window.print();">');
}

function injectFlash() {
  // Inject from external JS to avoid IE 6 "click to enable control" "feature"
  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="530" height="325" id="slideshow" align="middle"><param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/flash/slideshow.swf"><param name="quality" value="high"><param name="wmode" value="transparent"><param name="scale" value="exactfit"><param name="bgcolor" value="#ffffff"><embed wmode="transparent" src="/flash/slideshow.swf" quality="high" scale="exactfit" bgcolor="#ffffff" width="536" height="325" name="slideshow" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>');
}

function clearInput(inp,def) {
  if (inp && inp.value && (!def | inp.value == def)) inp.value = '';
}

