var arrMenuTypes = new Array("region", "city", "resort", "room");

function showHide(target) {
	// Hide all other
	for (var i=0; i < arrMenuTypes.length; i++) {
		if (document.getElementById(arrMenuTypes[i] + "_menu")) {
			if (target != arrMenuTypes[i] && document.getElementById(arrMenuTypes[i] + "_menu").style.display != "none") {
				new Effect.SlideUp(arrMenuTypes[i]+ "_menu", {duration: .4});
			}
		}
	}

	new Effect.toggle(target + "_menu", "Slide");

	return false;
}

function moveSearch(direction, sender) {
	// Determine the location of the next element based on direction
	if (direction == "next") {
		target = sender.previousSibling.previousSibling.firstChild.nextSibling.lastChild.previousSibling;
	} else {
		target = sender.nextSibling.nextSibling.firstChild.nextSibling.firstChild.nextSibling;
	}

	var currentPos = target.style.left;




	if (direction == "next") {
		currentPos = (currentPos.replace("px", "") * 1) + 54;
		new Ajax.Updater(target, 'moveSearch.asp?nav=1&dir=f&pos=' + currentPos, {insertion: Insertion.After});
		new Effect.Move ("search_images", {x: -54, y:0, duration: .5});
	} else if (currentPos != "0px" || currentPos != "") {
		currentPos = (currentPos.replace("px", "") * 1) - 54;
		new Ajax.Updater(target, 'moveSearch.asp?nav=1&dir=b&pos=' + currentPos, {insertion: Insertion.After});
		new Effect.Move ("search_images", {x: 54, y:0, duration: .5});
	}
}
