var objPopupWindow = null;

function openPopup(strUrl, strWindowName, strFeatures, iWidth, iHeight)
{
  if(objPopupWindow==null || objPopupWindow.closed)
  {
    if(strFeatures==null || strFeatures.length<1)
    {
      WindowObjectReference = window.open(strUrl, strWindowName);
    }
    else
    {
      WindowObjectReference = window.open(strUrl, strWindowName,
        strFeatures, iWidth, iHeight);
    }
  }
  else
  {
    objPopupWindow.focus();
  }
}

function popup(name,path,w,h) { //popup without scrollbars. Center on screen
	leftPos = 0
	topPos = 0
	if (screen) {//center popup on screen
		leftPos = (screen.width / 2) - w/2
		topPos = (screen.height / 2) - h/2
	}				
	name = window.open (''+path+'','mywindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+h+',left='+leftPos+',top='+topPos+'');
	name.resizeTo(w,h);
	name.moveTo((screen.width / 2) - w/2,(screen.height / 2) - h/2);
	name.focus();
}
