


function selSELECT(mySelectBox, which) {
	for(i=0;i<mySelectBox.options.length;i++) {
		if (mySelectBox.options[i].value == which) {
		select = i;
	break;	
	}
	
	
	}
	mySelectBox.selectedIndex = select;
}



function removeMe(object,saveObject) {
    if (typeof object != 'undefined') {
	var boxLength = object.length;
	arrSelected = new Array();
	var count = 0;
	for (i = 0; i < boxLength; i++) {
	    if (object.options[i].selected) {
		arrSelected[count] = object.options[i].value;
	    }
	    count++;
	}
	var x;
	for (i = 0; i < boxLength; i++) {
	    for (x = 0; x < arrSelected.length; x++) {
		if (object.options[i].value == arrSelected[x]) {
		    object.options[i] = null;
		}
	    }
	    boxLength = object.length;
	}

    }
    saveMe(object,saveObject);
}
function moveOver(fromObject, toObject,saveObject)  {

    if (typeof fromObject != 'undefined' && typeof toObject != 'undefined') {
	var boxLength = toObject.length;
	var selectedItem = fromObject.selectedIndex;
	var selectedText = fromObject.options[selectedItem].text;
	var selectedValue = fromObject.options[selectedItem].value;
	var i;
	var isNew = true;
	myString = new String(selectedText);
	rExp = /\xA0/g;
	selectedText = myString.replace(rExp, '');
	
	if (boxLength != 0) {
	    for (i = 0; i < boxLength; i++) {
		thisitem = toObject.options[i].text;
		if (thisitem == selectedText) {
		    isNew = false;
		    break;
		}
	    }
	}
	if (isNew){// && fromObject.options[selectedItem].style.color != '#aaaaaa') {
	   newoption = new Option(selectedText, selectedValue, false, false);
	   //newoption.style.backgroundColor = fromObject.options[selectedItem].style.backgroundColor;
	   toObject.options[boxLength] = newoption;
	 }
	fromObject.selectedIndex=-1;
	
    }
    
    saveMe(toObject,saveObject);

}

function saveMe(object, saveObject) {
    var strValues = "";
    if (typeof object != 'undefined') {
	var boxLength = object.length;
	var count = 0;
	if (boxLength != 0) {
	    for (i = 0; i < boxLength; i++) {
		if (count == 0) {
		    strValues = object.options[i].value;
		}
		else {
		    strValues = strValues + "," + object.options[i].value;
		}
		count++;
	    }
	}
    }
    if (typeof saveObject != 'undefined') {
	saveObject.value=strValues;
    }
}
