function changeInquiry(room_id, elm){

	var flg = $F(elm);


	if(!flg) flg = 0;

	var url = "./";

	var pars = "check_id="+room_id+"&flg="+flg;
	pars += "&mode=checkInquiry";

	var myAjax = new Ajax.Request(
		url,
		{
			method: 'get',
			parameters: pars
		});

	//上下のチェックボックスを同期させる
	var nam = elm.name;
	var checkes = document.getElementsByName(nam);

	for(var i=0; i<checkes.length; i++){
		var elm = checkes[i];

		elm.checked = flg;
	}

}

function changeMyPage(room_id, elm){

	var flg = $F(elm);

	if(!flg) flg = 0;

	var url = "./";

	var pars = "check_id="+room_id+"&flg="+flg;
	pars += "&mode=checkMyPage";

	var myAjax = new Ajax.Request(
		url,
		{
			method: 'get',
			parameters: pars
		});

	//上下のチェックボックスを同期させる
	var nam = elm.name;
	var checkes = document.getElementsByName(nam);

	for(var i=0; i<checkes.length; i++){
		var elm = checkes[i];

		elm.checked = flg;
	}

}


function printElement(id){

	var elm = $(id);

	iframe=document.createElement('IFRAME');
	var doc=null;

	Element.setStyle(iframe,'position:absolute;width:0px;height:0px;left:-500px;top:-500px;');

	document.body.appendChild(iframe);
	doc=iframe.contentWindow.document;

	var links=window.document.getElementsByTagName('link');

	for(var i=0;i<links.length;i++){
		if(links[i].rel.toLowerCase()=='stylesheet'){
			doc.write('<link type="text/css" rel="stylesheet" href="'+links[i].href+'"></link>');
		}
	}

	var text = elm.innerHTML;

	while(elm && elm.nodeName != "body" && elm.nodeName != "BODY"){
		var tag = elm.nodeName;

		var attr = " ";
		var attr_id    = elm.getAttribute("ID");
		var attr_style = elm.getAttribute("style");
		var attr_class = elm.getAttribute("CLASS");

		if(attr_id){
			attr += "id=\""+attr_id+"\" ";
		}

		if(attr_style){
			//attr = " style=\""+attr_style+"\" ";
		}

		if(attr_class){
			attr = " class=\""+attr_class+"\" ";
		}

		text = "<"+tag+attr+">"+text+"</"+tag+">";

		elm = elm.parentNode;
	}

	doc.write('<body>'+text+'</body>');
	doc.close();



	window.setTimeout(function(){
		iframe.contentWindow.focus();
		iframe.contentWindow.print();
		//document.body.removeChild(iframe);
		}, 1000);


}


/* ----- popupImage.js ----- */
var objWin;
var timerID;

function fitimg() {
  myImage = objWin.document.getElementById('myImage');
  var div_blank_img = objWin.document.getElementById('blank_img');

	if (myImage.complete==undefined || myImage.complete) {
		var position = jQuery(myImage).position();
		var height = jQuery(myImage).height();
		var width = jQuery(myImage).width();
		div_blank_img.innerHTML = '<img height="' + height + '" width="' + width + '" src="/img/common/blank.gif" style="top: 0px; left: 0px; position: absolute; width: ' + width + 'px; height: ' + height + 'px; z-index: 10;">';

    clearInterval(timerID);

    w=myImage.width;
    h=myImage.height;

    ua=navigator.userAgent;

    if(ua.indexOf("Firefox",0)>=0) {
      objWin.innerWidth=w;
      objWin.innerHeight=h;
    } else if(ua.indexOf("MSIE",0)>=0) {
      objWin.resizeTo(w,h);
      objWin.resizeBy(w-objWin.document.body.clientWidth,
              h-objWin.document.body.clientHeight-16);
    }

    objWin.document.close();
  }
}

function popupImage(url){
  objWin=window.open("","myWindow","width=640,height=480");

  objWin.document.open();
  objWin.document.write("<html><head><title>image</title>");
  objWin.document.write('</head>');
  objWin.document.write("<body style='margin:0; padding:0;'>");
  objWin.document.write("<img src='"+url+"' id='myImage' class='protect'><div id='blank_img'></div>");
  objWin.document.write("</body></html>");

  timerID=setInterval('fitimg()', 100);
}

