function NewWindow(mypage, myname, w, h) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizable=yes'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { 
		win.window.focus();
	}
}

function NewImageWindow(mypage, myimage, myname) {
  function getWidthAndHeight() {
    alert("'" + this.name + "' is " + this.width + " by " + this.height + " pixels in size.");
    return true;
  }
  function loadFailure() {
    alert("'" + this.name + "' failed to load.");
    return true;
  }  
  function openWindow() {
    var winl = (screen.availWidth - this.width) / 2;
    var wint = (screen.availHeight - this.height) / 2;
    winprops = 'height='+this.height+',width='+this.width+',top='+wint+',left='+winl+',scrollbars=no,resizable=no'    
    win = window.open(mypage, '', winprops);
    if (parseInt(navigator.appVersion) >= 4) {win.window.focus();}
    return true;
  }

  var myImage = new Image();
  myImage.name = myimage;
  myImage.onload = openWindow;
  myImage.onerror = loadFailure;
  myImage.src = myimage;
}
