// JavaScript Document
	var curPlayInstance;
	
	function onSpeakerClick(n, url)
	{
		var ins = document.all[n];
		
		if(ins.state == 1)
		{
			// if already playing, stop it
			ins.state = 0;
			ins.src = "../speaker_stop.gif";
			stopMP3();
		}
		else
		{
			// set stop state of previous playing instance
			if(curPlayInstance != undefined)
			{
				curPlayInstance.state = 0;
				curPlayInstance.src = "../speaker_stop.gif";
			}
			
			// playing
			ins.state = 1;
			ins.src = "../speaker_play.gif";
			curPlayInstance = ins;
			playMP3(url);
		}
	}
	
	function onSpeakerRollOut(n)
	{
		var ins = document.all[n];
		
		if(ins.state == 0)
		{
			ins.src = "../speaker_stop.gif";
		}
	}
	
	function onSpeakerRollOver(n)
	{
		var ins = document.all[n];
	
		if(ins.state == undefined)
			ins.state = 0;
		
		if(ins.state == 0)
		{
			ins.src = "../speaker_over.gif";
		}
	}
	
	function playMP3(url)
	{
		thisMovie("BasicMP3PushstreamPlayer").SetVariable('/:url', url);
	}
	
	function stopMP3()
	{
		thisMovie("BasicMP3PushstreamPlayer").SetVariable('/:state', 'stop');
	}
	
	function playerStateChange(newState)
	{
		if(newState == "stopped" || newState == "paused")
		{
			curPlayInstance.state = 0;
			curPlayInstance.src = "../speaker_stop.gif";
		}
		else if(newState == "playing")
		{
			curPlayInstance.state = 1;
			curPlayInstance.src = "../speaker_play.gif";
		}
	}
	
	function thisMovie(movieName)
	{
		if (navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName]
		}
		else {
			return document[movieName]
		}
	}