
$(document).ready(function() {
	
	flowplayer("a.myPlayer", "/flash/flowplayer-3.2.5.swf", {
		// this is the player configuration. You'll learn on upcoming demos.
		plugins:  {
			controls:  {
				volume: false		
			}
		}
	});
	initFlowplayer();
	
	$(".myPlayer").each(function(event) {
    	var flv = this.href;
    	//var bgimage = $(this).attr("image");
    	var mediatype = $(this).attr("mediatype");
    	var myType = "audio";
    	
    	if(mediatype == "mp3"){
    		myType = "audio";
    	}
    	
    	//if(mediatype == "mp3" && bgimage == ""){
    	//	bgimage = "/gfx/flowplayer_audio_bg_" + activeLanguage + ".gif";
    	//}
    	
		flowplayer(this, {
			src: "/flash/flowplayer-3.2.3.swf",
			version: [9, 115],
			onFail: function()  {
				document.getElementById("info").innerHTML =
					"You need the latest Flash version to view MP4 movies. " +
					"Your version is " + this.getVersion()
				;
			}
		}, {
			clip:{
				autoPlay: false
				,url:flv
				,type:myType
			}, plugins: {
				controls: {
					autoHide: false
					,fullscreen:false
					,height:25
				}
			}
			
		});
    });
});

function initFlowplayer() {
	$(".flowplayer").each(function(event) {
    	var flv = this.href;
    	//if(mediatype == "mp3" && bgimage == ""){
    	//	bgimage = "/gfx/flowplayer_audio_bg_" + activeLanguage + ".gif";
    	//}
    	
		f = flowplayer(this, {
			src: "/flash/flowplayer-3.2.3.swf",
			version: [9, 115],
			onFail: function()  {
				document.getElementById("info").innerHTML =
					"You need the latest Flash version to view MP4 movies. " +
					"Your version is " + this.getVersion()
				;
			}
		}, {
			clip:{
				autoPlay: true
				,url:flv
			}
		});
    });
}
