$(function() {

	$('#slider_caption').hide();
	var calloutVisible = false;
	$('.slider_bar').slider({
		handle: '.slider_handle',
		startValue: 26,
		minValue: 10,
		maxValue: 100,
		start: function(e, ui) {
			$('#slider_caption').fadeIn('fast', function() { calloutVisible = true;});
			$('#font_indicator').fadeIn('slow');
		},
		stop: function(e, ui) { 
			if (calloutVisible == false) {
				$('#slider_caption').fadeIn('fast', function() { calloutVisible = true;});
				$('#font_indicator').fadeIn('slow');
				$('#slider_caption').css('left', ui.handle.css('left')).text(Math.round(ui.value * 15/100 + 8 ));
				$('#font_indicator b').text(Math.round(ui.value * 15/100 + 8 ));
				$("div#text p").animate({fontSize: ui.value * 15/100 + 8 }).fadeIn("slow");
			}
			$('#slider_caption').fadeOut('fast', function() { calloutVisible = false; });
			$('#font_indicator').fadeOut('slow');
			
			
		},
	
		slide: function(e, ui) {
			$('#slider_caption').css('left', ui.handle.css('left')).text(Math.round(ui.value * 15/100 + 8 ));
			$('#font_indicator b').text(Math.round(ui.value * 15/100 + 8 ));
			$("div#text p").css({fontSize: ui.value * 15/100 + 8 }).fadeIn("slow");
		}
	});

});


