/***********************
* 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.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {
         /* Cantidad de combobox para la actividad, editar su valor si la actividad lo requiere 
         Ej: TotalComboBox = 10;   Se crearan 10 combobox en la composición	
         */
         
         TotalComboBox=4;
         //TAMAÑO DE LA FUENTE
         tamano = "26px";
         colorini = "#000000";
         //Set variables de color
         largo = "250px";
         altura = "35px";
         titulo = "---";
         /* 
         	En este bloque de código se agregan las respuestas según lo indique la actividad.
         	Para agregar mas respuestas en el combobox se tiene en cuenta el formato :
         	    "<option value='4'>Respuesta adicional</option>"
         	Si se agrega al final de las otras respuestas, no lleva coma (,) al terminar
         	y se debe incrementar en uno el valor (value) de la opción o respuesta nueva.
         */
          var select_1 = ["<option value='0'>"+titulo+"</option>",
         					"<option value='1'>televisor curvo</option>",
         					"<option value='2'>Reloj cardio</option>",
         					"<option value='3'>Casco 3D</option>",
         					"<option value='4'>Impresora 3D</option>"];
         					sym.setVariable("seleccionar_1", select_1);
         var select_2 = ["<option value='0'>"+titulo+"</option>",
         					"<option value='1'>televisor curvo</option>",
         					"<option value='2'>Reloj cardio</option>",
         					"<option value='3'>Casco 3D</option>",
         					"<option value='4'>Impresora 3D</option>"];
         					sym.setVariable("seleccionar_2", select_2);
         var select_3 = ["<option value='0'>"+titulo+"</option>",
         					"<option value='1'>televisor curvo</option>",
         					"<option value='2'>Reloj cardio</option>",
         					"<option value='3'>Casco 3D</option>",
         					"<option value='4'>Impresora 3D</option>"];
         					sym.setVariable("seleccionar_3", select_3);
         var select_4 = ["<option value='0'>"+titulo+"</option>",
         					"<option value='1'>televisor curvo</option>",
         					"<option value='2'>Reloj cardio</option>",
         					"<option value='3'>Casco 3D</option>",
         					"<option value='4'>Impresora 3D</option>"];
         					sym.setVariable("seleccionar_4", select_4);
         var select_5 = ["<option value='0'>"+titulo+"</option>",
         					"<option value='1'>Opción1</option>",
         					"<option value='2'>Opción2</option>",
         					"<option value='3'>Opción3</option>",
         					"<option value='4'>Opción4</option>"];
         					sym.setVariable("seleccionar_5", select_5);
         var select_6 = ["<option value='0'>"+titulo+"</option>",
         					"<option value='1'>Opción1</option>",
         					"<option value='2'>Opción2</option>",
         					"<option value='3'>Opción3</option>"];
         					sym.setVariable("seleccionar_6", select_6);
         var select_7 = ["<option value='0'>"+titulo+"</option>",
         					"<option value='1'>Opción1</option>",
         					"<option value='2'>Opción2</option>",
         					"<option value='3'>Opción3</option>",
         					"<option value='4'>Opción4</option>"];
         					sym.setVariable("seleccionar_7", select_7);
         var select_8 = ["<option value='0'>"+titulo+"</option>",
         					"<option value='1'>Opción1</option>",
         					"<option value='2'>Opción2</option>",
         					"<option value='3'>Opción3</option>",
         					"<option value='4'>Opción4</option>",
         					"<option value='5'>Opción5.......................</option>"];
         					sym.setVariable("seleccionar_8", select_8);
         var select_9 = ["<option value='0'>"+titulo+"</option>",
         					"<option value='1'>Opción1</option>",
         					"<option value='2'>Opción2</option>",
         					"<option value='3'>Opción3</option>",
         					"<option value='4'>Opción4</option>"];
         					sym.setVariable("seleccionar_9", select_9);
         var select_10 = ["<option value='0'>"+titulo+"</option>",
         					"<option value='1'>Opción1</option>",
         					"<option value='2'>Opción2</option>",
         					"<option value='3'>Opción3</option>",
         					"<option value='4'>Opción4</option>"];
         					sym.setVariable("seleccionar_10", select_10);	
         //RESPUESTAS CORRECTAS
         sym.setVariable("Respuesta_1", "2");
         sym.setVariable("Respuesta_2", "4");
         sym.setVariable("Respuesta_3", "3");
         sym.setVariable("Respuesta_4", "1");
         sym.setVariable("Respuesta_5", "1");
         sym.setVariable("Respuesta_6", "1");
         sym.setVariable("Respuesta_7", "1");
         sym.setVariable("Respuesta_8", "1");
         sym.setVariable("Respuesta_9", "1");
         sym.setVariable("Respuesta_10","1");
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_1}", "click", function(sym, e) {
         sym.getSymbol("pop_1").play();
         sym.$("cuadros").fadeOut("slow");
         sym.$("combobox_1").show();
         sym.$("cerrar_1").show();
         sym.$("hotspot_1").hide();
         sym.$("hotspot_2").hide();
         sym.$("hotspot_3").hide();
         sym.$("hotspot_4").hide();
         sym.$("bt_audio1").show();
         sym.$("bt_audio").hide();
         
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_cerrar_1}", "click", function(sym, e) {
         sym.getSymbol("pop_1").playReverse(500);
         sym.$("cuadros").fadeIn("slow");
         sym.$("combobox_1").hide();
         sym.$("cerrar_1").hide();
         sym.$("hotspot_1").show();
         sym.$("hotspot_2").show();
         sym.$("hotspot_3").show();
         sym.$("hotspot_4").show();
         sym.$("bt_audio1").hide();
         sym.$("bt_audio").show();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_2}", "click", function(sym, e) {
         sym.getSymbol("pop_2").play();
         sym.$("cuadros").fadeOut("slow");
         sym.$("combobox_2").show();
         sym.$("cerrar_2").show();
         sym.$("hotspot_1").hide();
         sym.$("hotspot_2").hide();
         sym.$("hotspot_3").hide();
         sym.$("hotspot_4").hide();
         sym.$("bt_audio2").show();
         sym.$("bt_audio").hide();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_cerrar_2}", "click", function(sym, e) {
         sym.getSymbol("pop_2").playReverse(500);
         sym.$("cuadros").fadeIn("slow");
         sym.$("combobox_2").hide();
         sym.$("cerrar_2").hide();
         sym.$("hotspot_1").show();
         sym.$("hotspot_2").show();
         sym.$("hotspot_3").show();
         sym.$("hotspot_4").show();
         sym.$("bt_audio2").hide();
         sym.$("bt_audio").show();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_3}", "click", function(sym, e) {
         sym.getSymbol("pop_3").play();
         sym.$("cuadros").fadeOut("slow");
         sym.$("combobox_3").show();
         sym.$("cerrar_3").show();
         sym.$("hotspot_1").hide();
         sym.$("hotspot_2").hide();
         sym.$("hotspot_3").hide();
         sym.$("hotspot_4").hide();
         sym.$("bt_audio3").show();
         sym.$("bt_audio").hide();
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_cerrar_3}", "click", function(sym, e) {
         sym.getSymbol("pop_3").playReverse(500);
         sym.$("cuadros").fadeIn("slow");
         sym.$("combobox_3").hide();
         sym.$("cerrar_3").hide();
         sym.$("hotspot_1").show();
         sym.$("hotspot_2").show();
         sym.$("hotspot_3").show();
         sym.$("hotspot_4").show();
         sym.$("bt_audio3").hide();
         sym.$("bt_audio").show();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_cerrar_4}", "click", function(sym, e) {
         sym.getSymbol("pop_4").playReverse(500);
         sym.$("cuadros").fadeIn("slow");
         sym.$("combobox_4").hide();
         sym.$("cerrar_4").hide();
         sym.$("hotspot_1").show();
         sym.$("hotspot_2").show();
         sym.$("hotspot_3").show();
         sym.$("hotspot_4").show();
         sym.$("bt_audio4").hide();
         sym.$("bt_audio").show();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_4}", "click", function(sym, e) {
         sym.getSymbol("pop_4").play();
         sym.$("cuadros").fadeOut("slow");
         sym.$("combobox_4").show();
         sym.$("cerrar_4").show();
         sym.$("hotspot_1").hide();
         sym.$("hotspot_2").hide();
         sym.$("hotspot_3").hide();
         sym.$("hotspot_4").hide();
         sym.$("bt_audio4").show();
         sym.$("bt_audio").hide();

      });
      //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: 'bt_validar_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

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

   //=========================================================
   
   //Edge symbol: 'bt_solucion_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

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

   //=========================================================
   
   //Edge symbol: 'bt_reiniciar_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

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

   //=========================================================
   
   //Edge symbol: 'bt_ayuda_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

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

   //=========================================================
   
   //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", 2750, function(sym, e) {
         sym.playReverse();

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

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

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

      });
      //Edge binding end

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

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

      });
      //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

   })("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

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

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

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

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

   //=========================================================
   
   //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-3785112");