<!--

/*
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','\'Swatch 519-062\' sunglasses with interchangeable front, FMG, Swiss, 1993.');
messages[1] = new Array('02.jpg','\'Swans\' frame by Anglo-American Eyewear, before 1990.');
messages[2] = new Array('03.jpg','\'Skoot\' sunglasses by Oliver Goldsmith, manufactured in France, 1960s.');
messages[3] = new Array('04.jpg','\'Pterydactyl\' novelty sunglasses by Anglo-American Eyewear, English, early 1990s. (note: The type of winged dinosaur depicted is imaginary but more like a Pteranodon than a Pterodactyl since they didn\'t have pointy heads)');
messages[4] = new Array('05.jpg','\'Ghostbusters Glasses\' distributed by Fun-tastic, with battery-powered flashing eyes, made in China, c. 2001');
messages[5] = new Array('06.jpg','\'Halloween Blinking Glasses\' distributed by Fun-tastic, with battery-powered flashing red eyes and sound effect, made in China, 2001');
messages[6] = new Array('07.jpg',' Ladies\' fashion spectacles, black plastic laminate frame with augmentary petal-shaped flourishes, studded with imitation stones, very narrow pad bridge, reinforced drop-end sides, upswept eyes, lenses missing, probably 1960s?');
messages[7] = new Array('08.jpg','Ladies evening wear, black plastic acetate frame, keyform bridge, high joints with double pinning concealed by decorative adornment, drop-end sides slightly dipping at centre point to accommodate holders for auxiliary upright hair decorations, upswept eyes, no lenses, probably 1960s or 1970s.');
messages[8] = new Array('09.jpg','Cats-Eyes novelty folding spectacles, white plastic front articulated at bridge so as to fold shut into shape of cats\' face with ears, mouth and black nose, opens into semi-unfolded and fully unfolded positions, three charnier high joints, red plastic drop-end sides, egg-shaped eyes, early 1980s?');
messages[9] = new Array('10.jpg','Frog sunglasses by TYCS Enterprises Inc, made in China, 2004 (their range of \'Animal Sunglasses\' also included an alligator, flamingo, crab, dolphin, shark, dinosaur, giraffe, penguin and a polar bear.');
messages[10] = new Array('11.jpg','Flip-down fashionable sunglasses, Japan, 1960s');
messages[11] = new Array('12.jpg','Pilots goggles that are Type E-1 Dark Adaptation by American Optical Co., 1943');
messages[12] = new Array('13.jpg','\'Chelsea Set\' Model A Spectacles, triple laminate plastic frame, by Michael Selcott Designs, British, Mid-Late 20th c.');
messages[13] = new Array('14.jpg','Billiard spectacles. Dark brown and crystal two-tone polygonal shaped frame with clear upper rims, thick lugs with vertically pinned centre joints, reinforced drop-end sides which can be angled downward to bring spectacle front forward, no lenses, British, mid-late 20th c.');
messages[14] = new Array('15.jpg','\'Halex\' spectacles by Oliver Goldsmith, British, Mid-Late 20th c.');
messages[15] = new Array('16.jpg','\'Lips\' spectacles, by Anglo-American Eyewear, British, c.1982');
messages[16] = new Array('17.jpg','\'Look\' spectacles, by Anglo-American Eyewear, British, 1980s? (Certainly before 1990)');
messages[17] = new Array('18.jpg','Year 2000 Sun Spectacles, with glittered frame and rose-tinted lenses! European, 2000 or before');
messages[18] = new Array('19.jpg','Recumbent spectacles, plastic frame, prismatic lenses suspended from shaped horizontal plate with integral nose rest, Japanese, mid-late 20th c.)');
messages[19] = new Array('20.jpg','\'Zebra\' spectacles with canopy, possibly French, c.1950');
messages[20] = new Array('21.jpg','\'Dame Edna\'-type ladies eyeglasses, jeweled and feathered upswept eye rims, 1960s');
messages[21] = new Array('22.jpg','Sun spectacles, with green-tinted lenses, by Metzler, West German, 1970s?');
messages[22] = new Array('23.jpg','Bollé Sun Glasses by Thurgar Bollé (Succrs) Ltd of Wellingborough with Crookes lenses, English, 1950s.');
messages[23] = new Array('24.jpg','Plastic half eye spectacles (imitation shell) with unusual lenses, mid 20th c. It has been suggested that maybe the upper rims have warped and were originally shaped similarly to the top of the lenses, hence there were no gaps when new.');
messages[24] = new Array('25.jpg','Plastic spectacles for shop display, echoing Nuremberg Masterpiece frames, designed by Stanley Unger, English c.1950');
messages[25] = new Array('26.jpg','Make-up spectacles by Filos, Italian, mid-late 20th c.');
messages[26] = new Array('27.jpg','Make-up spectacles by Revlon (black plastic), date uncertain');
messages[27] = new Array('28.jpg','Spectacles with Electric Wipers, mid 20th c. (Possibly 1970s since similar designs were available then).');
messages[28] = new Array('29.jpg','\'Leaf\' sun spectacles by Stanley Unger, English, mid 20th c.');
messages[29] = new Array('30.jpg','\'Spectrix Laser Visor\' holographic lens spectacles by Lightrix, American, c.2000 (A novelty item NOT safe to use as sunglasses)');
messages[30] = new Array('31.jpg','\'Bicycle frame\' novelty spectacles, British c.1990?');
messages[31] = new Array('32.jpg','Ladies evening wear spectacles with imitation stones, French, 1950s');
messages[32] = new Array('33.jpg','Marked ERMA, Italy');
messages[33] = new Array('34.jpg','National Health Insurance Scheme plastic spectacles, (N.B. not National Health Spectacles, which were later), c.1937');
messages[34] = new Array('35.jpg','Unusual, decorative crystal plastic frame with internally laminated pink lace pattern, apparently circa 1940 (seems early?)');
messages[35] = new Array('36.jpg','Crystal and black laminated plastic (cellulose nitrate?) frame by Stanley Unger, English, yellow decorative pattern on front including crowned lions and ER monogram, must post-date 1952 and possibly made to mark the Coronation of 1953 or the Silver Jubilee of 1977?');
messages[36] = new Array('37.jpg','Spectacles with auxiliary half lens holders by General Optical Company Ltd., mid 20th c.');
messages[37] = new Array('38.jpg','STAR 432 Ladies Spectacles by Loris Azarro, yellow metal, black plastic upper rim hoods with diamante decorative pattern, French (Paris), late 20th c.');
messages[38] = new Array('39.jpg','\'Polymil\' semi-rimless metal spectacle frame, unusually-shaped blue-tinted plastic lenses, by Norville Optical of Gloucester, English, late 20th c.');
messages[39] = new Array('40.jpg','\'Mirabelle\' Spectacles by Les Fils D\'aime Lamy S.A. (FIDELA), imitation blonde shell, French, late 20th c.');
messages[40] = new Array('41.jpg','Half-eye spectacles, library frame glazed in lower portion only, probably British, mid-late 20th c.');
messages[41] = new Array('42.jpg','\'Nulook\' spectacles by Oliver Goldsmith, English, date uncertain.');
messages[42] = new Array('43.jpg','\'Sports\' Sun Spectacles, aviator-style, made in Taiwan, late 1970s?/early 1980s?');
messages[43] = new Array('44.jpg','\'Cameo\' spectacles by Norville Optical Group, English, late 20th c.');
messages[44] = new Array('45.jpg','Rimless spectacles with gold-filled brow bar mount supporting drilled lenses with reduced lower outward corners, c.1935.');
messages[45] = new Array('46.jpg','Plastic spectacles with gold-filled decorative trim, 1950s.');
messages[46] = new Array('47.jpg','\'Dalesman\' protective spectacles by Birch, British, 1970s.');
messages[47] = new Array('48.jpg','Mod 417 spectacles with dipping browbar bridge, by Silhouette, Austrian, 1980s.');
messages[48] = new Array('49.jpg','Mod 64 spectacles with low joints, by Silhouette, Austrian, late 20th c.');
messages[49] = new Array('50.jpg','Polymil semi-rimless spectacles supplied by Norville Optical Group, Britsh, late 20th c. This is a cataract lens version.');
messages[50] = new Array('51.jpg','Ladies spectacles by Polaroid, 1950s');
messages[51] = new Array('52.jpg','\'Odéon\' Spectacles by Anglo-American Eyewear, British/Italian, late 20th c. Intended to evoke the mood of 1920s cinema.');
messages[52] = new Array('53.jpg','Plastic lorgnette. mid-late 20th c.');
messages[53] = new Array('54.jpg','Plastic lorgnette. mid-late 20th c.');
messages[54] = new Array('55.jpg','Sun spectacles, French, mid-late 20th c.');
messages[55] = new Array('56.jpg','Ladies Sun Spectacles by Polaroid (UK) Ltd. British, mid-late 20th c. Includes Polaroid tinted lenses.');



////////////////////  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;
}

//-->




