var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;

function DHTML_init() {
 if (window.opera) {
     OP = 1;
 }
 if(document.getElementById) {
   DHTML = 1;
   DOM = 1;
 }
 if(document.all && !OP) {
   DHTML = 1;
   MS = 1;
 }
if(document.layers && !OP) {
   DHTML = 1;
   NS = 1;
 }
}



DHTML_init();




var scrW = screen.availWidth;
var scrH = screen.availHeight;

window.moveTo(0,0);
window.resizeTo(scrW,scrH);
window.moveTo(0,0);
//window.resizeTo(1024,768-30);window.moveTo(200,100);

if (MS) {
	innerW  = "document.body.clientWidth";
	innerH  = "document.body.clientHeight";
	offsetX = "document.body.scrollLeft";
	offsetY = "document.body.scrollTop";
	mouseX  = "window.event.clientX";
	mouseY  = "window.event.clientY";
} else {
	innerW  = "window.innerWidth";
	innerH  = "window.innerHeight";
	offsetX = "window.pageXOffset";
	offsetY = "window.pageYOffset";
	mouseX  = "window.event.pageX";
	mouseY  = "window.event.pageY";
}




function checkSize() {
  if ( (screen.width<1024) && (screen.height<768) ) {
    alert('Die minimale Bildschirm-Auflösung\nfür diese Seiten beträgt 1024x768 Pixel...');
  } else {
    document.getElementById("pagediv").style.visibility = "visible";
  }
}



function OpenPic(adresse) {
  f = window.open(adresse,'PicPopup',
  'width=1,height=1,left='+(screen.availWidth/2)+',top='+(screen.availHeight/2)+',toolbar=0,scrollbars=1,marginheight=0,marginwidth=0');
  f.focus();
}


/***********************************************************

------------------------------------------------------------
|                                                          |
|                                                          |
|                                                          |
|                                                          |
|                                         B-------         |
|                                         |      |         |
|                                         |      |         |
|                                         |      |         |
|                                         --------         |
|                                                   A----  |
|                                                   |   |  |
|                                                   |   |  |
|                                                   -----  |
|                                                          |
------------------------------------------------------------

checkLocation brings menudiv1 to point A(x1/y1) and
menudiv2 to point B(x2/y2).

***********************************************************/



var menuRightBorder = 0;

function checkLocation() {

  var widthDiv1 = 80;
  var heightDiv1 = 80;

  var widthDiv2 = window.document.menuback.width;
  var heightDiv2 = window.document.menuback.height;

  var offset   = 20;
  var scrollOffsetY = eval(offsetY);
  var availHeight = eval(innerH);
  var menuRightBorder = ( (eval(innerW)-950)/2 ) + 950;


  var x = menuRightBorder - offset - widthDiv1;
  var y = scrollOffsetY + availHeight - offset - heightDiv1;
  document.getElementById("menudiv1").style.left = x;
  document.getElementById("menudiv1").style.top  = y;

  x -= (offset + widthDiv2);
  y -= (offset + heightDiv2);

  document.getElementById("menudiv2").style.left = x;
  document.getElementById("menudiv2").style.top  = y;
}



function fixMenu() {
  try {
    checkLocation();
    document.getElementById("menudiv1").style.visibility = "visible";
    setInterval('checkLocation()', 10);
  } catch (e) { }
}






function showMenu() {
  document.getElementById("menudiv2").style.visibility = "visible";
}

function hideMenu() {
  try {
    document.getElementById("menudiv2").style.visibility = "hidden";
  } catch (e) { }
}






function checkFont(fontName) {
    document.write("<span id='A' style=\"font-family:'"+fontName+"',sans-serif;visibility:hidden\">ABCDEFGHIJKLMNOPQRSTUVWXYZ</span>");
    document.write("<span id='B' style=\"font-family:sans-serif;visibility:hidden\">ABCDEFGHIJKLMNOPQRSTUVWXYZ</span><br>");
    var a = document.getElementById('A').offsetWidth;
    var b = document.getElementById('B').offsetWidth;
    if (a==b)
        alert("Offensichtlich haben Sie die Schriftart "+fontName+" nicht installiert.\n\n" +
              "Diese Schriftart wird zur optimalen Darstellung dieser Seiten benötigt,\n" +
              "bitte laden Sie sie herunter und installieren Sie sie, sie läßt sich\n" +
              "mit GOOGLE sehr leicht finden.\n\n" +
              "Zum Installieren unter Windows einfach mit der rechten Maus-Taste anklicken\n" +
              "und dann Installieren wählen...");
}

