/***********************
* 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 source;
	var sourcetxt = sym.getSymbol("styleBase").$("sourceTxt").css("pointer-events","none");
	var txt1
         var txt1txt = sym.$("txt1").css("pointer-events","none");
         var txt2;
         var txt2txt = sym.$("txt2").css("pointer-events","none");
         var txt3;
         var txt3txt = sym.$("txt3").css("pointer-events","none");
         var txt4;
         var txt4txt = sym.$("txt4").css("pointer-events","none");
         var txt5;
         var txt5txt = sym.$("txt5").css("pointer-events","none");
         var txt6;
         var txt6txt = sym.$("txt6").css("pointer-events","none");
         var txt7;
         var txt7txt = sym.$("txt7").css("pointer-events","none");
         var txt8;
         var txt8txt = sym.$("txt8").css("pointer-events","none");
         var txt9;
         var txt9txt = sym.$("txt9").css("pointer-events","none");
         var txt10;
         var txt10txt = sym.$("txt10").css("pointer-events","none");
         var txt11;
         var txt11txt = sym.$("txt11").css("pointer-events","none");
         var txt12;
         var txt12txt = sym.$("txt12").css("pointer-events","none");
         var txt13;
         var txt13txt = sym.$("txt13").css("pointer-events","none");
         var txt14;
         var txt14txt = sym.$("txt14").css("pointer-events","none");
         var txt15;
         var txt15txt = sym.$("txt15").css("pointer-events","none");
         var txt16;
         var txt16txt = sym.$("txt16").css("pointer-events","none");
         var txt17;
         var txt17txt = sym.$("txt17").css("pointer-events","none");
         var txt18;
         var txt18txt = sym.$("txt18").css("pointer-events","none");
         var txt19;
         var txt19txt = sym.$("txt19").css("pointer-events","none");
         var txt20;
         var txt20txt = sym.$("txt20").css("pointer-events","none");
			var txt21;
			var txt21txt = sym.$("txt21").css("pointer-events","none");
			var txt22;
			var txt22txt = sym.$("txt22").css("pointer-events","none");
			var txt23;
			var txt23txt = sym.$("txt23").css("pointer-events","none");
			var txt24;
			var txt24txt = sym.$("txt24").css("pointer-events","none");
			var txt25;
			var txt25txt = sym.$("txt25").css("pointer-events","none");
			var txt26;
			var txt26txt = sym.$("txt26").css("pointer-events","none");
			var txt27;
			var txt27txt = sym.$("txt27").css("pointer-events","none");
			var txt28;
			var txt28txt = sym.$("txt28").css("pointer-events","none");
			var txt29;
			var txt29txt = sym.$("txt29").css("pointer-events","none");
			var txt30;
         var txt30txt = sym.$("txt30").css("pointer-events","none");
         var txt31;
         var txt31txt = sym.$("txt31").css("pointer-events","none");
         var txt32;
         var txt32txt = sym.$("txt32").css("pointer-events","none");
         var txt33;
         var txt33txt = sym.$("txt33").css("pointer-events","none");
         var txt34;
         var txt34txt = sym.$("txt34").css("pointer-events","none");
         var txt35;
         var txt35txt = sym.$("txt35").css("pointer-events","none");
         var txt36;
         var txt36txt = sym.$("txt36").css("pointer-events","none");
         var txt37;
         var txt37txt = sym.$("txt37").css("pointer-events","none");
         var txt38;
         var txt38txt = sym.$("txt38").css("pointer-events","none");
         var txt39;
         var txt39txt = sym.$("txt39").css("pointer-events","none");
         var txt40;
         var txt40txt = sym.$("txt40").css("pointer-events","none");


	// STYLING TEXT
	//.css({"border-width":"3px","border-style":"solid","border-color":"rgba(100,100,100,0)"});




	//AJAX retrieves data from xml source specified in url, maps xml variable to DOM object variable
	$.ajax({	
		type: "GET",
		url: "GN31306.xml",
		dataType: "xml",
		success: function(xml) {
			headline = $(xml).find('headline').text();
			headlinetxt.html(headline);
			source = $(xml).find('source').text();
			sourcetxt.html(source);
					txt1 = $(xml).find('txt1').text();
         		txt1txt.html(txt1);
         		txt2 = $(xml).find('txt2').text();
         		txt2txt.html(txt2);
         		txt3 = $(xml).find('txt3').text();
         		txt3txt.html(txt3);
         		txt4 = $(xml).find('txt4').text();
         		txt4txt.html(txt4)
         		txt5 = $(xml).find('txt5').text();
         		txt5txt.html(txt5);
         		txt6 = $(xml).find('txt6').text();
         		txt6txt.html(txt6);
         		txt7 = $(xml).find('txt7').text();
         		txt7txt.html(txt7);
         		txt8 = $(xml).find('txt8').text();
         		txt8txt.html(txt8);
         		txt9 = $(xml).find('txt9').text();
         		txt9txt.html(txt9);
         		txt10 = $(xml).find('txt10').text();
         		txt10txt.html(txt10);
         		txt11 = $(xml).find('txt11').text();
         		txt11txt.html(txt11);
         		txt12 = $(xml).find('txt12').text();
         		txt12txt.html(txt12);
         		txt13 = $(xml).find('txt13').text();
         		txt13txt.html(txt13);
         		txt14 = $(xml).find('txt14').text();
         		txt14txt.html(txt14);
         		txt15 = $(xml).find('txt15').text();
         		txt15txt.html(txt15);
         		txt16 = $(xml).find('txt16').text();
         		txt16txt.html(txt16);
         		txt17 = $(xml).find('txt17').text();
         		txt17txt.html(txt17);
         		txt18 = $(xml).find('txt18').text();
         		txt18txt.html(txt18);
         		txt19 = $(xml).find('txt19').text();
         		txt19txt.html(txt19);
         		txt20 = $(xml).find('txt20').text();
					txt20txt.html(txt20);
					txt21 = $(xml).find('txt21').text();
					txt21txt.html(txt21);
					txt22 = $(xml).find('txt22').text();
					txt22txt.html(txt22);
					txt23 = $(xml).find('txt23').text();
					txt23txt.html(txt23);
					txt24 = $(xml).find('txt24').text();
					txt24txt.html(txt24);
					txt25 = $(xml).find('txt25').text();
					txt25txt.html(txt25);
					txt26 = $(xml).find('txt26').text();
					txt26txt.html(txt26);
					txt27 = $(xml).find('txt27').text();
					txt27txt.html(txt27);
					txt28 = $(xml).find('txt28').text();
					txt28txt.html(txt28);
					txt29 = $(xml).find('txt29').text();
					txt29txt.html(txt29);
					txt30 = $(xml).find('txt30').text();
					txt30txt.html(txt30);
					txt31 = $(xml).find('txt31').text();
					txt31txt.html(txt31);
					txt32 = $(xml).find('txt32').text();
					txt32txt.html(txt32);
					txt33 = $(xml).find('txt33').text();
					txt33txt.html(txt33);
					txt34 = $(xml).find('txt34').text();
					txt34txt.html(txt34);
					txt35 = $(xml).find('txt35').text();
					txt35txt.html(txt35);
					txt36 = $(xml).find('txt36').text();
					txt36txt.html(txt36);
					txt37 = $(xml).find('txt37').text();
					txt37txt.html(txt37);
					txt38 = $(xml).find('txt38').text();
					txt38txt.html(txt38);
					txt39 = $(xml).find('txt39').text();
					txt39txt.html(txt39);
					txt40 = $(xml).find('txt40').text();
					txt40txt.html(txt40);

			//create array from xml, put it into array of text elements
			var dateTxt = "<div style='clear:both; margin-bottom:10px'><div style='float:left; margin-right:5px; margin-left:0px; border-radius:5px; font-size:18px; font-weight:600; background-color:#9b1010; color:rgba(255,255,255,1); padding-left:6px; padding-right:6px; padding-top:6px; padding-bottom:6px'>";
			var capTxt = "</div><div style='font-family:pragmatica-web, sans-serif; font-size:14px; padding-right:10px; padding-left:0px; padding-bottom:1px; padding-top:0px'>";
			var endTxt = "</div></div>";



			var txt1 = dateTxt + txt1 + capTxt + txt2 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene0").$("textBox").append(txt1);
			var txt2 = dateTxt + txt3 + capTxt + txt4 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene0").$("textBox1").append(txt2);
			var txt3 = dateTxt + txt5 + capTxt + txt6 + endTxt + "<hr>" + dateTxt + txt7 + capTxt + txt8 + endTxt + "<hr>" + dateTxt + txt9 + capTxt + txt10 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene0").$("textBox2").append(txt3);
			var txt4 = dateTxt + txt11 + capTxt + txt12 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene1").$("textBox3").append(txt4);
			var txt5 = dateTxt + txt13 + capTxt + txt14 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene1").$("textBox4").append(txt5);
			var txt6 = dateTxt + txt15 + capTxt + txt16 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene1").$("textBox5").append(txt6);
			var txt7 = dateTxt + txt17 + capTxt + txt18 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene1").$("textBox6").append(txt7);
			var txt8 = dateTxt + txt19 + capTxt + txt20 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene1").$("textBox7").append(txt8);
			var txt9 = dateTxt + txt21 + capTxt + txt22 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene1").$("textBox8").append(txt9);

			sym.getSymbol("sliderMc").getSymbol("scene1").$("textBox8").animate({top:365 - sym.getSymbol("sliderMc").getSymbol("scene1").$("textBox8").height()+20}, 0);

			var txt10 = dateTxt + txt23 + capTxt + txt24 + endTxt + "<hr>" + dateTxt + txt25 + capTxt + txt26 + endTxt + "<hr>" + dateTxt + txt27 + capTxt + txt28 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene2").$("textBox9").append(txt10);
			var txt11 = dateTxt + txt29 + capTxt + txt30 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene2").$("textBox10").append(txt11);
			var txt12 = dateTxt + txt31 + capTxt + txt32 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene2").$("textBox11").append(txt12);
			var txt13 = dateTxt + txt33 + capTxt + txt34 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene3").$("textBox12").append(txt13);
			var txt14 = dateTxt + txt35 + capTxt + txt36 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene3").$("textBox13").append(txt14);
			var txt15 = dateTxt + txt37 + capTxt + txt38 + endTxt + "<hr>" + dateTxt + txt39 + capTxt + txt40 + endTxt;
			sym.getSymbol("sliderMc").getSymbol("scene3").$("textBox14").append(txt15);

		}
	}); // END XML


var slide = 0; // NUMBER FOR SCENES
var move = -800; // AMOUNT SCENES SLIDE


// MAKE ELEMENTS INVISIBLE
	sym.getSymbol("sliderMc").$("scene1").animate({left: 800}, 0);
	sym.getSymbol("sliderMc").$("scene2").animate({left: 1600}, 0);
	sym.getSymbol("sliderMc").$("scene3").animate({left: 2400}, 0);

function showSlides() {
		if (slide <= 0) {
			sym.getSymbol("styleHead").$("backBtn").fadeOut(0);
		}else{
			sym.getSymbol("styleHead").$("backBtn").fadeIn(0);
		}
		if (slide >= 3) {
			sym.getSymbol("styleHead").$("nextBtn").fadeOut(0);
		}else{
			sym.getSymbol("styleHead").$("nextBtn").fadeIn(0);
		}
			sym.getSymbol("styleHead").$("countTxt").html((slide + 1) + "/4");
			sym.$("sliderMc").stop().animate ({left:move*slide}, 700, 'easeOutCubic');
		}

	sym.$("swipeMc").swipeleft(function(){
		e.stopPropagation(); e.preventDefault();
			slide++;
		if (slide >= 3){
			slide = 3;
		}else{

		}
		showSlides();
 	});

	sym.$("swipeMc").swiperight(function(){
		e.stopPropagation(); e.preventDefault();
			slide--;
		if (slide <= -1){
			slide = 0;
		}else{
			showSlides();
		}
 	});


// BUTTONS COUNT
	sym.getSymbol("styleHead").$("nextBtn").on('touchstart click', function(e){
	e.stopPropagation(); e.preventDefault();
			slide++;
			showSlides();
	});
	sym.getSymbol("styleHead").$("nextBtn").mouseover(function(){
	sym.getSymbol("styleHead").getSymbol("nextBtn").$("btnOut").fadeOut(200);
	});
	sym.getSymbol("styleHead").$("nextBtn").mouseout(function(){
	sym.getSymbol("styleHead").getSymbol("nextBtn").$("btnOut").fadeIn(200);
	});

	sym.getSymbol("styleHead").$("backBtn").on('touchstart click', function(e){
	e.stopPropagation(); e.preventDefault();
			slide--;
			showSlides();
	});
	sym.getSymbol("styleHead").$("backBtn").mouseover(function(){
	sym.getSymbol("styleHead").getSymbol("backBtn").$("btnOut").fadeOut(200);
	});
	sym.getSymbol("styleHead").$("backBtn").mouseout(function(){
	sym.getSymbol("styleHead").getSymbol("backBtn").$("btnOut").fadeIn(200);
	});
sym.getSymbol("styleHead").$("backBtn").fadeOut(0);


         	});//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: 'scene0'
   (function(symbolName) {   
   
   })("scene0");
   //Edge symbol end:'scene0'

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

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

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

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

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

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

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

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