function hideVideo() {
  var video = document.getElementsByName('MediaPlayer');
  for (var i = 0; i < video.length; i++) {
    video[i].style.display = 'none';
  }
}

function showVideo() {
  var video = document.getElementsByName('MediaPlayer');
  for (var i = 0; i < video.length; i++) {
    video[i].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('option0',documentURI);
  menuitemSelectID('option1',documentURI);
  menuitemSelectID('option2',documentURI);
  menuitemSelectID('option3',documentURI);
}

function injectPrintable() {
  document.write('<img id="printable" src="/images/printer.gif" alt="Print this page..." onclick="window.print();">');
}

function injectflash() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="536" height="326" align="absmiddle"><param name="wmode" value="transparent"><param name="movie" value="/flash/slideshow.swf" /><param name="quality" value="high"><embed src="/flash/slideshow.swf" width="536" height="326" align="absmiddle" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash"></embed></object>');
}

function injectrecruitmentflash() {
	if (DetectFlashVer(6,0,0)) {
		document.write('<div id="homepageflash"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="526" height="254" align="absmiddle"><param name="wmode" value="transparent"><param name="movie" value="/flash/recruitment.swf" /><param name="quality" value="high"><embed src="/flash/recruitment.swf" width="526" height="254" align="absmiddle" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash"></embed></object></div>');
	} else {
		document.write('<img src="/images/recruitment/no-flash-people.jpg" alt="" style="display: block;">');
	}
}

function injectlocationflash() {
	if (DetectFlashVer(6,0,0)) {
		document.write('<div id="locationflash"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="526" height="821" align="absmiddle"><param name="wmode" value="transparent"><param name="movie" value="/flash/location.swf" /><param name="quality" value="high"><embed src="/flash/location.swf" width="526" height="821" align="absmiddle" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash"></embed></object></div>');
	} else {
		document.write('<img src="/images/recruitment/our-sites-no-flash.jpg" alt="" style="display: block;">');
	}
}


function clearInput(inp,def) {
  if (inp && inp.value && (!def | inp.value == def)) inp.value = '';
}

function clearSubWrapper() {
	var subwrapper = document.getElementById('subwrapper');
	subwrapper.style.backgroundImage = 'none';
	subwrapper.style.backgroundRepeat = '';
}

