$(document).ready(function(){

//$("#debug").text("test");

$("#kryptonite-rank .rank").hover(function () {
var e = $(this).attr("id");
	$(this).removeClass(e + "-dormant");
		$(this).addClass(e);

}, function () {
	var e = $(this).attr("id");
		$(this).removeClass(e);
			$(this).addClass(e + "-dormant");  
			
}
); // Close hover


$("#kryptonite-rank .rank").click(function () {
// Set variables.
	var aid = $("h1").attr("id");
	var direction = $(this).attr("id");
	var i = $(this).text() + 1;

// Submit vote.	
	$.ajax({
		type: "POST",
		url: "http://www.kryptonite-dove.com/scripts/kd_rank.php",
		data: "aid=" + aid + "&vote=" + direction,
		cache: false,
		success: function(html){
			$("#kryptonite-rank #integer").html(html);
		}
	});


});


$("#vote-error").live('click', function() {
  $(this).fadeOut("slow");
});

}); // Close ready state
