// JavaScript Document

var currentPosition = 0; 
var currentVolume = 80; 

var players = new Array();
var player = null; 
function playerReady(thePlayer) {
	players.push(thePlayer);	
}
function positionListener(obj) { 
	currentPosition = obj.position; 
	var tmp = document.getElementById("posit");
	if (tmp) { tmp.innerHTML = "position: " + currentPosition; }
}
function createPlayer(swfPlayer,path,img,vId,vContainer,p) {
	var flashvars = {
		id:vId,
		file:path,
		image:img,
		repeat:"always",
		controlbar:"over",
		skin:"flash/skin.swf",
		autostart:p
	}

	var params = {
		allowfullscreen:"true", 
		allowscriptaccess:"always",
		allownetworking:"all",
		wmode:"transparent"
	}

	var attributes = {
		id:vId,  
		name:vId
	}
	//players.push(vId);
	swfobject.embedSWF(swfPlayer, vContainer, "656", "250", "10", false, flashvars, params, attributes);
}
function createPlayer_d(swfPlayer,path,img,vId,w,h,vContainer,p) {
	var flashvars = {
		file:path,
		image:img,
		repeat:"always",
		controlbar:"over",
		skin:"flash/skin.swf",
		autostart:p
	}

	var params = {
		allowfullscreen:"true", 
		allowscriptaccess:"always",
		allownetworking:"all",
		wmode:"transparent"
	}

	var attributes = {
		id:vId,  
		name:vId
	}
	swfobject.embedSWF(swfPlayer, vContainer, w, h, "10", false, flashvars, params, attributes);
}
function stopVideos(){
	for(var i=0;i<players.length;++i){
		var m=players[i];
		document.getElementById(String(m.id)).sendEvent('STOP');			
	}		
}
						 
