var newWindow;

function openWindow(windowName,windowUri,windowHeight,windowWidth){
	var centerWidth = (window.screen.width - windowWidth) / 2;
	var centerHeight = (window.screen.height - windowHeight) / 2;
	
	if ( !newWindow || newWindow.closed ){
		newWindow = window.open("", windowName, 'resizable=0,width=' + windowWidth + 
        	',height=' + windowHeight + 
        	',left=' + centerWidth + 
        	',top=' + centerHeight);
    	try{
			newWindow.location.href; // throws exception if after reload
			newWindow.location = windowUri;
		}catch(e){};
	}
	newWindow.focus();
}