//播放
function play()
{
 if (player.controls.isavailable('play'))
 {
  userstop=false; //用户停止取消
  player.controls.play();
  musicSwf.SetVariable("musicName", RadioList[NowId]);
  
  
 }
}

//暂停
function pause()
{
 if (player.controls.isavailable('pause'))
 {
  player.controls.pause();
  clearInterval(state);
  musicSwf.SetVariable("musicName", "暂停");
 }
}

//停止
function stop()
{
 if (player.controls.isavailable('stop'))
 {
  userstop=true; //确认用户停止
  player.controls.stop();
  clearInterval(state);
  musicSwf.SetVariable("musicName", "停止");
 }
}

//前首
function previous()
{
NowId--;
if( NowId<0) NowId=count-1;
player.URL=listURL[NowId];
musicSwf.SetVariable("musicName", RadioList[NowId]);
play();
userstop=false; //用户停止取消
}

//后首
function next()
{
NowId++;
if( NowId>=count) NowId=0;
player.URL=listURL[NowId];
musicSwf.SetVariable("musicName", RadioList[NowId]);
play();	
userstop=false; //用户停止取消
}

//歌曲列表
function showmusiclist()
{
 document.getElementById('home').src='Music.Asp?JaUid='+JaUid;
}


function musicSwf_DOFSCommand(command,args){
	if (command=="Play"){
		play();
	}
	if (command=="Stop"){
		stop();
	}
	if (command=="Pause"){
		pause();
		
	}
	if (command=="next"){
		next();
	}
	if (command=="previous"){
		previous();
	}
	if (command=="gotoMusic") {
		showmusiclist();
	}
}



