	var videoplayerObj = new SWFObject('swf/mediaplayer.swf','vpl','550','334','9'); // sets the dimensions of the video player. the css style dimensions should match
	var currentItemIndex;
	var currentChannelUrl;
	var newItemToPlayOnChannelChange = 0;
	var autostart = true;
	var activeColor = "0x399edd"/*9d1c14*/;
			
	function startPlayer(videoUrl)
	{
		loadPlayer(videoUrl);
		writePlayer();
	}

	function loadPlayer(file)
	{
		videoplayerObj.addParam('allowfullscreen','true');
		videoplayerObj.addParam('allowScriptAccess','always');
		videoplayerObj.addVariable("backcolor","0x000000");
		videoplayerObj.addVariable("frontcolor","0xCCCCCC");
		videoplayerObj.addVariable("lightcolor", activeColor); // color of buttons on videoplayer on mouseover
		videoplayerObj.addVariable('displaywidth','550'); // should be the same as the dimensions in the swf object code
		videoplayerObj.addVariable('displayheight','334'); // should be the same as the dimensions in the swf object code
		videoplayerObj.addVariable('thumbsinplaylist','false');
		videoplayerObj.addVariable('autostart','true');
		videoplayerObj.addVariable('shuffle','false');
		videoplayerObj.addVariable('repeat','list');
		videoplayerObj.addVariable('bufferlength','2');
		videoplayerObj.addVariable('linkfromdisplay','false');
		videoplayerObj.addVariable('enablejs','true');
		videoplayerObj.addVariable('showstop','true');
		videoplayerObj.addVariable('file',file);
	}

	function writePlayer()
	{
		videoplayerObj.write('player');
	}
