/***********************
* 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 to be run when the composition is fully loaded here
         // insert code for compositionReady event here
         
         var headline;
         var headlinetxt = sym.getSymbol("header_sym").$("headlineTxt");
         headlinetxt.css('font-weight', '900');
         var credit;
         var pictures;
         var sources;
         var venue;
         var month1;
         var month2;
         var D1;
         var D2;
         var D3;
         var D4;
         var D5;
         var D6;
         var D7;
         var D8;
         var D9;
         var D10;
         var D11;
         var D12;
         var D13;
         var D14;
         var D15;
         var D16;
         var D17;
         var cap1;
         var cap2;
         var cap2txt = sym.$("cap2Txt");
         cap2txt.css('font-weight', '900');
         var cap3;
         var cap4;
         var cap4txt = sym.$("cap4Txt");
         cap4txt.css('font-weight', '900');
         var cap5;
         var cap6;
         var cap6txt = sym.$("cap6Txt");
         cap6txt.css('font-weight', '900');
         var cap7;
         var cap7txt = sym.$("cap7Txt");
         cap7txt.css('font-weight', '900');
         var cap8;
         var cap8txt = sym.$("cap8Txt");
         cap8txt.css('font-weight', '900');
         var cap9;
         var cap9txt = sym.$("cap9Txt");
         cap9txt.css('font-weight', '900');
         var cap10;
         var cap10txt = sym.$("cap10Txt");
         cap10txt.css('font-weight', '900');
         var cap11;
         var cap11txt = sym.$("cap11Txt");
         cap11txt.css('font-weight', '900');
         var cap12;
         var cap12txt = sym.$("cap12Txt");
         cap12txt.css('font-weight', '900');
         var cap13;
         var cap13txt = sym.$("cap13Txt");
         cap13txt.css('font-weight', '900');
         var cap14;
         var cap14txt = sym.$("cap14Txt");
         cap14txt.css('font-weight', '900');
         var cap15;
         var cap15txt = sym.$("cap15Txt");
         cap15txt.css('font-weight', '900');
         var cap16;
         var cap17;
         var cap18;
         var cap19;
         var cap20;
         var cap21;
         var cap22;
         var cap23;
         var cap24;
         var cap25;
         var cap25txt = sym.$("cap25Txt");
         cap25txt.css('font-weight', '900');
         var cap26;
         var cap26txt = sym.$("cap26Txt");
         cap26txt.css('font-weight', '900');
         var cap27;
         var cap28;
         var cap29;
         var cap30;
         var cap31;
         var cap32;
         var cap33;
         var cap34;
         var cap35;
         var cap36;
         var cap37;
         var cap38;
         var cap39;
         var cap40;
         var cap41;
         
         //var yourtag;
         //var yourtagtxt = sym.$("yourtagTxt");
         
         //AJAX retrieves data from xml source specified in url, maps xml variable to DOM object variable
         $.ajax({    
         
         
         
             type: "GET",
         
         //insert name of XML file here
         //XML file must be at root-level of folder
         
             url: "GN29538.xml",
         
             dataType: "xml",
         
             success: function(xml) {
         
         //If text is on Stage then use this syntax (see second line)
         	//credit = $(xml).find('credit').text();
         	//sym.$("creditTxt").html(credit);
         
         //If text is within a symbol then use this syntax
         	// headline = $(xml).find('headline').text();
                //sym.getSymbol("header_sym").$("headlineTxt").html(headline); 
          
         	headline = $(xml).find('headline').text();
         	sym.getSymbol("header_sym").$("headlineTxt").html(headline); 
         	
         	credit = $(xml).find('credit').text();
         	sym.getSymbol("footer_sym").$("creditTxt").html(credit);
         	pictures = $(xml).find('pictures').text();
         	sym.getSymbol("footer_sym").$("picturesTxt").html(pictures);
         	sources = $(xml).find('sources').text();
         	sym.getSymbol("footer_sym").$("sourcesTxt").html(sources);
         	
         	venue = $(xml).find('venue').text();
         	sym.getSymbol("header_sym").$("venueTxt").html(venue);
         	month1 = $(xml).find('month1').text();
         	sym.getSymbol("header_sym").$("month1Txt").html(month1); 
         	month2 = $(xml).find('month2').text();
         	sym.getSymbol("header_sym").$("month2Txt").html(month2); 
         
         //This block is the day of the week date	
         	D1 = $(xml).find('D1').text();
         	sym.getSymbol("header_sym").$("dateTxt1").html(D1);
         	D2 = $(xml).find('D2').text();
         	sym.getSymbol("header_sym").$("dateTxt2").html(D2); 
         	D3 = $(xml).find('D3').text();
         	sym.getSymbol("header_sym").$("dateTxt3").html(D3); 
         	D4 = $(xml).find('D4').text();
         	sym.getSymbol("header_sym").$("dateTxt4").html(D4); 
         	D5 = $(xml).find('D5').text();
         	sym.getSymbol("header_sym").$("dateTxt5").html(D5); 
         	D6 = $(xml).find('D6').text();
         	sym.getSymbol("header_sym").$("dateTxt6").html(D6); 
         	D7 = $(xml).find('D7').text();
         	sym.getSymbol("header_sym").$("dateTxt7").html(D7); 
         	D8 = $(xml).find('D8').text();
         	sym.getSymbol("header_sym").$("dateTxt8").html(D8); 
         	D9 = $(xml).find('D9').text();
         	sym.getSymbol("header_sym").$("dateTxt9").html(D9); 
         	D10 = $(xml).find('D10').text();
         	sym.getSymbol("header_sym").$("dateTxt10").html(D10); 
         	D11 = $(xml).find('D11').text();
         	sym.getSymbol("header_sym").$("dateTxt11").html(D11); 
         	D12 = $(xml).find('D12').text();
         	sym.getSymbol("header_sym").$("dateTxt12").html(D12); 
         	D13 = $(xml).find('D13').text();
         	sym.getSymbol("header_sym").$("dateTxt13").html(D13); 
         	D14 = $(xml).find('D14').text();
         	sym.getSymbol("header_sym").$("dateTxt14").html(D14); 
         	D15 = $(xml).find('D15').text();
         	sym.getSymbol("header_sym").$("dateTxt15").html(D15); 
         	D16 = $(xml).find('D16').text();
         	sym.getSymbol("header_sym").$("dateTxt16").html(D16); 
         	D17 = $(xml).find('D17').text();
         	sym.getSymbol("header_sym").$("dateTxt17").html(D17); 
         	
         //Captions on Stage
         	sources = $(xml).find('cap1').text();
         	sym.$("cap1Txt").html(sources);
         	sources = $(xml).find('cap2').text();
         	sym.$("cap2Txt").html(sources);
         	sources = $(xml).find('cap3').text();
         	sym.$("cap3Txt").html(sources);
         	sources = $(xml).find('cap4').text();
         	sym.$("cap4Txt").html(sources);
         	sources = $(xml).find('cap5').text();
         	sym.$("cap5Txt").html(sources);
         	sources = $(xml).find('cap6').text();
         	sym.$("cap6Txt").html(sources);
         	sources = $(xml).find('cap7').text();
                 sym.$("cap7Txt").html(sources);
         	sources = $(xml).find('cap8').text();
         	sym.$("cap8Txt").html(sources);
         	sources = $(xml).find('cap9').text();
         	sym.$("cap9Txt").html(sources);
         	
         //Captions on page 1	
         	sources = $(xml).find('cap10').text();
         	sym.$("cap10Txt").html(sources);
         	
         	sources = $(xml).find('cap11').text();
         	sym.$("cap11Txt").html(sources);
         	
         	sources = $(xml).find('cap12').text();
         	sym.$("cap12Txt").html(sources);
         	
         	sources = $(xml).find('cap13').text();
         	sym.$("cap13Txt").html(sources);
         	
         	sources = $(xml).find('cap14').text();
         	sym.$("cap14Txt").html(sources);
         	
         	sources = $(xml).find('cap15').text();
         	sym.$("cap15Txt").html(sources);
         	
         		
         	sources = $(xml).find('cap16').text();
         	sym.$("cap16Txt").html(sources);
         		
         	sources = $(xml).find('cap17').text();
         	sym.$("cap17Txt").html(sources);
         		
         	sources = $(xml).find('cap18').text();
         	sym.$("cap18Txt").html(sources);
         		
         	sources = $(xml).find('cap19').text();
         	sym.$("cap19Txt").html(sources);
         		
         	sources = $(xml).find('cap20').text();
         	sym.$("cap20Txt").html(sources);
         		
         	sources = $(xml).find('cap21').text();
         	sym.$("cap21Txt").html(sources);
         		
         	sources = $(xml).find('cap22').text();
         	sym.$("cap22Txt").html(sources);
         		
         	sources = $(xml).find('cap23').text();
         	sym.$("cap23Txt").html(sources);
         		
         	sources = $(xml).find('cap24').text();
         	sym.$("cap24Txt").html(sources);
         		
         	sources = $(xml).find('cap25').text();
         	sym.$("cap25Txt").html(sources);
         		
         	sources = $(xml).find('cap26').text();
         	sym.$("cap26Txt").html(sources);
         		
         	sources = $(xml).find('cap27').text();
         	sym.$("cap27Txt").html(sources);
         		
         	sources = $(xml).find('cap28').text();
         	sym.$("cap28Txt").html(sources);
         	
         	sources = $(xml).find('cap29').text();
         	sym.$("cap29Txt").html(sources);
         	
         	sources = $(xml).find('cap30').text();
         	sym.$("cap30Txt").html(sources);
         	
         	sources = $(xml).find('cap31').text();
         	sym.$("cap31Txt").html(sources);
         	
         	sources = $(xml).find('cap32').text();
         	sym.$("cap32Txt").html(sources);
         	
         	sources = $(xml).find('cap33').text();
         	sym.$("cap33Txt").html(sources);
         	
         	sources = $(xml).find('cap34').text();
         	sym.$("cap34Txt").html(sources);
         	
         	sources = $(xml).find('cap35').text();
         	sym.$("cap35Txt").html(sources);
         	
         	sources = $(xml).find('cap36').text();
         	sym.$("cap36Txt").html(sources);
         	
         	sources = $(xml).find('cap37').text();
         	sym.$("cap37Txt").html(sources);
         	
         	sources = $(xml).find('cap38').text();
         	sym.$("cap38Txt").html(sources);
         	
         	sources = $(xml).find('cap39').text();
         	sym.$("cap39Txt").html(sources);
         	
         	sources = $(xml).find('cap40').text();
         	sym.$("cap40Txt").html(sources);
         	
         	sources = $(xml).find('cap41').text();
         	sym.$("cap41Txt").html(sources);
         	
          //        yourtag = $(xml).find('yourtag').text();
          //       sym.$("yourtagTxt").html(yourtag);
          
          }
          });
         
         
         // Note: The green text following “//” are comments and don’t affect the code.
         
         
         // Embed a movie: create text variable 
         var vid = $("<video width='800' height='450' id='vid1'>" +
           "<source src='media/GN29538.mp4' type='video/mp4' />" +
           "<source src='media/GN29538.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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

      

      

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

      });
      //Edge binding end

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

      });
      //Edge binding end

      

      

      

      

      

      Symbol.bindElementAction(compId, symbolName, "${_video_sym}", "click", function(sym, e) {
         // insert code for mouse click here
         
         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

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

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

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

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

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

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

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

//=========================================================
   //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

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

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

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

      });
         //Edge binding end

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

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

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

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

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

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

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

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

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

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

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

//=========================================================
   (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'

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