barSection = "illo"

workspath = "works/"

sortByDate = 0;

document.bullet = new Image();
document.bullet.src = "images/nav_bullet.gif";
document.invis = new Image();
document.invis.src = "images/invis.gif";

document.barilloOn = new Image();
document.barilloOn.src = "images/bar_illo_on.gif";
document.barilloOff = new Image();
document.barilloOff.src = "images/bar_illo_off.gif";
document.barilloSelected = new Image();
document.barilloSelected.src = "images/bar_illo_selected.gif";

document.barcharOn = new Image();
document.barcharOn.src = "images/bar_char_on.gif";
document.barcharOff = new Image();
document.barcharOff.src = "images/bar_char_off.gif";
document.barcharSelected = new Image();
document.barcharSelected.src = "images/bar_char_selected.gif";

document.barmiscOn = new Image();
document.barmiscOn.src = "images/bar_misc_on.gif";
document.barmiscOff = new Image();
document.barmiscOff.src = "images/bar_misc_off.gif";
document.barmiscSelected = new Image();
document.barmiscSelected.src = "images/bar_misc_selected.gif";

document.bargraphOn = new Image();
document.bargraphOn.src = "images/bar_graph_on.gif";
document.bargraphOff = new Image();
document.bargraphOff.src = "images/bar_graph_off.gif";
document.bargraphSelected = new Image();
document.bargraphSelected.src = "images/bar_graph_selected.gif";



document.barIndic = new Image();
document.barIndic.src = "images/bar_indic.gif";


document.thumbOn = new Image();
document.thumbOn.src = "images/thumb_on.gif";
document.thumbOff = new Image();
document.thumbOff.src = "images/thumb_off.gif";

document.nextOn = new Image();
document.nextOn.src = "images/next_on.gif";
document.nextOff = new Image();
document.nextOff.src = "images/next.gif";

document.prevOn = new Image();
document.prevOn.src = "images/prev_on.gif";
document.prevOff = new Image();
document.prevOff.src = "images/prev.gif";





listIllo = new Array();
listIllo[0] = "illo"
listIllo[1] = new Array();
listIllo[2] = "illustration";

listChar = new Array();
listChar[0] = "char"
listChar[1] = new Array();
listChar[2] = "design"

listObjEnv = new Array();
listObjEnv[0] = "objenv"
listObjEnv[1] = new Array();
listObjEnv[2] = "design"

list3d = new Array();
list3d[0] = "3d"
list3d[1] = new Array();
list3d[2] = "3d work"

listGraph = new Array();
listGraph[0] = "graph"
listGraph[1] = new Array();
listGraph[2] = "design"

listMisc = new Array();
listMisc[0] = "misc"
listMisc[1] = new Array();
listMisc[2] = "miscellaneous work"


addWork(listIllo, "bizarrefruit", "Bizarre Fruit",2010);
addWork(listIllo, "herewithme", "Here With Me",2010);
addWork(listIllo, "whatliesinhereyes", "What Lies In Her Eyes",2010);
addWork(listIllo, "bloodofparadise", "The Blood of Paradise",2010);
addWork(listIllo, "dragon", "Dragon",2010);
addWork(listIllo, "communion", "Communion",2010);
addWork(listIllo, "bigwhite", "Big White",2009);
addWork(listIllo, "whiteempress", "Black Flags on the White Empress",2009);
addWork(listIllo, "threewishes", "Three Wishes",2009);
addWork(listIllo, "fear", "Fear",2009);
addWork(listIllo, "onebird", "One Bird, One Tree",2009);
addWork(listIllo, "osiris", "Osiris",2009);
addWork(listIllo, "morrigan", "Morrigan",2009);
addWork(listIllo, "loki", "Loki",2009);
addWork(listIllo, "snailfight", "Snailfight",2009);
addWork(listIllo, "toreyo", "Toreyo",2009);
addWork(listIllo, "mistaken", "Mistaken Identity",2008);
addWork(listIllo, "ionesco", "Ionesco",2009);
addWork(listIllo, "henri", "Henri",2008);
addWork(listIllo, "sanctuary", "Sanctuary",2008);
addWork(listIllo, "flybynight", "Fly By Night",2008);
addWork(listIllo, "blue", "Blue",2005);
addWork(listIllo, "echo", "Echo of the Heliosheath",2008);
addWork(listIllo, "imogen", "Imogen",2008);
addWork(listIllo, "rider", "The Rider",2008);
addWork(listIllo, "matsuyama", "Matsuyama's Divine Love",2008);
addWork(listIllo, "mockturtle", "The Mock Turtle's Story",2005);
addWork(listIllo, "troll", "Troll",2006);
addWork(listIllo, "salene", "Salene",2008);
addWork(listIllo, "wine", "Wine Labels",2008);
addWork(listIllo, "stay", "Stay, And I Will Love Thee",2007);
addWork(listIllo, "temptation", "Temptation",2006);
addWork(listIllo, "ursula", "Ursula the Unfriendly Giant",2007);
addWork(listIllo, "passages", "Passages for Lost Clouds",2004);
addWork(listIllo, "frank", "Frank the Whale",2008);
addWork(listIllo, "hilltopcastle", "Hilltop Castle",2007);
addWork(listIllo, "selah", "Selah Alhambra",2004);
addWork(listIllo, "summer", "Summer",2006);
addWork(listIllo, "longboat", "Longboat",2006);
addWork(listIllo, "darkwaters", "Two Set Out In Dark Waters",2005);
addWork(listIllo, "tori", "Tori",2005);
addWork(listIllo, "alicevs", "Alice vs. the Matrix",2004);


addWork(listChar, "threepigs", "Three Pigs");
addWork(listChar, "grimmmales", "Grimm Male Characters");
addWork(listChar, "littlem", "Little Misery");
addWork(listChar, "viking", "Viking");
addWork(listChar, "voodoo", "Voodoo Guitarist");
addWork(listChar, "clara", "Clara");
addWork(listChar, "rrh", "Red Riding Hood");
addWork(listChar, "mp", "Mudpuppies");
addWork(listChar, "dinkus", "Dinkus");
addWork(listChar, "kibbles", "Mrs. Kibblesworth");
addWork(listChar, "ozma", "Ozma");



//RELABLE AS 'OLD'

/*
addWork(listGraph, "fairy", "Enchanted Forest logo");
addWork(listGraph, "hall2k2", "Halloween 2002");
addWork(listGraph, "surrounded", "Surrounded!");
addWork(listGraph, "against", "Against All Odds");
addWork(listGraph, "sirene", "Sirčne");
addWork(listGraph, "autumn", "Autumn Goddess");
addWork(listGraph, "towers", "Towers");
addWork(listGraph, "lantern", "Lantern");
addWork(listGraph, "kraken", "Kraken");
addWork(listGraph, "tech", "Technician");
addWork(listGraph, "pino", "Pinocchio");
addWork(listGraph, "alexis", "Alexis");
addWork(listGraph, "quadling", "Quadling");
addWork(listGraph, "strawh", "Straw");
addWork(listGraph, "hobbit", "The Hobbit");
*/



addWork(listGraph, "dreamfish", "Dreamfish",2006);
addWork(listGraph, "tee", "Dark Fairytale Tshirts",2004);
addWork(listGraph, "straw", "Straw, Sticks, Bricks",2002);
addWork(listGraph, "crown", "Crown of Wax",2005);
addWork(listGraph, "eternal", "The Eternal Battle Between Good and Evil",2002);
addWork(listGraph, "mina", "Mina");
addWork(listGraph, "thunderdome", "Thunderdome");
addWork(listGraph, "digging", "Digging for Penguin");
addWork(listGraph, "originality", "Originality");
addWork(listGraph, "loversreunion", "The Lover's Reunion");
addWork(listGraph, "after", "After the Rain",2001);
addWork(listGraph, "mercurygirl", "Mercury Girl",2001);

//addWork(listMisc, "costume", "Halloween costume");
//addWork(listMisc, "can", "Can of Soup Number Two");


//RELABLE AS 'SKETCHES'
addWork(listMisc, "royalty", "Royalty");
addWork(listMisc, "winter", "Winter");
addWork(listMisc, "treegirl", "Treegirl");
addWork(listMisc, "goblin", "Goblinpot");
addWork(listMisc, "falseidle", "False Idle");
addWork(listMisc, "yellow", "Yellow");
addWork(listMisc, "peterpan", "Peter Pan");
addWork(listMisc, "surface", "Surface");
addWork(listMisc, "pn", "Pirate versus Ninja!");
addWork(listMisc, "4adie", "For Adie");
addWork(listMisc, "subday", "Happy Birthday Sub");
addWork(listMisc, "tetris", "Retro game cartoon");
addWork(listMisc, "bots", "Bots Tribute");





//addWork(listGraph, "const", "Constellation Publishing Annual Report");
//addWork(listGraph, "comm", ".community Magazine");




if(sortByDate)
	{
	sortListByDate(listIllo);
	sortListByDate(listChar);
	sortListByDate(listGraph);
	sortListByDate(listMisc);
	}


function sortListByDate(list)
	{
	if(list[1].length!=0)
		{
		list[1].sort(function(a,b){return b[2]-a[2]})
		}
	}


function pOn()
	{
	document.passagesButton.src = document.passagesOn.src;
	}
function pOff()
	{
	document.passagesButton.src = document.passagesOff.src;
	}

function addWork(whichList, file, name, year)
	{
	whichList[1][whichList[1].length] = new Array();
	whichList[1][whichList[1].length-1][0] = file;
	whichList[1][whichList[1].length-1][1] = name;
	whichList[1][whichList[1].length-1][2] = year;
	}

function writeThumbs(whichList, columns, target)
	{
	listName = whichList[0];
	if(whichList[1].length==0)
		{
		document.write('<TD><IMG src="images/thumb_soon.gif"></TD>');
		document.write('<TD><IMG src="images/thumb_soon.gif"></TD>');
		document.write('<TD><IMG src="images/thumb_soon.gif"></TD>');
		}
	else
		{
		counter=0;
		for(i=0;i<whichList[1].length;i++)
			{
			if(counter%columns==0)
				{
				document.write('</TR><TR>');
				}
			itemFile = whichList[1][i][0];
			itemName = whichList[1][i][1];
			document.write('<TD background="'+workspath+itemFile+'_thumb.jpg"><A target='+target+' href="'+itemFile+'.htm#top" ');
			document.write('onmouseover="javascript:imageswitch(\''+itemFile+'\',\'thumbOn\');" onmouseout="javascript:imageswitch(\''+itemFile+'\',\'thumbOff\');">');
			document.write('<IMG src="images/thumb_off.gif" width="80" height="80" border="0" name="'+itemFile+'" alt="'+itemName+'"></A></TD>');
			counter++;
			}
		}
	}

function findNext(whichList,current)
	{
	next = current;
	for(i=0;i<whichList[1].length;i++)
		{
		if(whichList[1][i][0]==current)
			{
			if(i==whichList[1].length-1)
				next = whichList[1][0][0];
			else
				next = whichList[1][i+1][0];
			break;
			}
		}
	return next;
	}

function findPrev(whichList,current)
	{
	prev = current;
	for(i=0;i<whichList[1].length;i++)
		{
		if(whichList[1][i][0]==current)
			{
			if(i==0)
				prev = whichList[1][whichList[1].length-1][0];
			else
				prev = whichList[1][i-1][0];
			break;
			}
		}
	return prev;
	}

function writeEndLinks(whichList,current)
	{
	document.write('<P align=center><A href='+findNext(whichList,current)+'.htm><B>Next</B> '+whichList[2]+'</A> | ');
	document.write('<A href=index.htm><B>Back</B> to portfolio</A> | ');
	document.write('<B>Previous</B> '+whichList[2]+'</A></P>');
	}



function writePrev(whichList,current)
	{
	document.write('<A href='+findPrev(whichList,current)+'.htm onmouseover="javascript:document.prev.src=document.prevOn.src;"');
	document.write('onmouseout="javascript:document.prev.src=document.prevOff.src;"><IMG src="images/prev.gif" border="0" name="prev" alt="Next"></A>');
	}


function writeNext(whichList,current)
	{
	document.write('<A href='+findNext(whichList,current)+'.htm onmouseover="javascript:document.next.src=document.nextOn.src;"');
	document.write('onmouseout="javascript:document.next.src=document.nextOff.src;"><IMG src="images/next.gif" border="0" name="next" alt="Next"></A>');
	}



function imageswitch(item,item2)
	{
	document[item].src = document[item2].src;
	}

function barOn(item)
	{
	document[item].src = document[item+"On"].src;
	}

function barOff(item)
	{
	if("bar"+barSection==item)
		{document[item].src = document[item+"Selected"].src;}
	else
		{document[item].src = document[item+"Off"].src;}
	}

function barClick(item)
	{
	document["bar"+barSection].src = document["bar"+barSection+"Off"].src; // turn other indics off
	barSection = item;
	document["bar"+barSection].src = document["bar"+barSection+"Selected"].src;
	frames["barWindow"].location.href = "bar_"+barSection+".htm";
	}

function writeBarPage(whichList)
	{
	document.write('<IMG src="images/invis.gif" width="783" height="1"><BR><A name="'+whichList[0]+'"><TABLE cellspacing=5 cellpadding=0 border=0 align=center><TR>');
	writeThumbs(whichList,9,"_parent");
	document.write('</TR></TABLE></A>');
	}

//

function writeHeader()
	{
	document.write('<TABLE cellspacing=0 cellpadding=0 border=0 width="100%">');
	document.write('<TR><TD>&nbsp;</TD><TD width="990" bgcolor=#242725 style="background-image: url(\'images/watermark.gif\'); background-repeat: no-repeat;">');

		document.write('<TABLE cellspacing=0 cellpadding=0 border=0 width=990>');

		document.write('<TR><TD valign="bottom"><A href="index.htm"><IMG src="images/header_name.gif" border="0"></A><BR><IMG src="images/invis.gif" width="0" height="50"></TD>');
		document.write('<TD align=right><IMG src="images/nav_start.gif" border="0">');
		document.write('<A href="index.htm" onmouseover="javascript:imageswitch(\'port\',\'bullet\')" onmouseout="javascript:imageswitch(\'port\',\'invis\')"><IMG src="images/nav_port.gif" border="0">');
		document.write('</A><A href="prints.htm" target="_new" onmouseover="javascript:imageswitch(\'prints\',\'bullet\')" onmouseout="javascript:imageswitch(\'prints\',\'invis\')"><IMG src="images/nav_prints.gif" border="0">');
		document.write('</A><A href="projects.htm" onmouseover="javascript:imageswitch(\'project\',\'bullet\')" onmouseout="javascript:imageswitch(\'project\',\'invis\')"><IMG src="images/nav_proj.gif" border="0">');

		document.write('</A><A href="about.htm" onmouseover="javascript:imageswitch(\'about\',\'bullet\')" onmouseout="javascript:imageswitch(\'about\',\'invis\')"><IMG src="images/nav_about.gif" border="0">');

		document.write('</A></TD></TR><TR><TD colspan=2>');
	}

function writeBar(whichBar)
	{
	barSection = whichBar;
	document.write('<TABLE width="800" align="center" border="0" cellspacing="0" cellpadding="0">');
	document.write('<TR><TD>');
	document.write('<A href="javascript:barClick(\'illo\');" onmouseover="javascript:barOn(\'barillo\');"');
	document.write('onmouseout="javascript:barOff(\'barillo\');"><IMG src="images/bar_illo_off.gif" border=0 name="barillo"></A>');
	document.write('<A href="javascript:barClick(\'char\');" onmouseover="javascript:barOn(\'barchar\');"');
	document.write('onmouseout="javascript:barOff(\'barchar\');"><IMG src="images/bar_char_off.gif" border=0 name="barchar"></A>');
	document.write('<A href="javascript:barClick(\'graph\');" onmouseover="javascript:barOn(\'bargraph\');"');
	document.write('onmouseout="javascript:barOff(\'bargraph\');"><IMG src="images/bar_graph_off.gif" border=0 name="bargraph"></A>');
	document.write('<A href="javascript:barClick(\'misc\');" onmouseover="javascript:barOn(\'barmisc\');"');
	document.write('onmouseout="javascript:barOff(\'barmisc\');"><IMG src="images/bar_misc_off.gif" border=0 name="barmisc"></A>');
	document.write('</TD></TR><TR><TD><IMG src="images/bar_top.gif"></TD></TR>');
	document.write('<TR><TD>');
	document.write('<IFRAME width="800" height="455" border="0" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" src="bar_'+barSection+'.htm" name="barWindow"></IFRAME>');
	document.write('</TD></TR>');
	document.write('<TR><TD><IMG src="images/bar_bottom.gif"></TD></TR>');
	document.write('</TABLE><BR><BR>');
	barClick(barSection);
	}

function writeFooter()
	{
	document.write('</TD></TR></TABLE><P class="copy">All content and design (c) 2001-2008 Ken Wong, ');
	document.write('except where otherwise stated.</P></TD>');
	document.write('<TD>&nbsp;</TD>');
	document.write('</TR></TABLE>');
	}