﻿// Google Map Resize
function mapresize() {
	// User Agent
	var ua = navigator.userAgent;
	// Map Height
	var nHeight;
	// IE User Agent ?
	var nHit = ua.indexOf("MSIE");
	// IE ?
	var bIE = (nHit >=  0);
	// IE version 6 ?
	var bVer6 = bIE && ((ua.substr(nHit+5, 1) == "6") || (ua.substr(nHit+5, 1) == "7"));
	// Standard mode ?
	var bStd = (document.compatMode && document.compatMode=="CSS1Compat");

	if (bIE) {
		if (bVer6 && bStd) {
			nHeight = document.documentElement.clientHeight;
		} else {
			nHeight = document.body.clientHeight;
		}
	} else {
		nHeight = window.innerHeight;
	}
	mapHeight = Math.floor(nHeight) - 250;
	if(mapHeight > 572) {
		mapHeight = 572;
	} else if (mapHeight < 280) {
		mapHeight = 280;
	}
	document.getElementById("mapCanvas").style.height = mapHeight + "px";
}

// Comment iframe Resize
function commentresize(n) {
	// User Agent
	var ua = navigator.userAgent;
	// iframe width
	var nWidth;
	// IE User Agent ?
	var nHit = ua.indexOf("MSIE");
	// IE ?
	var bIE = (nHit >=  0);
	// IE version 6 ?
	var bVer6 = bIE && ((ua.substr(nHit+5, 1) == "6") || (ua.substr(nHit+5, 1) == "7"));
	// Standard mode ?
	var bStd = (document.compatMode && document.compatMode=="CSS1Compat");

//	if (bIE) {
		if (n==1) {
			if (bVer6 && bStd) {
				nWidth = document.documentElement.clientWidth;
			} else {
				nWidth = document.body.clientWidth;
			}
			commentWidth = Math.floor(nWidth) - 372;
			if(commentWidth < 200) {
				commentWidth = 200;
			}
			document.getElementById("leftContents").style.width = commentWidth + "px";
		} else {
			document.getElementById("leftContents").style.width = 100 + "%";
		}
//	}
}