<!--
function selInit(area){
   for(var i=0; i<document.strace.network.length; i++){
      if(document.strace.network[i].selected == true){
         var network = document.strace.network[i].value;
         break;
      }
   }

   if(network.match(/^0101/)) var array = prefs;
   if(network.match(/^0103/)) var array = regions;
   if(network.match(/^0301/)) var array = regions;

   // ソート
   var i = 0;
   keys = new Array();
   for(key in array){
      keys[i] = key;
      i++;
   }
   document.strace.area.length = i;
   if(i > 40) keys.sort(); // 都道府県の配列の場合にソート

   var i = 0;
   for(key in keys){
      document.strace.area[i].value = keys[key];
      document.strace.area[i].text  = array[keys[key]];
      if(area == keys[key]){
         document.strace.area[i].selected = true;
         document.strace.areaname.value = array[keys[key]];
      }
      i++;
   }
   if(area == '') document.strace.area[0].selected = true;
}

function checkPreviewType(lnm,val){
   var obj = document.stplot.elements;
   for(var i=0; i<obj.length; i++){
      if(obj[i].name == lnm && obj[i].value == val){
         obj[i].checked = true;
         break;
      }
   }
}

function stationClick(orgid,netid,stcd,tm){
   for(var i=0; i<document.stplot.type.length; i++){
      if(document.stplot.type[i].checked == true){
         var type = document.stplot.type[i].value;
         break;
      }
   }
   viewWave(orgid,netid,stcd,tm,'',type);
}

function winName(orgid,netid,stcd,type){
   var winnm = "straceWin" + type + "_" + orgid + netid + "_" + stcd.replace(".", "_");
   return winnm;
}

function viewWave(orgid,netid,stcd,tm,comp,type){
   var winnm = winName(orgid,netid,stcd,type);
   var url = "./view.php?orgid=" + orgid + "&netid=" + netid + "&stcd=" + stcd
              + "&tm=" + tm + "&comp=" + comp + "&type=" + type;
   straceWin = window.open(url,winnm,"width=920,height=730,resizable=1,scrollbars=1");
   straceWin.window.focus();
}

function changeSel(orgid,netid,stcd,type){
   var y  = document.strace_view.year.selectedIndex;
   var yy = document.strace_view.year.options[y].value
   var m  = document.strace_view.month.selectedIndex;
   var mm = document.strace_view.month.options[m].value
   var d  = document.strace_view.day.selectedIndex;
   var dd = document.strace_view.day.options[d].value
   var h  = document.strace_view.hour.selectedIndex;
   var hh = document.strace_view.hour.options[h].value
   var tm = yy + mm + dd + hh;
   for(var i=0; i<document.strace_view.comp.length; i++){
      if(document.strace_view.comp[i].selected == true){
         var comp = document.strace_view.comp[i].value;
         break;
      }
   }
   viewWave(orgid,netid,stcd,tm,comp,type);
}

function stOn(stcd){
   var imgpath = "./image/stbf.gif";
   if(document.all || document.getElementById) document.images[stcd].src = imgpath;
   else                                        document.layers[stcd].document.images[0].src = imgpath;
}

function stOut(stcd,imgpath){
   if(document.all || document.getElementById) document.images[stcd].src = imgpath;
   else                                        document.layers[stcd].document.images[0].src = imgpath;
}

function viewStraceHelp(){
   var url = './strace_help.php';
   straceHelpWin = window.open(url,"straceHelpWin","width=900,height=750,resizable=1,scrollbars=1");
   straceHelpWin.window.focus();

}
//-->
