var playing=0;

function triggerSound(no,url) {

	var theImage=document.getElementById("soundImage"+no);
	
	//image found
	if (theImage!=null) {
	
		//about to play
		if (theImage.src.indexOf("play.jpg")>0) {

			//already playing something
			if (playing>0) {
			
				//stop the current one
				triggerSound(playing,"");
			
			}

			var theWrapper=document.getElementById("soundWrapper");

			//wrapper found
			if (theWrapper!=null) {
			
				//start the sound
				theWrapper.innerHTML='<embed src="'+url+'" autostart="true" width="0" height="0" id="banquetSound'+no+'" enablejavascript="true" />';
				
				//change the image source
				theImage.src="graphics/listenbuttonstop.jpg";
			
				//remember what we're playing
				playing=no;
			
			}
				
		//about to stop
		} else {
		
			var theEmbed=document.getElementById("banquetSound"+no);

			//embed found
			if (theEmbed!=null) {
			
				//stop the sound
				theEmbed.Stop();
				
				//change the image source
				theImage.src="graphics/listenbuttonplay.jpg";
				
				//remember that we're not playing
				playing=0;

			}

		}

	}

}