function calcRates() {
<!--OPEN THIS FILE'S PROPERTIES AND CHANGE TO POUND SIGN ON SPECIFIC TAB-->
  var poundages = new Array();
  var propertyType = document.calcform.proptype;
<!--Domestic 2010/2011-->
  if (propertyType[0].checked) {
  	  poundages = [ 0.007193, 0.006303, 0.007486, 0.007184, 0.006936, 0.007013, 0.006537,
	  0.007253, 0.005576, 0.006560, 0.006338, 0.007255, 0.007524, 0.006964, 0.006150, 0.006056, 0.007056,
	  0.007642, 0.006029, 0.006149, 0.007357, 0.006805, 0.006815, 0.006284, 0.007267, 0.007116];

  }
  <!--Non-domestic 2010/2011-->
  else
  {
	  poundages = [ 0.575713, 0.529410, 0.594702, 0.565749, 0.566222, 0.563052, 0.562749,
          0.573434, 0.470602, 0.530704, 0.522450, 0.541774, 0.577769, 0.560414, 0.515051, 0.484240, 0.540596, 
          0.583082, 0.491670, 0.508192, 0.610767, 0.540773, 0.557394, 0.504971, 0.532042, 0.545590];

  }


    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 = 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"
		document.getElementById('valuelink').href="http://lpsni.gov.uk/vListNDN/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 (in pounds):</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>');
}