$(document).ready(function(){
	$("#navigationSection *").hover(function(){
		$(this).addClass("hover");
	}, function(){
		$(this).removeClass("hover");
	});
	$("#navigationSection ul").hover(function(){
		$(this).parent().find("> a").addClass("hover");
	}, function(){
		$(this).parent().find("> a").removeClass("hover");
	});
	$("#navigationSection > ul > li").hover(function(){
		$(this).find("> a").addClass("hover");
	}, function(){
		$(this).find("> a").removeClass("hover");
	});
	var overlay_text = 'pesquisar';
	$("#s").val(overlay_text);
	$("#s").focus(function(){
		if ($(this).val() == overlay_text) {
			$("#s").val('');
		}
	});
	$("#s").blur(function(){
		if ($(this).val() == "") {
			$("#s").val(overlay_text);
		}
	});
	var t;
	$("#feed_rss").hover(function(){
		t=setTimeout(function(){
			$("#feed_tooltip").show().animate({
				top:"-20px",
				left: "120px"
			},400);
		}, 500);
	}, function(){
		clearTimeout(t);
		$("#feed_tooltip").animate({
			top:"10px",
			left: "100px"
		},500, function(){$(this).hide();} );
	});
	$(".cmm_info, .search_result li a").hover(function(){
		$(this).find("span").css("display","inline");
	},function(){
		$(this).find("span").css("display","none");
	});
	$('a.roll[href*=#]').click(function() {  
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')  
		&& location.hostname == this.hostname) {  
			var $target = $(this.hash);  
			$target = $target.length && $target  
			|| $('[name=' + this.hash.slice(1) +']');  
			if ($target.length) {  
				var targetOffset = $target.offset().top;  
				$('html,body')  
				.animate({scrollTop: targetOffset}, 900);  
				return false;  
			}  
		}  
	});
	
});