var counter = 0;
/*Start a counter. Yes, at 0*/
function addInputRow(row) {
    counter++;
/*I find it easier to start the incrementing of the counter here.*/
    var newFields = document.getElementById(row).cloneNode(true);
    newFields.id = '';
    newFields.style.display = 'block';
    var newField = newFields.childNodes;
    for (var i=0;i<newField.length;i++) {
        var theName = newField[i].name
        if (theName)
                newField[i].name = theName + counter;
/*This will change the 'name' field by adding an auto incrementing number at the end. This is important.*/
/*		alert(newField[i].name); */
 } 
/*		var num = newField[i].name;*/

        var insertHere = document.getElementById(row);
/*Inside the getElementById brackets is the name of the div class you will use.*/
        insertHere.parentNode.insertBefore(newFields,insertHere);
/*		document.input1_1.focus();*/
}


