function checkSearchForm ()
{
  this.verifyForm = function ()
  {
    if (document.formSearch.schnellsuchtxt.value.length < 3)
    {
      alert ('Bitte geben Sie mindestens vier Zeichen ein');
      return false;
    }
    return true;
  }

  this.verifyLogin = function ()
  {
    if (document.logintop.login.value == '' ||
        document.logintop.passwd.value == '')
    {
      alert ('Bitte geben Sie Ihren Benutzernamen und Ihr Passwort ein');
      return false;
    }
    return true;
  }
}

if ( typeof(document.formSearch) != 'undefined' )
{
  var check = new checkSearchForm();
  document.formSearch.onsubmit = function ()
  {
    success = check.verifyForm();
    if (success)
    {
      return true;
    }
    else
    {
      return false;
    }
  }
}

if ( document.getElementById('jobSearch') )
{
  document.getElementById('jobSearch').onclick = function ()
  {
    success = check.verifyForm();
    if (success)
    {
      document.formSearch.submit();
    }
    else
    {
      return false;
    }
  }
}

if ( document.getElementById('pageSearch') )
{
  document.getElementById('pageSearch').onclick = function ()
  {
    success = check.verifyForm();
    if (success)
    {
      document.formSearch.action = '/index/index.php?sei_id=123';
      document.formSearch.submit();
    }
    else
    {
      return false;
    }
  }
}

if ( typeof(document.logintop) != 'undefined' )
{
  document.logintop.onsubmit = function ()
  {
    success = check.verifyLogin();
    if (success)
    {
      return true;
    }
    else
    {
      return false;
    }
  }
}

if ( typeof(document.sprachform) != 'undefined' )
{
  document.sprachform.switch_spr_id.onchange = function ()
  {
    document.sprachform.submit();
  }
}

if ( typeof(document.domainswitchform) != 'undefined' )
{
  document.domainswitchform.switch_domain.onchange = function ()
  {
    index = document.domainswitchform.switch_domain.selectedIndex;
    link  = document.domainswitchform.switch_domain.options[index].value;
    document.location.href = link;
  }
}