var rn = 0;
var al = archives.length;
var borderpics = 66;
var rnTemp;
rnTemp = Math.floor(Math.random()*al);
rn = archives[rnTemp];	
var imgsrc = '<img src="http://library.wellcome.ac.uk/images/random/' + rn + '_random.jpg" border="0" alt="">';
var hintsrc = '<img src="http://library.wellcome.ac.uk/images/random/' + rn + '_random.gif" border="0" alt="">';

if (rn<=borderpics){
  document.write('<table width="50" border="0" cellspacing="0" cellpadding="0"><tr bgcolor="#7078bd"  width="1" height="1"><td colspan="5" height="1"><img src="http://library.wellcome.ac.uk/images/spacer.gif"  width="1" height="1" border="0"></td></tr>');
  document.write('<tr><td rowspan="3" bgcolor="#7078bd"  width="1" height="1"><img src="http://library.wellcome.ac.uk/images/spacer.gif"  width="1" height="1" border="0"></td><td colspan="3" height="10"><img src="http://library.wellcome.ac.uk/images/spacer.gif"  width="1" height="10" border="0"></td>');
  document.write('<td rowspan="3" bgcolor="#7078bd"  width="1" height="1"><img src="http://library.wellcome.ac.uk/images/spacer.gif"  width="1" height="1" border="0"></td></tr>');
  document.write('<tr><td width="10" height="10"><img src="http://library.wellcome.ac.uk/images/spacer.gif"  width="10" height="1" border="0"></td><td width="10" height="10">');
}
//
if(!document.layers)
{
	var linkAddress
	if (JSLibraryCurrentNodeId == 254) {
		linkAddress = "/doc_wtd026745.html";
	} else {
		linkAddress = "javascript:;";
	}
	document.write('<a href="' + linkAddress + '" onmouseover="showhint()" onmouseout="hidehint()" onfocus="if(this.blur)this.blur();" style="cursor:nw-resize">');
}

document.write(imgsrc);

if(!document.layers)
{
	document.write('</a>');
}
//
if (rn<=borderpics){
  document.write('</a></td><td width="10" height="10"><img src="http://library.wellcome.ac.uk/images/spacer.gif"  width="10" height="1" border="0"></td></tr>');
  document.write('<tr><td colspan="3" height="10"><img src="http://library.wellcome.ac.uk/images/spacer.gif"  width="1" height="10" border="0"></td></tr>');
  document.write('<tr bgcolor="#7078bd"  width="1" height="1"><td colspan="5"><img src="http://library.wellcome.ac.uk/images/spacer.gif"  width="1" height="1" border="0"></td></tr></table>');
}
//
//
if(!document.layers)document.write('<div id="c" style="position:absolute; left:41px; top:-348px; width: 200px; visibility: visible; z-index: 677;">' + hintsrc + '</div>');
////////////////////////////////////////////////////////
function nsmouse(evnt){
  xpos = evnt.pageX;
  ypos = evnt.pageY;
}
//if(document.layers || (document.getElementById && !document.all)) {
if(document.getElementById && !document.all) {
window.captureEvents(Event.MOUSEMOVE);
window.onmousemove = nsmouse;
}
////////////////////////////////////////////////////////
var idc = "c";
////////////////////////////////////////////////////////
if(document.getElementById) { 
    pCaption = document.getElementById(idc);
} else if (document.all) {
    pCaption = document.all[idc];
} else if (document.layers) {
    pCaption = document.layers[idc];
}
////////////////////////////////////////////////////////
function showhint() {
  if (pCaption.style) {
     if(document.getElementById && !document.all) { 
       pCaption.style.top = ypos + "px";
       pCaption.style.left = xpos + "px";
     } else if (document.all) {
       pCaption.style.top = event.clientY + document.body.scrollTop + "px";
       pCaption.style.left = event.clientX + document.body.scrollLeft + "px"; 
     }
  } else {
    pCaption.top = ypos;
    pCaption.left = xpos;
  }
}
////////////////////////////////////////////////////////
function hidehint() {
  if (pCaption.style) {
    pCaption.style.top = -400 + "px";
  } else {
    pCaption.top = -400;
  }
}
////////////////////////////////////////////////////////