// JavaScript routines for Dentalteach, Matthias Ziehe 2003

// opens a popup window 
//
// param aUrl  the URL of the window contents
// param aTitle the title of the window
// param width the widht of the window in pixels
// param height the heght of the window in pixels
//
function openPopup(aURL, aName, width, height) {
	//calculate position for centered display	
	leftPos = (screen.width) ? (screen.width-width)/2 : 0;
    topPos = (screen.height) ? (screen.height-height)/2 : 0;
    settings = 'height='+height+',width='+width+',top='+topPos+',left='+leftPos+',scrollbars=yes, resizable=yes, status=no';
    
    // open a new window if not existant or refresh the content of the old one	
	popupWin = window.open(aURL, aName, settings);	
	popupWin.location.href = aURL;
	
	popupWin.focus();
}
