function ShowMainButton(index,posy,height,name,path,msg,imagename){  
    document.writeln('<span style="position:absolute; left:0px; top:' + posy + 'px">');

      document.writeln('<a onMouseOver="switchOn(\'' + imagename + '\',\'' + name + '\');"');
      document.writeln('onMouseOut="switchOff(\'' + imagename + '\',\'' + name + '\');"');
      document.writeln('href="' + path + '.php" target="main">');
      document.writeln('<img height=' + height + ' src="buttons/' + imagename + 'N.gif"');
      document.writeln('width=306 border=0 name=btn_' + name + ' /></a>');
    
    document.writeln('</span>');  
} // ShowMainButton   

var FeeX = 173;
var FeeY = 200;
var FeePosX = FeeX;
var FeePosY = FeeY;
var FeeNewX = FeeX;
var FeeNewY = FeeY;
var DeltaX  = 0;
var DeltaY  = 0;

function NewPos(OldPos) {
  var Delta = Math.floor(7 * Math.random()) - 3; 
  return OldPos + Delta;

} // NewPos

function BewegeFee() {
  if (FeePosX == FeeNewX) {
    FeeNewX = NewPos(FeeX);
  } else {
    if (FeeNewX < FeePosX) {
      FeePosX--;
    } else {
      FeePosX++;
    } // if .. else
  } // if .. else      
  if (FeePosY == FeeNewY) {
    FeeNewY = NewPos(FeeY);
  } else {
    if (FeeNewY < FeePosY) {
      FeePosY--;
    } else {
      FeePosY++;
    } // if .. else
  } // if .. else      

  fee.style.left = FeePosX;
  fee.style.top  = FeePosY;
  
  window.setTimeout("BewegeFee();",1000);
  
} // BewegeFee


/* Mainbuttons an und ausschalten: */

function switchOn(imgname, name)
{
	var b_name = "btn_" + name;
	
	parent.frames[0].document.getElementsByName(b_name)[0].src = "./buttons/" + imgname + "O.gif";
}

function switchOff(imgname, name)
{
	var b_name = "btn_" + name;
	
	parent.frames[0].document.getElementsByName(b_name)[0].src = "./buttons/" + imgname + "N.gif";
}

function popUp(img_url, w, h, id, kat)
{
	var newx = (screen.width/2) - (w/2);
	var newy = (screen.height/2) - (h/2);
	
	str = "./showpic.php?bild=" + img_url + "&id=" + id + "&kat=" + kat;
	
	var F = window.open(str, "Bild", "width=" + w + ",height=" + (h+40) + ",scrollbars=no,status=no,menubar=no,location=no,left="+newx+",top="+newy);
	
	window.innerWidth = w;
	window.innerHeight = (h+40);
	
	F.focus();
}

function popUpmen(img_url, w, h)
{
	var newx = (screen.width/2) - (w/2);
	var newy = (screen.height/2) - (h/2);
	
	str = "./showpic_menschen.php?bild=" + img_url;
	
	var F = window.open(str, "Bild", "width=" + w + ",height=" + (h+40) + ",scrollbars=no,status=no,menubar=no,location=no,left="+newx+",top="+newy);
	
	window.innerWidth = w;
	window.innerHeight = (h+40);
	
	F.focus();
}


function switchimg(img_url, w, h, id, kat)
{
	var newx = (screen.width/2) - (w/2);
	var newy = (screen.height/2) - (h/2);
	
	
	str = "./showpic.php?bild=" + img_url + "&id=" + id + "&kat=" + kat + "&w=" + w + "&h=" + h;
	
	F = window.open(str, "Bild", "width=" + w + ",height=" + (h+40) + ",scrollbars=no,status=no,menubar=no,location=no,left="+newx+",top="+newy);
	
	F.focus();	
}

function setMasse(w, h)
{
	window.resizeTo(w, (h+40));
	window.innerWidth = w;
	window.innerHeight = (h+40);
	window.moveTo((screen.width/2) - (w/2), (screen.height/2) - (h/2));
	
	window.focus();
}

