/*
** Crea tanti HIDDEN quanti sono gli oggetti nella pagina JSP che hanno il nome con "|"
*/
function makeHiddenForm(MyForm){

    for ( m=0; m < MyForm.length ; m++ ) {
        var obj = MyForm.elements[m];
        var nome = obj.name;
        var valore = obj.value;
        var ind1 = nome.indexOf("|");

        if(ind1 != -1){
            var newName = nome.substring(0,ind1);
            document.write("<input type=\"hidden\" name=\""+newName+"\" value=\""+valore+"\">");
        }
    }
}
/*
** Valorrizza tutti gli HIDDEN corrispondenti agli oggetti che
** hanno il nome con il "|" con il valore di ques'ultimi
*/
function replaceValueHiddenForm(MyForm){

    for ( z=0; z < MyForm.length ; z++ ) {
        var obj = MyForm.elements[z];
        var nome = obj.name;
        var valore = obj.value;
        var ind1 = nome.indexOf("|");

        if(ind1 != -1){
            var newName = nome.substring(0,ind1);
            MyForm.elements[newName].value = valore;
        }
    }
}

/*
** Stessa funzione della replaceParam ma ottimizzata per Netscape 6 o superiore
*/
function replaceParamNS6(MyForm){
    var indAuto = 0;
    for ( z=0; z < MyForm.length; z++ ) {
        var obj = MyForm.elements[indAuto];
        var nome = obj.name;
        var ind1 = nome.indexOf("|");
        if(ind1 != -1){
            var newName = nome.substring(0,ind1);
            MyForm.elements[indAuto].name = newName;
        }
        indAuto++;
    }
}

