/***********************
* 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 menu_arr = ["table01Txt", "table02Txt", "table03Txt", "table04Txt", "table05Txt", "table06Txt", "table07Txt", "table08Txt", "table09Txt", "table10Txt"];
         $.each(menu_arr, function(index, value) {
         sym.$(value).css('line-height', '135%');
         });
         
         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 cap20;
         var cap21;
         var cap22;
         var cap23;
         var cap24;
         var cap25;
         var cap26;
         var cap27;
         var cap28;
         var cap29;
         var cap30;
         var cap31;
         var cap32;
         
         var cap40;
         var cap41;
         var cap42;
         var cap43;
         
         
         //AJAX retrieves data from xml source specified in url, maps xml variable to DOM object variable
         
         $.ajax({	
         	type: "GET",
         	url: "GN29637.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);
          
          
            cap40 = $(xml).find('cap40').text();
                        sym.getSymbol("slider").getSymbol("panel01").$("cap40Txt").html(cap40);
          
            cap41 = $(xml).find('cap41').text();
                        sym.getSymbol("slider").getSymbol("panel01").$("cap41Txt").html(cap41);
          
            cap42 = $(xml).find('cap42').text();
                        sym.getSymbol("slider").getSymbol("panel01").$("cap42Txt").html(cap42);
          
            cap43 = $(xml).find('cap43').text();
                        sym.getSymbol("slider").getSymbol("panel01").$("cap43Txt").html(cap43);
          
          cap44 = $(xml).find('cap44').text();
                        sym.getSymbol("slider").getSymbol("panel01").$("cap44Txt").html(cap44);
          
          
          
          
          
          
          cap11 = $(xml).find('cap11').text();
                        sym.getSymbol("slider").getSymbol("panel02").$("cap11Txt").html(cap11);
          
          cap12 = $(xml).find('cap12').text();
                        sym.getSymbol("slider").getSymbol("panel02").$("cap12Txt").html(cap12);
          
          cap13 = $(xml).find('cap13').text();
                        sym.getSymbol("slider").getSymbol("panel02").$("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);
          
          
          cap20 = $(xml).find('cap20').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol").$("cap20Txt").html(cap20);
          
           cap21 = $(xml).find('cap21').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_1").$("cap21Txt").html(cap21);
           
           cap22 = $(xml).find('cap22').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_2").$("cap22Txt").html(cap22);
           
           cap23 = $(xml).find('cap23').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_3").$("cap23Txt").html(cap23);
           
           cap24 = $(xml).find('cap24').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_4").$("cap24Txt").html(cap24);
           
           cap25 = $(xml).find('cap25').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_5").$("cap25Txt").html(cap25);
           
           cap26 = $(xml).find('cap26').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_6").$("cap26Txt").html(cap26);
           
           cap27 = $(xml).find('cap27').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_7").$("cap27Txt").html(cap27);
           
           cap28 = $(xml).find('cap28').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_8").$("cap28Txt").html(cap28);
           
           cap29 = $(xml).find('cap29').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_9").$("cap29Txt").html(cap29);
           
           cap30 = $(xml).find('cap30').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_10").$("cap30Txt").html(cap30);
           
           cap31 = $(xml).find('cap31').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_11").$("cap31Txt").html(cap31);
           
           cap32 = $(xml).find('cap32').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_12").$("cap32Txt").html(cap32);
          
          cap33 = $(xml).find('cap33').text();
                       sym.getSymbol("slider").getSymbol("panel01").getSymbol("Explosionsymbol_13").$("cap33Txt").html(cap33);
          
         		
         		
         		
         	// 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.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         // insert code to be run when the symbol is created here
           // Embed a movie: create text variable 
         var vid = $("<video width='798' height='483'  id='vid1'>" +
           "<source src='movies/movie.mp4' type='video/mp4' />" +
           "<source src='movies/movie.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' (not a symbol) 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();

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

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

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

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

   })("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: 'Explosionsymbol'
   (function(symbolName) {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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