var player = null;
var ppoint = null;
var currentState = 'NONE';
function playerReady(thePlayer) {
	player = window.document[thePlayer.id];
	addListeners();
}

function addListeners() {
	if (player) {
		player.addModelListener("STATE", "stateListener");
	} else {
		setTimeout("addListeners()",100);
	}
}

function stateListener(obj) { //IDLE, BUFFERING, PLAYING, PAUSED, COMPLETED
	currentState = obj.newstate; 
	previousState = obj.oldstate; 
		if((ppoint!=00)&&(currentState=="PLAYING")){
		player.sendEvent('SEEK', ppoint);
		setTimeout(ppoint=00,2000);}
}

function createPlayer(ppath,vvideo) {
	var s1 = new SWFObject("http://webcastors.net/emlyon/player.swf","idvid","400","300","9");
	s1.addParam("allowfullscreen","true");
	s1.addParam("allowscriptaccess","always");
	s1.addParam("bgcolor","#ffffff");
	s1.addParam('flashvars','&file='+ppath+'/'+vvideo+'&plugins=http://webcastors.net/emlyon/highwinds.swf&highwinds.autostart=true&controlbar=over');
	//s1.addParam('flashvars','&file='+ppath+'/'+vvideo+'');
	s1.addVariable("autostart","false");
    s1.addVariable("screencolor","0xffffff");
	s1.addVariable("enablejs","true");
	s1.addVariable("javascriptid","idvid");
	s1.addVariable("width","400");
	s1.addVariable("height","300");
	s1.addVariable("displayheight","300");
	s1.addVariable('bufferlength', '0');
	s1.addVariable("showicons","false");
	s1.write("container");
}
				 
function playervod(path,video,point){ 
	createPlayer(path,video);
	ppoint = point;
}