function initSearchMask() {
  document.Suchmaske.H_title.focus();
}

function formCheck(searchForm,validate) {
  var sfElement, sfType;
  var sfBoolean = false;
  if (validate) {
    for (var i = 0; i < searchForm.elements.length; i++) {
      sfElement = searchForm.elements[i];
      sfType = sfElement.type;
      if (sfType == "text")
        sfBoolean = sfBoolean || textElementContent(sfElement);
      if (sfType == "select-one" && (sfElement.name != "H_anzProSeite") && (sfElement.name != "H_dateType") && (sfElement.name != "H_dateOp"))
        sfBoolean = sfBoolean || selectOneContent(sfElement);
      if (sfType == "select-multiple")
        sfBoolean = sfBoolean || selectMultipleContent(sfElement);
    }
    if (!sfBoolean)
      alert("Bitte geben Sie einen Suchkriterium ein!");
    return sfBoolean;
  }
}

function textElementContent(textElement) {
  return (textElement.value.replace(" ", "") != "");
}

function selectOneContent(selectOneElement) {
  return (selectOneElement.options[selectOneElement.selectedIndex].value != "");
}

function selectMultipleContent(selectMultipleElement) {
  for (i = 0; i < selectMultipleElement.length; i++)
    if (selectMultipleElement.options[i].selected && selectMultipleElement.options[i].value != "")
      return true;
  return false;
}

var newWindow;
function openWindow(x,y,ref) {
    ref.target = "neuesFenster";
    if ( newWindow ) { newWindow.close(); }
    newWindow = window.open("", "neuesFenster", "width=" + x + ",height=" + y + ",scrollbars=yes,menubar=no,resizable=yes,toolbar=no,status=no,location=no");
    newWindow.focus();
}

function showRadioButtons(id) {
  $(id).getElementsBySelector('a').each(function(el){el.replace(el.innerHTML)});
  $(id).getElementsBySelector('input').each(function(el){el.show()});
}