$(document).ready(function() {
	var cloud = $('#cloud');
	var topics = $('#cloud h4');
	$('#cloud h4 a').css('text-decoration','none')

	var dimmed = .4
	var topicSpeed = 150;
	var cloudSpeed = 150;

	// hide or show individual topics
	$(topics).hover(
		function() {
			if ($(this).css('opacity') != dimmed) {
				$(this).stop().css('opacity', 1);
			}
			else {
				$(this).animate({ 
					opacity: '1' 
				}, topicSpeed);
			}
		},
		function(){
			if ($(this).css('opacity') != 1) {
				$(this).stop().css('opacity', dimmed);
			}
			else {
				$(this).animate({
					opacity: dimmed
				}, topicSpeed);
			}
		}		
	);
	// hide or show all on cloud mouseover
	$(cloud).hover(
		function() { 
			if($(topics).css('opacity') != dimmed) {
				$(topics).animate({ opacity: dimmed }, cloudSpeed);
			} },
		function() {
			$(topics).animate({ opacity: '1' }, cloudSpeed);
		}
	);
	
});
