
//***********************FOR MP2 PLAYER ************************/

	function play_mp3_home(url,node,p2)
	{

		// stop current mp3 player
		document.getElementById("myFlash_home").SetVariable("player:jsStop", "");

		if(node.className=="voidOn")
		{ 
			
			//stop live radio before play music
			stop_live_radio("",document.getElementById("button_id"));		
					
			// Change the url
			document.getElementById("myFlash_home").SetVariable("player:jsUrl", url);
			//play music
			document.getElementById("myFlash_home").SetVariable("player:jsPlay", "");	
			
			//reset all button become on
			reset_all_listening_button()
			
			//change current style
			node.className="voidOff";
			
			
		}else{
			node.className="voidOn";
		}
	}
	
	function reset_all_listening_button(){
	
		//clear all ttdb button
		for(i=1;i<50;i++){
			var objButton = document.getElementById("ttdb_"+i);
			if(objButton!=null) objButton.className ="voidOn";
		}
		
		//clear all tmds button
		for(i=1;i<50;i++){
			var objButton = document.getElementById("tmds_"+i);
			if(objButton!=null) objButton.className ="voidOn";
		}		
	
	}
	
	
//***********************FOR LIVE RADIO PLAYER************************/

		function play_live_radio(url,node){
			
			//reset all mp3 button become on
			reset_all_listening_button();
		
			//stop mp3 player		
			document.getElementById("myFlash_home").SetVariable("player:jsStop", "");

			
			if(node.className == "start_listening") start_live_radio(url,node);
			else	stop_live_radio(url,node);
		}
		
		
		
		function stop_live_radio(url,node)
		{
				document.getElementById("nghe").innerHTML = "<div style=\"float:left; width:253px; height:50px;\"><img src=\"img/bgNghe_01.png\" width=\"30\" height=\"50\" /><img src=\"img/btmLive.png\" width=\"223\" height=\"50\" /></div></span>";
				node.className = "start_listening";
				if(document.getElementById("btm_nghe1")!=null)
				{
					document.getElementById("btm_nghe1").className='voidOn';
				}
				url="";
				stop(url);
		}
		
		function start_live_radio(url,node)
		{
				document.getElementById("nghe").innerHTML = "<div  style=\"float:left;width:253px; height:50px;\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" height=\"50px\" width=\"253px\"> <param name=\"movie\" value=\"img/btt-live2.swf\"><param name=\"quality\" value=\"high\"><embed src=\"img/btt-live2.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" height=\"50px\" width=\"253px\"></object></div>";
				node.className = "stop_listening";
				if(document.getElementById("btm_nghe1")!=null)
				{
					document.getElementById("btm_nghe1").className='voidOff';
				}

				play(url);
		}
		

		function play(url)
		{
	 
	 		var div =document.createElement('div');
			div.innerHTML = "<div  id=\"flashcontent\" ></div>";
						
			document.getElementById("body").appendChild(div.firstChild);
			var so = new SWFObject("img/nativeradio.swf", "nativeradio", "149", "0", "0", "#cccccc");
		
			so.addParam("scale", "noscale");
		
			so.addVariable("swfcolor", "b89e7a");
		
			so.addVariable("swfexclusive", "1");
		
			so.addVariable("swfstreamurl", url);
		
			so.addVariable("swfpause", "0");
		
			so.write("flashcontent");


		}
	
	function stop(url)
	{
	 
	 
		var div =document.createElement('div');
		div.innerHTML = "<div  id=\"flashcontent\" ></div>";
					
		document.getElementById("body").appendChild(div.firstChild);
		var so = new SWFObject("img/nativeradio.swf", "nativeradio", "149", "0", "0", "#cccccc");
	
		so.addParam("scale", "noscale");
	
		so.addVariable("swfcolor", "b89e7a");
	
		so.addVariable("swfexclusive", "1");
	
		so.addVariable("swfstreamurl", url);
	
		so.addVariable("swfpause", "0");
	
		so.write("flashcontent");


	}
		

