<!--

function CheckExistence(objTo,str)
{
	for(var j=0;j<objTo.options.length;j++)
		if(objTo.options[j].text==str)
			 return true;
	return false;
}

function AddOption(objTo,Option)
{
	var oOption = document.createElement("OPTION");
	oOption.text = Option.text;
	oOption.value = Option.value;
	objTo.options[objTo.options.length] = oOption;
//	objTo.add(oOption);
}

function MoveAll(FromControl,ToControl)
{
	if((FromControl!=null)&&(ToControl!=null))
	{
		for(var i=0;i<FromControl.options.length;i++)
			if(!CheckExistence(ToControl,FromControl.options[i].text))
					AddOption(ToControl,FromControl.options[i]);
		do
		{
			FromControl.options[0]=null;
		}
		while (FromControl.options.length>0)
	}
}

function MoveOne(FromControl,ToControl)
{
	if((FromControl!=null)&&(ToControl!=null))
	{
		for(var i=0;i<FromControl.options.length;i++)
			if((FromControl.options[i].selected) && (!CheckExistence(ToControl,FromControl.options[i].text)))
					AddOption(ToControl,FromControl.options[i]);

		for(var i=0;i<FromControl.options.length;i++)
			if(FromControl.options[i].selected)
			{
				FromControl.options[i]=null;		
				FromControl.selectedIndex = (i < FromControl.options.length) ? i : 0;
				return true;
			}
	}
		
}

//-->
