var player = null;
function playerReady(obj)
{
	player = document.getElementsByName(obj.id)[0];
	player.addControllerListener('ITEM', 'itemMonitor');
};
function itemMonitor(obj)
{
	if(obj.index != undefined)
{
var playlist = player.getPlaylist();
if((playlist[obj.index].file) && (playlist[obj.index].title))

{
var path = playlist[obj.index].file;

start = path.lastIndexOf(".");

HTML = '<b>' + playlist[obj.index].title + '</b><br />';
HTMLD = '';
HTMLT = '';

if(playlist[obj.index].description) {HTML = HTML + '<b>' + playlist[obj.index].description + '</b>'}
if(playlist[obj.index].mp3 || playlist[obj.index].mp4 || playlist[obj.index].gp3) {HTMLD = HTMLD + ' <b>Datoteke za prenos</b><br />' }
if(playlist[obj.index].mp3) {
	HTMLD = HTMLD + '<br /><a href="' + playlist[obj.index].mp3 + '"><img src="typo3conf/ext/deup_media_center/pi1/scripts/images/mp3-icon.gif" border="0">Audio(MP3)';
	if(playlist[obj.index].mp3Size) {HTMLD = HTMLD + ' | Velikost:' + playlist[obj.index].mp3Size}
	if(playlist[obj.index].mp3Duration) {HTMLD = HTMLD + ' | Dolžina: ' + playlist[obj.index].mp3Duration}
	HTMLD = HTMLD + '</a>';
}
if(playlist[obj.index].mp4) {
	HTMLD = HTMLD + '<br /><a href="' + playlist[obj.index].mp4 + '"><img src="typo3conf/ext/deup_media_center/pi1/scripts/images/mp4-icon.gif" border="0">Video(MP4)';
	if(playlist[obj.index].mp4Size) {HTMLD = HTMLD + ' | Velikost:' + playlist[obj.index].mp4Size}
	if(playlist[obj.index].mp4Duration) {HTMLD = HTMLD + ' | Dolžina: ' + playlist[obj.index].mp4Duration}
	HTMLD = HTMLD + '</a>';
}
if(playlist[obj.index].gp3) {
	HTMLD = HTMLD + '<br /><a href="' + playlist[obj.index].gp3 + '"><img src="typo3conf/ext/deup_media_center/pi1/scripts/images/3gp-icon.gif" border="0">Video(GP3)';
	if(playlist[obj.index].gp3Size) {HTMLD = HTMLD + ' | Velikost:' + playlist[obj.index].gp3Size}
	if(playlist[obj.index].gp3Duration) {HTMLD = HTMLD + ' | Dolžina: ' + playlist[obj.index].gp3Duration}
	HTMLD = HTMLD + '</a>';
}
if(playlist[obj.index].text) {HTMLT = HTMLT + '<br /><br /> <b>Magnetogram</b><br /><br />' + playlist[obj.index].text }

gid('theLink').innerHTML = HTMLD;
gid('textVersion').innerHTML = HTMLT;
  }
  else
  {
	gid('theLink').innerHTML = '';
	gid('textVersion').innerHTML = '';
  }
}
};

function gid(name)
{
return document.getElementById(name);
};