function toggle( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "block";
  			} else {
  				target.style.display = "none";
  			}
  	}
}
function toggleon( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "inline";
  			}
  	}
}
function toggleoff( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  			if (target.style.display == "inline"){
  				target.style.display = "none";
  			}
  	}
}  	

// change spur-xx and blackdist IDs bg-color //

var thespur = "spur-" + spr;
var spurelement;
var colorelement;
var Scolors = new Array();
Scolors["h0"] = "#9c6";
Scolors["n"] = "#c93";
Scolors["tt"] = "#669999";
Scolors["z"] = "#69c";
Scolors["g"]="#f96";

function checkspur(){
spurelement = document.getElementById? document.getElementById(thespur) : document.all.thespur;
colorelement = document.getElementById? document.getElementById("blackdist") : document.all.blackdist;

if (spr != '')
spurelement.style.backgroundColor = Scolors[spr];
colorelement.style.backgroundColor = Scolors[spr];

}

function percentage() {
 a = document.getElementById('calc').maxsum.value;
 b = document.getElementById('calc').discount.value;
 c = a*(100-b)/100;
 document.getElementById('calc').minsum.value = c;
 }