function dettagli(current) {
	var spanID = new Array()
	spanID[0] = "note";
	spanID[1] = "dettagli";
	spanID[2] = "ingredienti";

	for ( var i = 0; i < spanID.length; i++)
		if (current == spanID[i]) {
			document.getElementById(spanID[i]).style.display = '';
			if (document.all) {
				document.getElementById(spanID[i] + 'span').style.backgroundPosition = "100% -42px";
				document.getElementById(spanID[i] + 'a').style.backgroundPosition = "0% -42px";
			} else {
				document.getElementById(spanID[i] + 'SPAN').style.backgroundPosition = [ '100%', '-42px' ].join('');
				document.getElementById(spanID[i] + 'A').style.backgroundPosition = [ '0%', '-42px' ].join('');
			}
		} else {
			document.getElementById(spanID[i]).style.display = 'none';
			if (document.all) {
				document.getElementById(spanID[i] + 'span').style.backgroundPosition = "100% 0px";
				document.getElementById(spanID[i] + 'a').style.backgroundPosition = "0% 0px";
			} else {
				document.getElementById(spanID[i] + 'SPAN').style.backgroundPosition = [ '100%', '0px' ].join('');
				document.getElementById(spanID[i] + 'A').style.backgroundPosition = [ '0%', '0px' ].join('');
			}
		}
}

function funMat(pMethod) {
	var eForm = document.getElementById('fMatSearch');
	var method = '?method='
	var actionSplit = eForm.action.split(method);
	eForm.action = actionSplit[0] + method + pMethod;
	eForm.submit();
}

function funRic(pMethod) {
	var eForm = document.getElementById('fRicSearch');
	var method = '?method='
	var actionSplit = eForm.action.split(method);
	eForm.action = actionSplit[0] + method + pMethod;
	eForm.submit();
}

function funBasket(pMethod) {
	var eForm = document.getElementById('fBasket');
	var method = '?method='
	var actionSplit = eForm.action.split(method);
	eForm.action = actionSplit[0] + method + pMethod;
	eForm.submit();
}

function getEl(id) {
	element = document.getElementById(id);

	return element;
}

function hideEl(id) {
	var element = getEl(id);

	element.style.display = 'none';
}

function showEl(id) {
	var element = getEl(id);

	element.style.display = '';
}

function ShowHide(sid, last) {
	var el = 'info_' + sid;
	if (getEl(el).style.display == 'none') {
		showEl(el);
	} else {
		hideEl(el);
	}
}

