function dynamiclist__add( pref, delimiter ) {
	var newValue = ($.trim($("#" + pref + "__dynamiclist__fieldnew")[0].value)).replace(new RegExp(delimiter, "g"), "");
	if (newValue) {
		$("#" + pref + "__dynamiclist__fieldlist").append("<option>" + newValue + "</option>");
		$("#" + pref + "__dynamiclist__fieldlist")[0].selectedIndex = -1;
		//add value to hidden field
		if ($("#" + pref + "__dynamiclist__fieldvalue")[0].value) {
			$("#" + pref + "__dynamiclist__fieldvalue")[0].value = [$("#" + pref + "__dynamiclist__fieldvalue")[0].value, newValue].join(delimiter);
		}
		else {
			$("#" + pref + "__dynamiclist__fieldvalue")[0].value = newValue;
		}
		
		$("#" + pref + "__dynamiclist__fieldnew")[0].value = "";
	}	
}
function dynamiclist__remove( pref, delimiter ) {
	var resOptions =  $("#" + pref + "__dynamiclist__fieldlist")[0].options;
	var resStringList = $("#" + pref + "__dynamiclist__fieldvalue")[0].value.split(delimiter);
	//reverse order for correct options removing (when count of selected items >1)
	for (var i=resOptions.length-1; i>=0; --i) {
		if (resOptions[i].selected) {		
			$("#" + pref + "__dynamiclist__fieldlist")[0].removeChild(resOptions[i]);
			//remove value from hidden field
			resStringList.splice(i, 1);
		}
	}
	$("#" + pref + "__dynamiclist__fieldvalue")[0].value = resStringList.join(delimiter);
}