function displayPlayList() {
		for (i=0; i < myPlayList.length; i++) {
			if(i == myPlayList.length) klasse = '';
			$("#radio_playlist ul").append("<li id='radio_playlist_item_"+i+"'><div class='title'>"+ myPlayList[i].title +"</div><div class='band'>"+ myPlayList[i].band +"</div><div class='laufzeit'>"+ myPlayList[i].laufzeit +"</div></li>");

			$("#radio_playlist_item_"+i).data( "index", i ).hover(
				function() {
					if (playItem != $(this).data("index")) {
						$(this).addClass("playlist_hover");
					}
				},
				function() {
					$(this).removeClass("playlist_hover");
				}
			).click( function() {
				var index = $(this).data("index");
				if (playItem != index) {
					playListChange( index );
				}
			});
		}
//               playListChange (playItem);
//               playListConfig (playItem);
	}
function playListInit(autoplay) {
		var randnr =Math.floor(Math.random()*myPlayList.length);
		if(autoplay) {
//			playListChange( randnr );
                    //alx important!, stoopid FF (3.5+?) has racing condition, so we need to wait, otherwise no music for you!
                    //possibly only on local server...
                    if ($.browser.mozilla ) {
                        setTimeout('$("#radio_player").setFile(myPlayList['+randnr+'].mp3, myPlayList['+randnr+'].mp3).play()', 10000);
                    }else {
                        $("#radio_player").setFile(myPlayList[randnr].mp3, myPlayList[randnr].mp3).play();
                    }
                    markCurrent(randnr);
                    setTrackname(myPlayList[randnr]);
		} else {
			playListConfig( randnr );
		}
	}
        function markCurrent(index) {
            for (i=0; i<myPlayList.length; i++){
            	$("#radio_playlist_item_"+i).removeClass("playlist_current");
            }
		$("#radio_playlist_item_"+index).addClass("playlist_current");
        }
function playListConfig( index ) {
                markCurrent(index);
		playItem = index;
                $("#radio_player").setFile(myPlayList[playItem].mp3, myPlayList[playItem].mp3)
                setTrackname(myPlayList[playItem]);
	}

function setTrackname (trackObj) {
    var tmp = trackObj.band + " - " + trackObj.title + " (" + trackObj.laufzeit + ")";
    //TODO if too long strip string to meaningful substring
    $("#player_trackname").html(tmp);
}

function playListChange( index ) {
		playListConfig( index );
		$("#radio_player").play();
}

function playListNext() {

	var index = (playItem+1 < myPlayList.length) ? playItem+1 : 0;
	playListChange( index );

}

function playListPrev() {
/*
	var index = (playItem-1 >= 0) ? playItem-1 : myPlayList.length-1;
	playListChange( index );
*/
}
