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 sendSearch()
{
  var suchstring = escape(document.getElementById("suchanfrage").value);
  document.location.href = "/Suche.aspx?searchvalue=" + 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("suchanfrage").onkeydown = stopEvent;
}

function printtxt()
  {
    var Url = encodeURI(document.location.href);
    window.open("/module/print/print.aspx?url=" +encodeURIComponent(Url)+"&outputtype=text", "Drucken","width=775,height=800,scrollbars=yes");
  }

function printpdf()
  {
    var Url = encodeURI(document.location.href);
    window.open("/module/print/print.aspx?url=" +encodeURIComponent(Url)+"&outputtype=pdf", "Drucken","width=775,height=800,scrollbars=yes");
  }

function printnormal()
  {
    var Url = encodeURI(document.location.href);
    window.open("/module/print/print.aspx?url=" +encodeURIComponent(Url)+"&outputtype=html", "Drucken","width=775,height=800,scrollbars=yes");
  }

function setCursor()
{
  var login = document.getElementById("UserLogin");
  if (login != null) {
    login.focus();
  }
}

function updateFBSuche()
{
  ajaxCallCBLAjax(document.getElementById("landesverbandfachbetriebe").value);
}


function myCallbackOCRcontent()
{
  if (document.location.href.indexOf('ContentReader.aspx?remotePage=/Software.aspx') > -1)
  {
    var e = document.getElementById('teaser');
    e.style.display = 'none';
  }
}