
// Necessarily global:
function thisMovie(movieName)
{
	if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document[movieName];
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function cxPlayerCore(container_id,width,height)
{
	function FOB(){	return document.getElementById(container_id);	}
	this.FOB = FOB;
	this.Write = function (url,pid)
	{
		var so = new SWFObject('/common/player/mediaplayer.swf',pid,width,height,'8');
		so.addParam('allowscriptaccess','always');
		so.addParam('allowfullscreen','false');
		so.addVariable('width',width);
		so.addVariable('height',height);
		so.addVariable('file',url);
		so.addVariable('javascriptid',pid);
		so.addVariable('enablejs','true');
		so.addVariable("autostart","true");
		so.write(container_id);
		return pid;
	};
}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function cxAudioPlayer(container_id,width,height,player_id)
{
	var This = this;
	cxPlayerCore.call(this,container_id,width,height);
	
	var A = this.FOB().getElementsByTagName("A")[0];
	var URL = A.href;
	A.href="#";
	A.target="";
	AttachEvent(A,"click",
		function()
		{
			This.Write(URL,player_id);
		}
	);
	A=null;
}

