var NS = (navigator.appName=="Netscape")?true:false;

// fitSize function. Resizes the popUp window to fit the enlarged thumbnail picture.
function fitSize() {
  bredOrg = (NS)?window.innerWidth:document.body.clientWidth;
  hoejOrg = (NS)?window.innerHeight:document.body.clientHeight;
  bred = document.images['popPic'].width - bredOrg + 40;
  hoej = document.images['popPic'].height - hoejOrg + 90;
  window.resizeBy(bred,hoej);
  self.focus();
  xPos = (screen.width-bredOrg-40)/2;
  window.moveTo(xPos,140);
  self.focus();
} 

function PopWinWithScroll(url,w,h){
  var topPos = (screen.height) ? (screen.height-h)/2 : 0;
  var leftPos = (screen.width) ? (screen.width-w)/2 : 0;
  
  //alert(url);

  popupWin = window.open(url, 'MM_FileBank', 'scrollbars=yes,height=' + h + ',width=' + w + ',top=' + topPos + ',left=' + leftPos + '')
}

// PopUp function. Makes a new popUp window name MM_FileBank.
var popupWin = null;

function PopWin(url,w,h)
{
  var topPos = (screen.height) ? (screen.height-h)/2 : 0;
  var leftPos = (screen.width) ? (screen.width-w)/2 : 0;

  popupWin = window.open(url, 'MM_FileBank', 'height=' + h + ',width=' + w + ',top=' + topPos + ',left=' + leftPos + '')
}


