// Javascript Default Library fuer labyrinth-international.org

function ShowMainImage (iName) {
  if (! iName) return;
  document.images['maintext' + iName].src = 'images/menu_'     + iName + '_on.gif';
  document.images['mainbeschr'      ].src = 'images/menu_'     + iName + '_beschr.gif';
  document.images['mainlogo'        ].src = 'images/logo_300_' + iName + '.gif';
};

// -----------------------------------------------------------------------------

function HideMainImage (iName) {
  if (! iName) return;
  document.images['maintext' + iName].src = 'images/menu_'     + iName + '_off.gif';
  document.images['mainbeschr'      ].src = 'images/spacer.gif';
  document.images['mainlogo'        ].src = 'images/logo_300.gif';
};

// -----------------------------------------------------------------------------

function PreloadMainImages () {
  var modulename = new Array ('kopf','rechts','fuss','links','herz');
  var imgpattern = new Array ('menu_%1_on','menu_%1_beschr','logo_300_%1');
  var images     = new Array();
  var idx        = 0;
  var imgname    = '';
  for (i = 0 ; i < imgpattern.length ; i++) {
    for (j = 0 ; j < modulename.length ; j++ ) {
      imgname = imgpattern[i];
      imgname = 'images/' + imgname.replace ('%1', modulename[j]) + '.gif';
      images[idx]     = new Image;
      images[idx].src = imgname;
      idx++;
    };
  };
};

// -----------------------------------------------------------------------------

function MM_checkBrowser (
  NSvers,NSpass,NSnoPass,
  IEvers,IEpass,IEnoPass,
  OBpass,
  URL,
  altURL
) { //v4.0
  var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);
  if (app.indexOf('Netscape') != -1) {
    if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
  } else if (app.indexOf('Microsoft') != -1) {
    if (version >= IEvers || verStr.indexOf(IEvers) != -1)
     {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
  } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
  if (newURL) {
    window.location.replace (unescape(newURL));
    document.MM_returnValue=false;
  }
}

// -----------------------------------------------------------------------------

MM_checkBrowser (
  5.0, 0, 1,
  5.0, 0, 0,
  0,
  'support/unsupported.html',
  ''
);

// -----------------------------------------------------------------------------

function ActivateMenu0 (
  iThisImage,
  iThisSrc,
  iBeschrImageID,
  iBeschrImageSrc
) {
  iThisImage.src                      = iThisSrc;
  document.images[iBeschrImageID].src = iBeschrImageSrc;
}

// -----------------------------------------------------------------------------

function PopupFenster (
  iUrl
) {

  popupWin = window.open (
    iUrl,
    "popup",
    "resizable=yes,scrollbars=yes,toolbar=no"
  );

  return false;

}

// -----------------------------------------------------------------------------

function FensterSchliessen () {

  document.write ('<form action="#">\n');
  document.write ('  <input type="button" onclick="window.close()" value="Fenster schliessen" />\n');
  document.write ('</form>\n');

}

// -----------------------------------------------------------------------------

