var flag_no_javascript = false;
function test_value(val) {
	
	if (val == undefined) {
		val = '';
	} else {
		val = trim(val);
	}
	return val;
}


function submit_action_form(page, todo, anhor) {
	anhor = test_value(anhor);
	if (anhor!='') {

		document.action_form.action += anhor;
	}
    document.action_form.elements['actioncontext[page]'].value = test_value(page);
    document.action_form.elements['actioncontext[todo]'].value = test_value(todo);

	document.action_form.submit();
    return false;
};


function submit_menu (page, todo) {
	
	document.menu.elements['ap'].value = test_value(page);
    document.menu.elements['at'].value = test_value(todo);
    document.menu.submit();
    return false;
}


function submit_f( page, todo, form, form_name) {
	form = test_value(form);
	form_name = test_value(form_name);
	todo = test_value(todo);
	page = test_value(page);
	if (form == '') {
		form = document.action_form;
	} 
	if (form_name == '') {
		form_name = 'action_form';
	}
	if (!flag_no_javascript) {
		var flag = test_f(form, form_name);
	} else {
		var flag = true;
	}
	if (flag) {
		submit_action_form(page, todo);
	}	
	return false;
}
