/**
* phpBB3 forum functions
*/

/**
* Window popup
*/
function popup(url, width, height, name)
{
	if (!name)
	{
		name = '_popup';
	}

	window.open(url.replace(/&amp;/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes, width=' + width);
	return false;
}

/**
* Play quicktime file by determining it's width/height
* from the displayed rectangle area
*/
function play_qt_file(obj)
{
	var rectangle = obj.GetRectangle();

	if (rectangle)
	{
		rectangle = rectangle.split(',');
		var x1 = parseInt(rectangle[0]);
		var x2 = parseInt(rectangle[2]);
		var y1 = parseInt(rectangle[1]);
		var y2 = parseInt(rectangle[3]);

		var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;
		var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;
	}
	else
	{
		var width = 200;
		var height = 0;
	}

	obj.width = width;
	obj.height = height + 16;

	obj.SetControllerVisible(true);
	obj.Play();
}
// (c) 2002 M.Bothge - Schwarzheide
// BILD IN NEUEM ZENTRIERTEN FENSTER ÖFFNEN 

function OpenNewWindow(Picture,Breit,Hoch)
{
	xsize = Breit + 45;// Zusatz für Rand rechts und links
	ysize = Hoch + 80; //Zusatz für Rand oben und unten - damit Button angezeit werden kann 
		
	ScreenWidth = screen.width;
	ScreenHeight = screen.height;

	xpos = (ScreenWidth/2)-(xsize/2);
	ypos = (ScreenHeight/2)-(ysize/2);
	
		NewWindow=window.open("","Picture","height="+ysize+",width="+xsize+",scrollbars=yes,top="+ypos+",left="+xpos+"");
	
		var ausgabe = '<html><head><title>' + Picture + '</title></head>';
		ausgabe += '<body onload="focus();">';
		ausgabe += '<a href="javascript:self.close();"><img src="' + Picture + '" alt="Klicke aufs Bild, um das Fenster zu schließen" title="Klicke aufs Bild, um das Fenster zu schließen"></a>';
		ausgabe += '</body></html>';

		NewWindow.document.write (ausgabe);
		NewWindow.document.close();
		NewWindow.resizeTo(xsize,ysize); 
}

