<!-- // hide from old browsers...

var imagesarr = new Array;
var imagecap = new Array;
var imageHeight = new Array;
var imageWidth = new Array;
var newWinSwitch, perRow, imgnum, index, Num, i = Number;
var imgtype, NxtPic, NumVal, newWin, imgloc, imgnam, myimg, qNam, img = String;

function loadImages(imgloc, qNam, imgtype, imgnum, perRow, newWin)
{
  if (imgtype == null || imgtype == "")
  {
    return self.document.writeln("Image type is needed...");
  }

  if (imgnum == null || imgnum == 0)
  {
    return self.document.writeln("# of images is needed...");
  }

  if (perRow == null || perRow == 0)
  {
    return self.document.writeln("# of images per row is needed...");
  }

  if (loadImages.arguments.length < 4)
  {
    return self.document.writeln("# of parms passed are not valid...");
  }
   index = 14;
   imageWidth[0] = 335;   
   imageHeight[0] = 564;
   imageWidth[1] = 535;   
   imageHeight[1] = 498;
   imageWidth[2] = 335;   
   imageHeight[2] = 550;
   imageWidth[3] = 335;   
   imageHeight[3] = 508;
   imageWidth[4] = 335;   
   imageHeight[4] = 566;
   imageWidth[5] = 585;   
   imageHeight[5] = 432;
   imageWidth[6] = 335;   
   imageHeight[6] = 589;
   imageWidth[7] = 335;   
   imageHeight[7] = 576;
   imageWidth[8] = 335;   
   imageHeight[8] = 621;
   imageWidth[9] = 335;   
   imageHeight[9] = 594;
   imageWidth[10] = 335;   
   imageHeight[10] = 553;
   imageWidth[11] = 335;   
   imageHeight[11] = 618;
   imageWidth[12] = 335;   
   imageHeight[12] = 602;
   imageWidth[13] = 335;   
   imageHeight[13] = 532;
   imageWidth[14] = 335;   
   imageHeight[14] = 499;
   imageWidth[15] = 335;   
   imageHeight[15] = 575;
   imageWidth[16] = 335;   
   imageHeight[16] = 552;
   imageWidth[17] = 335;   
   imageHeight[17] = 372;
   imageWidth[18] = 335;   
   imageHeight[18] = 407;
   imageWidth[19] = 535;   
   imageHeight[19] = 725;
   
   imagecap[0] = '1879<br>A. Lalauze<br>Don Quixote (Edimburgh: Patterson, 1879)<br>Aguafuerte (Etching)';
   imagecap[1] =' 1877<br>Barneto<br>Don Quixote (Madrid: Biblioteca Universal, 1877)<br>Steel engraving';
   imagecap[2] = '1876<br>C.A. Leslie / Danforth<br>Don Quixote (Philadelphia: Porter & Coates, 1876)<br>Steel engraving';
   imagecap[3] = '1859<br>Luis de Madrazo<br>Don Quixote (Barcelona: Gorchs, 1859)<br>Steel engraving by Hortigosa';
   imagecap[4] = '1844<br>C. Nanteuil<br>Madrid: Martínez, S.A<br>Litograph by Martínez in "Album" of drawings';
   imagecap[5] = '1836<br>Tony Johannot<br>Don Quixote (Paris: Dubochet, 1836)<br>Drawing';
   imagecap[6] = '1839<br>Dean / Selma<br>The Life and Writings of Miguel de Cervantes (London: Thomas Tegg, 1839)<br>Steel engraving';
   imagecap[7] = '1824<br>Lane<br>Don Quixote (London: Jones, 1828)<br>Engraving';
   imagecap[8] = '1819<br>Blas Ametller (from the painting by Castillo in #4)<br>Don Quixote (Madrid: Imprenta Real, 1819) 4th ed. RAE<br>Engraving<br>In vol. 4, Vida de Cervantes by M. Navarrete';
   imagecap[9] = '1791<br>D.I. Ferro / D.F. Selma<br>Retratos de españoles ilustres (Madrid: Imprenta Real,1791)<br>Engraving<br>Original in Biblioteca Nacional, Madrid';
   imagecap[10] = '1780<br>J. del Castillo / Salvador Carmona<br>Don Quixote (Madrid: Ibarra, 1780) 1st ed. RAE<br>Copper engraving<br>Frontispiece, based on spurious portrait by Alonso del Arco';
   imagecap[11] = '1739<br>Copy of  Kent/Vertue (#2 above)<br>Novelas ejemplares (The Hague: Neaulme, 1739)<br>Engraved by Folkema';   
   imagecap[12] = '1738<br>G. Kent / G. Vertue<br>Don Quixote (London: J.R. Tonson, 1738)<br>Copper engraving<br>Based on Cervantes’ self-portrait in the Novelas ejemplares';  
   imagecap[13] = '1705<br>Unknown<br>Novelas ejemplares (Amsterdam, 1705)<br>Copper engraving';
   imagecap[14] = 'c1900<br>C. A. Machado<br>Oil painting';
   imagecap[15] = '1888<br>Colored drawing by Cano after Pacheco’s painting "San Pedro de Nolasco"<br>Don Quixote (London: Adam & Charles Black, 1895)';   
   imagecap[16] = '1879<br>Bartolomé Maura<br>Don Quijote (Barcelona: Montaner, 1880)<br>Aguafuerte (Etching)';
   imagecap[17] = 'c1600<br>J. de Jáuregui<br>Real Academia Española, Madrid<br>Oil painting<br>Attributed to Jáuregui, inscribed with Cervantes’ name';
   imagecap[18] = '1868<br>Unknown<br>Filadelfia: Lippincott, 1868';   
   imagecap[19] = '1841<br>Geoffroy, after painting by Castillo<br>Don Quixote: (Paris: Baudry, 1841)<br>Steel engraving';
  //  

  for (i = 1; i < imgnum + 1; i++)
  {
    var Num = "000" + i;
    var NumVal = Num.substr(Num.length - 4, Num.length);
    var imgnam = "./cimg/portrait/"+NumVal + imgtype;
    var myimg = imgloc + imgnam;
    if (qNam != null && qNam != "")
    {
      var Num = i;
      var NumVal = i;
      var imgnam = qNam + i + imgtype;
      var myimg = imgloc + imgnam;
    }

    var img = new Image(60,60);
    img.src = myimg;
    imagesarr[i - 1] = myimg;

  }

  if (newWin == null || newWin == "")
  {
      newWinSwitch = 1
  }

  if (newWinSwitch > 0)
  {
    CrtNewWin(index);
  }

  return true;
}

function escapeErr()
{
  return self.document.writeln("There was an error loading " + imagesarr[i - 1] + " ...");
}

function CrtNewWin(index)
{
  if (index==0){
  var newWinWidth = imageWidth[0];
  var newWinHeight = imageHeight[0];
  }else{
  var newWinWidth = imageWidth[index-1];
  var newWinHeight = imageHeight[index-1];
  }
  newWin = window.open("", "newWin", "height="
    + newWinHeight + ", width="
    + newWinWidth + ", resize=yes, scrollbars=yes, top=75, left=650");
//  newWin.document.writeln('indeex '+index);    
  //newWin.document.writeln('W '+newWinWidth);    
//  newWin.document.writeln('H '+newWinHeight);    
//  return newWin.location.reload(LoadNewWin(index));
//}

//function LoadNewWin(index)
//{
  var caps = '';
  newWin.document.writeln('<html><head>');
  newWin.document.writeln('<title>Image Display</title>');
  newWin.document.writeln('</head><body>');
  newWin.document.writeln('<CENTER>');
//  newWin.document.writeln('<a href="javascript:self.close()">Close This Window</a>');
//  newWin.document.writeln('  <br><br>');
  newWin.document.writeln('    <IMG SRC="');
  if (index > 0)
  {
    caps = imagecap[index-1];
    newWin.document.writeln(     imagesarr[index - 1]     );
  } else {
    caps = imagecap[0];  
    newWin.document.writeln(     imagesarr[0]     );
  }
  newWin.document.writeln('" ');
//    newWin.document.writeln('onAbort="javascript:escapeErr()"');
//    newWin.document.writeln(' ');
//    newWin.document.writeln('onError="javascript:escapeErr()"');
//    newWin.document.writeln(' ');
  newWin.document.writeln('ALIGN="TOP" ALT="" BORDER="0" NAME="Photos">');
  newWin.document.writeln('</CENTER>');
  newWin.document.writeln('<p><font size="1" face="Arial">'+caps+'</font></p>');
  newWin.document.writeln('</body></html>');
//  return true;
}

function SwapImg(index)
{
    newWin.close();
    CrtNewWin(index);
   return false;
}


// done hiding from old browsers... -->

