/***********************
* Adobe Edge Composition Actions
*
* Edit this file with caution, being careful to preserve 
* function signatures and comments starting with 'Edge' to maintain the 
* ability to interact with these actions from within Adobe Edge
*
***********************/
(function($, Edge, compId){
var Composition = Edge.Composition, Symbol = Edge.Symbol; // aliases for commonly used Edge classes

   //Edge symbol: 'stage'
   (function(symbolName) {
      
      
      Symbol.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {
         // insert code for compositionReady event here
         
         
         
         var headline;
         var headlinetxt = sym.$("headlineTxt");
         headlinetxt.css('font-weight', '900');
         
         
         
         var venue;
         var key01;
         var key02;
         var month01;
         var month02;
         var sources;
         var pictures;
         var cap1;
         var cap2;
         var cap3;
         var cap4;
         var cap5;
         var cap6;
         var cap7;
         var cap8;
         var cap9;
         var cap10;
         var cap11;
         var cap12;
         var cap13;
         var cap14;
         var cap15;
         var cap16;
         var cap17;
         var cap18;
         var cap19;
         var cap20;
         var cap21;
         var cap22;
         var cap23;
         var cap24;
         var cap25;
         var cap26;
         var cap27;
         var cap28;
         var cap29;
         var cap30;
         var cap31;
         
         
         var menu_arr = ["cap2Txt", "cap3Txt", "cap4Txt", "cap5Txt", "cap6Txt", "cap7Txt", "cap8Txt", "cap9Txt", "cap10Txt", "cap11Txt", "cap12Txt", "cap13Txt"];
         $.each(menu_arr, function(index, value) {
         sym.$(value).css('line-height', '135%');
         });
         
         
         //AJAX retrieves data from xml source specified in url, maps xml variable to DOM object variable
         
         $.ajax({	
         	type: "GET",
         	url: "GN29567.xml",
         	dataType: "xml",
         	success: function(xml) {
         	
         		headline = $(xml).find('headline').text();
         		sym.$("headlineTxt").html(headline);
         		
         		venue = $(xml).find('venue').text();
         		sym.$("venueTxt").html(venue);
         		
         		key01 = $(xml).find('key01').text();
         		sym.$("key01Txt").html(key01);
         		
         		key02 = $(xml).find('key02').text();
         		sym.$("key02Txt").html(key02);
         		
         		month01 = $(xml).find('month01').text();
         		sym.$("month01Txt").html(month01);
         		
         		month02 = $(xml).find('month02').text();
         		sym.$("month02Txt").html(month02);
         		
         		sources = $(xml).find('sources').text();
         		sym.$("sourcesTxt").html(sources);
         		
         		pictures = $(xml).find('pictures').text();
         		sym.$("picturesTxt").html(pictures);
         		
         		
         		cap1 = $(xml).find('cap1').text();
                        sym.getSymbol("slider").getSymbol("panel01").$("cap1Txt").html(cap1);
          
                       cap2 = $(xml).find('cap2').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap2Txt").html(cap2);
          
                       cap3 = $(xml).find('cap3').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap3Txt").html(cap3);
          
                       cap4 = $(xml).find('cap4').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap4Txt").html(cap4);
          
          cap5 = $(xml).find('cap5').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap5Txt").html(cap5);
          
          cap6 = $(xml).find('cap6').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap6Txt").html(cap6);
          
          cap7 = $(xml).find('cap7').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap7Txt").html(cap7);
          
           cap8 = $(xml).find('cap8').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap8Txt").html(cap8);
          
           cap9 = $(xml).find('cap9').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap9Txt").html(cap9);
          
           cap10 = $(xml).find('cap10').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap10Txt").html(cap10);
          
            cap11 = $(xml).find('cap11').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap11Txt").html(cap11);
          
            cap12 = $(xml).find('cap12').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap12Txt").html(cap12);
          
            cap13 = $(xml).find('cap13').text();
                       sym.getSymbol("slider").getSymbol("panel01").$("cap13Txt").html(cap13);
          
          cap14 = $(xml).find('cap14').text();
                       sym.getSymbol("slider").getSymbol("panel02").$("cap14Txt").html(cap14);
          
          cap15 = $(xml).find('cap15').text();
                       sym.getSymbol("slider").getSymbol("panel02").$("cap15Txt").html(cap15);
          
           cap16 = $(xml).find('cap16').text();
                       sym.getSymbol("slider").getSymbol("panel02").$("cap16Txt").html(cap16);
          
           cap17 = $(xml).find('cap17').text();
                       sym.getSymbol("slider").getSymbol("panel02").$("cap17Txt").html(cap17);
          
           cap18 = $(xml).find('cap18').text();
                       sym.getSymbol("slider").getSymbol("panel02").$("cap18Txt").html(cap18);
          
           cap19 = $(xml).find('cap19').text();
                       sym.getSymbol("slider").getSymbol("panel02").$("cap19Txt").html(cap19);
         		
         		
            cap20 = $(xml).find('cap20').text();
                       sym.getSymbol("slider").getSymbol("panel02").$("cap20Txt").html(cap20);
         		
         		
             cap21 = $(xml).find('cap21').text();
                       sym.getSymbol("slider").getSymbol("panel02").$("cap21Txt").html(cap21);
         		
         		
         		 cap22 = $(xml).find('cap22').text();
                       sym.getSymbol("slider").getSymbol("panel02").$("cap22Txt").html(cap22);
          
           cap23 = $(xml).find('cap23').text();
                       sym.getSymbol("slider").getSymbol("panel02").getSymbol("detail").$("cap23Txt").html(cap23);
          
          cap24 = $(xml).find('cap24').text();
                       sym.getSymbol("slider").getSymbol("panel02").getSymbol("detail").$("cap24Txt").html(cap24);
          
           cap25 = $(xml).find('cap25').text();
                       sym.getSymbol("slider").getSymbol("panel02").getSymbol("detail").$("cap25Txt").html(cap25);
          
            cap26 = $(xml).find('cap26').text();
                       sym.getSymbol("slider").getSymbol("panel02").getSymbol("detail").$("cap26Txt").html(cap26);
          
            cap27 = $(xml).find('cap27').text();
                       sym.getSymbol("slider").getSymbol("panel02").getSymbol("detail").$("cap27Txt").html(cap27);
          
            cap28 = $(xml).find('cap28').text();
                       sym.getSymbol("slider").getSymbol("panel02").getSymbol("detail").$("cap28Txt").html(cap28);
          
            cap29 = $(xml).find('cap29').text();
                       sym.getSymbol("slider").getSymbol("panel02").getSymbol("detail").$("cap29Txt").html(cap29);
          
            cap30 = $(xml).find('cap30').text();
                       sym.getSymbol("slider").getSymbol("panel02").getSymbol("detail").$("cap30Txt").html(cap30);
          
            cap31 = $(xml).find('cap31').text();
                       sym.getSymbol("slider").getSymbol("panel02").getSymbol("detail").$("cap31Txt").html(cap31);
         		
         		
         		
         		
         		
         	// cap1 = $(xml).find('cap1').text();
         	// sym.getSymbol("panels").getSymbol("panel1").$("cap1Txt").html(cap1);
          
         
         		}
         	});
          
         
         
         
         
         
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_slider}", "touchstart", function(sym, e) {
         // insert code to be run when a user touches the object (for touch devices only)
         if ( e.pageX == undefined ) {
         
         	var touch = e.originalEvent.touches [0] || e.originalEvent.changedTouches [0];
         	
         	this.swipeStartX = touch.pageX;
         }

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_slider}", "touchend", function(sym, e) {
         // insert code to be run when a user stops touching an object (for touch devices only)
         if ( e.pageX == undefined ) {
         	
         	var touch = e.originalEvent.touches [0] || e.originalEvent.changedTouches [0];
         	this.swipeEndX = touch.pageX;
         	this.onSwipe();
         }

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_video_btn}", "click", function(sym, e) {
         var videoShow = sym.$("videoPanel");
         
         if(videoShow.is(":hidden") ) { 
           videoShow.show();
           sym.getSymbol("videoPanel").play();
             document.getElementById('vid1').play();
             
         } else {
           videoShow.hide();
           document.getElementById('vid1').pause();
         }

      });
      //Edge binding end

      Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         // Embed a movie
         var vid = $("<video width='800' height='450' controls='controls' id='vid1'>" +
            "<source src='media/GN29567.mp4' type='video/mp4' />" +
            "<source src='media/GN29567.ogg' type='video/ogg' />" +
            "This browser is not compatible with HTML 5" +
         "</video>");
          
         // stage symbol lookup, and append the above vid object to it;
         // in other words, get the div called 'videobox' and attach the video control to it;
         sym.getSymbol("videoPanel").$("videobox").append(vid);
          
         // additional options for the video object
         //vid.attr('autoplay','autoplay');
         vid.attr('preload','auto');

      });
      //Edge binding end

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

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

//Edge symbol: 'tab'
(function(symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
// insert code here
sym.stop();
});
//Edge binding end

Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1000, function(sym, e) {
// insert code here
sym.stop();
});
//Edge binding end












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

//=========================================================
   //Edge symbol: 'slider'
   (function(symbolName) {

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1000, function(sym, e) {
         // insert code here
         sym.stop();
         // Lookup the Edge Symbol Javascript Object from an element that is
         // an instance of a symbol. The symbol object can be used to invoke
         // symbol functions like play, stop etc.
         sym.getSymbol("panel02").play("Label1");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_forward_butt}", "click", function(sym, e) {
         // insert code for mouse click here
         sym.play("p1");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_forward_butt}", "touchstart", function(sym, e) {
         // insert code to be run when a user touches the object (for touch devices only)
         sym.play("p1");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_back_butt}", "click", function(sym, e) {
         // insert code for mouse click here
         sym.playReverse();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_back_butt}", "touchstart", function(sym, e) {
         // insert code to be run when a user touches the object (for touch devices only)
         sym.playReverse();

      });
      //Edge binding end

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

//=========================================================
   //Edge symbol: 'panel02'
   (function(symbolName) {

      Symbol.bindElementAction(compId, symbolName, "${_Glowsymbol}", "touchstart", function(sym, e) {

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 750, function(sym, e) {
         // insert code here
      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_Glowsymbol}", "click", function(sym, e) {
         // insert code for mouse click here
         sym.play("p4");
         // Lookup the Edge Symbol Javascript Object from an element that is
         // an instance of a symbol. The symbol object can be used to invoke
         // symbol functions like play, stop etc.
         sym.getSymbol("detail").play("p3");
         
         
         

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 6737, function(sym, e) {
         
         // insert code here
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // insert code here
      });
      //Edge binding end

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

//=========================================================
   //Edge symbol: 'panel01'
   (function(symbolName) {

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

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

//Edge symbol: 'backBtn'
(function(symbolName) {
Symbol.bindElementAction(compId, symbolName, "${_Rectangle}", "mouseover", function(sym, e) {
// insert code for mouse enter here
// stop the timeline at the given position (ms or label)
sym.stop("over");
});
//Edge binding end

Symbol.bindElementAction(compId, symbolName, "${_Rectangle}", "mouseout", function(sym, e) {
// insert code for mouse leave here
// stop the timeline at the given position (ms or label)
sym.stop("off");
});
//Edge binding end






Symbol.bindElementAction(compId, symbolName, "${_Rectangle}", "click", function(sym, e) {
// insert code for mouse clicks here
sym.stop("over");
});
//Edge binding end







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

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

//Edge symbol: 'forwardBtn'
(function(symbolName) {
Symbol.bindElementAction(compId, symbolName, "${_Rectangle}", "mouseover", function(sym, e) {
// insert code for mouse enter here
// stop the timeline at the given position (ms or label)
sym.stop("over");
});
//Edge binding end

Symbol.bindElementAction(compId, symbolName, "${_Rectangle}", "mouseout", function(sym, e) {
// insert code for mouse leave here
// stop the timeline at the given position (ms or label)
sym.stop("off");
});
//Edge binding end






Symbol.bindElementAction(compId, symbolName, "${_Rectangle}", "click", function(sym, e) {
// insert code for mouse clicks here
sym.stop("over");
});
//Edge binding end







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

//=========================================================
   //Edge symbol: 'videopane'
   (function(symbolName) {

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

//=========================================================
   (function(symbolName) {

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 4000, function(sym, e) {
         // insert code here// play the timeline from the given position (ms or label)
         sym.play("glow");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_vid_icon}", "click", function(sym, e) {
         // play the timeline from the given position (ms or label)
         sym.play("start");
         // insert code for mouse click here

      });
      //Edge binding end

      

      Symbol.bindElementAction(compId, symbolName, "${_vid_back}", "click", function(sym, e) {
         // play the timeline from the given position (ms or label)
         sym.play("back");

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 6000, function(sym, e) {
         // insert code here
         // stop the timeline at the given position (ms or label)
         sym.stop("off");

      });
      //Edge binding end

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

//=========================================================
   //Edge symbol: 'Glowsymbol'
   (function(symbolName) {

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // insert code here
      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2000, function(sym, e) {
         // play the timeline from the given position (ms or label)
         sym.play("Loop");
         // insert code here

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_Glow}", "mouseout", function(sym, e) {
         // play the timeline from the given position (ms or label)
         sym.play("Loop");
         // insert code here

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_Glow}", "mouseover", function(sym, e) {
         // insert code for mouse enter here
         // play the timeline from the given position (ms or label)
         //sym.play("over");
         // stop the timeline at the given position (ms or label)
         sym.stop("Over");

      });
      //Edge binding end

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

//=========================================================
   //Edge symbol: 'Trackdetailsymbol'
   (function(symbolName) {

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // insert code here
      });
      //Edge binding end

      

      

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 3398, function(sym, e) {
         // insert code here
      });
      //Edge binding end

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

//=========================================================
   //Edge symbol: 'whiterectangle'
   (function(symbolName) {

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // insert code here
      });
      //Edge binding end

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

})(jQuery, AdobeEdge, "GraphicNews29567");