+
+function copyelement(from, to) {
+ if ( from.type == undefined ) {
+ to.value = '';
+ } else if ( from.type == 'select-one' ) {
+ to.value = from.options[from.selectedIndex].value;
+ //alert(from + " (" + from.type + "): " + to.name + " => (" + from.selectedIndex + ") " + to.value);
+ } else if ( from.type == 'select-multiple' ) {
+ var i = 0;
+ var count = 0;
+ var values = new Array();
+ for (i=0;i<from.length;i++) {
+ if (from.options[i].selected){
+ values[count++] = from.options[i].value;
+ }
+ }
+ for (i=0;i<values.length-1;i++) {
+ var clone = to.cloneNode(true);
+ clone.value = values[i];
+ to.form.appendChild(clone);
+ }
+ if (count > 0) {
+ to.value = values[values.length-1];
+ }else{
+ to.value = '';
+ }
+ } else if ( from.type == 'checkbox' ) {
+ if ( from.checked ) {
+ to.value = from.value;
+ } else {
+ to.value = '';