// +----------------------------------------------------------------------+
// | marlerstern.de                                                       |
// +----------------------------------------------------------------------+
// | copyright (c) 2002 - 2005 center management buschmann gmbh           |
// +----------------------------------------------------------------------+
// | the  marlerstern.de  website  (including  all  of it's  content and  |
// | sources) is covered under german and international copyright laws by |
// | the authors [see below], and is property of the authors, or is used/ |
// | presented  with  permission  and/or  under  license.  no copying  is |
// | allowed without  express written  permission of the the authors, and |
// | and possibly other copyright or trademark owners. all rights reserved|
// +----------------------------------------------------------------------+
// | authors: sebastian olle <p@ndur.de>                                  |
// |          marcus olle <m@rcusolle.de>                                 |
// |          olaf magnusson <o.magnusson@malerstern.de>                  |
// +----------------------------------------------------------------------+

function openwindow(strURL,winType,winName,winWidth,winHeight)
{
    var objWindow
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 800, yMax=600;


	switch(winType)
	{
		case "portrait":
			var xOffset = (xMax - 245)/2, yOffset = (yMax - 375)/2;
			objWindow=window.open(strURL, 'Portrait','toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=245, height=375, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "print":
			var xOffset = (xMax - 600)/2, yOffset = (yMax - 400)/2;
			objWindow=window.open(strURL, 'Drucken','toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=600, height=400, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "help":
			var xOffset = (xMax - 750)/2, yOffset = (yMax - 400)/2;
			objWindow=window.open(strURL, 'Drucken','toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=750, height=400, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "auto":
			objWindow=window.open(strURL, winName, 'scrollbars, resizable, width=200, height=100, top=0, left=0');
			break;
		case "custom":
			window.open(strURL, winName, 'width=' + winWidth + ', height=' + winHeight + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no');
			break;
		case "contest_super":
			var xOffset = (xMax - 560)/2, yOffset = (yMax - 400)/2;
			objWindow=window.open(strURL, 'Gewinnspiel','toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=560, height=400, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "contest_heli":
			var xOffset = (xMax - 512)/2, yOffset = (yMax - 384)/2;
			objWindow=window.open(strURL, 'Gewinnspiel','toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=512, height=384, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "contest_taler":
			var xOffset = (xMax - 500)/2, yOffset = (yMax - 300)/2;
			objWindow=window.open(strURL, 'Gewinnspiel','toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=500, height=300, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "contest_schmetter":
			var xOffset = (xMax - 620)/2, yOffset = (yMax - 420)/2;
			objWindow=window.open(strURL, 'Gewinnspiel','toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=620, height=420, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "contest_maybug":
			var xOffset = (xMax - 590)/2, yOffset = (yMax - 400)/2;
			objWindow=window.open(strURL, 'Gewinnspiel','toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=590, height=400, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "contest_peek":
			var xOffset = (xMax - 600)/2, yOffset = (yMax - 420)/2;
			objWindow=window.open(strURL, 'Gewinnspiel','toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=600, height=420, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;

		default:
			objWindow=window.open(strURL);
	}
}