createPlayer = function(theFile, parentdivID, width, height, go, redirectto) {
	var divID = parentdivID+'player';
	var s = new SWFObject("/assets/mediaplayer/player.swf",divID,width,height,"7");
	redirectAtEnd = redirectto;
	s.addParam("id",divID);
	s.addParam("name",divID);
	s.addParam('allowfullscreen','true'); 
	s.addVariable("streamer","rtmp://stream2.hamilton.edu/vod/");
	s.addVariable("skin", "/assets/mediaplayer/nacht/nacht.swf");
	s.addVariable("file",theFile);
	s.addVariable("width",width);
	s.addVariable("id",divID);
	s.addVariable("height",height);
	s.addVariable("displayheight",height);
	s.addVariable("config","/assets/mediaplayer/config.xml");
	if (go) { s.addVariable("autostart","true"); }
	s.write(parentdivID);
}
playerReady = function(obj) {
	var player = document.getElementById(obj['id']);
	if (redirectAtEnd) {
		player.addModelListener('STATE', 'stateMonitor');
	}
};
stateMonitor = function(obj) {
	if(obj.newstate == 'COMPLETED') {
		location.href = redirectAtEnd;
	}
};
