// JavaScript Document

$(window).load(function() {
	var pos_x, pos_y;	
	$("#categorias").bind("mouseenter",function(){
		pos_y = ($("#categorias").position().top) + 51;
		pos_x = ($("#categorias").position().left);
		
		$("div#menu-container").fadeIn("slow");
		$("div#menu-container").css("top", pos_y);
		$("div#menu-container").css("left", pos_x);
		$("div#menu-container").css("z-index", 100);
   	});
	
	$("div#menu-container").bind("mouseleave", function(){
		$("div#menu-container").fadeOut("slow");
	});
	
	$("ul#menu-list li a").mouseover(function(){
		$("div#imgHolder").css("top", pos_y);
		$("div#imgHolder").css("left", pos_x + 180);
		$("div#imgHolder").css("z-index", 999);
		$("div#imgHolder").append("<img src='" + this.id + "'>").fadeIn("slow");
	});
	
	$("ul#menu-list li a").mouseout(function(){
		$("div#imgHolder").empty();
		$("div#imgHolder").hide();
	});
});

function makeVote(url)
{
	var el = document.getElementById("nota");
	el.innerHTML = "Votando...";
	
	$.get(url, function(data){
	  el.innerHTML = "Voto Computado!";
	});
}