var browser = detectBrowser();
var debug = true;

var NS4 = (document.layers) ? 1 : 0;
var IE4 = (document.all) ? 1 : 0;
var NS6 = (document.getElementById) ? 1 : 0;

function detectBrowser() {
  var b;
  if (navigator.appName.indexOf("Microsoft") != -1) b = "IE";
  else b = "NN";
  return b;
}
function popup(url,windowName) {
  var breite = 2000 - 12;
  var hoehe  = 600 - 31;
  if (NS4) popupWin = open(url, windowName, "innerHeight="+hoehe+",innerWidth="+breite+ ",screenX=150,screenY=112,location=no,resizable=yes,directories=no,menubar=no,status=no,toolbar=no,scrollbars=1,scrollbars=yes");
  else     popupWin = open(url, windowName, "height="     +hoehe+",width="     +breite+ ",left=150,top=112,location=no,resizable=yes,directories=no,menubar=no,status=no,toolbar=no,scrollbars=1,scrollbars=yes");
  popupWin.focus();
}
function popupHttp(linkURL,windowName) {
  var myLinkName = "http://"  + window.location.hostname + getHttpPort() + linkURL;
  var breite = 2000 - 12;
  var hoehe  = 600 - 31;
  if (NS4) popupWin = open(myLinkName, windowName, "innerHeight="+hoehe+",innerWidth="+breite+ ",screenX=150,screenY=112,location=no,resizable=yes,directories=no,menubar=no,status=no,toolbar=no,scrollbars=1,scrollbars=yes");
  else     popupWin = open(myLinkName, windowName, "height="     +hoehe+",width="     +breite+ ",left=150,top=112,location=no,resizable=yes,directories=no,menubar=no,status=no,toolbar=no,scrollbars=1,scrollbars=yes");
  popupWin.focus();
}
function motoState() {
  window.status='MotorradThunder.de';
  return true;
}
function getHttpPort() {
  var port = window.location.port;
  if (!port) return port; // no port specified
  else if (window.location.protocol == "https:") port = parseInt(port) - 1; // httpPort = httpsPort - 1
  return (":" + port);
}