var flagExec = 0;
function hostExec(in_form){
	if(flagExec == 2){
		alert("ただいま処理をしております。\n処理が完了するまでしばらくお待ちください。");
	}else{
		flagExec = 1;
	}
}
function confirmExec(in_form){
	if(flagExec == 2){
		alert("ただいま処理をしております。\n処理が完了するまでしばらくお待ちください。");
	}else{
		if (confirm("[" + in_form.value + "]" + "\n上記の処理を行います。よろしいですか？")){
			flagExec = 1;
		}
	}
}
function confirmDeleteExec(in_form){
	if(flagExec == 2){
		alert("ただいま処理をしております。\n処理が完了するまでしばらくお待ちください。");
	}else{
		if (confirm("[OK]をクリックすると、削除した内容を元に戻すことはできません。\n削除してよろしいですか？")){
			flagExec = 1;
		}
	}
}
function sendCheck(){
	if(flagExec == 1){
		flagExec = 2;
		return true;
	}else{
		return false;
	}
}
function clearSendCheck(){
	flagExec = 0;
}
//セレクトオプション変更時Netscapeではリサイズが必要
function resizeOptions() {
  if(document.layers){
    if (navigator.appVersion.charAt(0) >= 4){
      self.moveBy(1,1);
      top.resizeBy(-1,0);
      top.resizeBy(1,0);
      self.moveBy(-1,-1);
    };
  };
}

//問合せ先からコピー（申込先へ）
function CopyToiToMou() {
  document.forms[1].mouName.value   = document.forms[1].toiName.value;
  document.forms[1].mouTantou.value = document.forms[1].toiTantou.value;
  document.forms[1].mouZip.value    = document.forms[1].toiZip.value;
  document.forms[1].mouAdd.value    = document.forms[1].toiAdd.value;
  document.forms[1].mouTel.value    = document.forms[1].toiTel.value;
  document.forms[1].mouExt.value    = document.forms[1].toiExt.value;
  document.forms[1].mouFax.value    = document.forms[1].toiFax.value;
  document.forms[1].mouUrl.value    = document.forms[1].toiUrl.value;
  document.forms[1].mouMail.value   = document.forms[1].toiMail.value;
}
//問合せ先からコピー（主催者へ）
function CopyToiToShu() {
  document.forms[1].shuName.value = document.forms[1].toiName.value;
  document.forms[1].shuZip.value  = document.forms[1].toiZip.value;
  document.forms[1].shuAdd.value  = document.forms[1].toiAdd.value;
  document.forms[1].shuTel.value  = document.forms[1].toiTel.value;
  document.forms[1].shuExt.value  = document.forms[1].toiExt.value;
  document.forms[1].shuFax.value  = document.forms[1].toiFax.value;
  document.forms[1].shuUrl.value  = document.forms[1].toiUrl.value;
  document.forms[1].shuMail.value = document.forms[1].toiMail.value;
}
//申込先からコピー（主催者へ）
function CopyMouToShu() {
  document.forms[1].shuName.value = document.forms[1].mouName.value;
  document.forms[1].shuZip.value  = document.forms[1].mouZip.value;
  document.forms[1].shuAdd.value  = document.forms[1].mouAdd.value;
  document.forms[1].shuTel.value  = document.forms[1].mouTel.value;
  document.forms[1].shuExt.value  = document.forms[1].mouExt.value;
  document.forms[1].shuFax.value  = document.forms[1].mouFax.value;
  document.forms[1].shuUrl.value  = document.forms[1].mouUrl.value;
  document.forms[1].shuMail.value = document.forms[1].mouMail.value;
}

//郵便番号検索用
function callInputZipCode(link,zipObj,prefix,formname){
 var param = "?prefix="+prefix+"&formname="+formname;
 if (zipObj.value!=""){ param = param + '&zipCd=' + zipObj.value; }
 var win = "inputZipCode";
 openWindow(link+param,win,600,550);
 return false;
}
//画像情報登録用
function callFileOperation(link){
 var win = "fileOperation";
 openWindow(link,win,800,600);
 return false;
}
//参照先施設情報検索用
function callInputInstitution(link,institutionObj,prefix,formname){
 var param = "?prefix="+prefix+"&formname="+formname;
 var win="inputInstitutionReference";
 if (institutionObj.value!="")
 { param = param + '&seiriNo=' + institutionObj.value;
   win = "inputInstitutionDetail";
 }
 openWindow(link+param,win,600,550);
 return false;
}
//管理元コード検索用
function callInputDirector(link){
 var win = "inputDirector";
 openWindow(link,win,800,600);
 return false;
}
//所属グループコード検索用
function callInputGroup(link){
 var win = "inputDirector";
 openWindow(link,win,800,600);
 return false;
}
//別ウィンドウ処理
function openWindow(url,win,w,h){
 var str  = "'width="+w+",height="+h+",scrollbars=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes'";
 win = window.open(url,win,eval(str));
 win.focus();
}
// 2004.09.30 追加 By T.Miyagawa
// アップロード処理用(30秒経過後に2度押し防止機能を解除する)
function sendCheckUpload() {
  if(flagExec == 1) {
    flagExec = 2;
    setTimeout('clearSendCheck()', 30000);
    return true;
  } else {
    return false;
  }
}
// 2006.02.13 追加 By T.Miyagawa
// ダウンロード処理用(30秒経過後に2度押し防止機能を解除する)
function sendCheckDownload() {
  if(flagExec == 1) {
    flagExec = 2;
    setTimeout('clearSendCheck()', 30000);
    return true;
  } else {
    return false;
  }
}
