// install flowplayer into container
$f("audio", "http://www.alexchu.com/travel/india/flowplayer-3.2.1.swf", {

	onLoad: function() {
		this.setVolume(80);
	}, 

playlist: [
			{url: 'http://www.alexchu.com/midi/04.mp3', image: false},
			{url: 'http://www.alexchu.com/midi/04.mp3', image: false, 	
			onBeforeFinish: function() {
				return false; 
			}}
],



	// fullscreen button not needed here
	plugins: {
		controls: {
			fullscreen: false,
			height: 1,
			autoHide: false,
			time: false
		}
	},

	clip: {
		autoPlay: true,
		
	// optional: when playback starts close the first audio playback
	onBeforeBegin: function() {
			$f("player").close();
		}


	}

});


		function offme(ima) {
				if ($f().isPlaying() == true) {
					 	$f().stop();		
				
						// divides the path
						nr = ima.getAttribute('src').split('/');
						// gets the last part of path, ie name
						nr = nr[nr.length-1]
						// former was .split('.')[0];
 
						ima.setAttribute('src',root+namesVec[1]);
						document.getElementById('a').innerHTML='&nbsp; Music {OFF}';
						
				} 				
		}


		function stopme() {
				if ($f().isPlaying() == true) {
					 	$f().stop();
						
						// alert("True");

				} else {
						$f().play();
						// alert("False");
				}
				
		}


var namesVec = new Array("sound_on.png", "sound_off.png");
var root ='/images/';
function swapImg(ima){
// divides the path
nr = ima.getAttribute('src').split('/');
// gets the last part of path, ie name
nr = nr[nr.length-1]
// former was .split('.')[0];
 
if(nr==namesVec[0]){
		ima.setAttribute('src',root+namesVec[1]);
		document.getElementById('a').innerHTML='&nbsp; Music {OFF}';
	}
else {
		ima.setAttribute('src',root+namesVec[0]);
		document.getElementById('a').innerHTML='&nbsp; Music {ON}';
	}



}