// This function is used to open a popup window when user clicking the links in theme
function PBIB_openPopup(cmd, locale, newWin)
{	
	var url = contextPath + "/CommonDispatchServlet?";
	
	if (locale != null)
		cmd += locale;	
	url += cmd;
	url += "=";

	if (!newWin)
	{
		if (window.win)
		{
			if (!window.win.closed)
			{
				win.close();
			}
		}
	}
	
	var name = "pbib_popup";
	var width = screen.width;
	var height = screen.height;
	width = (width*4) / 5;
	height = (height*2) / 3;
	if (screen.width >= 1024 && screen.height >= 768) 
	{
		width = 1015;
		height = 600;
	}
	
	var _x = (screen.width-width)/2 - 5;
   	var _y = ((screen.height-height)*1)/3;

	var settings = 	"left="+ _x + ",top=" + _y + "toolbar=no,location=no,directories=no," +
					"status=no,menubar=no,scrollbars=yes," +
					"resizable=yes,width=" + width + ",height=" + height;

	win = window.open(url, name, settings);
	win.creator = self;
	win.focus();		
}