/* Copyright IBM Corp. 2001, 2008  All Rights Reserved.              */

/* author: sberajaw                                                  */

var helpWindow;

function openHelpWindow(url, width, height, newWindow, windowName) {
	if (!width) {
    	width = window.screen.width / 2;
    	if (width < 950)
    		width = 950;
    }
    if (!height) {
    	height = window.screen.height / 2;
    	if (height < 650)
    		height = 650;
    }
    
    if (typeof(newWindow) != "undefined" && newWindow != true) {
    	if (typeof(helpWindow) != "undefined")
    		helpWindow.close();
    }
    
    var left = (window.screen.width - width)/2;
    var top = (window.screen.height - height)/2;
    var options = 'height=' + height + ',width=' + width + ',left=' + left + ',top=' + top + ',status=yes,toolbar=yes,menubar=no,location=yes,scrollbars=yes,resizable=yes';
	
	helpWindow = window.open(applicationContext + url, 
		(typeof(windowName) != 'undefined')?windowName:'help', options);
	
	if (window.focus)
		helpWindow.focus();
}

