// slide show

var this_slide = 1  // the slide we're on at any given moment -- start with #1
var slide_count = 3  // total number of slides we show
var link_string = new Array;
var link_url = new Array;
var link_title = new Array;
var image_buffer = new Array;
var shuffle_save = new Array;

var interval = 8000; // time for each image

  if (document.images) // pre-load to make the operation smoother
        {
        image_buffer[1] = new Image;
        image_buffer[2] = new Image;
        image_buffer[3] = new Image;
        image_buffer[4] = new Image;
        image_buffer[5] = new Image;
        }

	function stopError()
	{
  	return true;
	}

	window.onerror = stopError;

if (document.images) // continuing pre-load
{

	set = 1;
	shuffle = Math.round(Math.random() * 8) + 1;
	shuffle_save[set] = shuffle;

	if (shuffle == 1) 
		{
		image_buffer[set].src = "slideshow-images/il_uranus.jpg";
		link_url[set] = "http://www.curiousnotions.com/cgi"
		link_title[set] = "Uranus (Autodesk Maya)";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Uranus<br>(Autodesk&nbsp;Maya)</a>";
		}
	if (shuffle == 2) 
		{
		image_buffer[set].src = "slideshow-images/il_mars-phobos.jpg";
		link_url[set] = "http://www.curiousnotions.com/cgi"
		link_title[set] = "Mars & Phobos (Autodesk Maya)";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Mars & Phobos<br>(Autodesk&nbsp;Maya)</a>";
		}
	if (shuffle == 3) 
		{
		image_buffer[set].src = "slideshow-images/il_saturn-enceladus.jpg";
		link_url[set] = "http://www.curiousnotions.com/cgi"
		link_title[set] = "Saturn & Enceladus (Autodesk Maya)";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Saturn & Enceladus<br>(Autodesk&nbsp;Maya)</a>";
		}
	if (shuffle == 4) 
		{
		image_buffer[set].src = "slideshow-images/il_jupiter-amalthea.jpg";
		link_url[set] = "http://www.curiousnotions.com/cgi"
		link_title[set] = "Jupiter & Amalthea (Autodesk Maya)";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Amalthea (dot at left) & Jupiter<br>(Autodesk&nbsp;Maya)</a>";
		}
	if (shuffle == 5) 
		{
		image_buffer[set].src = "slideshow-images/il_earth-africa.jpg";
		link_url[set] = "http://www.curiousnotions.com/cgi"
		link_title[set] = "The Earth (Autodesk Maya)";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>The Earth<br>(Autodesk&nbsp;Maya)</a>";
		}
	if (shuffle == 6) 
		{
		image_buffer[set].src = "slideshow-images/il_neptune.jpg";
		link_url[set] = "http://www.curiousnotions.com/cgi"
		link_title[set] = "Neptune (Autodesk Maya)";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Neptune<br>(Autodesk&nbsp;Maya)</a>";
		}
	if (shuffle == 7) 
		{
		image_buffer[set].src = "slideshow-images/il_tethys.jpg";
		link_url[set] = "http://www.curiousnotions.com/cgi"
		link_title[set] = "Tethys (Autodesk Maya)";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Tethys<br>(Autodesk&nbsp;Maya)</a>";
		}
	if (shuffle == 8) 
		{
		image_buffer[set].src = "slideshow-images/il_amalthea.jpg";
		link_url[set] = "http://www.curiousnotions.com/cgi"
		link_title[set] = "Amalthea (Autodesk Maya)";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Amalthea<br>(Autodesk&nbsp;Maya)</a>";
		}
	if (shuffle == 9) 
		{
		image_buffer[set].src = "slideshow-images/il_mercury.jpg";
		link_url[set] = "http://www.curiousnotions.com/cgi"
		link_title[set] = "Mercury (Autodesk Maya)";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Mercury<br>(Autodesk&nbsp;Maya)</a>";
		}

	set = 2;

	shuffle = Math.round(Math.random() * 6) + 1;
	shuffle_save[set] = shuffle;

	if (shuffle == 1) 
		{
		image_buffer[set].src = "slideshow-images/il_saiga.gif";
		link_url[set] = "gazetteer_item.asp?code=mon"
		link_title[set] = "Minority Languge Planetary Gazetteer";
		link_string[set] = "My Favorite<br>Mongolian Antelope<br><a href='" + link_url[set] + "' title='" + link_title[set] + "'>(Planetary Gazetteer)</a>";
		}
	if (shuffle == 2) 
		{
		image_buffer[set].src = "slideshow-images/il_triethylborane.jpg";
		link_url[set] = "../temperatures";
		link_title[set] = "Online temperature conversion: 42 scales";
		link_string[set] = "Triethylborane<br>(<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Online temperature conversion</a>)";
		}
	if (shuffle == 3) 
		{
		image_buffer[set].src = "slideshow-images/il_wedgwood.jpg";
		link_url[set] = "../temperatures";
		link_title[set] = "Online temperature conversion: 42 scales";
		link_string[set] = "Josiah Wedgwood<br>(<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Online temperature conversion</a>)";
		}
	if (shuffle == 4) 
		{
		image_buffer[set].src = "slideshow-images/il_triethylborane.jpg";
		link_url[set] = "../temperatures";
		link_title[set] = "Online temperature conversion: 42 scales";
		link_string[set] = "Triethylborane<br>(<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Online temperature conversion</a>)";
		}
	if (shuffle == 5) 
		{
		image_buffer[set].src = "slideshow-images/il_wedgwood.jpg";
		link_url[set] = "../temperatures";
		link_title[set] = "Online temperature conversion: 42 scales";
		link_string[set] = "Josiah Wedgwood<br>(<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Online temperature conversion</a>)";
		}
	if (shuffle == 6) 
		{
		image_buffer[set].src = "slideshow-images/il_john-evelyn.jpg";
		link_url[set] = "../temperatures";
		link_title[set] = "Online temperature conversion: 42 scales";
		link_string[set] = "Royal Society of London founder John Evelyn<br>(<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Online temperature conversion</a>)";
		}
	if (shuffle == 7) 
		{
		image_buffer[set].src = "slideshow-images/il_john-evelyn.jpg";
		link_url[set] = "../temperatures";
		link_title[set] = "Online temperature conversion: 42 scales";
		link_string[set] = "Royal Society of London founder John Evelyn<br>(<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Online temperature conversion</a>)";
		}

	set = 3;

	shuffle = Math.round(Math.random() * 6) + 1;
	shuffle_save[set] = shuffle;

	if (shuffle == 1) 
		{
		image_buffer[set].src = "slideshow-images/il_lb.jpg";
		link_url[set] = "popes.asp";
		link_title[set] = "Adventures in Popedom";
		link_string[set] = "Pope&rsquo;s Daughter<br>Lucrezia Borgia<br><a href='" + link_url[set] + "' title='" + link_title[set] + "'>(Adventures in Popedom)</a>";
		}
	if (shuffle == 2) 
		{
		image_buffer[set].src = "slideshow-images/il_todays-date.gif";
		link_url[set] = "../todays-date.asp";
		link_title[set] = "Today's Date";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>Today&rsquo; Date</a><br>(In more ways than one)";
		}
	if (shuffle == 3) 
		{
		image_buffer[set].src = "slideshow-images/il_methylene-blue.jpg";
		link_url[set] = "http://www.curiousnotions.com/index.asp";
		link_title[set] = "Methylene Blue (Anti-Aging)";
		link_string[set] = "Methylene Blue<br><a href='" + link_url[set] + "' title='" + link_title[set] + "'>(Anti-Aging)</a>";
		}

	if (shuffle == 4) 
		{
		image_buffer[set].src = "slideshow-images/il_mars_pond2.jpg";
		link_url[set] = "../mars/mars_pond_3.html";
		link_title[set] = "Seen near Crater Lau";
		link_string[set] = "Liquid Water on Mars?<br><a href='" + link_url[set] + "' title='" + link_title[set] + "'>(Martian Curiosities)</a>";
		}

	if (shuffle == 5) 
		{
		image_buffer[set].src = "slideshow-images/il_sp1a.gif";
		link_url[set] = "../spyro/index.html"
		link_title[set] = "SpyroGyro";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>SpyroGyro Design Tool</a>";
		}
	if (shuffle == 6) 
		{
		image_buffer[set].src = "slideshow-images/il_sp3.gif";
		link_url[set] = "../spyro/index.html";
		link_title[set] = "SpyroGyro";
		link_string[set] = "<a href='" + link_url[set] + "' title='" + link_title[set] + "'>SpyroGyro Design Tool</a>";
		}
	if (shuffle == 7) 
		{
		image_buffer[set].src = "slideshow-images/il_urban-viii.jpg";
		link_url[set] = "popes.asp";
		link_title[set] = "Adventures in Popedom";
		link_string[set] = "Urban VIII<br>Excommunicated Smokers<br><a href='" + link_url[set] + "' title='" + link_title[set] + "'>(Adventures in Popedom)</a>";
		}
}

var slide_image = new Array; 

slide_image[1] = image_buffer[1].src;
slide_image[2] = image_buffer[2].src;
slide_image[3] = image_buffer[3].src;

function slide_cycle()
{

	if (document.images) // don't bother if images are turned off in preferences
	{
		document.slideshow.src = slide_image[this_slide];
		document.getElementById("slide_caption").innerHTML = link_string[this_slide];
		document.getElementById("slideshow_link").href = link_url[this_slide];
		document.getElementById("slideshow_link").title = link_title[this_slide];
			
	setTimeout ("slide_cycle()", interval);
	this_slide = this_slide + 1;
	if (this_slide > slide_count) this_slide = 1;
	}
}


