function prev_item() {
	parent.frames[0].sendEvent('prev');
}
function next_item() {
	parent.frames[0].sendEvent('next');
}
function change_state() {
	parent.frames[0].changeState();
	showState();
}
function showState() {
	var button = document.getElementById('play-pause');
	var state = parent.frames[0].getState();
	if(state=='pause') {
		var img='play';	
	}
	else {
		var img='pause';	
	}
	button.src = 'images/icon_'+img+'.jpg';
}
function getData() {
	showState();
	parent.frames[0].reloadItem();
}
function showItem(creator, title) {
	document.getElementById('itemInfo').innerHTML = title;
}
function showTime(elapsed, remaining) {
        var total_time = Math.round(elapsed) + Math.round(remaining);
	var percentage = Math.round(elapsed) / total_time * 200;
	document.getElementById('statusbar').style.backgroundPosition = Math.round(200 + percentage)+'px 0px';
}

