/***************************/
//@Author: Adrian "yEnS" Mato Gondelle
//@website: www.yensdesign.com
//@email: yensamg@gmail.com
//@license: Feel free to use it, but keep this credits please!					
/***************************/

$().ready(function(){
	//SETUP Mp3 files player example
	var status = document.getElementById("audioStatus").value;

	var filePath = document.getElementById("audioPath").value;
	var playerMp3 = new SWFObject("images/player.swf","myplayer1","0","0","9");
	playerMp3.addVariable("file",filePath);
	playerMp3.addVariable("icons","false");
	playerMp3.write("player1");
	//create a javascript object to allow us send events to the flash player
	var player1 = document.getElementById("myplayer1");
	var mute1 = 0;
	var status1 = $("#status1");
	
	//EVENTS for Mp3 files player
	$("#play1").click(function(){
		if (document.getElementById("audioStatus").value == "STOP"){
			player1.sendEvent("PLAY","true");
			document.getElementById("audioStatus").value = "PLAY";
			document.getElementById("play1").className = "stopbtn handcur";
		}
		else{
			player1.sendEvent("STOP","true");
			document.getElementById("audioStatus").value = "STOP";
			document.getElementById("play1").className = "playbtn handcur";
		}
	});
});

function playAudio(artistId, cntId) {

	var status = document.getElementById("audioStatus").value;

	var filePath = document.getElementById("lstRiddimId_" + artistId + "_" + cntId).value;

	var playerMp3 = new SWFObject("images/player.swf","myplayer1","0","0","9");
	playerMp3.addVariable("file",filePath);
	playerMp3.addVariable("icons","false");
	playerMp3.write("player1");
	
	//create a javascript object to allow us send events to the flash player
	var player1 = document.getElementById("myplayer1");
		
	if (artistId != 0){
		setTimeout("document.getElementById('myplayer1').sendEvent('PLAY','start')", 2000);
	}
}