/***********************
* 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 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.$("txt0").css("pointer-events","none");
	txt[1] = sym.$("txt1").css("pointer-events","none");
	txt[2] = sym.$("txt2").css("pointer-events","none");
	txt[3] = sym.$("txt3").css("pointer-events","none");
	txt[4] = sym.$("txt4").css("pointer-events","none");
	txt[5] = sym.$("txt5").css("pointer-events","none");
	txt[6] = sym.$("txt6").css("pointer-events","none");
	txt[7] = sym.$("txt7").css("pointer-events","none");
	txt[8] = sym.$("txt8").css("pointer-events","none");
	txt[9] = sym.$("txt9").css("pointer-events","none");
	txt[10] = sym.$("txt10").css("pointer-events","none");
	txt[11] = sym.getSymbol("viewMc").$("txt11").css("pointer-events","none");
	txt[12] = sym.getSymbol("viewMc").$("txt12").css("pointer-events","none");
	txt[13] = sym.getSymbol("viewMc").$("txt13").css("pointer-events","none");
	txt[14] = sym.getSymbol("breakOutMc").$("txt14").css("pointer-events","none");
	txt[15] = sym.getSymbol("breakOutMc").$("txt15").css("pointer-events","none");
	txt[16] = sym.getSymbol("breakOutMc").$("txt16").css("pointer-events","none");
	txt[17] = sym.getSymbol("breakOutMc").$("txt17").css("pointer-events","none");
	txt[18] = sym.getSymbol("breakOutMc").$("txt18").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: "GN31438.xml",
		dataType: "xml",
		success: function(xml) {
			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<19; i++){
			txtArr[i]=$(xml).find('txt'+i).text();
			txt[i].html(txtArr[i]);
			}
		sym.$("txt10").animate({top:214 - sym.$("txt10").height()+10}, 0);
		}
	}); // END XML
	
	// BUTTONS COUNT
	sym.getSymbol("breakOutMc").$("plusBtn").on('touchstart click', function(e){
	e.stopPropagation(); e.preventDefault();
	btnClick();
	//sym.getSymbol("btnsMc").getSymbol("btnNext").$("btnClick").fadeIn(200);
	});
	sym.getSymbol("breakOutMc").$("plusBtn").mouseover(function(){
	sym.getSymbol("breakOutMc").getSymbol("plusBtn").$("btnRoundRed").fadeOut(200);
	});
	sym.getSymbol("breakOutMc").$("plusBtn").mouseout(function(){
	sym.getSymbol("breakOutMc").getSymbol("plusBtn").$("btnRoundRed").fadeIn(200);
	});
	
	var clicked = 0;	
	function btnClick() {
	if (clicked == 0) {
		sym.getSymbol("breakOutMc").getSymbol("plusBtn").$("plus").fadeOut(200);
		sym.getSymbol("breakOutMc").play();
		sym.$("viewMc").fadeOut(500);
		clicked = 1;
	}else{
		sym.getSymbol("breakOutMc").getSymbol("plusBtn").$("plus").delay(1000).fadeIn(200);
		sym.getSymbol("breakOutMc").playReverse();
		sym.$("viewMc").delay(2100).fadeIn(500);
		clicked = 0;
	}
	}

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


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

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

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

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

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

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

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

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

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

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

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

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

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