// JavaScript Document
function callAlbum(albumId, playerMode){
	var myIDinfo=albumId.split("-");
	requestAlbumPlaylist(myIDinfo[1], playerMode);
}

function requestAlbumPlaylist(myID, playerMode) {
	getFlashMovie("mp3Player").callAlbumPlaylist(myID, playerMode);
}	

function callRemix(trackId, playerMode){
	var myIDinfo=trackId.split("-");
	requestRemixPlaylist(myIDinfo[1], playerMode);
}

function requestRemixPlaylist(myID, playerMode) {
	getFlashMovie("mp3Player").callRemixPlaylist(myID, playerMode);
}	


function callAlbumPlaylist(albumId, playerMode){
	var myIDinfo=albumId.split("-");
	requestArtistPlaylist(myIDinfo[1], playerMode);
}


function callArtist(albumId, playerMode){
	var myIDinfo=albumId.split("-");
	requestArtistPlaylist(myIDinfo[1], playerMode);
}

function requestArtistPlaylist(myID, playerMode) { 
	getFlashMovie("mp3Player").callArtistPlaylist(myID, playerMode);
}



function callAlbumOrdered(myID, playerMode){
	var myIDinfo=myID.split("-");
	requestArtistPlaylistOrdered(myIDinfo[1], playerMode);
}

function requestArtistPlaylistOrdered(myID, playerMode) { 
	getFlashMovie("mp3Player").callAlbumPlaylistOrdered(myID, playerMode);
}

	
function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}



function callStop() {
	getFlashMovie("mp3Player").callStop();
}	
	


function changeToStop(myID, myText){
	$('.playTrack').addClass('playBtn').removeClass('stopBtn');
	$('#playBtn-'+myID).addClass('stopBtn').removeClass('playBtn');
	$('#playerText-'+myID).html(myText);
	
	$('#theMarquee').marquee('pointer').mouseover(function () {
	  $(this).trigger('stop');
	}).mouseout(function () {
	  $(this).trigger('start');
	}).mousemove(function (event) {
	  if ($(this).data('drag') == true) {
		this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
	  }
	}).mousedown(function (event) {
	  $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
	}).mouseup(function () {
	  $(this).data('drag', false);
	});
	
	
	}
	
function changeToPlay(myID){
	$('#playBtn-'+myID).removeClass('stopBtn');
	$('#playBtn-'+myID).addClass('playBtn');


 	$(".pointer").trigger("stop");


	$(".pointer").unbind();
	//$('#playerText-'+myID).html('Listen');
	
	$('.miniPlayerArea').html('<span id="theMarquee" behavior="scroll" scrollamount="1" direction="left" width="100"><span id="playerText-'+myID+'" class="marqueeText">Listen</span></span>');
	$('.largePlayerArea').html('<span><span id="playerText-'+myID+'" class="marqueeText">Listen</span></span>');
	
	}	


function changeToStopPL(myID){
	$('.stopBtnSmall').hide();
	$('.playListStop').hide();

	$('#playBtn-'+myID).show();
	$('#playListStop-'+myID).show();
	
	}
	
function changeToPlayPL(myID){
	$('.stopBtnSmall').hide();
	$('.playListStop').hide();
	//$('#playListListen-'+myID).show();
	
	}


function refreshPlaylist(myID){
	$('.stopBtnSmall').hide();
	$('.playListStop').hide();

	$('#playBtn-'+myID).show();
	$('#playListStop-'+myID).show();
	
	}