function seltime(op, q) {
  location.href="/" + q + "&type=" + op;
  return (1);
}

function selperiod(q, selBoxN) {
  var periodType = document.getElementById('periodType');
  var periodTypeValue = periodType.options[periodType.selectedIndex].value;
  if (periodTypeValue == 'year') {
    if(selBoxN == 'yearN') {
      var yearN = document.getElementById('yearN');
      var yearNvalue = yearN.options[yearN.selectedIndex].value;
      location.href = '/' + q + '&type=year&yearN=' + yearNvalue;
    }
  }
  else if (periodTypeValue == 'month') {
    if (selBoxN == 'yearN') {
      var yearN = document.getElementById('yearN');
      var yearNvalue = yearN.options[yearN.selectedIndex].value;
      location.href = '/' + q + '&type=month&yearN=' + yearNvalue;
    }
    else if (selBoxN == 'monthN') {
      var yearN = document.getElementById('yearN');
      var yearNvalue = yearN.options[yearN.selectedIndex].value;
      var monthN = document.getElementById('monthN');
      var monthNvalue = monthN.options[monthN.selectedIndex].value;
      location.href = '/' + q + '&type=month&yearN=' + yearNvalue + '&monthN=' + monthNvalue;
    }
  }
  else if (periodTypeValue == 'day') {
    if (selBoxN == 'yearN') {
      var yearN = document.getElementById('yearN');
      var yearNvalue = yearN.options[yearN.selectedIndex].value;
      location.href = '/' + q + '&type=day&yearN=' + yearNvalue;
    }
    else if (selBoxN == 'monthN') {
      if(selBoxN == 'yearN') {
        var yearN = document.getElementById('yearN');
        var yearNvalue = yearN.options[yearN.selectedIndex].value;
        location.href = '/' + q + '&type=day&yearN=' + yearNvalue;
      }
      else if (selBoxN == 'monthN') {
        var yearN = document.getElementById('yearN');
        var yearNvalue = yearN.options[yearN.selectedIndex].value;
        var monthN = document.getElementById('monthN');
        var monthNvalue = monthN.options[monthN.selectedIndex].value;
        location.href = '/' + q + '&type=day&yearN=' + yearNvalue + '&monthN=' + monthNvalue;
      }
    }
    else if (selBoxN == 'dayN') {
      var yearN = document.getElementById('yearN');
      var yearNvalue = yearN.options[yearN.selectedIndex].value;
      var monthN = document.getElementById('monthN');
      var monthNvalue = monthN.options[monthN.selectedIndex].value;
      var dayN = document.getElementById('dayN');
      var dayNvalue = dayN.options[dayN.selectedIndex].value;
      location.href = '/' + q + '&type=day&yearN=' + yearNvalue + '&monthN=' + monthNvalue + '&dayN=' + dayNvalue;
    }
  }

  return (1);
}
