function clear_field(field)
{
   if (field.value==field.defaultValue) {
			field.value=''
   }
}



function calculateRmatching()
{
   var Z0ohm  = parseFloat(document.res_matching.Z0ohm.value);
   var Z1ohm  = parseFloat(document.res_matching.Z1ohm.value);

   var  R1ohm = Z0ohm * Math.sqrt(1 - Z1ohm/Z0ohm);
   var  R2ohm = Z1ohm / Math.sqrt(1 - Z1ohm/Z0ohm);

   var  attendb = 20 * ((Math.log(Math.sqrt(Z0ohm/Z1ohm) + Math.sqrt(Z0ohm/Z1ohm - 1)))/(Math.log(10)));


   document.res_matching.R1ohm.value  = R1ohm.toFixed(2);
   document.res_matching.R2ohm.value  = R2ohm.toFixed(2);
   document.res_matching.attendb.value  = attendb.toFixed(4);


   return;
}
