thisURL = String(document.location);
thisURLtmp = thisURL.match(/(.*pishchevie_dobavki.*\/)[a-z0-9_]+.php/);
if(thisURLtmp) {	thisURL = thisURLtmp[1] + "index.php";}
start = -1;
end = -1;
function menuItemHidden(displayedItems,direction) {	if(itemList.length <= displayedItems) return;
	var currentItem = 0;
	for(i=0;i<itemList.length;i++) {		if(thisURL.indexOf(itemList[i].getAttribute("href")) != -1) {
			currentItem = i;
			break;
		}
	}
	if(start == -1 && end == -1) {
		start = currentItem-(displayedItems/2-1);
		end = currentItem+(displayedItems/2);
	} else {		start += direction;
		end += direction;	}
	if(start <= 0) {
		end = end - start;
		start = 0;
		document.getElementById("upArrow").style.display = "none";
	} else {		document.getElementById("upArrow").style.display = "inline";
	}
	if(end >= itemList.length) {
		start = start - (end - itemList.length);
		end = itemList.length;
		document.getElementById("downArrow").style.display = "none";
	} else {
		document.getElementById("downArrow").style.display = "inline";
	}
	for(i=0;i<itemList.length;i++) {		if(i < start || i > end) {
			itemList[i].style.display = "none";
		} else {			itemList[i].style.display = "block";		}
	}
}