$(document).ready(function() {
		
		//  ######### tag following mouse on HOME PAGE
		$(".homeSlideshow div").mousemove(
			function(e) {
				var myOffset = $(".centeredContent").offset();
		        if ( e.pageX -myOffset.left < 722) {
					$('.mapHover').css({
						'position':"absolute",
						'top': (e.pageY -25) + "px",
			 			'left': ((e.pageX) +20) + "px"
					});
				}
				else {
					$('.mapHover').css({
						'position':"absolute",
						'top': (e.pageY -25) + "px",
				 		'left': ((e.pageX) -165) + "px"
					});
				}
		    }
		);
		
		$(".homeSlideshow div").hover(
			function() {
		        $('.mapHover').show();
		    },		
		    function() {
		        $('.mapHover').hide();
		    }
		);
		
		
		//  ######### Button Roll-Overs:
		var overButton;
		$(".button").live('mouseover',function() {
			if ($(this).hasClass('button')){
				overButton = $(this).attr("src").split(".");
				overButton = overButton[0]+ "_on." +overButton[1];
				$(this).attr("src",overButton);
				$(this).css({"cursor":"pointer"});
				
			}
			else {
				$(this).css({"cursor":"default"});
			}
		});
		$(".button").live('mouseout',function() {
				if ($(this).hasClass('button')){
					overButton = $(this).attr("src").split("_on.");
					overButton = overButton[0]+ "." +overButton[1];
					$(this).attr("src",overButton);
				}
		});
						
						

		// #########  SHARE BUTTON
		$("div.shareNav div.buttonShare").mouseenter(function() {
				$(this).stop().animate();
					$(this).animate({ 
			    		right: "-30px"
			 			}, 500);	
		});
		$("div.shareNav div.buttonShare").mouseleave(function(){
			$(this).animate({ 
		    	right: "-150px"
		 	}, 500);
		});
		
		// #########  DOWNLOAD BUTTON:
		$("div.shareNav div.buttonDownload").mouseenter(function(){			
				$(this).animate({ 
			    	right: "-375px"
			 	}, 500);			
				$("div.shareNav div.buttonShare").stop().animate();
				$("div.shareNav div.buttonShare").animate({ 
			    	right: "0px"
			 	}, 500);
		});
		$("div.shareNav div.buttonDownload").mouseleave(function(){	
			$(this).animate({ 
		    	right: "-525px"
		 	}, 500);
			$("div.shareNav div.buttonShare").animate({ 
		    	right: "-150px"
		 	}, 500);
		});
		
		
		//  ######### image Map in Corporate section
		$(".mapPerson").mousemove(
			function(e) {
				var myOffset = $(".centeredContent").offset();
		        if ( e.pageX -myOffset.left < 755) {
					$('.mapHover').css({
						'position':"absolute",
						'top': (e.pageY -170) + "px",
			 			'left': ((e.pageX-myOffset.left) +20) + "px"
					});
				}
				else {
					$('.mapHover').css({
						'position':"absolute",
						'top': (e.pageY -170) + "px",
				 		'left': ((e.pageX-myOffset.left) -135) + "px"
					});
				}
		    }
		);
		
		$(".mapPerson").hover(
			function() {
				$('.mapHover').html($(this).attr("data-alt"));
		        $('.mapHover').show();
		    },		
		    function() {
		        $('.mapHover').hide();
		    }
		);
		
});



