var dicwin = null;

function onSubmit() {
  var c = 0;

  with (document.selform){
    var strSrchWord = word.value;
    if (strSrchWord.length <= 0){
      window.alert("検索条件を入力してください");
      word.focus();
      return false;
    }

    for(var i = 0 ; i < book.length; i++){
      if(book[i].checked)
        c++;
    }

    if(c == 0){
      window.alert("辞書は一つ以上選択して下さい");
      book[0].focus();
      return false;
    }
    else if(c > 3){
      window.alert("選択できる辞書は三つまでです");
      book[0].focus();
      return false;
    }
    else if (!dicwin || dicwin.closed) {
      var sized;
      xPos = (screen.width - 680) / 2;
      yPos = (screen.height - 600) / 2;
      size = "width=" + 680 + ", height=" + 600 + ", resizable=yes, left=" + xPos + ", top=" + yPos ;
      dicwin = window.open("", "FindFrame", size);
      return true;
    }
  }
}


function treeDic(id) {
  if (document.all(id).style.display != "none" || document.all(id).style.display == "") {
    document.all(id).style.display = "none";
  }
  else {
    document.all(id).style.display = "block";
  }
}


function openHowToUse() {
  var height1, width1, size, url;
  height1=610; width1=820;
  xPos = (screen.width - width1) / 2;
  yPos = (screen.height - height1) / 2;
  size = "height=" + height1 + ", width=" + width1 + ", resizable=1, scrollbars=yes, status=no, left=" + xPos + ", top=" + yPos ;
  url = "http://www.sanseido.net/Main/Goannai/Info0401.aspx";
  rewindow = window.open('', 'HowToUse', size);
  rewindow.location.href = url;
}

