var openedMenu = null;
var submenuTimer;

//画像差し替え
function roAction(pathName,imgname, flg) {
	document.images[imgname].src = pathName + imgname + flg + ".gif";
}

//Pull Downスクリプト
function menuOvr(id, x, y, img){
	if (openedMenu && openedMenu != id){
		CloseMenu(id);
	}
	OpenMenu(id, x, y, img);
}
function OpenMenu(id, x, y, img){ 
	obj = document.images[img];
	x = x+LeftPos(obj);
	y = y+TopPos(obj);//moveYbySlicePos (y, obj);
	if (document.getElementById){
		document.getElementById(id).style.left = x+"px";
		document.getElementById(id).style.top = y+"px";
		document.getElementById(id).style.display = "block";
	}else if(document.all){
		document.all(id).style.left = x;
		document.all(id).style.top = y;
		document.all(id).style.display = 'block';
	}
	clearTimeout(submenuTimer);
	openedMenu = id;
}
function CloseMenu(){ 
	if (document.getElementById){
		document.getElementById(openedMenu).style.display = "none";
	}else if(document.all){
		document.all(id).style.display = 'none';
	}
	openedMenu = null;
}
function pdMenuRO(id, colr){
	 if (document.layers){
		 document.layers[id].bgColor = color;
	 }else if (document.getElementById){
		 document.getElementById(id).style.background = colr;
	}else if(document.all){
		document.all(id).style.background = colr;
	}
}

//画像のx座標を求める
function LeftPos(obj){
	posleft = obj.offsetLeft;
	if(obj.offsetParent != null){
		posleft += LeftPos(obj.offsetParent);
	}
	return posleft;
}

//画像のy座標を求める
function TopPos(obj){
	postop = obj.offsetTop;
	if(obj.offsetParent != null){
		postop += TopPos(obj.offsetParent);
	}
	return postop;
}

