﻿function wopen(url, name, w, h) {
    // Fudge factors for window decoration space.
    // In my tests these work well on all platforms & browsers.
    w =w+ 32;
    h =h+ 96;
    var topX = (window.screen.width / 2) - (w / 2);
    var topY = (window.screen.height / 2) - (h / 2);


    var win = window.open(url,name,'width=' + w + ', height=' + h + ',location=no, menubar=no, ' +
		'status=no, toolbar=no, scrollbars=yes, screenX=' + topX + ',screenY=' + topY);
    win.resizeTo(w, h);
    win.location;
    win.focus();
}

function openWindowCentered(url, theWidth, theHeight, scrollbars, resizable){
	// scrollbars and resizable get yes/no options
	var theTop = (screen.height / 2) - (theHeight / 2);
	var theLeft=(screen.width / 2) - (theWidth / 2);
	var features=
	'height=' + theHeight + ',width=' + theWidth + ',top=' + theTop + ',left=' + theLeft + ",scrollbars=" + scrollbars + ", resizable= + resizable + ";
	theWin=window.open(url,'',features);
}
