// Functions for toggling 'Overlay' display items

function getFlashMovie(movieName) {
    var isIE = navigator.appName.indexOf("Microsoft") != -1;
    return (isIE) ? window[movieName] : document[movieName];
}


function showOverlay() {	
		

	// Show overlay
	var overlay = document.createElement('div');
	overlay.id = 'overlay';
	overlay.innerHTML = '<div id="overlay-flash"></div>';
	document.body.insertBefore(overlay, document.body.firstChild);
	
	// Show Flash
	var flashvars = new Object();
	var params = {
		allowScriptAccess: "always",
		allowFullScreen: "true",
		quality: "high",
		menu: "false", 
		wmode: "transparent"
	};
	var attributes = {}
	swfobject.embedSWF("/videos/player.swf", "overlay-flash", "100%", "100%", "9.0.115.0", "expressInstall.swf", flashvars, params, attributes);
	
	// Scroll page to top
	window.scrollTo(0,0);
}

function hideOverlay() {
	
	// Remove overlay
	var flash = document.getElementById('overlay-flash');	
	var overlay = document.getElementById('overlay');
	if (overlay && flash) overlay.removeChild(flash);	
	if (overlay) document.body.removeChild(overlay);	
	
	
}
