<!--

/*
Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
Copyright 2002 by Sharon Paine
Visit http://www.dynamicdrive.com for this script
*/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

// resize fix for ns4
var origWidth, origHeight;
if (ns4) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= false;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 432;
var offX= 20;	// how far from mouse to show tip
var offY= 60; 
var tipFontFamily= "arial, helvetica, verdana, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "white";
var tipBgColor= "#669966"; 
var tipBorderColor= "#000080";
var tipBorderWidth= 2;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing: 
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array('01.jpg','4 lens protective, unusual silver cataract spectacles by Thomas Phelps of Holborn, 1825');
messages[1] = new Array('02.jpg','4 lens with green front and blue sides D-Spectacles by J.C., c.1830s');
messages[2] = new Array('03.jpg','4 lens, silver D-Specs with double-turnpin, LV & W, Birmingham, 1829, very rare');
messages[3] = new Array('04.jpg','Blued steel specs, square crank bridge, steel \'guillotine\', straight sides, oval c.1880');
messages[4] = new Array('05.jpg','Center lens, distance, outer quadrants, near vision similar Pergens-type multifocal specs, c.1840s');
messages[5] = new Array('06.jpg','Chinese spectacles, brass, green plano lenses, 2nd half 19th c.');
messages[6] = new Array('07.jpg','Chinese spectacles, tortoiseshell and nickel silver, late 18-early 19th c.');
messages[7] = new Array('08.jpg','Chinese, interesting pale colored horn, double hinged sides 2nd half 19th century');
messages[8] = new Array('09.jpg','Chinese, light tortoiseshell, early 19th century');
messages[9] = new Array('10.jpg','Chinese, tortoiseshell frame, dark tea-colored lenses with double-hinged sides.');
messages[10] = new Array('11.jpg','Excellent condition French K-bridge, solid gold specs, turnpin sides, marked J.L. and G18, 2nd quarter 19th century');
messages[11] = new Array('12.jpg','Folding English nose spectacles, light horn frame, mid-late 18th');
messages[12] = new Array('13.jpg','French fancy jeweled spring lorgnette, gilded brass, enameling, semi-precious stones, late 19th c.');
messages[13] = new Array('14.jpg','French folding lorgnette, gilded brass, mid 19th century and c.1860');
messages[14] = new Array('15.jpg','French or Italian long handled carved amber tortoiseshell, c.1860');
messages[15] = new Array('16.jpg','Holding the unique Dr. Johnson tortoiseshell spectacles with right-angled sides late 18th century');
messages[16] = new Array('17.jpg','Industrial shot-blasting spectacles with very thick quartz lenses (4) and protective sides');
messages[17] = new Array('18.jpg','Martins Margins with temple sides, circa 1770s');
messages[18] = new Array('19.jpg','\'Mikros\' patent finger-piece pince-nez, French-made under license from AO, c.1915');
messages[19] = new Array('20.jpg','Ornate brass frame, frosted lenses, turnpin sides first quarter 19th century');
messages[20] = new Array('21.jpg','Ornate French lorgnette with unusual frame, for a female after 1850');
messages[21] = new Array('22.jpg','Ornate handle spring lorgnette, gold and enamel, c. 1850');
messages[22] = new Array('23.jpg','Oval blue tinted steel, temple sides with ring ends, c.1800');
messages[23] = new Array('24.jpg','Pince-nez spectacles with detachable sides, c.1900 with bar-spring and protective sides');
messages[24] = new Array('25.jpg','Pinhole shooting spectacles, blued steel, 1876');
messages[25] = new Array('26.jpg','Protective goggles with steel frame, Fieuzal green lenses, c.1890');
messages[26] = new Array('27.jpg','Protective goggles, steel frame, yellow sodium tint lenses, c.1935');
messages[27] = new Array('28.jpg','Round frame shell, tinted, straight sides, fenestrated padded ends, second half 18th c.');
messages[28] = new Array('29.jpg','Round frame tortoiseshell spectacles, short straight sides with round padded ends, c.1800');
messages[29] = new Array('30.jpg','Silver (not hallmarked) spectacles, round frame, short sides with ring ends, c.1790');
messages[30] = new Array('31.jpg','Silver small oval frame, very wide nose-bridge (not hallmarked) spectacles c.1825');
messages[31] = new Array('32.jpg','Silver spectacles, crank bridge, small round eye, made by Maryann Holmes, c.1828');
messages[32] = new Array('33.jpg','Silver round frame, wide bridge, c. 1800');
messages[33] = new Array('34.jpg','Silver temple spectacles, very large finials, late 18th century');
messages[34] = new Array('35.jpg','Steel round eye spectacles, Ayscough sides with large ring ends, c.1790');
messages[35] = new Array('36.jpg','Steel round eye spectacles, Ayscough sides, green tint, c.1780');
messages[36] = new Array('37.jpg','Tortoiseshell and silver lorgnette, circa 1830-1860.');
messages[37] = new Array('38.jpg','Tortoiseshell spectacles, unusual sinuous sides, 1800-1820');
messages[38] = new Array('39.jpg','Twin-Spec 4 lens with flip downs by M. Wiseman & Company Ltd, London c.1935');
messages[39] = new Array('40.jpg','Unique solid gold wig spectacles with unusual ‘spoked’ ring ends, 1780');
messages[40] = new Array('41.jpg','Unusual round frame, shell lorgnette, medium-length handle, 1900-1920');
messages[41] = new Array('42.jpg','Silver double turnpin, total wrap-around, RM of Birmingham 1868-75, very unusual');
messages[42] = new Array('43.jpg','Unusual solid gold pince-nez spectacles with curl sides. Oxford-type. c.1920');
messages[43] = new Array('44.jpg','Very fashionable Goldoni-type Venetian sun spectacles, horn, c.1790');
messages[44] = new Array('45.jpg','Very ornate double lorgnette by Asprey, amber shell, 1900-1910');
messages[45] = new Array('46.jpg','Very unusual protective D-Spectacles missing silk eye shades, c.1830');
messages[46] = new Array('47.jpg','Ornamental nose spectacles, German nickel silver frame without sides, unusually shaped eyes and wavy glass lenses, Italian, 18th c., unique');
messages[47] = new Array('48.jpg','Blued steel oval frame, hinged X-bridge, No pads. Centre joints. Very short sides with spatula ends, after 1850');
messages[48] = new Array('49.jpg','Burt & Willard\'s folding oval blued steel frame, center-hinged crank bridge, short straight sides with white \'pearl\' round pads at ends, 1859 Patent');
messages[49] = new Array('50.jpg','Silver oval frame, hinged nose bridge hallmarked IH, possibly London, Ayscough sides with oval loops as finials, end of the 18th century');
messages[50] = new Array('51.jpg','Iron frame, oval green Fieuzal lenses, hinged nose bridge. Ayscough sides with oval loops at ends, end of the 18th century (as seen on one of the BOA Museum postcards)');
messages[51] = new Array('52.jpg','Reversible, non-folding, double spectacles with oval steel frame, connected at centre of bridge (forming an X-bridge) and at joints, mid to late 19th century, unique');
messages[52] = new Array('53.jpg','Round frame tortoiseshell reversible frame, no lenses, X-bridge, elongated, split centre joints, pinned, short straight sides with large ring ends, first quarter 19th century?');
messages[53] = new Array('54.jpg','Fully reversible, tortoiseshell frame, green tinted oval lenses, X-bridge, turnpin sides with pointed ends, note the holes drilled into lateral front and anterior sides for silk side visors (these are missing), around 1825?');
messages[54] = new Array('55.jpg','Cataract spectacles, 10K gold frame, curl sides, wide aluminum margins, London Optical Company, 1920s');

////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
  }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles for all but ns4. 
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = (ns4)? document.tipDiv: tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		if (ns4) document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (ns4) {
		var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + curBgColor + '"width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + messages[num][0] + midStr + '<center>' + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr + '</td></tr></table></td></tr></table>';
		tooltip.write(tip);
		tooltip.close();
	} else if (ie4||ie5||ns5) {
		var tip = startStr + messages[num][0] + midStr + '<center>' + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
	mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (!tipFollowMouse) {
		mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
		mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
	var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";
	else tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
	else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

//-->



