function openOverlayDialogWithUrl(pURL)
{
	console.log("openOverlayDialogWithUrl");
	var playerContainer = document.getElementById("player");
	
	if ( playerContainer && ( pURL && pURL !== '' ) ) // check if player tag exists and URL exists and is not empty
	{
		playerContainer.href = pURL;                  // set player's href
		$f("player", "flowplayer/flowplayer-3.2.4.swf");     // install player, which launches it and plays content
	}

	$("#my_dialog").overlay().load();
}

function openTextDialog()
{
	$("#my_text_dialog").overlay().load();		
}

function openSwfObject(url)
{
	console.log("openSwfObject");
	$(function() {
		// Defines Popup Dialog
		$("#raw_swf_object").overlay({
			effect: 'apple',
			mask: {
				color: '#fff',
				loadSpeed: 200,
				opacity: 0.5
			},			
			onLoad: function() {
				// Events executed onLoad of Dialog
			},
			onClose: function() {
				// Events executed onClose of Dialog
			},
			closeOnClick: false,
			load:false
		});
	});



	var playerContainer = document.getElementById("raw_swf_object");
	if ( playerContainer && ( url && url !== '' ) ) // check if player tag exists and URL exists and is not empty
	{
/*
		var params={
			scale:"noscale",
			allowScriptAccess:"always",
			wmode:"opaque"
		};
		swfobject.embedSWF("mthreader.swf?"+url,"raw_swf_object","475","766","10.0.0","",{},params,{});
*/

      var fo = new SWFObject("mthreader.swf?"+url, "raw_swf_object", "475", "766", "10", "000000");
      fo.addParam("allowScriptAccess", "sameDomain");
      fo.addParam("quality", "high");
      fo.addParam("scale", "scale");
      fo.addParam("loop", "false");
      fo.addParam("menu", "false");
      fo.write("raw_swf_object");

		$("#raw_swf_object").overlay().load();		
	}
}



function openSwfObjectSteve(url)
{
	console.log("openSwfObjectSteve");
	$(function() {
		// Defines Popup Dialog
		$("#raw_swf_object").overlay({
			mask: {
				color: '#000',
				loadSpeed: 200,
				opacity: 0.5
			},			
			onLoad: function() {
			},
			onClose: function() {
			},
			closeOnClick: true,
			load:false
		});
	});

	var playerContainer = document.getElementById("raw_swf_object");
	if ( playerContainer && ( url && url !== '' ) ) // check if player tag exists and URL exists and is not empty
	{
/*
		var params={
			scale:"noscale",
			allowScriptAccess:"always",
			wmode:"opaque"
		};
		swfobject.embedSWF("mthreader.swf?"+url,"raw_swf_object","475","766","10.0.0","",{},params,{});
*/
      var fo = new SWFObject("mthreader.swf?"+url, "raw_swf_object", "511", "806", "10", "000000");
      fo.addParam("allowScriptAccess", "sameDomain");
      fo.addParam("quality", "high");
      fo.addParam("scale", "scale");
      fo.addParam("loop", "false");
      fo.addParam("menu", "false");
      fo.write("raw_swf_object");

		$("#raw_swf_object").overlay().load();		
	}
}

function openRawSwfDialog(url)
{
	var playerContainer = document.getElementById("raw_swf_dialog");
	if ( playerContainer && ( url && url !== '' ) ) // check if player tag exists and URL exists and is not empty
	{
		playerContainer.src = url;                  // set player's href
	}
	$("#my_raw_swf_dialog").overlay().load();		
}

function openSwfOverlayDialog(pURL)
{
	var playerContainer = document.getElementById("player");
	
	if ( playerContainer && ( pURL && pURL !== '' ) ) // check if player tag exists and URL exists and is not empty
	{
		playerContainer.href = pURL;                  // set player's href
		$f("player", "flowplayer/flowplayer-3.2.4.swf", {
			plugins: {
			   controls: null  // disable autoloading of the controlbar plugin
			},
			play: null,        // disable the "overlay play button"

			// prevent pausing
			onBeforePause: function() {
				return false;
			},

			onMouseOver: function() {
				console.log("onMouseOver");
				return false;
			},

			onClick: function() {
				console.log("onClick");
				return false;
			},

			onBeforeUnload: function() {
				console.log("onBeforeUnload");
				return false;
			},

			onBeforeClick: function() {
				console.log("onBeforeClick");
				return false;
			},

			onError: function(errCode, errMessage) {
				console.log("onError "+errMessage);
				return false;
			},

			// make the video loop
			onBeforeFinish: function() {
				return true;
			}
		});
	}

	$("#my_dialog").overlay().load();
}

