
window.onload = prepareForm;

function prepareForm() {

    if( ! document.getElementById) {
        return;
    }

    //if( ! document.getElementById("personList")) {
    //    return;
    //}

    if( document.getElementById( "price")) {
        document.getElementById( "price").onblur = function() {
            if( ! checkNum( this.value)) {
                this.focus();
            }
        }
    }


    //-------------------------------------------------------
    // Listeneintrag löschen
    //-------------------------------------------------------

    aDelRef = document.getElementsByName( "delete");
    for( i = 0; i < aDelRef.length; i++) {
        aDelRef[i].onclick = function() {
            //aPNames = document.getElementsByName( "fldname");
            //artName = aPNames[0].childNodes[0].data;
            if ( ! confirm( "Datensatz löschen?")) {
               return false;
            }
        }
    } // for...


    aNewRef = document.getElementsByName( "newrecord");
    for( i = 0; i < aDelRef.length; i++) {
        aNewRef[i].onclick = function() {
            if ( ! confirm( "Neuen Datensatz anfügen?")) {
               return false;
            }
        }
    } // for...

} // prepareForm...
