if(document.images)
{
  haus_a = new Image();
  haus_a.src = "img/button1.jpg";
  haus_b = new Image();
  haus_b.src = "img/button1_on.jpg";

  restaurant_a = new Image();
  restaurant_a.src = "img/button2.jpg";
  restaurant_b = new Image();
  restaurant_b.src = "img/button2_on.jpg";

  zimmer_a = new Image();
  zimmer_a.src = "img/button3.jpg";
  zimmer_b = new Image();
  zimmer_b.src = "img/button3_on.jpg";

  aktivitaeten_a = new Image();
  aktivitaeten_a.src = "img/button4.jpg";
  aktivitaeten_b = new Image();
  aktivitaeten_b.src = "img/button4_on.jpg";

  fw_logo_a = new Image();
  fw_logo_a.src = "img/fw_logo.gif";
  fw_logo_b = new Image();
  fw_logo_b.src = "img/fw_logo_on.gif";
}

function changeImage(img_name,objectname)
{
  if(document.images)
  {
    document.images[img_name].src = eval(objectname + ".src");
  }
}

var winObj;

function showPDF(pdfUrl)
{
  if(winObj && !winObj.closed)
    winObj.close();

  $width = 320;
  $height = 320;

  var properties = "left=" + ((screen.availWidth - $width) / 2);
    properties += ",top=" + ((screen.availHeight - $height) / 2);
    properties += ",width=" + ($width > screen.availWidth-10 ? screen.availWidth-10 : $width);
    properties += ",height=" + ($height > screen.availHeight-10 ? screen.availHeight-10 : $height);
    properties += ",scrollbars=no,resizable=no";

  var url = 'showpdf.php?pdfUrl='+pdfUrl;

  winObj = window.open("","PDF",properties);
  winObj.location = url;
}

function showpicture(picUrl,picWidth,picHeight)
{
  if (winObj && !winObj.closed)	winObj.close();

  var properties = "left=" + ((screen.availWidth - picWidth) / 2);
    properties += ",top=" + ((screen.availHeight - picHeight) / 2);
    properties += ",width=" + (picWidth > screen.availWidth-10 ? screen.availWidth-10 : picWidth);
    properties += ",height=" + (picHeight > screen.availHeight-10 ? screen.availHeight-10 : picHeight);
    properties += ",scrollbars=no,resizable=no";

  var picUrl = 'showpicture.php?picUrl='+picUrl+'&picWidth='+picWidth+'&picHeight='+picHeight;

  winObj = window.open("","Picture",properties);
  winObj.location = picUrl;
}
