<!--
/* ------------------------------------------------
 I hope you find it useful and if you find it to   
 have errors please let me know.

                  *  script by S.J. Kok
                  *  http://www.sanderkok.com
                  *  copyright 2003
                  *  all rights reserved
 ------------------------------------------------
*/

function convert1(input) {
var txt="";
var m1=(input.m1.value);
var m2=(input.m2.value);
var cc=(input.c.value);
var A=6E23
var k=(input.constant.value)
var d=5.3E-12
if (input.m1.value == "" && input.m2.value == "") {
txt = "";
input.m1.value = txt;
input.m2.value = txt;
}

if (input.m1.value != "" && input.m2.value != "")

 {
var txt = d * Math.sqrt(k / (((m1/A) * (m2/A))/((m1/A) + (m2/A))))
input.c.value = txt;
}
}

function reset(input) {
	input.m1.value="";	
	input.m2.value="";
	input.c.value="";
}


// IR wavelength to wavenumber converter.
function convert2(input) {
var txt="";
var aa=(input.a.value);
var bb=(input.b.value);
if (input.a.value == "" && input.b.value == "") {
txt = "";
input.a.value = txt;
input.b.value = txt;
}

if (input.a.value != "" && input.b.value == "") {
var txt = ((1/aa)*10000)
input.b.value = txt;
}

if (input.a.value == "" && input.b.value != "") {
var txt = ((1/bb)*10000)
input.a.value = txt;
}
}

function reset(input) {
	input.a.value="";	
	input.b.value="";
}



// IR wavelength to frequency converter.
function convert3(input) {
var txt="";
var xx=(input.x.value);
var yy=(input.y.value);
var Z=3

if (input.x.value == "" && input.y.value == "") {
txt = "";
input.x.value = txt;
input.y.value = txt;
}

if (input.x.value != "" && input.y.value == "") {
var txt = (yy/Z)
input.y.value = txt;
}

if (input.x.value == "" && input.y.value != "") {
var txt = (xx*Z)
input.x.value = txt;
}
}

function reset(input) {
	input.x.value="";	
	input.y.value="";
}
//-->