//************************************************************************
//Objectのメンバーとvalueをalertで表示
//
//in Object:メンバーを見たいオブジェクト
//************************************************************************
function memberAlert(Object) {
	var str = "";
	var maxlength = 30;
	var i=0;
	for(var member in Object){
		str = str + member + " = " + Object[member] + "\n";
		i++;
		if(i % maxlength == 0){
			alert(str);
			str="";
		}
	}
	if(i % maxlength != 0)	alert(str);
}

//************************************************************************
//指定したImageをWindowでポップさせる
//Openした子WindowのドキュメントにHTMLを流し込むタイプ
//
//in image_src:Imageのurl
//in msg:メッセージ
//************************************************************************
function openImageWindow(image_src, msg, e) {

	//自分のdocument領域にこれからOpenするWindowに表示するImage Objectを作成
	//Imageのサイズを得る為
	if (document.images) {
		if(window.document.popupImage == null)
			window.document.popupImage = new Image();
		window.document.popupImage.src = image_src;
	}

	//現在のマウス位置取得
	var x = getMouseX(e);
	var y = getMouseY(e);

	//OpenするWindowのスタイルを設定
	var style = "";
	style = style + "left=" + (x + 10) + ",";	//Window位置x
	style = style + "top=" + (y + 0) + ",";		//Window位置y
	style = style + "height=" + (window.document.popupImage.height + 70) + ",";	//window高さ
	style = style + "width=" + (window.document.popupImage.width + 20) + ",";	//window横幅
	style = style + "directories=no,";	//ユーザ設定ツールバーの表示
	style = style + "location=no,";		//場所ツールバーの表示
	style = style + "menubar=no,";		//メニューバーの表示
	style = style + "resizable=yes,";	//リサイズを可能にする
	style = style + "toolbar=no";		//ツールバーの表示
	//alert(style);
	//既にWindowが開いていたら閉じる
	if(window.document.wpChild != null)
		window.document.wpChild.close();

	//Windowオープン
	window.document.wpChild = 
		window.open("", "POPUPIMAGE", style);

	window.document.wpChild.document.open();
	window.document.wpChild.document.write('<HTML>\n');
	window.document.wpChild.document.write('<HEAD>\n');
	window.document.wpChild.document.write('</HEAD>\n');
	window.document.wpChild.document.write('\n');
	window.document.wpChild.document.write('<BODY onload="window.focus();">\n');
	window.document.wpChild.document.write('<form>\n');
	window.document.wpChild.document.write('\n');
	window.document.wpChild.document.write('<center>\n');
	window.document.wpChild.document.write('<img name="Image01" src="' + image_src + '"><BR>\n');
	window.document.wpChild.document.write(msg + '\n');
	window.document.wpChild.document.write('<BR>\n');
	window.document.wpChild.document.write('<input type=button name="buttonClose" value="閉じる" onclick="window.close();">\n');
	window.document.wpChild.document.write('</center>\n');
	window.document.wpChild.document.write('\n');
	window.document.wpChild.document.write('</form>\n');
	window.document.wpChild.document.write('</BODY>\n');
	window.document.wpChild.document.write('\n');
	window.document.wpChild.document.write('</HTML>\n');
	window.document.wpChild.document.close();
}

//************************************************************************
//MouseのY座標獲得
//
//in image_src:Imageのurl
//in msg:メッセージ
//************************************************************************
function getMouseY(e){
	if(document.layers)return e.screenY
	if(document.all)   return window.event.screenY

}

//************************************************************************
//MouseのX座標獲得
//
//in image_src:Imageのurl
//in msg:メッセージ
//************************************************************************
function getMouseX(e){
	if(document.layers)return e.screenX
	if(document.all)   return window.event.screenX

}

