	var outstanding = 0;
	var percent = 0.8;

	window.onload = function() {
		var invoice = new Control.Slider('invoiceHandle','invoiceTrack', {axis:'horizontal'});
			invoice.options.onChange = function(value) {
				$('invoiceValue').update('&pound;'+(value*250).toFixed()+',000');
			};
			invoice.options.onSlide = function(value) {
				$('invoiceValue').update('&pound;'+(value*250).toFixed()+',000');
				outstanding = (value*250).toFixed();
				updateFactoring();
			};
			$('invoiceValue').update('&pound;'+invoice.value+',000');	

		var percentage = new Control.Slider('percentageHandle','percentageTrack', {axis:'horizontal',sliderValue:0.8});
			percentage.options.onChange = function(value) {
				$('percentageValue').update((value*100).toFixed()+'%');
			};
			percentage.options.onSlide = function(value) {
				$('percentageValue').update((value*100).toFixed()+'%');
				percent = value;
				updateFactoring();
			};
			$('percentageValue').update((percentage.value*100).toFixed()+'%');
	}

	function updateFactoring() {
		$('factoringTotal').update('&pound;'+(outstanding * percent).toFixed()+',000');
	}

