function swapIn(imgid,newimg,thisThumb,caption)  {
	document.getElementById(imgid).innerHTML = '<img src="' + newimg + '">';
	// only way to do this in IE because getElementsByName is buggy
	var thumbs = document.getElementById('thumbBox').getElementsByTagName('div');
	for (i=0; i<thumbs.length; i++)	{
		if (i == thisThumb - 1)	{
			thumbs[i].className = "onThumb";
		}
		else	{
			thumbs[i].className = "viewThumb";
		}
	}
	document.getElementById('caption').innerHTML = caption;
}

function swapText(newtitle,newpanel)  {
	document.getElementById('panelTitle').innerHTML = newtitle;
	document.getElementById('panelText').innerHTML = newpanel;
}

function MM_displayStatusMsg(msgStr)  { //v3.0
        status=msgStr; document.MM_returnValue = true;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

/* Functions that handle preload. */
function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// verbose because setTimeout will not accept variables in its function argument
function revealColors()	{
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#101000'",50);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#201800'",100);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#302000'",150);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#402800'",200);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#503000'",250);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#603800'",300);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#704000'",350);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#804800'",400);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#905000'",450);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#A06800'",500);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#B07000'",550);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#C07800'",600);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#D08000'",650);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#E08800'",700);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = '#F09000'",750);
	window.setTimeout("document.getElementById('largeImageOverlay').style.backgroundColor = ''",800);
}

function revealTile(overlay)	{
	window.setTimeout("document.getElementById('largeImageOverlay1').style.backgroundColor = ''",800);
	window.setTimeout("document.getElementById('largeImageOverlay2').style.backgroundColor = ''",1100);
	window.setTimeout("document.getElementById('largeImageOverlay3').style.backgroundColor = ''",200);
	window.setTimeout("document.getElementById('largeImageOverlay4').style.backgroundColor = ''",1000);
	window.setTimeout("document.getElementById('largeImageOverlay5').style.backgroundColor = ''",500);
	window.setTimeout("document.getElementById('largeImageOverlay6').style.backgroundColor = ''",900);
	window.setTimeout("document.getElementById('largeImageOverlay7').style.backgroundColor = ''",1300);
	window.setTimeout("document.getElementById('largeImageOverlay8').style.backgroundColor = ''",700);
	window.setTimeout("document.getElementById('largeImageOverlay9').style.backgroundColor = ''",1200);
	window.setTimeout("document.getElementById('largeImageOverlay10').style.backgroundColor = ''",600);
	window.setTimeout("document.getElementById('largeImageOverlay11').style.backgroundColor = ''",1500);
	window.setTimeout("document.getElementById('largeImageOverlay12').style.backgroundColor = ''",1400);
	window.setTimeout("document.getElementById('largeImageOverlay13').style.backgroundColor = ''",500);
	window.setTimeout("document.getElementById('largeImageOverlay14').style.backgroundColor = ''",400);
	window.setTimeout("document.getElementById('largeImageOverlay15').style.backgroundColor = ''",100);
	window.setTimeout("document.getElementById('largeImageOverlay16').style.backgroundColor = ''",1600);
}

var ht = 0;

function revealRolldown()	{
	var rd;

	rd = window.setInterval('rolldown()',2);
}

function rolldown()	{
	ht = ht + 1;
	if ( ht <= 284 )	{
		document.getElementById('largeImageOverlay').style.height = (284 - ht) + 'px';
		document.getElementById('largeImageOverlay').style.top = ht + 114 + 'px';
	}
}

function revealExplode()	{
	var rd;

	rd = window.setInterval('explode()',5);
}

function explode()	{
	ht = ht + 1;
	if ( ht <= 284 )	{
		document.getElementById('largeImageOverlay').style.height = (284 - ht) + 'px';
		document.getElementById('largeImageOverlay').style.top = ht + 114 + 'px';
	}
}

