
var count = 0;

function playspot() {
	count ++;
	//alert(count);
	
		if (count < 2) {
			document.getElementById("speaker").style.backgroundImage = "url(images/radio_off.png)";
			if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1) { 
				play_embed("true");
			}
			else {
				$(document).ready(function() {
					  $("#jpId").jPlayer( {
						ready: function () {
						  $(this).setFile("Spot_FAT.mp3").play(); // Defines the mp3
						}
					  });
					});
			}
		}
		else {
			document.getElementById("speaker").style.backgroundImage = "url(images/radio.png)";
			if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1) { 
				play_embed("false"); 
				count = 0;
			}
			else {
			$("#jpId").stop();
			count = 0;
			}
		}	
}

function play_embed(ap)
{
	document.getElementById( "jpId" ).innerHTML = '<embed src="Spot_FAT.mp3" audiostream="true" bufferingtime="0" hidden="true" type="audio/mpeg" autostart="' + ap + '"></embed>';
}


