//----------- Browser Detection -----------

var oldTimer = true;

if (parseInt(navigator.appVersion) >= 4) {
  oldTimer = false;
  var browserVar = navigator.platform;
  var isWin = browserVar.indexOf("Win") != -1;
  var isMac = browserVar.indexOf("Mac") != -1;
  if (document.layers) {
    var n4 = true;
  } else if (document.getElementById && !(document.all)) {
    var ns = true;
  } else if (document.getElementById && document.all) {
    var ie = true;
  } else if(document.all) {
    var i4 = true;
  }
}

//----------- OpenWindow -----------

function getAttr(height,width){

if (ns) {
         // Center on the main window.
         dialogleft = window.screenX + ((window.outerWidth - width) / 2);
         dialogtop = window.screenY + ((window.outerHeight - height) / 2);
         var attr = "screenX=" + dialogleft + ",screenY=" + dialogtop + ",width=" + width + ",height=" + height;
      } else if (ie){
         // The best we can do is center in screen.
         dialogleft = (screen.width - width) / 2;
         dialogtop = (screen.height - height) / 2;
         var attr = "left=" + dialogleft + ",top=" + dialogtop + ",width=" + width + ",height=" + height;
      } else {
      	 var attr = "width=" + width + ",height=" + height;
      }
      return (attr);
}


function OpenWindow(height,width){
	attr = getAttr(height,width);
	dialog = window.open('start.html','LAUDA', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,' + attr);
	dialog.opener = this;
}
function OpenWindowDe(height,width){
	attr = getAttr(height,width);
	dialog = window.open('start_de.html','LAUDA', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,' + attr);
	dialog.opener = this;
}
function OpenWindowEn(height,width){
	attr = getAttr(height,width);
	dialog = window.open('start_en.html','LAUDA', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,' + attr);
	dialog.opener = this;
}

//----------- N4 Resize -----------

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
