function core_form_clear_select_list(select_list) {
	while (select_list.options.length > 0) select_list.options[0] = null;
}
function core_toggle_htmleditor(id, editor) {		// switch between views of htmleditor and source, updating content if necessary
	var source = core_dom_element(id);
	core_update_htmleditor(source, editor);		// update content
	core_dom_toggle(source, core_dom_element("toggle_" + id), "source", "editor");		// toggle source and text of source/editor button
	core_dom_toggle(core_dom_element("editor_" + id));	// toggle editor
	is_source = core_dom_element('is_source_' + id);
	is_source.value = (is_source.value == 0) ? 1 : 0;
}
function core_update_htmleditor(source, editor) {		// updates content of htmleditor/source textarea, depending on which one is currently visible
	if (!source) return;
	if (source.style.display == 'none') source.value = editor.getContent();	//  update content from editor if currently hidden
	else editor.setContent(source.value); 		// otherwise update the editor with the source content
}