//	Image Handling for Meyer Gartengestaltung Naturgärten
//	(c) Webmanufaktur Fritschy + Partner

var detWin;

function definePicture( imgname, title, width, height) {
  var imgbig = 'images/normal/' + imgname;
	var imgsmall = 'images/small/' + imgname;
	var widthsmall = 120;
	var heightsmall = 90;
	alttext = title + ' - Clicken, um zu vergrössern';
  var emit = '';
	
	emit = emit + '<a href="' + imgbig + '" target="_blank">';
	emit = emit + '<img src="' + imgsmall + '" width="' + widthsmall + '" height="' + heightsmall + '" border="0" alt="' + alttext + '" onclick="showPicture(\'' + imgbig + '\',\'' + title + '\',' + width + ',' + height + ');return false;"/>';
	emit = emit + '</a>';
	document.write( emit );
}

function showPicture( imgname, title, w, h) {
  var features = 'width=' + w + ',height=' + h + ',top=100,left=100,resizable';

  if (detWin != null) detWin.close();
  detWin = window.open("","Detail",features,true);
  if (detWin == null) {
    window.alert('Could not create window ' + text);
    return;
  }

  d = detWin.document;
  d.open();
  d.write('<html><head><title>' + title + '</title></head>');
  d.write('<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" onClick="self.close()" onBlur="self.close()">');
  d.bgColor    = '#FFFFFF';
  d.fgColor    = '#000000';
  d.write('<img src="' + imgname + '" border="0" width="' + w + '" height="' + h + '" alt="' + title + '" />');
//  d.write('<p>&nbsp;</p>');
  d.write('</body></html>');
  d.close();
  detWin.focus();
}
