Date.prototype.getDOY = function() {
	var onejan = new Date(this.getFullYear(),0,1);
	return Math.ceil((this - onejan) / 86400000);
}
function titleCaps(title) {
   var small = "(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v[.]?|via|vs[.]?)";
   var punct = "([!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]*)";
   var parts = [], split = /[:.;?!] |(?: |^)["Ò]/g, index = 0;
   title = lower(title);
   while (true) {
           var m = split.exec(title);
           parts.push( title.substring(index, m ? m.index : title.length)
                   .replace(/\b([A-Za-z][a-z.'Õ]*)\b/g, function(all){
                           return /[A-Za-z]\.[A-Za-z]/.test(all) ? all : upper(all);
                   })
                   .replace(RegExp("\\b" + small + "\\b", "ig"), lower)
                   .replace(RegExp("^" + punct + small + "\\b", "ig"), function(all, punct, word){
                           return punct + upper(word);
                   })
                   .replace(RegExp("\\b" + small + punct + "$", "ig"), upper));
           
           index = split.lastIndex;
           
           if ( m ) parts.push( m[0] );
           else break;
   }
   return parts.join("").replace(/ V(s?)\. /ig, " v$1. ")
     .replace(/(['Õ])S\b/ig, "$1s")
     .replace(/\b(AT&T|Q&A)\b/ig, function(all){
             return all.toUpperCase();
     });
}
    
function lower(word){
  return word.toLowerCase();
}
    
function upper(word){
  return word.substr(0,1).toUpperCase() + word.substr(1);
}

var images = [
["WI.wpl00263", "After the fire. Waterford, Wisconsin", "/MmBib/WaterfordLocHist/thumb/wpl00263t.jpg"],
["AfricaFocus.2706pc05", "Aoufous Town Gate at Sunset", "/27/thumb/2706pc05t.jpg"],
["WI.am4g019", "The America in the Duluth Ship Canal", "/GreatLakes/Superior/Batch02(A)/thumb/am4g019t.jpg"],
["GlobalDesign.bg00334", "cradle board (baby carrier)", "/globaldesign1/thumb/bg00334t.jpg"],
["UW.UWArchives.dn05052514", "Ron Vander Kelen", "/UWArchives/thumb/dn05052514t.jpg", "Vander Kelen (15) was quarterback of the Big Ten champion 1962 football team and co-MVP of the 1963 Rose Bowl. The other Badger players in the photo are Steve Underwood (60) and Bill Smith (40)."],
["WI.400023", "Art faire at UW Marathon County WI", "/MmBib/EducationFacilities/thumb/400023t.jpg", "View of art faire held in courtyard at UW Marathon County. Patrons and booths can be seen as well as the Red School House in Marathon park."],
["AfricaFocus.4815as03", "Ablution Fountain in Courtyard of Muhammad Ali Mosque, Cairo", "/48/thumb/4815as03t.jpg"],
["UW.UWArchives.040502as055", "Tiger mascot cheerleader", "/UWArchives/thumb/040502as055t.jpg", "University of Wisconsin--Madison tiger mascot cheerleader. For several years in the 1890s and 1900s, the university yell \"U Rah! Rah! Wisconsin\" always ended with the word Tiger."],
["AfricaFocus.5003as41", "Roofing the Chief's Toilet", "/50/thumb/5003as41t.jpg"],
["EastAsian.hw0024a", "The Three Holy Ones of the West.", "/welch/thumb/hw0024at.jpg", "Statues of the Three Holy Ones of the West at the Pilu Monastery's (Pilu Si 毘盧寺) Buddha Recitation Hall preside at the central altar. Left to right: Mahasthamaprapta, Amitabha, and Guanyin (Avalokitesvara) 觀音."],
["EcoNatRes.KlineV.1142", "Adiantum pedatum, Baxter's Hollow, State Natural Area", "/KlineV/Kline3/thumb/1142t.jpg"],
["Arts.Doll01W1945.373", "Doll", "/MmBib/FolkFigures/thumb/Doll01W1945.373t.jpg", "Painted wooden doll representing a peasant woman."],
["Arts.AleBowl01N35.553", "Ale bowl with lion and snake handles", "/MmBib/FolkFigures/thumb/AleBowl01N35.553t.jpg", "This drinking bowl has one handle in the shape of a crowned lion and the other in the shape of a snake. The snake may be a representation of the snake from the Garden of Eden, with an apple under its chin."],
["WI.wpl00419", "Early river scenes. Waterford, Wisconsin", "/MmBib/WaterfordLocHist/thumb/wpl00419t.jpg", "Early river scenes, photo 1. Buena Park, Waterford Wisconsin"],
["AfricaFocus.4404as08", "Top of Mount Kilimanjaro", "/44/thumb/4404as08t.jpg"],
["UW.UWArchives.040502as182", "Camp Randall Stadium and Fieldhouse", "/UWArchives/thumb/040502as182t.jpg", "Camp Randall Stadium and Fieldhouse at the University of Wisconsin--Madison. Color postcard."],
["EcoNatRes.KlineV.1067", "Bloodroot in bloom", "/KlineV/Kline3/thumb/1067t.jpg"],
["UW.UWArchives.040502as129", "1994 Rose Bowl postgame", "/UWArchives/thumb/040502as129t.jpg", "University of Wisconsin--Madison football coach Barry Alvarez celebrates the 1994 Rose Bowl victory. Wisconsin defeated UCLA 21-16."],
["DLDecArts.Ceramics.196101505", "Coffeepot", "/Ceramics/thumb/196101505t.jpg", "This unusual coffeepot cannot predate 1760, the year of the coronation of George William Frederick (1738-1820) as George III of England. The king's appearance alone on this and other pots may indicate support for his policies."],
["AfricaFocus.3906as02", "Two Houses in Transkei, Ibisi Cuttings", "/39/thumb/3906as02t.jpg"],
["WI.HomeFront.300200", "Trial run on Lake Michigan", "/MmBib/HomeFront/thumb/300200t.jpg", "This is one of a series of photographs documenting practice tank landings on the Lake Michigan shoreline at Point Beach, north of Two Rivers, Wisconsin, during the summer of 1943."],
["DLDecArts.Ceramics.199301503", "Bottle", "/Ceramics/thumb/199301503t.jpg", "This important early wine bottle displays \"bird-on-rock\" decoration derived from that on Chinese export hard paste porcelain of the early seventeenth century."],
["AfricaFocus.1412as20", "Candy and Soda Stand Selling One Thing and Advertising Another", "/14/thumb/1412as20t.jpg", "Candy and Soda Stand Selling One Thing and Advertising Another. Ghana, West Africa."],
["DLDecArts.Ceramics.199616802", "Bellarmine jug", "/Ceramics/thumb/199616802t.jpg", "This is thought to be an English imitation of a Continental bearded man jug."],
["UW.CLP-B0043.bib", "Bascom Hall burning, 1916", "/MmBib/UWCulturalLand/UWCL-A/thumb/CLP-B0043t.jpg", "View from the ground of Bascom Hall's dome on fire, October 10, 1916. The fire of unknown origin destroyed the dome, but the rest of the building was saved."],
["AfricaFocus.1412as22", "Advertisement for Star Beer, Produced in an Accra Brewery", "/14/thumb/1412as22t.jpg"],
["UW.UWArchives.040502as119", "Badger band forms \"W\"", "/UWArchives/thumb/040502as119t.jpg"],
["EcoNatRes.LeopoldPapers.leop0130", "Aldo paddling canoe (photo taken by Carl), Colorado River trip, 1922", "/LeopoldPapers/thumb/leop0130t.jpg"],
["Science.0010", "Das Pferd", "/MmBib/VetAnatImg/thumb/0010t.jpg", "These are cranial views (from the front) of the head, neck and forelimbs displaying the musculoskeletal system."],
["UW.UWArchives.dn06041415", "Students confronting police", "/UWArchives/thumb/dn06041415t.jpg", "Students and a policeman during protests over the US invasion of Cambodia."],
["AfricaFocus.3905as07", "Soweto in Johannesburg", "/39/thumb/3905as07t.jpg"],
["Arts.Chair01N35.143", "Three-legged chair with dragon heads", "/MmBib/FolkFigures/thumb/Chair01N35.143t.jpg", "Wooden three-legged chair with arms terminating in stylized dragon heads."],
["AfricaFocus.3705hl09", "Merca, a Gleaming Town by the Sea", "/37/thumb/3705hl09t.jpg"],
["EcoNatRes.KlineV.0831", "Cicada adult on tree trunk", "/KlineV/Kline2/thumb/0831t.jpg"],
["UW.UWArchives.040502as192", "Diving girls at state university defy chilly autumn days and curious eyes", "/UWArchives/thumb/040502as192t.jpg", "Newspaper photo and article taken at the University of Wisconsin--Madison entitled, \"Diving Girls at State University Defy Chilly Autumn Days and Curious Eyes.\""],
["WI.500358", "Hotel Clair cocktail lounge, Lake Geneva, Wis.", "/MmBib/LakeGenImgs/thumb/500358t.jpg", "Photograph of Hotel Clair cocktail lounge, Lake Geneva, Wis."],
["Science.27-1.12", "Holly fern - section of a sporangium", "/GenBot/GroupDa25_28/thumb/27-1.12t.jpg"],
["WI.al2g002", "Bow view of the Alexander Mitchell", "/GreatLakes/LaCrosse/Batch05/thumb/al2g002t.jpg", "Black and white photo bow side view of the sidewheel excursion, Alexander Mitchell, at a landing with passengers posed on and around the boat. Bluffs of the Wisconsin River are in background. Several small row boats are in the picture."],
["AfricaFocus.4808as24", "Face of Goddess Hathor at Karnak", "/48/thumb/4808as24t.jpg"],
["SoHECent.jec239", "High School Hospitality Day", "/001/thumb/jec239t.jpg", "Students planning High School Hospitality Day at the School of Home Economics."],
["GlobalDesign.bg00283", "Miniature sugar coffins for the Day of the Dead", "/globaldesign1/thumb/bg00283t.jpg", "Each miniature coffin has a skull inside.	"],
["AfricaFocus.4808bw15", "Statues of Ramses II, Luxor Temple", "/48/thumb/4808bw15t.jpg", "Luxor, Egypt"],
["WI.npl00028", "Walter Brothers Brewing Company Wagon", "/MmBib/NeenahLocHist/thumb/npl00028t.jpg", "This undated photograph shows a Walter Brothers Brewing Company wagon in front of the George Sensenbrenner Sample Room (tavern) which was located at 292 Tayco Street in Menasha."],
["EcoNatRes.LeopoldPapers.leop0108", "Walking along railroad tracks", "/LeopoldPapers/thumb/leop0108t.jpg", "Aldo and Estella Bergere Leopold, probably Santa Fe, New Mexico, ca. 1912 (walking along railroad tracks)"],
["AfricaFocus.3905as07", "Soweto in Johannesburg", "/39/thumb/3905as07t.jpg"],
["SEAiT.Philippines.ph01016", "Cadets forming a pyramid at the beach, San Fernando, 1938-1939", "/uw/thumb/ph01016t.jpg", "Picar's caption: \"End 1938-1939\" |35.) pyramid, Photo Caption: \"Philippine Military Academy, Poro Is., Sn. Fdo. Galang Studio.\""],
["Science.12-2.1", "Coleus plants in mass", "/GenBot/GroupDa25_28/thumb/28-1-2.12t.jpg"],
["DLDecArts.Ceramics.199701803", "Teapot", "/Ceramics/thumb/199701803t.jpg", "Staffordshire, England, ca. 1755-1770. This rare teapot, inspired by \"Kakiemon\" hard paste porcelain, shows stylistic similarities to a somewhat more barrel-shaped one with enamel floral motifs."],
["UW.UWArchives.031212as10", "Candlelight vigil on State Street", "/UWArchives/thumb/031212as10t.jpg", "Students taking part in a candlelight vigil protesting the Vietnam War on State Street near the University of Wisconsin--Madison campus, 1972."],
["AfricaFocus.3613jt01", "Men Looking Out Window of Wood House in Freetown", "/36/thumb/3613jt01t.jpg", "ca. 1973-1974, Sierra Leone, West Africa."],
["WI.MTWCImages.Over2.001", "Last GAR veterans", "/MmBib/MTWC/thumb/Over2.001t.jpg", "The last of Manitowoc's veterans of the Great Army of the Republic were photographed together around 1910. Jacob Williams and William Braun posed for this picture in front of the flag."],
["EcoNatRes.LeopoldPapers.leop0181", "Photo of dog with tame crow", "/LeopoldPapers/thumb/leop0181t.jpg", "Eulogy for \"Gus\" (photo of dog with tame crow and caption written by AL), late 1943-early 1944"],
["GlobalDesign.bg00204", "Chair, \"Blow\"", "/globaldesign1/thumb/bg00204t.jpg", "First mass-produced inflatable chair in Italy, now an icon of 1960s popular culture. Manufactured by Zanotta."],
["AfricaFocus.0104jt10", "Sand Dunes between Tamanrasett and Djanet", "/01/thumb/0104jt10t.jpg", "Sand dunes in the Sahara between Tamanrasett and Djanet, Algeria, North Africa."],
["WI.400115", "Cain Creek School", "/MmBib/EducationFacilities/thumb/400115t.jpg", "ca. 1890-1899. Exterior of log school building with 22 students and 2 teachers. Location: Town of Pine River."],
["DLDecArts.Ceramics.199001202", "Dish", "/Ceramics/thumb/199001202t.jpg", "ca. 1680-1720, Staffordshire, England. The dish is thrown. The interior is coated in cream-colored slip. The reverse is unglazed. Trailed and dotted slip forms a cat with a tightly curled tail, an upward running mouse, and a nearby multi-lobed filler ornament."],
["UW.UWArchives.dn04120101.bib", "Dedication of Memorial Union building site", "/UWArchives/thumb/dn04120101t.jpg", "Crowd at the dedication of the Memorial Union building site, November 5, 1921. The three buildings are, from left, the President's house, the old Clinical Laboratory, and the then home of the Union (the Raymer house and former infirmary). The buildings occupy the current site of the Memorial Union."],
["WI.TaylorBros.224-51702", "Parade float for 4th of July", "/TaylorBros/tb1/thumb/224-51702t.jpg", "ca. 1910-1930. 4th of July parade. Gund Brewery signs on Float and Men Drinking Beer."],
["EastAsian.db0264a", "Eating dumplings", "/dobson/thumb/db0264at.jpg", "Three men sitting around a table eating dumplings."],
["WI.TaylorBros.531-52264B", "Children with dog pulling wagon", "/TaylorBros/tb2/thumb/531-52264Bt.jpg", "Adams County, Wisconsin, ca. 1910-1930."],
["UW.UWArchives.040502as139", "Hockey players", "/UWArchives/thumb/040502as139t.jpg", "Hockey players Donald Meiklejohn (L) and Gilbert Krueger (R) on ice rink on the current Library Mall at the University of Wisconsin--Madison."],
["AfricaFocus.2706pc02", "Tinherir, an Oasis Town on the Sahara Side of the Atlas", "/27/thumb/2706pc02t.jpg", "Morocco, North Africa"],
["WI.HomeFront.300226", "Loggerhead battle insignia", "/MmBib/HomeFront/thumb/300226t.jpg", "Color print of the battle insignia for the submarine U.S.S. Loggerhead, a submarine built in Manitowoc, Wisconsin by the Manitowoc Shipbuilding Company in 1944."],
["WI.TaylorBros.047-51295", "School. Lewiston, Wisconsin", "/TaylorBros/tb1/thumb/047-51295t.jpg", "School: rural school and class, exterior. Lewiston, Wisconsin"],
["GlobalDesign.bg00039", "Stool", "/globaldesign1/thumb/bg00039t.jpg", "\"Wisdom knot stool\", signifying that only the wise man can untie such a knot. Includes incised symnbols on the central section. A king would use this to show his subjects he rules by wisdom rather than force."],
["History.WWIArchives.0001", "Terror", "/MmBib/WWI/thumb/0001t.jpg", "This stamp is one of a complete collection of original [Great] War Poster-Stamps designed by Lodewijk Schelfhout. The stamps were designed and sold for the benefit of War-refugees (mainly Belgians) staying in the Netherlands. "],
["Arts.Pipe01N35.504", "Pipe", "/MmBib/FolkFigures/thumb/Pipe01N35.504t.jpg", "Pipe of meerscaum with carved horse decoration and dated 1800."],
["UW.UWArchives.040502as194", "Synchronized swimming, women's physical education", "/UWArchives/thumb/040502as194t.jpg", "Synchronized swimming in a women's physical education class at the University of Wisconsin--Madison."],
["WI.wpl00399", "School bus, Ranke School", "/MmBib/WaterfordLocHist/thumb/wpl00399t.jpg", "Oscar Graf is pictured with Racine County's first school bus, which stated its run the first day of school in 1931. The bus was used to transport children from the Ranke to the Waterford Graded School District after the two districts consolidated."],
["AfricaFocus.0701as18", "Camels at Water Hole", "/07/thumb/0701as18t.jpg", "Mao, Chad, Central Africa"],
["WI.MTWCImages.LSE.018", "Aluminum Goods baseball 1924", "/MmBib/MTWC/thumb/LSE.018t.jpg", "Aluminum Goods baseball team, Manitowoc, WI, 1924."],
["UW.UWArchives.040502as101", "First UW football team", "/UWArchives/thumb/040502as101t.jpg", "The first University of Wisconsin--Madison football team, 1889."],
["AfricaFocus.0407as02", "House and Horse in the Mountains in Winter", "/04/thumb/0407as02t.jpg", "There are very few roads in Lesotho. Because horses are the major means of transportation, the Basuto people are adept at horsemanship. They often measure wealth by the number of horses that a person owns."],
["WI.wpl00262", "Noll Band", "/MmBib/WaterfordLocHist/thumb/wpl00262t.jpg", "Noll Band. Louis L. (1861-1920) Noll is 4th from left in back row. Charles H. (1858-1921) Noll is 2nd from right in the front row."],
["AfricaFocus.3610jt34", "Blacksmith at Work on Anvil", "/36/thumb/3610jt34t.jpg", "Sierra Leone, West Africa"],
["WiscSheetMus.wsm0393", "Belle of Wisconsin", "/WiscSheetMus0399/thumb/wsm039301t.jpg", "Cover of \"The Belle of Wisconsin Waltz\" by W. G. du Buy, Jr., 1890."],
["UW.UWArchives.031212as12", "Police officers in front of Bascom Hall", "/UWArchives/thumb/031212as12t.jpg", "February 1969; police officers in front of Bascom Hall during a strike to demand more black students and faculty and creation of a black studies department."],
["WiscFolkSong.WHS25394", "Emil Boulanger", "/ThomasHS/thumb/WHS25394t.jpg", "Fiddle player Emil Boulanger played for dances since he was a boy. He played entirely by ear, and on a violin which he made himself. He was born in Dykesville (a Belgian community) and neither spoke or understood English."],
["WI.TaylorBros.091-51535", "Indians of North America", "/TaylorBros/tb1/thumb/091-51535t.jpg", "A Native American woman named Emma Decorah from Adams County, Wisconsin."],
["AfricaFocus.2422as10", "Amadu Karta, Weaver at Work in Bamako", "/24/thumb/2422as10t.jpg", "Mali, West Africa"],
["GlobalDesign.pw00016", "Temple of Heaven, Hall of Prayer for Good Harvests, Beijing", "/globaldesign1/thumb/pw00016t.jpg", "Emperor made sacrifices here twice a year to ensure good harvests. Rebuilt several times, last in 1890."],
["AfricaFocus.3510as15", "Carving a Pirogue (Canoe) from a Tree", "/35/thumb/3510as15t.jpg", "Senegal, West Africa"],
["AfricaFocus.2910as10", "Hausa Potter Carries Her Pots to Kiln to be Fired", "/29/thumb/2910as10t.jpg", "ca. 1980, Niger, West Africa"],
["AfricaFocus.1410as09", "Woman Making Water Pots", "/14/thumb/1410as09t.jpg"],
["EastAsian.tt0083a", "The Biyun Si (Temple of Azure Clouds)", "/Tianjin/thumb/tt0083at.jpg", "A group of foreigners are visiting the famous Biyun Si (Temple of Azure Clouds) 碧雲寺 located at Xiangshan(Fragrant Hill) 香山, a popular excursion place to the west of Beijing 北京."],
["Zoology.z0082", "Great Egret (Casmerodius albus)", "/MmBib/Galapagos/thumb/z0082t.jpg", "Great Egret on the grounds of the Hotel Galápagos."],
["UW.UWArchives.040502as065", "Law students' halftime cane toss", "/UWArchives/thumb/040502as065t.jpg", "Law students' halftime cane toss during the Homecoming game at the University of Wisconsin--Madison. Tradition has it that if the law student is successful in tossing his/her cane over the goal post, he/she will win his/her first case."],
["WI.zb3g003", "1196, in winter quarters, Reeds, Minn.", "/GreatLakes/SHSW/Batch04/thumb/zb3g003t.jpg", "Ship: Hiram Price (constructed 1867). Black and white postcard shows nine rafters wintering at Reed's Landing, Minnesota."],
["WI.BelgAmrCol.0836b", "King of Belgium, 1951-1993", "/belgian/belgian2/thumb/0836bt.jpg", "King Baudoin of Belgium"],
["GlobalDesign.pw00359", "Dragon Wall with Moon Gate", "/globaldesign1/thumb/pw00359t.jpg", "Curved dragon wall with classic moon gate opening frames a 'borrowed view' in a Chinese scholar's garden. Borrowed views are living pictures in Chinese gardens"],
["EcoNatRes.KlineV.0281", "Garden spider on its web", "/KlineV/Kline1/thumb/0281t.jpg"],
["DLDecArts.Ceramics..198600201", "Plate", "/Ceramics/thumb/198600201t.jpg", "ca. 1755. The plate is press-molded and has in the central reserve a ring of nine small nearly oval stilt marks. Scratch blue decoration includes a crowned lion within a border consisting of cross-hatched arches and pointed motifs composed of graduated nearly parallel lines."],
["WiscFolkSong.WHS25399", "Man with pipe", "/ThomasHS/thumb/WHS25399t.jpg", "Probably Robert A. Steinbach (b.1887?), a singer of German folk songs, who recorded for song collector Helene Stratman-Thomas."],
["SoHECent.jec113", "Women's Short Course", "/001/thumb/jec113t.jpg", "A photograph of a lecture at the 1923 Women's Short Course. These week-long courses were held annually for Wisconsin farm women to teach them about nutrition, clothing, child health and home management."],
["AfricaFocus.5003as26", "Lozi Women Applying Mud and Dung Stucco to Walls of House in Barotseland", "/50/thumb/5003as26t.jpg"],
["EastAsian.hw0019a", "The Xunxiang meditation patrol makes a circuit holding the board next to his ear", "/welch/thumb/hw0019at.jpg", "During the sitting meditation session, the Xunxiang 巡香 meditation patrol holds the board next to his ear with the right hand."],
["PBO.pbw00405", "The Odd-fellows' offering, for 1854", "/MmBib/pbw004xx/thumb/pbw00405f01t.jpg", "Red ribbed-morocco-grain cloth. Gold stamping on front and spine. Blind stamping on back. Endpapers colored yellow. All gilt."],
["AfricaFocus.3510as14", "Boy playing with father's wood-carving tools", "/35/thumb/3510as14t.jpg", "Senegal, West Africa"],
["Arts.DrinkingHorn01N35.220", "Norwegian drinking horn", "/MmBib/FolkFigures/thumb/DrinkingHorn01N35.220t.jpg", "Silver drinking horn given to Prof. R.B. Anderson by the Danish government for his translations of the Icelandic Sagas."],
["History.WWIArchives.0098", "Chaumont", "/MmBib/WWI/thumb/0098t.jpg", "Commune of Chaumont, Haute-Marne, France during World War I"],
["WI.TaylorBros.462-52154", "Military boxing event", "/TaylorBros/tb2/thumb/462-52154t.jpg", "Military boxing event in Wisconsin"],
["UW.UWArchives.dn04050603", "Football program for Wisconsin-Chicago game, 1928", "/UWArchives/thumb/dn04050603t.jpg", "Cover of the program for the Homecoming game between Wisconsin and the University of Chicago, November 10, 1928 (Wisconsin 25, Chicago 0)."],
["UW.UWArchives.040502as162", "Riflery team captains", "/UWArchives/thumb/040502as162t.jpg", "The captains of the University of Wisconsin--Madison's riflery team."],
["SEAiT.Laos.03022c", "Mekong River port, summer", "/Halpern03/thumb/03022ct.jpg", "In 1957 the Luang Prabang town port was quite a small presence on the Mekong and reflected the town's closeness to the surrounding countryside."],
["SEAiT.Philippines.ph00511", "Opium den, Malinta Street, Manila, early 1900s", "/lc/thumb/ph00511t.jpg"],
["WI.HomeFront.300049", "Spencer Tracy on the Icefish", "/MmBib/HomeFront/thumb/300049t.jpg", "Actor Spencer Tracy looks down as he descends into (or emerges from) the hatch of the submarine Icefish during a visit to the Manitowoc Shipbuilding Company on May 16, 1944. The Icefish, one of twenty-eight submarines built by Manitowoc Shipbuilding Company, had been launched February 20, 1944 and would be commissioned June 10, 1944"],
["Science.2-4-1-1.3", "Cut corn grain treated with concentrated nitric acid and then by ammonium hydroxide stained orange for protein", "/GenBot/GroupA01_09/thumb/2-4-1-1.3t.jpg", "What is commonly considered a seed in grasses (family Poaceae) is botanically a fruit. Specifically this fruit is a caryopsis. A caryopsis is a fruit that is dry and indehiscent and is firmly joined at all points to the underlying seed. All grains are of this fruit type and include rye, wheat, corn, barley, rice, and oats. The fruit makes up the bran of the grain. The embryo is the germ of the grain. The endosperm of the seed provides us with white rice and the refined white flour of wheat."],
["PBO.pba00763", "In ghostly Japan", "/MmBib/pba007xx/thumb/pba00763o01t.jpg", "Blue ungrained-cloth. Gold, blue, and gray stamping on front. Gold and blue stamping on spine. Blue and gray stamping on back. Top gilt."],
["DLDecArts.Ceramics.198600101", "Bear-baiting jug", "/Ceramics/thumb/198600101t.jpg", "The jug is thrown and its head, with flattened ball eyes and applied ears, is removable for use as a cup. The bear's appendages and the dog are hand-formed."],
["DLDecArts.1954.11", "America septentrionalis", "/MmBib/ChipPrints/thumb/1954.11t.jpg", "Engraving in black with hand coloring and gilding on paper. Inscribed \"AMERICA / SEPTENTRIO - / NALIS.\" in plate, in image, ul. Inscribed \"AMSTELODAMI, / Excudit Joannes Janssonius.\" in plate, in image, ll."],
["EastAsian.tt0022a", "Chinese soldiers led by an officer carrying a machine gun", "/Tianjin/thumb/tt0022at.jpg", "A group of Chinese soldiers and an officer, viewed from the side, with rifles and a machine gun. Soldiers are carrying blankets on their backs. The season is probably either late autumn or early winter."],
["EcoNatRes.KlineV.1142", "Adiantum pedatum, Baxter's Hollow, State Natural Area", "/KlineV/Kline3/thumb/1142t.jpg"],
["History.WWIArchives.0180", "Am Moscovul Reiserle beim Aufstieg", "/MmBib/WWI/thumb/0180t.jpg"],
["AfricaFocus.5107as02", "Victoria Falls", "/51/thumb/5107as02t.jpg", "Victoria Falls is on the Zambezi River by the border with Zambia. It is a major tourist site which attracts international tourists for the scenery, and for white water rafting and other water sports."],
["PBO.pba02297", "Japan: an attempt at interpretation", "/MmBib/pba022xx/thumb/pba02297e01t.jpg", "Gray vermiform-grain cloth. The wave from one hundred views of Fuji by Hokusai."],
["Arts.Tankard04N35.380", "Norwegian tankard", "/MmBib/FolkFigures/thumb/Tankard01N35.380t.jpg", "Wooden ale tankard with beaver thumblift and animal form legs and handle."],
["DLDecArts.Ceramics.197000101", "Bear-baiting jug", "/Ceramics/thumb/197000101t.jpg", "The small bear-bating jug is thrown and rouletted and has a removable head usable as a cup and has an extruded strap handle. The bear's eyes, ears, arms (replaced?), feet, and the dog and chain are formed by hand."],
["GlobalDesign.bg00144", "Bathroom with extensive tile work", "/globaldesign1/thumb/bg00144t.jpg", "Moroccan-style, island of Ibiza"],
["DLDecArts.1983.03", "Plan of the operations of General Washington against the Kings Troops in New Jersey", "/MmBib/ChipPrints/thumb/1983.03t.jpg", "Plan of the operations of General Washington against the Kings Troops in New Jersey. Engraving in black with hand coloring in blue, green, red and brown on paper."],
["EastAsian.tt0094a", "Distant view of Yuquan Shan Ta (Jade Fountain Hill Pagoda)", "/Tianjin/thumb/tt0094at.jpg", "A clear distant view of Yuquan Shan Ta (Jade Fountain Hill Pagoda) 玉泉山塔 taken from the stone steps leading to the higher building of Zhongxiang Jie (World of Abundant Fragrance) 眾香界, Yihe Yuan (Summer Palace) 頤和園, on a crisp late summer or early autumn day"],
["EcoNatRes.KlineV.0064", "Aerial view of glacially-formed lakes", "/KlineV/Kline1/thumb/0064t.jpg", "View of lakes typical of previously glaciated terrain in northern Wisconsin"],
["History.WWIArchives.0148", "Das Schulhaus i. Bernweiler i. Els.", "/MmBib/WWI/thumb/0148t.jpg"],
["PBO.pba00056", "Warwickshire lad : the story of the boyhood of William Shakespeare", "/MmBib/pba000xx/thumb/pba00056f01t.jpg", "Warwickshire lad : the story of the boyhood of William Shakespeare. Signed binding: D and D reversed, lower right quadrant. Red ungrained cloth. Gold and cream stamping on front. Cream stamping on spine. No decoration on back."],
["Science.4-3.9", "Composite of the tissue of ripe and unripe red pepper and Jerusalem cherry fruits", "/GenBot/GroupA01_09/thumb/4-3.9t.jpg", "Plastids can transform from one form into another. In the case of these two fruits, the chloroplasts in the green fruit develop into the chromoplasts of the ripe fruit."],
["SEAiT.Bruner.ph30038", "Bruner's house, Echague, P.I.", "/bruner/thumb/ph30038t.jpg", "Dr. William Jones' killers in the custody of Filipino troops."],
["SoHECent.gmz005", "The rat room at Yale", "/001/thumb/gmz005t.jpg", "According to Helen Parsons in a letter she wrote to the UW Home Economics Department while she was at Yale, \"No food major needs to be told that this is the 'rat room.'\""],
["Zoology.z0073", "Marine Iguana <em>(Amblyrhynchus cristatus)</em>", "/MmBib/Galapagos/thumb/z0073t.jpg", "Marine Iguana <em>(Amblyrhynchus cristatus)</em>, Ecuador"],
["WI.bls0699", "Dells of Wisconsin Devils Inkstand", "/MmBib/BrittinghamImgs/BLS1080/thumb/bls0699t.jpg", "The Devil's Inkstand, a rock formation in the water at the Wisconsin Dells."],
["WiscFolkSong.WHS25204", "Ho-Chunk performers", "/ThomasHS/thumb/WHS25204t.jpg", "Either Mr. and Mrs. James Hawkins or Henry Thunder and Stella Stacy at Winnebago (HoChunk) Indian Village."],
["PBO.pbw00449", "The Freemason's annual: a gift for all seasons, with new and elegant illustrations", "/MmBib/pbw004xx/thumb/pbw00449f01t.jpg", "Blue ribbed-morocco-grain cloth. Gold, red, orange, yellow, green, and tan stamping on front. Gold, orange, green, tan, and brown stamping on spine. Blind, gold, red, orange, yellow, green, and brown stamping on back. Endpapers colored yellow. All gilt."],
["SEAiT.Philippines.ph00930", "Bombs dropped in Manila, 1944", "/nara/thumb/ph00930t.jpg", "2000 lb. bomb dropped on Manila, 1944."],
["Zoology.z0001", "Volcanic Eruption", "/MmBib/Galapagos/thumb/z0001t.jpg", "Volcanic Eruption. Picture taken from tourist ship off the coast of Isabela."],
["UW.UWArchives.031212as03", "Protest on Bascom Hill with tear gas", "/UWArchives/thumb/031212as03t.jpg", "Student protesters with tear gas on Bascom Hill at the University of Wisconsin--Madison campus."],
["http://digicoll.library.wisc.edu/cgi-bin/HumanEcol/HumanEcol-idx?type=turn&entity=HumanEcol.SixLitCooks.p0008&id=HumanEcol.SixLitCooks&isize=M", "Six little cooks, or, Aunt Jane's cooking class (1877)", "http://images.library.wisc.edu/HumanEcol/EFacs/ChildHomeEc/SixLitCooks/thumb/0008.jpg", "", "EFacs"],
["http://digicoll.library.wisc.edu/cgi-bin/WI/WI-idx?type=article&id=WI.FromFields&did=WI.FROMFIELDS.I0004", "Nature Writing", "http://images.library.wisc.edu/WI/EFacs/USAIN/FromFields/thumb/00000011.jpg", "", "EFacs"],
["http://digicoll.library.wisc.edu/cgi-bin/HistSciTech/HistSciTech-idx?type=article&id=HistSciTech.CompAnat&did=HISTSCITECH.0003.0003.0010", "Man, stag and antelope",  "http://images.library.wisc.edu/HistSciTech/EFacs/CompAnat/0010/thumb/PLATEVII.jpg", "", "EFacs"],
["http://digicoll.library.wisc.edu/cgi-bin/WI/WI-idx?type=article&did=WI.DIWKMO.I0001&id=WI.DiWKMO&isize=M", "Dairying in Wisconsin", "http://images.library.wisc.edu/WI/EFacs/USAIN/DiWKMO/thumb/00000001.jpg", "", "EFacs"],
["http://digicoll.library.wisc.edu/cgi-bin/DLDecArts/DLDecArts-idx?type=turn&entity=DLDecArts.BirdsNAStud.p0039&id=DLDecArts.BirdsNAStud&isize=", "Birds of North America", "http://images.library.wisc.edu/DLDecArts/EFacs/BirdsNAStud/thumb/0039.jpg", "", "EFacs"],
["http://digicoll.library.wisc.edu/cgi-bin/HistSciTech/HistSciTech-idx?type=div&did=HISTSCITECH.0011.0029.0006&isize=M", "The Shasta Daisy", "http://images.library.wisc.edu/HistSciTech/EFacs/Burbank/Burbank02/thumb/0016.jpg", "", "EFacs"],
["http://digicoll.library.wisc.edu/cgi-bin/HistSciTech/HistSciTech-idx?type=turn&entity=HistSciTech000300030021&id=HistSciTech.CompAnat&isize=", "A comparitive view of the human and animal frame", "http://images.library.wisc.edu/HistSciTech/EFacs/CompAnat/0009/thumb/PLATEVI.jpg", "", "EFacs"],
["http://digicoll.library.wisc.edu/cgi-bin/HistSciTech/HistSciTech-idx?type=article&did=HISTSCITECH.0006.0017.0002&id=HistSciTech.Bestiary&isize=M", "The Book of Beasts", "http://images.library.wisc.edu/HistSciTech/EFacs/Bestiary/thumb/WHITE001.jpg", "", "EFacs"],
["http://digicoll.library.wisc.edu/cgi-bin/HistSciTech/HistSciTech-idx?type=turn&entity=HistSciTech001503280151&id=HistSciTech.Jonstonus&isize=", "A description of the nature of four-footed beasts", "http://images.library.wisc.edu/HistSciTech/EFacs/Jonstonus/thumb/0151.jpg", "", "EFacs"],
["http://digicoll.library.wisc.edu/cgi-bin/WI/WI-idx?type=turn&id=WI.AtlasDoorCo&entity=WI.AtlasDoorCo.p0007&isize=L", "Atlas of Door County, Wisconsin (1914)", "http://images.library.wisc.edu/awareImageServer/imageserver?collection=WI&resource=EFacs/NicoletLocHist/AtlasDoorCo/reference/0007.jp2&size=T&entity=WI.AtlasDoorCo.p0007", "", "EFacs"],
["http://digicoll.library.wisc.edu/cgi-bin/Arts/Arts-idx?type=turn&id=Arts.ArtsSocv07i2&entity=Arts.ArtsSocv07i2.p0001&isize=L", "Arts in Society: The Electric Generation", "http://images.library.wisc.edu/awareImageServer/imageserver?collection=Arts&resource=EFacs/ArtsSoc/ArtsSocv07i2/reference/0001.jp2&size=T&entity=Arts.ArtsSocv07i2.p0001", "", "EFacs"],
["http://digicoll.library.wisc.edu/cgi-bin/Arts/Arts-idx?type=div&did=ARTS.BARTONRURAL.I0003&isize=L&title=Rural%20artists%20of%20Wisconsin%2C%20p.%20%5Biv%5D", "Harvest Time", "http://images.library.wisc.edu/awareImageServer/imageserver?collection=Arts&resource=EFacs/BartonRural/reference/0010.jp2&size=T&entity=Arts.BartonRural.p0010", "Oil painting by Lois Ireland", "EFacs"]
];
// BAD: ["UW.UWArchives.CLP-A0034", "Aerial UW-Madison, ca. 1980-1989"],
// BAD (but large is good): ["UW.UWArchives.040502as062", "Bill Sagal, the first human Bucky Badger mascot", "/UWArchives/thumbs/040502as062t.jpg", "Bill Sagal, the first human Bucky Badger mascot. He is assisted by Bill Sachse and Connie Conrad, who constructed \"Bucky.\""],
// BAD (but large is good): ["EcoNatRes.LeopoldPapers.leop0198", "Charred contents of Leopold's wallet",  "/LeopoldPapers/thumb/leop0198t.jpg", "Note: Leopold died of a heart attack while fighting a grass fire near the Shack"],
// BAD (not found) ["UW.CLP-A0141", "Plan, elevation, Memorial Union, ca. 1920-1925"],
// EFACS: ["WI.AtlasDoorCo"], 
// <a href="http://digicoll.library.wisc.edu/cgi-bin/Arts/Arts-idx?type=article&amp;did=ARTS.0001.0009.0001&amp;isize=M"> <img src="graphics/ImageOfDay/image120.jpg" alt="Image Of the Day"/></a>
// <p class="caption"><a href="http://digicoll.library.wisc.edu/cgi-bin/Arts/Arts-idx?type=article&amp;did=ARTS.0001.0009.0001&amp;isize=M">Arts in society</a></p>
//<a href="http://digicoll.library.wisc.edu/cgi-bin/HistSciTech/HistSciTech-idx?type=turn&amp;entity=HistSciTech000900240008&amp;isize=S"> <img src="graphics/ImageOfDay/image225.jpg" alt="Image Of the Day"/></a>
//<p class="caption"><a href="http://digicoll.library.wisc.edu/cgi-bin/HistSciTech/HistSciTech-idx?type=turn&amp;entity=HistSciTech000900240008&amp;isize=S">Cyclopedia</a></p>

var collectionNames={"AfricaFocus":"Africa Focus: Sights and Sounds of a Continent", "Arts":"The Arts Collection", "DLDecArts":"Digital Library for the Decorative Arts and Material Culture", "EastAsian":"The East Asian Collection", "EcoNatRes":"The Ecology and Natural Resources Collection", "GlobalDesign":"Global Perspectives on Design and Culture", "History":"The History Collection", "HistSciTech":"The History of Science and Technology", "HumanEcol":"The Human Ecology Collection", "PBO":"Publishers' Bindings Online 1815 - 1930: The Art of Books", "Science":"The Science Collection", "SEAiT":"SouthEast Asian images & Texts", "SoHECent":"Home Economics to Human Ecology: A Centennial History", "UW":"The University of Wisconsin Collection", "WI":"The State of Wisconsin Collection", "WiscFolkSong":"Wisconsin Folksong Collection, 1937-1946", "WiscSheetMus":"The Wisconsin Sheet Music Database", "Zoology":"University of Wisconsin-Madison Zoological Museum Collection"};

jQuery.preloadImages = function() {
  for(var i = 0; i < arguments.length; i++) {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

var nextImageID;
function createSingleFeaturedImage(random) {
	if(random == false) {
		var today = new Date();
		var dayOfYear = today.getDOY();
		if (dayOfYear > images.length) {
			imageID = dayOfYear - images.length;
			if(imageID > images.length) {
				imageID = imageID - images.length;
			}
		} 
		nextImageID = Math.floor(Math.random() * images.length);
	} else {
		imageID = nextImageID;
		nextImageID = Math.floor(Math.random() * images.length);
	}
	
	// preload next image for smooth animation	
	var nextImage = images[nextImageID];
	if(nextImage[4] == "EFacs") {
		var nextThumbnailURL = nextImage[2];
	} else { //MmBib
		var nextObjectID = nextImage[0];
		var nextCollection = nextObjectID.match(/^(.+?)\./)[1];
		var nextThumbnailPath = nextImage[2];
		var nextThumbnailURL = "http://digicoll.library.wisc.edu/" + nextCollection + "/data/images" + nextThumbnailPath;	
	}
	$.preloadImages(nextThumbnailURL);
	
	var currentImage = images[imageID];
	if(currentImage[3] != null) {
		var longCaption = currentImage[3];
	} else {
		var longCaption = "";
	}
	if(currentImage[4] == "EFacs") {
		var bibRecordURL = currentImage[0];
		var bibRecordLink = "<a href=\"" + bibRecordURL + "\">View Full Item Record</a>";
		var collection = bibRecordLink.match(/cgi-bin\/(.+?)\//)[1];
		if(collectionNames[collection] != null) {
			longCollectionName = collectionNames[collection];
		} else {
			longCollectionName = collection;
		}
		var thumbnailURL = currentImage[2];
		if(thumbnailURL.match(/jp2/)) {
			var largeImageURL = thumbnailURL.replace(/size=T/, "size=L");
		} else {
			var largeImageURL = thumbnailURL.replace(/thumb/, "L");
		}
	} else { // MmBib
		var currentObjectID = currentImage[0];
		var collection = currentObjectID.match(/^(.+?)\./)[1];
		var shortCaption = currentImage[1];
		var thumbnailPath = currentImage[2];
		var collection = currentObjectID.match(/^(.+?)\./)[1];
		var thumbnailURL = "http://digicoll.library.wisc.edu/" + collection + "/data/images" + thumbnailPath;
		var largeImagePath = thumbnailPath.replace(/t\.jpg/, "l.jpg");
		var largeImagePath = largeImagePath.replace(/thumb(s?)/, "large");
		var largeImageURL = "http://digicoll.library.wisc.edu/" + collection + "/data/images" + largeImagePath;
		if(collectionNames[collection] != null) {
			longCollectionName = collectionNames[collection];
		} else {
			longCollectionName = collection;
		}
		var bibRecordLink = "<a href=\"http://digital.library.wisc.edu/1711.dl/SSRecIDSearch?repl1=" + collection + "&repl2=" + currentObjectID + ".bib\">View Full Item Record" + "</a>";
		var thumbnailLink = "<a href=\"http://digital.library.wisc.edu/1711.dl/SSRecIDSearch?repl1=" + collection + "&repl2=" + currentObjectID + ".bib\"><img src=\"http://digicoll.library.wisc.edu/" + collection + "/data/images/" + thumbnailPath + "\"/></a>";
	}
	var collectionLink = "<a href=\"http://digicoll.library.wisc.edu/" + collection + "\">View " + longCollectionName + "</a>";	
	var thumbnail = ("<a href=\"" + largeImageURL + "\" class=\"highslide\" onclick=\"return hs.expand(this, { slideshowGroup: 'thumbnail-group' })\"><p id=\"imageOfDayThumbnail\"><img src=\"" + thumbnailURL + "\" alt=\"" + shortCaption + "\" title=\"Click to enlarge\"/></p></a><div class=\"highslide-heading\">" + shortCaption + "<\/div><div class=\'highslide-caption\'>" + longCaption + "<p class=\"links\">" + bibRecordLink + " &bull; " + collectionLink + "</p></div>");	
	var textLink = "<a id=\"imageOfDayTitle\" style=\"color: black\" href=\"" + largeImageURL + "\" class=\"highslide\" onclick=\"return hs.expand(this, { slideshowGroup: 'text-link-group' })\"><p>" + shortCaption + "<p></a><div class=\"highslide-heading\">" + shortCaption + "<\/div><div class=\'highslide-caption\'>" + longCaption + "<p class=\"links\">" + bibRecordLink + " &bull; " + collectionLink + "</p></div>";
	
	if(random == true) {
		$("#imageOfDay").fadeOut("normal", function() {
			$("#imageOfDay").html(thumbnail + textLink).fadeIn("normal");
		});
		$(".todaysImage").css("width", "auto");
	} else {
		$("#imageOfDay").html(thumbnail + textLink);
	}
	return false;
}

function createImageGallery() {
	document.write("<div id=\"imageCarousel-control\" class=\"imageCarousel-control\"></div>");
	document.write("<ul id=\"imageCarousel\" class=\"jcarousel-skin-tango\">");
	currentTableNum = 0;
	currentTableRowNum = 0;
	currentTableCellNum = 0;
	currentGalleryIndex = 1;
	for(i = 0; i < images.length; i++) {
		var currentImage = images[i];
		var currentObjectID = currentImage[0];
		var shortCaption = currentImage[1];
		if(currentImage[2] != null)
		 	var thumbnailPath = currentImage[2];
		else {
			var thumbnailPath = "http://whoops!";
		}
		if(currentImage[3] != null) {
			var longCaption = currentImage[3];
		} else {
			var longCaption = "";
		}
		if(currentImage[4] == "EFacs") {
			var bibRecordURL = currentImage[0];
			var bibRecordLink = "<a href=\"" + bibRecordURL + "\">View Full Item Record</a>"
			var collection = bibRecordLink.match(/cgi-bin\/(.+?)\//)[1];
			if(collectionNames[collection] != null) {
				longCollectionName = collectionNames[collection];
			} else {
				longCollectionName = collection;
			}
			var thumbnailURL = currentImage[2];
			if(thumbnailURL.match(/jp2/)) {
				var largeImageURL = thumbnailURL.replace(/size=T/, "size=L");
			} else {
				var largeImageURL = thumbnailURL.replace(/thumb/, "L");
			}			
			var thumbnailLink = "<a href=\"" + thumbnailURL + "\"></a>"
		} else { // MmBib
			var collection = currentObjectID.match(/^(.+?)\./)[1];
			var currentObjectID = currentImage[0];
			var shortCaption = currentImage[1];
			var thumbnailPath = currentImage[2];
			var collection = currentObjectID.match(/^(.+?)\./)[1];
			var thumbnailURL = "http://digicoll.library.wisc.edu/" + collection + "/data/images" + thumbnailPath;
			var largeImagePath = thumbnailPath.replace(/t\.jpg/, "l.jpg");
			var largeImagePath = largeImagePath.replace(/thumb(s?)/, "large");
			var largeImageURL = "http://digicoll.library.wisc.edu/" + collection + "/data/images" + largeImagePath;
			if(collectionNames[collection] != null) {
				longCollectionName = collectionNames[collection];
			} else {
				longCollectionName = collection;
			}
			var bibRecordLink = "<a href=\"http://digital.library.wisc.edu/1711.dl/SSRecIDSearch?repl1=" + collection + "&repl2=" + currentObjectID + ".bib\">View Full Item Record</a>";
			var thumbnailLink = "<a href=\"http://digital.library.wisc.edu/1711.dl/SSRecIDSearch?repl1=" + collection + "&repl2=" + currentObjectID + ".bib\"><img src=\"http://digicoll.library.wisc.edu/" + collection + "/data/images/" + thumbnailPath + "\"/></a>";
		}
		
		var collectionLink = "<a href=\"http://digicoll.library.wisc.edu/" + collection + "\">View " + longCollectionName + "</a>";	
		
		if(currentTableRowNum == 0 && currentTableCellNum == 0) {
			document.write("<li><table class=\"imageTable\">");
		}
		if(currentTableCellNum == 0) {
			document.write("<tr>");
		}
		document.write("<td width=\"25%\">")
		document.write("<a href=\"" + largeImageURL + "\" class=\"highslide\" onclick=\"return hs.expand(this, { slideshowGroup: 'thumbnail-group', wrapperClassName: '"+ currentGalleryIndex +"' })\"><img id=\"" + currentGalleryIndex + "\" src=\"" + thumbnailURL + "\" alt=\"" + shortCaption + "\" title=\"Click to enlarge\"/></a><div class=\"highslide-heading\">" + shortCaption + "<\/div><div class=\'highslide-caption\'>" + longCaption + "<p class=\"links\">" + bibRecordLink + " &bull; " + collectionLink + "</p></div><br/>");
		document.write("<a href=\"" + largeImageURL + "\" class=\"highslide\" onclick=\"return hs.expand(this, { slideshowGroup: 'text-link-group', wrapperClassName: '"+ currentGalleryIndex +"' })\">" + shortCaption + "</a><div class=\"highslide-heading\">" + shortCaption + "<\/div><div class=\'highslide-caption\'>" + longCaption + "<p class=\"links\">" + bibRecordLink + " &bull; " + collectionLink + "</p></div><br/>");
		document.write("</td>");
		if(currentTableCellNum == 3 || i == images.length-1)  {
			document.write("</tr>");
			currentTableCellNum = 0;
			if(currentTableRowNum == 2 || i == images.length-1) {
				document.write("</table></li>");
				currentTableRowNum = 0;
				currentTableNum++;
			} else {
				currentTableRowNum++;
			}
		} else {
			currentTableCellNum++;
		}
		currentGalleryIndex++;
	}
	document.write("</ul>");
	carouselControlsContent = ""
	for(i=0; i<currentTableNum;i++) {
		carouselControlsContent = carouselControlsContent += "<a class=\"pageNum\" href=\"#\">" + (i+1) + "</a>";
	}
	$('#imageCarousel-control').html("<a href=\"#\" id=\"mycarousel-prev\">&laquo; Prev</a>" + carouselControlsContent + "<a href=\"#\" id=\"mycarousel-next\">Next &raquo;</a>");
}