// preload rollover images


function init()
{

if (document.images)
{

	enter = new Image();
	enter.src = 'images/window_arrow.jpg';
	enterOn = new Image();
	enterOn.src = 'images/window_arrow_hover.jpg';

	headOff = new Image();
	headOff.src = 'images/window_right.jpg';
	headOn = new Image();
	headOn.src = 'images/window_right_hover.jpg';

	more = new Image();
	more.src = 'images/link-more.gif';
	moreOn = new Image();
	moreOn.src = 'images/link-more-hover.gif';

	comics = new Image();
	comics.src = 'images/link-comics.gif';
	comicsOn = new Image();
	comicsOn.src = 'images/link-comics-hover.gif';

	woodburning = new Image();
	woodburning.src = 'images/link_woodburning1.gif';
	woodburningOn = new Image();
	woodburningOn.src = 'images/link_woodburning2.gif';
	
	illustration = new Image();
	illustration.src = 'images/link_illustration1.gif';
	illustrationOn = new Image();
	illustrationOn.src = 'images/link_illustration2.gif';
	
	projects = new Image();
	projects.src = 'images/link_projects1.gif';
	projectsOn = new Image();
	projectsOn.src = 'images/link_projects2.gif';

}

document.getElementById('contWindow').style.display = 'block';

}


// Descriptions of pieces

var desc = Array();

desc['Study for A Dream'] = 'Woodburning triptych, 2005.';
desc['Downtown'] = 'Pen &amp; ink, 2005.';
desc['Killer Music'] = 'Painting on wood.';
desc['Gourd1'] = 'Woodburned gourd.';
desc['Gala Corina - Artist Trading Cards'] = 'Artist trading cards created for Gala Corina, an annual art, music, and fashion show in Tampa, Florida. Pen and highlighters on parchment paper. 2.5in x 3.5in each. 96 cards total. <a href="www.galacorina2007.com">www.galacorina2007.com</a>';


function showPiece(URL, title, width, source)

{
	document.getElementById('topNavi').style.display = 'none';
	document.getElementById('contPiece').style.display = 'block';
	
	if (source == 'thumbnails1')
		dir = 'woodburning';
	else if (source == 'thumbnails2')
		dir = 'illustration';
	else if (source == 'thumbnails2')
		dir = 'projects';
	document.getElementById('piece').src = dir + '/' + URL;
	document.getElementById('title').innerHTML = title;
	document.getElementById('clickText').innerHTML = clickThings[Math.round(Math.random()*5)];
	
	// set containers

//	document.getElementById('contPiece').style.width = width+'px';
	document.getElementById('contTable').style.paddingTop = '45px';

	// description			

	if (typeof(desc[title]) != 'undefined') // i.e. if it exists
	{
		document.getElementById('description').innerHTML = desc[title];
		document.getElementById('description').style.display = 'block';
	}

	else
	{
		document.getElementById('description').style.display = 'none';
	}
}

function showWoodburning()
{
	document.getElementById('thumbnails1').style.display = 'block';
	document.getElementById('thumbnails2').style.display = 'none';
	document.getElementById('thumbnails3').style.display = 'none';
	document.getElementById('imgWoodburning').className = 'current';
	document.getElementById('imgIllustration').className = '';
	document.getElementById('imgProjects').className = '';
}
function showIllustration()
{
	document.getElementById('thumbnails2').style.display = 'block';
	document.getElementById('thumbnails1').style.display = 'none';
	document.getElementById('thumbnails3').style.display = 'none';
	document.getElementById('imgWoodburning').className = '';
	document.getElementById('imgIllustration').className = 'current';
	document.getElementById('imgProjects').className = '';
}
function showProjects()
{
	document.getElementById('thumbnails3').style.display = 'block';
	document.getElementById('thumbnails1').style.display = 'none';
	document.getElementById('thumbnails2').style.display = 'none';
	document.getElementById('imgWoodburning').className = '';
	document.getElementById('imgIllustration').className = '';
	document.getElementById('imgProjects').className = 'current';
}

function showThumbs()
{
	document.getElementById('topNavi').style.display = 'block';
	document.getElementById('contPiece').style.display = 'none';
	document.getElementById('piece').src = '';
	document.getElementById('title').innerHTML = '';
	document.getElementById('clickText').innerHTML = '';
}

clickThings = Array(5);
clickThings[0] = 'Click me to make me go away.',
clickThings[1] = 'I will be gone if you click me.',
clickThings[2] = 'Thumbnails will come back if you click me.',
clickThings[3] = 'Click me and I will be gone.',
clickThings[5] = 'If you want the thumbnails back, click me.'
clickThings[4] = 'Clicking will make me go away.',
clickThings[5] = 'If you click me, I will go.'

// by Adriano Santi, http://adrianosanti.com
function noSpam(me)
{

	me = me.replace('[at]','@');
	me = me.replace('[dot]','.');
	self.location.href = me;
	return false;
}
