// css frame
var uri = document.location.href;
var sharp= uri.indexOf("#");
if(sharp>=0){
	uri = uri.substring(0,sharp);
}
var ques= uri.indexOf("?");
if(ques>=0){
	uri = uri.substring(0,ques);
}

// 印刷用ウィンドウ作成
function printCtrl() {
	var pwin = uri + "?print=on";
	window.open(pwin,"_blank");
}

var index_width = 230;
var indexOpen = true;
var head_height = 35;
var footer_height = 20;

function arrange(){
	var obj = window;
	if( window.opera ) {
		var w = obj.innerWidth;
		var h = obj.innerHeight;
	} else if( document.all && obj.document.body){				//ie4-
		var w = obj.document.body.clientWidth;
		var h = obj.document.body.clientHeight;
	} else if( document.getElementById ){	//n6-7, m1, s1
		var w = obj.innerWidth;
		var h = obj.innerHeight;
	}

	var left = document.getElementById("index");		// インデックス
	var right = document.getElementById("main");	// コンテンツ
	if(right && left){
		var right_style = right.style;
		var left_style = left.style;
		if(right_style && left_style){
			right_style.overflow = "auto";
			// - ヘッダーとフッタの高さ
			left_style.height = (h - head_height - footer_height) + "px";
			right_style.height = (h - head_height - footer_height) + "px";

			right_style.width = ( w - index_width  ) + "px";
			
			
			//var debug = document.getElementById("debug");	// コンテンツ
			//debug.innerHTML=right_style.width;
			
			var right_head = document.getElementById("main_head");	// コンテンツ
			if(right_head){
				right_head.style.width = ( w - index_width -20 ) + "px";
			}
		}
	}
}


var g_browser_ok = 0;
if ( document.getElementById ) { 
	g_browser_ok = 1;
}
if( navigator.userAgent.indexOf("MSIE 4") != -1 
	|| navigator.userAgent.indexOf("MSIE4") != -1 ){
	g_browser_ok = 0;
}
if( navigator.userAgent.indexOf("MSIE 5") != -1 
	|| navigator.userAgent.indexOf("MSIE5") != -1 ){
	g_browser_ok = 0;
}
if ( document.layers ) {
	g_browser_ok = 0;
}
if( g_browser_ok ) {
	window.onload = arrange;
	window.onresize = arrange;
}
