$(function() { 
    $('#slider_callout_pages').hide(); 
    var calloutVisible = false; 
    $('.slider_bar2').slider({ 
        handle: '.slider_handle', 
        min: 1, 
 
        max: 20, 
		
		startValue: 1,
		
        start: function(e, ui) { 
            $('#slider_callout_pages').fadeIn('fast', function() { calloutVisible = true;}); 
        }, 
        stop: function(e, ui) { 
            if (calloutVisible == false) { 
                $('#slider_callout_pages').fadeIn('fast', function() { calloutVisible = true;}); 
                $('#slider_callout_pages').css('left', ui.handle.css('left')).text(Math.round(ui.value)); 
            } 
            $('#slider_callout_pages').fadeOut('fast', function() { calloutVisible = false; }); 
        }, 
        slide: function(e, ui) { 
            $('#slider_callout_pages').css('left', ui.handle.css('left')).text(Math.round(ui.value)); 
			//in addition to what’s already in the slide function…
			$('#pages').val(Math.round(ui.value));
			// total...
			$('#total').val($('#pages').val()*145 - $('#days').val()*3);
        } 
    }); 
});


$(function() { 
    $('#slider_callouts').hide(); 
    var calloutVisible = false; 
    $('.slider_bar3').slider({ 
        handle: '.slider_handle', 
        min: 7, 
 
        max: 21, 
		
		startValue: 7,
		
        start: function(e, ui) { 
            $('#slider_callouts').fadeIn('fast', function() { calloutVisible = true;}); 
        }, 
        stop: function(e, ui) { 
            if (calloutVisible == false) { 
                $('#slider_callouts').fadeIn('fast', function() { calloutVisible = true;}); 
                $('#slider_callouts').css('left', ui.handle.css('left')).text(Math.round(ui.value)); 
            } 
            $('#slider_callouts').fadeOut('fast', function() { calloutVisible = false; }); 
        }, 
        slide: function(e, ui) { 
            $('#slider_callouts').css('left', ui.handle.css('left')).text(Math.round(ui.value));
			//in addition to what’s already in the slide function…
			$('#days').val(Math.round(ui.value));
			// total...
			$('#total').val($('#pages').val()*145 - $('#days').val()*3);
        } 
    }); 
});