// +----------------------------------------------------------------------+
// | 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 "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;
		case "download":
			var xOffset = (xMax - 250)/2, yOffset = (yMax - 150)/2;
			objWindow=window.open(strURL, 'Download','toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=300, height=180, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "featurepic":
			var xOffset = (xMax - 830)/2, yOffset = (yMax - 650)/2;
			objWindow=window.open(strURL, winName,'toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=830, height=650, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "sitemap":
			var xOffset = (xMax - 470)/2, yOffset = (yMax - 550)/2;
			objWindow=window.open(strURL, winName,'toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=470, height=550, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "stream512":
			var xOffset = (xMax - 700)/2, yOffset = (yMax - 620)/2;
			objWindow=window.open(strURL, winName,'toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=700, height=620, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "stream620":
			var xOffset = (xMax - 810)/2, yOffset = (yMax - 620)/2;
			objWindow=window.open(strURL, winName,'toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=810, height=620, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "stream840":
			var xOffset = (xMax - 1020)/2, yOffset = (yMax - 620)/2;
			objWindow=window.open(strURL, winName,'toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=1020, height=620, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "stream1280":
			var xOffset = (xMax - 1300)/2, yOffset = (yMax - 740)/2;
			objWindow=window.open(strURL, winName,'toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=1300, height=740, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		case "translator":
			var xOffset = (xMax - 990)/2, yOffset = (yMax - 605)/2;
			objWindow=window.open(strURL, winName,'toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=990, height=605, screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset+'');
			break;
		default:
			objWindow=window.open(strURL);
	}
}