function openWindow(url, name, style, width, height)
{
t = (screen.height - height) / 2;
l = (screen.width - width) / 2;
window.open(url, name, style + ",width=" + width + ",height=" + height + ",top=" + t + ",left=" + l);
}openWindow('URL', 'WindowName', 'style without width and height',700,400);