<!--
// (c) Stephan Slabihoud 1999-2002 - 8bit-museum.de - v1.3
// Feel free to use it (but do not modify the copyright notice).
// Plz report changes and bugfixes to: stephan@8bit-museum.de

  var HELPER1 = "http://www.kleincomputer.de/";
  var HELPER1REMOTE = 0;  // 0=same drive, 1=remote folder required

  var NS  = (navigator.appName.indexOf("Netscape") != -1) ? true : false;
  var IE  = (navigator.appName.indexOf("Microsoft Internet Explorer") != -1) ? true : false;
  var IE3 = (navigator.appVersion.indexOf("MSIE 3") != -1) ? true : false;
  var IE4 = (navigator.appVersion.indexOf("MSIE 4") != -1) ? true : false;
  var OP  = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
  var VER = navigator.appVersion.substring(0,1);

  var thePath = null;
  var theTitle = null;
  var theWidth = null;
  var theHeight = null;

  var popWin = '';
//  var popOld = null;
  var imgCount = 0;

function Translate() {
	document.writeln('<table align=right cellspacing=1 cellpadding=0 border=0><tr>');
	document.writeln('<td><a href=\"http://translate.google.com/translate?langpair=de%7Cen&hl=en&u=' + document.URL + '\"><img src=\"../imagsite/lande.gif\" border=0></a></td>');
	document.writeln('<td><a href=\"http://translate.google.com/translate?langpair=de%7Cfr&hl=en&u=' + document.URL + '\"><img src=\"../imagsite/landf.gif\" border=0></a></td>');
//	document.writeln('<td><a href=\"http://translate.google.com/translate_c?langpair=de%7Cen&hl=en&u=' + document.URL + '\"><img src=\"../imagsite/lande.gif\" border=0></a></td>');
	document.writeln('</tr></table>\n\r');
}

function fixPaths(p) {
	var i = p.indexOf('?', 0);
	if (i >= 0) {p = p.substring(0,i);}
	if (p.substring(0,2) == '/:') {p = p.substring(p.indexOf('/', 2), p.length);}
	i = p.indexOf('\\', 0);
	while (i >= 0) {
		p = p.substring(0,i) + '/' + p.substring(i+1,p.length);
		i = p.indexOf('\\', i);
	}
	return p;
}


// PRIVATE
// ändern relpath in einen absoluten Pfad bezogen auf abspath
function relabs(relpath, abspath) {
  var absimg = fixPaths(abspath);
  var relimg = relpath;

  // Dateinamen abschneiden (kein / am Ende)
  var pos = absimg.lastIndexOf("/");
  absimg = absimg.substring(0,pos);

  while (relimg.substring(0,2)=="..") {
    // letzten Ordner abschneiden (kein / am Ende)
    pos = absimg.lastIndexOf("/");
    absimg = absimg.substring(0,pos);
    relimg = relimg.substring(3,relimg.length);
  }
  absimg = absimg + "/" + relimg;
  return absimg;
}


// ------------------------------------------------------------------
// Für große Bilder, wie Werbung, PCBs u.a.

function PopUpWin(Ort, Title, Path, Width, Height) {
  var pos = 0;  
  var abs = location.href;
  if (Ort==1 && abs.substring(0,7)=="file://") {
    abs = fixPaths(abs);
    pos = abs.lastIndexOf("/");
    abs = abs.substring(0,pos); // Filenamen abschneiden
    pos = abs.lastIndexOf("/");
    abs = abs.substring(0,pos); // letzten Ordner abschneiden
    if (HELPER1REMOTE) {
      abs = abs + "/remote/dummy/"; // und diesen ersetzen durch "remote/" mit einem zusätzlichen Fakeordner
    } else {
      abs = abs + "/dummy/";        // und diesen ersetzen durch "/" mit einem zusätzlichen Fakeordner
    }
    thePath = relabs(Path, abs);
    Ort = 999;
  }

  if (Ort==0) {
    thePath = relabs(Path, location.href);
  }
  if (Ort==1) {
    if (Path.substring(0,2)=="..") {
      Path = Path.substring(3,Path.length);
    }
    thePath = HELPER1 + Path;
  }

  theTitle = Title;
  theWidth = Width;
  theHeight = Height;

  Width=Width+32;
  Height=Height+32;
  if (IE) {
    if (IE3)      { Width=Width+ 4; Height=Height+ 2; }
    if (VER=="4") { Width=Width+ 4; Height=Height+ 2; }
    if (VER>="5") { Width=Width+ 0; Height=Height+ 0; }
  }
  if (OP) {
    Width=Width+ 0; Height=Height+ 0;
  }
  if (NS) {
    Width=Width+ 0; Height=Height+ 0;
  }

  var winFeatures = 'dependent=yes,locationbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=' + Width + ',height=' + Height;
  if (!IE3 && !IE4) if(popWin) if(!popWin.closed) popWin.close();
  popWin = window.open('toolshtml2.htm', 'PopWin' + imgCount++, winFeatures);
}

// Für kleine Bilder
function PopUp(Ort, Title, Path, Width, Height) {
  var pos = 0;  
  var abs = location.href;
  if (Ort==1 && abs.substring(0,7)=="file://") {
    abs = fixPaths(abs);
    pos = abs.lastIndexOf("/");
    abs = abs.substring(0,pos); // Filenamen abschneiden
    pos = abs.lastIndexOf("/");
    abs = abs.substring(0,pos); // letzten Ordner abschneiden
    if (HELPER1REMOTE) {
      abs = abs + "/remote/dummy/"; // und diesen ersetzen durch "remote/" mit einem zusätzlichen Fakeordner
    } else {
      abs = abs + "/dummy/";        // und diesen ersetzen durch "/" mit einem zusätzlichen Fakeordner
    }
    thePath = relabs(Path, abs);
    Ort = 999;
  }

  if (Ort==0) {
    thePath = relabs(Path, location.href);
  }
  if (Ort==1) {
    if (Path.substring(0,2)=="..") {
      Path = Path.substring(3,Path.length);
    }
    thePath = HELPER1 + Path;
  }

  theTitle = Title;
  theWidth = Width;
  theHeight = Height;

  if (IE) {
    if (IE3)      { Width=Width+10; Height=Height-30; }
    if (VER=="4") { Width=Width+ 0; Height=Height+ 0; }
    if (VER>="5") { Width=Width+ 5; Height=Height+ 5; }
  }
  if (OP) {
    Width=Width+0; Height=Height+0;
  }
  if (NS) {
    Width=Width+0; Height=Height+0;
  }

  var winFeatures = 'dependent=yes,locationbar=no,menubar=no,toolbar=no,scrollbars=no,resizable=no,width=' + Width + ',height=' + Height;
  if (!IE3 && !IE4) if(popWin) if(!popWin.closed) popWin.close();
     
  if(OP) {
    popWin = window.open('toolshtml.htm', 'PopWin' + imgCount++, winFeatures);
  } else {
    popWin = window.open('toolshtml.htm', 'PopWin' + imgCount++, winFeatures);
  }

//  if (IE3) if(popOld) if(!popOld.closed) popOld.close();
//  popOld = popWin;
}

// Für Multimedia-Dateien
function PlayIt(Ort, Title, Path) {
  var Width = 400;
  var Height = 40;
  var pos = 0;  
  var abs = location.href;
  if (Ort==1 && abs.substring(0,7)=="file://") {
    abs = fixPaths(abs);
    pos = abs.lastIndexOf("/");
    abs = abs.substring(0,pos); // Filenamen abschneiden
    pos = abs.lastIndexOf("/");
    abs = abs.substring(0,pos); // letzten Ordner abschneiden
    if (HELPER1REMOTE) {
      abs = abs + "/remote/dummy/"; // und diesen ersetzen durch "remote/" mit einem zusätzlichen Fakeordner
    } else {
      abs = abs + "/dummy/";        // und diesen ersetzen durch "/" mit einem zusätzlichen Fakeordner
    }
    thePath = relabs(Path, abs);
    Ort = 999;
  }

  if (Ort==0) {
    thePath = relabs(Path, location.href);
  }
  if (Ort==1) {
    if (Path.substring(0,2)=="..") {
      Path = Path.substring(3,Path.length);
    }
    thePath = HELPER1 + Path;
  }

  theTitle = Title;
  theWidth = Width;
  theHeight = Height;

  if (OP) {
    Height=Height+32;
  }

  var winFeatures = 'dependent=yes,locationbar=no,menubar=no,toolbar=no,scrollbars=no,resizable=no,width=' + Width + ',height=' + Height;
  if (!IE3 && !IE4) if(popWin) if(!popWin.closed) popWin.close();
     
  if(OP) {
    popWin = window.open('toolshtml3.htm', 'PopWin' + imgCount++, winFeatures);
  } else {
    popWin = window.open('toolshtml3.htm', 'PopWin' + imgCount++, winFeatures);
  }
}

// -->

