/***********************
* 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) {
         var mexico = sym.getSymbol("hologram").getSymbol("screen_text").$("txt0").css('line-height', '120%');
         var usa = sym.getSymbol("hologram").getSymbol("screen_text").$("txt1").css('line-height', '120%');
         var caribbean = sym.getSymbol("hologram").getSymbol("screen_text").$("txt2").css('line-height', '120%');
         var bolivia = sym.getSymbol("hologram").getSymbol("screen_text").$("txt3").css('line-height', '120%');
         var brazil = sym.getSymbol("hologram").getSymbol("screen_text").$("txt4").css('line-height', '120%');
         var morocco = sym.getSymbol("hologram").getSymbol("screen_text").$("txt5").css('line-height', '120%');
         var egypt = sym.getSymbol("hologram").getSymbol("screen_text").$("txt6").css('line-height', '120%');
         var turkey = sym.getSymbol("hologram").getSymbol("screen_text").$("txt7").css('line-height', '120%');
         var lebanon = sym.getSymbol("hologram").getSymbol("screen_text").$("txt8").css('line-height', '120%');
         var madagascar = sym.getSymbol("hologram").getSymbol("screen_text").$("txt9").css('line-height', '120%');
         var afghanistan = sym.getSymbol("hologram").getSymbol("screen_text").$("txt10").css('line-height', '120%');
         var pakistan = sym.getSymbol("hologram").getSymbol("screen_text").$("txt11").css('line-height', '120%');
         var india = sym.getSymbol("hologram").getSymbol("screen_text").$("txt12").css('line-height', '120%');
         var russia = sym.getSymbol("hologram").getSymbol("screen_text").$("txt13").css('line-height', '120%');
         var thailand = sym.getSymbol("hologram").getSymbol("screen_text").$("txt14").css('line-height', '120%');
         var china = sym.getSymbol("hologram").getSymbol("screen_text").$("txt15").css('line-height', '120%');
         var kazakhstan = sym.getSymbol("hologram").getSymbol("screen_text").$("txt16").css('line-height', '120%');
         var hongkong = sym.getSymbol("hologram").getSymbol("screen_text").$("txt17").css('line-height', '120%');
         var korea = sym.getSymbol("hologram").getSymbol("screen_text").$("txt18").css('line-height', '120%');
         var japan = sym.getSymbol("hologram").getSymbol("screen_text").$("txt19").css('line-height', '120%');
         var iceland = sym.getSymbol("hologram").getSymbol("screen_text").$("txt20").css('line-height', '120%');
         var portugal = sym.getSymbol("hologram").getSymbol("screen_text").$("txt21").css('line-height', '120%');
         var spain = sym.getSymbol("hologram").getSymbol("screen_text").$("txt22").css('line-height', '120%');
         var britain = sym.getSymbol("hologram").getSymbol("screen_text").$("txt23").css('line-height', '120%');
         var france = sym.getSymbol("hologram").getSymbol("screen_text").$("txt24").css('line-height', '120%');
         var monaco = sym.getSymbol("hologram").getSymbol("screen_text").$("txt25").css('line-height', '120%');
         var netherlands = sym.getSymbol("hologram").getSymbol("screen_text").$("txt26").css('line-height', '120%');
         var switzerland = sym.getSymbol("hologram").getSymbol("screen_text").$("txt27").css('line-height', '120%');
         var germany = sym.getSymbol("hologram").getSymbol("screen_text").$("txt28").css('line-height', '120%');
         var italy = sym.getSymbol("hologram").getSymbol("screen_text").$("txt29").css('line-height', '120%');
         var austria = sym.getSymbol("hologram").getSymbol("screen_text").$("txt30").css('line-height', '120%');
         var czechrep = sym.getSymbol("hologram").getSymbol("screen_text").$("txt31").css('line-height', '120%');
         var yugoslavia = sym.getSymbol("hologram").getSymbol("screen_text").$("txt32").css('line-height', '120%');
         var bulgaria = sym.getSymbol("hologram").getSymbol("screen_text").$("txt33").css('line-height', '120%');
         var greece = sym.getSymbol("hologram").getSymbol("screen_text").$("txt34").css('line-height', '120%');
         var azerbaijan = sym.getSymbol("hologram").getSymbol("screen_text").$("txt35").css('line-height', '120%');
         var uganda = sym.getSymbol("hologram").getSymbol("screen_text").$("txt36").css('line-height', '120%');
         var vietnam = sym.getSymbol("hologram").getSymbol("screen_text").$("txt37").css('line-height', '120%');
         var albania = sym.getSymbol("hologram").getSymbol("screen_text").$("txt38").css('line-height', '120%');
         var gibraltar = sym.getSymbol("hologram").getSymbol("screen_text").$("txt39").css('line-height', '120%');
         
         btnArray = [];
         
                  for (var i=0; i<40; i++){
                  	 var btnSymbols = sym.getSymbol("hologram").getSymbol("map_buttons_group").getSymbol("btn" +i); //GET EACH OF THE BUTTONS
                  	 btnSymbols.setVariable("btnId", i); //SET VARIABLE FOR EACH BUTTON
                  	 btnArray.push(btnSymbols); //PUSH THESE INTO THE ARRAY
                  	 sym.getSymbol("hologram").getSymbol("map_buttons_group").getSymbol("btn" + i).$("reticle_rotate"). animate ({opacity: 0}, 0);
         		}
                  
                    //a 'for each' loop through the newly populated array.
                  $.each(btnArray, function( count, btnInTheArray ){
                  	 var btnItem = $(btnInTheArray);
                  	 var btnElement = btnInTheArray.getSymbolElement();
                  	// btnElement.bind ("click", {btnId:count}, btnClick); //COUNT THROUGH AND BIND A CLICK FUNCTION TO EACH BUTTONS
                  	 btnElement.bind ("mouseover", {btnId:count}, btnShow); //BIND A MOUSEOVER FUNCTION TO EACH BUTTON
                  	 btnElement.bind ("mouseout", {btnId:count}, btnHide); //BIND A MOUSEOUT FUNCTION TO EACH BUTTON
                  	}
         		)
                 
         function btnShow (e){
                  	var selectedBtn_id = (e.data.btnId); //GET THE ID OF THE OVER BUTTON
         		sym.getSymbol("hologram").getSymbol("map_buttons_group").getSymbol("btn" + selectedBtn_id).$("reticle_rotate"). animate ({opacity: 1}, 0);
         		sym.getSymbol("hologram").getSymbol("screen_text").$("txt" + selectedBtn_id).show();
         		sym.getSymbol("hologram").getSymbol("text_screen").$("selecttxt").hide();
         		}
                  
         function btnHide (e){
                  	var selectedBtn_id = (e.data.btnId); //GET THE ID OF THE OUT BUTTON
         		sym.getSymbol("hologram").getSymbol("map_buttons_group").getSymbol("btn" + selectedBtn_id).$("reticle_rotate"). animate ({opacity: 0}, 0);
         		sym.getSymbol("hologram").getSymbol("screen_text").$("txt" + selectedBtn_id).hide();
         		sym.getSymbol("hologram").getSymbol("text_screen").$("selecttxt").show();
         		}
         		
          $.ajax({	
         	type: "GET",
         	url: "GN29811.xml",
         	dataType: "xml",
         	success: function(xml) {
         		var headlinetxt = $(xml).find('headlinetxt').text();
         		sym.getSymbol("heading").$("headlinetxt").html(headlinetxt);
         		
         		var picturetxt = $(xml).find('picturetxt').text();
         		sym.$("picturetxt").html(picturetxt);
         		
         		var welcometxt = $(xml).find('welcometxt').text();
         		sym.getSymbol("hologram").getSymbol("welcome_screen").$("welcometxt").html(welcometxt);
         		
         		var selecttxt = $(xml).find('selecttxt').text();
         		sym.getSymbol("hologram").getSymbol("text_screen").$("selecttxt").html(selecttxt);
         		
         		var mexicotxt = $(xml).find('mexicotxt').text();
         		mexico.html(mexicotxt);
         		
         		var usatxt = $(xml).find('usatxt').text();
         		usa.html(usatxt);
         		
         		var caribbeantxt = $(xml).find('caribbeantxt').text();
         		caribbean.html(caribbeantxt);
         		
         		var boliviatxt = $(xml).find('boliviatxt').text();
         		bolivia.html(boliviatxt);
         		
         		var braziltxt = $(xml).find('braziltxt').text();
         		brazil.html(braziltxt);
         		
         		var moroccotxt = $(xml).find('moroccotxt').text();
         		morocco.html(moroccotxt);
         		
         		var egypttxt = $(xml).find('egypttxt').text();
         		egypt.html(egypttxt);
         		
         		var turkeytxt = $(xml).find('turkeytxt').text();
         		turkey.html(turkeytxt);
         		
         		var lebanontxt = $(xml).find('lebanontxt').text();
         		lebanon.html(lebanontxt);
         		
         		var madagascartxt = $(xml).find('madagascartxt').text();
         		madagascar.html(madagascartxt);
         		
         		var afghanistantxt = $(xml).find('afghanistantxt').text();
         		afghanistan.html(afghanistantxt);
         		
         		var pakistantxt = $(xml).find('pakistantxt').text();
         		pakistan.html(pakistantxt);
         		
         		var indiatxt = $(xml).find('indiatxt').text();
         		india.html(indiatxt);
         		
         		var russiatxt = $(xml).find('russiatxt').text();
         		russia.html(russiatxt);
         		
         		var thailandtxt = $(xml).find('thailandtxt').text();
         		thailand.html(thailandtxt);
         		
         		var chinatxt = $(xml).find('chinatxt').text();
         		china.html(chinatxt);
         		
         		var kazakhstantxt = $(xml).find('kazakhstantxt').text();
         		kazakhstan.html(kazakhstantxt);
         		
         		var hongkongtxt = $(xml).find('hongkongtxt').text();
         		hongkong.html(hongkongtxt);
         		
         		var koreatxt = $(xml).find('koreatxt').text();
         		korea.html(koreatxt);
         		
         		var japantxt = $(xml).find('japantxt').text();
         		japan.html(japantxt);
         		
         		var icelandtxt = $(xml).find('icelandtxt').text();
         		iceland.html(icelandtxt);
         		
         		var portugaltxt = $(xml).find('portugaltxt').text();
         		portugal.html(portugaltxt);
         		
         		var spaintxt = $(xml).find('spaintxt').text();
         		spain.html(spaintxt);
         		
         		var britaintxt = $(xml).find('britaintxt').text();
         		britain.html(britaintxt);
         		
         		var francetxt = $(xml).find('francetxt').text();
         		france.html(francetxt);
         		
         		var monacotxt = $(xml).find('monacotxt').text();
         		monaco.html(monacotxt);
         		
         		var netherlandstxt = $(xml).find('netherlandstxt').text();
         		netherlands.html(netherlandstxt);
         		
         		var switzerlandtxt = $(xml).find('switzerlandtxt').text();
         		switzerland.html(switzerlandtxt);
         		
         		var germanytxt = $(xml).find('germanytxt').text();
         		germany.html(germanytxt);
         		
         		var italytxt = $(xml).find('italytxt').text();
         		italy.html(italytxt);
         		
         		var austriatxt = $(xml).find('austriatxt').text();
         		austria.html(austriatxt);
         		
         		var czechreptxt = $(xml).find('czechreptxt').text();
         		czechrep.html(czechreptxt);
         		
         		var yugoslaviatxt = $(xml).find('yugoslaviatxt').text();
         		yugoslavia.html(yugoslaviatxt);
         		
         		var bulgariatxt = $(xml).find('bulgariatxt').text();
         		bulgaria.html(bulgariatxt);
         		
         		var greecetxt = $(xml).find('greecetxt').text();
         		greece.html(greecetxt);
         		
         		var azerbaijantxt = $(xml).find('azerbaijantxt').text();
         		azerbaijan.html(azerbaijantxt);
         		
         		var ugandatxt = $(xml).find('ugandatxt').text();
         		uganda.html(ugandatxt);
         		
         		var vietnamtxt = $(xml).find('vietnamtxt').text();
         		vietnam.html(vietnamtxt);
         		
         		var albaniatxt = $(xml).find('albaniatxt').text();
         		albania.html(albaniatxt);
         		
         		var gibraltartxt = $(xml).find('gibraltartxt').text();
         		gibraltar.html(gibraltartxt);
         		
          }
         
         	});
         	

      });
      //Edge binding end

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

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

      

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 14000, function(sym, e) {
         // play the timeline from the given position (ms or label)
         sym.play("scanbar");

      });
      //Edge binding end

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

      });
      //Edge binding end

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

   //=========================================================
   
   //Edge symbol: 'text_screen'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2250, function(sym, e) {
         // play the timeline from the given position (ms or label)
         sym.play(0);

      });
      //Edge binding end

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

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

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 8500, function(sym, e) {
         // play the timeline from the given position (ms or label)
         sym.play("pulse");

      });
      //Edge binding end

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

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

   //=========================================================
   
   //Edge symbol: 'globe_spin_screen'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2250, function(sym, e) {
         // play the timeline from the given position (ms or label)
         sym.play(0);

      });
      //Edge binding end

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

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

   //=========================================================
   
   //Edge symbol: 'reticle_rotate'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 5000, function(sym, e) {
         // play the timeline from the given position (ms or label)
         sym.play(0);

      });
      //Edge binding end

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

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

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

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

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

   //=========================================================
   
   //Edge symbol: 'pixelate'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 15000, function(sym, e) {
         // play the timeline from the given position (ms or label)
         sym.play(0);

      });
      //Edge binding end

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

   //=========================================================
   
   //Edge symbol: 'welcome_screen'
   (function(symbolName) {   
   
      Symbol.bindElementAction(compId, symbolName, "${_map_button}", "click", function(sym, e) {
         sym.getComposition().getStage().getSymbol("hologram").play();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2250, function(sym, e) {
         // play the timeline from the given position (ms or label)
         sym.play(0);

      });
      //Edge binding end

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

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