// Data and instructions for display of an Ursula Michael design

function stopErr() {
  var msg = ""
  msg += "JavaScript error has occurred!" + "\n"
  msg += "Cannot display the desired information." + "\n\n"
  msg += "Your browser is: " + navigator.appName + " " + navigator.appVersion
  alert(msg)
  return true
}

function ShowPicture(bookNum, path) {
  window.onerror = stopErr
  var pictTitle  = new Array()
  var pictImage  = new Array()
  var pictWidth  = new Array()
  var pictHeight = new Array()
  var winWidth
  var winHeight

  // Define the pictures
  pictTitle[00] = "Not Found!"
  pictImage[00] = "images/notavailable.gif"
  pictWidth[00] = 175; pictHeight[00] = 175
  pictTitle[01] = "#168 - Threads of Joy"
  pictImage[01] = "images/168.jpg"
  pictWidth[01] = 275; pictHeight[01] = 360
  pictTitle[02] = "#186 - Winter Home"
  pictImage[02] = "images/186.jpg"
  pictWidth[02] = 387; pictHeight[02] = 319
  pictTitle[03] = "#189/190 - Stitched With Love / Seek Home"
  pictImage[03] = "images/189-190.jpg"
  pictWidth[03] = 205; pictHeight[03] = 360
  pictTitle[04] = "#192 - Happily Ever After"
  pictImage[04] = "images/192.jpg"
  pictWidth[04] = 261; pictHeight[04] = 360
  pictTitle[05] = "#193 - Family Tree"
  pictImage[05] = "images/193.jpg"
  pictWidth[05] = 371; pictHeight[05] = 363
  pictTitle[06] = "#195 - Believe In Your Dreams"
  pictImage[06] = "images/195.jpg"
  pictWidth[06] = 316; pictHeight[06] = 360
  pictTitle[07] = "#196 - Joyful Heart"
  pictImage[07] = "images/196.jpg"
  pictWidth[07] = 401; pictHeight[07] = 352
  pictTitle[08] = "#211 - Forget-Me-Knots Quilt"
  pictImage[08] = "images/211.jpg"
  pictWidth[08] = 223; pictHeight[08] = 360
  pictTitle[09] = "#212 - Love One Another"
  pictImage[09] = "images/212.jpg"
  pictWidth[09] = 331; pictHeight[09] = 360
  pictTitle[10] = "#213 - Roses All Around"
  pictImage[10] = "images/213.jpg"
  pictWidth[10] = 351; pictHeight[10] = 354
  pictTitle[11] = "#215 - Parade of Quilts"
  pictImage[11] = "images/215.jpg"
  pictWidth[11] = 413; pictHeight[11] = 178
  pictTitle[12] = "#217 - Don't Miss The Boat"
  pictImage[12] = "images/217.jpg"
  pictWidth[12] = 238; pictHeight[12] = 360
  pictTitle[13] = "#218 - Salty Dog"
  pictImage[13] = "images/218.jpg"
  pictWidth[13] = 238; pictHeight[13] = 360
  pictTitle[14] = "#219 - Zeke's Creek"
  pictImage[14] = "images/219.jpg"
  pictWidth[14] = 239; pictHeight[14] = 360
  pictTitle[15] = "#220 - Polly's Boathouse"
  pictImage[15] = "images/220.jpg"
  pictWidth[15] = 242; pictHeight[15] = 360
  pictTitle[16] = "#221 - Sailboat Neighbors"
  pictImage[16] = "images/221.jpg"
  pictWidth[16] = 412; pictHeight[16] = 194
  pictTitle[17] = "#222 - So Many Weeds"
  pictImage[17] = "images/222.jpg"
  pictWidth[17] = 376; pictHeight[17] = 318
  pictTitle[18] = "#223 - Stars and Stripes"
  pictImage[18] = "images/223.jpg"
  pictWidth[18] = 412; pictHeight[18] = 144
  pictTitle[19] = "#224 - Sunny Little Day"
  pictImage[19] = "images/224.jpg"
  pictWidth[19] = 412; pictHeight[19] = 180
  pictTitle[20] = "#225 - Harmony Quilts"
  pictImage[20] = "images/225.jpg"
  pictWidth[20] = 411; pictHeight[20] = 177
  pictTitle[21] = "#226 - Prayer Warms the Soul"
  pictImage[21] = "images/226.jpg"
  pictWidth[21] = 412; pictHeight[21] = 175
  pictTitle[22] = "#227 - Quilts and Kittens"
  pictImage[22] = "images/227.jpg"
  pictWidth[22] = 410; pictHeight[22] = 162
  pictTitle[23] = "#228 - Snowmen With Quilts"
  pictImage[23] = "images/228.jpg"
  pictWidth[23] = 413; pictHeight[23] = 177
  pictTitle[24] = "#229 - I'd Rather Be By The Sea"
  pictImage[24] = "images/229.jpg"
  pictWidth[24] = 412; pictHeight[24] = 154
  pictTitle[25] = "#230 - Faith Makes All Things Possible"
  pictImage[25] = "images/230.jpg"
  pictWidth[25] = 413; pictHeight[25] = 159
  pictTitle[26] = "#231 - Safe and Warm"
  pictImage[26] = "images/231.jpg"
  pictWidth[26] = 412; pictHeight[26] = 179
  pictTitle[27] = "#234 - What Cats Do"
  pictImage[27] = "images/234.jpg"
  pictWidth[27] = 410; pictHeight[27] = 192
  pictTitle[28] = "#180 - Bless Our Home"
  pictImage[28] = "images/180.jpg"
  pictWidth[28] = 298; pictHeight[28] = 360
  pictTitle[29] = "#183 - Cozy Cabin"
  pictImage[29] = "images/183.jpg"
  pictWidth[29] = 289; pictHeight[29] = 360
  pictTitle[30] = "#197 - Bear Hugs"
  pictImage[30] = "images/197.jpg"
  pictWidth[30] = 391; pictHeight[30] = 362
  pictTitle[31] = "#216 - Where You Sail"
  pictImage[31] = "images/216.jpg"
  pictWidth[31] = 268; pictHeight[31] = 360
  pictTitle[32] = "#155 - Cottage By The Sea"
  pictImage[32] = "images/155.jpg"
  pictWidth[32] = 279; pictHeight[32] = 360
  pictTitle[33] = "#200 - My Secret Garden"
  pictImage[33] = "images/200.jpg"
  pictWidth[33] = 362; pictHeight[33] = 360
  pictTitle[34] = "#158 - Friends Are Like Seashells"
  pictImage[34] = "images/158.jpg"
  pictWidth[34] = 276; pictHeight[34] = 360
  pictTitle[35] = "#187 - Charming Snow Trio"
  pictImage[35] = "images/187.jpg"
  pictWidth[35] = 276; pictHeight[35] = 360
  pictTitle[36] = "#707 - Sweetheart Bunnies"
  pictImage[36] = "images/707.jpg"
  pictWidth[36] = 300; pictHeight[36] = 206
  pictTitle[37] = "SMR - Snowmen on Mittens Row"
  pictImage[37] = "images/SMR.jpg"
  pictWidth[37] = 420; pictHeight[37] = 115

  // Find the desired picture number from the given book number
  var pictNum = 0
  for (var i=1; i < pictImage.length; i++) {
    if (pictTitle[i].indexOf(bookNum) >= 0) {
      pictNum = i; i = pictImage.length
    }
  }
  winWidth  = pictWidth[pictNum] + 84
  winHeight = pictHeight[pictNum] + 180
  if (pictWidth[pictNum] < 250) {
    winWidth += 250 - pictWidth[pictNum]
  }
  if (pictTitle[pictNum].indexOf(" / ") >= 0) {
    winHeight += 20
  }
  if (pictTitle[pictNum].indexOf("SMR") >= 0) {
    winHeight += 230
  }
  // Define the window parameters
  var windowFeatures = "scrollbars,"
  if (navigator.appName == "Microsoft Internet Explorer") {
    windowFeatures += "width=" + winWidth + ",height=" + winHeight + ",left=0,top=0"
  } else {
    windowFeatures += "width=" + winWidth + ",height=" + winHeight + ",screenX=0,screenY=0"
  }
  // Open the new window
  var repWindow = window.open("","",windowFeatures)
  if (repWindow != null) {
    // Create the new html text
    var repPage = ""
    repPage += "<HTML><HEAD><TITLE>" + pictTitle[pictNum] + "</TITLE>" + "\n"
    repPage += "</HEAD>" + "\n"
    repWindow.document.write(repPage); repPage = ""
    repPage += "<BODY BGCOLOR=\"#FCFFD0\">" + "\n"
    repPage += "<P ALIGN=CENTER><BIG><BIG><B>Ursula Michael Designs</B></BIG></BIG>" + "\n"
    repPage += "<P><CENTER><TABLE BGCOLOR=#FFFFFF CELLPADDING=6 ALIGN=Center><TR><TD>" + "\n"
    if (pictTitle[pictNum].indexOf(" / ") < 0) {
    repPage += "<P ALIGN=CENTER><B>" + pictTitle[pictNum] + "</B>" + "\n"
    } else {
    repPage += "<P ALIGN=CENTER><B>"
    repPage += pictTitle[pictNum].substr(0,pictTitle[pictNum].indexOf(" / ") + 2) + "<BR>"
    repPage += pictTitle[pictNum].substr(pictTitle[pictNum].indexOf(" / ") + 3)
    repPage += "</B>" + "\n"
    }
    repWindow.document.write(repPage); repPage = ""
    repPage += "<P ALIGN=CENTER><IMG SRC=\"" + path + pictImage[pictNum] + "\" BORDER=1"
    repPage += " WIDTH=" + pictWidth[pictNum] + " HEIGHT=" + pictHeight[pictNum]
    repPage += " ALT=\"" + pictTitle[pictNum] + "\">" + "\n"
    if (bookNum == "SMR") {
    repPage += "<BR><IMG SRC=\"" + path + "images/SMR-2.jpg\""
    repPage += " BORDER=1 WIDTH=180 HEIGHT=119"
    repPage += " ALT=\"Snowmen on Mittens Row (enlarged)\">" + "\n"
    repPage += "<P><CENTER><TABLE BGCOLOR=Yellow BORDER"
    repPage += " CELLSPACING=0 CELLPADDING=4><TR><TD>" + "\n"
    repPage += "<P ALIGN=CENTER><B>A donation for<BR>" + "\n"
    repPage += "Breast Cancer Research and Education<BR>" + "\n"
    repPage += "will be made with each sale of this pattern</B>" + "\n"
    repPage += "</TD></TR></TABLE></CENTER>" + "\n"
    repWindow.document.write(repPage); repPage = ""
    }
    repPage += "</TD></TR></TABLE></CENTER>" + "\n"
    repWindow.document.write(repPage); repPage = ""
    repPage += "<P ALIGN=CENTER><A HREF=javascript:window.close() "
    repPage += "ONMOUSEOVER=\"window.status='Close this window';return true\" "
    repPage += "ONMOUSEOUT=\"window.status='';return true\"><SMALL>Close this window</SMALL></A>" + "\n"
    repWindow.document.write(repPage); repPage = ""
    repPage += "</BODY></HTML>" + "\n"
    repWindow.document.write(repPage)
    repWindow.document.close()
  }
}
