/***********************
* 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 source;
         var sourcetxt = sym.getSymbol("styleBase").$("sourceTxt").css("pointer-events","none");
         var txt0
         var txt0txt = sym.$("txt0").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 txt8a;
         var txt8atxt = sym.$("txt8a").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");
         var txt41;
         var txt41txt = sym.$("txt41").css("pointer-events","none");


           //AJAX retrieves data from xml source specified in url, maps xml variable to DOM object variable
           $.ajax({	
         	type: "GET",
         	url: "GN30534.xml",
         	dataType: "xml",
         	success: function(xml) {
					headline = $(xml).find('headline').text();
         		headlinetxt.html(headline);
         		source = $(xml).find('source').text();
         		sourcetxt.html(source);
         		txt0 = $(xml).find('txt0').text();
         		txt0txt.html(txt0);
         		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);
         		txt8a = $(xml).find('txt8a').text();
         		txt8atxt.html(txt8a);
         		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);                 
         		}
         	}); // END XML

// STOP ELEMENTS INTERACTING WITH MOUSE
	sym.$("handMc").css("pointer-events","none");
/*	
// HIDE ELEMENTS USING ARRAY
	sym.getSymbol("rollBtn0").$("minus").fadeOut(0);
	var menu_arr = ["day1","day2","day3","day4","routeMc","kaabaMc"];
		$.each(menu_arr, function(index, value) {
		sym.getSymbol("mainMapMc").$(value).fadeOut(0);
		});

// MAKE ELEMENTS INVISIBLE
	sym.$("handMc").animate({opacity: 0}, 0);

// MOVE HAND
	sym.$("handMc").delay(500).animate ({opacity:1, left:640, top:450}, 2000);
	sym.$("handMc").delay(200).animate ({left:665, top:20}, 2000, 'easeOutCirc');

// TOGGLE BUTTON
	var btnShow = 0;
	Symbol.bindElementAction(compId, symbolName, "${_rollBtn0}", "click", function(sym, e) {
		if (btnShow == 0) {
			sym.getSymbol("rollBtn0").$("minus").fadeIn(0);
			sym.getSymbol("rollBtn0").$("plus").fadeOut(0);
			btnShow = 1;
		}else{
			sym.getSymbol("rollBtn0").$("minus").fadeOut(0);
			sym.getSymbol("rollBtn0").$("plus").fadeIn(0);
			btnShow = 0;
		}
	});

	*/

sym.$("nucleus").animate ({left:8, top:114, width:500, height:419}, 0);
sym.$("chromPoint").fadeOut(0);
sym.$("chromZoom").animate ({opacity:0}, 0);
sym.$("chrom").animate ({opacity:0}, 0);
sym.$("helix2").fadeOut(0);
sym.$("txt3").fadeOut(0);
sym.$("txt4").fadeOut(0);
sym.$("txt5").fadeOut(0);
/*
function hideElements2(){
	var txt_arr = ["txt1","txt2","protein","proteinTxt","chromPoint","nucPoint","mutate","scene3Point","codePoint","Ellipse2","Ellipse1","txt3","txt4","txt6","txt7","txt8","txt9","txt10","last"];
		$.each(txt_arr, function(index, value) {
		sym.$(value).fadeOut(0);
		});
}
hideElements2();
*/
function hideElements(){
	var txt_arr = ["txt0","txt1","txt2","protein","proteinTxt","chromPoint","nucPoint","mutate","scene3Point","codePoint","Ellipse2","Ellipse1","txt3","txt4","txt6","txt7","txt8","txt8a","txt9","txt10","last"];
		$.each(txt_arr, function(index, value) {
		sym.$(value).fadeOut(0);
		});
}
hideElements();
sym.$("txt1").fadeIn(0);
sym.$("nucPoint").fadeIn(0);

var scene = 0;
var played = 0;
// BUTTONS
	sym.getSymbol("btnsMc").$("btnNext").click(function(){
		scene++;
		btnClick();
		sym.getSymbol("btnsMc").getSymbol("btnNext").$("btnOver").fadeOut(0);
	});
	sym.getSymbol("btnsMc").$("btnNext").mouseover(function(){
		sym.getSymbol("btnsMc").getSymbol("btnNext").$("btnOver").fadeIn(200);
	});
	sym.getSymbol("btnsMc").$("btnNext").mouseout(function(){
		sym.getSymbol("btnsMc").getSymbol("btnNext").$("btnOver").fadeOut(200);
	});

	sym.getSymbol("btnsMc").$("btnBack").click(function(){
		scene--;
		btnClick();
		sym.getSymbol("btnsMc").getSymbol("btnNext").$("btnOver").fadeOut(0);
	});
	sym.getSymbol("btnsMc").$("btnBack").mouseover(function(){
		sym.getSymbol("btnsMc").getSymbol("btnBack").$("btnOver").fadeIn(200);
	});
	sym.getSymbol("btnsMc").$("btnBack").mouseout(function(){
		sym.getSymbol("btnsMc").getSymbol("btnBack").$("btnOver").fadeOut(200);
	});

	sym.$("chromZoom").animate ({left:301, top:231, width:23, height:7}, 0);
	sym.$("chrom").animate ({left:300, top:220, width:29, height:16}, 0);

function btnClick(){
	hideElements();
	sym.$("btnsMc").animate ({left:78}, 500);
	if (scene == 0) {
		sym.$("chromZoom").animate ({opacity:0, left:301, top:231, width:23, height:7}, 800);
		sym.$("chrom").animate ({opacity:0, left:300, top:220, width:29, height:16}, 800, 'easeOutCubic');
		sym.$("nucleus").delay(1000).animate ({left:8, top:114, width:500, height:419}, 500, 'easeOutCubic');
		sym.$("txt0").delay(2000).fadeIn(1000);
		sym.$("txt1").delay(2000).fadeIn(1000);
		sym.$("nucPoint").delay(2000).fadeIn(1000);
		sym.$("btnsMc").delay(500).animate ({left:0}, 500);
	}
	if (scene == 1) {
		sym.$("nucleus").animate ({left:123, top:114, width:394, height:331}, 1000, 'easeOutCubic');  
		sym.$("chrom").animate ({opacity:1, left:21, top:344, width:149, height:205, rotate:0}, 1000, 'easeOutCubic');
		sym.$("chromZoom").animate ({opacity:1, left:46, top:228, width:279, height:296, rotate:0}, 1000, 'easeOutCubic');
		sym.$("chromPoint").delay(1000).fadeIn(500);
		sym.$("txt2").delay(1000).fadeIn(500);
		sym.$("helixMc").fadeOut(500);
		sym.$("helix2").fadeOut(500);
		sym.$("txt3").fadeOut(500);
		sym.$("txt4").fadeOut(500);
		sym.$("txt5").fadeOut(500);
		sym.$("btnsMc").delay(500).animate ({left:0}, 500);
		played = 0;
	}
	if (scene == 2) {
		sym.$("nucleus").animate ({left:255, top:18, width:251, height:210}, 1000, 'easeOutCubic');  
		sym.$("chrom").animate ({left:115, top:55, width:106, height:147, rotate:33}, 1000, 'easeOutCubic');
		sym.$("chromZoom").animate ({left:140, top:20, width:193, height:205, rotate:33}, 1000, 'easeOutCubic');
		sym.$("helixMc").fadeIn(0);
		if (played == 0) {
			sym.getSymbol("helixMc").play(1);
			sym.$("scene3Point").delay(5000).fadeIn(500);
			sym.$("txt8").delay(5000).fadeIn(500);
			sym.$("txt8a").delay(5000).fadeIn(500);
			sym.$("helix2").delay(5000).fadeIn(500);
			sym.$("txt5").delay(5000).fadeIn(500);
			sym.$("btnsMc").delay(6000).animate ({left:0}, 500);
			played = 1;
		}else{
		sym.$("scene3Point").fadeIn(500);
		sym.$("txt8").fadeIn(500);
		sym.$("txt8a").fadeIn(500);
		sym.$("txt3").fadeOut(500);
		sym.$("txt4").fadeOut(500);
		sym.$("btnsMc").delay(500).animate ({left:0}, 500);
		}

	}
	if (scene == 3) {
		sym.$("protein").fadeIn(1000);
		sym.$("codePoint").fadeIn(500);
		sym.$("txt6").fadeIn(500); 
		sym.$("txt7").fadeIn(500);
		sym.$("helix2").fadeIn(800);
		sym.$("txt5").fadeIn(500);
		sym.$("btnsMc").delay(500).animate ({left:0}, 500);
	}
	if (scene == 4) {
		sym.$("mutate").fadeIn(1000);
		sym.$("txt9").fadeIn(500); 
		sym.$("btnsMc").delay(500).animate ({left:0}, 500);
	}
	if (scene == 5) {
		sym.$("last").fadeIn(1000);
		sym.$("txt10").fadeIn(500);
		sym.$("Ellipse1").fadeIn(500);
		sym.$("Ellipse2").fadeIn(500);
		sym.$("txt3").fadeIn(500);
		sym.$("txt4").fadeIn(500);
		sym.$("btnsMc").delay(500).animate ({left:0}, 500);
	}
	if (scene <= 0) {
		sym.getSymbol("btnsMc").$("btnBack").fadeOut(0);
	}else{
		sym.getSymbol("btnsMc").$("btnBack").fadeIn(0);
	}
	if (scene >= 5) {
		sym.getSymbol("btnsMc").$("btnNext").fadeOut(0);
	}else{
		sym.getSymbol("btnsMc").$("btnNext").fadeIn(0);
	}
	}

btnClick();





(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);





















// sym.$("chromMc").animate ({left:-23, top:-89, width:826, height:138}, 2000, 'easeOutCubic');

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

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

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

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

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

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

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

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

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