function addConfirmer() {
    myform = document.userform;
    for (i = 0; i < myform.selectableIDList.options.length; i++) {
        if (myform.selectableIDList.options(i).selected == true) {
	    j = myform.selectedIDList.options.length - 1;
	    for (; j >= 0; j--) {
	 	if (myform.selectableIDList.item(i).value == myform.selectedIDList.item(j).value) {
	 	    break;
	 	}
	    }
	    if (j < 0) {
	        newOpt = new Option(myform.selectableIDList.item(i).text, myform.selectableIDList.item(i).value);
                myform.selectedIDList.add(newOpt);
	    }
	}
    }
}

function removeConfirmer() {
    myform = document.userform;

    myindex = 0;
    for (; myindex < myform.selectedIDList.options.length; myindex++) {
        if (myform.selectedIDList.options(myindex).value == myform.operatorID.value) {
            break;
	}
    }
    if (myindex == myform.selectedIDList.options.length) {
        myindex = -1;
    }

    for (i = myform.selectedIDList.options.length - 1; i > myindex; i--) {
        if (myform.selectedIDList.options(i).selected == true) {
            myform.selectedIDList.remove(i);
	}
    }
}

function GetUsers()
{
		myform = document.userform;
		myindex=0;
		for (i = myform.selectedIDList.options.length -1; i >= myindex; i--) {
        myform.selectedIDList.options(i).selected = true;
		myform.SelectedUsers.value=myform.SelectedUsers.value +','+ myform.selectedIDList.item(i).value
		}
}

function closewindow(selectusers,strSelectUsers){
	self.opener.document.MailForm.copytoid.value=selectusers;
	self.opener.document.MailForm.copyto.value=strSelectUsers;
	self.close();
}
