Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

possible to do this calcluation in javascript 2

Status
Not open for further replies.

tyutghf

Technical User
Apr 12, 2008
258
GB
I have a spreadsheet with calculations in, enter some figures into some fields and a kind of pivot table is created which then generates the results.

Code:
[URL unfurl="true"]http://speedy.sh/CM3db/Website-Calculator.xlsx[/URL]

Is it possible to do this in javascript or will I need to use php and create temporary tables in a database to generate the figures from rows 11 to 27?

Thanks
 
yes. it is possible to do this calculation in javascript.
just the same way as you would do in php (probably).
 
How would it handle the rows 11 to 27 as each year uses previous years data? I initially thought of javascript to make the real time updating of the results instead of having to press submit.

When they initially asked me if it was possible they told me it was a case of

a1 - enter a figure
b1 - enter a figure
c1 - enter a figure

perform a calculation such as

d1 = (a1 + b1) / c1

but it's way more complicated. I'm eager to learn though :)
 
I looked at the spreadsheet but I could not see the complexity. It's just a calculation done on a running sum, so far as I can tell.

this code is a bit crude. it could be done in fewer lines and probably neater. but it works. the difference between the excel version and this can be traced to math precision differences between the browser engine and the excel engine.

Code:
<!DOCTYPE HTML>
<html>
	<head>
		<script  type="text/javascript" src="[URL unfurl="true"]https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>[/URL]
		<script type="text/javascript">
function calculateTable(){
	$('#calcTable tbody tr').remove();
	alert('called');
	var iValue = parseInt($('#valueInvestment').val());
	
	var existingRate = 		parseFloat( $('#existingTrailCommissionRate').val()/100 );
	var serviceInterval = 	parseFloat( $('#minServiceInterval').val() );
	var initialFeeRate = 	parseFloat( $('#initialFeePercentage').val() / 100 );
	var assumedGrowth = 	parseFloat( $('#assumedPercentageGrowth').val() / 100 );
	
	var col1 = new Array;
	var col2 = new Array;
	var col3 = new Array;
	var col4 = new Array;
	
	var runningSum = parseFloat(iValue);
	
	for(var i = 1; i <= $('#numYears').val(); i++){
		if (i == 1) {
			col1[i - 1] = (iValue * initialFeeRate) + serviceInterval;
			col2[i - 1] = (iValue * initialFeeRate) + serviceInterval;
			col3[i - 1] = existingRate * iValue;
			col4[i - 1] = existingRate * iValue;
		}
		else { 
			if (i == 2) {
				col1[i - 1] = 1.025 * serviceInterval;
			} else {
				col1[i - 1] = 1.025 * parseFloat(col1[i - 2]);
			}
			col2[i - 1] = col2[i - 2] + col1[i - 1];
			col3[i - 1] = parseFloat(existingRate) * parseFloat(runningSum);
			col4[i - 1] = parseFloat(col4[i - 2]) + parseFloat(col3[i - 1]);
		}	
		runningSum = runningSum * (1 + parseFloat(assumedGrowth));
	}
	for(var i = 0; i < col1.length; i++ ){
		var tr = $('<tr />');
		tr.append('<td>' + (i + 1) +  '</td>');
		var td = $('<td>' + addCommas(Math.round(col1[i])) + '</td>' );
		tr.append(td);
		var td = $('<td>' + addCommas(Math.round(col2[i])) + '</td>' );
		tr.append(td);
		
		var td = $('<td>' + addCommas(Math.round(col3[i])) + '</td>' );
		tr.append(td);
		var td = $('<td>' + addCommas(Math.round(col4[i])) + '</td>' );
		tr.append(td);
		if (i == col1.lenth - 1){
			
		}
		$('#calcTable tbody').append(tr);
	}

	$('#altFC').html( addCommas( Math.round(col2[ col2.length - 1 ]) ) );
	$('#currentTC').html( addCommas( Math.round(col4[ col4.length - 1 ]) ) );
	var t = Math.round( col4[ col4.length - 1 ] )  -  Math.round(col2[ col2.length - 1 ]);
	t = t < 0 ? 0: addCommas(t);
	$('#estCS').html(t);
	return false;
}
function addCommas(nStr) {
    nStr += '';
    x = nStr.split('.');
    x1 = x[0];
    x2 = x.length > 1 ? '.' + x[1] : '';
    var rgx = /(\d+)(\d{3})/;
    while (rgx.test(x1)) {
        x1 = x1.replace(rgx, '$1' + ',' + '$2');
    }
    return x1 + x2;
}

$(document).ready(function(){
	for(var i = .50; i<=1; i = i + .05){
		i = Math.round(i * 100) /100;
		var o = new Option(i ,i);
		$('#existingTrailCommissionRate').append( $(o) );
	}
	
	$('#calculate').on('click', function(e){
		e.preventDefault()
		calculateTable();
	});
	
});

		</script>
		<style type="text/css">
			td{
				text-align: center;
			}
			.row{ 
				clear: left; 
				overflow-y: hidden;
				width: 420px;
			}
			.row .label{ 
				width: 300px; 
				float:left;
			}
			.row .field{ 
				width: 100px; 
				float:left; 
				margin-left: 10px;
			}
			.row .field input, .row .field select { 
				width: 90%;
			} 
		</style>
	</head>
	<body>
		
		<form >
			<div class="row">
				<div class="label">
					Value of Investments
				</div>
				<div class="field">
					<input type="text" id="valueInvestment" name="valueInvestment" />
				</div>
			</div>
			<div class="row">
				<div class="label">
					Minimum Service Interval
				</div>
				<div class="field">
					<select name="minServiceInterval" id="minServiceInterval" >
						<option value="2877">Bi-Annual</option>
						<option value="1237">Annual</option>
						<option value="777">Two-Yearly</option>
					</select>
				</div>
			</div>
			<div class="row">
				<div class="label">
					Existing trail commission rate
				</div>
				<div class="field">
				<select name="existingTrailCommissionRate" id="existingTrailCommissionRate" >
						
				</select>
				</div>
			</div>
			<div class="row">
				<div class="label">
					Initial Fee Percentage
				</div>
				<div class="field">
					<input type="text" id="initialFeePercentage" name="initialFeePercentage" value="1" readonly="readonly" />
				</div>
			</div>
			<div class="row">
				<div class="label">
					Assumed percentage growth
				</div>
				<div class="field">
					<input type="text" id="assumedPercentageGrowth" name="assumedPercentageGrowth" />
				</div>
			</div>
			<div class="row">
				<div class="label">
					Number of years of comparison
				</div>
				<div class="field">
					<input type="text" id="numYears" name="numYears" />
				</div>
			</div>
			<div class="row">
				<div class="label">
					&nbsp;
				</div>
				<div class="field">
					<button id="calculate">Calculate</button>
				</div>
			</div>
		</form>
		
		<table id="calcTable">
			<thead>
				
			<tr>
				<th>Year</th>
				<th colspan="2">Charter Plus Options</th>
				<th colspan="2">Current Trail Options</th>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<th>Annual</th>
				<th>Cumulative</th>
				<th>Annual</th>
				<th>Cumulative</th>
			</tr>
			</thead>
			<tbody>
				
			</tbody>
		</table>
		<hr/>
		<div class="row">
			<div class="label">
				Current estimated "trail" cost"
			</div>
			<div class="field" id="currentTC">
				0
			</div>
		</div>
		<div class="row">
			<div class="label">
				Alternative fixed cost with G'eed Service
			</div>
			<div class="field" id="altFC">
				0
			</div>
		</div>
		<div class="row">
			<div class="label">
				Extimated cost saving
			</div>
			<div class="field" id="estCS">
				0
			</div>
		</div>
<script type="text/javascript">

</script>
	</body>
</html>
 
This is insane, you didn't think that was complicated? I have a lot to read up on :)

If I am being picky, the 'Initial Fee Percentage' field should be populated depending on the figure they type into the value field at the very top.

Just a question, how long have you been coding? This isn't my full time job but something I love doing so always jump at the chance of building something for our business but your skills are most definately something to aspire to.

Thanks
 
if you know a development or coding language then stuff like this takes 5 minutes, even I must say well done jpadie. I know it would take me a day to work this equation out.

Darryn Cooke
| Marketing and Creative Services
 
it was not one of the yellow fields in your spreadsheet. so I did not provide for it as a variable. but it is easily done by removing the readonly attribute.

add this to the document.ready() function (at the end) and it should work as was set up in the spreadsheet

Code:
	$('#valueInvestment').on('change', function(e){
		var v = parseInt($(this).val());
		var r;
		if (v >= 1000000 ){
			r = 1;
		} else {
			if ( v >= 750000){
				r = 0.5;
			} else {
				r = 0;
			}
		}
		$('#initialFeePercentage').val( r );
		
		$('#calcTable tbody tr').remove();
		$('#altFC').html( 0 );
		$('#currentTC').html( 0 );
		$('#estCS').html(0);
	});

I started coding in 1979 in Basic (zx80 and BBC), then in Pascal and some 3GL languages, as well as machine code, on RML machines in the 80s. took a long break in the mid-late 90s to get my name known in legal circles (I am a lawyer) and returned to coding in 2003 (mainly php). i have become more involved in javascript through my love of jQuery over the last couple of years.
 
It is really interesting to know the background of some of the folks on here thanks

I have formatted it and added a few other items such as percentage saving and a message depending on whether a saving can be made [smile]

They have slightly changed the way it works (!) however which I can't get my head around. They have added a new item in purple which changes the calculation on the first row which then changes column E throughout and also the final 'alternative' price figure

Code:
[URL unfurl="true"]http://speedy.sh/Qqj75/Website-Calculator-v2.xlsx[/URL]

Can you help one last time?

Here's the code following my changes

Code:
<!DOCTYPE HTML>
<html>
	<head>
		<script  type="text/javascript" src="[URL unfurl="true"]https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>[/URL]
		<script type="text/javascript">
function calculateTable(){
	$('#calcTable tbody tr').remove();
	
	//alert('called');
	var iValue = parseInt($('#valueInvestment').val());
	
	var existingRate = 		parseFloat( $('#existingTrailCommissionRate').val()/100 );
	var serviceInterval = 	parseFloat( $('#minServiceInterval').val() );
	var initialFeeRate = 	parseFloat( $('#initialFeePercentage').val() / 100 );
	var assumedGrowth = 	parseFloat( $('#assumedPercentageGrowth').val() / 100 );
	
	var col1 = new Array;
	var col2 = new Array;
	var col3 = new Array;
	var col4 = new Array;
	
	var runningSum = parseFloat(iValue);
	
	for(var i = 1; i <= $('#numYears').val(); i++){
		if (i == 1) {
			col1[i - 1] = (iValue * initialFeeRate) + serviceInterval;
			col2[i - 1] = (iValue * initialFeeRate) + serviceInterval;
			col3[i - 1] = existingRate * iValue;
			col4[i - 1] = existingRate * iValue;
		}
		else { 
			if (i == 2) {
				col1[i - 1] = 1.025 * serviceInterval;
			} else {
				col1[i - 1] = 1.025 * parseFloat(col1[i - 2]);
			}
			col2[i - 1] = col2[i - 2] + col1[i - 1];
			col3[i - 1] = parseFloat(existingRate) * parseFloat(runningSum);
			col4[i - 1] = parseFloat(col4[i - 2]) + parseFloat(col3[i - 1]);
		}	
		runningSum = runningSum * (1 + parseFloat(assumedGrowth));
	}
	for(var i = 0; i < col1.length; i++ ){
		var tr = $('<tr />');
		tr.append('<td>' + (i + 1) +  '</td>');
		var td = $('<td>' + addCommas(Math.round(col1[i])) + '</td>' );
		tr.append(td);
		var td = $('<td>' + addCommas(Math.round(col2[i])) + '</td>' );
		tr.append(td);
		
		var td = $('<td>' + addCommas(Math.round(col3[i])) + '</td>' );
		tr.append(td);
		var td = $('<td>' + addCommas(Math.round(col4[i])) + '</td>' );
		tr.append(td);
		if (i == col1.lenth - 1){
			
		}
		$('#calcTable tbody').append(tr);
	}

	$('#altFC').html( addCommas( Math.round(col2[ col2.length - 1 ]) ) );
		var ctc = addCommas( Math.round(col4[ col4.length - 1 ]) );
		$('#currentTC').html(ctc);
	var t = Math.round( col4[ col4.length - 1 ] )  -  Math.round(col2[ col2.length - 1 ]);
	t = t < 0 ? 0: addCommas(t);
	$('#estCS').html(t);
	
		if (t == 0) {
			$('#response').html("No saving");
		} else {
			$('#response').html("Woo hoo a saving");
		}
	$('#response').show("slow");
	
	$('#finalpercentage').html( (Math.round( col4[ col4.length - 1 ] )  -  Math.round(col2[ col2.length - 1 ])) / (Math.round(col4[ col4.length - 1 ])) * 100 );
	
	return false;
}
function addCommas(nStr) {
    nStr += '';
    x = nStr.split('.');
    x1 = x[0];
    x2 = x.length > 1 ? '.' + x[1] : '';
    var rgx = /(\d+)(\d{3})/;
    while (rgx.test(x1)) {
        x1 = x1.replace(rgx, '$1' + ',' + '$2');
    }
    return x1 + x2;
}

$(document).ready(function(){
	/*for(var i = .50; i<=1; i = i + .05){
		i = Math.round(i * 100) /100;
		var o = new Option(i ,i);
		$('#existingTrailCommissionRate').append( $(o) );
	}
	
	for(var i = 4; i<=9; i = i + .5){
		i = Math.round(i * 100) /100;
		var o = new Option(i ,i);
		$('#assumedPercentageGrowth').append( $(o) );
	}
	
	for(var i = 5; i<=15; i = i + 1){
		i = Math.round(i * 100) /100;
		var o = new Option(i ,i);
		$('#numYears').append( $(o) );
	}*/
	
	
	$('#calculate').on('click', function(e){
		e.preventDefault()
		calculateTable();
	});
	
	$('#valueInvestment').on('change', function(e){
		var v = parseInt($(this).val());
		var r;
		if (v >= 1000000 ){
			r = 1;
		} else {
			if ( v >= 750000){
				r = 0.5;
			} else {
				r = 0;
			}
		}
		$('#initialFeePercentage').val( r );
		
		$('#calcTable tbody tr').remove();
		$('#altFC').html( 0 );
		$('#currentTC').html( 0 );
		$('#estCS').html(0);
		
	});
	
});

		</script>
		<style type="text/css">
			td{
				text-align: center;
			}
			.row{ 
				clear: left; 
				overflow-y: hidden;
				width: 420px;
			}
			.row .label{ 
				width: 300px; 
				float:left;
			}
			.row .field{ 
				width: 100px; 
				float:left; 
				margin-left: 10px;
			}
			.row .field input, .row .field select { 
				width: 90%;
			} 
		</style>
	</head>
	<body>
		
		
		
        
        <form >
			<div class="calculator-question">
            	<label for="valueInvestment">Total value of your investments and pensions (&pound;)</label> 
                <input id="valueInvestment" type="text" name="valueInvestment" value="50000" onfocus="if (this.value == '50000') {this.value = '';}" onblur="if (this.value == '') {this.value = '50000';}" />
            </div>
            
			<div class="calculator-question">
            	<select class="dropdown" id="minServiceInterval" name="minServiceInterval">
            		<option value="2877">6 monthly</option>
					<option value="1237" selected>Annual</option>
					<option value="777">Two-Yearly</option>
                    <option value="0">No Service</option>
            	</select>
            	<label for="minServiceInterval">Required service frequency</label>
            </div>
            
            
			<div class="calculator-question">
            	<select class="dropdown" id="existingTrailCommissionRate" name="existingTrailCommissionRate">
                	<option value='0.5'>0.5</option>
                    <option value='0.55'>0.55</option>
                    <option value='0.6'>0.6</option>
                    <option value='0.65'>0.65</option>
                    <option value='0.7'>0.7</option>
                    <option value='0.75' selected>0.75</option>
                    <option value='0.8'>0.8</option>
                    <option value='0.85'>0.85</option>
                    <option value='0.9'>0.9</option>
                    <option value='0.95'>0.95</option>
                    <option value='1'>1</option>     
            	</select>
            	<label for="existingTrailCommissionRate">'Trail commission' payable on your existing plans</label>
            </div>
            
            <div class="calculator-question result initial-fee-percentage">
            	<label for="initialFeePercentage">Initial fee % (with trail)</label> 
                <input id="initialFeePercentage" type="text" name="initialFeePercentage" value="1" readonly />
            </div>
            
            <div class="calculator-question">
            	<select class="dropdown" id="assumedPercentageGrowth" name="assumedPercentageGrowth">
                	<option value='4'>4</option>
                    <option value='4.5'>4.5</option>
                    <option value='5'>5</option>
                    <option value='5.5'>5.5</option>
                    <option value='6' selected>6</option>
                    <option value='6.5'>6.5</option>
                    <option value='7'>7</option>
                    <option value='7.5'>7.5</option>
                    <option value='8'>8</option>
                    <option value='8.5'>8.5</option>
                    <option value='9'>9</option>
                    
            	</select>
            	<label for="assumedPercentageGrowth">Assumed annual growth in your investements</label>
            </div>
            
            <div class="calculator-question">
            	<select class="dropdown" id="numYears" name="numYears">
                	<option value='5'>5</option>
                    <option value='6'>6</option>
                    <option value='7'>7</option>
                    <option value='8'>8</option>
                    <option value='9'>9</option>
                    <option value='10' selected>10</option>
                    <option value='11'>11</option>
                    <option value='12'>12</option>
                    <option value='13'>13</option>
                    <option value='14'>14</option>
                    <option value='15'>15</option>
            	</select>
            	<label for="numYears">Period for cost comparison (years)</label>
            </div>
            
            
			<button class="calculator-submit" id="calculate">Calculate</button>
			
                
		</form>
		
		<table id="calcTable">
			<thead>
				
			<tr>
				<th>Year</th>
				<th colspan="2">Charter Plus Options</th>
				<th colspan="2">Current Trail Options</th>
			</tr>
			<tr>
				<th> </th>
				<th>Annual</th>
				<th>Cumulative</th>
				<th>Annual</th>
				<th>Cumulative</th>
			</tr>
			</thead>
			<tbody>
				
			</tbody>
		</table>
		<hr/>
		
        
        <div class="calculator-question result">Estimated 'trail commission' over period selected (&pound;)
        	<div class="calcresult" id="currentTC">
				0
			</div>
        </div>
        
        <div class="calculator-question result">Alternative fixed price* with selected level of service (subject to terms and conditions)  (&pound;)
        	<div class="calcresult" id="altFC">
				0
			</div>
        </div>
        
        <div class="calculator-question result">Estimated cost saving (&pound;)
        	<div class="calcresult" id="estCS">
				0
			</div>
        </div>
        
        <div class="calculator-question result">Percentage saving (%)
        	<div class="calcresult" id="finalpercentage">
				0
			</div>
        </div>
        
        
        <div id='response' class='calculator-question calulator-response' style='display: none'>
        	
        </div>
	</body>
</html>
 
not got a lot of time to look at this but i suspect that this would work

Code:
<!DOCTYPE HTML>
<html>
    <head>
    	<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
        <script type="text/javascript" src="[URL unfurl="true"]https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">[/URL]
        </script>
        <script type="text/javascript">
            function calculateTable(){
                $('#calcTable tbody tr').remove();
                
                //alert('called');
                var iValue = parseInt($('#valueInvestment').val());
                var B5 = iValue;
                var existingRate = parseFloat($('#existingTrailCommissionRate').val() / 100);
                var serviceInterval = parseFloat($('#minServiceInterval').val());
                var initialFeeRate = parseFloat($('#initialFeePercentage').val() / 100);
                var assumedGrowth = parseFloat($('#assumedPercentageGrowth').val() / 100);
                
                var col1 = new Array;
                var col2 = new Array;
                var col3 = new Array;
                var col4 = new Array;
				var col5 = new Array;
                
                var runningSum = parseFloat(iValue);
                
                for (var i = 1; i <= $('#numYears').val(); i++) {
                    if (i == 1) {
                        col1[i - 1] = (iValue * initialFeeRate) + serviceInterval;
                        col2[i - 1] = (iValue * initialFeeRate) + serviceInterval;
                        col3[i - 1] = existingRate * iValue;
                        col4[i - 1] = existingRate * iValue;
						col5[i - 1] = 790;
                    }
                    else {
                        if (i == 2) {
                            col1[i - 1] = 1.025 * serviceInterval;
							col5[i - 1] = B5<=100000 	? B5 * 0.015 + 790 
													: ( 
														B5<=500000 
															? ((B5-100000)*0.01)+2290 
															: ((B5-500000)*0.005)+6290
														);
                        }
                        else {
                            col1[i - 1] = 1.025 * parseFloat(col1[i - 2]);
							col5[i - 1] = "&nbsp;";
                        }
                        col2[i - 1] = col2[i - 2] + col1[i - 1];
                        col3[i - 1] = parseFloat(existingRate) * parseFloat(runningSum);
                        col4[i - 1] = parseFloat(col4[i - 2]) + parseFloat(col3[i - 1]);
                    }
                    runningSum = runningSum * (1 + parseFloat(assumedGrowth));
                }
                for (var i = 0; i < col1.length; i++) {
                    var tr = $('<tr />');
                    tr.append('<td>' + (i + 1) + '</td>');
                    var td = $('<td>' + addCommas(Math.round(col1[i])) + '</td>');
                    tr.append(td);
                    var td = $('<td>' + addCommas(Math.round(col2[i])) + '</td>');
                    tr.append(td);
                    
                    var td = $('<td>' + addCommas(Math.round(col3[i])) + '</td>');
                    tr.append(td);
                    var td = $('<td>' + addCommas(Math.round(col4[i])) + '</td>');
                    tr.append(td);
                    var td = $('<td>' + (col5[i] == '&nbsp;' ? '&nbsp;' : addCommas(Math.round(col5[i]))) + '</td>');
					tr.append(td);
                    $('#calcTable tbody').append(tr);
                }
                
                $('#altFC').html(addCommas(Math.round(col2[col2.length - 1])));
                var ctc = addCommas(Math.round(col4[col4.length - 1]));
                $('#currentTC').html(ctc);
                var t = Math.round(col4[col4.length - 1]) - Math.round(col2[col2.length - 1]);
                //t = t < 0 ? 0 : addCommas(t);
				
                $('#estCS').html( t < 0 ? 0 : addCommas(t) );
				var pc = (Math.round(col4[col4.length - 1]) - Math.round(col2[col2.length - 1]))
													/
												Math.round(col4[col4.length - 1]);
				$('finalPercentage').html( 	pc <= 0 ? "0%" : addCommas(Math.round(pc))  );
                
                if (t == 0) {
                    $('#response').html("No saving");
                }
                else {
                    $('#response').html("Woo hoo a saving");
                }
                $('#response').show("slow");
                
                $('#response').html( 	pc <= 0 
										? "Although we can't save you money today, we will guarantee future service at your selected frequency" 
										: (
											pc >= 0.35
											? "By contacting us you are likely to make a substantial saving! Why not phone us today!"
											: "Contact us today to find out more about our fixed price contract!"
											)
								);
                return false;
            }
            
            function addCommas(nStr){
				if(nStr == '&nbsp') return nStr;
                nStr += '';
                x = nStr.split('.');
                x1 = x[0];
                x2 = x.length > 1 ? '.' + x[1] : '';
                var rgx = /(\d+)(\d{3})/;
                while (rgx.test(x1)) {
                    x1 = x1.replace(rgx, '$1' + ',' + '$2');
                }
                return x1 + x2;
            }
            
            $(document).ready(function(){
                /*for(var i = .50; i<=1; i = i + .05){
                 i = Math.round(i * 100) /100;
                 var o = new Option(i ,i);
                 $('#existingTrailCommissionRate').append( $(o) );
                 }
                 
                 for(var i = 4; i<=9; i = i + .5){
                 i = Math.round(i * 100) /100;
                 var o = new Option(i ,i);
                 $('#assumedPercentageGrowth').append( $(o) );
                 }
                 
                 for(var i = 5; i<=15; i = i + 1){
                 i = Math.round(i * 100) /100;
                 var o = new Option(i ,i);
                 $('#numYears').append( $(o) );
                 }*/
                $('#calculate').on('click', function(e){
                    e.preventDefault()
                    calculateTable();
                });
                
				
                $('#minServiceInterval').on('change', function(e){
                    var v = parseInt($(this).val());
                    var r;
                    if (v >= 1000000) {
                        r = 1;
                    }
                    else {
                        if (v >= 750000) {
                            r = 0.5;
                        }
                        else {
                            r = 0;
                        }
                    }
					alert(r);
                    $('#initialFeePercentage').val(r);
                    
                    $('#calcTable tbody tr').remove();
                    $('#altFC').html(0);
                    $('#currentTC').html(0);
                    $('#estCS').html(0);
                    
                });
                
            });
            
        </script>
        <style type="text/css">
            td {
                text-align: center;
            }
            
            .row {
                clear: left;
                overflow-y: hidden;
                width: 420px;
            }
            
            .row .label {
                width: 300px;
                float: left;
            }
            
            .row .field {
                width: 100px;
                float: left;
                margin-left: 10px;
            }
            
            .row .field input, .row .field select {
                width: 90%;
            }
        </style>
    </head>
    <body>
        <form>
            <div class="calculator-question">
                <label for="valueInvestment">
                    Total value of your investments and pensions (£)
                </label>
                <input id="valueInvestment" type="text" name="valueInvestment" value="50000" onfocus="if (this.value == '50000') {this.value = '';}" onblur="if (this.value == '') {this.value = '50000';}"/>
            </div>
            <div class="calculator-question">
                <select class="dropdown" id="minServiceInterval" name="minServiceInterval">
                    <option value="2877">6 monthly</option>
                    <option value="1237" selected="selected">Annual</option>
                    <option value="777">Two-Yearly</option>
                    <option value="0">No Service</option>
                </select>
                <label for="minServiceInterval">
                    Required service frequency
                </label>
            </div>
            <div class="calculator-question">
                <select class="dropdown" id="existingTrailCommissionRate" name="existingTrailCommissionRate">
                    <option value='0.5'>0.5</option>
                    <option value='0.55'>0.55</option>
                    <option value='0.6'>0.6</option>
                    <option value='0.65'>0.65</option>
                    <option value='0.7'>0.7</option>
                    <option value='0.75' selected="selected">0.75 </option>
                    <option value='0.8'>0.8</option>
                    <option value='0.85'>0.85</option>
                    <option value='0.9'>0.9</option>
                    <option value='0.95'>0.95</option>
                    <option value='1'>1</option>
                </select>
                <label for="existingTrailCommissionRate">
                    'Trail commission' payable on your existing plans
                </label>
            </div>
            <div class="calculator-question result initial-fee-percentage">
                <label for="initialFeePercentage">
                    Initial fee % (with trail)
                </label>
                <input id="initialFeePercentage" type="text" name="initialFeePercentage" value="1" readonly/>
            </div>
            <div class="calculator-question">
                <select class="dropdown" id="assumedPercentageGrowth" name="assumedPercentageGrowth">
                    <option value='4'>4</option>
                    <option value='4.5'>4.5</option>
                    <option value='5'>5</option>
                    <option value='5.5'>5.5</option>
                    <option value='6' selected="selected">6 </option>
                    <option value='6.5'>6.5</option>
                    <option value='7'>7</option>
                    <option value='7.5'>7.5</option>
                    <option value='8'>8</option>
                    <option value='8.5'>8.5</option>
                    <option value='9'>9</option>
                </select>
                <label for="assumedPercentageGrowth">
                    Assumed annual growth in your investements
                </label>
            </div>
            <div class="calculator-question">
                <select class="dropdown" id="numYears" name="numYears">
                    <option value='5'>5</option>
                    <option value='6'>6</option>
                    <option value='7'>7</option>
                    <option value='8'>8</option>
                    <option value='9'>9</option>
                    <option value='10' selected="selected">10 </option>
                    <option value='11'>11</option>
                    <option value='12'>12</option>
                    <option value='13'>13</option>
                    <option value='14'>14</option>
                    <option value='15'>15</option>
                </select>
                <label for="numYears">
                    Period for cost comparison (years)
                </label>
            </div>
            <button class="calculator-submit" id="calculate">
                Calculate
            </button>
        </form>
        <table id="calcTable">
            <thead>
                <tr>
                    <th>
                        Year
                    </th>
                    <th colspan="2">
                        Charter Plus Options
                    </th>
                    <th colspan="2">
                        Current Trail Options
                    </th>
					<th >
                        No Service
                    </th>
                </tr>
                <tr>
                    <th>
                    	&nbsp;
                    </th>
                    <th>
                        Annual
                    </th>
                    <th>
                        Cumulative
                    </th>
                    <th>
                        Annual
                    </th>
                    <th>
                        Cumulative
                    </th>
					<th>
						&nbsp;
					</th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
        <hr/>
        <div class="calculator-question result">
            Estimated 'trail commission' over period selected (£)
            <div class="calcresult" id="currentTC">
                0
            </div>
        </div>
        <div class="calculator-question result">
            Alternative fixed price* with selected level of service (subject to terms and conditions)  (£)
            <div class="calcresult" id="altFC">
                0
            </div>
        </div>
        <div class="calculator-question result">
            Estimated cost saving (£)
            <div class="calcresult" id="estCS">
                0
            </div>
        </div>
        <div class="calculator-question result">
            Percentage saving (%)
            <div class="calcresult" id="finalpercentage">
                0
            </div>
        </div>
        <div id='response' class='calculator-question calculator-response' style='display: none'>
        </div>
    </body>
</html>
 
Hi

Sorry to drudge this up, I have tried to make it work but I am messing it up in ways you won't believe.

Your version didn't give the same output as the new spreadsheet gives and I have been trying to figure it out for weeks with no luck. Is there any chance you could help one last time?

Thanks
 
btw - i'm assuming you're going to give me a bit more to go on than 'not the same output'? i.e. the 'new' spreadsheet and where you see the discrepancies?
 
Sorry yes that would be helpful wouldn't it.

The 'estimated commission' (B29) is correct but the 'alternative price' (B30) is coming out different now they have introduced the purple background changes on the xls. The D and E columns are now all 0 and I can't figure out what they have done with the calculations.

Thanks
 
Oh yes the previous link expired

Code:
[URL unfurl="true"]http://speedy.sh/2aurY/Website-Calculator-v2.xlsx[/URL]
 
i have tried a few permutations and this seems to work ok. if you find issues could you post back with the permutations that cause the issues?

Code:
[COLOR=#990000]<![/color]DOCTYPE HTML[COLOR=#990000]>[/color]
[COLOR=#990000]<[/color]html[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]head[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]meta http[COLOR=#990000]-[/color]equiv[COLOR=#990000]=[/color][COLOR=#FF0000]'Content-Type'[/color] content[COLOR=#990000]=[/color][COLOR=#FF0000]'text/html; charset=utf-8'[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]script type[COLOR=#990000]=[/color][COLOR=#FF0000]"text/javascript"[/color] src[COLOR=#990000]=[/color][COLOR=#FF0000]"[URL unfurl="true"]https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"[/URL][/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]script[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]script type[COLOR=#990000]=[/color][COLOR=#FF0000]"text/javascript"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]calculateTable[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#calcTable tbody tr'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]remove[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab][i][COLOR=#9A1900]//alert('called');[/color][/i]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] iValue [COLOR=#990000]=[/color] [b][COLOR=#000000]parseInt[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'#valueInvestment'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]());[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] B5 [COLOR=#990000]=[/color] iValue[COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] existingRate [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'#existingTrailCommissionRate'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]()[/color] [COLOR=#990000]/[/color] [COLOR=#993399]100[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] serviceInterval [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'#minServiceInterval'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]());[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] initialFeeRate [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'#initialFeePercentage'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]()[/color] [COLOR=#990000]/[/color] [COLOR=#993399]100[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] assumedGrowth [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'#assumedPercentageGrowth'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]()[/color] [COLOR=#990000]/[/color] [COLOR=#993399]100[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] col1 [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] Array[COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] col2 [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] Array[COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] col3 [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] Array[COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] col4 [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] Array[COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] col5 [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] Array[COLOR=#990000];[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] runningSum [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]iValue[COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]for[/color][/b] [COLOR=#990000]([/color][b][COLOR=#0000FF]var[/color][/b] i [COLOR=#990000]=[/color] [COLOR=#993399]1[/color][COLOR=#990000];[/color] i [COLOR=#990000]<=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'#numYears'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]();[/color] i[COLOR=#990000]++)[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color]i [COLOR=#990000]==[/color] [COLOR=#993399]1[/color][COLOR=#990000])[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][tab]col1[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#990000]([/color]iValue [COLOR=#990000]*[/color] initialFeeRate[COLOR=#990000])[/color] [COLOR=#990000]+[/color] serviceInterval[COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab]col2[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#990000]([/color]iValue [COLOR=#990000]*[/color] initialFeeRate[COLOR=#990000])[/color] [COLOR=#990000]+[/color] serviceInterval[COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab]col3[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] existingRate [COLOR=#990000]*[/color] iValue[COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab]col4[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] existingRate [COLOR=#990000]*[/color] iValue[COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab]col5[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#993399]790[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]else[/color][/b] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color]i [COLOR=#990000]==[/color] [COLOR=#993399]2[/color][COLOR=#990000])[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][tab][tab]col1[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#993399]1.025[/color] [COLOR=#990000]*[/color] serviceInterval[COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab][tab]col5[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] B5[COLOR=#990000]<=[/color][COLOR=#993399]100000[/color][tab][COLOR=#990000]?[/color] B5 [COLOR=#990000]*[/color] [COLOR=#993399]0.015[/color] [COLOR=#990000]+[/color] [COLOR=#993399]790[/color] 
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][COLOR=#990000]:[/color] [COLOR=#990000]([/color] 
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab]B5[COLOR=#990000]<=[/color][COLOR=#993399]500000[/color] 
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][COLOR=#990000]?[/color] [COLOR=#990000](([/color]B5[COLOR=#990000]-[/color][COLOR=#993399]100000[/color][COLOR=#990000])*[/color][COLOR=#993399]0.01[/color][COLOR=#990000])+[/color][COLOR=#993399]2290[/color] 
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][COLOR=#990000]:[/color] [COLOR=#990000](([/color]B5[COLOR=#990000]-[/color][COLOR=#993399]500000[/color][COLOR=#990000])*[/color][COLOR=#993399]0.005[/color][COLOR=#990000])+[/color][COLOR=#993399]6290[/color]
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][tab][tab][b][COLOR=#0000FF]else[/color][/b] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][tab][tab]col1[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#993399]1.025[/color] [COLOR=#990000]*[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]col1[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]2[/color][COLOR=#990000]]);[/color]
[tab][tab][tab][tab][tab][tab][tab]col5[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]" "[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][tab][tab]col2[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] col2[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]2[/color][COLOR=#990000]][/color] [COLOR=#990000]+[/color] col1[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]];[/color]
[tab][tab][tab][tab][tab][tab]col3[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]existingRate[COLOR=#990000])[/color] [COLOR=#990000]*[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]runningSum[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][tab]col4[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]col4[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]2[/color][COLOR=#990000]])[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]col3[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]]);[/color]
[tab][tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][tab]runningSum [COLOR=#990000]=[/color] runningSum [COLOR=#990000]*[/color] [COLOR=#990000]([/color][COLOR=#993399]1[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]assumedGrowth[COLOR=#990000]));[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]for[/color][/b] [COLOR=#990000]([/color][b][COLOR=#0000FF]var[/color][/b] i [COLOR=#990000]=[/color] [COLOR=#993399]0[/color][COLOR=#990000];[/color] i [COLOR=#990000]<[/color] col1[COLOR=#990000].[/color]length[COLOR=#990000];[/color] i[COLOR=#990000]++)[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] tr [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'<tr />'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'<td>'[/color] [COLOR=#990000]+[/color] [COLOR=#990000]([/color]i [COLOR=#990000]+[/color] [COLOR=#993399]1[/color][COLOR=#990000])[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'</td>'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] td [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'<td>'[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col1[COLOR=#990000][[/color]i[COLOR=#990000]]))[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'</td>'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]td[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] td [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'<td>'[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col2[COLOR=#990000][[/color]i[COLOR=#990000]]))[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'</td>'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]td[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] td [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'<td>'[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col3[COLOR=#990000][[/color]i[COLOR=#990000]]))[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'</td>'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]td[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] td [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'<td>'[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col4[COLOR=#990000][[/color]i[COLOR=#990000]]))[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'</td>'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]td[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] td [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'<td>'[/color] [COLOR=#990000]+[/color] [COLOR=#990000]([/color]col5[COLOR=#990000][[/color]i[COLOR=#990000]][/color] [COLOR=#990000]==[/color] [COLOR=#FF0000]' '[/color] [COLOR=#990000]?[/color] [COLOR=#FF0000]' '[/color] [COLOR=#990000]:[/color] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col5[COLOR=#990000][[/color]i[COLOR=#990000]])))[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'</td>'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]td[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#calcTable tbody'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]tr[COLOR=#990000]);[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#altFC'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col2[COLOR=#990000][[/color]col2[COLOR=#990000].[/color]length [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]])));[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] ctc [COLOR=#990000]=[/color] Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col4[COLOR=#990000][[/color]col4[COLOR=#990000].[/color]length [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]]);[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#currentTC'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]ctc[COLOR=#990000]));[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] t [COLOR=#990000]=[/color] Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col4[COLOR=#990000][[/color]col4[COLOR=#990000].[/color]length [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]])[/color] [COLOR=#990000]-[/color] Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col2[COLOR=#990000][[/color]col2[COLOR=#990000].[/color]length [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]]);[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#estCS'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color] t [COLOR=#990000]<[/color] [COLOR=#993399]0[/color] [COLOR=#990000]?[/color] [COLOR=#993399]0[/color] [COLOR=#990000]:[/color] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]t[COLOR=#990000])[/color] [COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] pc [COLOR=#990000]=[/color] Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]t[COLOR=#990000]/[/color]ctc [COLOR=#990000]*[/color] [COLOR=#993399]1000[/color][COLOR=#990000])/[/color][COLOR=#993399]10[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#finalpercentage'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color] pc [COLOR=#990000]+[/color] [COLOR=#FF0000]"%"[/color] [COLOR=#990000])[/color] [COLOR=#990000];[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color]t [COLOR=#990000]==[/color] [COLOR=#993399]0[/color][COLOR=#990000])[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#response'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]"No saving"[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]else[/color][/b] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#response'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]"Woo hoo a saving"[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#response'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]show[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]"slow"[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#response'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][tab]pc [COLOR=#990000]<=[/color] [COLOR=#993399]0[/color] 
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][COLOR=#990000]?[/color] [COLOR=#FF0000]"Although we can't save you money today, we will guarantee future service at your selected frequency"[/color] 
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][COLOR=#990000]:[/color] [COLOR=#990000]([/color]
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab]pc [COLOR=#990000]>=[/color] [COLOR=#993399]0.35[/color]
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][COLOR=#990000]?[/color] [COLOR=#FF0000]"By contacting us you are likely to make a substantial saving! Why not phone us today!"[/color]
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][COLOR=#990000]:[/color] [COLOR=#FF0000]"Contact us today to find out more about our fixed price contract!"[/color]
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][tab][COLOR=#990000])[/color]
[tab][tab][tab][tab][tab][tab][tab][tab][COLOR=#990000]);[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]return[/color][/b] [b][COLOR=#0000FF]false[/color][/b][COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab]
[tab][tab][tab][b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]nStr[COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]if[/color][/b][COLOR=#990000]([/color]nStr [COLOR=#990000]==[/color] [COLOR=#FF0000]' '[/color][COLOR=#990000])[/color] [b][COLOR=#0000FF]return[/color][/b] nStr[COLOR=#990000];[/color]
[tab][tab][tab][tab]nStr [COLOR=#990000]+=[/color] [COLOR=#FF0000]''[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab]x [COLOR=#990000]=[/color] nStr[COLOR=#990000].[/color][b][COLOR=#000000]split[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'.'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]x1 [COLOR=#990000]=[/color] x[COLOR=#990000][[/color][COLOR=#993399]0[/color][COLOR=#990000]];[/color]
[tab][tab][tab][tab]x2 [COLOR=#990000]=[/color] x[COLOR=#990000].[/color]length [COLOR=#990000]>[/color] [COLOR=#993399]1[/color] [COLOR=#990000]?[/color] [COLOR=#FF0000]'.'[/color] [COLOR=#990000]+[/color] x[COLOR=#990000][[/color][COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]:[/color] [COLOR=#FF0000]''[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] rgx [COLOR=#990000]=[/color] [COLOR=#FF6600]/(\d+)(\d{3})/[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]while[/color][/b] [COLOR=#990000]([/color]rgx[COLOR=#990000].[/color][b][COLOR=#000000]test[/color][/b][COLOR=#990000]([/color]x1[COLOR=#990000]))[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab]x1 [COLOR=#990000]=[/color] x1[COLOR=#990000].[/color][b][COLOR=#000000]replace[/color][/b][COLOR=#990000]([/color]rgx[COLOR=#990000],[/color] [COLOR=#FF0000]'$1'[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]','[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'$2'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]return[/color][/b] x1 [COLOR=#990000]+[/color] x2[COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab]
[tab][tab][tab]$[COLOR=#990000]([/color]document[COLOR=#990000]).[/color][b][COLOR=#000000]ready[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][i][COLOR=#9A1900]/*for(var i = .50; i<=1; i = i + .05){[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] i = Math.round(i * 100) /100;[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] var o = new Option(i ,i);[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] $('#existingTrailCommissionRate').append( $(o) );[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] }[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] [/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] for(var i = 4; i<=9; i = i + .5){[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] i = Math.round(i * 100) /100;[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] var o = new Option(i ,i);[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] $('#assumedPercentageGrowth').append( $(o) );[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] }[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] [/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] for(var i = 5; i<=15; i = i + 1){[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] i = Math.round(i * 100) /100;[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] var o = new Option(i ,i);[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] $('#numYears').append( $(o) );[/color][/i]
[i][COLOR=#9A1900][tab][tab][tab][tab] }*/[/color][/i]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#calculate'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]on[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'click'[/color][COLOR=#990000],[/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]([/color]e[COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab]e[COLOR=#990000].[/color][b][COLOR=#000000]preventDefault[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#minServiceInterval'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]change[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab][tab][b][COLOR=#000000]calculateTable[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#minServiceInterval'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]on[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'change'[/color][COLOR=#990000],[/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]([/color]e[COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] B5 [COLOR=#990000]=[/color] [b][COLOR=#000000]parseInt[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'#valueInvestment'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]());[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] I2 [COLOR=#990000]=[/color] [COLOR=#993399]0[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] v [COLOR=#990000]=[/color] [b][COLOR=#000000]parseInt[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][b][COLOR=#0000FF]this[/color][/b][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]());[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] D6 [COLOR=#990000]=[/color] v[COLOR=#990000];[/color]
[tab][tab][tab][tab][tab]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] r [COLOR=#990000]=[/color] D6[COLOR=#990000]==[/color][COLOR=#993399]0[/color] [COLOR=#990000]?[/color] [COLOR=#993399]0[/color] [COLOR=#990000]:[/color] B5 [COLOR=#990000]<[/color] [COLOR=#993399]500000[/color] [COLOR=#990000]?[/color] [COLOR=#993399]0[/color] [COLOR=#990000]:[/color] B5 [COLOR=#990000]<=[/color] [COLOR=#993399]750000[/color] [COLOR=#990000]?[/color] [COLOR=#993399]0.5[/color] [COLOR=#990000]:[/color] B5 [COLOR=#990000]<=[/color] [COLOR=#993399]1000000[/color] [COLOR=#990000]?[/color] [COLOR=#993399]1[/color] [COLOR=#990000]:[/color] [COLOR=#993399]0[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab][tab]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#initialFeePercentage'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]([/color]r[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#calcTable tbody tr'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]remove[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#altFC'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][COLOR=#993399]0[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#currentTC'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][COLOR=#993399]0[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#estCS'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][COLOR=#993399]0[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#minServiceInterval'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]change[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][COLOR=#FF0000]}[/color][COLOR=#990000]);[/color]
[tab][tab][tab]
[tab][tab][COLOR=#990000]</[/color]script[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]style type[COLOR=#990000]=[/color][COLOR=#FF0000]"text/css"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]td [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab]text[COLOR=#990000]-[/color]align[COLOR=#990000]:[/color] center[COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab]
[tab][tab][tab][COLOR=#990000].[/color]row [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab]clear[COLOR=#990000]:[/color] left[COLOR=#990000];[/color]
[tab][tab][tab][tab]overflow[COLOR=#990000]-[/color]y[COLOR=#990000]:[/color] hidden[COLOR=#990000];[/color]
[tab][tab][tab][tab]width[COLOR=#990000]:[/color] 420px[COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab]
[tab][tab][tab][COLOR=#990000].[/color]row [COLOR=#990000].[/color]label [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab]width[COLOR=#990000]:[/color] 300px[COLOR=#990000];[/color]
[tab][tab][tab][tab]float[COLOR=#990000]:[/color] left[COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab]
[tab][tab][tab][COLOR=#990000].[/color]row [COLOR=#990000].[/color]field [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab]width[COLOR=#990000]:[/color] 100px[COLOR=#990000];[/color]
[tab][tab][tab][tab]float[COLOR=#990000]:[/color] left[COLOR=#990000];[/color]
[tab][tab][tab][tab]margin[COLOR=#990000]-[/color]left[COLOR=#990000]:[/color] 10px[COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab]
[tab][tab][tab][COLOR=#990000].[/color]row [COLOR=#990000].[/color]field input[COLOR=#990000],[/color] [COLOR=#990000].[/color]row [COLOR=#990000].[/color]field select [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab]width[COLOR=#990000]:[/color] [COLOR=#993399]90[/color][COLOR=#990000]%;[/color]
[tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][COLOR=#990000]</[/color]style[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]head[COLOR=#990000]>[/color]
[tab][COLOR=#990000]<[/color]body[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]form action[COLOR=#990000]=[/color][COLOR=#FF0000]"somepage.php"[/color] method[COLOR=#990000]=[/color][COLOR=#FF0000]"post"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calculator-question"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]label [b][COLOR=#0000FF]for[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"valueInvestment"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab]Total value of your investments and [b][COLOR=#000000]pensions[/color][/b] [COLOR=#990000]([/color]£[COLOR=#990000])[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]label[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]input id[COLOR=#990000]=[/color][COLOR=#FF0000]"valueInvestment"[/color] type[COLOR=#990000]=[/color][COLOR=#FF0000]"text"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"valueInvestment"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"500000"[/color] onfocus[COLOR=#990000]=[/color][COLOR=#FF0000]"if (this.value == '50000') {this.value = '';}"[/color] onblur[COLOR=#990000]=[/color][COLOR=#FF0000]"if (this.value == '') {this.value = '50000';}"[/color][COLOR=#990000]/>[/color]
[tab][tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calculator-question"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]select [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"dropdown"[/color] id[COLOR=#990000]=[/color][COLOR=#FF0000]"minServiceInterval"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"minServiceInterval"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]"2877"[/color][COLOR=#990000]>[/color][COLOR=#993399]6[/color] monthly[COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]"1237"[/color] [COLOR=#990000]>[/color]Annual[COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]"777"[/color] selected[COLOR=#990000]=[/color][COLOR=#FF0000]"selected"[/color][COLOR=#990000]>[/color]Two[COLOR=#990000]-[/color]Yearly[COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]"0"[/color][COLOR=#990000]>[/color]No Service[COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]select[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]label [b][COLOR=#0000FF]for[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"minServiceInterval"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab]Required service frequency
[tab][tab][tab][tab][COLOR=#990000]</[/color]label[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calculator-question"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]select [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"dropdown"[/color] id[COLOR=#990000]=[/color][COLOR=#FF0000]"existingTrailCommissionRate"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"existingTrailCommissionRate"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'0.5'[/color] selected[COLOR=#990000]=[/color][COLOR=#FF0000]"selected"[/color][COLOR=#990000]>[/color][COLOR=#993399]0.5[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'0.55'[/color][COLOR=#990000]>[/color][COLOR=#993399]0.55[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'0.6'[/color][COLOR=#990000]>[/color][COLOR=#993399]0.6[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'0.65'[/color][COLOR=#990000]>[/color][COLOR=#993399]0.65[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'0.7'[/color][COLOR=#990000]>[/color][COLOR=#993399]0.7[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'0.75'[/color][COLOR=#990000]>[/color][COLOR=#993399]0.75[/color] [COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'0.8'[/color][COLOR=#990000]>[/color][COLOR=#993399]0.8[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'0.85'[/color][COLOR=#990000]>[/color][COLOR=#993399]0.85[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'0.9'[/color][COLOR=#990000]>[/color][COLOR=#993399]0.9[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'0.95'[/color][COLOR=#990000]>[/color][COLOR=#993399]0.95[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'1'[/color][COLOR=#990000]>[/color][COLOR=#993399]1[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]select[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]label [b][COLOR=#0000FF]for[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"existingTrailCommissionRate"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#FF0000]'Trail commission'[/color] payable on your existing plans
[tab][tab][tab][tab][COLOR=#990000]</[/color]label[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calculator-question result initial-fee-percentage"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]label [b][COLOR=#0000FF]for[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"initialFeePercentage"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab]Initial fee [COLOR=#990000]%[/color] [COLOR=#990000]([/color][b][COLOR=#0000FF]with[/color][/b] trail[COLOR=#990000])[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]label[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]input id[COLOR=#990000]=[/color][COLOR=#FF0000]"initialFeePercentage"[/color] type[COLOR=#990000]=[/color][COLOR=#FF0000]"text"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"initialFeePercentage"[/color] value[COLOR=#990000]=[/color][COLOR=#FF0000]"1"[/color] readonly[COLOR=#990000]/>[/color]
[tab][tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calculator-question"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]select [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"dropdown"[/color] id[COLOR=#990000]=[/color][COLOR=#FF0000]"assumedPercentageGrowth"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"assumedPercentageGrowth"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'4'[/color] selected[COLOR=#990000]=[/color][COLOR=#FF0000]"selected"[/color][COLOR=#990000]>[/color][COLOR=#993399]4[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'4.5'[/color][COLOR=#990000]>[/color][COLOR=#993399]4.5[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'5'[/color][COLOR=#990000]>[/color][COLOR=#993399]5[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'5.5'[/color][COLOR=#990000]>[/color][COLOR=#993399]5.5[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'6'[/color] [COLOR=#990000]>[/color][COLOR=#993399]6[/color] [COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'6.5'[/color][COLOR=#990000]>[/color][COLOR=#993399]6.5[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'7'[/color][COLOR=#990000]>[/color][COLOR=#993399]7[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'7.5'[/color][COLOR=#990000]>[/color][COLOR=#993399]7.5[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'8'[/color][COLOR=#990000]>[/color][COLOR=#993399]8[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'8.5'[/color][COLOR=#990000]>[/color][COLOR=#993399]8.5[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'9'[/color][COLOR=#990000]>[/color][COLOR=#993399]9[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]select[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]label [b][COLOR=#0000FF]for[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"assumedPercentageGrowth"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab]Assumed annual growth [b][COLOR=#0000FF]in[/color][/b] your investements
[tab][tab][tab][tab][COLOR=#990000]</[/color]label[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calculator-question"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]select [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"dropdown"[/color] id[COLOR=#990000]=[/color][COLOR=#FF0000]"numYears"[/color] name[COLOR=#990000]=[/color][COLOR=#FF0000]"numYears"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'5'[/color][COLOR=#990000]>[/color][COLOR=#993399]5[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'6'[/color][COLOR=#990000]>[/color][COLOR=#993399]6[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'7'[/color][COLOR=#990000]>[/color][COLOR=#993399]7[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'8'[/color][COLOR=#990000]>[/color][COLOR=#993399]8[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'9'[/color][COLOR=#990000]>[/color][COLOR=#993399]9[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'10'[/color] selected[COLOR=#990000]=[/color][COLOR=#FF0000]"selected"[/color][COLOR=#990000]>[/color][COLOR=#993399]10[/color] [COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'11'[/color][COLOR=#990000]>[/color][COLOR=#993399]11[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'12'[/color][COLOR=#990000]>[/color][COLOR=#993399]12[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'13'[/color][COLOR=#990000]>[/color][COLOR=#993399]13[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'14'[/color][COLOR=#990000]>[/color][COLOR=#993399]14[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]option value[COLOR=#990000]=[/color][COLOR=#FF0000]'15'[/color][COLOR=#990000]>[/color][COLOR=#993399]15[/color][COLOR=#990000]</[/color]option[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]select[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]label [b][COLOR=#0000FF]for[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"numYears"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab]Period [b][COLOR=#0000FF]for[/color][/b] cost [b][COLOR=#000000]comparison[/color][/b] [COLOR=#990000]([/color]years[COLOR=#990000])[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]label[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]button [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calculator-submit"[/color] id[COLOR=#990000]=[/color][COLOR=#FF0000]"calculate"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab]Calculate
[tab][tab][tab][COLOR=#990000]</[/color]button[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]form[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]table id[COLOR=#990000]=[/color][COLOR=#FF0000]"calcTable"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]thead[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]tr[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][tab]Year
[tab][tab][tab][tab][tab][COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]th colspan[COLOR=#990000]=[/color][COLOR=#FF0000]"2"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][tab]Charter Plus Options
[tab][tab][tab][tab][tab][COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]th colspan[COLOR=#990000]=[/color][COLOR=#FF0000]"2"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][tab]Current Trail Options
[tab][tab][tab][tab][tab][COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]th [COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][tab]No Service
[tab][tab][tab][tab][tab][COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]tr[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]<[/color]tr[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][tab] 
[tab][tab][tab][tab][tab][COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][tab]Annual
[tab][tab][tab][tab][tab][COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][tab]Cumulative
[tab][tab][tab][tab][tab][COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][tab]Annual
[tab][tab][tab][tab][tab][COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][tab]Cumulative
[tab][tab][tab][tab][tab][COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][COLOR=#990000]<[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][tab][tab] 
[tab][tab][tab][tab][tab][COLOR=#990000]</[/color]th[COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#990000]</[/color]tr[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]</[/color]thead[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]<[/color]tbody[COLOR=#990000]>[/color]
[tab][tab][tab][COLOR=#990000]</[/color]tbody[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]table[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]hr[COLOR=#990000]/>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calculator-question result"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Estimated [COLOR=#FF0000]'trail commission'[/color] over period [b][COLOR=#000000]selected[/color][/b] [COLOR=#990000]([/color]£[COLOR=#990000])[/color]
[tab][tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calcresult"[/color] id[COLOR=#990000]=[/color][COLOR=#FF0000]"currentTC"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#993399]0[/color]
[tab][tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calculator-question result"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Alternative fixed price[COLOR=#990000]*[/color] [b][COLOR=#0000FF]with[/color][/b] selected level of [b][COLOR=#000000]service[/color][/b] [COLOR=#990000]([/color]subject to terms and conditions[COLOR=#990000])[/color]  [COLOR=#990000]([/color]£[COLOR=#990000])[/color]
[tab][tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calcresult"[/color] id[COLOR=#990000]=[/color][COLOR=#FF0000]"altFC"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#993399]0[/color]
[tab][tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calculator-question result"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Estimated cost [b][COLOR=#000000]saving[/color][/b] [COLOR=#990000]([/color]£[COLOR=#990000])[/color]
[tab][tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calcresult"[/color] id[COLOR=#990000]=[/color][COLOR=#FF0000]"estCS"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#993399]0[/color]
[tab][tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calculator-question result"[/color][COLOR=#990000]>[/color]
[tab][tab][tab]Percentage [b][COLOR=#000000]saving[/color][/b] [COLOR=#990000](%)[/color]
[tab][tab][tab][COLOR=#990000]<[/color]div [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]"calcresult"[/color] id[COLOR=#990000]=[/color][COLOR=#FF0000]"finalpercentage"[/color][COLOR=#990000]>[/color]
[tab][tab][tab][tab][COLOR=#993399]0[/color]
[tab][tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]<[/color]div id[COLOR=#990000]=[/color][COLOR=#FF0000]'response'[/color] [b][COLOR=#0000FF]class[/color][/b][COLOR=#990000]=[/color][COLOR=#FF0000]'calculator-question calculator-response'[/color] style[COLOR=#990000]=[/color][COLOR=#FF0000]'display: none'[/color][COLOR=#990000]>[/color]
[tab][tab][COLOR=#990000]</[/color]div[COLOR=#990000]>[/color]
[tab][COLOR=#990000]</[/color]body[COLOR=#990000]>[/color]
[COLOR=#990000]</[/color]html[COLOR=#990000]>[/color]
 
I just grabbed the javascript part that did paste in, I presume that's the only part that changed?

There is just one calculation that didn't work as in the spreadsheet for me. The frequency works fine in all modes except 'no service' where the fixed price is always 0. Here's a screenshot comparing the versions


Thanks
 
the html is as follows

Code:
[b][COLOR=#000080]&lt;!DOCTYPE[/color][/b] [COLOR=#009900]HTML[/color][b][COLOR=#000080]&gt;[/color][/b]
[b][COLOR=#0000FF]&lt;html&gt;[/color][/b]
[tab][b][COLOR=#0000FF]&lt;head&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;meta[/color][/b] [COLOR=#009900]http-equiv[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'Content-Type'[/color] [COLOR=#009900]content[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'text/html; charset=utf-8'[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;title&gt;[/color][/b]test[b][COLOR=#0000FF]&lt;/title&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;script[/color][/b] [COLOR=#009900]type[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;text/javascript&quot;[/color] [COLOR=#009900]src[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;[URL unfurl="true"]https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&quot;[/URL][/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;/script&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;script[/color][/b] [COLOR=#009900]type[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;text/javascript&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab] &lt;!--- insert js from below ---&gt;
[tab][tab][b][COLOR=#0000FF]&lt;/script&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;style[/color][/b] [COLOR=#009900]type[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;text/css&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab]td {
[tab][tab][tab][tab]text-align: center;
[tab][tab][tab]}
[tab][tab][tab]
[tab][tab][tab].row {
[tab][tab][tab][tab]clear: left;
[tab][tab][tab][tab]overflow-y: hidden;
[tab][tab][tab][tab]width: 420px;
[tab][tab][tab]}
[tab][tab][tab]
[tab][tab][tab].row .label {
[tab][tab][tab][tab]width: 300px;
[tab][tab][tab][tab]float: left;
[tab][tab][tab]}
[tab][tab][tab]
[tab][tab][tab].row .field {
[tab][tab][tab][tab]width: 100px;
[tab][tab][tab][tab]float: left;
[tab][tab][tab][tab]margin-left: 10px;
[tab][tab][tab]}
[tab][tab][tab]
[tab][tab][tab].row .field input, .row .field select {
[tab][tab][tab][tab]width: 90%;
[tab][tab][tab]}
[tab][tab][tab][tab]#results{
[tab][tab][tab][tab]overflow-y:hidden;
[tab][tab][tab][tab]display:none;
[tab][tab][tab]}
[tab][tab][tab]#results .result {
[tab][tab][tab][tab]overflow-y: hidden;
[tab][tab][tab][tab]clear: left;
[tab][tab][tab][tab]margin-top: 0;
[tab][tab][tab][tab]padding-top: 0;
[tab][tab][tab]}
[tab][tab][tab]
[tab][tab][tab]#results .result p {
[tab][tab][tab][tab]float: left;
[tab][tab][tab][tab]width: 20em;
[tab][tab][tab][tab]margin-right: 2em;
[tab][tab][tab][tab]margin-top: 0;
[tab][tab][tab][tab]padding-top: 0;
[tab][tab][tab]}
[tab][tab][tab]
[tab][tab][tab]#results .result div {
[tab][tab][tab][tab]float: left;
[tab][tab][tab][tab]width: 5em;
[tab][tab][tab][tab]padding-left: 1em;
[tab][tab][tab][tab]margin-top: 0;
[tab][tab][tab][tab]padding-top: 0;
[tab][tab][tab]}
[tab][tab][tab]
[tab][tab][tab]#results .left {
[tab][tab][tab][tab]width: 60%;
[tab][tab][tab][tab]float: left;
[tab][tab][tab][tab]padding-right: 20px;
[tab][tab][tab]}
[tab][tab][tab]
[tab][tab][tab]#results .right {
[tab][tab][tab][tab]width: 30%;
[tab][tab][tab][tab]float: left;
[tab][tab][tab]}
[tab][tab][b][COLOR=#0000FF]&lt;/style&gt;[/color][/b]
[tab][b][COLOR=#0000FF]&lt;/head&gt;[/color][/b]
[tab][b][COLOR=#0000FF]&lt;body&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;form[/color][/b] [COLOR=#009900]action[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;somepage.php&quot;[/color] [COLOR=#009900]method[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;post&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculator-question&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;label[/color][/b] [COLOR=#009900]for[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;valueInvestment&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab]Total value of your investments and pensions (£)
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/label&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;input[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;b5&quot;[/color] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;valueInvestment&quot;[/color] [COLOR=#009900]type[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;text&quot;[/color] [COLOR=#009900]name[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;valueInvestment&quot;[/color] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;500000&quot;[/color] [b][COLOR=#0000FF]/&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculator-question&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;select[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;dropdown b6&quot;[/color] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;minServiceInterval&quot;[/color] [COLOR=#009900]name[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;minServiceInterval&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;2877&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]6 monthly[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;1237&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]Annual[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;777&quot;[/color] [COLOR=#009900]selected[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;selected&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]Two-Yearly[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;0&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]No Service[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/select&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;label[/color][/b] [COLOR=#009900]for[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;minServiceInterval&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab]Required service frequency
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/label&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculator-question&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;select[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;dropdown b7&quot;[/color] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;existingTrailCommissionRate&quot;[/color] [COLOR=#009900]name[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;existingTrailCommissionRate&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'0.5'[/color] [COLOR=#009900]selected[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;selected&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]0.5[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'0.55'[/color][b][COLOR=#0000FF]&gt;[/color][/b]0.55[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'0.6'[/color][b][COLOR=#0000FF]&gt;[/color][/b]0.6[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'0.65'[/color][b][COLOR=#0000FF]&gt;[/color][/b]0.65[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'0.7'[/color][b][COLOR=#0000FF]&gt;[/color][/b]0.7[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'0.75'[/color][b][COLOR=#0000FF]&gt;[/color][/b]0.75 [b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'0.8'[/color][b][COLOR=#0000FF]&gt;[/color][/b]0.8[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'0.85'[/color][b][COLOR=#0000FF]&gt;[/color][/b]0.85[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'0.9'[/color][b][COLOR=#0000FF]&gt;[/color][/b]0.9[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'0.95'[/color][b][COLOR=#0000FF]&gt;[/color][/b]0.95[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'1'[/color][b][COLOR=#0000FF]&gt;[/color][/b]1[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/select&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;label[/color][/b] [COLOR=#009900]for[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;existingTrailCommissionRate&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab]'Trail commission' payable on your existing plans
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/label&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculator-question result initial-fee-percentage&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;label[/color][/b] [COLOR=#009900]for[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;initialFeePercentage&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab]Initial fee % (with trail)
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/label&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;input[/color][/b] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;initialFeePercentage&quot;[/color] [COLOR=#009900]type[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;text&quot;[/color] [COLOR=#009900]name[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;initialFeePercentage&quot;[/color] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;1&quot;[/color] [COLOR=#009900]readonly[/color][b][COLOR=#0000FF]/&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculator-question&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;select[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;dropdown b9&quot;[/color] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;assumedPercentageGrowth&quot;[/color] [COLOR=#009900]name[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;assumedPercentageGrowth&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'4'[/color] [COLOR=#009900]selected[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;selected&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]4[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'4.5'[/color][b][COLOR=#0000FF]&gt;[/color][/b]4.5[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'5'[/color][b][COLOR=#0000FF]&gt;[/color][/b]5[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'5.5'[/color][b][COLOR=#0000FF]&gt;[/color][/b]5.5[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'6'[/color][b][COLOR=#0000FF]&gt;[/color][/b]6 [b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'6.5'[/color][b][COLOR=#0000FF]&gt;[/color][/b]6.5[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'7'[/color][b][COLOR=#0000FF]&gt;[/color][/b]7[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'7.5'[/color][b][COLOR=#0000FF]&gt;[/color][/b]7.5[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'8'[/color][b][COLOR=#0000FF]&gt;[/color][/b]8[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'8.5'[/color][b][COLOR=#0000FF]&gt;[/color][/b]8.5[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'9'[/color][b][COLOR=#0000FF]&gt;[/color][/b]9[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/select&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;label[/color][/b] [COLOR=#009900]for[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;assumedPercentageGrowth&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab]Assumed annual growth in your investements
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/label&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculator-question&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;select[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;dropdown b10&quot;[/color] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;numYears&quot;[/color] [COLOR=#009900]name[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;numYears&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'5'[/color][b][COLOR=#0000FF]&gt;[/color][/b]5[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'6'[/color][b][COLOR=#0000FF]&gt;[/color][/b]6[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'7'[/color][b][COLOR=#0000FF]&gt;[/color][/b]7[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'8'[/color][b][COLOR=#0000FF]&gt;[/color][/b]8[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'9'[/color][b][COLOR=#0000FF]&gt;[/color][/b]9[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'10'[/color] [COLOR=#009900]selected[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;selected&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]10 [b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'11'[/color][b][COLOR=#0000FF]&gt;[/color][/b]11[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'12'[/color][b][COLOR=#0000FF]&gt;[/color][/b]12[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'13'[/color][b][COLOR=#0000FF]&gt;[/color][/b]13[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'14'[/color][b][COLOR=#0000FF]&gt;[/color][/b]14[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;option[/color][/b] [COLOR=#009900]value[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'15'[/color][b][COLOR=#0000FF]&gt;[/color][/b]15[b][COLOR=#0000FF]&lt;/option&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/select&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;label[/color][/b] [COLOR=#009900]for[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;numYears&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab]Period for cost comparison (years)
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/label&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;button[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculator-submit&quot;[/color] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculate&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab]Calculate
[tab][tab][tab][b][COLOR=#0000FF]&lt;/button&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;/form&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;table[/color][/b] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calcTable&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;thead&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;tr&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;th&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]Year
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/th&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;th[/color][/b] [COLOR=#009900]colspan[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;2&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]Charter Plus Options
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/th&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;th[/color][/b] [COLOR=#009900]colspan[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;2&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]Current Trail Options
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/th&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;th&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]No Service
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/th&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/tr&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;tr&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;th&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/th&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;th&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]Annual
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/th&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;th&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]Cumulative
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/th&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;th&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]Annual
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/th&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;th&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]Cumulative
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/th&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;th&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/th&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/tr&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;/thead&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;tbody&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;/tbody&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;/table&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;hr/&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;style[/color][/b] [COLOR=#009900]type[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;text/css&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab]   
[tab][tab][b][COLOR=#0000FF]&lt;/style&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;results&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;left&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculator-question result&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;p&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]Estimated 'trail commission' over period selected (£)
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/p&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calcresult&quot;[/color] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;currentTC&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]0
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculator-question result&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;p&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]Alternative fixed price* with selected level of service (subject to terms and conditions)  (£)
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/p&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calcresult&quot;[/color] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;altFC&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]0
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculator-question result&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;p&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]Estimated cost saving (£)
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/p&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calcresult&quot;[/color] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;estCS&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]0
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calculator-question result&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;p&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]Percentage saving (%)
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/p&gt;[/color][/b]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;calcresult&quot;[/color] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]&quot;finalpercentage&quot;[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][tab][tab][tab]0
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;div[/color][/b] [COLOR=#009900]id[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'response'[/color] [COLOR=#009900]class[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'calculator-question calculator-response  right'[/color] [COLOR=#009900]style[/color][COLOR=#990000]=[/color][COLOR=#FF0000]'display: none'[/color][b][COLOR=#0000FF]&gt;[/color][/b]
[tab][tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][tab][b][COLOR=#0000FF]&lt;/div&gt;[/color][/b]
[tab][b][COLOR=#0000FF]&lt;/body&gt;[/color][/b]
[b][COLOR=#0000FF]&lt;/html&gt;[/color][/b]

Code:
[b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]calculateTable[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#minServiceInterval'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]change[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#calcTable tbody tr'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]remove[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#calcTable'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]hide[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] iValue [COLOR=#990000]=[/color] [b][COLOR=#000000]parseInt[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'#valueInvestment'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]());[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] B5 [COLOR=#990000]=[/color] iValue[COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] existingRate [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'#existingTrailCommissionRate'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]()[/color] [COLOR=#990000]/[/color] [COLOR=#993399]100[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] serviceInterval [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'#minServiceInterval'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]());[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] initialFeeRate [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'#initialFeePercentage'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]()[/color] [COLOR=#990000]/[/color] [COLOR=#993399]100[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] assumedGrowth [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'#assumedPercentageGrowth'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]()[/color] [COLOR=#990000]/[/color] [COLOR=#993399]100[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] col1 [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] Array[COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] col2 [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] Array[COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] col3 [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] Array[COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] col4 [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] Array[COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] col5 [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] Array[COLOR=#990000];[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] runningSum [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]iValue[COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]for[/color][/b] [COLOR=#990000]([/color][b][COLOR=#0000FF]var[/color][/b] i [COLOR=#990000]=[/color] [COLOR=#993399]1[/color][COLOR=#990000];[/color] i [COLOR=#990000]&lt;=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'#numYears'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]();[/color] i[COLOR=#990000]++)[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color]i [COLOR=#990000]==[/color] [COLOR=#993399]1[/color][COLOR=#990000])[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][tab]col1[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#990000]([/color]iValue [COLOR=#990000]*[/color] initialFeeRate[COLOR=#990000])[/color] [COLOR=#990000]+[/color] serviceInterval[COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab]col2[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#990000]([/color]iValue [COLOR=#990000]*[/color] initialFeeRate[COLOR=#990000])[/color] [COLOR=#990000]+[/color] serviceInterval[COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab]col3[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] existingRate [COLOR=#990000]*[/color] iValue[COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab]col4[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] existingRate [COLOR=#990000]*[/color] iValue[COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab]col5[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#993399]790[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]else[/color][/b] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color]i [COLOR=#990000]==[/color] [COLOR=#993399]2[/color][COLOR=#990000])[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][tab][tab]col1[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#993399]1.025[/color] [COLOR=#990000]*[/color] serviceInterval[COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab][tab]col5[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] B5 [COLOR=#990000]&lt;=[/color] [COLOR=#993399]100000[/color] [COLOR=#990000]?[/color] B5 [COLOR=#990000]*[/color] [COLOR=#993399]0.015[/color] [COLOR=#990000]+[/color] [COLOR=#993399]790[/color] [COLOR=#990000]:[/color] [COLOR=#990000]([/color]B5 [COLOR=#990000]&lt;=[/color] [COLOR=#993399]500000[/color] [COLOR=#990000]?[/color] [COLOR=#990000](([/color]B5 [COLOR=#990000]-[/color] [COLOR=#993399]100000[/color][COLOR=#990000])[/color] [COLOR=#990000]*[/color] [COLOR=#993399]0.01[/color][COLOR=#990000])[/color] [COLOR=#990000]+[/color] [COLOR=#993399]2290[/color] [COLOR=#990000]:[/color] [COLOR=#990000](([/color]B5 [COLOR=#990000]-[/color] [COLOR=#993399]500000[/color][COLOR=#990000])[/color] [COLOR=#990000]*[/color] [COLOR=#993399]0.005[/color][COLOR=#990000])[/color] [COLOR=#990000]+[/color] [COLOR=#993399]6290[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][tab][tab][b][COLOR=#0000FF]else[/color][/b] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][tab][tab]col1[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#993399]1.025[/color] [COLOR=#990000]*[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]col1[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]2[/color][COLOR=#990000]]);[/color]
[tab][tab][tab][tab][tab][tab][tab]col5[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [COLOR=#FF0000]&quot; &quot;[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][tab][tab]col2[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] col2[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]2[/color][COLOR=#990000]][/color] [COLOR=#990000]+[/color] col1[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]];[/color]
[tab][tab][tab][tab][tab][tab]col3[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]existingRate[COLOR=#990000])[/color] [COLOR=#990000]*[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]runningSum[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][tab]col4[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]col4[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]2[/color][COLOR=#990000]])[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]col3[COLOR=#990000][[/color]i [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]]);[/color]
[tab][tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][tab]runningSum [COLOR=#990000]=[/color] runningSum [COLOR=#990000]*[/color] [COLOR=#990000]([/color][COLOR=#993399]1[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]assumedGrowth[COLOR=#990000]));[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]for[/color][/b] [COLOR=#990000]([/color][b][COLOR=#0000FF]var[/color][/b] i [COLOR=#990000]=[/color] [COLOR=#993399]0[/color][COLOR=#990000];[/color] i [COLOR=#990000]&lt;[/color] col1[COLOR=#990000].[/color]length[COLOR=#990000];[/color] i[COLOR=#990000]++)[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] tr [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'&lt;tr /&gt;'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'&lt;td&gt;'[/color] [COLOR=#990000]+[/color] [COLOR=#990000]([/color]i [COLOR=#990000]+[/color] [COLOR=#993399]1[/color][COLOR=#990000])[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'&lt;/td&gt;'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] td [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'&lt;td&gt;'[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col1[COLOR=#990000][[/color]i[COLOR=#990000]]))[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'&lt;/td&gt;'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]td[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] td [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'&lt;td&gt;'[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col2[COLOR=#990000][[/color]i[COLOR=#990000]]))[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'&lt;/td&gt;'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]td[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] td [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'&lt;td&gt;'[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col3[COLOR=#990000][[/color]i[COLOR=#990000]]))[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'&lt;/td&gt;'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]td[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] td [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'&lt;td&gt;'[/color] [COLOR=#990000]+[/color] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col4[COLOR=#990000][[/color]i[COLOR=#990000]]))[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'&lt;/td&gt;'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]td[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] td [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'&lt;td&gt;'[/color] [COLOR=#990000]+[/color] [COLOR=#990000]([/color]col5[COLOR=#990000][[/color]i[COLOR=#990000]][/color] [COLOR=#990000]==[/color] [COLOR=#FF0000]' '[/color] [COLOR=#990000]?[/color] [COLOR=#FF0000]' '[/color] [COLOR=#990000]:[/color] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col5[COLOR=#990000][[/color]i[COLOR=#990000]])))[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'&lt;/td&gt;'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]tr[COLOR=#990000].[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]td[COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#calcTable tbody'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]append[/color][/b][COLOR=#990000]([/color]tr[COLOR=#990000]);[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] b30 [COLOR=#990000]=[/color] serviceInterval [COLOR=#990000]==[/color] [COLOR=#993399]0[/color] [COLOR=#990000]?[/color] Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col5[COLOR=#990000][[/color][COLOR=#993399]1[/color][COLOR=#990000]])[/color] [COLOR=#990000]:[/color] Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col2[COLOR=#990000][[/color]col2[COLOR=#990000].[/color]length [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]]);[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] b29 [COLOR=#990000]=[/color] Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]col4[COLOR=#990000][[/color]col4[COLOR=#990000].[/color]length [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]]);[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] b31 [COLOR=#990000]=[/color] b29 [COLOR=#990000]-[/color] b30 [COLOR=#990000]&lt;=[/color] [COLOR=#993399]0[/color] [COLOR=#990000]?[/color] [COLOR=#993399]0[/color] [COLOR=#990000]:[/color] b29 [COLOR=#990000]-[/color] b30[COLOR=#990000];[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#currentTC'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]b29[COLOR=#990000]));[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#altFC'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]b30[COLOR=#990000]));[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#estCS'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]b31[COLOR=#990000]));[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] b32 [COLOR=#990000]=[/color] Math[COLOR=#990000].[/color][b][COLOR=#000000]round[/color][/b][COLOR=#990000]([/color]b31 [COLOR=#990000]/[/color] b29 [COLOR=#990000]*[/color] [COLOR=#993399]1000[/color][COLOR=#990000])[/color] [COLOR=#990000]/[/color] [COLOR=#993399]10[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#finalpercentage'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color]b32 [COLOR=#990000]+[/color] [COLOR=#FF0000]&quot;%&quot;[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color]b31 [COLOR=#990000]==[/color] [COLOR=#993399]0[/color][COLOR=#990000])[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#response'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]&quot;No saving&quot;[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]else[/color][/b] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#response'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]&quot;Woo hoo a saving&quot;[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#calcTable'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]show[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#results'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]show[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#response'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]hide[/color][/b][COLOR=#990000]().[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color]b32 [COLOR=#990000]&lt;=[/color] [COLOR=#993399]0[/color] [COLOR=#990000]?[/color] [COLOR=#FF0000]&quot;Although we can't save you money today, we will guarantee future service at your selected frequency&quot;[/color] [COLOR=#990000]:[/color] [COLOR=#990000]([/color]b32 [COLOR=#990000]&gt;=[/color] [COLOR=#993399]0.35[/color] [COLOR=#990000]?[/color] [COLOR=#FF0000]&quot;By contacting us you are likely to make a substantial saving! Why not phone us today!&quot;[/color] [COLOR=#990000]:[/color] [COLOR=#FF0000]&quot;Contact us today to find out more about our fixed price contract!&quot;[/color][COLOR=#990000]));[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#response'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]show[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]&quot;slow&quot;[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#response'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]flash[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'green'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]return[/color][/b] [b][COLOR=#0000FF]false[/color][/b][COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab]
[tab][tab][tab][b][COLOR=#0000FF]function[/color][/b] [b][COLOR=#000000]addCommas[/color][/b][COLOR=#990000]([/color]nStr[COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color]nStr [COLOR=#990000]==[/color] [COLOR=#FF0000]' '[/color][COLOR=#990000])[/color] 
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]return[/color][/b] nStr[COLOR=#990000];[/color]
[tab][tab][tab][tab]nStr [COLOR=#990000]+=[/color] [COLOR=#FF0000]'[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab]x [COLOR=#990000]=[/color] nStr[COLOR=#990000].[/color][b][COLOR=#000000]split[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'.'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]x1 [COLOR=#990000]=[/color] x[COLOR=#990000][[/color][COLOR=#993399]0[/color][COLOR=#990000]];[/color]
[tab][tab][tab][tab]x2 [COLOR=#990000]=[/color] x[COLOR=#990000].[/color]length [COLOR=#990000]&gt;[/color] [COLOR=#993399]1[/color] [COLOR=#990000]?[/color] [COLOR=#FF0000]'.'[/color] [COLOR=#990000]+[/color] x[COLOR=#990000][[/color][COLOR=#993399]1[/color][COLOR=#990000]][/color] [COLOR=#990000]:[/color] [COLOR=#FF0000]'[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] rgx [COLOR=#990000]=[/color] [COLOR=#FF6600]/(\d+)(\d{3})/[/color][COLOR=#990000];[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]while[/color][/b] [COLOR=#990000]([/color]rgx[COLOR=#990000].[/color][b][COLOR=#000000]test[/color][/b][COLOR=#990000]([/color]x1[COLOR=#990000]))[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab]x1 [COLOR=#990000]=[/color] x1[COLOR=#990000].[/color][b][COLOR=#000000]replace[/color][/b][COLOR=#990000]([/color]rgx[COLOR=#990000],[/color] [COLOR=#FF0000]'$1'[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]','[/color] [COLOR=#990000]+[/color] [COLOR=#FF0000]'$2'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][b][COLOR=#0000FF]return[/color][/b] x1 [COLOR=#990000]+[/color] x2[COLOR=#990000];[/color]
[tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab]
[tab][tab][tab]$[COLOR=#990000]([/color]document[COLOR=#990000]).[/color][b][COLOR=#000000]ready[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#calculate'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]on[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'click'[/color][COLOR=#990000],[/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]([/color]e[COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab]e[COLOR=#990000].[/color][b][COLOR=#000000]preventDefault[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab][tab][b][COLOR=#000000]calculateTable[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#minServiceInterval'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]on[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'change'[/color][COLOR=#990000],[/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]([/color]e[COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] B5 [COLOR=#990000]=[/color] [b][COLOR=#000000]parseInt[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][COLOR=#FF0000]'.b5'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]());[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] D6 [COLOR=#990000]=[/color] [b][COLOR=#000000]parseInt[/color][/b][COLOR=#990000]([/color]$[COLOR=#990000]([/color][b][COLOR=#0000FF]this[/color][/b][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]());[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#initialFeePercentage'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]([/color]D6 [COLOR=#990000]==[/color] [COLOR=#993399]0[/color] [COLOR=#990000]?[/color] [COLOR=#993399]0[/color] [COLOR=#990000]:[/color] B5 [COLOR=#990000]&lt;[/color] [COLOR=#993399]500000[/color] [COLOR=#990000]?[/color] [COLOR=#993399]0[/color] [COLOR=#990000]:[/color] B5 [COLOR=#990000]&lt;=[/color] [COLOR=#993399]750000[/color] [COLOR=#990000]?[/color] [COLOR=#993399]0.5[/color] [COLOR=#990000]:[/color] B5 [COLOR=#990000]&lt;=[/color] [COLOR=#993399]1000000[/color] [COLOR=#990000]?[/color] [COLOR=#993399]1[/color] [COLOR=#990000]:[/color] [COLOR=#993399]0[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'.b6, .b7, .b9, .b10'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]on[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'focus'[/color][COLOR=#990000],[/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]([/color]e[COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab]$[COLOR=#990000]([/color][b][COLOR=#0000FF]this[/color][/b][COLOR=#990000]).[/color][b][COLOR=#000000]one[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'change'[/color][COLOR=#990000],[/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][tab][b][COLOR=#000000]calculateTable[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab][tab][COLOR=#FF0000]}[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'.b5'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]on[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'blur'[/color][COLOR=#990000],[/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] c [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'.b5'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]var[/color][/b] v [COLOR=#990000]=[/color] [b][COLOR=#000000]parseFloat[/color][/b][COLOR=#990000]([/color]c[COLOR=#990000].[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]());[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color]v [COLOR=#990000]&lt;[/color] [COLOR=#993399]50000[/color][COLOR=#990000])[/color] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][tab]c[COLOR=#990000].[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]([/color][COLOR=#993399]50000[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][tab]c[COLOR=#990000].[/color][b][COLOR=#000000]css[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'background-color'[/color][COLOR=#990000],[/color] [COLOR=#FF0000]'red'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][tab]c[COLOR=#990000].[/color][b][COLOR=#000000]focus[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][tab][b][COLOR=#0000FF]else[/color][/b] [COLOR=#FF0000]{[/color]
[tab][tab][tab][tab][tab][tab]c[COLOR=#990000].[/color][b][COLOR=#000000]css[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'background-color'[/color][COLOR=#990000],[/color] [COLOR=#FF0000]'white'[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab][tab][tab][b][COLOR=#000000]calculateTable[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab][tab][tab][COLOR=#FF0000]}[/color]
[tab][tab][tab][tab][COLOR=#FF0000]}[/color][COLOR=#990000]);[/color]
[tab][tab][tab][tab]$[COLOR=#990000]([/color][COLOR=#FF0000]'#calcTable'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]hide[/color][/b][COLOR=#990000]();[/color]
[tab][tab][tab]  [i][COLOR=#9A1900]//  calculateTable();[/color][/i]
[tab][tab][tab][COLOR=#FF0000]}[/color][COLOR=#990000]);[/color]
 
the full text seems to be there now. let me know if it does not work for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top