function changestyle(theRow, Style) {
  theRow.className = Style;
}

function confirmLink(theLink, theSqlQuery) {
  var is_confirmed = confirm(theSqlQuery);
  if (is_confirmed) {
    theLink.href += '&is_js_confirmed=1';
  }
  return is_confirmed;
}

function WHnavigator(JTPullDown) {
  location.href='#'+(document.JTPullDown.DList.options[document.JTPullDown.DList.selectedIndex].value);
}

function dbstyleover(theRow) {
theRow.className = "dbrow-active";
}
function dbstyleout(theRow) {
theRow.className = "dbrow";
}
/* kontrola datumu */
function ToLen(retezec, maximum) {
  retezec = String(retezec);
  var i = 0;
  for (i = retezec.length; i < maximum; i++) {
    retezec = "0" + retezec;
  }
  return retezec;
}

function CheckDate(form) {
  var datum = form.value;
  var len = datum.length;
  var poz = 1;
  var subs = 0;
  var i = 0;
  var char = "";
  var day = "";
  var month = "";
  var year = "";
    for (i = 0; i < len; i++) {
      char = datum.substr(i, 1);
      if (char == " " || char == "." || char == "," || char == ":") {
        poz++;
        subs = 0;
      }
      else {
        if (poz == 1) {
          if (subs < 2) {
            day = (day * 10) + (char * 1);
            subs++;
          }
        }
        if (poz == 2) {
          if (subs < 2) {
            month = (month * 10) + (char * 1);
            subs++;
          }
        }
        if (poz == 3) {
          if (subs < 4) {
            year = (year * 10) + (char * 1);
            subs++;
          }
        }
      }
    }

    ThisTime = new Date();
    if (day < 1) day = 1;
    if (day > 31) day = 31;
    if (month < 1) month = ThisTime.getMonth() + 1;
    if (month > 12) month = 12;
    if (year == "") year = ThisTime.getFullYear();
    if (year <= 20) year = year + 2000;
    if (year > 2100) year = 2100;
    if (month == 4 || month == 6 || month == 9 || month == 11) {
      if (day > 30) day = 30;
    }
    if (month == 2) {
      if ((year/4) == parseInt(year/4, 10)) {
        if (day > 29) day = 29;
      } else {
        if (day > 28) day = 28;
      }
    }
    form.value = ToLen(day, 2) + "." + ToLen(month, 2) + "." + ToLen(year, 4);
}
/* kontrola datumu */
