﻿// selectオブジェクトをvalueで選択する
function SelectOnValue(objsel, selvalue) {
    var i;
    for (i = 0; i < objsel.options.length; i++) {
        if (objsel.options[i].value == selvalue) {
            objsel.selectedIndex = i;
            return;
        }
    }
    objsel.selectedIndex = 0;
}
//selectオブジェクトの選択値を返す
function SelectedValue(objsel) {
    if (objsel.selectedIndex >= 0) {
        return objsel.options[objsel.selectedIndex].value;
    } else {
        return -1;
    }
}

//3桁カンマ
function addComma(str) {
    var num = new String(str).replace(/,/g, '');
    while (num != (num = num.replace(/^(-?\d+)(\d{3})/, '$1,$2')));
    return num;
}


function SetStation(station, node) {
    SearchBox_SetStation(station, node);
}


