        /*
        All functions copyright 2004, Matthew Sturges and Web-Strategi.
        Do not use without permission.
        */
        
        
/*
=======================================================================================================
ACTIVE BOX FUNCTIONS
=======================================================================================================
*/


        //Function to move items from one active_box to another.
        function this_to_that(id, from_list, to_list) {
            if (document.getElementById) {
                deselect_row(id, from_list);
                var tbod = document.getElementById('tb_' + from_list + '_' + id);
                tbod.className = 'off'; 

                var tbod = document.getElementById('tb_' + to_list + '_' + id);
                tbod.className = 'on'; 
                
                update_value(id, from_list, to_list);
                
            }
            return false;
        }    
        
        
        //function to remove the highlight from a row in the active_box.
        function deselect_row(id, list) {
            if (id) {
                td = document.getElementById('td_' + list + '_' + id);
                td.style.color = 'black';
                td.style.backgroundColor = 'white';
            }
        }
        
        //function to highlight a row in an active_box and to mark it as the currently selected field.
        function select_row(id, list) {
            if (document.getElementById) {
                var td = document.getElementById('td_' + list + '_' + id);
                td.style.color = 'white';
                td.style.backgroundColor = '#000099';
                var id_old = document.form1.row_selected.value;
                var list_old = document.form1.row_selected_list.value;
                deselect_row(id_old, list_old); 
                document.form1.row_selected.value = id;
                document.form1.row_selected_list.value = list;
            }
            return false;
        }   
        
     
        //updates the value of the underlying form field for an active_box
        function update_value(id, from_list, to_list){
            //first, unset the from_list value;
            var fld = document.form1.elements[from_list];
            var vals = fld.value;            
            vals = vals.replace(',' + id + ',', ',');
            fld.value = vals;
            
            
            //now, set the to_list value
            fld = document.form1.elements[to_list];
            vals = fld.value;
            vals += id + ',';
            fld.value = vals;     
            
        }
               
        
        //This hides or shows one of the tbody bits in the active_box
        function tbody_on(id, which){
        	var tbod = document.getElementById(id);
        	if (which) {
        		tbod.className = 'on';
        		document.form1.update_password.value = '1';
        	} else {
        		tbod.className = 'off';
        		document.form1.update_password.value = '';
        	}
        }

/*
=======================================================================================================
GENERAL FUNCTIONS
=======================================================================================================
*/

        
        //if you don't know what this is, i can't help you.
        function confirm_delete(){
        	return confirm('Are you sure you want to delete this item?');
        }

