// JavaScript Document 
// charset "utf-8";

// ------------------------------------
// popup image
// ------------------------------------
function openimg(url,w,h){	
	// 縦横サイズの引数が無い場合は下記のように設定
	if((w == "")||(w == null)){
			w = 400;
	}	
	if((h == "")||(h == null)){
			h = 300;
	}

	// 画像をポップアップ
	winFig = window.open(url,"OpenImg","width=" + w + "," + "height=" + h);
	
	// 新しいウィンドウへの書き出し
	winFig.document.open();
	winFig.document.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
 winFig.document.writeln('<html>');
	winFig.document.writeln('<head>');
	winFig.document.writeln('<title>- image window -</title>');
	winFig.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">');
	winFig.document.writeln('<style type="text/css">');
	winFig.document.writeln('body{margin:0px;padding:0px;}');
	winFig.document.writeln('img{border:0px;}');
	winFig.document.writeln('</style>');
	winFig.document.writeln('</head>');
	winFig.document.writeln('<body>');
	winFig.document.writeln('<a href="javascript:void(0);" onclick="self.window.close()">');
	winFig.document.writeln('<img src="' + url + '" alt="' + url + '">');
	winFig.document.writeln('</a>');
 winFig.document.writeln('</body>');
 winFig.document.writeln('</html>');
 winFig.document.close();
}

// ------------------------------------
// popup window
// ------------------------------------
function openwin(url,w,h){
		window.open(url,"OpenWin","width=" + w + "," + "height=" + h);
}

// -----------------------------------------------------
// hover map
// ----------------------------------------------------- */
/*function hoverMap(id,img){
	id.src='img/' + img;
}

function defaultMap(id,img){
	id.src='img/' + img;
}*/
function overImg(id,img){
 if(img.indexOf('.') == -1){
		id.src = 'img/' + img + 'b.gif';
	}else{
		id.src = 'img/' + img;
	}
}

function outImg(id,img){
	if((img == '')||(img == null)){
		over_src = id.src;
		default_src = over_src.slice(0,-5) + 'a.gif';
		id.src = default_src;
	}else{
		id.src = 'img/' + img;
	}
}

// -----------------------------------------------------
// フォーカスが当たった時・外れた時にフォームの色を変化
// <input type="text" name="" size="" onfocus="activeForm(this)" onblur="defaultForm(this)" />
// -----------------------------------------------------
function activeForm(id){
	id.style.backgroundColor = '#D9E9E9';
	/*id.style.borderTopColor = '#333';
	id.style.borderLeftColor = '#333';
	id.style.borderBottomColor = '#999';
	id.style.borderRightColor = '#999';*/
}

function defaultForm(id){
	id.style.backgroundColor = '#F0F6F6';
	/*id.style.borderTopColor = '#666';
	id.style.borderLeftColor = '#666';
	id.style.borderBottomColor = '#ccc';
	id.style.borderRightColor = '#ccc';*/
}



// -----------------------------------------------------
// 貸し会議室お問い合わせフォームにて希望開始時間が終了時間よりも前だったら警告（←ボツ）
// ----------------------------------------------------- */
function time(){	
 var timeStart = document.getElementById('start').value;
	var timeEnd = document.getElementById('end').value;
	var theStart = document.myform.start.selectedIndex;
	var theEnd = document.myform.end.selectedIndex;
	var difference = (timeStart - timeEnd);
	if((theStart == null)||(theStart == '0')){
			'';	
		}else if((theEnd == null)||(theEnd == '0')){
			'';	
		}else if(difference < 0){
			'';	
		}else{
			window.alert('終了時間は開始時間より1時間後以降に設定してください');
	}
}




// -----------------------------------------------------
// 前のページへ戻る
// -----------------------------------------------------
function pageBack(){
		history.back();
}



/* end of this file */