/* 
 * rotator.js
 * takes a series of array cells, delimited by a pipe (|), and randomly calls one to write to the caller. 
 */


var theImages = new Array();
var theDescription = new Array();
theImages[0] = '../images/highlights/000165.jpg|San Marino, Huntington Library, HM 1100, f. 13|http://dpg.lib.berkeley.edu/webdb/dsheh/heh_brf?CallNumber=hm+1100';
theImages[1] = '../images/highlights/001819.jpg|San Marino, Huntington Library, HM 1163, f. 13v|http://dpg.lib.berkeley.edu/webdb/dsheh/heh_brf?CallNumber=HM+1163';
theImages[2] = '../images/highlights/002042.jpg|San Marino, Huntington Library, HM 932, f. 2v|http://dpg.lib.berkeley.edu/webdb/dsheh/heh_brf?CallNumber=HM+932';
theImages[3] = '../images/highlights/002362.jpg|San Marino, Huntington Library, HM 52435, f. 54|http://dpg.lib.berkeley.edu/webdb/dsheh/heh_brf?CallNumber=HM+52435';
theImages[4] = '../images/highlights/1081b.jpg|New York, Jewish Theological Seminary of America, Library, MS NH35, f. 24v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NNJ-17.xml?showLightbox=yes';
theImages[5] = '../images/highlights/1189b.jpg|New York, Jewish Theological Seminary of America, Library, MS NH150, face|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NNJ-27.xml?showLightbox=yes';
theImages[6] = '../images/highlights/420498s.jpg|New York, New York Public Library, NYPL MA 001, f. 10v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NN-MA-74.xml?showLightbox=yes';
theImages[7] = '../images/highlights/426707s.jpg|New York, New York Public Library, NYPL MA 115, f. 51v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NN-MA-257.xml?showLightbox=yes';
theImages[8] = '../images/highlights/427107s.jpg|New York, New York Public Library, NYPL Spencer 001, f. 3v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NN-Spncr-133.xml?showLightbox=yes';
theImages[9] = '../images/highlights/427455s.jpg|New York, New York Public Library, NYPL Spencer 032, pp. 48-49|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NN-Spncr-167.xml?showLightbox=yes';
theImages[10] = '../images/highlights/COLUMBIA.DS.4885.jpg|New York, Columbia University, Rare Book and Manuscript Library, Plimpton MS 040A, f. 1|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NNC-RBML-35.xml?showLightbox=yes';
theImages[11] = '../images/highlights/COLUMBIA.DS.5844.jpg|New York, Columbia University, Barnard College Library, MS 1, p. 189|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NNBa-1019.xml?showLightbox=yes';
theImages[12] = '../images/highlights/COLUMBIA.DS.7149.jpg|New York, Columbia University, Rare Book and Manuscript Library, Plimpton MS 296, f. 28|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NNC-RBML-1102.xml?showLightbox=yes';
theImages[13] = '../images/highlights/COLUMBIA.DS.8045.jpg|New York, Columbia University, Rare Book and Manuscript Library, Plimpton MS 219, f. 155|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NNC-RBML-1334.xml?showLightbox=yes';
theImages[14] = '../images/highlights/COLUMBIA.DS.8310.jpg|New York, Columbia University, Burke Library at Union Theological Seminary, UTS MS 03, f. 171v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NNC-TH-1120.xml?showLightbox=yes';
theImages[15] = '../images/highlights/COLUMBIA.DS.8441.jpg|New York, Columbia University, Burke Library at Union Theological Seminary, UTS MS 06, f. 33|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NNC-TH-1123.xml?showLightbox=yes';
theImages[16] = '../images/highlights/COLUMBIA.DS.8454.jpg|New York, Columbia University, Burke Library at Union Theological Seminary, UTS MS 08, ff. 7v-8|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/NNC-TH-1125.xml?showLightbox=yes';
theImages[17] = '../images/highlights/DS002500aB.jpg|Berkeley, University of California, Bancroft Library, UCB 150, f. 252v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CU-BANC-7.xml?showLightbox=yes';
theImages[18] = '../images/highlights/DS003367aB.jpg|Berkeley, University of California, Bancroft Library, UCB 147, f. 20v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CU-BANC-634.xml?showLightbox=yes';
theImages[19] = '../images/highlights/DS003688aB.jpg|Berkeley, University of California, Robbins Collection, Robbins MS 001, f. 46|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CU-ROB-715.xml?showLightbox=yes';
theImages[20] = '../images/highlights/DS003988aB.jpg|Berkeley, University of California, Music Library, Music Library MS 0752, f. 5|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CU-MUSI-746.xml?showLightbox=yes';
theImages[21] = '../images/highlights/DS004231aB.jpg|Berkeley, University of California, Robbins Collection, Robbins MS 100, f. 356v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CU-ROB-780.xml?showLightbox=yes';
theImages[22] = '../images/highlights/DS004397aC.jpg|Berkeley, University of California, Robbins Collection, Robbins MS 151, face|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CU-ROB-818.xml?showLightbox=yes';
theImages[23] = '../images/highlights/DS004481aC.jpg|Berkeley, University of California, Music Library, Music Library MS 0753, f. 14|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CU-MUSI-824.xml?showLightbox=yes';
theImages[24] = '../images/highlights/DS004539aB.jpg|Berkeley, University of California, Music Library, Music Library MS 1087, recto|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CU-MUSI-861.xml?showLightbox=yes';
theImages[25] = '../images/highlights/DS004551aB.jpg|Berkeley, University of California, Music Library, Music Library MS 0744, p. 62|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CU-MUSI-863.xml?showLightbox=yes';
theImages[26] = '../images/highlights/DS004601aB.jpg|San Francisco, San Francisco State University, J. Paul Leonard Library, De Bellis La. 12, f. 31|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CSfSt-De-810.xml?showLightbox=yes';
theImages[27] = '../images/highlights/DS004791aB.jpg|San Francisco, San Francisco State University, J. Paul Leonard Library, De Bellis La. 01, f. 179|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CSfSt-De-796.xml?showLightbox=yes';
theImages[28] = '../images/highlights/DS005083aB.jpg|Davis, University of California, Shields Library, Special Collections, UCD D-041:23, f. 1v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CU-Asp-1021.xml?showLightbox=yes';
theImages[29] = '../images/highlights/DS005106aB.jpg|Davis, University of California, Shields Library, Special Collections, UCD BS2551 A4 no. 2641, f. 198|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/CU-Asp-1023.xml?showLightbox=yes';
theImages[30] = '../images/highlights/DS005148aB.jpg|San Francisco, California State Library, Sutro Collection MS 07, f. 48v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/C-S-1028.xml?showLightbox=yes';
theImages[31] = '../images/highlights/DS005209aB.jpg|San Francisco, California State Library, Sutro Collection MS 01, f. 46v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/C-S-1037.xml?showLightbox=yes';
theImages[32] = '../images/highlights/FRAG003R2XL.jpg|Columbia, University of Missouri, Ellis Library, Special Collections, Fragmenta Manuscripta 003, recto|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/MoU-Sp-3.xml?showLightbox=yes';
theImages[33] = '../images/highlights/FRAG064R2XL.jpg|Columbia, University of Missouri, Ellis Library, Special Collections, Fragmenta Manuscripta 064, recto|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/MoU-Sp-64.xml?showLightbox=yes';
theImages[34] = '../images/highlights/FRAG156R2XL.jpg|Columbia, University of Missouri, Ellis Library, Special Collections, Fragmenta Manuscripta 156, recto|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/MoU-Sp-156.xml?showLightbox=yes';
theImages[35] = '../images/highlights/Gar15.003r.jpg|Baltimore, Johns Hopkins University, The John Work Garrett Library, Gar. 15, f. 3|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/MdBJ-G-32.xml?showLightbox=yes';
theImages[36] = '../images/highlights/harvard.DS.1030.jpg|Cambridge, Harvard University, Houghton Library, MS Typ 001, f. 33|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/MH-H-1.xml?showLightbox=yes';
theImages[37] = '../images/highlights/harvard.DS.1900.jpg|Cambridge, Harvard University, Houghton Library, MS Typ 413, f. 1|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/MH-H-148.xml?showLightbox=yes';
theImages[38] = '../images/highlights/harvard.DS.2102.jpg|Cambridge, Harvard University, Houghton Library, MS Typ 444, f. 26|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/MH-H-161.xml?showLightbox=yes';
theImages[39] = '../images/highlights/texas.ds.154.jpg|Austin, University of Texas, Harry Ransom Humanities Research Center, HRC 035, f. 1v|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/TxAuHRH-25.xml?showLightbox=yes';
theImages[40] = '../images/highlights/TEXAS.DS.200.jpg|Austin, University of Texas, Harry Ransom Humanities Research Center, HRC 029, f. 29|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/TxAuHRH-29.xml?showLightbox=yes';
theImages[41] = '../images/highlights/texas.ds.324.jpg|Austin, University of Texas, Harry Ransom Humanities Research Center, HRC 020, f. 13|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/TxAuHRH-21.xml?showLightbox=yes';
theImages[42] = '../images/highlights/texas.ds.597.jpg|Austin, University of Texas, Harry Ransom Humanities Research Center, HRC leaf I.3, recto|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/TxAuHRH-73.xml?showLightbox=yes';
theImages[43] = '../images/highlights/msb17A.002r.jpg|Baltimore, Johns Hopkins University, Eisenhower Library, MSB 17A, f. 2|http://app.cul.columbia.edu:8080/exist/scriptorium/individual/MdBJ-Sp-14.xml?showLightbox=yes';
theImages[44] = '../images/highlights/ca04.jpg|Conception MO, Conception Abbey & Seminary, Library, CA 04, f. 1|http://www.columbia.edu/cgi-bin/dlo?obj=ds.Conception-MO.MoConA.0000108&size=medium';
theImages[45] = '../images/highlights/providence.jpg|Providence, Providence Public Library, Wetmore MS 1, ff. 23v-24|http://www.columbia.edu/cgi-bin/dlo?obj=ds.ProvidencePL-RI.RP.0000028&size=medium';
theImages[46] = '../images/highlights/ks-a7.jpg|Lawrence, University of Kansas, Spencer Research Library, Spec. Coll., MS A7, f. 137|http://www.columbia.edu/cgi-bin/dlo?obj=ds.Kansas-KS.KU-SSp.1177&size=medium';
theImages[47] = '../images/highlights/ks-c195.jpg|Lawrence, University of Kansas, Spencer Research Library, Spec. Coll., MS C195, f. 137|http://www.columbia.edu/cgi-bin/dlo?obj=ds.Kansas-KS.KU-SSp.1472&size=medium';
theImages[48] = '../images/highlights/ks-d31.jpg|Lawrence, University of Kansas, Spencer Research Library, Spec. Coll., MS D31, f. 19|http://www.columbia.edu/cgi-bin/dlo?obj=ds.Kansas-KS.KU-SSp.1529&size=medium';
theImages[49] = '../images/highlights/ccny.jpg|New York, City College of New York, Cohen Library, Archives & Spec. Coll., MS 1, f. 70v|http://www.columbia.edu/cgi-bin/dlo?obj=ds.CUNYCCNY-NY.NNCC.0000005&size=medium';
theImages[50] = '../images/highlights/fordham.jpg|New York, Fordham University, Walsh Library, Archives & Spec. Coll., MS Item 26, recto|http://www.columbia.edu/cgi-bin/dlo?obj=ds.Fordham-NY.NNF-WSp.0000122&size=medium';
theImages[51] = '../images/highlights/oberlin.jpg|Oberlin, Oberlin College, Main Library, Special Collections, H1, verso|http://www.columbia.edu/cgi-bin/dlo?obj=ds.Oberlin-OH.OO-Sp.0000007&size=medium';
theImages[52] = '../images/highlights/penn-0017.jpg|Philadelphia, University of Pennsylvania, Rare Book & MS Library, Ms. Codex 0017, f. 58|http://www.columbia.edu/cgi-bin/dlo?obj=ds.Penn-PA.PU-RBML.1004&size=medium';
theImages[53] = '../images/highlights/penn-0109.jpg|Philadelphia, University of Pennsylvania, Rare Book & MS Library, Ms. Codex 0109, f. 137|http://www.columbia.edu/cgi-bin/dlo?obj=ds.Penn-PA.PU-RBML.1094&size=medium';
theImages[54] = '../images/highlights/penn-0725.jpg|Philadelphia, University of Pennsylvania, Rare Book & MS Library, Ms. Codex 0725, f. 16v|http://www.columbia.edu/cgi-bin/dlo?obj=ds.Penn-PA.PU-RBML.1162&size=medium';
theImages[55] = '../images/highlights/notreDame-02.jpg|Notre Dame, Notre Dame University, Hesburgh Library, Rare Books & Spec. Coll., MS. 2, f. 8|http://www.columbia.edu/cgi-bin/dlo?obj=ds.NotreDame-IN.InNdHLSp.ND0203&size=medium';
theImages[56] = '../images/highlights/notreDame-73.jpg|Notre Dame, Notre Dame University, Hesburgh Library, Rare Books & Spec. Coll., MS. 73, f. 11|http://www.columbia.edu/cgi-bin/dlo?obj=ds.NotreDame-IN.InNdHLSp.ND7303&size=medium';
theImages[57] = '../images/highlights/notreDameNewberry-05.jpg|Notre Dame, Notre Dame University, Hesburgh Library, Rare Books & Spec. Coll., Notre Dame/Newberry MS. 5, f. 5v|http://www.columbia.edu/cgi-bin/dlo?obj=ds.NotreDame-IN.InNdHLSp.NDN0503&size=medium';
theImages[58] = '../images/highlights/flp-lc-14-23.jpg|Philadelphia, Free Library of Philadelphia, Rare Book Department, LC 14 23, f. 34|http://www.columbia.edu/cgi-bin/dlo?obj=ds.FreeLibPhil-PA.PP-RB.mcac142310&size=medium';
theImages[59] = '../images/highlights/flp-lewisE15.jpg|Philadelphia, Free Library of Philadelphia, Rare Book Department, Lewis E 015, f. 53|http://www.columbia.edu/cgi-bin/dlo?obj=ds.FreeLibPhil-PA.PP-RB.mca0150531&size=medium';
theImages[60] = '../images/highlights/flp-lewisE33.jpg|Philadelphia, Free Library of Philadelphia, Rare Book Department, Lewis E 033, Binding|http://www.columbia.edu/cgi-bin/dlo?obj=ds.FreeLibPhil-PA.PP-RB.mca0330001&size=medium';
theImages[61] = '../images/highlights/flp-widener5.jpg|Philadelphia, Free Library of Philadelphia, Rare Book Department, Widener 005, f. 13v|http://www.columbia.edu/cgi-bin/dlo?obj=ds.FreeLibPhil-PA.PP-RB.mcaw050130&size=medium';
theImages[62] = '../images/highlights/flp-widener1.jpg|Philadelphia, Free Library of Philadelphia, Rare Book Department, Widener 001, f. 5v|http://www.columbia.edu/cgi-bin/dlo?obj=ds.FreeLibPhil-PA.PP-RB.mcaw010052&size=medium';
theImages[63] = '../images/highlights/flp-lewisEM76.jpg|Philadelphia, Free Library of Philadelphia, Rare Book Department, Lewis E M 076:17, recto|http://www.columbia.edu/cgi-bin/dlo?obj=ds.FreeLibPhil-PA.PP-RB.mcai760171&size=medium';
theImages[64] = '../images/highlights/flp-lewisEM73.jpg|Philadelphia, Free Library of Philadelphia, Rare Book Department, Lewis E M 073:05, recto|http://www.columbia.edu/cgi-bin/dlo?obj=ds.FreeLibPhil-PA.PP-RB.mcai730051&size=medium';

var j = 0
var p = theImages.length;

// get a random image whose boundaries are [0, p]
var whichOne = Math.round(Math.random()*(p-1));

function rotate() {
	theDescription = theImages[whichOne].split("|");
	document.write('<div style="text-align:left;padding:0;margin:0;"><img src="http://scriptorium.columbia.edu/images/highlights.gif" alt="highlights of digital scriptorium." /></div>');	
	document.write('<table class="rotator2">\n');
	document.write('<tr><td rowspan="2"><a href="javascript:openMe(' + "'" + theDescription[2] + "')" + '" class="caption"><img src="' + theDescription[0] + '" alt="theDescription[1]" border="0" width="175" /></a></td>');
	document.write('<td valign="middle" class="caption">' + '<a href="javascript:openMe(' + "'" + theDescription[2] + "')" + '" class="caption">' + theDescription[1] + '</a></td></tr>');
	 document.write('<tr><td align="left">&nbsp;&nbsp;<a href="highlights/">More highlights&nbsp;&raquo;</a></p></td></tr>\n');
	document.write('</table>');
}

function writeInfo() {

	for(i = 0; i < theImages.length; i++) {
		document.write();
	}	

}


function openMe(url) {
        newWin = window.open(url, "newWin", "height=600, width=800, scrollbars=yes, toolbar=yes, location=yes, resizable=yes, status=yes, menubar=yes");
}

