function psSelAdd(tbox, val, txt) {
	var i=0,j=0;
	for(i=0; i<tbox.options.length; i++){
		if(tbox.options[i].value == val){
			return;
		}
	}
	if(txt != "") {
		var no = new Option();
		no.value = val;
		no.text = txt;
		var maxidx = tbox.options.length;
		tbox.options[maxidx] = no;
	}
}

function psSelRemoveAll(box) {
	for(var i=0; i<box.options.length; i++) {
		if(box.options[i] != "") {
			box.options[i].value = "";
			box.options[i].text = "";
		}
	}
	psSelBumpUp(box);
} 


function psSelBumpUp(abox) {
	for(var i = 0; i < abox.options.length; i++) {
		if(abox.options[i].value == "" && abox.options[i].text == "")  {
			for(var j = i; j < abox.options.length - 1; j++)  {
				abox.options[j].value = abox.options[j + 1].value;
				abox.options[j].text = abox.options[j + 1].text;
			}
			var ln = i;
			break;
		}
	}
	if(ln < abox.options.length)  {
		abox.options.length -= 1;
		psSelBumpUp(abox);
	}
}

