function getClientSize(){
	var w = window;
	var b = document.body;
	var e = document.documentElement;
	FF=/a/[-1]=='a';
	
	fg = document.compatMode == "CSS1Compat" &&!window.opera;
	if (FF) {
		getClientSize = function (){
			return {
				'width':b.clientWidth,
				'height' :(w.innerWidth < e.offsetWidth ) ? w.innerHeight - 14 : w.innerHeight
			};
		}
	} else if(fg && !window.opera && e && e.clientHeight && e.clientWidth) {
		getClientSize = function (){
			return {'width':e.clientWidth, 'height':e.clientHeight};
		}
	} else if(b && b.clientHeight && b.clientWidth) {
		getClientSize = function (){
			return {'width':b.clientWidth, 'height':b.clientHeight};
		}		
	} else if(w.innerHeight && w.innerWidth) {
		if(e && e.offsetHeight && e.offsetWidth) {
			getClientSize = function () {
				return {
					'width' :(w.innerHeight < e.offsetHeight) ? w.innerWidth - 14 : w.innerWidth,
					'height' :(w.innerWidth < e.offsetWidth ) ? w.innerHeight - 14 : w.innerHeight
				};
			}
		} else {
			getClientSize = function (){
				return {'width':w.innerWidth, 'height':w.innerHeight};
			}
		}
	} else {
		getClientSize = function () {
			return {'width':0, 'height':0};
		}
	}
	return getClientSize();
}
function resizeFunc(imgWidth,imgHeight) {
	if(!isMobile) {
		if (document.getElementById("splashcontent").style.display != "none") {
			var bWidth = getClientSize().width;
			if (bWidth < imgWidth) {
				var xPos = Math.floor((bWidth - imgWidth) / 2);
				var cSize = bWidth + Math.abs(xPos);
				document.getElementById("splashcontent").style.width = cSize + 'px';
				var cMargin = '0 ' + xPos + 'px ' + '0 0';
				document.getElementById("splashcontent").style.margin = cMargin;
				document.getElementById("splashcontent").style.position = 'absolute';
				document.getElementById("splashcontent").style.left = xPos + 'px';
				document.getElementById("splashtext").style.top = 0;
				if (location.pathname.indexOf("index.html") >= 0 || location.href == "http://www.geihinkan.com/" || (location.pathname.indexOf(".html") <= -1 && location.pathname.indexOf(".cgi") <= -1)) {
					document.getElementById("splashcontent_0").style.top = 0;
					document.getElementById("splashcontent_1").style.position = 'absolute';
					document.getElementById("splashcontent_1").style.top = 0;
					document.getElementById("splashcontent_1").style.left = xPos + 'px';
					document.getElementById("splashcontent_2").style.position = 'absolute';
					document.getElementById("splashcontent_2").style.top = 0;
					document.getElementById("splashcontent_2").style.left = xPos + 'px';
					document.getElementById("splashcontent_3").style.position = 'absolute';
					document.getElementById("splashcontent_3").style.top = 0;
					document.getElementById("splashcontent_3").style.left = xPos + 'px';
					document.getElementById("splashcontent_4").style.position = 'absolute';
					document.getElementById("splashcontent_4").style.top = 0;
					document.getElementById("splashcontent_4").style.left = xPos + 'px';
					document.getElementById("splashcontent_5").style.position = 'absolute';
					document.getElementById("splashcontent_5").style.top = 0;
					document.getElementById("splashcontent_5").style.left = xPos + 'px';
					document.getElementById("splashcontent_6").style.position = 'absolute';
					document.getElementById("splashcontent_6").style.top = 0;
					document.getElementById("splashcontent_6").style.left = xPos + 'px';
				}
			} else {	
				document.getElementById("splashcontent").style.width = bWidth + 'px';
				if (location.pathname.indexOf("index.html") >= 0 || location.href == "http://www.geihinkan.com/" || (location.pathname.indexOf(".html") <= -1 && location.pathname.indexOf(".cgi") <= -1)) {
					document.getElementById("splashcontent_0").style.width = bWidth + 'px';
					document.getElementById("splashcontent_1").style.width = bWidth + 'px';
					document.getElementById("splashcontent_1").style.position = 'absolute';
					document.getElementById("splashcontent_1").style.top = 0;
					document.getElementById("splashcontent_1").style.left = 0;
					document.getElementById("splashcontent_2").style.width = bWidth + 'px';
					document.getElementById("splashcontent_2").style.position = 'absolute';
					document.getElementById("splashcontent_2").style.top = 0;
					document.getElementById("splashcontent_2").style.left = 0;
					document.getElementById("splashcontent_3").style.width = bWidth + 'px';
					document.getElementById("splashcontent_3").style.position = 'absolute';
					document.getElementById("splashcontent_3").style.top = 0;
					document.getElementById("splashcontent_3").style.left = 0;
					document.getElementById("splashcontent_4").style.width = bWidth + 'px';
					document.getElementById("splashcontent_4").style.position = 'absolute';
					document.getElementById("splashcontent_4").style.top = 0;
					document.getElementById("splashcontent_4").style.left = 0;
					document.getElementById("splashcontent_5").style.width = bWidth + 'px';
					document.getElementById("splashcontent_5").style.position = 'absolute';
					document.getElementById("splashcontent_5").style.top = 0;
					document.getElementById("splashcontent_5").style.left = 0;
					document.getElementById("splashcontent_6").style.width = bWidth + 'px';
					document.getElementById("splashcontent_6").style.position = 'absolute';
					document.getElementById("splashcontent_6").style.top = 0;
					document.getElementById("splashcontent_6").style.left = 0;
				} else {
					document.getElementById("splashimg").style.width = bWidth + 'px';
				}
				var xScale = bWidth / imgWidth;
				if (location.pathname.indexOf("index.html") >= 0 || location.href == "http://www.geihinkan.com/") {
					document.getElementById("splash_top").style.height = imgHeight * xScale + 'px';
					var tPos = (document.getElementById("splash_top").style.height.split("px").join("") - imgHeight) / 2;
				} else {
					document.getElementById("splash").style.height = imgHeight * xScale + 'px';
					var tPos = (document.getElementById("splash").style.height.split("px").join("") - imgHeight) / 2;
				}
				document.getElementById("splashtext").style.top = tPos + 'px';
				document.getElementById("splashcontent").style.position = 'relative';
				document.getElementById("splashcontent").style.left = 0;
				document.getElementById("splashcontent").style.overflow = 'hidden';
				document.getElementById("splashcontent").style.margin = '0 auto';
			}
		}
	}
}
function showhide(id){
	if(document.getElementById){
		if(document.getElementById(id).style.display == "block"){
			document.getElementById(id).style.display = "none";
			document.getElementById('splashtext').style.display = "none";
			document.getElementById("splash").style.height = 128 + 'px';
		}else{
			document.getElementById(id).style.display = "block";
			document.getElementById('splashtext').style.display = "block";
			document.getElementById("splash").style.height = 418 + 'px';
			resizeFunc(1280,418);
		}
	}
}
function fixWeddingColumnHeight() {
	document.getElementById("wedding_noble_block").style.height = document.getElementById("wedding_cafe_block").offsetHeight + 'px';
}
