//レイヤーの幅
var nWidth = 750;
//ずらす場合下記2項目を変更してください
//var nXAlpha = 0;
//var nYAlpha = 0;
///////////////////////////////////////////////////////////////////////////////////
//他変数
///////////////////////////////////////////////////////////////////////////////////
var nYPos;
var nTimer;
///////////////////////////////////////////////////////////////////////////////////
//レイヤー移動関数
///////////////////////////////////////////////////////////////////////////////////
function fcenter()
{
layerObj = document.all("mainlayer");
if(layerObj!=null){

	var nWinWidth;
	//NNの場合
	if (navigator.appName=="Netscape")
	{
		//真中を計算
		nWinWidth = window.innerWidth/2;
		nXpos = nWinWidth - nWidth/2 + nXAlpha;
		if(nXpos < 11)
		{
			nXpos = 11;
		}
		//画面の位置を取得
		//nYPos = window.pageYOffset;
		nYPos = 27 + 4;		//NN4
		if(document.layers)
		{
			//レイヤーの幅と高さをマウス座標にセット
			document.mainlayer.left = nXpos-1;		
			document.mainlayer.top = nYPos + nYAlpha+16+8;			
		}
		//NN6
		else
		{
			document.getElementById("mainlayer").style.left = nXpos -1;		
			document.getElementById("mainlayer").style.top = nYPos + nYAlpha+16+8;			
		}
	}
	//IEの場合
	if (document.all)
	{
		//真中を計算
		nWinWidth = window.document.body.clientWidth/2;
		//真ん中チェック
		nXpos = nWinWidth - nWidth/2 + nXAlpha -1;
		if(nXpos < 14)
		{
			nXpos = 14;
		}
		//画面の位置を取得
		//nYPos = document.body.scrollTop;
		nYPos = 51 + 3;
		//レイヤーの幅と高さを座標にセット
		mainlayer.style.left = nXpos;	
		mainlayer.style.top = nYPos + nYAlpha + 8;
	}
	//nTimer=setTimeout("fcenter()",100);
}
}

