function callSong(file, albumIndex, trackIndex)
{
	boolFlash = false;
	for (i = 0; i < navigator.plugins.length; ++i)
		if(navigator.plugins[i].name.indexOf("Flash") != -1)
			boolFlash = true;
	
	if(boolFlash){
		if(document.getElementById("playImg").innerHTML == ""){
			stopImg(file, albumIndex, trackIndex);
			playImg(file, albumIndex, trackIndex);
		}
		if(firefox){
			callSong_Firefox(file, albumIndex, trackIndex);
		}else{
			file = file.replace(/_/g, " ");
			document.getElementById("my_mp3Player").SetVariable("file", file);
			document.getElementById("radioInfo").style.visibility = "visible";
		}	
	}else{
		callErrorFlash();
	}
	
}

function callErrorFlash()
{
	var strOnClick = "newWindow('https://addons.mozilla.org/de/firefox/browse/type:7', 300, 200, 300, 300, 'yes', 'yes');";
	var strHtml = "";
	strHtml += "<font class=\"txtNormal\">To hear any music your browser should use the flash-plugin!</font>\n";
	document.getElementById("radioInfo").innerHTML = strHtml;
 	document.getElementById("radioInfo").style.visibility = "visible";
}

function callSong_Firefox(file, albumIndex, trackIndex)
{
	file = file.replace(/_/, " ");
	var strHtml = "";
	strHtml += "<PARAM NAME=movie VALUE=\"my_mp3Player_Firefox_a.swf\">\n";
 	strHtml += "<param name=\"allowScriptAccess\" value=\"always\">\n";
 	strHtml += "<PARAM NAME=quality VALUE=high>\n";
 	strHtml += "<PARAM NAME=bgcolor VALUE=#FFFFFF>\n";
 	strHtml += "<param name=\"wmode\" value=\"window\">\n";
 	strHtml += "<param name=\"FlashVars\" value=\"file=" + file + "&intStop=0\">\n";
 	strHtml += "<EMBED src=\"my_mp3Player_Firefox_a.swf\" quality=high bgcolor=#FFFFFF  WIDTH=\"314\" HEIGHT=\"17\" NAME=\"my_mp3Player\" allowScriptAccess=\"always\" FlashVars=\"file=" + file + "&intStop=0\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>\n";
 	document.getElementById("my_mp3Player").innerHTML = strHtml;
 	document.getElementById("radioInfo").style.visibility = "visible"
}

function callStop(file, albumIndex, trackIndex)
{
	if(firefox)
		callStop_Firefox(file, albumIndex, trackIndex);
	else
		document.getElementById("my_mp3Player").SetVariable("stop", "1");
}

function callStop_Firefox(file, albumIndex, trackIndex)
{
	file = file.replace(/_/, " ");
	var strHtml = "";
	strHtml += "<PARAM NAME=movie VALUE=\"my_mp3Player_Firefox_a.swf\">\n";
 	strHtml += "<param name=\"allowScriptAccess\" value=\"always\">\n";
 	strHtml += "<PARAM NAME=quality VALUE=high>\n";
 	strHtml += "<PARAM NAME=bgcolor VALUE=#FFFFFF>\n";
 	strHtml += "<param name=\"wmode\" value=\"window\">\n";
 	strHtml += "<param name=\"FlashVars\" value=\"file=" + file + "&intStop=1\">\n";
 	strHtml += "<EMBED src=\"my_mp3Player_Firefox_a.swf\" quality=high bgcolor=#FFFFFF  WIDTH=\"314\" HEIGHT=\"17\" NAME=\"my_mp3Player\" allowScriptAccess=\"always\" FlashVars=\"file=" + file + "&intStop=1\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>\n";
 	document.getElementById("my_mp3Player").innerHTML = strHtml;
 	document.getElementById("radioInfo").style.visibility = "visible"
}

function stopImg(file, albumIndex, trackIndex)
{
	var strHtml = "";
	strHtml += "<a href=\"#\" onClick=\"callStop('" +file+"',"+ albumIndex+","+ trackIndex+");\" class=\"trackLinks\">\n";
	strHtml += "<img src=\"grafix/stop.jpg\" width=8 heigth=8 border=0></a>";
	document.getElementById("stopImg").innerHTML = strHtml;
}

function playImg(file, albumIndex, trackIndex)
{
	var strHtml = "";
	strHtml += "<a href=\"#\" onClick=\"callSong('" +file+"',"+ albumIndex+","+ trackIndex+");\" class=\"trackLinks\">\n";
	strHtml += "<img src=\"grafix/play_1.jpg\" width=8 heigth=8 border=0></a>";
	document.getElementById("playImg").innerHTML = strHtml;
}