$().ready(function() {
	
	$('div.charity_popup').each(function(){
		$(this).attr('id', $('h1', this).text());
	});
	
	$('a#btn_info').click(function(){
		pageTracker._trackEvent('Goat', 'View Question Mark Help');
		$('div#info').show();
		return false;
	});
	
	$('a#link_info').click(function(){
		pageTracker._trackEvent('Goat', 'View Footer Link Help');
		$('div#info').show();
		return false;
	});
	
	$('a#btn_close').click(function(){
		$('div#info').hide();
		return false;		
	});
	
	$('div.bottom a').click(function(){
		var charity_id = $(this).attr('href');
		pageTracker._trackEvent('Goat', 'View Charity', charity_id);
		$('div.charity_popup').each(function(){
			if($('h1', this).text() == charity_id){
				$(this).show();
			}
		});
		return false;
	});
	
	$('a.btn_charity_close').click(function(){
		$('div.charity_popup').hide();
		return false;		
	});
	
	$('a#btn_form_close').click(function(){
		$('div#form').hide();
		return false;		
	});
	
	$('div.top a').click(function(){
		$('input#gift').val($(this).parents('div.charity_tag').children('div.bottom').children('a').attr('href'));
		$('input#gift_display').val($(this).parents('div.charity_tag').children('div.bottom').children('a').attr('href'));
		$('div#form').show();
		return false;
	});
	
	
	
});
