function submit(act) {
  document.adminForm.act.value = act;
  document.adminForm.submit();
}

function submit_confirm(act, text) {
  if (confirm(text)) { submit(act); }
}

function setCookie(sName, sValue, oExpires, sPath, sDomain, bSecure) {
    var sCookie = sName + "=" + encodeURIComponent(sValue);
    if (oExpires) {
        sCookie += "; expires=" + oExpires.toGMTString();
    }
    if (sPath) {
        sCookie += "; path=" + sPath;
    }
    if (sDomain) {
        sCookie += "; domain=" + sDomain;
    }
    if (bSecure) {
        sCookie += "; secure";
    }
    document.cookie = sCookie;
}

function getCookie(sName) {
    var sRE = "(?:; )?" + sName + "=([^;]*);?";
    var oRE = new RegExp(sRE);
    if (oRE.test(document.cookie)) {
        return decodeURIComponent(RegExp["$1"]);
    } else {
        return null;
    }
}

function toggleDescr(id) {
    var descr_full = document.getElementById('descr_' + id + '_full');
    var descr_short = document.getElementById('descr_' + id + '_short');

    if (descr_full.style.visibility == 'hidden') {
      descr_full.style.visibility = 'visible';
      descr_short.style.visibility = 'hidden';
    } else {
      descr_full.style.visibility = 'hidden';
      descr_short.style.visibility = 'visible';
    }
}

function addOption (oSelect, text, value)
{
  var oOption = document.createElement("option");
  oOption.appendChild(document.createTextNode(text));
  oOption.setAttribute('value', value);

  oSelect.appendChild(oOption);
}
