$(document).ready(function(){
	
	// BEGINNING CONDITIONS //
	
	$('.tooltip').css('opacity','0');
	$('.dropdown').css('opacity','0');
	
	// EXIF OVERLAY //

  $('.community').mouseenter(function() {								// if mouse enters image area
  
  	var divid = $(this).attr('ttitle');
  	
    $(".tooltip#"+divid).stop().show().animate({												// show the overlay
     	opacity: '1',
    }, 500);
     	
  });
  
  $('.community').mouseleave(function() {								// if mouse leaves image area
  	
  	var divid = $(this).attr('ttitle');
  	
  	$(".tooltip#"+divid).stop().animate({												// hide the overlay
  	 	opacity: '0',
  	}, 100);
  	
  });
  
  // NAV DROPDOWN //
  
    $('.nav-item').mouseenter(function() {								// if mouse enters image area
    
    	var divid = $(this).attr('ttitle');
    	
      $(".dropdown#"+divid).stop().show().animate({												// hide the overlay
       	opacity: '1',
      }, 500);
       	
    });
    
    $('.nav-element').mouseleave(function() {								// if mouse leaves image area
    	
    	var divid = $(this).attr('ttitle');
    	
    	$(".dropdown#"+divid).stop().animate({												// hide the overlay
    	 	opacity: '0',
    	}, 100).hide();
    	
    });
    
    // LOGO TOOLTIPS //
    
      $('.tt').mouseenter(function(e) {								// if mouse enters image area
      
      	var divid = $(this).attr('desc');
      	
        $("#name-tt").html(divid).stop().show().animate({						// hide the overlay
         	opacity: '0.8',
        }, 500);
        
        //Set the X and Y axis of the tooltip 
        $('#name-tt').css('top', e.pageY - 30 );  
        $('#name-tt').css('left', e.pageX + 10 );
         	
      }).mousemove(function(e) {  
            
    		//Keep changing the X and Y axis for the tooltip, thus, the tooltip move along with the mouse  
    		$('#name-tt').css('top', e.pageY - 30 );  
    		$('#name-tt').css('left', e.pageX + 10 );  
                
    	}).mouseleave(function() {								// if mouse leaves image area
      	
      	$("#name-tt").html("").stop().animate({												// hide the overlay
      	 	opacity: '0',
      	}, 100).hide();
      	
      });

}); // end document ready function
