function check_browser_6_or_later() {
	var ret = 0;
	if ( document.getElementById ) { 
		ret = 1;
	}
	if( navigator.userAgent.indexOf("MSIE 4") != -1 
		||
		navigator.userAgent.indexOf("MSIE4") != -1 
	) {
		ret = 0;
	}
	if( navigator.userAgent.indexOf("MSIE 5") != -1 
		||
		navigator.userAgent.indexOf("MSIE5") != -1 
	){
		ret = 0;
	}
	if ( document.layers ) {
		ret = 0;
	}
	return ret;
}


var g_browser_ok = check_browser_6_or_later();


function arrenge() {
	if( 0 == g_browser_ok ) {
		return;
	}
	var obj = window;
	if( window.opera ) {
		var w = obj.innerWidth;
		var h = obj.innerHeight;
	} else if( document.all ){				//ie4-
		var w = obj.document.documentElement.clientWidth;
		var h = obj.document.documentElement.clientHeight;//W
	} else if( document.getElementById ){	//n6-7, m1, s1
		var w = obj.innerWidth;
		var h = obj.innerHeight;
	}
	
	
	//TOP
	if( document.getElementById("img_top") != null ) {
		var img_top_style = document.getElementById("img_top").style;
		if( 1104 < w ) {
			img_top_style.width = "1024px";
			img_top_style.height = "768px";
		} else {
			img_top_style.width = ( w - 80) + "px";
			img_top_style.height = ( w - 80) * 0.75 + "px";
		}
	}
	
	//{
	if( document.getElementById("img-shisaku") != null ) {
		var img_shisaku_style = document.getElementById("img-shisaku").style;
		if( 976 < w ) {
			img_shisaku_style.width = "896px";
			img_shisaku_style.height = "680px";
			document.getElementById("map-shisaku1").coords = "138,136,124";
			document.getElementById("map-shisaku2").coords = "136,542,124";
			document.getElementById("map-shisaku3").coords = "452,136,124";
			document.getElementById("map-shisaku4").coords = "450,544,124";
			document.getElementById("map-shisaku5").coords = "764,136,124";
			document.getElementById("map-shisaku6").coords = "760,546,124";
		} else {
			var x = ( w - 80);
			var y = ( w - 80) * 0.75892857142857142857142857142857;
			img_shisaku_style.width = x + "px";
			img_shisaku_style.height = y + "px";
			var z = x / 448;
			var r = parseInt(62 * z);
			
			x = parseInt(69 * z);
			y = parseInt(68 * z);
			document.getElementById("map-shisaku1").coords = x + "," + y + "," + r;
			x = parseInt(68 * z);
			y = parseInt(271 * z);
			document.getElementById("map-shisaku2").coords = x + "," + y + "," + r;
			x = parseInt(226 * z);
			y = parseInt(68 * z);
			document.getElementById("map-shisaku3").coords = x + "," + y + "," + r;
			x = parseInt(225 * z);
			y = parseInt(272 * z);
			document.getElementById("map-shisaku4").coords = x + "," + y + "," + r;
			x = parseInt(382 * z);
			y = parseInt(68 * z);
			document.getElementById("map-shisaku5").coords = x + "," + y + "," + r;
			x = parseInt(380 * z);
			y = parseInt(273 * z);
			document.getElementById("map-shisaku6").coords = x + "," + y + "," + r;
		}
	}


}


if( g_browser_ok ){
	window.onload = arrenge;
	window.onresize = arrenge;
}

