// +----------------------------------------------------------------------+
// | copyright (c) 2003 diehausagentur.de                                 |
// +----------------------------------------------------------------------+
// | the  diehausagentur.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  possibly other copyright  or  trademark  owners. |
// | all rights reserved!                                                 |
// +----------------------------------------------------------------------+
// | authors: sebastian olle <p@ndur.de>                                  |
// |          marcus olle <m@rcusolle.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 "abo":
			var xOffset = (xMax - 460)/2, yOffset = (yMax - 520)/2;
			objWindow=window.open(strURL, winName, 'scrollbars, resizable, width=460, height=520, 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":
			var xOffset = (xMax - 380)/2, yOffset = (yMax - 380)/2;
			objWindow=window.open(strURL, 'Gewinnspiel','toolbar=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=380, height=380, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		default:
			objWindow=window.open(strURL);
	}
}
