// A function to build a javascript window containing a
// graphic image, a line of item description, and text which
// has been extracted from a hidden memo section.
// Rev 03/25/2009 MMG
// Begun 08/09/2002

 var loPageText
 var lcForeMark
 var lcAftMark
 var lnForePos
 var lnAftPos

 // GetPoster assembles an image, a caption line, and a
 // variable amount of descriptive text into a new
 // window. The parameters govern (1) raw Itemcode used
 // for special bookmarks in the page's hidden memo text;
 // (2) ItemCode converted to lowercase, used to assemble
 // the filename for an image file; (3) fixed length
 // (41-char max) item description converted to uppercase,
 // used as caption for the image; (4) window properties; and 
 // (5) 3-char file extension for the image file (e.g. 'jpg' or 'gif').
 function GetPoster (lcItemCode,lcLowCode,lcUpItemDesc,lcWfeatures,lcFtype) {

  loPageText = new String(document.AllMemos.memo1.value)
  lcForeMark = "FOREMARK_"+lcItemCode
  lcAftMark = "AFTMARK_"+lcItemCode

  lnForePos = loPageText.indexOf(lcForeMark) + 15
  lnAftPos = loPageText.indexOf(lcAftMark)
 
  var w = window.open("",      // URL ( none specified)
         "item_" + lcItemCode, // Name (should be unique)
         lcWfeatures); // Features (e.g.,'resizable,status,width=320,height=440')
  var d = w.document;     // We use this variable to save typing    
 
 // Output an HTML document into the new window
 d.write('<IMG SRC = "images/'+ lcLowCode +'.'+ lcFtype +'">')
 d.write('<BR><strong>')
 d.write(lcUpItemDesc)
 d.write('</strong><BR>')
 d.write(loPageText.substring(lnForePos,lnAftPos))
 // Remember to close the document when we're done
  d.close();
  }
