function learnMoreAnimation(){
	/* Animate the 'Learn More' button */
	//$(".learnmore").stop();
	$(".learnmore").css('left','-129px');
	$(".learnmore").animate({"left": "+=129px"},{ queue:false, duration:1800, easing:"bounceEaseOut"});
}


function heroBarListener(){



			/* Initial animation of learnmor button */
			$(".learnmore").animate({"left": "+=129px"},{ queue:false, duration:1800, easing:"bounceEaseOut"});

			$('#click-aviation').click( function(){
				// aviation
				$('#body-herobar-caption > *:visible').fadeOut(150, function() {
						$('#body-herobar-caption .aviation').fadeIn(150, function() {
							
						});
						
						$('a#hero-learnmore-link').attr('href','/services/service-markets/aviation/');
						learnMoreAnimation();
					});
				
			});

			$('#click-automotive').click(function() {
				// automotive
				$('#body-herobar-caption > *:visible').fadeOut(150, function() {
						$('#body-herobar-caption .automotive').fadeIn(150, function() {
							
						});
						
						$('a#hero-learnmore-link').attr('href','/services/service-markets/automotive/');
						learnMoreAnimation();
						
					});
			});

			$('#click-marine').click(function() {
				// marine
				$('#body-herobar-caption > *:visible').fadeOut(150, function() {
						$('#body-herobar-caption .marine').fadeIn(150, function() {
							
						});
						
						$('a#hero-learnmore-link').attr('href','/services/service-markets/marine/');
						learnMoreAnimation();
						
					});	
			});

			$('#click-residential').click(function() {
				// residential
				$('#body-herobar-caption > *:visible').fadeOut(150, function() {
						$('#body-herobar-caption .residential').fadeIn(150, function() {
							
						});
						
						$('a#hero-learnmore-link').attr('href','/services/service-markets/residential/');
						learnMoreAnimation();
						
					});
			});
				
			$('#click-commercial').click(function() {
				// commercial
				$('#body-herobar-caption > *:visible').fadeOut(150, function() {
						$('#body-herobar-caption .commercial').fadeIn(150, function() {
							
						});
						
						$('a#hero-learnmore-link').attr('href','/services/service-markets/commercial/');
						learnMoreAnimation();
						
					});
			});
			
			
			
			
			// Create the learn more button effect
			$("img#hero-learn-more").mousedown(function() {
				//alert('this is just a test');
				$('img#hero-learn-more').attr('src','<?php bloginfo("template_directory") ?>/images/general/home_cta_hover.png');
			});
			
			$('img#hero-learn-more').mouseup(function() {
				$('img#hero-learn-more').attr('src','<?php bloginfo("template_directory") ?>/images/general/cta.png');
			});
			
			


}
