// overlay
// define function that opens the overlay
/*
function openOverlay() {
	// get access to the overlay API
	var api = $("#videoOverlay").overlay();
	// call it's open() method		
	api.load();			
}
*/

var path = '/';

function openOverlay(movie) {
	//fill overlay with given content
	var flashvars = {};
	flashvars.path = path+'flv/';
	flashvars.file = movie;
	var params = {};
	params.play = "true";
	params.menu = "false";
	params.wmode = "transparent";
	swfobject.embedSWF("swf/videoplayerOverlay.swf", "overLayMovie", "548", "352", "8.0.0", false, flashvars, params);
	
	/*
	$("#overLayMovie").flashembed(path + "swf/videoplayerOverlay.swf", {
	 	// these properties are given for the Flash object
	 	path: path+'flv/',
		file: movie
	});
	*/
	
	// get access to the overlay API
	var api = $("#videoOverlay").overlay();
	// call it's open() method
	api.load();
}

$(function() {
	$("#videoOverlay").overlay({
		close: 'a.close' ,
		speed: 50,
		// start exposing when overlay starts to load
		onBeforeLoad: function() {
			// this line does the magic. it makes the background image sit on top of the mask
			this.getBackgroundImage().expose({opacity: 0.75 ,color: '#000000'});
		}, 
		
		// when overlay is closed take the expose instance and close it as well
		onClose: function() {
			$.expose.close();
		}
	});
});

$(document).ready(function() {
	if (showHomeMovie == true) {
		openOverlay('calgonit_finish.flv');
	}
});

function hideFlashOverlay() {
	// close overlay
	$("#videoOverlay").overlay().close();	
}
