
/* This function merely allows a button to request that an encompassing form copy elements between its inputs \
   (c)2008 DRE INC 
*/

/* input : obj
   value : the calling object
   input : list
   value : [ [ 'input'  , 'other-input'  ] ,
             [ 'input2' , 'other-input2' ] ] ;
   what  : copies input to other input for each list in list
*/
function dup_form_values( o , l )
{
    /* first find the enclosing form */
    f = o ;

    while( f && f.tagName != "FORM" )
        {
            f = f.parentNode ;
        }
    
    if( ! f )
        return 0 ;

    for( e in l )
        {
            f[ l[e][1] ].value = f[ l[e][0] ].value ;
        }

    return 1 ;

}
