//********************************************************************
// addrow.js
//
// DHTML code for dynamically adding a row to a table.  This is
// intended for a FORM table which includes INPUT elements.  The
// intent is to allow for rows of input which might need to be
// expanded in a FORM.
//
// Dependencies:
//      jquery.js
//
//********************************************************************
// $Id$
//********************************************************************

$(document).ready( function() {

    $("#ingred").click( function() {

        var rows   = $(".addrow");
        var newRow = rows.last().clone();
        var n      = rows.length;

        $("input", newRow).eq(0).attr("name", "amt-" + n);
        $("input", newRow).eq(1).attr("name", "ing-" + n);


        newRow.insertAfter( rows.last() )

    });

});


//********************************************************************
// END
//********************************************************************;
