function attendetPeopleUpdate(){
	$(".attendet_people").hover(function(){
		$(this).children('.attend_preview').fadeIn();
	}, function(){
		$(this).children('.attend_preview').fadeOut();
	});
}
function goButtonClick(caller){
	var url = $(this).attr('href');
	$.ajax({url:url,
			type: 'post',
			data:{'home_page':'True'},
			success: function(data){
					data = jQuery.parseJSON(data);
					$('.next_event').html(data.next_event_block);
					$('#race_box').html(data.up_races_block);
					attendetPeopleUpdate();
				},
			error: function(data){alert("error");}
		});
	return false; 
}
$(document).ready(function(){
	$('.button_go').click(goButtonClick);
	attendetPeopleUpdate();
	$('.twitter, .facebook').bind('click', function () {
		var class_name = $(this).attr('class'); 
	 	$('.st_'+class_name+'_large span.stLarge').trigger('click');
	 	return false;
	});
	$('.greeting .close').bind('click', function(){
		$(this).parent().hide();
	});
});
