﻿//=========================================================================
// General

function popupWindow(url, width, height, name, noscroll, noresize, nocenter)
{
    if (name == null) 
        name = 'window' + Math.ceil(Math.random()*1000).toString();
	
	var features = 'width=' + width + ', height=' + height;
	features += ', location=no, menubar=no, toolbar=no, status=no';
	if (noscroll)
	    features += ', scrollbars=no';
	if (noresize)
	    features += ', resizable=no';
	else
	    features += ', resizable=yes';

	var newWin = window.open(url, name, features);
	if (!nocenter)
	{
   	    try
   	    {
   	        newWin.moveTo((screen.width - width)/2, (screen.height - height)/2);
        }
        catch(e) {}
    }
    
    newWin.focus();
}
