var pTop, pLeft; 
function getPos() { 
	if (document.all) {//IE4, IE5.x 
		if (document.all && document.getElementById && (document.compatMode=='CSS1Compat')) {
			pTop = document.documentElement.scrollHeight - 0;//ウィンドウ縦幅の半分 
			pLeft = document.documentElement.clientWidth / 2 - 400;//ウィンドウ横幅の半分 
		}else {
			pTop = document.body.scrollHeight - 0;//ウィンドウ縦幅の半分 
			pLeft = document.body.scrollHeight / 2 - 400;//ウィンドウ横幅の半分 
		}
	} else if (document.getElementById && !document.all || document.layers) {//NN6, NN4 
		pTop = document.body.offsetHeight;//ウィンドウ縦幅の半分 
		pLeft = innerWidth / 2 - 405;//ウィンドウ横幅の半分 
	}
	if (pTop < 0){pTop = 0}
	if (pLeft < 0){pLeft = 0}
	
	if ( document.compatMode == 'CSS1Compat'){ nowY=document.documentElement.scrollTop;
	}else{ nowY=document.body.scrollTop; }

//	pTop = pTop + nowY ; 
} 


function setPos() { 
	getPos(); 
	if (document.getElementById) {//IE5.x, NN6
		document.getElementById('footer_copyright').style.marginLeft = pLeft +"px";
	}else if (document.all) {//IE4
		document.all('footer_copyright').style.marginLeft = pLeft;
	}else if (document.layers) {//NN4
		document.all('footer_copyright').style.marginLeft = pLeft;
	}
	
	if (document.getElementById) {//IE5.x, NN6
		document.getElementById('title').style.marginLeft = pLeft +"px";
	}else if (document.all) {//IE4
		document.all('title').style.marginLeft = pLeft;
	}else if (document.layers) {//NN4
		document.all('title').style.marginLeft = pLeft;
	}
	
}


function setPosTop() { 
	getPos(); 
	if (document.getElementById) {//IE5.x, NN6
		document.getElementById('footer_copyright').style.marginTop = pTop +"px";
		document.getElementById('footer_copyright').style.marginLeft = pLeft +"px";
	}else if (document.all) {//IE4
		document.all('footer_copyright').style.marginTop = pTop;
		document.all('footer_copyright').style.marginLeft = pLeft;
	}else if (document.layers) {//NN4
		document.all('footer_copyright').style.marginTop = pTop;
		document.all('footer_copyright').style.marginLeft = pLeft;
	}
	
	if (document.getElementById) {//IE5.x, NN6
		document.getElementById('title').style.marginLeft = pLeft +"px";
	}else if (document.all) {//IE4
		document.all('title').style.marginLeft = pLeft;
	}else if (document.layers) {//NN4
		document.all('title').style.marginLeft = pLeft;
	}
}

window.onscroll = setPos; 
window.onload = setPos; 
window.onload = setPosTop; 
window.onresize = setPos; 
setPos;



