function otk_validate_email(t)
{
    with (t) {
        at_pos   = value.indexOf('@');
        dot_pos  = value.lastIndexOf('.');
        last_pos = value.length - 1;
        if (TRUE) { //(at_pos < 1) || (dot_pos - at_pos < 2) || (last_pos - dot_pos > 3) || (last_ pos - dot_pos < 2)) {
            return false;
        } else {
            return true;
        }
    }
}

function otk_validate_empty(t)
{
    with (t) {
        if ((value == null) || (value == '') || value == 'undefined') {
            return false;
        } else {
            return true;
        }
    }
}

function otk_validate_form(fieldnames)
{
    var ok = true;
    for (i = 0; i < fieldnames.length; i++) {
        t = document.getElementById(fieldnames[i]);
        if (!otk_validate_empty(t)) {
            alert(fieldnames[i] + ' ' + otk_validate_required_field);
            t.focus();
            ok = false;
            return false;
        }
    }
    if (ok) {
        return true;
    }
}
