		function move_selected_items(aFromId, aWhereId, lstSelected, ftpValue)
		{
				var aFrom=document.getElementById(aFromId);
				var aWhere=document.getElementById(aWhereId);
				while (aFrom.selectedIndex!=-1)
				{
					if (aWhere != null)  { 
					var option_text = aFrom.options[aFrom.selectedIndex].text;
					var option_id = aFrom.options[aFrom.selectedIndex].value;
					var new_option = new Option(option_text, option_id);
					aWhere.options[aWhere.options.length] = new_option;
					}
					aFrom.options[aFrom.selectedIndex] = null;
				}
				var selectedList;
				var w;
				var sendString="";	
				
				selectedList=document.getElementById(lstSelected);
				
				if(aWhereId==lstSelected)selectedList=aWhere;
				else selectedList=aFrom;
					
				for(w=0;w<selectedList.options.length;w++) {
					sendString += selectedList.options[w].value+",";
				}
				sendString = sendString.substring(0, sendString.length-1);
				if (ftpValue != null)
				{
					document.getElementById(ftpValue).value=sendString;
				}
		}
		
		function selectAllOptions(objId) 
		{
				var obj=document.getElementById(objId);
				for (var i=0; i<obj.options.length; i++) {
					obj.options[i].selected = true;
				} 
		} 
		
		function initialize_listSelected(listSelected, ftpControl)
		{
			var selectedList;
			var w;
			var sendString="";  
			
			if(document.getElementById(listSelected) && document.getElementById(ftpControl))
			{
				selectedList=document.getElementById(listSelected);

				for(w=0;w<selectedList.options.length;w++) {
					sendString += selectedList.options[w].value+",";
				}  	
				sendString = sendString.substring(0, sendString.length-1)
				document.getElementById(ftpControl).value=sendString;
			}
		}
					
		function on_remove(aWhereId, aFromId, ftpControl) {
			move_selected_items(aWhereId, aFromId, aWhereId, ftpControl);
		}  

		function on_add(aFromId, aWhereId, ftpControl, notAppCtrl) {
			move_selected_items(aFromId, aWhereId, aWhereId, ftpControl);
			if (notAppCtrl != null)
			{
				notAppCtrl = document.getElementById(notAppCtrl);
				if (notAppCtrl != null)
					notAppCtrl.checked = false;
			}
		} 
