/******
 * Hypotecni kalkulator zjednoduseny
 * Autostart skript, ktery spusti prvni vypocet po nacteni stranky
 */
function findForm(aname)
{
    if (document.all) {
        return document.all[aname];
    }

    if (document.forms[aname]) {
        return document.forms[aname];
    }

    if (document.getElementById) {
        return document.getElementById(aname);
    }

    for(i=0; i<document.forms.length; i++) {
        if (document.forms[i].name == aname) {
            return document.forms[i];
        }
    }
    return false;
}

//--- calculate hypo
function calculateHypo()
{
    hForm = findForm('hypoForm');
    if (hForm) {
        hypo_calc(hForm);
    }
}

//--- schedule calculate hypo
window.setTimeout('calculateHypo()', 1000);
