function imageWindow(url,caption,width,height) {
  leftPos = ''
  topPos = ''
  toolbars = false
  scrollbars = true
  url = '/imageEnlarge.asp?imageUrl=' + url + '&caption=' + caption
  //width = width + 20
  //height = height + 50
  windowName = width + 'x' + height
  openCustomWindow(url,windowName,width,height,leftPos,topPos,toolbars,scrollbars)
}

function openPainting(filename,width,height) {

  openCustomWindow("/enlarge.asp?Filename=" + filename,filename,width,height,false,true);
}

bName=navigator.appName;
function openCustomWindow(url,name,width,height,toolbars,scrollbars,leftPos,topPos) {
  //function used for opening a window, uses passed parameters
  //name is the name of the window
  //toolbars and scrollbars are boolean fields that determine whether those should be shown on window

  rExp = /./gi
  name = name.replace(rExp,'')
  
  toolbarTxt = "toolbar=no,status=no"
  if (toolbars) {
    toolbarTxt = "toolbar=yes,status=yes"
  }
  scrollbarTxt = "scrollbars=no,resizable=yes"
  if (scrollbars) {
    scrollbarTxt = "scrollbars=yes,resizable=yes"
  }
  leftPosTxt = ''
  topPosTxt = ''
  if (!isNaN(leftPos) && !isNaN(topPos)) {
    if (bName != 'Netscape') {
      leftPos = leftPos + 10
      topPos = topPos + 10
    }
    topPosTxt = 'top=' + topPos
    leftPosTxt = 'left=' + leftPos
  }
  windowSpecs = topPosTxt + ',' + leftPosTxt + ',width=' + width + ',height=' + height + ',' + scrollbarTxt + ',' + toolbarTxt
  child = window.open(url,name, windowSpecs)
  child.window.focus()
}

