function calcTR() {	

		var navrate=0,capitalvalue=0,error=0,district=0;
		
		/* Districts Antrim 0, Ards 1, Armagh 2, Ballymena 3 ,Ballymoney 4, Banbridge 5, Belfast 6,
		Carrickfergus 7, Castlereagh 8, Coleraine 9, Cookstown 10, Craigavon 11, Derry 12,
		Downpatrick 13, Dungannon & S.Tyrone 14, Fermanagh 15, Larne 16, Limavady 17, Lisburn 18,
		Magherafelt 19, Moyle 20, Newry 21, Newtownabbey 22, North Down 23, Omagh 24, Strabane 25 */

		<!-- 2007 variables and data -->	
		var poundagenotional07=0,poundageactual07=0,navbill07=0,navbill0733=0,cvbill07=0,
		cvbillpercent07=0,transrelief07=0;
		var poundages07=new Array(), notional07=new Array();
		poundages07 = [0.006483,0.006017,0.006782,0.006482,0.006376,0.006611,0.006031,
                0.006594,0.005479,0.006114,0.006052,0.007003,0.006973,0.006481,0.005892,0.005640,0.006844,
		0.006943,0.005883,0.005822,0.006853,0.006280,0.006440,0.005843,0.006851,0.006545];
		notional07 = [3.632286,3.703444,3.924011,3.670412,3.588023,3.699569,3.904766,
		3.671094,3.403759,3.542978,3.647891,3.763941,3.920494,3.865812,3.562558,3.346762,3.826509,
		3.755081,3.471451,3.365747,4.036647,3.834568,3.655069,3.645276,3.818360,3.609736];
		
		<!-- 2008 variables and data -->		
		var poundagenotional08=0,poundageactual08=0,navbill08=0,navbill0833=0,cvbill08=0,
		cvbillpercent08=0,transrelief08=0;		
		var poundages08=new Array(), notional08=new Array();
		poundages08 = [0.006767,0.006101,0.007001,0.006765,0.006486,0.006729,0.006148,
		0.006803,0.005510,0.006262,0.006172,0.007082,0.007141,0.006673,0.006042,0.005780,0.006926,
		0.007163,0.005922,0.005886,0.007158,0.006411,0.006607,0.006010,0.007008,0.006735];
		notional08 = [3.783616,3.759383,4.049826,3.825038,3.647073,3.762409,3.991907,
		3.781029,3.425391,3.628222,3.723863,3.802696,4.011306,3.983728,3.658609,3.432622,3.870175,
		3.864276,3.494893,3.402310,4.218635,3.919533,3.746782,3.760664,3.901500,3.707377];

		<!-- 2009 variables and data -->
		capitalvalue09=0;		
		var poundagenotional09=0,poundageactual09=0,navbill09=0,navbill0933=0,cvbill09=0,
		cvbillpercent09=0,transrelief09=0;		
		var poundages09=new Array(), notional09=new Array();
		poundages09 = [0.007012,0.006225,0.007236,0.006953,0.006705,0.006852,0.006325,
		0.007058,0.005510,0.006420,0.006271,0.007184,0.007338,0.006751,0.006150,0.005965,0.006926,
		0.007358,0.005982,0.005952,0.007357,0.006600,0.006665,0.006206,0.007161,0.006969];
		notional09 = [3.914218,3.841824,4.184907,3.927815,3.764760,3.827884,4.123731,
		3.915127,3.425391,3.719116,3.786521,3.852738,4.117924,4.031560,3.727784,3.546110,3.870175,
		3.961102,3.531005,3.440059,4.337456,4.042129,3.778553,3.896125,3.982540,3.827563];


		<!-- Clear table and error messages -->
		document.getElementById("navbill07").innerHTML = "";
		document.getElementById("navbill0733").innerHTML = "";
		document.getElementById("cvbill07").innerHTML = "";
		document.getElementById("cvbillpercent07").innerHTML = "";
		document.getElementById("transrelief07").innerHTML = "";	
		document.getElementById("navbill08").innerHTML = "";
		document.getElementById("navbill0833").innerHTML = "";
		document.getElementById("cvbill08").innerHTML = "";
		document.getElementById("cvbillpercent08").innerHTML = "";
		document.getElementById("transrelief08").innerHTML = "";
		document.getElementById("navbill09").innerHTML = "";
		document.getElementById("navbill0933").innerHTML = "";
		document.getElementById("cvbill09").innerHTML = "";
		document.getElementById("cvbillpercent09").innerHTML = "";
		document.getElementById("transrelief09").innerHTML = "";		
		hideAllErrors();

		<!-- Get data from form -->
		navrate = document.getElementById("navrate").value;
		capitalvalue = document.getElementById("capitalvalue").value;
		capitalvalue09 = capitalvalue;
		district = document.getElementById("district").value
		poundagenotional07 = notional07[district];
		poundageactual07 = poundages07[district];
		poundagenotional08 = notional08[district];
		poundageactual08 = poundages08[district];
		poundagenotional09 = notional09[district];
		poundageactual09 = poundages09[district];


		<!-- Verify form data -->
		if ( (isNaN(district)) || (district < 0) || (district > 25))
			{
				document.getElementById("DistrictError").style.display = "inline";
				document.getElementById("TitleError").style.display = "inline";
				error = 1
				document.raterelief.district.focus();

			}
		
		
		if ( (isNaN(navrate) ) || (navrate == "") || (navrate <= 0)) 
			{	document.getElementById("NAVError").style.display = "inline";	
				document.getElementById("TitleError").style.display = "inline";	
				error = 1			
				document.raterelief.navrate.focus();
			}
			
			
		if ( (isNaN(capitalvalue) ) || (capitalvalue == "") || (capitalvalue <=0)) 
			{	
				document.getElementById("CVError").style.display = "inline";
				document.getElementById("TitleError").style.display = "inline";	
				error = 1
				document.raterelief.capitalvalue.focus();
			}
			
		<!-- Capital Value was capped at &#163;500,000 and is now capped at &#163;400,000 -->
		if (capitalvalue > 400000 && capitalvalue <= 500000)
			{
				document.getElementById("TitleWarning").style.display = "inline";	
				document.raterelief.capitalvalue.focus();
				capitalvalue09 = 400000;
			}
		if (capitalvalue > 500000)
			{				
				document.getElementById("CVError2").style.display = "inline";
				document.getElementById("TitleError").style.display = "inline";
				error = 1	
				document.raterelief.capitalvalue.focus();
			}

		
		<!-- Calculate results for table -->			
		if (error == 0)
			{
				/*hideAllErrors();*/
				
				<!--NAV system bill-->
				navbill07 = navrate * poundagenotional07;
                                navbill08 = navrate * poundagenotional08;
                                navbill09 = navrate * poundagenotional09;
								
				<!--NAV system bill plus 33% (Basecase)-->
				navbill0733 = navbill07 * 1.33;
                                navbill0833 = navbill08 * 1.33;
                                navbill0933 = navbill09 * 1.33;
				
				<!--New CV system-->
				cvbill07 = capitalvalue * poundageactual07;
				cvbill08 = capitalvalue * poundageactual08;
				cvbill09 = capitalvalue09 * poundageactual09;				

				<!--CV Bill % increase-->
				cvbillpercent07 = ((cvbill07/navbill07)-1)*100;
				cvbillpercent08 = ((cvbill08/navbill08)-1)*100;	
				cvbillpercent09 = ((cvbill09/navbill09)-1)*100;					 
					 
				<!--Transitional Relief-->
				transrelief07 = cvbill07-navbill0733;
                                transrelief08 = (cvbill08-navbill0833)*2/3;
                                transrelief09 = (cvbill09-navbill0933)*1/3;

				if (transrelief07 < 0) {transrelief07 = 0}
				if (transrelief08 < 0) {transrelief08 = 0}
				if (transrelief09 < 0) {transrelief09 = 0}
							
				<!-- Assign results to screen -->				
				document.getElementById("navbill07").innerHTML = "&pound;" + navbill07.toFixed(2);
				document.getElementById("navbill0733").innerHTML = "&pound;" + navbill0733.toFixed(2);
				document.getElementById("cvbill07").innerHTML = "&pound;" + cvbill07.toFixed(2);
				document.getElementById("cvbillpercent07").innerHTML = eval(cvbillpercent07).toFixed(1) + "%";
				document.getElementById("transrelief07").innerHTML = "&pound;" + transrelief07.toFixed(2);
				document.getElementById("navbill08").innerHTML = "&pound;" + navbill08.toFixed(2);
				document.getElementById("navbill0833").innerHTML = "&pound;" + navbill0833.toFixed(2);
				document.getElementById("cvbill08").innerHTML = "&pound;" + cvbill08.toFixed(2);
				document.getElementById("cvbillpercent08").innerHTML = eval(cvbillpercent08).toFixed(1) + "%";
				document.getElementById("transrelief08").innerHTML = "&pound;" + transrelief08.toFixed(2);
				document.getElementById("navbill09").innerHTML = "&pound;" + navbill09.toFixed(2);
				document.getElementById("navbill0933").innerHTML = "&pound;" + navbill0933.toFixed(2);
				document.getElementById("cvbill09").innerHTML = "&pound;" + cvbill09.toFixed(2);
				document.getElementById("cvbillpercent09").innerHTML = eval(cvbillpercent09).toFixed(1) + "%";
				document.getElementById("transrelief09").innerHTML = "&pound;" + transrelief09.toFixed(2);		
	
			}
		
		error = 0;
		
	} <!-- End calcTR -->
		
function hideAllErrors() {
		document.getElementById("TitleError").style.display = "none";
		document.getElementById("TitleWarning").style.display = "none";
		document.getElementById("NAVError").style.display = "none";
		document.getElementById("CVError").style.display = "none";
		document.getElementById("CVError2").style.display = "none";
		document.getElementById("DistrictError").style.display = "none";
	}
