// JavaScript Document

var theItem;
var selFile;


function loadPlay(file,idx) { 
	theItem=idx;
	selFile=file;
	createPlayer(selFile);
	setTimeout("play()",1100);
};

function play() {
	sendEvent('playitem',theItem);
};

function sendEvent(typ,prm) {
	thisMovie("thePlayerId").sendEvent(typ,prm);
};

function thisMovie(movieName) {
    if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document[movieName];
	}
};



function createPlayer(theFile, go) {
	var s = new SWFObject("mediaplayer.swf","PlayerID","300","270","7");
	s.addParam("allowfullscreen","true");
	s.addVariable("file",theFile);
	s.addVariable("width","300");
	
	s.addVariable("displayheight","0");
	s.addVariable("overstretch","none");
	s.addVariable("shuffle","false");
	s.addVariable("frontcolor","0x525134"); 
	s.addVariable("lightcolor","0x525134"); 
	s.addVariable("showicons","false");
	s.addVariable("autostart","true");
	s.addVariable("thumbsinplaylist","false");
	s.addVariable("enablejs","true");
	s.addVariable("javascriptid","thePlayerId"); 
	s.addVariable('repeat','list');
	s.addParam("wmode","transparent");
	s.write("player-2");
}