function calcRates() {

  var poundages = new Array();
  var propertyType = document.calcform.proptype;
<!--Domestic-->
  if (propertyType[0].checked) {
  	  poundages = [ 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];

  }
  <!--Non-domestic-->
  else 
  {
	  poundages = [ 0.554161, 0.514990, 0.568156, 0.541051, 0.540247, 0.542975, 0.536225,
          0.551122, 0.457121, 0.512092, 0.509192, 0.529238, 0.556903, 0.536341, 0.507061, 0.469613, 0.523781,
          0.555632, 0.480080, 0.484651, 0.602767, 0.517791, 0.537708, 0.491153, 0.517509, 0.527641];

  }


    var valuation = document.calcform.valuation.value;
    var councilIndex = document.calcform.council.options[document.calcform.council.selectedIndex].value;


    if (valuation == '' || isNaN(valuation)) {
      alert('The Property Valuation must be a number');
      document.calcform.valuation.focus();
    }
    else {
        if ((propertyType[0].checked) && (valuation > 500000))  //domestic
        {
           valuation = 500000;
        } 
    	document.calcform.rates.value = '&#163;' + Math.round (valuation * poundages[councilIndex] * 100) /100;
    }
    return;
  }


function showLink(propertyType) {
    if (propertyType == 'domestic') {
        document.getElementById('valuelink').innerHTML="Capital valuation of your domestic property"
        document.getElementById('valuelink').href="http://pip.vla.nics.gov.uk/search.asp?submit=form"
    }
    else {
        document.getElementById('valuelink').innerHTML="NAV-based valuation of your non-domestic property"
        document.getElementById('valuelink').href="http://cmslist5.vla.nics.gov.uk/search.asp?submit=form"  
    }
}        


function showCalc() {
        document.writeln('<div id="extranav">');
         document.writeln('<h3 class="nav">Rates Calculator</h3><!--calculator-->');
        document.writeln('<form name="calcform">');
        document.writeln('<fieldset><legend>Property Type</legend>');
        document.writeln('<input class="radio" type="radio" checked="checked" value="domestic" name="proptype" id="domestic" onClick="showLink(this.value)"/>');
        document.writeln('<label for="domestic">Domestic</label><br />');
        document.writeln('<input class="radio" id="business" type="radio" value="commercial" name="proptype" id="commercial" onClick="showLink(this.value)"/> ');
        document.writeln('<label for="business">Business</label></p></fieldset>');
        document.writeln('<p><a id="valuelink" href="http://pip.vla.nics.gov.uk/search.asp?submit=form" target="_blank">Capital valuation of your domestic property</a>:<br />');
        document.writeln('<input class="calcform" onfocus="select()" size="7" name="valuation" /></p>');
        document.writeln('<p><label for="council">Council Area:</label><br />');
        document.writeln('<select class="calcform" name="council" id="council" >');
         document.writeln('<option value="0" selected="selected">Antrim</option>');
        document.writeln('<option value="1">Ards</option> ');
        document.writeln('<option value="2">Armagh</option>');
        document.writeln('<option value="3">Ballymena</option>');
        document.writeln('<option value="4">Ballymoney</option>');
        document.writeln('<option value="5">Banbridge</option> ');
        document.writeln('<option value="6">Belfast</option>');
        document.writeln('<option value="7">Carrickfergus</option>');
        document.writeln('<option value="8">Castlereagh</option>');
        document.writeln('<option value="9">Coleraine</option>');
        document.writeln('<option value="10">Cookstown</option>');
        document.writeln('<option value="11">Craigavon</option>');
        document.writeln('<option value="12">Derry</option>');
        document.writeln('<option value="13">Down</option>');
        document.writeln('<option value="14">Dungannon</option>');
        document.writeln('<option value="15">Fermanagh</option>');
        document.writeln('<option value="16">Larne</option>');
        document.writeln('<option value="17">Limavady</option>');
        document.writeln('<option value="18">Lisburn</option>');
        document.writeln('<option value="19">Magherafelt</option> ');
        document.writeln('<option value="20">Moyle</option>');
        document.writeln('<option value="21">Newry/Mourne</option> ');
        document.writeln('<option value="22">Newtownabbey</option>');
        document.writeln('<option value="23">North Down</option>');
        document.writeln('<option value="24">Omagh</option>');
        document.writeln('<option value="25">Strabane</option>');
        document.writeln('</select></p>');
        document.writeln('<input type="button" value="calculate" onclick="calcRates()" style="margin-left: .7em;" />');
        document.writeln('<p><label for="rates">Annual Rates:</label>');
        document.writeln('<br /><input class="calcform" onfocus="this.blur()"  size="7" name="rates" id="rates" /></p>');
        document.writeln('<p><a href="rates_calculation.html">Some property types and Business distinguishments will not be liable for the full rates as assessed above.</a></p>');
        document.writeln('</form>');
        document.writeln('</div>');
}
