var url_code = "1094101";
var IsNN4=(navigator.appName.indexOf("Netscape")>=0 && parseFloat(navigator.appVersion)>=4 && parseFloat(navigator.appVersion)<5)?1:0;
var mvList=new Array(5);
var mmList=new Array(5);
function makeList(){
  // 検索月リスト作成（当日の２日後より４ヶ月）
  var d = new Date();
  var day = 24*60*60*1000;         //１日の秒数
  d.setTime(d.getTime()+day*2);    //２日後を求める
  var y = d.getYear();
  if(y < 2000){ y += 1900; }
  var m = d.getMonth();
  var mm ="";
  var mv = "";
  for(i=1;i<5;i++){
    m++;
    if(m>12){
      m -= 12;
      y++;
    }
    if(m<10){
      mm = "0"+m;
      mv=m+" ";
    }else{
      mm = m;
      mv= m;
    }
    mvList[i] = mv;
    mmList[i] = y+""+mm;
  }
}
function Next_Click(){
    var cnt = document.iForm.a_check.length;
    var pref = "";
    var area = "";
    for(i=0;i<cnt;i++){
      if(document.iForm.a_check[i].checked){
        if(document.iForm.a_check[i].value.length==2){
          //都道府県選択
          pref += "'"+document.iForm.a_check[i].value+"',";
        }else{
          //エリア選択
          area += document.iForm.a_check[i].value;
        }
      }
    }
    if(pref==""){
      alert("エリアを選択してください");
      document.iForm.a_check[0].focus();
      return;
    }
    pref = pref.substring(0, pref.length-1);
    cnt = document.iForm.m_slct.length;
    var month = 0;
    for(i=0;i<cnt;i++){
      if(document.iForm.m_slct[i].checked){
        month = document.iForm.m_slct[i].value;
        break;
      }
    }
    if(month==0){
      alert("月を選択してください");
      document.iForm.m_slct[0].focus();
      return;
    }
    domain = "www.aki-search.jp";
    var href="http://"+domain+"/akiweb/servlet/akiwebServlet?";
    if(area.length==1){
      //エリアを１個のみ選択した場合
      href += "ACODE="+area;
    }else{
      href += "FCODE="+pref;
    }
    href += "&URLCODE="+url_code+"&NENGETU="+month;
    document.iForm.a_check[0].focus();
    NW = window.open ("","itiran","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
    NW.location.href = href;
    NW.focus();
}
function a_check_all(start_, count_){
  for(var i=start_; i<start_+count_; i++){
    document.iForm.a_check[i].checked = document.iForm.a_check[start_-1].checked;
  }
}
function a_check_click(start_, point_){
  if(!document.iForm.a_check[start_-1+point_].checked){
    document.iForm.a_check[start_-1].checked = false;
  }
}
function Ken_Click(){
    var cnt = document.iForm.m_slct.length;
    var month = 0;
    for(i=0;i<cnt;i++){
      if(document.iForm.m_slct[i].checked){
        month = document.iForm.m_slct[i].value;
        break;
      }
    }
    cnt = document.iForm.ken_cd.length;
    var ken = '';
    for(i=0;i<cnt;i++){
      if(document.iForm.ken_cd[i].selected){
        ken = document.iForm.ken_cd[i].value;
        break;
      }
    }
    if(ken==''){
      alert("都道府県を選択してください");
      document.iForm.ken_cd.focus();
      return;
    }
    domain = "www.aki-search.jp";
    var href="http://"+domain+"/akiweb/servlet/akiwebServlet?";
    href += "FCODE='"+ken+"'"+"&NENGETU="+month;
    var ccode = document.iForm.kakaku_cd[document.iForm.kakaku_cd.selectedIndex].value;
    if(ccode!=""){ href += "&CCODE="+ccode; }
    href += "&URLCODE="+url_code;
    NW = window.open ("","itiran","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
    NW.location.href = href;
    NW.focus();
}
function Area_Click(area){
    var cnt = document.iForm.m_slct.length;
    var month = 0;
    for(i=0;i<cnt;i++){
      if(document.iForm.m_slct[i].checked){
        month = document.iForm.m_slct[i].value;
        break;
      }
    }
    domain = "www.aki-search.jp";
    var href="http://"+domain+"/akiweb/servlet/akiwebServlet?";
    href += "ACODE="+area+"&NENGETU="+month;
    var ccode = document.iForm.kakaku_cd[document.iForm.kakaku_cd.selectedIndex].value;
    if(ccode!=""){ href += "&CCODE="+ccode; }
    href += "&URLCODE="+url_code;
    NW = window.open ("","itiran","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
    NW.location.href = href;
    NW.focus();
}
function Tiiki_Click(){
    if(document.tForm.ANAME_I.value==''){
      alert("温泉地名を入力してください");
      document.tForm.ANAME_I.focus();
      return;
    }
    var cnt = document.iForm.m_slct.length;
    var month = 0;
    for(i=0;i<cnt;i++){
      if(document.iForm.m_slct[i].checked){
        month = document.iForm.m_slct[i].value;
        break;
      }
    }
    domain = "www.aki-search.jp";
    var href="http://"+domain+"/akiweb/servlet/akiwebServlet";
    NW = window.open ("","itiran","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
    document.tForm.action=href;
    document.tForm.ANAME.value=document.tForm.ANAME_I.value.replace(/[ 　]/g, "%");
    document.tForm.URLCODE.value=url_code;
    document.tForm.NENGETU.value=month;
    document.tForm.CCODE.value=document.iForm.kakaku_cd[document.iForm.kakaku_cd.selectedIndex].value;
    document.tForm.target="itiran";
    document.tForm.submit();
    NW.focus();
}
function Shohin_Click(){
    if(document.sForm.SNAME_I.value==''){
      alert("旅館名を入力してください");
      document.sForm.SNAME_I.focus();
      return;
    }
    var cnt = document.iForm.m_slct.length;
    var month = 0;
    for(i=0;i<cnt;i++){
      if(document.iForm.m_slct[i].checked){
        month = document.iForm.m_slct[i].value;
        break;
      }
    }
    domain = "www.aki-search.jp";
    var href="http://"+domain+"/akiweb/servlet/akiwebServlet";
    NW = window.open ("","itiran","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
    document.sForm.action=href;
    document.sForm.SNAME.value=document.sForm.SNAME_I.value.replace(/[ 　]/g, "%");
    document.sForm.URLCODE.value=url_code;
    document.sForm.NENGETU.value=month;
    document.sForm.CCODE.value=document.iForm.kakaku_cd[document.iForm.kakaku_cd.selectedIndex].value;
    document.sForm.target="itiran";
    document.sForm.submit();
    NW.focus();
}
function Ryoukin_Click(){
      NW = window.open ("","ryoukin",
         "toolbar=no,location=no,directories=no,status=no,"
        +"menubar=no,scrollbars=no,resizable=no,width=640,height=600");
      NW.location.href = "http://www.i-tel24.com/ryoukin.html";
      NW.focus();
}
