/**********************************************************************
 * SPS: Sam's Publishing System
 * Copyright (C) 1999-2002 by Sam Nelson sam@clevernamehere.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 **********************************************************************
 * $Header: /sps/SPS/clipboard.cgi 1     9/22/03 1:15p Laptop $
 * $NoHeaders: $
 **********************************************************************/

function doMove(f, t, v, h) 
{
	from_widget = document.main[f];
	to_widget = document.main[t];
	hidden_widget = document.main[h];
	value_widget = document.main[v];
	
	for (i=0; i<from_widget.length; ++i)
	{
		if (from_widget.options[i].selected)
		{
			var newoption = new Option(from_widget.options[i].text, from_widget.options[i].value);
			to_widget.options[to_widget.length] = newoption;
			from_widget.options[i] = null;
			i=-1; // Removing changed the length; just to be on the safe side, go back a bit. 
		}
	}
	
	h_val = "";
	for (i=0; i<value_widget.length; ++i)
	{
		if (i>0)
		{
			h_val += "|";
		}
		h_val += value_widget[i].value;
	}
	hidden_widget.value = h_val;

//	alert(hidden_widget.value);
}

