<!--
// menu style vars
var menuwidth = 250;
var menuheight = 25;
var border = "#C6C6C6";
var border2 = "#555555";
var menubgOn = "#F1F1F1";
var menubgOff = "#ffffff";

var menuXoffset = 0;
var menuYoffset = 0;

// functionality variables
var delay = 500;
var delayStart = 150;
var useMask = false;
var useDHTML = false;
var hideSels = false;

var start;
var hideFlag;
var hideTimer;
var showTimer;
var curMenu;
var curItem;
var curNav;
var activeMenu;
var theMenu;
var theImg;
var theDiv;
var theCont;
var theMask;
var onMenu = false;
var menusWritten = false;

var upNavImgBtn;
var downNavImgBtn;
	
// menu building variables;
var menucount = 0;

var menustyle = "width:" + menuwidth + "px; text-align:left; border-left:" + border + " 1px solid; border-right:" + border2 + " 1px solid; background-color:" + menubgOff + "; cursor: pointer;";

var separator = "<div class=\"sepstyle\"> </div>";

function menuobject (label, url) {
	this.label = label;
	this.url = url;
	return this;
}

function renderdata () {
	menuData[catCount++] = tmpData;
	tmpData = new Array();
	count = 0;
}

// Turn iFrame mask on for IE 5.5+ / PC only
if (is_ie && !is_mac_ie) {
	if (is_ie5_5up) {
		useMask = true;
	}
	else {
		hideSels = true;
	}
}

// Turn on DHTML for 5+ browsers only
if (is_ie && !is_ie5up) {
	useDHTML = false;
} else if(!nn4) { useDHTML = true; }

function writeMenus() {
	if(useDHTML) {
		for (i = 0; i < menuData.length; i++) {
			document.writeln("<div id=\"menu" + i + "\" style=\"position:absolute; z-index:100; top:0px; left:0px; height:200px; overflow:hidden; visibility:hidden;\">");
		//	if (useMask) {
				document.writeln("<div id=\"cont" + i + "\" style=\"position:relative;top:16px;\">");
		//	}
			for (j = 0; j < menuData[i].length; j++) {
				if (j == 0) {
					document.write("<div id=\"menuitem" + menucount + "\" onMouseOver=\"startShow('" + i + "'); changebg('menuitem" + menucount + "'); changeStatus('" + menuData[i][j].url + "');\" changeStatus('');\" onClick=\"goTo('" + menuData[i][j].url + "');return false;\" style=\"" + menustyle + "\"><div class=\"dhtmlmenuitem\"><a href=\"" + menuData[i][j].url + "\" class=\"dhtmlmenulink\">" + menuData[i][j].label + "</a></div>" + separator + "</div>");
				}
				else if (j < menuData[i].length - 1) {
					document.write("<div id=\"menuitem" + menucount + "\" onMouseOver=\"startShow('" + i + "'); changebg('menuitem" + menucount + "'); changeStatus('" + menuData[i][j].url + "');\" changeStatus('');\" onClick=\"goTo('" + menuData[i][j].url + "');return false;\" style=\"" + menustyle + "\"><div class=\"dhtmlmenuitem\"><a href=\"" + menuData[i][j].url + "\" class=\"dhtmlmenulink\">" + menuData[i][j].label + "</a></div>" + separator + "</div>");
				}
				else {
					document.write("<div id=\"menuitem" + menucount + "\" onMouseOver=\"startShow('" + i + "'); changebg('menuitem" + menucount + "'); changeStatus('" + menuData[i][j].url + "');\" changeStatus('');\" onClick=\"goTo('" + menuData[i][j].url + "');return false;\" style=\"" + menustyle + "\"><div class=\"dhtmlmenuitem\"><a href=\"" + menuData[i][j].url + "\" class=\"dhtmlmenulink\">" + menuData[i][j].label + "</a></div></div>");
				}
				menucount++;
			}
		//	if (useMask) {
				document.writeln("</div>");
		//	}
			document.write("<div id=\"upNav\" changebg('menuitem" + menucount + "'); onMouseOut=\"changeStatus('');\"  style=\"position:absolute;height:15px;top:0px;" + menustyle + "border-top:" + border + " 1px solid;\"><a onMouseOver=moveup() onMouseOut=clearTimeout(moveupvar)><IMG id=\"upNavImg" + i + "\" src=\"/assets/images/products-and-services/up.gif\" height=\"15\" border=\"0\"></a></div>");
			document.write("<div id=\"downNav\" changebg('menuitem" + menucount + "\'); movedown(); onMouseOut=\"changeStatus(\'\'); clearTimeout(movedownvar)\"  style=\"position:absolute;height:15px;top:184px;" + menustyle + "border-bottom:" + border2 + " 1px solid;\"><a onMouseOver=movedown() onMouseOut=clearTimeout(movedownvar)><IMG id=\"downNavImg" + i + "\" src=\"/assets/images/products-and-services/down.gif\" height=\"15\" border=\"0\"></a></div>");
			document.writeln("</div>");
			moveMenu(i);
		}
	}
	menusWritten = true;
}

function moveMenu(num) {
	tmpMenu = "menu" + num;
	//thePos = getObj("pos" + num);
	theImg = "findermenu" + num;
	xPos = offsetLeft(getObj(theImg)) + menuXoffset;
	yPos = offsetTop(getObj(theImg)) + menuheight + menuYoffset - 8; // -183
	
	if (offsetTop(getObj(theImg))+document.images[theImg].height+parseInt(getObj(tmpMenu).style.height)-1-document.body.scrollTop > document.body.clientHeight)
		yPos = yPos - (parseInt(getObj(tmpMenu).style.height)-1 + document.images[theImg].height);
		
	/*if (num == 0) {
		xPos += 4;
	}*/
	
	if (!is_mac_ie) {
		xPos -= menuwidth - document.images[theImg].width - 1;
		if (!is_ie) {
			xPos -= 3;
		}
		//xPos -= 0;
	}
	if (num == (menuData.length - 2)) {
		//xPos -= 30;
	}
	getObj(tmpMenu).style.left = xPos;
	getObj(tmpMenu).style.top = yPos;
}

function showMenus() {
	unfocus();
	if (hideSels) {
		hideSelect();
	}
	onMenu = true;
	theMenu = "menu" + curMenu;
	activeMenu = theMenu;
	if (getObj(theMenu).style.visibility != "visible")
	{
	    upNavImgBtn=document.getElementById? document.getElementById("upNavImg" + curMenu) : document.all["upNavImg" + curMenu];
	    downNavImgBtn=document.getElementById? document.getElementById("downNavImg" + curMenu) : document.all["downNavImg" + curMenu];

	   	upNavImgBtn.src = "/assets/images/products-and-services/up_off.gif";

		var crossobj=document.getElementById? document.getElementById("cont"+curMenu) : document.all["cont"+curMenu]
		if (iens6&&parseInt(crossobj.style.top)<=14)
			crossobj.style.top="15px"
		else if (ns4&&crossobj.top<=14)
			crossobj.top = 15;
	}
	
	moveMenu(curMenu);
    if (useMask) {
		theMask = getObj("iMask");
		theCont = "cont" + curMenu;
		theMask.style.left = xPos;
	    theMask.style.top = yPos;
		theMask.style.width = getObj(theCont).offsetWidth;
	    theMask.style.height = '100px'; //getObj(theCont).offsetHeight;
	}
    getObj(theMenu).style.visibility = "visible";
}

function startShow(menu) {
	if (curNav) {
		//navOff(curNav);
	}

	//navOver(menu);
	curNav = menu;
	if (menusWritten && !nn4) {
		if (is_safari)
		{
	//		if (activeMenu) getObj(activeMenu).style.visibility = "hidden";
		}
		else if (curMenu != menu)
		{
			if (activeMenu)
				getObj(activeMenu).style.visibility = "hidden";
		}

		curMenu = menu;
		clearTimer();
		if (!onMenu) {
			if (curItem) {
				curItem.style.backgroundColor = menubgOff;
			}
			showTimer = setTimeout("showMenus()", delayStart);
		}
		else {
			showMenus();
		}
	}
	else {
		return false;
	}
}

function startHide() {
	if (!onMenu) {
		if (curNav) {
			//navOff(curNav);
			curNav = null;
		}
	}
	if (menusWritten && !nn4) {
		if (showTimer) clearTimeout(showTimer);
		start = new Date();
		hideFlag = true;
		hideTimer = setTimeout("hideMenus()", delay);
	}
	else {
		return false;
	}
}

function clearTimer() {
	if (hideTimer) clearTimeout(hideTimer);
	hideTimer = null;
	hideFlag = false;
}

function hideMenus() {
	if (!hideFlag) return;
	var elapsed = new Date() - start;
	if (elapsed < delay) {
		hideTimer = setTimeout("hideMenus()", delay - elapsed);
		return;
	}
	hideFlag = false;
	hideAllMenus();
	if (hideSels) {
		showSelect();
	}
}

function hideAllMenus() {
	changeStatus('');
	if (curNav) {
		//navOff(curNav);
		curNav = null;
	}
	for (i = 0; i<menuData.length; i++) {
		theMenu = "menu" + i;
		getObj(theMenu).style.visibility = "hidden";
	}
    if (useMask) {
		if (theMask) {
			theMask.style.left = -300;
	    	theMask.style.top = -300;
		}
	}
	if (curItem) {
		curItem.style.backgroundColor = menubgOff;
	}
	onMenu = false;
}

function goTo(url) {
	if (url.indexOf("/jp/") != -1)
		opwin(url,820,800,'yes','yes','no','PM');
	else
		opwin(url,820,715,'yes','yes','no','PM');
	//document.location.href = url;
}

//return [object]
function getObj(theId) {
	if (document.getElementById) {
		theObj = document.getElementById(theId); 
	} else if (document.all) { 
		theObj = document.all[theId];
	}
	return theObj;
}

//return [img] object NS4 fix
function getImg(imgName, divName) {
	if (nn4) {
		imgObj = eval("document." + divName + ".document.images." + imgName);
	}
	else {
		imgObj = eval("document.images." + imgName);
	}
	return imgObj;
}

//Mac IE offset fix
function offsetLeft(o){
	var i = 0;
	while (o.offsetParent!=null) {
		i += o.offsetLeft;
		o = o.offsetParent;
	}
	return i + o.offsetLeft;
}
function offsetTop(o){
	var i = 0;
	while (o.offsetParent!=null) {
		i += o.offsetTop;
		o = o.offsetParent;
	}
	return i + o.offsetTop;
}

function changebg(id) {
	if (useDHTML) {
		var tmp = getObj(id);
		if (curItem) {
			if (tmp != curItem) {
				curItem.style.backgroundColor = menubgOff;
				tmp.style.backgroundColor = menubgOn;
			}
		} else { tmp.style.backgroundColor = menubgOn; }
		curItem = tmp;
	}
}

function unfocus() {
	for (x = 0; x < document.forms.length; x++) {
		for (y = 0; y < document.forms[x].elements.length; y++) {
			if (document.forms[x].elements[y].type == "text") {
				document.forms[x].elements[y].blur();
			}
		}
	}
}

function hideSelect() {
	var f = document.forms;
	for(var i=0;i<f.length;i++) {
		for (var j=0; j<f[i].elements.length; j++) {
			if (f[i].elements[j].type == "select-one") {
				f[i].elements[j].style.visibility = "hidden";
			}
		}
	}
}

function showSelect() {
	var f = document.forms;
	for(var i=0;i<f.length;i++) {
		for (var j=0; j<f[i].elements.length; j++) {
			if (f[i].elements[j].type == "select-one") {
				f[i].elements[j].style.visibility = "visible";
			}
		}
	}
}

function changeStatus(text) {
	window.status = text;
}

function clearbg() {
	if (curItem) {
		curItem.style.backgroundColor = menubgOff;
	}
	curItem = null;
}

if (document.addEventListener) {
	document.addEventListener("mouseup", mouseUp, false);
}

document.onmouseup = mouseUp;

function mouseUp() {
	hideAllMenus();
	return true;
}

var speed=5;
iens6=document.all||document.getElementById;
ns4=document.layers;
function movedown(){
	var crossobj=document.getElementById ? document.getElementById("cont"+curMenu) : document.all["cont"+curMenu]
	var contentheight=crossobj.offsetHeight
	if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+189)) {
		crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
	} else if (ns4&&crossobj.top>=(contentheight*(-1)+189)) {
		crossobj.top-=speed
 	} else {
		if (downNavImgBtn.src.indexOf("down_off.gif") == -1)
			downNavImgBtn.src = "/assets/images/products-and-services/down_off.gif";
	}
	if (upNavImgBtn.src.indexOf("up.gif") == -1)
		upNavImgBtn.src = "/assets/images/products-and-services/up.gif";
	
	movedownvar=setTimeout("movedown()",24)
}

function moveup(){
	var crossobj=document.getElementById? document.getElementById("cont"+curMenu) : document.all["cont"+curMenu]
	var contentheight=crossobj.offsetHeight
	if (iens6&&parseInt(crossobj.style.top)<=14) {
		crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
	} else if (ns4&&crossobj.top<=14) {
		crossobj.top+=speed;
	} else {
		if (upNavImgBtn.src.indexOf("up_off.gif") == -1)
			upNavImgBtn.src = "/assets/images/products-and-services/up_off.gif";
	}
	
	if (downNavImgBtn.src.indexOf("down.gif") == -1)
		downNavImgBtn.src = "/assets/images/products-and-services/down.gif";

	moveupvar=setTimeout("moveup()",24)
}

//-->