// copyright Philipp Jurewicz 2002/3

fensterHandle = null;
function ImageWindowHandle(href, name, parameters) {
 var localFensterHandle = window.open(href,name,parameters);
 return localFensterHandle;
}

function ImageWindow(windowname, imagepath, imagetext, width, height, scrollflag, linkurl, linktext) {
  if (fensterHandle != null) {
    if (fensterHandle.closed == false) {
  	  var body = fensterHandle.document.getElementsByTagName('body');
	  body[0].innerHTML = '';
	  //fensterHandle.close();
	}
  }
  fensterHandle = ImageWindowHandle('', windowname, 'width=' + width +',height=' + height + ',scrollbars=' + scrollflag);
  fensterHandle.document.write ('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><body style="background: #000000; color: #666666; font-family:Verdana">');
  fensterHandle.document.write ('<div align="center">');
  
  fensterHandle.document.write ('<a hef="JavaScript:window.close();"><img src="' + imagepath + '"></a>');
  fensterHandle.document.write ('<div style="margin-top:5px; font-size:9pt;">' + imagetext);
  
  //if (linkurl != '') {
//	  fensterHandle.document.write (' (<a href="' + linkurl + '" target="_blank">' + linktext + '</a>)</div>');
 // }
  
  fensterHandle.document.write ('</div>');
  fensterHandle.document.write ('</body></html>');
  
  fensterHandle.focus();
}


// ====================================================== ImageWindowPortrait
function ImageWindowPortrait(imagepath, imagetext) {
  ImageWindow('portrait', imagepath, imagetext, '473', '700', 'no', '', '');
}
function ImageWindowPortraitUrl(imagepath, imagetext, linkurl, linktext) {
  ImageWindow('portrait', imagepath, imagetext, '473', '700', 'no', linkurl, linktext);
}

function ImageWindowPortraitNamed(imagepath, imagetext, windowname)
{
  ImageWindow(windowname, imagepath, imagetext, '473', '700', 'no');
}
function ImageWindowPortrait4x3(imagepath, imagetext)
{
  ImageWindow('portrait', imagepath, imagetext, '473', '623', 'no');
}

function ImageWindowPortrait4x3Named(imagepath, imagetext, windowname)
{
  ImageWindow(windowname, imagepath, imagetext, '473', '623', 'no');
}

function ImageWindowLandscape(imagepath, imagetext)
{
  ImageWindow('landscape', imagepath, imagetext, '690', '483', 'no');
}
function ImageWindowLandscapeNamed(imagepath, imagetext, windowname)
{
  ImageWindow(windowname, imagepath, imagetext, '690', '483', 'no');
}
function ImageWindowPresse(imagepath, imagetext)
{
  ImageWindow('presse', imagepath, imagetext, '690', '690', 'yes');
}

function ImageWindowSmallLandscapeNamed(imagepath, imagetext, windowname)
{
  ImageWindow(windowname, imagepath, imagetext, '450', '350', 'no');
}
