function openPopupWithScroll(htmlFile) {
	openPopup(htmlFile, 950, 700, true, true);
}
function openPopupWithoutScroll(htmlFile) {
	openPopup(htmlFile, 950, 700, false, true);
}
function openPopup(htmlFile,htmlWidth,htmlHeight, showScroll, centerWin) {
	
	if (centerWin) {
	  calculatePopupStartLocation(htmlWidth, htmlHeight);
	}
  str = 'resizable=yes,toolbar=0,menubar=0,scrollbars=yes,status=0,location=0,directory=0,width=350,height=200';

  version=Math.round(parseFloat(navigator.appVersion) * 1000);

  if(navigator.appName.indexOf("Konqueror")!=-1) { // konqueror
    htmlWidth+=18;
    htmlHeight+=96;
  }

  if(navigator.appName.indexOf("Netscape")!=-1) {
    if(version>=5000) {
      if(navigator.appVersion.indexOf("Mac")!=-1) { // Netscape6+ on mac
        htmlHeight+=5;
      }
    }
  }

  if(navigator.appName.indexOf("Microsoft")!=-1) {
    if(navigator.appVersion.indexOf("Mac")!=-1) { // IE on Mac
       htmlWidth  -= 11;
       htmlHeight -= 11;
    }
  }

	if (showScroll) {
      win = window.open(htmlFile,'VPScreenshot','resizable=yes,titlebar=no,scrollbars=yes'+ ',width='+htmlWidth+',height='+htmlHeight+',top='+startTop+', left='+startLeft);	
			win.focus();
	} else {
      win = window.open(htmlFile,'VPScreenshot','resizable=yes,titlebar=no,scrollbars=no'+ ',width='+htmlWidth+',height='+htmlHeight+',top='+startTop+', left='+startLeft);	
			win.focus();
	}	
//  window.open(htmlFile + ', resizable=yes, scrollbars=yes, width='+htmlWidth+', height='+htmlHeight+',top='+startTop+', left='+startLeft);
}

var startTop = 0;
var startLeft = 0;

function calculatePopupStartLocation(htmlWidth, htmlHeight) {
//  if(navigator.appName.indexOf("Netscape")==-1) {
//		startTop = (window.screen.height/2)  - (htmlHeight/2) - 24;
		startTop = ((window.screen.height - htmlHeight) /2);
//		startLeft = (window.screen.width/2) - (htmlWidth/2) - 6;
		startLeft = ((window.screen.width - htmlWidth) /2); 
		startTop = Math.ceil(startTop);
		startLeft = Math.ceil(startLeft);
//		alert ("window.screen.width: " + window.screen.width + "\nhtmlWidth: " + htmlWidth +"\nstartLeft: " + startLeft);
//  }
}

