function deletePlayer(theWrapper, thePlaceholder, thePlayerId) { 
	swfobject.removeSWF(thePlayerId);
	var tmp=document.getElementById(theWrapper);
	if (tmp) { tmp.innerHTML = "<div id=" + thePlaceholder + "></div>"; }
}

function createPlayer(thePlaceholder, thePlayerId, theFile, autoStart, width, height) {
	var flashvars = {
	        file:"upload/audio/"+theFile, 
	        autostart:autoStart
	}
	var params = {
	        allowfullscreen:"true", 
	        allowscriptaccess:"always",
	        wmode:"transparent"
	}
	var attributes = {
	        id:thePlayerId,  
	        name:thePlayerId
	}
	swfobject.embedSWF("lib/player.swf", thePlaceholder, width, height, "9", false, flashvars, params, attributes);
}


function initPlayer(thePlaceholder, thePlayerId, theFile, autoStart, width, height) { 
	deletePlayer('wrapper', thePlaceholder, thePlayerId); 
	createPlayer(thePlaceholder, thePlayerId, theFile, autoStart, width, height);
}