if(isWeb){	
	if(document.useTransitions){
		/* transitions: scale up/down menu button images */
		$('.topic_select').mouseover(function(e){
			if($(this).children('.overlay').css('display')==='none'){
				$(this).children('.heading_area').children('img').addClass('menu_scale');
			}
		});
		/* transitions: scale up/down menu button images */
		$('.topic_select').mouseout(function(e){
			if($(this).children('.overlay').css('display')==='none'){
				$(this).children('.heading_area').children('img').removeClass('menu_scale');
			}
		});		
		/* transitions: scale up/down hotspot button images */
		$('.hotspot_btn').mouseover(function(e){
			var hspID = $(this).attr('id').split('btn_')[1];
			if (hspID != currHotSpotItem)
			{
				$(this).children('img').addClass('hotspot_scale');
			}
		});
		/* transitions: scale up/down hotspot button images */
		$('.hotspot_btn').mouseout(function(e){
			$(this).children('img').removeClass('hotspot_scale');
		});
	}
}

/* transitions: fade in topics one at a time */
function calcHeight(){	
	var tempArr = []
	$('.topic_select').each(function(){		
		tempArr.push($(this).height());		
	});	
	tempArr.sort(function(a, b){return b-a});	
	$('.topic_select').css('min-height', tempArr[0]+'px !important');
}

/* transitions: fade in topics one at a time */
function displayMenu(){	
    
    $('#topic_nav_bar_menu').css('display', 'none');  // LJ Fix to hide show menu footer
    
	if(isWeb){
		if(document.useTransitions){
			calcHeight();
			topic_height();			
			var tileCount = $('.topic_select').length;
			var i = 1;
			$('.menu_topic_select_bg_'+i).fadeIn(300, function showNext() {
				if(i < tileCount+1){
					$(this).children('.top_wrapper').children('.select_title').animate({opacity:1}, 200, function(){					
						$(this).parent('.top_wrapper').children('.select_description').animate({opacity:1}, 200, function(){					
							topic_height()
							i++;
							$('.menu_topic_select_bg_'+i).fadeIn(300, showNext );
							if (i == tileCount)
							{
								//$('.home-copyright').fadeIn(300);
                                $('#topic_nav_bar_menu').fadeIn(300); // LJ Fix to hide show menu footer
							}	
						});					
					});
				}
			});			
		}else{
			$('.select_title').css('opacity',1);
			$('.select_description').css('opacity',1);
			$('.topic_select').css('display','block');
			//$('.home-copyright').css('display','block');
            $('#topic_nav_bar_menu').css('display', 'block'); // LJ Fix to hide show menu footer
			topic_height();
		}
	}else{
		$('.select_title').css('opacity',1);
		$('.select_description').css('opacity',1);
		$('.topic_select').css('display','block');
		//$('.home-copyright').css('display','block');
        $('#topic_nav_bar_menu').css('display', 'block'); // LJ Fix to hide show menu footer
		topic_height();
	}
}


function animateContent(sec){
	
	//console.log("sec = " + sec)
	
	var winTop = Math.max($('body').scrollTop(), $('html').scrollTop());	
	
	var distance = -$(window).height();
	
	$("#sec_"+sec).find('.animation-element').each(function(index, element) {
		
		if (winTop > Math.round($(this).offset().top)+distance){
			
			//console.log("animate")
			
			$(this).addClass("in-view");
			
			if($(this).hasClass("content_video")){
				$(this).next().addClass("in-view")
			}
		}
		
		
		//$(this).addClass("in-view")
	});
	
}

/*
// Detect request animation frame
var scroll = window.requestAnimationFrame ||
             // IE Fallback
             function(callback){ window.setTimeout(callback, 1000/60)};
var elementsToShow = document.querySelectorAll('.animation-element'); 

function loop() {

  elementsToShow.forEach(function (element) {
    if (isElementInViewport(element)) {
		//console.log($(element).attr("class"))
      element.classList.add('in-view');
    } else {
      element.classList.remove('in-view');
    }
  });

  scroll(loop);
}

// Call the loop for the first time
//loop();

// Helper function from: http://stackoverflow.com/a/7557433/274826
function isElementInViewport(el) {
  // special bonus for those using jQuery
  if (typeof jQuery === "function" && el instanceof jQuery) {
    el = el[0];
  }
  var rect = el.getBoundingClientRect();
  return (
    (rect.top <= 0
      && rect.bottom >= 0)
    ||
    (rect.bottom >= (window.innerHeight || document.documentElement.clientHeight) &&
      rect.top <= (window.innerHeight || document.documentElement.clientHeight))
    ||
    (rect.top >= 0 &&
      rect.bottom <= (window.innerHeight || document.documentElement.clientHeight))
  );
}
*/

/*
var $animation_elements = $('.animation-element');
var $window = $(window);

function check_if_in_view() {
	
	var window_height = $window.height();
	var window_top_position = window_height*.2;
	var window_bottom_position = window_height*.8;

	$.each($animation_elements, function() {
		var $element = $(this);
		var element_height = $element.outerHeight();
		var element_top_position = $element.offset().top;
		var element_bottom_position = (element_top_position + element_height);

		//check to see if this current container is within viewport
		
		var thisTop = $(this).offset().top - $(window).scrollTop();
		
		

		//if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) {
		if (thisTop >= window_top_position && (thisTop + $(this).height()) <= window_bottom_position){
		//if($element.isInViewport()){
			//console.log($element.attr("id"))
			$element.addClass('in-view');
		} else {
			//$element.removeClass('in-view');
		}
	});
}

$window.on('scroll resize', check_if_in_view);
//$window.trigger('scroll');

$.fn.isInViewport = function() {
    var elementTop = $(this).offset().top;
    var elementBottom = elementTop + $(this).outerHeight();

    var viewportTop = $(window).scrollTop();
    var viewportBottom = viewportTop + $(window).height();

    return elementBottom > viewportTop && elementTop < viewportBottom;
};
*/

