/***********************
* 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 btnNo = 0;
	
	var xmlNo = "GN31970.xml";
	
	var headline;
	var headlinetxt = sym.getSymbol("styleHead").$("headlineTxt").css("pointer-events","none");
	var stand;
	var standtxt = sym.getSymbol("styleHead").$("standTxt").css("pointer-events","none");
	var source;
	var sourcetxt = sym.getSymbol("styleBase").$("sourceTxt").css("pointer-events","none");
	
	var txt=[];
	txt[0] = sym.getSymbol("pointerMc").$("txt0").css({"pointer-events":"none",});
	txt[1] = sym.getSymbol("pointerMc").$("txt1").css({"pointer-events":"none"});
	txt[2] = sym.getSymbol("pointerMc").$("txt2").css({"pointer-events":"none", "background-color":"rgba(0,0,0,0.8)","padding":"6px"});
	txt[3] = sym.getSymbol("pointerMc").$("txt3").css({"pointer-events":"none"});
	txt[4] = sym.getSymbol("pointerMc").$("txt4").css({"pointer-events":"none"});
	txt[5] = sym.getSymbol("pointerMc").$("txt5").css({"pointer-events":"none"});
	txt[6] = sym.getSymbol("pointerMc").$("txt6").css({"pointer-events":"none"});
	txt[7] = sym.getSymbol("pointerMc").$("txt7").css({"pointer-events":"none"});
	txt[8] = sym.getSymbol("pointerMc").$("txt8").css({"pointer-events":"none"});
	txt[9] = sym.getSymbol("pointerMc").$("txt9").css({"pointer-events":"none"});
	txt[10] = sym.getSymbol("pointerMc").$("txt10").css({"pointer-events":"none", "background-color":"rgba(0,0,0,0.5)"});
	txt[11] = sym.getSymbol("pointerMc").$("txt11").css({"pointer-events":"none"});
	txt[12] = sym.getSymbol("pointerMc").$("txt12").css({"pointer-events":"none"});
	
	var txtArr=[];
	
	//AJAX retrieves data from xml source specified in url, maps xml variable to DOM object variable
	$.ajax({	
		type: "GET",
		url: xmlNo,
		dataType: "xml",
		success: function(xml) {
			custonCol = $(xml).find('customColour').text();
			sym.getSymbol("styleHead").$("headerBox").css("background-color",custonCol);
			headline = $(xml).find('headline').text();
			headlinetxt.html(headline);
			stand = $(xml).find('stand').text();
			standtxt.html(stand);
			source = $(xml).find('source').text();
			sourcetxt.html(source);
	
			//create array from xml, put it into array of text elements
			for (var i=0; i<13; i++){
			txtArr[i]=$(xml).find('txt'+i).text();
			txt[i].html(txtArr[i]);
			}
	
			sym.getSymbol("pointerMc").$("txt2").animate({top:196 - sym.getSymbol("pointerMc").$("txt2").height()+10}, 0);
			sym.getSymbol("pointerMc").$("txt8").animate({top:559 - sym.getSymbol("pointerMc").$("txt8").height()+0}, 0);
	
		}
	}); // END XML
	
	
	function playStart() {
	sym.$("rocket").stop().animate ({top:150, height:500}, 0);
	sym.$("earth").stop().animate ({top:250, height:500}, 0);
	sym.$("earth").stop().animate ({top:355, height:231}, 2000, 'easeOutCubic');
	}
	
	// BUTTONS COUNT
	sym.$("replayBtn").on('touchstart click', function(e){
		e.stopPropagation(); e.preventDefault();
		sym.play(0);
		});
	sym.$("replayBtn").mouseover(function(){
		sym.getSymbol("replayBtn").$("btnOut").fadeOut(200);
		});
	sym.$("replayBtn").mouseout(function(){
		sym.getSymbol("replayBtn").$("btnOut").fadeIn(200);
		});
	

         	});//Edge binding end	
		
		// VIDEO BTN 1 =========================================================
         	
			
         	
         		
         	
			
			
         	// VIDEO BTN 2 =========================================================
         	
         	
         	
         		
         	
         	


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

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

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

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

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

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

      });
      //Edge binding end

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

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

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

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