/*  Fenster v2.1  by © Michael Mally            */
/*  E-Mail: office@mally.at                     */
/*  unauthorized use is not allowed             */
/*  if you want to use this script e-mail me !! */


<!--
//Konfiguration
var preloadpath="images/";
var stylesheet="cms/templates/fenster.css";

function Fenster (bild, bbreite, bhoehe)
{
//  alert(bild.width);
  
  if (bhoehe > screen.height-58) {fhoehe=screen.height-58;} else {fhoehe=bhoehe+50;}
  if (bbreite > screen.width-10) {fbreite=screen.width-10;} else {fbreite=bbreite;}
  p1=fbreite*100/bbreite;
  p2=(fhoehe-50)*100/bhoehe;
  if (p1>p2) {prozent=p2;} else {prozent=p1;}
  hoehe=bhoehe*prozent/100;
  breite=bbreite*prozent/100;
  if (fbreite>breite) {fbreite=breite;}
  if (fhoehe-50>hoehe) {fhoehe=hoehe+50;}
  if (fhoehe<200) {fhoehe=200;}
  if (fbreite<200) {fbreite=200;}
  
//  alert(fbreite);

  //Fenster öffnen
  F1=window.open (this.href,"Bild"," width="+fbreite+", height="+fhoehe+", menubar=no, locationbar=no, resizable=no, status=no");
  F1.document.clear();
  F1.moveTo (screen.width/2-(fbreite+10)/2,(screen.height-29)/2-(fhoehe+30)/2);
  F1.document.write ("<html>\n<head>\n<title>ImageView</title>\n<link rel='STYLESHEET' type='text/css' href='"+stylesheet+"'>\n<script language='JavaScript'>\nimage1=new Image();\nimage1.src='"+bild+"';\nfunction change()\n{\n  if(image1.complete==true)\n  { document.imagebig.src=image1.src;\n    imagebig.width="+fbreite+";\n    imagebig.height="+(fhoehe-50)+";\n  }\n  else\n  { window.setTimeout('change()',200); }\n}\n</script>\n</head>\n");
  F1.document.write ("<body onLoad='change()' class='seite'>\n<table class='tabelle' cellspacing='0'>\n<tr>\n<td class='zelle_bild'><img class='bild' name='imagebig' src='"+preloadpath+"preload.gif' onClick='window.close()'></td>\n</tr>\n<tr height='50'>\n<td class='zelle_button'><input type='button' class='buttonstandard' name='close' value='Close' onClick='window.close()'></td>\n</tr>\n</table>\n</body>\n</html>");
  F1.document.close();
}
//-->
