function CalculateSum(Atext, Btext, form)
{
var A = parseFloat(Atext);
var B = parseFloat(Btext);

form.iso25.value  =  (Math.floor  ((A / B * 10) / ( Math.sqrt ( 100 / 25  )))) / 10;
form.iso50.value  =  (Math.floor  ((A / B * 10) / ( Math.sqrt ( 100 / 50  )))) / 10;
form.iso100.value =  (Math.floor  ((A / B * 10) / ( Math.sqrt ( 100 / 100 )))) / 10;
form.iso200.value =  (Math.floor  ((A / B * 10) / ( Math.sqrt ( 100 / 200 )))) / 10;
form.iso400.value =  (Math.floor  ((A / B * 10) / ( Math.sqrt ( 100 / 400 )))) / 10;
form.iso800.value =  (Math.floor  ((A / B * 10) / ( Math.sqrt ( 100 / 800 )))) / 10;
}

function ClearForm(form)
{
form.input_A.value = "";
form.input_B.value = "";
form.iso100.value  = "";
form.iso25.value   = "";
form.iso50.value   = ""; 
form.iso200.value  = ""; 
form.iso400.value  = ""; 
form.iso800.value  = ""; 
}

//Feet to Meter Calculator JavaScript and Formula

function ConvertSum(Ctext, Dtext, form) // ConvertSum called by onclick command
{
var C = parseFloat(Ctext);
var D = parseFloat(Dtext);

// The equuation:- divide "B" by 12 to give a decimal answer then add to "A", Divide result by 3.281 to convert to meters
// Multiply by 100 then round to nearest integer, divide by 100 to leave a 2 decimal point answer eg 1.9811086 becomes 1.98

form.meters.value  =   (Math.round  (((C + ( D / 12 ))/3.281)*100))/100;
}

function ClearTable(form)
{
form.input_C.value = "";
form.input_D.value = "";
form.meters.value  = "";
}


// ASA and Guide Number Calculator JavaScript and Formula 

function WorkSum(Etext, Ftext, form)
{
var E = parseFloat(Etext);
var F = parseFloat(Ftext);



form.guide.value  =   Math.round(E *  (Math.sqrt(F / 100)));// where E is the Guide number and F is the ASA number
form.iso.value    =   100;  // This is the given ASA number the calculation works to
}

function CancelForm(form)
{
form.input_E.value = "";
form.input_F.value = "";
form.guide.value  = "";
form.iso.value  = "";
}

