/***********************
* 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 clickEventType = ('ontouchstart' in document.documentElement ? "touchstart" : "click");

	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", "background-color":"rgba(255,255,255,1)"});
	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.$("txt11").css({"pointer-events":"none"});
	txt[12] = sym.$("txt12").css({"pointer-events":"none"});
	txt[13] = sym.$("txt13").css({"pointer-events":"none"});
	txt[14] = sym.$("txt14").css({"pointer-events":"none"});
	txt[15] = sym.$("txt15").css({"pointer-events":"none"});
	txt[16] = sym.$("txt16").css({"pointer-events":"none"});
	txt[17] = sym.$("txt17").css({"pointer-events":"none"});
	txt[18] = sym.$("txt18").css({"pointer-events":"none"});
	txt[19] = sym.$("txt19").css({"pointer-events":"none"});
	txt[20] = sym.$("txt20").css({"pointer-events":"none"});
	txt[21] = sym.$("txt21").css({"pointer-events":"none"});
	txt[22] = sym.$("txt22").css({"pointer-events":"none"});
	txt[23] = sym.$("txt23").css({"pointer-events":"none"});
	txt[24] = sym.getSymbol("mapMc").$("txt24").css({"pointer-events":"none"});
	txt[25] = sym.getSymbol("mapMc").$("txt25").css({"pointer-events":"none"});
	txt[26] = sym.getSymbol("mapMc").$("txt26").css({"pointer-events":"none"});
	txt[27] = sym.getSymbol("mapMc").$("txt27").css({"pointer-events":"none"});
	txt[28] = sym.getSymbol("mapMc").$("txt28").css({"pointer-events":"none"});
	txt[29] = sym.getSymbol("mapMc").$("txt29").css({"pointer-events":"none"});
	txt[30] = sym.getSymbol("mapMc").$("txt30").css({"pointer-events":"none"});
	txt[31] = sym.getSymbol("mapMc").$("txt31").css({"pointer-events":"none"});
	txt[32] = sym.getSymbol("mapMc").$("txt32").css({"pointer-events":"none"});
	txt[33] = sym.getSymbol("mapMc").$("txt33").css({"pointer-events":"none"});
	txt[34] = sym.getSymbol("berlinMc").$("txt34").css({"pointer-events":"none"});
	txt[35] = sym.getSymbol("berlinMc").$("txt35").css({"pointer-events":"none"});
	txt[36] = sym.getSymbol("berlinMc").$("txt36").css({"pointer-events":"none"});
	txt[37] = sym.getSymbol("berlinMc").$("txt37").css({"pointer-events":"none"});
	txt[38] = sym.getSymbol("berlinMc").$("txt38").css({"pointer-events":"none"});
	txt[39] = sym.getSymbol("berlinMc").$("txt39").css({"pointer-events":"none"});
	txt[40] = sym.getSymbol("berlinMc").$("txt40").css({"pointer-events":"none"});
	txt[41] = sym.getSymbol("berlinMc").$("txt41").css({"pointer-events":"none"});
	txt[42] = sym.getSymbol("berlinMc").$("txt42").css({"pointer-events":"none"});
	txt[43] = sym.getSymbol("berlinMc").$("txt43").css({"pointer-events":"none"});
	txt[44] = sym.getSymbol("berlinMc").$("txt44").css({"pointer-events":"none"});
	txt[45] = sym.getSymbol("berlinMc").$("txt45").css({"pointer-events":"none"});
	txt[46] = sym.getSymbol("berlinMc").$("txt46").css({"pointer-events":"none"});
	txt[47] = sym.getSymbol("berlinMc").$("txt47").css({"pointer-events":"none"});
	txt[48] = sym.getSymbol("berlinMc").$("txt48").css({"pointer-events":"none"});
	txt[49] = sym.getSymbol("berlinMc").$("txt49").css({"pointer-events":"none"});
	txt[50] = sym.getSymbol("berlinMc").$("txt50").css({"pointer-events":"none"});
	txt[51] = sym.getSymbol("berlinMc").$("txt51").css({"pointer-events":"none"});
	txt[52] = sym.$("txt52").css({"pointer-events":"none"});
	txt[53] = sym.getSymbol("wallMc").$("txt53").css({"pointer-events":"none"});
	txt[54] = sym.getSymbol("wallMc").$("txt54").css({"pointer-events":"none"});
	txt[55] = sym.getSymbol("wallMc").$("txt55").css({"pointer-events":"none"});
	txt[56] = sym.getSymbol("wallMc").$("txt56").css({"pointer-events":"none"});
	txt[57] = sym.getSymbol("wallMc").$("txt57").css({"pointer-events":"none"});
	txt[58] = sym.getSymbol("wallMc").$("txt58").css({"pointer-events":"none"});
	txt[59] = sym.getSymbol("wallMc").$("txt59").css({"pointer-events":"none"});
	txt[60] = sym.getSymbol("wallMc").$("txt60").css({"pointer-events":"none"});
	txt[61] = sym.getSymbol("wallMc").$("txt61").css({"pointer-events":"none"});
	txt[62] = sym.getSymbol("wallMc").$("txt62").css({"pointer-events":"none"});
	txt[63] = sym.getSymbol("wallMc").$("txt63").css({"pointer-events":"none"});
	txt[64] = sym.getSymbol("wallMc").$("txt64").css({"pointer-events":"none"});
	txt[65] = sym.getSymbol("wallMc").$("txt65").css({"pointer-events":"none"});
	txt[66] = sym.getSymbol("wallMc").$("txt66").css({"pointer-events":"none"});
	txt[67] = sym.getSymbol("wallMc").$("txt67").css({"pointer-events":"none"});
	txt[68] = sym.getSymbol("wallMc").$("txt68").css({"pointer-events":"none"});
	txt[69] = sym.getSymbol("wallMc").getSymbol("patrolMc").$("txt69").css({"pointer-events":"none"});
	txt[70] = sym.getSymbol("wallMc").getSymbol("patrolMc").$("txt70").css({"pointer-events":"none"});
	txt[71] = sym.getSymbol("wallMc").getSymbol("patrolMc").$("txt71").css({"pointer-events":"none"});
	txt[72] = sym.getSymbol("wallMc").getSymbol("patrolMc").$("txt72").css({"pointer-events":"none"});
	txt[73] = sym.getSymbol("wallMc").getSymbol("patrolMc").$("txt73").css({"pointer-events":"none"});
	txt[74] = sym.getSymbol("wallMc").getSymbol("patrolMc").$("txt74").css({"pointer-events":"none"});
	txt[75] = sym.getSymbol("wallMc").getSymbol("deadMc").$("txt75").css({"pointer-events":"none"});
	txt[76] = sym.getSymbol("wallMc").getSymbol("deadMc").$("txt76").css({"pointer-events":"none"});
	txt[77] = sym.$("txt77").css({"pointer-events":"none"});
	txt[78] = sym.$("txt78").css({"pointer-events":"none"});
	txt[79] = sym.$("txt79").css({"pointer-events":"none"});
	txt[80] = sym.$("txt80").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: "GN32224.xml",
		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);

			for (var i=0; i<80; i++){
			txtArr[i]=$(xml).find('txt'+i).text();
			txt[i].html(txtArr[i]);
			}


			sym.$("txt0").empty();
			var st1 = "<div class='dateTxt'>" + txtArr[0] + "</div><div class='body1Txt'>" + txtArr[1] +
			"</div><div class='dateTxt'>" + txtArr[2] + "</div><div class='body2Txt'>" + txtArr[3] + 
			"</div><div class='dateTxt'>" + txtArr[4] + "</div><div class='body1Txt'>" + txtArr[5] + 
			"</div><div class='dateTxt'>" + txtArr[6] + "</div><div class='body2Txt'>" + txtArr[7] + 
			"</div><img class='datePic' src='images/img2.png' width='235' height='168' /><div class='dateTxt nopad'>" + txtArr[8] + "</div><div class='body1Txt'>" + txtArr[9] +
			"</div><div class='dateTxt'>" + txtArr[10] + "</div><div class='body2Txt'>" + txtArr[11] + 
			"</div><div class='dateTxt'>" + txtArr[12] + "</div><div class='body1Txt'>" + txtArr[13] + 
			"</div><div class='dateTxt'>" + txtArr[14] + "</div><div class='body2Txt'>" + txtArr[15] + 
			"</div><div class='dateTxt'>" + txtArr[16] + "</div><div class='body1Txt'>" + txtArr[17] + 
			"</div><img class='datePic' src='images/img3.png' width='235' height='168' /><div class='dateTxt nopad'>" + txtArr[18] + "</div><div class='body2Txt'>" + txtArr[19] + 
			"</div><div class='dateTxt'>" + txtArr[20] + "</div><div class='body1Txt'>" + txtArr[21] + 
			"</div><div class='dateTxt'>" + txtArr[22] + "</div><div class='body2Txt'>" + txtArr[23] + 
			"</div>";

			sym.$("txt0").append(st1);
			sym.$("Rectangle").css({"overflow-y":'auto'});
			$('.body1Txt').css({'background-color':'rgba(0,0,0,0.1)', 'padding':'5px 10px'});
			$('.body2Txt').css({'background-color':'rgba(0,0,0,0)', 'padding':'5px 10px'});
			$('.dateTxt').css({'float':'left', 'font-size':'15px', 'font-weight':600, 'color':'rgba(200,20,20,1)','padding':'5px 1px 0px 10px', 'margin-right':'5px'});
			$('.datePic').css({'float':'left','padding':'5px 1px 0px 10px'});
			$('.nopad').css({'padding':'0px 1px 0px 10px'});
	var gh = sym.$("txt0").height()-100;

	setInterval( "update();", 50 ); 

	$(function() { 
       update = function(){ 

			var pos = sym.$("Rectangle").scrollTop();

			if (pos == 0){
				sym.$("mapPoint").fadeIn(0);
				sym.getSymbol("mapMc").$("mapLoco").fadeIn(0);
			}else{
				sym.$("mapPoint").fadeOut(0);
				sym.getSymbol("mapMc").$("mapLoco").fadeOut(0);
				sym.$("scrollDown").fadeOut(200);
			}
			if (pos >= gh){
				sym.$("wallPic").fadeIn(500);
			}else{
				sym.$("wallPic").fadeOut(500);
			}
       } 
		}); 
		}
	}); // END XML

sym.$("wallMc").fadeOut(0);
sym.$("wallPic").fadeOut(0);
sym.getSymbol("wallMc").$("patrolMc").stop().fadeOut(0);
sym.getSymbol("wallMc").$("deadMc").stop().fadeOut(0);

sym.getSymbol("wallMc").$("toggleBtn1").on(clickEventType, function(e){
	e.stopPropagation(); e.preventDefault();
	if (sym.getSymbol("wallMc").getSymbol("toggleBtn1").$("btnPlus").is(":visible") ) { 
		sym.getSymbol("wallMc").getSymbol("toggleBtn1").$("btnPlus").fadeOut(0);
		sym.getSymbol("wallMc").$("patrolMc").stop().fadeIn(500);
		sym.getSymbol("wallMc").getSymbol("toggleBtn2").$("btnPlus").fadeIn(0);
		sym.getSymbol("wallMc").$("deadMc").stop().fadeOut(500);
	}else{
		sym.getSymbol("wallMc").getSymbol("toggleBtn1").$("btnPlus").fadeIn(0);
		sym.getSymbol("wallMc").$("patrolMc").stop().fadeOut(500);
	}
}); 

sym.getSymbol("wallMc").$("toggleBtn2").on(clickEventType, function(e){
	e.stopPropagation(); e.preventDefault();
	if (sym.getSymbol("wallMc").getSymbol("toggleBtn2").$("btnPlus").is(":visible") ) { 
		sym.getSymbol("wallMc").getSymbol("toggleBtn2").$("btnPlus").fadeOut(0);
		sym.getSymbol("wallMc").$("deadMc").stop().fadeIn(500);
		sym.getSymbol("wallMc").getSymbol("toggleBtn1").$("btnPlus").fadeIn(0);
		sym.getSymbol("wallMc").$("patrolMc").stop().fadeOut(500);
	}else{
		sym.getSymbol("wallMc").getSymbol("toggleBtn2").$("btnPlus").fadeIn(0);
		sym.getSymbol("wallMc").$("deadMc").stop().fadeOut(500);
	}
}); 

sym.getSymbol("wallMc").$("closeBtn").on(clickEventType, function(e){
	e.stopPropagation(); e.preventDefault();
		sym.$("wallMc").stop().fadeOut(500);
		sym.$("toggleBtn").stop().fadeIn(500);
}); 

sym.$("toggleBtn").on(clickEventType, function(e){
	e.stopPropagation(); e.preventDefault();
		sym.$("wallMc").stop().fadeIn(500);
		sym.getSymbol("wallMc").getSymbol("toggleBtn2").$("btnPlus").fadeIn(0);
		sym.getSymbol("wallMc").$("deadMc").stop().fadeOut(0);
		sym.getSymbol("wallMc").getSymbol("toggleBtn1").$("btnPlus").fadeIn(0);
		sym.getSymbol("wallMc").$("patrolMc").stop().fadeOut(0);
		sym.$("toggleBtn").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: 'Preloader'
   (function(symbolName) {   
   
   })("Preloader");
   //Edge symbol end:'Preloader'

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

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

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

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

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

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

   //=========================================================
   
   //Edge symbol: 'Down-level'
   (function(symbolName) {   
   
   })("Down-level");
   //Edge symbol end:'Down-level'

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