
var player_anchura = '1';
var player_altura  = '1';
var player_nombre  = 'js/mediaplayer/player.swf';
var flash_version  = '9.0.115';
var flashvars = {
//  	file		: 'sonidos/bleep2.mp3'
	autostart	: 'false'	
,   resizing	: 'false'
,	width		: player_anchura
,	height		: player_altura
,	volume		: '50'
//,	image 		: WEB_RAIZ + '/Multis/Videos/cat.png'
//,	plugins		: 'viral'
}
var params = {
	allowscriptaccess	: 'always'
}
var attributes = {
	id	: "player1"  
,	name: "player1"
}

swfobject.embedSWF(player_nombre, "mediaspace", player_anchura, player_altura, flash_version, false, flashvars, params, attributes);

function play(sonido) {

  	var player = document.getElementById(attributes.id);

  	player.sendEvent("LOAD",'sonidos/' + sonido + '.mp3');
	player.sendEvent("PLAY","true");
	
}						  	

//--------------------------------------------------------------------------------------------
var fondo1 = getElement('fondo1');
var fondo2 = getElement('fondo2');
var fondo3 = getElement('fondo3');

var efecto1 = MochiKit.Visual.appear;
var efecto2 = MochiKit.Visual.fade;
var opciones_u = {'sync' : 'true', 'duration': 10, 'delay': 0.0} ; 

var opciones_d = opciones_u;
opciones_d['duration'] = 5;

var opciones_g = {'duration': 45, 'fps': 12, 'afterFinish': function(){bucleAnimacionFondo();} }
opciones_g['duration'] = (opciones_u['duration'] * 3) + (opciones_d['duration'] * 3)

function bucleAnimacionFondo() {
	animacionFondo();
}	

function animacionFondo() {
	
	Sequence( [ 
	          	efecto1(fondo1,	opciones_u ) 
	          ,	efecto2(fondo1,	opciones_d ) 
	          ,	efecto1(fondo2,	opciones_u ) 
	          ,	efecto2(fondo2,	opciones_d ) 
	          ,	efecto1(fondo3,	opciones_d ) 
	          ,	efecto2(fondo3,	opciones_u ) 
	          ] , opciones_g  );

}

//--------------------------------------------------------------------------------------------

connect(window,'onload', bucleAnimacionFondo);