
var smallMenu = function(o, formId, inputId) {
	var items = o.parentNode.childNodes;
	for ( var i = 0; i < items.length; i++) {
		if (items[i].id)
			items[i].className = "menu-inactive";
	}
	o.className = "menu-active";

	var formDivs = o.parentNode.parentNode.getElementsByTagName('FORM');
	for ( var i = 0; i < formDivs.length; i++) {
		if (formDivs[i].id == formId)
			formDivs[i].style.display = 'block';
		else
			formDivs[i].style.display = 'none';
	}
	document.getElementById(inputId).focus();
	return false;
}

// ---

var onCatFormSubmit = function(theForm) {
	var val = theForm.anytext.value;
	if (window.location.pathname == "/web/guest/catalogue-client") {
		app.search({anytext: val, ttype:'AnyText'});
	} else document.formadr.sumbit();
	return false;
}

var onAddrFormSubmit = function(theForm) {
	var val = theForm.q.value;
	if (window.location.pathname == "/web/guest/map") {
		parseAddress(val);
	} else document.formcat.sumbit();
	return false;
}

var onDocFormSubmit = function(theForm) {
	var val = theForm.anytext.value;
	document.formdoc.sumbit();
	return false;
}

