
function MM_openBrWindow(theURL,winName,features)
{
  // SessionID anhängen
  theURL = append_sessionid( theURL );

  // Fenster öffnen

  OpenWin = window.open(theURL,winName,features);
  OpenWin.opener = self;
  OpenWin.focus();
}

function append_sessionid( theURL )
{
  // SessionID ermitteln und bei Bedarf an URL anhängen
  get_param = document.location.search;

  if( get_param.length > 1 && theURL.indexOf("sessionid") == -1 )
  {
    get_param = get_param.substr(1,get_param.length);
    if( get_param.charAt(0) == "&" )
    {
      get_param = get_param.substr(1,get_param.length);
    }
    params    = get_param.split( "&" );
    sessionid = "";
    for( i=0; i<params.length; i++)
    {
      vars = params[i].split( "=" );
      key  = vars[0];
      if( vars.length > 1 )
      {
        val  = vars[1];
      }
      else
      {
        val  = "";
      }
      if( key == "sessionid" )
      {
        sessionid = val;
      }
    }
    if( sessionid != "" )
    {
      if( theURL.indexOf("?") == -1 )
      {
        theURL += "?sessionid=" + sessionid;
      }
      else
      {
        theURL += "&sessionid=" + sessionid;
      }
    }
  }
  return theURL;
}



function printWindow()
{
  if(document.all && navigator.appVersion.substring(22,23)==4)
  {
    self.focus();
    var OLECMDID_PRINT = 6;
    var OLECMDEXECOPT_DONTPROMPTUSER = 2;
    var OLECMDEXECOPT_PROMPTUSER = 1;
    var WebBrowser = '<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
    document.body.insertAdjacentHTML('beforeEnd',WebBrowser);
    WebBrowser1.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER);
    WebBrowser1.outerHTML = '';
  }
  else {
    if (window.print)
    {
      window.print();
    } else
    {
      alert("Ihr Browser unterst&uuml;tzt keine automatische Print Funktion!");
    }
  }
}

function disclaimer()
{
  MM_openBrWindow('/index.php?action=disclaimer','disclaimer','status=no,menubar=no,scrollbars=yes,width=798,height=520');
}

function openApplicationForm() 
{
  MM_openBrWindow('/company/popup.php', 'popup', 'width=820,height=700,resizable=0,status=no,menubar=no,' );
}