  //===========================================================
  //This javascript library suppoerts creating a child window with
  //explicit Height and Width Parameters
  //===========================================================

  var bChild = 0;  // flag whether we have an open window

  
  //---------------------------------------------------
  // Close the window if we have one open.
  function closeWin()
  {
    if ( bChild == 1 )
    {
      // alert ("Childwin exists");
       ChildWin.close();
       bChild = 0;
    }
    else
    {
       //alert ("Childwin does NOT exist");
    }   
  }




  //-----------------------------------------------------
  function openWin(caption, color, theImage, w, h)
  {

    closeWin();  // . . . if necessary
    bChild = 0;

    img = new Image();
    img.src = theImage;

    w = w + 60;
    h = h + 80;

    hw = "height="+h+ ",width=" + w;  //string to insert in window,open()

    // ChildWin.close();   // just in case

    ChildWin = window.open("","photo", hw);
    bChild = 1;
 
    ChildWin.window.document.writeln('<p align=center><img name="thisone" src=theImage > <P>');

    ChildWin.document.images[ 'thisone' ].src = theImage;

    ChildWin.window.document.writeln('<p align=center>  <font color="#808080" face="Arial" size="3"><b> ');
    ChildWin.document.write(caption);
    ChildWin.window.document.writeln('<p><P>');
    ChildWin.window.document.bgColor=color 
    ChildWin.window.document.close(); 
  }
