/***********************
* Acciones de composición de Adobe Edge Animate
*
* Editar este archivo con precaución, teniendo cuidado de conservar 
* las firmas de función y los comentarios que comienzan con "Edge" para mantener la 
* capacidad de interactuar con estas acciones en Adobe Edge Animate
*
***********************/
(function($, Edge, compId){
var Composition = Edge.Composition, Symbol = Edge.Symbol; // los alias más comunes para las clases de Edge

   //Edge symbol: 'stage'
   (function(symbolName) {
      
      
      

      

      

      

      

      

      Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         sym.$('.center-wrapper').css("overflow","hidden");
         
         //Variables de colores
         sym.setVariable("fondo", "rgba(200,200,200,0.0)");
         sym.setVariable("colorbad", "rgba(50,230,60,0.4)");
         sym.setVariable("fondobad", "rgba(231,50,60,0.4)");
         sym.setVariable("fondook", "rgba(50,230,60,0.4)");
         sym.setVariable("fondoini", "rgba(244,244,244,0)");
         
         //Cambiar por la cantidad de elementos arrastrables
         TotalDragElements = 5;
         
         //Cambiar por la cantidad de elementos droppables o de destino
         TotalDropElements = 1;
         
         // Determino las respuestas correctas para cada drop en la actividad
         var dontTouch = 0;
         var Rd1 = new Array(1,dontTouch); 
         sym.setVariable("RespDrop1", Rd1);
         var Rd2 = new Array(2,3,dontTouch); 
         sym.setVariable("RespDrop2", Rd2);
         var Rd3 = new Array(3,dontTouch); 
         sym.setVariable("RespDrop3", Rd3);
         var Rd4 = new Array(4,dontTouch); 
         sym.setVariable("RespDrop4", Rd4);
         var Rd5 = new Array(5,dontTouch); 
         sym.setVariable("RespDrop5", Rd5);
         var Rd6 = new Array(6,dontTouch); 
         sym.setVariable("RespDrop6", Rd6);
         var Rd7 = new Array(7,dontTouch); 
         sym.setVariable("RespDrop7", Rd7);
         var Rd8 = new Array(8,dontTouch); 
         sym.setVariable("RespDrop8", Rd8);
         var Rd9 = new Array(9,dontTouch); 
         sym.setVariable("RespDrop9", Rd9);
         var Rd10 = new Array(10,dontTouch); 
         sym.setVariable("RespDrop10", Rd10);
         
         // Funcion para verificar las respuestas de cada drop
         function verificarRespuestas(RespuestaDrop,idActiveDrag){
         	var respDrop=0;
         
         	var idResp = idActiveDrag.slice(11);	
         	var vectorResp = sym.getVariable(RespuestaDrop);	
         	var respTemp = vectorResp.indexOf(parseInt(idResp));
         	if(respTemp != -1){
         		respDrop = 1;
         	}
         	else{
         		respDrop = 0;		
         	}	
         	return respDrop;	
         }
         
         for(var i=1; i<=TotalDragElements; i++){
         	sym.setVariable("left"+i, sym.$("Drag_"+i).css("left"));
         	sym.setVariable("top"+i, sym.$("Drag_"+i).css("top"));
         }
         
         for(var i=1; i<=50; i++){
            sym.setVariable("DropVar"+i, 0); 
         }
         
         function matrixToArray(matrix) {
             var scaleVars = matrix.substr(7, matrix.length - 8).split(', ');
             return scaleVars[0];
         }
         
         function calcularDimensiones(){
         	anchoDrag = parseInt($(this).width()/2);
         	altoDrag = parseInt($(this).height()/2);
         	console.log(anchoDrag);	
         	$(this).draggable({
         		cursorAt:{top: altoDrag, left: anchoDrag}
         	});
         }
         
         //Centrar el cursos en el elemento-cambiar por la mitad del ancho y alto
         //sym.$('[id^="Stage_Drag_"]').draggable({ cursorAt: { top: 20, left: 20 } });
         
          sym.$('[id^="Stage_Drag_"]').draggable({
         	//axis: ["x","y"], 
         	appendTo: "body",
         	containment: '#Stage', 
         	opacity: 0.4,
         	iframeFix: true,
         	zIndex: 100,
         	cursor:'move',		
         	refreshPositions: true,
         	//snap:true,
         	//snapMode: "both",
         	//snapTolerance:20,
         	scroll:false,
         	//helper: "clone",
         	revert: "invalid",
         	revertDuration: 500,
         
         	helper: function() {
         		var escalaTemp = $('#Stage').css('transform');
         		var escala = matrixToArray(escalaTemp);
               var helper = $(this).clone(); 
               helper.css({
             	"transform":"scale("+escala+")",
             	"-o-transform":"scale("+escala+")",
             	"-ms-transform":"scale("+escala+")",
             	"-webkit-transform":"scale("+escala+")",
             	"-moz-transform":"scale("+escala+")",
             	"-o-transform":"scale("+escala+")",
             	"-moz-transform-origin":"left top",
         		"-webkit-transform-origin":"left top",
         		"-o-transform-origin":"left top",
         		"-ms-transform-origin":"left top",
             	});        
               return helper;
            }
         });
         
         
         
         
         	sym.$('[id^="Stage_Drop_"]').droppable({
         		drop: function( event, ui ){
         			var DropIdtemp=$(this).prop("id");	
         			var DropId = DropIdtemp.slice(11);	
         			var respDroppable=0;	 	
         			sym.setVariable("DropVar"+DropId, verificarRespuestas("RespDrop"+DropId,ui.draggable.attr('id')));
               	coordenadas("Drop_"+DropId, ui.draggable.attr('id').slice(6));	
            	}
            });	
         
             function coordenadas (Drop, simbolo) {
                varxdrop = sym.$(Drop).css("left");
                varydrop = sym.$(Drop).css("top");
                varxdropanch = sym.$(Drop).css("width");
                varydropalto = sym.$(Drop).css("height");
                varxdropcentro = parseInt(varxdrop) + parseInt(varxdropanch)/2;
                varydropcentro = parseInt(varydrop) + parseInt(varydropalto)/2;
                varxdraganch = sym.$(simbolo).css("width");
                varydragalto = sym.$(simbolo).css("height");
                varxdragcentro = parseInt(varxdraganch)/2;
                varydragcentro = parseInt(varydragalto)/2;
                sym.$(simbolo).css({top: varydropcentro-varydragcentro});
                sym.$(simbolo).css({left: varxdropcentro-varxdragcentro});
                };

      });
      //Edge binding end

      

      

      

      

      

      

      

      

      Symbol.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {
         //botones
         sym.getSymbol("bt_reiniciar").stop("normal");
         sym.getSymbol("bt_ayuda").stop("normal");
         sym.$("hotspot_reiniciar").show();
         sym.$("hotspot_ayuda").show();
         
         //	Copiar la siguiente función para las correcciones del material anterior
         //	Esta función permite que los elementos no se solapen
         
         // Se establece el atributo vacio para todos los elementos droppables
         sym.$('[id^="Stage_Drop_"]').attr("dragelement","vacio");
         
         		 $(".ui-droppable").on( "drop", function( event, ui ) {
         		 	// Verifico el estado del drop (ocupado o vacio)
         					var estadoDrop = $(this).attr("dragelement");
         
         					// 
         					if(estadoDrop != "vacio"){										
         						var numDrag = estadoDrop.slice(11);	
         						var posLeftDrag = sym.getVariable("left"+numDrag);
         						var posTopDrag = sym.getVariable("top"+numDrag);
         						sym.$("#"+estadoDrop).animate({top: posTopDrag, left: posLeftDrag});
         						var idDraggable = ui.draggable.attr('id');
         						$(this).attr("dragelement",idDraggable);
         					} else{
         						var idDraggable = ui.draggable.attr('id');
         						$(this).attr("dragelement",idDraggable);
         					}
         
         		 } );
         
         		 $(".ui-droppable").droppable({	
         				out: function( event, ui ){ 
         					var estadoDrop = $(this).attr("dragelement");
         					var idDraggable = ui.draggable.attr('id');
         					if(estadoDrop == idDraggable ){	
         						$(this).attr("dragelement","vacio");					
         					}
         					else{						
         					}
         				}
         		 });
         
         
         //BOTÓN REINICIAR
         sym.$('hotspot_reiniciar').click(function(){
         $("[class*='dragged']").remove();
         margenIzq = 5;
         counter = 0;
         //botones
         sym.getSymbol("bt_reiniciar").stop("normal");
         sym.$("hotspot_reiniciar").hide();
         sym.$('[id^="Stage_Drop_"]').attr("dragelement","vacio");
         
         var colorini = sym.getVariable("colorini");
         var fondoini = sym.getVariable("fondoini");
         var tipoactividad = sym.getVariable("tipoactividad");
         
         for(var i=1; i<=TotalDragElements; i++){
         	var topDrag = sym.getVariable("top"+i);
         	var leftDrag = sym.getVariable("left"+i);
         	sym.$("Drag_"+i).css({top: topDrag, left: leftDrag});
         	sym.$("Drag_"+i).draggable ({
         		disabled: false
         	});
         	//sym.$("Drop_"+i).css({color: colorini ,background: fondoini});
         	sym.setVariable("DropVar"+i, 0);
         }
         
         sym.$('[id^="Stage_Drop_"]').css({background: fondo});
         });
         
         //BOTÓN AYUDA
         sym.$('hotspot_ayuda').click(function(){
         // Definir un conmutador para ocultar o mostrar un elemento 
         if (sym.$("help").is(":visible")) {
         	sym.$("help").hide();
         	sym.getSymbol("bt_ayuda").stop("normal");
         } else {
         	sym.$("help").show();
         	sym.getSymbol("bt_ayuda").stop("down");
         }
         });
         // AYUDA
         sym.$('help').click(function(){
         sym.$("help").hide();
         sym.getSymbol("bt_ayuda").stop("normal");
         });

      });
      //Edge binding end

      

      Symbol.bindElementAction(compId, symbolName, "${_Drag_1}", "mousedown", function(sym, e) {
         sym.getSymbol("pop_1").play(0001);
         sym.$("Drag_2").fadeOut("slow");
         sym.$("Drag_3").fadeOut("slow");
         sym.$("Drag_4").fadeOut("slow");
         sym.$("Drag_5").fadeOut("slow");
         sym.$("hotspot_ayuda").fadeOut("slow");
         sym.$("hotspot_reiniciar").fadeOut("slow");
         sym.$("bt_ayuda").fadeOut("slow");
         sym.$("bt_reiniciar").fadeOut("slow");
         sym.$("bt_audio").fadeOut("slow");
         sym.$("audio_2")[0].pause();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_Drag_2}", "mousedown", function(sym, e) {
         sym.getSymbol("pop_2").play(0001);
         sym.$("Drag_1").fadeOut("slow");
         sym.$("Drag_3").fadeOut("slow");
         sym.$("Drag_4").fadeOut("slow");
         sym.$("Drag_5").fadeOut("slow");
         sym.$("puntos").fadeOut("slow");
         sym.$("nino").fadeOut("slow");
         sym.$("nina").fadeOut("slow");
         sym.$("hotspot_ayuda").fadeOut("slow");
         sym.$("hotspot_reiniciar").fadeOut("slow");
         sym.$("bt_ayuda").fadeOut("slow");
         sym.$("bt_reiniciar").fadeOut("slow");
         sym.$("bt_audio").fadeOut("slow");
         sym.$("audio_2")[0].pause();
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_Drag_3}", "mousedown", function(sym, e) {
         sym.getSymbol("pop_3").play(0001);
         sym.$("Drag_1").fadeOut("slow");
         sym.$("Drag_2").fadeOut("slow");
         sym.$("Drag_4").fadeOut("slow");
         sym.$("Drag_5").fadeOut("slow");
         sym.$("puntos").fadeOut("slow");
         sym.$("hotspot_ayuda").fadeOut("slow");
         sym.$("hotspot_reiniciar").fadeOut("slow");
         sym.$("bt_ayuda").fadeOut("slow");
         sym.$("bt_reiniciar").fadeOut("slow");
         sym.$("bt_audio").fadeOut("slow");
         sym.$("audio_2")[0].pause();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_Drag_4}", "mousedown", function(sym, e) {
         sym.getSymbol("pop_4").play(0001);
         sym.$("Drag_2").fadeOut("slow");
         sym.$("Drag_3").fadeOut("slow");
         sym.$("Drag_1").fadeOut("slow");
         sym.$("Drag_5").fadeOut("slow");
         sym.$("nino").fadeOut("slow");
         sym.$("nina").fadeOut("slow");
         sym.$("hotspot_ayuda").fadeOut("slow");
         sym.$("hotspot_reiniciar").fadeOut("slow");
         sym.$("bt_ayuda").fadeOut("slow");
         sym.$("bt_reiniciar").fadeOut("slow");
         sym.$("bt_audio").fadeOut("slow");
         sym.$("audio_2")[0].pause();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_Drag_5}", "mousedown", function(sym, e) {
         sym.getSymbol("pop_5").play(0001);
         sym.$("Drag_2").fadeOut("slow");
         sym.$("Drag_3").fadeOut("slow");
         sym.$("Drag_1").fadeOut("slow");
         sym.$("Drag_4").fadeOut("slow");
         sym.$("nino").fadeOut("slow");
         sym.$("nina").fadeOut("slow");
         sym.$("hotspot_ayuda").fadeOut("slow");
         sym.$("hotspot_reiniciar").fadeOut("slow");
         sym.$("bt_ayuda").fadeOut("slow");
         sym.$("bt_reiniciar").fadeOut("slow");
         sym.$("bt_audio").fadeOut("slow");
         sym.$("audio_2")[0].pause();

      });
      //Edge binding end

   })("stage");
   //Edge symbol end:'stage'

   //=========================================================
   
   //Edge symbol: 'Precargador'
   (function(symbolName) {   
   
   })("Precargador");
   //Edge symbol end:'Precargador'

   //=========================================================
   
   //Edge symbol: 'ok'
   (function(symbolName) {   
   
   })("ok");
   //Edge symbol end:'ok'

   //=========================================================
   
   //Edge symbol: 'bad'
   (function(symbolName) {   
   
   })("bad");
   //Edge symbol end:'bad'

   //=========================================================
   
   //Edge symbol: 'bt_validar'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

   })("bt_validar");
   //Edge symbol end:'bt_validar'

   //=========================================================
   
   //Edge symbol: 'bt_solucion'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

   })("bt_solucion");
   //Edge symbol end:'bt_solucion'

   //=========================================================
   
   //Edge symbol: 'bt_reiniciar'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

   })("bt_reiniciar");
   //Edge symbol end:'bt_reiniciar'

   //=========================================================
   
   //Edge symbol: 'bt_ayuda'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

   })("bt_ayuda");
   //Edge symbol end:'bt_ayuda'

   //=========================================================
   
   //Edge symbol: 'nina'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.play();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1500, function(sym, e) {
         sym.playReverse();

      });
      //Edge binding end

   })("nina");
   //Edge symbol end:'nina'

   //=========================================================
   
   //Edge symbol: 'nino'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.play();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2500, function(sym, e) {
         sym.playReverse();

      });
      //Edge binding end

   })("nino");
   //Edge symbol end:'nino'

   //=========================================================
   
   //Edge symbol: 'pop_1'
   (function(symbolName) {   
   
      Symbol.bindElementAction(compId, symbolName, "${_bt_cerrar}", "click", function(sym, e) {
         sym.playReverse(0500);
         sym.getComposition().getStage().$("Drag_2").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_3").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_4").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_5").fadeIn("slow");
         sym.getComposition().getStage().$("hotspot_reiniciar").fadeIn("slow");
         sym.getComposition().getStage().$("hotspot_ayuda").fadeIn("slow");
         sym.getComposition().getStage().$("bt_reiniciar").fadeIn("slow");
         sym.getComposition().getStage().$("bt_ayuda").fadeIn("slow");
         sym.getComposition().getStage().$("bt_audio").fadeIn("slow");

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

   })("pop_1");
   //Edge symbol end:'pop_1'

   //=========================================================
   
   //Edge symbol: 'bt_info_1'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hot_spot_1}", "click", function(sym, e) {
         sym.stop("down");
         
         // Mostrar un elemento 
         sym.getComposition().getStage().getSymbol("slide_2").getSymbol("contenido2").$("pop_info").show();
         sym.getComposition().getStage().getSymbol("slide_2").getSymbol("contenido2").getSymbol("pop_info").play("inicio");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hot_spot_2}", "click", function(sym, e) {
         sym.stop("up");
         

      });
      //Edge binding end

   })("bt_cerrar");
   //Edge symbol end:'bt_cerrar'

   //=========================================================
   
   //Edge symbol: 'pop_2'
   (function(symbolName) {   
      
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();
      
      });
      //Edge binding end
      
      Symbol.bindElementAction(compId, symbolName, "${_bt_cerrar}", "click", function(sym, e) {
         sym.playReverse(0500);
         sym.getComposition().getStage().$("puntos").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_1").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_3").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_4").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_5").fadeIn("slow");
         sym.getComposition().getStage().$("nina").fadeIn("slow");
         sym.getComposition().getStage().$("nino").fadeIn("slow");
         sym.getComposition().getStage().$("hotspot_reiniciar").fadeIn("slow");
      	sym.getComposition().getStage().$("hotspot_ayuda").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_reiniciar").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_ayuda").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_audio").fadeIn("slow");

      });
      //Edge binding end

   })("pop_2");
   //Edge symbol end:'pop_2'

   //=========================================================
   
   //Edge symbol: 'pop_3'
   (function(symbolName) {   
      
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();
      
      });
      //Edge binding end
      
      Symbol.bindElementAction(compId, symbolName, "${_bt_cerrar}", "click", function(sym, e) {
         sym.playReverse(0500);
         sym.getComposition().getStage().$("puntos").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_1").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_2").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_4").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_5").fadeIn("slow");
      	sym.getComposition().getStage().$("hotspot_reiniciar").fadeIn("slow");
      	sym.getComposition().getStage().$("hotspot_ayuda").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_reiniciar").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_ayuda").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_audio").fadeIn("slow");

      });
      //Edge binding end

   })("pop_3");
   //Edge symbol end:'pop_3'

   //=========================================================
   
   //Edge symbol: 'pop_4'
   (function(symbolName) {   
      
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();
      
      });
      //Edge binding end
      
      Symbol.bindElementAction(compId, symbolName, "${_bt_cerrar}", "click", function(sym, e) {
         sym.playReverse(0500);
         sym.getComposition().getStage().$("Drag_2").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_3").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_1").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_5").fadeIn("slow");
         sym.getComposition().getStage().$("nina").fadeIn("slow");
         sym.getComposition().getStage().$("nino").fadeIn("slow");
         sym.getComposition().getStage().$("hotspot_reiniciar").fadeIn("slow");
      	sym.getComposition().getStage().$("hotspot_ayuda").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_reiniciar").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_ayuda").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_audio").fadeIn("slow");

      });
      //Edge binding end

   })("pop_4");
   //Edge symbol end:'pop_4'

   //=========================================================
   
   //Edge symbol: 'pop_5'
   (function(symbolName) {   
      
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();
      
      });
      //Edge binding end
      
      Symbol.bindElementAction(compId, symbolName, "${_bt_cerrar}", "click", function(sym, e) {
         sym.playReverse(0500);
         sym.getComposition().getStage().$("Drag_2").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_3").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_1").fadeIn("slow");
         sym.getComposition().getStage().$("Drag_4").fadeIn("slow");
         sym.getComposition().getStage().$("nina").fadeIn("slow");
         sym.getComposition().getStage().$("nino").fadeIn("slow");
         sym.getComposition().getStage().$("hotspot_reiniciar").fadeIn("slow");
      	sym.getComposition().getStage().$("hotspot_ayuda").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_reiniciar").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_ayuda").fadeIn("slow");
      	sym.getComposition().getStage().$("bt_audio").fadeIn("slow");

      });
      //Edge binding end

   })("pop_5");
   //Edge symbol end:'pop_5'

   //=========================================================

   //=========================================================

   //=========================================================

   //=========================================================
   
   //Edge symbol: 'bt_audio'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_ht_spot}", "click", function(sym, e) {
         var soundId = sym.getSymbolElement().attr( "title" );
         var currentAudio=sym.getComposition().getStage().$(soundId)[0].currentTime;
         var duracion= sym.getComposition().getStage().$(soundId).duration;
         console.log("soundId="+soundId);
         if (duracion== currentAudio){
         sym.stop("up");
         }
         
         sym.getComposition().getStage().$(soundId).on('ended', function() {
         sym.stop("up");
         });
         console.log("currentAudio="+currentAudio);
         console.log("duracion="+duracion); 
         
         $("audio").prop("muted", true);
         
         	if (sym.getComposition().getStage().$(soundId)[0].paused) {
         	//elimina el mute del audio
         	sym.getComposition().getStage().$(soundId)[0].muted = false;
         	sym.getComposition().getStage().$(soundId)[0].volume=0.7;
         	sym.getComposition().getStage().$(soundId)[0].play();
         	sym.stop("down");
         
         } else {
         //activar para pausar en vez de reiniciar
         	sym.getComposition().getStage().$(soundId)[0].pause();
         	sym.stop("up");
         }

      });
      //Edge binding end

      

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

      

   })("bt_audio");
   //Edge symbol end:'bt_audio'

})(jQuery, AdobeEdge, "EDGE-1010687330");