function process(){
var Ht = parseFloat(BMIform.inaltime.value);
var Wt = parseFloat(BMIform.greutate.value);
var UW ='<span class=titlu1>ESTI SUBPONDERAL</span> <br><i>(ai o greutate prea mica pentru inaltimea ta)</i>';
var W = '<span class=titlu1>ESTI NORMOPONDERAL</span> <br><i>(ai o greutate normala pentru inaltimea ta)</i>';
var OW = '<span class=titlu1>ESTI SUPRAPONDERAL</span> <br><i>(ai o greutate prea mare pentru inaltimea ta)</i>';
var O = '<font face="Arial" color="#000066">ESTI OBEZ <br><i>(ai o greutate mult prea mare pentru inaltimea ta)</i> <br>Trebuie sa iei urgent masuri!';
var IdealWtMax = Math.round(10 * 25 * Ht * Ht) / 10;
var IdealWtMin = Math.round(10 * 20 * Ht * Ht) / 10;

var BMI = Math.round(100 * Wt/(Ht * Ht)) / 100;

var msg;
var pic;
var col= "#C8FE7E";


if (BMI < 20){
msg = UW;

col= "#C8FE7E";
}

if (BMI >= 20 && BMI <= 25) {
msg = W;
col= "#C8FE7E";
}

if (BMI > 25 && BMI <= 30) {
msg = OW;
col= "#C8FE7E";
}

if (BMI > 30 ) {
msg = O;
col= "#C8FE7E";


}

var wleft =(screen.width -400)/2;
var wtop =(screen.inaltime -300)/2;


var w =window.open("","IMC","left=" + wleft + ",top=" + wtop +",width=400,height=200");
var d = w.document;

d.open();
d.write ('<html>');
if (BMI > 30 ) d.write;
d.write ('<body bgcolor="' + col  + '"><H2 align= "center"><font face="arial" color="#000066">Rezultate Personal Wellness</font></H2>');
d.write ('<table border="0" width="100%"><tr><td valign="top" width="50%">');
d.write ('<font face="arial" color="#000066">Greutatea: ' + Wt + 'kg <br>Inaltimea: ' + Ht + 'm');
d.write ('</td><td valign="top" width="50%">');
d.write ('<p align="center"><font face="arial" color="#000066">IMC: ' + BMI + '</p>');
d.write ('</td><td valign="top" width="50%">');
d.write ('</td></tr></table>');

d.write ('<p align="center"><b>' + msg + '</b></p>');

d.write ('<p align="center"><font face="arial" color="#000066">Greutatea ta trebuie sa se incadreze intre ',IdealWtMin,' si ',IdealWtMax,' kg</font></p>');
d.write ('</body></html>');
d.close();
}

function isblank(s)
{
    for(var i = 0;i < s.length;i++) {
        var c = s.charAt(i);
        if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
    }
    return true;
}


function verify(f)
{
    var msg;
    var empty_fields = "";
    var errors = "";


    for(var i = 0;i < f.length;i++) {
        var e = f.elements[i];
        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) {
            // first check if the field is empty
            if ((e.value == null) || (e.value == "") || isblank(e.value)) {
                empty_fields += "\n          " + e.name;
                continue;
            }

            // Now check for fields that are supposed to be numeric.
            if (e.numeric || (e.min != null) || (e.max != null)) {
                var v = parseFloat(e.value);
                if (isNaN(v) || 
                    ((e.min != null) && (v < e.min)) || 
                    ((e.max != null) && (v > e.max))) {
                    errors += "\"" + e.name + "\"  trebuie sa fie valoare cuprinsa";
                    if (e.min != null) 
                        errors += " intre " + e.min;
                    if (e.max != null && e.min != null) 
                        errors += " si " + e.max;
 
                    errors += ".\n";
                }
            }
        }
    }


    if (!empty_fields && !errors) return true;

    
    msg = "Formularul nu a fost trimis pentru ca:\n";
    
    msg += "______________________________________________________\n\n"

    if (empty_fields) {
        msg += "Urmatoarele campuri nu sunt complete:" 
                + empty_fields + "\n";
        if (errors) msg += "\n";
    }
    msg += errors;
    msg += "______________________________________________________\n\n"
   msg += "Corecteaza si retrimite.\n";
    alert(msg);
    return false;
}
