
//This is the js variable which holds the element id of the pronunciation that is being played
var playing="not playing";

function playStopPron(elmPron, filename)
{  
	var elemetId = ""+elmPron.id;
			   //alert(elemetId);
    //Check if the current playing pronunciation is this one, 
    //if not, stop the other and start this.
    if(playing != elemetId)
    {   
		stopPron(playing);
		
        	ndPronounciation=document.getElementById("play"+elemetId);
		ndPronounciation.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '+
		'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"' +
		'width="1" height="1" id="player" align="middle"> '+
		'<param name="wmode" value="transparent" /> '+
		'<param name="flashVars" value="theLink='+filename+'" /> '+
		'<param name="movie" value="/decouverte/flash/wb_player.swf" /> '+
		'<param name="quality" value="high" /> '+
		'<embed src="/decouverte/flash/wb_player.swf" '+
		'flashVars="theLink='+filename+'"' +
		'autostart=false '+
		'quality="high" '+
		'wmode="transparent" '+
		'width="1" '+
		'height="1" '+
		'name="player" '+
		'align="middle" '+
		'allowScriptAccess="chi.worldbookonline.com" '+
		'type="application/x-shockwave-flash" '+
		'pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
		elmPron.src="/digitallibraries/images/au_stop.gif";	 
		//alert("filename="+ndPronounciation.innerHTML);
		playing=""+elemetId;
	}
	else
	{
	    stopPron(elemetId);
	}

}
function stopSound()
{
    //Nothing
}

function stopPron(pronId)
{
    ndPronounciation=document.getElementById("play"+pronId);
    if(ndPronounciation)
	ndPronounciation.innerHTML='';
    
    elmPlaying = document.getElementById(pronId);
    if (elmPlaying)
	elmPlaying.src="/digitallibraries/images/au_play.gif";
	playing="not playing";		
}

						
