var pos;
function barHovers()
{
	$("ol.graph li").hover(
		function(){
			pos.pageX = pos.pageX - 310;
			pos.pageY = pos.pageY + 10;
			$("#bar-info").css({left:pos.pageX+"px",top:pos.pageY+"px",position:"absolute"});
			var item = $(this).attr('id').slice(4,10);
			var div = $("#item-"+item);
			$("#bar-info").find('h5').html(div.find('h3').text());
			$("#bar-info").find('strong').html(div.find('.charity').text());
			$("#bar-info").find('p:first').html(div.find('p').text());
			$("#bar-info").show();
		},function(){
			return;
		}
	);
	$("ol.graph").hover(function(){ return; },function() { $("#bar-info").hide(); });
}
$(function(){
	$(document).mousemove(function(e){
		pos = e;
   }); 
   $("#enter").click(function(e){ formProcess(e); return false; });
	var box = $('#voted');
	var height = $(window).height();
	var width = $(document).width();
	box.css({
		'position' : 'fixed',
		'display' 	: 'none',
		'left' : width/2 - (box.width() / 2),  // half width - half element width
		'top' : height/2 - (box.height() / 2), // similar
		'z-index' : 15                      // make sure element is on top
	});
	
	$("#main-content div h3").bind('click',function(){
		$(this).find('input').trigger('click');
	});
	$("#main-content div h3 input").bind('click',function(e){
		e.stopPropagation()
		box.find('.top p span').html($(this).parent().text());
		box.show();
		$("#overlay").show();
	});
	
	$("#undo, #close").bind('click',function(){
		box.hide();
		$("#overlay").hide();
		$("input[type=radio]:checked").attr('checked', false);
		return false;
	});
});
Cufon.replace('h2, h3, h4, h5, h6' );
Cufon.replace('.prize .charity em, #numbers, .graph .bar-title' );
Cufon.replace('#sidebar ul li a' );
