$(function(){
	if( $('li').length > 0 ) $('li:last-child').addClass('last-child');
	if( $('*[slider="yes"]').length > 0 ) $('*[slider="yes"]').carousel({ 'slideshow_start': true, 'hover_pause': false, 'delay': 300, 'time': 5000 });
	
	var goal = parseFloat ( $('#the-goal').html().replace(/,/g,'') ),
		amount = parseFloat ( $('#the-amount').html().replace(/,/g,'') ),
		gaugeHeight = (amount/goal)*310,
		labelHeight = gaugeHeight + 37;
		
	if ( gaugeHeight >= 330 ){
		var gaugeHeight = 330;
		var labelHeight = 347;
		$('#donate .filler').css('height', 330);
		$('.donate-current').css('bottom', 328);
		$('.gauge').addClass('full');
		$('#campaign-desc').hide();
		$('#campaign-reached').show();
	} else {
		$('#donate .filler').animate({
			height: gaugeHeight
			}, 1000, function() {
				// Animation Complete
		});
		$('.donate-current').animate({
			bottom: labelHeight
			}, 1000, function() {
				//Animation Complete
		});
	}
	
	$('input').focusin(function(){
		$(this).prev('label').hide();
	});
	$('input').focusout(function(){
		var typed = $(this).val();
		if ( typed == '' ){
			$(this).prev('label').show();
		}
	});
	$( "#form-tabs" ).tabs({
		event: "mouseover"
	});
	
})
