var videosCollection = new Array();
function buildVideos() {
	$("span.video").each(function(){
			var id = $(this).attr("id");
			var file =  $(this).text();

			var flashvars = new Object();
			flashvars.lg = langue;
			flashvars.path = path; //path
			flashvars.file = file;
			flashvars.id = id;
			var params = new Object();
			params.menu = "false";
			params.wmode = "transparent";
			params.allowFullScreen ="true";
			params.allowScriptAccess ="always";
			var attributes = new Object();
			attributes.name = id;
			
			swfobject.embedSWF("swfs/player.swf", id, 280, 210, "9.0.0", "", flashvars, params, attributes);
			videosCollection.push(id);
	});
}
function stopAllVideos() {
	if (videosCollection.length==0) return;
	for(var i=0; i < videosCollection.length; i++) {
		var flashMovie = document.getElementById(videosCollection[i]);
		if (typeof(flashMovie.stopVideo) != "undefined") flashMovie.stopVideo();
	}
}
function stopOtherVideos(execeptionId) {
	if (videosCollection.length==0) return;	
	for(var i=0; i < videosCollection.length; i++) {
		if (videosCollection[i] != execeptionId) {
			var flashMovie = document.getElementById(videosCollection[i]);
			if (typeof(flashMovie.stopVideo) != "undefined") flashMovie.stopVideo();
		}
	}
}

