workspath = "illu-pages/works/"

sortByDate = 0;

function gup(name)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "artificial";
  else
    return results[1];
}


function framer() 
	{
	top.frames['illuview'].location.href ='illu-pages/'+gup('view')+'.html';	
	}



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


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

listIllo2 = new Array();
listIllo2[0] = "illo2"
listIllo2[1] = new Array();
listIllo2[2] = "illustration 2"

listIllo3 = new Array();
listIllo3[0] = "illo3"
listIllo3[1] = new Array();
listIllo3[2] = "illustration 3"


addWork(listIllo, "artificial", "Robot cat & mouse", 2010);
addWork(listIllo, "atmosphere", "Smoking on the Moon", 2010);
addWork(listIllo, "barbie51", "Barbie aged 51", 2010);
addWork(listIllo, "bertisevil", "Bert is evil", 2011);
addWork(listIllo, "bonsaikitten", "Bonsai kitten", 2010);
addWork(listIllo, "borisbike", "Pimped-out Boris bike", 2011);
addWork(listIllo, "rconspiracy", "The Royal Family are Lizards!", 2010);
addWork(listIllo, "crossbows", "Crossbows & Catapults", 2010);
addWork(listIllo, "graffiti", "Toilet wall graffiti", 2010);
addWork(listIllo, "jedireligion", "Jedi religion", 2010);
addWork(listIllo, "knex", "K-Nex cocktail", 2010);
addWork(listIllo, "mcdonaldsneverrots", "McDonalds food 'never rots'", 2010);
addWork(listIllo, "motherorlover", "Impromptu games: Mother or lover", 2011);
addWork(listIllo, "rcpope", "Radio control Pope", 2010);
addWork(listIllo, "robot", "Robot holding flower", 2010);
addWork(listIllo, "sneaky", "Ninja Fleas", 2010);
addWork(listIllo, "spam", "419 Eater", 2010);
addWork(listIllo, "virginmeals", "Virgin Air meal complaint", 2011);


addWork(listIllo2, "library", "Unemployed bankers", 2009);
addWork(listIllo2, "billgates", "Bill Gates",2009);
addWork(listIllo2, "chucknorris", "Chuck Norris", 2009);
addWork(listIllo2, "handmedowns", "HM the Queen", 2008);
addWork(listIllo2, "iceland", "Bjšrk", 2009);
addWork(listIllo2, "itv", "Ant & Dec", 2008);
addWork(listIllo2, "moonwalker", "Michael Jackson", 2008);
addWork(listIllo2, "snakecharmer", "Snake Charmer", 2010);
addWork(listIllo2, "shrooms", "David Bowie", 2008);
addWork(listIllo2, "zardoz", "Sean Connery", 2009);
addWork(listIllo2, "matrix", "Neo", 2009);
addWork(listIllo2, "phantommenace", "The Phantom Menace", 2008);
addWork(listIllo2, "banks", "We own the banks", 2009);
addWork(listIllo2, "brum", "Come to Birmingham", 2009);
addWork(listIllo2, "conspiracy", "Conspiracy theory", 2009);
addWork(listIllo2, "hampsterdance", "Hampster Dance", 2008);
addWork(listIllo2, "freecycle", "Free mayo", 2009);
addWork(listIllo2, "perspective", "Perspective", 2010);


addWork(listIllo3, "indianajones", "Indiana Jones & the Crystal Skull", 2008);
addWork(listIllo3, "meanness", "St Scrooge", 2009);
addWork(listIllo3, "piggy", "Smashed piggy bank", 2009);
addWork(listIllo3, "nerds", "Wargames", 2009);
addWork(listIllo3, "pratchett", "Terry Pratchett", 2009);
addWork(listIllo3, "scifi", "sci-fi", 2009);
addWork(listIllo3, "weed", "Weed", 2009);
addWork(listIllo3, "littlesister", "Little Sister", 2008);
addWork(listIllo3, "dinners", "School dinners", 2009);
addWork(listIllo3, "poison", "Poison", 2008);
addWork(listIllo3, "retro", "Retro-gaming", 2008);
addWork(listIllo3, "witch", "The Witch", 2008);
addWork(listIllo3, "numanuma", "Numa Numa", 2008);
addWork(listIllo3, "spongmonkey", "Spongmonkeys", 2008);
addWork(listIllo3, "tronguy", "Tron Guy", 2008);
addWork(listIllo3, "catwoman", "Cat Woman", 2009);
addWork(listIllo3, "lawnmowerman", "Lawnmower Man", 2008);
addWork(listIllo3, "estate", "Estate agents crash & burn", 2009);



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 writeBarPage(whichList)
	{
	document.write('<TABLE cellspacing=3 cellpadding=0 border=0 align=center><TR>');
	writeThumbs(whichList,3,"illuview");
	document.write('</TR></TABLE></A>');
	}



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="illu-pages/'+itemFile+'.html" ');
			document.write('onmouseover="imageswitch(\''+itemFile+'\',\'images/thumb_on.gif\')" onmouseout="imageswitch(\''+itemFile+'\',\'images/thumb_off.gif\')">');
			document.write('<IMG src="images/thumb_off.gif" width="70" height="70" 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(image1, image2src)
	{
	document[image1].src = image2src;
	return true;
	}



