function fire_action( p ) {
	if ( typeof( p ) == 'string') p = { action: p };
	if ( p.action == null ) return;
	document.getElementById('abm[action]').value = p.action;
	form = document.getElementById('data_form');
	save_rich_editors()
	form.submit();
}

function post( prefix, p, page ) {
	if ( typeof( p ) == 'string') p = { action: p };
	if ( p.action == null ) return;

	for ( inputName in p ) {
		input = document.getElementById( prefix + '[' + inputName + ']' );
		if ( input != null ) input.value = p[inputName];
	}
	form = document.getElementById('data_form');
	if ( page != null ) form.action = page;
	save_rich_editors()
	form.submit();
}

function set_id( prefix, id ) {
	input = document.getElementById( prefix + '[id]');
	if ( input != null ) input.value = id;
}

function save_rich_editors() {
	if ( typeof rich_editors === 'undefined' ) return;
	if ( rich_editors.length == 0 ) return;
	for( i=0; i < rich_editors.length; i++ ) {
		rich_editors[i].saveHTML();
	}
}
