// Global popup window handle
popup_handle = null;

// newPopup is the name of the popup window that would be opened always.

// Open popup (opener form, width, height)
function openPopup(formObj, popupWidth, popupHeight)
{
	 var top = (screen.availHeight - popupHeight) / 2;
	 var left = (screen.availWidth - popupWidth) /2;
     popup_handle=window.open('about:blank','newPopup',
	 'toolbar=no,resizable=no,scrollbars=no,locationbar=no,status=no,modal=yes,unadorned=yes,left=' + left + ',top=' + top + 
	 ',height=' + popupHeight + ',width=' + popupWidth);
	// popup_handle.resizeTo(poupWidth,popupHeight);
     formObj.target="newPopup";
     formObj.submit();
	 popup_handle.focus();
     void('');
}

function closePopup(Success)
{
	var selfTop = self.top;
	var flag = Success; 
	if (flag == "yes")
	{
		if (selfTop.opener) { 
			with(selfTop.opener){
				if (!closed) {
					location.reload();
					focus();
				} 
			}
		}
	}
	selfTop.close();
}