var SoundList = new Array();

SoundList[0] = "once";
SoundList[1] = "wave";
SoundList[2] = "nowhere";
SoundList[3] = "nomoney";
SoundList[4] = "life";
SoundList[5] = "comebaby"
SoundList[6] = "life"
SoundList[7] = "comebaby"

var embedString = '<embed src="mp3/[%filename%].mp3" width="80" height="20" autoplay="true" controller="true" kioskmode="true"></embed>';
var LinkString ='<a href="javascript:play(\'[%index%]\');">listen</a>';

function play(callID)
{
	
	if(document.getElementById)
	{
		
		// reset all players
		
		var i = 0;
		
		while(document.getElementById("audio_"+i))
		{
			var tempSpanID = "audio_"+i;
			tempResetString = LinkString.replace(/\[%index%\]/,i);
			document.getElementById(tempSpanID).innerHTML = tempResetString;
			i++;
			if(i>100) break;
		}
		
		
		//start selected player
		
		var tempString = embedString.replace(/\[%filename%\]/,SoundList[callID]);
		var tempID = "audio_"+callID;
		
		document.getElementById(tempID).innerHTML = tempString;
	
	}
	else alert("Your Browser does not support required functions!");
	
	
	
}