// ----------------------------------------------------------------------------
//
//	P O P P I C   V 3 . 0
//
//	Copyright (C) 2004, Ulf Brossmann (contact: www.brossmann.biz)
//
//
//	This program is free software; you can redistribute it and/or
//	modify it under the terms of the GNU General Public License
//	as published by the Free Software Foundation; either version 2
//	of the License, or any later version.
//
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with this program; if not, write to the Free Software
//	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
//	USA.
//
// ----------------------------------------------------------------------------



function popPic( headline, image, width, height )
{
	var bgcolor     = "#5e5656";                 // Hintergrundfarbe des Bildes
	var closeXsize  = 24;                        // Schriftgröße des X zum Schließen des Fensters
	var closeXcolor = "#9c1818";                 // Farbe des X im Ruhezustand
	var closeXhover = "#e78C00";                 // Farbe des X bei Mausberührung
	var windowname  = "poppic" + width + height; // Name des Popup-Fensters
	var eventhandle = ' onblur="self.close();"'; // Fensterverhalten steuern

	var    code = '<html>\n<head>\n';
	code = code + '<title>' + headline + '</title>\n';
	code = code + '<style type="text/css">\n';
	code = code + '<!--\n';
	code = code + '\tbody {\n';
	code = code + '\t\tmargin: 0;\n';
	code = code + '\t\tpadding: 0;\n';
	code = code + '\t\tbackground: ' + bgcolor + ' url( "' + image + '" ) no-repeat;\n';
	code = code + '\t}\n';
	code = code + '\t#closer {\n';
	code = code + '\t\tmargin-top: ' + ( height - closeXsize - 20 ) + 'px;\n';
	code = code + '\t\tmargin-right: 20px;\n';
	code = code + '\t\tpadding: 0;\n';
	code = code + '\t\ttext-align: right;\n';
	code = code + '\t}\n';
	code = code + '\ta {\n';
	code = code + '\t\tfont-family: Verdana, Arial, Helvetica, sans-serif;\n';
	code = code + '\t\tfont-size: ' + closeXsize + 'px;\n';
	code = code + '\t\tfont-weight: bold;\n';
	code = code + '\t\tcolor: ' + closeXcolor + ';\n';
	code = code + '\t\ttext-decoration: none;\n';
	code = code + '\t}\n';
	code = code + '\ta:hover {\n';
	code = code + '\t\tcolor: ' + closeXhover + ';\n';
	code = code + '\t}\n';
	code = code + '//-->\n';
	code = code + '</style>\n';
	code = code + '</head>\n\n';
	code = code + '<body' + eventhandle + '>';
	code = code + '<div id="closer">\n';
	code = code + '\t<a href="javascript:self.close();" title="Bildfenster schlie&szlig;en">X</a>\n';
	code = code + '</div>';
	code = code + '</body>\n';
	code = code + '</html>';

	var offsetX = ( screen.width - width - 14 ) / 3;
	var offsetY = ( screen.height - height - 32 ) / 2;

	ImageWindow = window.open( "", windowname, "width=" + width + ", height=" + height + ", left=" + offsetX + ", top=" + offsetY + ", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no" );
	ImageWindow.document.write( code );
	ImageWindow.document.close();
}

