//the profile pics
$(function() {
   $('#aqlift #bottom .content .col2 .about-us ul li').hover( function(){
      $(this).css('border-color', '#66c3e0');
   },
   function(){
      $(this).css('border-color', '#eff0f0');
   });
});


//the project slideshow images
$(function() {
   $('#aqlift-indiv #obi .slideshow .image-background').hover( function(){
      $(this).css('border-color', '#e5cf5c'); /*#66c3e0*/
      
      /*only flash the bellyband if the 'before' image is showing*/
      if ($(this).find('#lift-before').attr('class') == "show") {
	      $(this).find('.shirase').css('display', 'block');      
		}//if
   },
   function(){
      $(this).css('border-color', '#e0e1e1');
      $(this).find('.shirase').css('display', 'none');            
   });
});


//slideshow in Lift section	
function cycleSlide(target_div) {


	//if bellyband is showing, hide it
	if ($('.shirase').css('display') == 'block') {
		$('.shirase').css('display', 'none');
	}//if

	//--Cycle the image--------------------//
	var $active_img = $('#'+target_div+' div.image-background a img.show');	

	if ($active_img.next().length == 0) {
		var $next_img = $('#'+target_div+' div.image-background a img:first');
	} else {
		var $next_img = $active_img.next();
	}	


	$active_img.css({opacity: 1.0})
	.animate({opacity: 0.0}, 250, function() {
		$active_img.removeClass('show');
		$active_img.addClass('hide');
				
		//fade in the next image
		$next_img.css({opacity: 0.0});

		$next_img.removeClass('hide');
		$next_img.addClass('show');
		
		$next_img.animate({opacity: 1.0}, 250, function() {
		});//$next_img.animate		
		
	});//$active_img.css().animate	
	
	//--Cycle the menu--------------------//	
	var $active_menu = $('#'+target_div+' ul li.current');		

	if ($active_menu.next().length == 0) {	
		var $next_menu = $('#'+target_div+' ul li:first');
	} else {
		var $next_menu = $active_menu.next();
	}		
	

	$active_menu.removeClass('current');

	$next_menu.addClass('current');		


}//function cycleSlide(target_div)

//aqlift cta on blog posts
$(function() {
   $('.blog-lift-cta').hover( function(){
      $(this).find('a').css('color', '#ff0000');
   },
   function(){
      $(this).find('a').css('color', '#3AAED7');
   });
});

//fade out the alert message upon click
$(document).ready(function() {
	if($('#alert_message').length) {
		window.setTimeout(function(){$('#alert_message').fadeOut("slow", "linear")}, 5000);
	}	

	$('#alert_message').click(function(event) {
		$('#alert_message').fadeOut("slow", "linear");
		});
});


function setTranslationCookie() {
	document.cookie="showNoTranslationMessage=1; expires=12 Dec 3000 12:12:12 GMT; path=/";
	}


//flash a blue/teal alert for a recently changed item
function blueFade(el) {
  var r = 115;
  var g = 205;
  function f() {
  	r+=5;
  	g+=5;
  	if (r > 255) { r = 255;}
  	if (g > 255) { g = 255;}  	
	document.getElementById(el).style.background = 'rgb('+r+','+g+',255)';	
	if ((r < 255) || (g < 255)) {
	  setTimeout(f, 95);
	} else {
	  document.getElementById(el).style.display = "none";
	 } 
  };
  f();

}//yellowFade(el)

