function playerInit() {
	//check if player frame is loaded and start animation
	if (parent.topFrame.wimpyIsReady !== 1) {
		setTimeout("playerInit()", 10);
	} else {
		if (parent.topFrame.wimpy_amReady_ask() !== true) {
			setTimeout("playerInit()", 10);
		} else {
			//check player state
			if (parent.topFrame.wimpy_getPlayerState().status == 1) {
				//player state is playing, start throbber and scroll song title
				//alert('player is playing');
				getFlashMovie("trdplayer").startAnimation();
				setSongTitle("Now Playing: " + parent.topFrame.wimpy_getTrackInfo().title);
			} else {
				//alert('player is not playing');
				getFlashMovie("trdplayer").stopAnimation();
				setSongTitle("Music Stopped.");
			}
		}
	}
}

function getFlashMovie(objectId) {
	//return (window[objectId]) ? window[objectId] : document[objectId];
//	if (window.document[objectId]) {
//		return window.document[objectId];
//	}
	if (navigator.appName.indexOf("Microsoft Internet")==-1) {
		if (document.embeds && document.embeds[objectId]) {
			return document.embeds[objectId];
		}
	} else {
		return document.getElementById(objectId);
	}
}

function getSongTitle() {
	return parent.topFrame.wimpy_getTrackInfo().title;
}

function setSongTitle(title) {
	getFlashMovie("trdplayer").scrollText(title);
}

function skipBack() {
	parent.topFrame.wimpy_prev();
	setSongTitle('Now Playing: ' + getSongTitle());
}

function startPlayback() {
	parent.topFrame.wimpy_play();
	setSongTitle('Now Playing: ' + getSongTitle());
}

function pausePlayback() {
	parent.topFrame.wimpy_pause();
	setSongTitle('Paused: ' + getSongTitle());
}

function stopPlayback() {
	parent.topFrame.wimpy_stop();
	setSongTitle('Stopped: ' + getSongTitle());
}

function skipForward() {
	parent.topFrame.wimpy_next();
	setSongTitle('Now Playing: ' + getSongTitle());
}
