<!--

function OpenWin(filename,width_p,height_p){
  sub = window.open(filename,"search","width="+width_p+",height="+height_p+",status=yes,resizable=no,scrollbars=no,location=no,resize=no,menubar=no,top="+(screen.height/2-height_p/2)+",left="+(screen.width/2-width_p/2));
  sub.focus();
}

function get_object(id) {
    if(document.getElementById) return document.getElementById(id) //e5,e6,n6,m1,o6
    else if(document.all)       return document.all(id)            //e4
    else if(document.layers)    return document.layers[id]         //n4
}

function swap_field(checkbox, field1, field2) {
    if (checkbox.checked) {
        get_object(field1).style.display = "none";
        get_object(field2).style.display = "";
    } else {
        get_object(field2).style.display = "none";
        get_object(field1).style.display = "";
    }
}

var win = window;
function openSubWindow(url, width, height) {
   if ((win == window) || win.closed) {
      win = open(url, "_blank", "width="+width+",height="+height+",resizable=yes,scrollbars=no");
   } else {
      win.focus();
   }
   return false;
}

function validate_checkbox(form) {;
  var cnt=0;
  var i;
  for(i =0; i< form.elements.length;i++){
    if(form.elements[i].checked) cnt++;
  }
  if(cnt == 0){
    alert("チェックボックスを１つ以上選択してください。");
    return false;
  }else{
    return true;
  }
}

function remove_confirm(form, action, caption) {
  if (validate_checkbox(form)) {
     if (confirm("選択した"+caption+"を削除してよろしいですか？")) {
        submit_switch(form, action);
     }
  }
}

function submit_switch(form, action) {
  if (validate_checkbox(form)) {
    form.action = action;
    form.submit();
  }
}

function submit_switch2(form, action) {
    form.action = action;
    form.submit();
}
//-->
