/***********************
* 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) {
//get the id of the clicked item         // insert code to be run when the composition is fully loaded here

	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 menuIcon0;
	var menuIcon0txt = sym.getSymbol("techMc").getSymbol("menuBtn0").$("txt").css("pointer-events","none");
	var menuIcon1;
	var menuIcon1txt = sym.getSymbol("techMc").getSymbol("menuBtn1").$("txt").css("pointer-events","none");
	var txt1
	var txt1txt = sym.getSymbol("routeBtns").$("txt1").css("pointer-events","none");
	var txt2;
	var txt2txt = sym.getSymbol("routeBtns").getSymbol("routeBtn0").$("txt").css("pointer-events","none");
	var txt3;
	var txt3txt = sym.getSymbol("routeBtns").getSymbol("routeBtn1").$("txt").css("pointer-events","none");
	var txt4;
	var txt4txt = sym.getSymbol("routeBtns").getSymbol("routeBtn2").$("txt").css("pointer-events","none");
	var txt5;
	var txt5txt = sym.getSymbol("routeBtns").getSymbol("routeBtn3").$("txt").css("pointer-events","none");
	var txt6;
	var txt6txt = sym.getSymbol("routeBtns").getSymbol("routeBtn4").$("txt").css("pointer-events","none");
	var txt7;
	var txt7txt = sym.getSymbol("routeBtns").getSymbol("routeBtn5").$("txt").css("pointer-events","none");
	var txt8;
	var txt8txt = sym.getSymbol("routeBtns").getSymbol("routeBtn6").$("txt").css("pointer-events","none");
	var txt9;
	var txt9txt = sym.getSymbol("routeBtns").getSymbol("routeBtn7").$("txt").css("pointer-events","none");
	var txt10;
	var txt10txt = sym.getSymbol("routeBtns").getSymbol("routeBtn8").$("txt").css("pointer-events","none");
	var txt11;
	var txt11txt = sym.getSymbol("routeBtns").getSymbol("routeBtn9").$("txt").css("pointer-events","none");
	var txt12;
	var txt12txt = sym.getSymbol("routeBtns").getSymbol("routeBtn10").$("txt").css("pointer-events","none");
	var txt13;
	var txt13txt = sym.getSymbol("routeBtns").getSymbol("routeBtn11").$("txt").css("pointer-events","none");
	var txt14;
	var txt14txt = sym.getSymbol("routeBtns").getSymbol("routeBtn12").$("txt").css("pointer-events","none");
	var txt15;
	var txt15txt = sym.getSymbol("routeBtns").getSymbol("routeBtn13").$("txt").css("pointer-events","none");
	var txt16;
	var txt16txt = sym.getSymbol("routeBtns").getSymbol("routeBtn14").$("txt").css("pointer-events","none");
	var txt17;
	var txt17txt = sym.getSymbol("routeBtns").getSymbol("routeBtn15").$("txt").css("pointer-events","none");
	var txt18;
	var txt18txt = sym.getSymbol("routeBtns").$("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.getSymbol("techMc").$("txt37").css("pointer-events","none");
	var txt38;
	var txt38txt = sym.getSymbol("techMc").getSymbol("techMc0").$("txt38").css("pointer-events","none");
	var txt39;
	var txt39txt = sym.getSymbol("techMc").getSymbol("techMc1").$("txt39").css("pointer-events","none");
	var txt40;
	var txt40txt = sym.getSymbol("techMc").getSymbol("techMc1").$("txt40").css("pointer-events","none");
	var txt41;
	var txt41txt = sym.getSymbol("techMc").getSymbol("techMc1").$("txt41").css("pointer-events","none");
	var txt42;
	var txt42txt = sym.getSymbol("techMc").getSymbol("techMc1").$("txt42").css("pointer-events","none");
	var txt43;
	var txt43txt = sym.getSymbol("graphMc").$("txt43").css("pointer-events","none");
	var txt44;
	var txt44txt = sym.getSymbol("graphMc").$("txt44").css("pointer-events","none");
	var txt45;
	var txt45txt = sym.getSymbol("graphMc").$("txt45").css("pointer-events","none");
	var txt46;
	var txt46txt = sym.$("txt46").css("pointer-events","none");
	var txt47;
	var txt47txt = sym.$("txt47").css("pointer-events","none");
	var txt48;
	var txt48txt = sym.getSymbol("techMc").getSymbol("techMc0").$("txt48").css("pointer-events","none");
	var txt49;
	var txt49txt = sym.getSymbol("techMc").getSymbol("techMc0").$("txt49").css("pointer-events","none"); 
	var txt50;
	var txt50txt = sym.getSymbol("techMc").getSymbol("techMc0").$("txt50").css("pointer-events","none");
	var txt51;
	var txt51txt = sym.getSymbol("techMc").getSymbol("techMc0").$("txt51").css("pointer-events","none");
	var txt52;
	var txt52txt = sym.getSymbol("techMc").getSymbol("techMc0").$("txt52").css("pointer-events","none");
	var txt53;
	var txt53txt = sym.getSymbol("techMc").getSymbol("techMc0").$("txt53").css("pointer-events","none");
	sym.getSymbol("routeBtns").$("routeNos").css("pointer-events","none");


//AJAX retrieves data from xml source specified in url, maps xml variable to DOM object variable
	$.ajax({	
		type: "GET",
		url: "GN30625.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);
			menuIcon0 = $(xml).find('menuIcon0').text();
			menuIcon0txt.html(menuIcon0);
			menuIcon1 = $(xml).find('menuIcon1').text();
			menuIcon1txt.html(menuIcon1);  
			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);   
			txt41 = $(xml).find('txt41').text();
			txt41txt.html(txt41);
			txt42 = $(xml).find('txt42').text();
			txt42txt.html(txt42);
			txt43 = $(xml).find('txt43').text();
			txt43txt.html(txt43);
			txt44 = $(xml).find('txt44').text();
			txt44txt.html(txt44);
			txt45 = $(xml).find('txt45').text();
			txt45txt.html(txt45);
			txt46 = $(xml).find('txt46').text();
			txt46txt.html(txt46)
			txt47 = $(xml).find('txt47').text();
			txt47txt.html(txt47);	
			txt48 = $(xml).find('txt48').text();
			txt48txt.html(txt48);
			txt49 = $(xml).find('txt49').text();
			txt49txt.html(txt49);
			txt50 = $(xml).find('txt50').text();
			txt50txt.html(txt50);
			txt51 = $(xml).find('txt51').text();
			txt51txt.html(txt51);
			txt52 = $(xml).find('txt52').text();
			txt52txt.html(txt52);
			txt53 = $(xml).find('txt53').text();
			txt53txt.html(txt53);     
		}
	}); // END XML


// STOP ELEMENTS INTERACTING WITH MOUSE
	sym.$("handMc").css("pointer-events","none");

// MENU BUTTONS --------------------------------------------	
	menuArray = []; //the array that will hold references to the buttons.

	for (var h = 0; h < 2; h++){
		var menuBtnSymbols = sym.getSymbol("techMc").getSymbol("menuBtn" +h); // Create an instance element of a symbol as a child of the given parent element
		menuBtnSymbols.setVariable("menuId", h); //set the value of a Symbol variable
		menuArray.push(menuBtnSymbols); //push it into the array
	}

	$.each(menuArray, function( count, menuInTheArray ){ //a 'for each' loop through the newly populated array
		var menuBtnItem = $(menuInTheArray); //create jQuery reference to the item
		var menuBtnElement = menuInTheArray.getSymbolElement(); //create a jQuery reference to the DIV element inside the symbol
		menuBtnElement.bind ("click", {menuId:count}, menuBtnClick);
		menuBtnElement.bind ("mouseover", {menuId:count}, menuShow);
		menuBtnElement.bind ("mouseout", {menuId:count}, menuHide);
	})

	function resetmenu(){
		for (var h=0; h<menuArray.length; h++){
			var resetmenu_arr = ["techMc0","techMc1"];
			$.each(resetmenu_arr, function(index, value) {
			sym.getSymbol("techMc").$(value).fadeOut(0);
			});
         menuArray[h].$("btnClick").fadeOut(0);
         menuArray[h].$("btnOver").fadeOut(0);
		}
	}
	resetmenu();
	function menuBtnClick (e){
		resetmenu(); //set them all back to normal state
		var menuMenu_id = (e.data.menuId); //get the id of the clicked item
		sym.getSymbol("techMc").getSymbol("menuBtn" + menuMenu_id).$("btnClick").fadeIn(0);
		sym.getSymbol("techMc").$("techMc" + menuMenu_id).fadeIn(500);
	}
	function menuShow (e){
		var menuMenu_id = (e.data.menuId); //get the id of the over button
		sym.$('handMc').hide();
		sym.getSymbol("techMc").getSymbol("menuBtn" + menuMenu_id).$("btnOver").fadeIn(0);
	}
	function menuHide (e){
		var menuMenu_id = (e.data.menuId); //get the id of the out button
		sym.getSymbol("techMc").getSymbol("menuBtn" + menuMenu_id).$("btnOver").fadeOut(0);
	}

// MAKE MENU 0 VISIBLE
	sym.getSymbol("techMc").getSymbol("menuBtn0").$("btnClick").fadeIn(0);
	sym.getSymbol("techMc").$("techMc0").fadeIn(0);

// BUTTONS UP
	sym.$("upBtn").click(function(){
		btnClick();
		});
	sym.$("upBtn").mouseover(function(){
		sym.getSymbol("upBtn").$("btnOver").fadeIn(200);
		});
	sym.$("upBtn").mouseout(function(){
		sym.getSymbol("upBtn").$("btnOver").fadeOut(200);
		});

var up = 0;
function btnClick(){ // START CLICK FUNCTION
	if (up == 0) { // 
		sym.$("upBtn").delay(70).animate ({top:145}, 940, 'easeOutCubic');
		sym.$("upBtn").animate ({rotate:180}, 500, 'easeOutCubic');
		sym.$("techMc").animate ({left:0}, 1000, 'easeOutCubic');
		sym.$("graphMc").animate ({top:139}, 1000, 'easeOutCubic');
		sym.$("txt22").fadeOut(500);
		up = 1;
		}else{
		sym.$("upBtn").animate ({top:539}, 950, 'easeOutCubic');
		sym.$("upBtn").animate ({rotate:0}, 500, 'easeOutCubic');
		sym.$("techMc").animate ({left:-610}, 1000, 'easeOutCubic');
		sym.$("graphMc").animate ({top:600}, 1000, 'easeOutCubic');
		sym.$("txt22").fadeIn(500);
		up = 0;
		}
} // END CLICK FUNCTION

// ROTATE 
(function($){
 var _e = document.createElement("canvas").width
 $.fn.cssrotate = function(d) {  
    return this.css({
  '-moz-transform':'rotate('+d+'deg)',
  '-webkit-transform':'rotate('+d+'deg)',
  '-o-transform':'rotate('+d+'deg)',
  '-ms-transform':'rotate('+d+'deg)'
 }).prop("rotate", _e ? d : null)
 }; 
 var $_fx_step_default = $.fx.step._default;
 $.fx.step._default = function (fx) {
 if(fx.prop != "rotate")return $_fx_step_default(fx);
 if(typeof fx.elem.rotate == "undefined")fx.start = fx.elem.rotate = 0;
 $(fx.elem).cssrotate(fx.now)
 }; 
})(jQuery);


// route BUTTONS --------------------------------------------	
         routeArray = []; //the array that will hold references to the buttons.

         for (var r = 0; r < 16; r++){
         	 // Create an instance element of a symbol as a child of the given parent element
         	 var routeBtnSymbols = sym.getSymbol("routeBtns").getSymbol("routeBtn" +r);
         	 //set the value of a Symbol variable
         	 routeBtnSymbols.setVariable("routeId", r);
         	 //push it into the array
         	 routeArray.push(routeBtnSymbols);
         }

         //a 'for each' loop through the newly populated array.
         $.each(routeArray, function( count, routeInTheArray ){
         	 //create jQuery reference to the item.
         	 var routeBtnItem = $(routeInTheArray); 
         	 //create a jQuery reference to the DIV element inside the symbol.
         	 var routeBtnElement = routeInTheArray.getSymbolElement();
         	 //now you can bind interactivity to the route items' DIVs
         	 routeBtnElement.bind ("click", {routeId:count}, routeBtnClick);
         	 routeBtnElement.bind ("mouseover", {routeId:count}, routeShow);
         	 routeBtnElement.bind ("mouseout", {routeId:count}, routeHide);
         	}
         )

	function resetroute(){
		for (var r=0; r<routeArray.length; r++){
			var resetroute_arr = ["routeTxt0","routeTxt1","routeTxt2","routeTxt3","routeTxt4","routeTxt5","routeTxt6","routeTxt7","routeTxt8","routeTxt","routeTxt10","routeTxt11","routeTxt12","routeTxt13","routeTxt14","routeTxt15","routeTxt16"];
			$.each(resetroute_arr, function(index, value) {
			sym.getSymbol("routeBtns").$(value).fadeOut(0);
			});
			var route_arr = ["route0","route1","route2","route3","route4","route5","route6","route7","route8","route9","route10","route11","route12","route13","route14","route15","route16"];			
			$.each(route_arr, function(index, value) {
			sym.getSymbol("routesMc").$(value).fadeOut(0);
			});
         	routeArray[r].$("btnClick").fadeOut(0);
         	routeArray[r].$("btnOver").fadeOut(0);
		}
	}
	resetroute();

	function routeBtnClick (e){
		resetroute(); //set them all back to normal state
		var routeroute_id = (e.data.routeId); //get the id of the clicked item
		sym.getSymbol("routeBtns").getSymbol("routeBtn" + routeroute_id).$("btnClick").fadeIn(0);
		sym.getSymbol("routesMc").$("route" + routeroute_id).fadeIn(800);
	}
	function routeShow (e){
         	var routeroute_id = (e.data.routeId); //get the id of the over button
				sym.getSymbol("routeBtns").getSymbol("routeBtn" + routeroute_id).$("btnOver").fadeIn(0);
	}
	function routeHide (e){
         	var routeroute_id = (e.data.routeId); //get the id of the out button
				sym.getSymbol("routeBtns").getSymbol("routeBtn" + routeroute_id).$("btnOver").fadeOut(0);
	}

// MAKE route 0 VISIBLE
	sym.getSymbol("routeBtns").getSymbol("routeBtn0").$("btnClick").fadeIn(0);
	sym.getSymbol("routesMc").$("route0").fadeIn(0);
	sym.$("upBtn").animate ({top:600}, 0);
	sym.$("upBtn").delay(500).animate ({top:539}, 1000); 

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

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

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

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

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

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

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

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

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

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

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

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

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