function winOpen(theURL,winName,features) 
{ 
  winName = window.open(theURL,winName,features); 
  
  if(winName == null || winName.closed)
    window.open(theURL,winName,features);
  else
    winName.location.href = theURL;

  if (!winName.closed) 
    winName.focus(); 
}

function switch2Url(targeturl)
{
  if (targeturl != null)
  {
    var values = targeturl.split(";"); 
    var target = values[0];
    var href = values[1];
    
    switch (target)
    {
      case "_self":
        self.document.location.href = href;
        break;
      case "_top":
        top.document.location.href = href;
        break;
      case "_parent":
        parent.document.location.href = href;
        break;
      case "_blank":
        window.open(href, target, "", "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600");
        break;
      case "_winopen":
        window.open(href, target, "", "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600");
        break;
      default:
        if (document.location.frames == null || document.location.frames[target])
          document.location.href = href;
        else
          document.location.frames[target].href = href;       
    }
  }
}

function setBookmark()
{
  var brty = navigator.appName;
  var brve = navigator.appVersion;
  var url=parent.document.location.href; 
  var titel = document.title; 
  if (brty.indexOf("Explorer")>-1)
  {
    window.external.AddFavorite(url, unescape(titel));
  }
  else
  {
    alert(unescape("Diese Funktion steht nur f%FCr Internet Explorer zur Verf%FCgung"));
  }
}

function sendSearch()
{
  var suchstring = escape(document.getElementById("suchstring").value);
  document.location.href = "/Suche.aspx?search=" + suchstring;
}

function stopSubmit(e)
{
  return false;
}

function stopEvent(e)
{
  if (!e)
    e = window.event;

  var keyCode = 0;

  if (e.which) {
    keyCode = e.which;
  } else if (e.keyCode) {
    keyCode = e.keyCode;
  }


  if(keyCode == 13 || keyCode == 96)
  {
    if (document.getElementById("onControls"))
    {   
      document.getElementById("onControls").onsubmit = stopSubmit; 
    }
    sendSearch();
  }
}

function setAction()
{
  document.getElementById("suchstring").onkeydown = stopEvent;
}