function addHover(stop)
{
	end = ( stop ? 3 : 11 );
	lnks = document.getElementsByTagName('a');
	for ( i=0; i<lnks.length; i++ )
	{
		clr1 = ( i > end ? '#00f' : '#aa5' );
		clr2 = ( i > 3 ? '#00a' : '#429' );
		attr = ( i > end ? 'background' : 'color' );
		a = document.createAttribute('onmouseover');
		a.value = "this.style." + attr + "='" + clr1 + "'";
		lnks[i].setAttributeNode(a);
		b = document.createAttribute('onmouseout');
		b.value = "this.style." + attr + "='" + clr2 + "'";
		lnks[i].setAttributeNode(b);
	}
	lnks = document.getElementsByTagName('li');
	for ( i=0; i<lnks.length; i++ )
	{
		a = document.createAttribute('onmouseover');
		a.value = "this.style.background='#aa5'";
		lnks[i].setAttributeNode(a);
		b = document.createAttribute('onmouseout');
		b.value = "this.style.background='#44c'";
		lnks[i].setAttributeNode(b);
	}
}
function go()
{
	if ( !location.search ) document.getElementById('contribName').innerHTML = '';
	else
	{
		which = location.search.substr( location.search.indexOf('?') + 1 );
		page = ( which == "upload" || which == "links" ? 'upload' : 'contrib' )
		location.replace( page + '.php?' + which );
	}
}
function Menu()
{
	menu = document.getElementById('contributors').style;
	menu.display = ( menu.display == 'block' ? 'none' : 'block' );
	setTimeout (  "menu.display='none'", 4000 );
}
function page( which )
{
	switch (which)
	{
		case 'eric': label = "Eric&#39;s page"; break;
		case 'laurel': label = "Laurel&#39;s page"; break;
		case 'christopher': label = "Christopher&#39;s page"; break;
		case 'lg_and_chris': label = "L.G. and Chris&#39;s page"; break;
		case 'lisa_and_brad': label = "Lisa and Brad&#39;s page"; break;
		case 'dee_and_walt': label = "Dee and Walt&#39;s page"; break;
		case 'jen_and_paul': label = "Jen and Paul&#39;s page"; break;
		default: label = '';
	}
	document.getElementById('contribName').innerHTML = label;
}
function photocred()
{
	document.getElementById('credsunset').style.fontWeight = 'normal';
	document.getElementById('credsunset').style.color = '#00a';

	document.getElementById('credspinner').style.fontWeight = 'normal';
	document.getElementById('credspinner').style.color = '#00a';

	document.getElementById('credwhale').style.fontWeight = 'normal';
	document.getElementById('credwhale').style.color = '#00a';

	document.getElementById('credflowers').style.fontWeight = 'normal';
	document.getElementById('credflowers').style.color = '#00a';

	document.getElementById('credturtle').style.fontWeight = 'normal';
	document.getElementById('credturtle').style.color = '#00a';

	document.getElementById('credporc').style.fontWeight = 'normal';
	document.getElementById('credporc').style.color = '#00a';

	document.getElementById('credmoray').style.fontWeight = 'normal';
	document.getElementById('credmoray').style.color = '#00a';

	document.getElementById('credmantis').style.fontWeight = 'normal';
	document.getElementById('credmantis').style.color = '#00a';

/*	creds = document.getElementsByClassName('zoom');
	for ( i=0;i<creds.length;i++ ) 
	{
		creds[i].style.fontWeight = 'normal';
		creds[i].style.color = '#00a';
	}
*/
	cred = document.getElementById('photocredits').style;
	cred.display = ( cred.display == 'block' ? 'none' : 'block' );
	if ( cred.display == 'none' )
	{
		document.getElementById('pix').style.display = 'block';
		document.getElementById('photofull').style.display = 'none';
		document.getElementById('photofull').style.outline = '0px';
		document.getElementById('inst').innerHTML = 'Click images for photo credits';
		document.getElementById('inst').style.color = '#44a';
	} else {
		document.getElementById('inst').innerHTML = 
			'Click an image description<br>to enlarge the image';
		document.getElementById('inst').style.color = '#008';
	}
}
function hilite(pic)
{
	zoom = document.getElementById('photofull').style;
	imgitem = document.getElementById(pic).style;
	zoom.display = 'none';
	zoom.outline = '0px';
	zoom.border = '1px solid #000';
	if ( pic != 'sunset' )
	{
		imgitem.outline = '1px solid #0f0';
		document.images['photofull'].src = document.images[pic].src;
		zoom.top = Number(imgitem.top.substring(0,imgitem.top.indexOf('p'))) + 9 + 'px';
		zoom.left = Number(imgitem.left.substring(0,imgitem.left.indexOf('p'))) + 119 + 'px';
		zoom.width = imgitem.width;
	} else {
		document.images['photofull'].src = "_img/sunset.jpg";
		zoom.top = '0px';
		zoom.left = '210px';
		zoom.width = '700px';
	}

	if ( pic == 'flowers' ) 
		maxwidth = 450;
	else 
		maxwidth = 700;
	
	growAmt = maxwidth - Number(imgitem.width.substring(0,imgitem.width.indexOf('p')));
	topAmt = 0 - Number(imgitem.top.substring(0,imgitem.top.indexOf('p')));
	leftAmt = 90 - Number(imgitem.left.substring(0,imgitem.left.indexOf('p')));
	document.getElementById('pix').style.display = 'block';

	document.getElementById('credsunset').style.fontWeight = 'normal';
	document.getElementById('credsunset').style.color = '#00a';

	document.getElementById('credspinner').style.fontWeight = 'normal';
	document.getElementById('credspinner').style.color = '#00a';

	document.getElementById('credwhale').style.fontWeight = 'normal';
	document.getElementById('credwhale').style.color = '#00a';

	document.getElementById('credflowers').style.fontWeight = 'normal';
	document.getElementById('credflowers').style.color = '#00a';

	document.getElementById('credturtle').style.fontWeight = 'normal';
	document.getElementById('credturtle').style.color = '#00a';

	document.getElementById('credporc').style.fontWeight = 'normal';
	document.getElementById('credporc').style.color = '#00a';

	document.getElementById('credmoray').style.fontWeight = 'normal';
	document.getElementById('credmoray').style.color = '#00a';

	document.getElementById('credmantis').style.fontWeight = 'normal';
	document.getElementById('credmantis').style.color = '#00a';

	document.getElementById('cred'+pic).style.fontWeight = 'bold';
	document.getElementById('cred'+pic).style.color = '#000';
	zoom.opacity = 0;
	zoom.display = 'block';
	grow ( 0, pic, growAmt, topAmt, leftAmt );
}
function grow ( step, pic, growAmt, topAmt, leftAmt )
{
	steps = 20;
	imgitem = document.getElementById(pic).style;
	zoom = document.getElementById('photofull').style;
	if ( step <= steps )
	{
		thisGrow = growAmt/steps;
		thisTop = topAmt/steps;
		thisLeft = leftAmt/steps;
		if ( step > 0 )
		{
			if ( pic != 'sunset' )
			{
				zoom.top = Number(zoom.top.substring(0,zoom.top.indexOf('p'))) + 
					Number(thisTop) + 'px';
				zoom.left = Number(zoom.left.substring(0,zoom.left.indexOf('p'))) + 
					Number(thisLeft) + 'px';
				zoom.width = Number(zoom.width.substring(0,zoom.width.indexOf('p'))) + 
					Number(thisGrow) + 'px';
			}
			zoom.opacity = 1-((steps-step)/steps);
		}
		delay = ( step == 0 ? 500 : (step^3)/(step*50) );
		setTimeout("grow( " + (step+1) + ", '" + pic + "', " + growAmt + ", " + topAmt + 
			", " + leftAmt + ")", delay); 
	} else {
		zoom.outline = '5px inset #888';
		document.getElementById('pix').style.display = 'none';
		imgitem.outlineColor = '#000'
	}
}

