function openWindow(url,winName,w,h) {
// parameters:	url = URL of the popup window
// 				winName = window name
// 				w = width
// 				h = height
	leftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	topPosition = (screen.height) ? (screen.height-h)/2 : 0;
	var windowprops = 'width=' + w + ',height=' + h + ',top='+ topPosition +',left='+ leftPosition +',toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no';
	var popup = window.open(url,winName,windowprops);
	// opener allows popup windows to communicate with its owner (the window from which it came)
	// please review http://www.webreference.com/js/tutorial1/opener.html for more information on opener
	if (popup.opener == null) { 	// check if opener property exists
		popup.opener = self; 		// define opener property
	}
	popup.focus();
}