
function startCatMenu(ulName) {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById(ulName);
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					if (this.className.indexOf(" over")<0)
						this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}

				if (node.childNodes.length < 2)
					continue;					
				ul = node.childNodes[1];

				for (j=0; j<ul.childNodes.length; j++) {
					node2 = ul.childNodes[j];
					if (node2.nodeName=="A") {
						if (node2.childNodes.length < 1)
							continue;
						li = node2.childNodes[0];

						li.onmouseover=function() {
							c = this.style.color;
							this.style.color = "#ffffff";
							this.style.backgroundColor = c;
						}
						li.onmouseout=function() {
							c = this.style.backgroundColor;
							this.style.color = c;
							this.style.backgroundColor = "";
						}
					}
				}
			}
		}
	}
}

function loadShopList() {
	type = "";
	alphabet = "";
	cat = "";
	subcat = "";
	
	href = window.location.href;
	pos = href.lastIndexOf("#");
	if (pos>=0) {
		paramSt = href.substring(pos+1, href.length);
		paramArr = paramSt.split("&");
		for (i=0; i<paramArr.length; i++) {
			paramPair = paramArr[i].split("=");
			if (paramPair.length == 2) {
				key = paramPair[0];
				val = paramPair[1];
				switch (key) {
					case "alphabet": alphabet = val; type = "alphabet"; break;
					case "cat": cat = val; type = "cat"; break;
					case "subcat": subcat = val; type = "cat"; break;
				}
			}			
		}
	}

	divName = "";
	switch (type) {
		case "alphabet":
			divName = "alphabet" + alphabet;
			break;
		case "cat":
			divName = "cat_"+cat+"_subcat_"+subcat;
			break;
		case "":
			divName = "emptyDiv";
			break;
	}

	ShowDiv(divName);
}

var lastDivName = "";

function ShowDiv(divName) {
	if (lastDivName != "") {
		div = document.getElementById(lastDivName);
		if (div)
			div.style.display = "none";
	}

	if (divName != "emptyDiv") {
		div = document.getElementById("emptyDiv");
		if (div)
			div.style.display = "none";
	}

	div = document.getElementById(divName);
	if (div)
		div.style.display = "";

	lastDivName = divName;
}

function highlightShop(floor, shopNo, catCode, isOn) {
	var os = navigator.platform.toLowerCase();
	var is_win = (os.indexOf("win") != -1);
	var is_mac = (os.indexOf("mac") != -1);
	if (is_mac)
		return;

	flash = document.all.SelectFloorFlash;
	flash.SetVariable("hiFloor", floor);
	flash.SetVariable("hiShopNo", shopNo);
	flash.SetVariable("hiCatCode", catCode);
	flash.SetVariable("hiOn", isOn);
}
