function calculate(){
if (!document.getElementById) return;
x = document.calc.phnum.value;
y = document.calc.hion.value;

if (x!="" && y!="") {document.calc.phnum.value=""; document.calc.hion.value=""; return};
if (x!=="") {var h = Math.pow(10,-x);
document.calc.hion.value = h;}
else
if (y!=="") {var ph = (Math.log(y)/Math.LN10)*-1;
ph = Math.round(ph*100)/100;
document.calc.phnum.value = ph;};
}

function ui(z){
if (!document.getElementById) return;
pval=document.getElementById("phq");
hval=document.getElementById("hq");
text1=document.getElementById("txt1");
text2=document.getElementById("txt2");

pval.className="phbar"+z; hval.className="hbar"+z; text1.innerHTML=z; text2.innerHTML="1 x 10<sup>-"+z+"</sup>";
}
