MyStage = {
	open_folder:function(element) {
		$(element.parentNode.parentNode.parentNode.id).childElements().each(function(li) {
			li.childElements().each(function(e) {
				if(e.nodeName=='UL') { e.hide(); }
			});
		});
		element.parentNode.parentNode.down('ul').show();
	}
};


	var player;
	var currentItem = 0;
	function playerReady(obj) {
		player = $(obj['id']);
		player.addControllerListener('ITEM','curIndex');
	};
	function curIndex(obj) {
		currentItem = obj.index;
		updatePlayer();
	};
	function updatePlayer() {
		var details = player.getPlaylist()[currentItem]['title'];
		details = details.split("[|]");
		switch(details[0]) {
			case 'a':
				$('media_audio').show();
				$('media_audio_title').update(details[1]);
				$('media_audio_artist').update(details[2]);
				player.height = 32;
				break;
			default:
				$('media_audio').hide();
				player.height = 306;
			break;
		}
		
		// the lines below undoes the stuff in mediaj.js to reset the button
		$('btnRequest').value = "Request";
		$('btnRequest').setStyle({cursor:'pointer',color:'',borderColor:'',background:''}).enable();
/*		$("btnRequest").style.cursor = "";
		$("btnRequest").style.color = "";
		$("btnRequest").style.borderTopColor = "";
		$("btnRequest").style.borderLeftColor = "";
		$("btnRequest").style.backgroundColor = "";
		$("btnRequest").style.borderBottomColor = "";
		$("btnRequest").style.borderRightColor = ""; */
	};