// +----------------------------------------------------------------------+
// | neverwinter-nights.com                                               |
// +----------------------------------------------------------------------+
// | copyright (c) 2002 andreas bytzek and sebastian olle                 |
// +----------------------------------------------------------------------+
// | the  neverwinter-nights.com 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!                                                 |
// | neverwinter  nights  is  (c)  bioware corp.   all  rights  reserved. |
// +----------------------------------------------------------------------+
// | authors: andreas bytzek <mail@mooshie.de>                            |
// |          sebastian olle <p@ndur.net>                                 |
// +----------------------------------------------------------------------+

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 "map":
			var xOffset = (xMax - 570)/2, yOffset = (yMax - 650)/2;
			objWindow=window.open(strURL, 'Portrait','toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=570, height=650, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "auto":
			objWindow=window.open(strURL, winName, 'scrollbars, resizable, width=100, 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;
		default:
			objWindow=window.open(strURL);
	}
}
