	function move(fbox, tbox) 
	{
		var arrFbox = new Array();
		var arrTbox = new Array();
		var arrLookup = new Array();
		var i;
		/* That part fills arrLookup with values of any data found in tbox
		*/
		for (i = 0; i < tbox.options.length; i++) 
		{
			arrLookup[tbox.options[i].text] = tbox.options[i].value;
			arrTbox[i] = tbox.options[i].text;
		}
		/* That part fills 3 arrays (arrLookup, arrTbox & arrFbox)
			arrLookup is filled with any values found in list2 
				(note that arrLookup was filled with all values found in list1 from the previous step)
			arrTbox is filled with selected items from list1 (fbox)
			arrFbox is filled with un-selected items from list1 (fbox)
		*/
		var fLength = 0;
		var tLength = arrTbox.length;
		for(i = 0; i < fbox.options.length; i++) 
		{
			arrLookup[fbox.options[i].text] = fbox.options[i].value;
			if (fbox.options[i].selected && fbox.options[i].value != "") 
			{
				arrTbox[tLength] = fbox.options[i].text;
				tLength++;
			}
			else 
			{
				arrFbox[fLength] = fbox.options[i].text;
				fLength++;
			 }
		}
		//arrFbox.sort();
		//arrTbox.sort();
		fbox.length = 0;
		tbox.length = 0;
		
		/* That part creats new option <option> and sets data of each array (arrTbox & arrFbox)
			in it using values of arrLookup
		*/
		var c;
		for(c = 0; c < arrFbox.length; c++) 
		{
			var no = new Option();
			no.value = arrLookup[arrFbox[c]];
			no.text = arrFbox[c];
			fbox[c] = no;
		}
		for(c = 0; c < arrTbox.length; c++) 
		{
			var no = new Option();
			no.value = arrLookup[arrTbox[c]];
			no.text = arrTbox[c];
			tbox[c] = no;
		}
	}
	
	function setFocus(objText, objList)
	{
		var nOptionNO;
		var strTarget;
		var strTemp;
		var strRetVal;
		var i,nPos,nFirstPos;
		strRetVal = "";				
		strTarget = objText.value;
		nOptionNO = objList.length;
		for (i = 0; i < nOptionNO; i++)
		{
			strTemp = new String(objList.options[i].text);
			strTemp = strTemp.toLowerCase();
			nPos    = strTemp.indexOf(strTarget.toLowerCase(),0);
			if (nPos==0 && strTarget!="")
			{
				objList.options[i].selected=true;
				if (strRetVal!="")
				{
					strRetVal += "," + objList.options[i].value;
				}
				else
				{
					nFirstPos = i;
					strRetVal = objList.options[i].value;
				}	
			}	
			else
			{
				objList.options[i].selected=false;
			}
			strTemp = null;
		}
		objList.options[0].selected=false;
		if (nFirstPos>=0)
		{
			objList.options[nFirstPos].selected=true;
		}
		return strRetVal;
	}
	
	function commitChooseIds(objTarget, formIds, formNames)
	{
		var strNames = "";
		var strIds = "";
		var i;
		for (i = 0; i < objTarget.options.length; i++) 
		{
			if (i == 0)
			{
				strNames = objTarget.options[i].text ;
				strIds = objTarget.options[i].value;
			}
			else
			{
				strNames = strNames + ","  + objTarget.options[i].text ;
				strIds = strIds + ","  + objTarget.options[i].value;
			}
		}
    var ObjOpenerForm; 
    ObjOpenerForm = eval("window.opener."+formIds);
    ObjOpenerForm.value = strIds;
    ObjOpenerForm = eval("window.opener."+formNames);
    ObjOpenerForm.value = strNames;
		window.close();
	}

  function showSelectWin(winUrl)
  {
    window.open(winUrl, "SelectWin", "width=550, height=350, left=200, top=100, scrollbars=0");
  }