//マウスの座標
var nXPos = 0;
var nYPos = 0;
//レイヤーの座標
var nLayerXPos = 0;
var nLayerYPos = 0;


//	レイヤー表示・非表示関数
function layPop(strLayer, fType)
{
	//レイヤーの座標をセット。
	nLayerXPos = nXPos + 0;
	nLayerYPos = nYPos + 0;

	//NNの場合
	if (document.layers)
	{
		if (fType)
		{
			//レイヤーの幅と高さをマウス座標にセット
			document.layers[strLayer].left = nLayerXPos;
			document.layers[strLayer].top = nLayerYPos;
			//表示
			document.layers[strLayer].visibility = "show";
		}
		else
		{
			//非表示
			document.layers[strLayer].visibility = "hide";	
		}
	}
	//IEとNC6以降の場合
	if (document.getElementById)
	{	
		if (fType)
		{	
			//レイヤーの幅と高さをマウス座標にセット
			document.getElementById(strLayer).style.left = nLayerXPos;
			document.getElementById(strLayer).style.top = nLayerYPos;
			//表示
			document.getElementById(strLayer).style.visibility="visible";
		}
		else
		{
			//非表示
			document.getElementById(strLayer).style.visibility="hidden";
		}
	}
	
}

//	マウストラッキング
//Netscapeの場合
if (navigator.appName=="Netscape")
{
	function nMouse(e)
	{
		nXPos = e.pageX;
		nYPos = e.pageY;
	}
	//NN4
	if (document.layers)
	{
		window.captureEvents(Event.MOUSEMOVE);
		window.onMouseMove = nMouse;
	}
	//NC6以降
	else
	{
		document.onmousemove = nMouse;
	}
}
//IEの場合
else
{
	function iMouse()
	{
		nXPos = event.x+document.body.scrollLeft;
		nYPos = event.y+document.body.scrollTop;
	}
	document.onmousemove = iMouse;
}
