// Copyright 2009 - 2010, Jason Sinclair Astorquia, All rights reserved

function gallery()
{
	this.sections			= null;	
	this.selectedSection 	= null;

	this.galleryNode;
	this.contentsNode;
	
	this.tocNode;
	
	this.headerNode;
	this.headerImg;
	
	this.displayNode;
	
	this.infoNode;
	this.displayBodyNode;
	this.sellersNode;

	this.initSections();
}
gallery.prototype.WIDTH  		= 1110;
gallery.prototype.HEIGHT 		= 700;
gallery.prototype.HEADER_HEIGHT = 23;
gallery.prototype.INFO_WIDTH	= 195;
gallery.prototype.DISPLAY_WIDTH	= 910;


function gallery_initSections()
{
	var lSection;	
	
	// init the sections
	this.sections = new Array();

	// home
	lSection = new section('home', section.prototype.TYPE_SPLASH);
	lSection.idx = this.sections.length;
	lSection.parentObj = this;
	
	this.configureHome(lSection);
	this.sections.push(lSection);
	
	// acrylics
	lSection = new section('portfolio', section.prototype.TYPE_PORTFOLIO);
	lSection.idx = this.sections.length;
	lSection.parentObj = this;
	
	this.configureAcrylics(lSection);
	this.sections.push(lSection);
	
	// bio/about
	lSection = new section('about', section.prototype.TYPE_CONTACTINFO);
	lSection.idx = this.sections.length;
	lSection.parentObj = this;

	var lAbout = new about();
	lSection.displayObj = lAbout;
	this.sections.push(lSection);	

	//statements
	lSection = new section('statement', section.prototype.TYPE_CONTACTINFO);
	lSection.idx = this.sections.length;
	lSection.parentObj = this;
	
	var lStatement = new statement();
	lSection.displayObj = lStatement;
	this.sections.push(lSection);
	
	// shows
	//lSection = new section('shows', section.prototype.TYPE_SHOWS);
	//lSection.idx = this.sections.length;
	//lSection.parentObj = this;
	
	//this.configureShowList(lSection);
	//this.sections.push(lSection);
	
	// contact
	lSection = new section('contact', section.prototype.TYPE_CONTACTINFO);
	lSection.idx = this.sections.length;
	lSection.parentObj = this;

	var lContact = new contact();
	lSection.displayObj = lContact;
	this.sections.push(lSection);	
	
}
gallery.prototype.initSections = gallery_initSections;


function gallery_configureHome(section)
{
	var lSplash;
	var lPhoto;
	
	lSplash = new splash();
	lSplash.parentObj = section;
	
	// name, thumb, img, height, width, text

	lPhoto = new photo('autumn lake', null, 'images/autumnLake.jpg', 600, 599, null);
	lSplash.addPhoto(lPhoto);
	
	lPhoto = new photo('civilized tundra', null, 'images/civilizedTundra.jpg', 600, 500, null);
	lSplash.addPhoto(lPhoto);

	lPhoto = new photo('bubble universe ii', null, 'images/bubbleUniverseII.jpg', 443, 900, null);
	lSplash.addPhoto(lPhoto);

	lPhoto = new photo('event horizon', null, 'images/eventHorizon.jpg', 600, 603, null);
	lSplash.addPhoto(lPhoto);
	
	lPhoto = new photo('void (red)', null, 'images/voidRed.jpg', 600, 754, null);
	lSplash.addPhoto(lPhoto);
	
	lPhoto = new photo('carta', null, 'images/carta.jpg', 550, 947, null);
	lSplash.addPhoto(lPhoto);
	
	lPhoto = new photo('void (blue)', null, 'images/voidBlue.jpg', 600, 528, null);
	lSplash.addPhoto(lPhoto);
	
	lPhoto = new photo('nickel', null, 'images/nickel.jpg', 600, 533, null);
	lSplash.addPhoto(lPhoto);

	lPhoto = new photo('spacescape (green)', null, 'images/spacescapeGreen.jpg', 600, 903, null);
	lSplash.addPhoto(lPhoto);
	
	lPhoto = new photo('autumn flows', null, 'images/autumnFlows.jpg', 600, 704, null);
	lSplash.addPhoto(lPhoto);
	
	lPhoto = new photo('fractal tree iv', null, 'images/fractalTreeIV.jpg', 600, 707, null);
	lSplash.addPhoto(lPhoto);
 
	lPhoto = new photo('the falls', null, 'images/theFalls.jpg', 600, 597, null);
	lSplash.addPhoto(lPhoto);
	
	lPhoto = new photo('encoded', null, 'images/encoded.jpg', 600, 491, null);
	lSplash.addPhoto(lPhoto)
	
 

	// set the display object	
	section.displayObj = lSplash;
}
gallery.prototype.configureHome = gallery_configureHome;

function gallery_configureAcrylics(section)
{
	var acrylics;
	var lSeries;
	var lPhoto;
	var medium = 'acrylic on canvas';
	
	acrylics = new portfolio();
	acrylics.parentObj = section;
	


	// impressions
	lSeries = new series('impressions', 'images/impressionSeries.jpg', '');
	acrylics.addSeries(lSeries);
	
	lPhoto = new photo('nickel', 'images/nickelThumb.jpg', 'images/nickel.jpg', 600, 533, medium, '48" x 54"', 2011, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('civilized tundra', 'images/civilizedTundraThumb.jpg', 'images/civilizedTundra.jpg', 600, 500, medium, '50" x 60"', 2011, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('paas ii', 'images/paasIIThumb.jpg', 'images/paasII.jpg', 600, 256, medium, '18" x 42"', 2011, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('borg', 'images/borgThumb.jpg', 'images/borg.jpg', 600, 600, medium, '36" x 36"', 2011, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('labyrinth', 'images/labyrinthThumb.jpg', 'images/labyrinth.jpg', 600, 723, medium, '30" x 36"', 2011, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('manhattan', 'images/manhattanThumb.jpg', 'images/manhattan.jpg', 600, 718, medium, '30" x 36"', 2011, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('paas', 'images/paasThumb.jpg', 'images/paas.jpg', 600, 284, medium, '20" x 42"', 2011, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('eden', 'images/edenThumb.jpg', 'images/eden.jpg', 600, 640, medium, '56" x 60"', 2010, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('obscured', 'images/obscuredThumb.jpg', 'images/obscured.jpg', 600, 669, medium, '54" x 60"', 2010, 'private collection');
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('encoded', 'images/encodedThumb.jpg', 'images/encoded.jpg', 600, 491, medium, '48" x 58"', 2010, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('pixelate', 'images/pixelateThumb.jpg', 'images/pixelate.jpg', 600, 545, medium, '54" x 60"', 2010, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('golden gate', 'images/goldenGateThumb.jpg', 'images/goldenGate.jpg', 600, 562, medium, '56" x 60"', 2010, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('autumn flows', 'images/autumnFlowsThumb.jpg', 'images/autumnFlows.jpg', 600, 704, medium, '30" x 36"', 2010, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('midnight', 'images/midnightThumb.jpg', 'images/midnight.jpg', 600, 783, medium, '30" x 40"', 2010, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('distorted', 'images/distortedThumb.jpg', 'images/distorted.jpg', 600, 661, medium, '54" x 60"', 2010, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('maya', 'images/mayaThumb.jpg', 'images/maya.jpg', 600, 517, medium, '48" x 58"', 2010, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('java', 'images/javaThumb.jpg', 'images/java.jpg', 599, 814, medium, '24" x 36"', 2010, 'private collection');
	lSeries.addPhoto(lPhoto);


	// void/dimension
	lSeries = new series('void/dimension', 'images/voidSeries.jpg', '');
	acrylics.addSeries(lSeries);
	
	lPhoto = new photo('matrix', 'images/matrixThumb.jpg', 'images/matrix.jpg', 600, 599, medium, '48" x 48"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('event horizon', 'images/eventHorizonThumb.jpg', 'images/eventHorizon.jpg', 600, 603, medium, '48" x 48"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('autumn lake', 'images/autumnLakeThumb.jpg', 'images/autumnLake.jpg', 600, 599, medium, '48" x 48"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('bubble universe i', 'images/bubbleUniverseIThumb.jpg', 'images/bubbleUniverseI.jpg', 600, 732, medium, '48" x 60"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('bubble universe ii', 'images/bubbleUniverseIIThumb.jpg', 'images/bubbleUniverseII.jpg', 443, 900, medium, '24" x 48"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('autumn lake ii', 'images/autumnLakeIIThumb.jpg', 'images/autumnLakeII.jpg', 445, 900, medium, '24" x 48"', 2011, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('the falls', 'images/theFallsThumb.jpg', 'images/theFalls.jpg', 600, 597, medium, '48" x 48"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('waves', 'images/wavesThumb.jpg', 'images/waves.jpg', 600, 725, medium, '30" x 36"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('void (blue)', 'images/voidBlueThumb.jpg', 'images/voidBlue.jpg', 600, 528, medium, '48" x 54"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('void (red)', 'images/voidRedThumb.jpg', 'images/voidRed.jpg', 600, 754, medium, '48" x 60"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('void (green)', 'images/voidGreenThumb.jpg', 'images/voidGreen.jpg', 600, 530, medium, '48" x 54"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('void (gold)', 'images/voidGoldThumb.jpg', 'images/voidGold.jpg', 600, 531, medium, '48" x 54"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('spacescape (green)', 'images/spacescapeGreenThumb.jpg', 'images/spacescapeGreen.jpg', 600, 903, medium, '24" x 36"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('spacescape (blue)', 'images/spacescapeBlueThumb.jpg', 'images/spacescapeBlue.jpg', 600, 908, medium, '24" x 36"', 2011, 'private collection');
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('spacescape (red)', 'images/spacescapeRedThumb.jpg', 'images/spacescapeRed.jpg', 600, 909, medium, '24" x 36"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('spacescape (gold)', 'images/spacescapeGoldThumb.jpg', 'images/spacescapeGold.jpg', 600, 911, medium, '24" x 36"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	//lPhoto = new photo('spacescape (violet)', 'images/spacescapeVioletThumb.jpg', 'images/spacescapeViolet.jpg', 600, 900, medium, '24" x 36"', 2011, null);
	//lSeries.addPhoto(lPhoto);
	

	// fractals & dimension
	lSeries = new series('fractals/dimension', 'images/fractalsDimensionSeries.jpg', '');
	acrylics.addSeries(lSeries);

	lPhoto = new photo('fractal tree iv', 'images/fractalTreeIVThumb.jpg', 'images/fractalTreeIV.jpg', 600, 707, medium, '36" x 40"', 2011, 'private collection');
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('fractal tree i', 'images/fractalTreeIThumb.jpg', 'images/fractalTreeI.jpg', 600, 671, medium, '36" x 40"', 2011, 'private collection');
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('orbits ii', 'images/orbitsIIThumb.jpg', 'images/orbitsII.jpg', 600, 621, medium, '48" x 50"', 2011, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('orbits i', 'images/orbitsThumb.jpg', 'images/orbits.jpg', 600, 577, medium, '48" x 50"', 2011, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('grid (gold ii)', 'images/gridGoldIIThumb.jpg', 'images/gridGoldII.jpg', 600, 539, medium, '36" x 40"', 2011, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('mckenna', 'images/mckennaThumb.jpg', 'images/mckenna.jpg', 600, 537, medium, '36" x 40"', 2011, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('grid (buff)', 'images/gridBuffThumb.jpg', 'images/gridBuff.jpg', 600, 540, medium, '36" x 40"', 2011, null);
	lSeries.addPhoto(lPhoto);
 
	//lPhoto = new photo('spores i', 'images/sporesIThumb.jpg', 'images/sporesI.jpg', 600, 803, medium, '24" x 32"', 2011, null);
	//lSeries.addPhoto(lPhoto);
 
	//lPhoto = new photo('spores ii', 'images/sporesIIThumb.jpg', 'images/sporesII.jpg', 600, 727, medium, '30" x 36"', 2011, null);
	//lSeries.addPhoto(lPhoto);
 
	//lPhoto = new photo('spores iii', 'images/sporesIIIThumb.jpg', 'images/sporesIII.jpg', 600, 667, medium, '36" x 40"', 2011, null);
	//lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('von neumann', 'images/vonNeumannThumb.jpg', 'images/vonNeumann.jpg', 600, 538, medium, '36" x 40"', 2011, 'private collection');
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('grid (gold)', 'images/gridGoldThumb.jpg', 'images/gridGold.jpg', 600, 541, medium, '36" x 40"', 2011, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('grid (green)', 'images/gridGreenThumb.jpg', 'images/gridGreen.jpg', 600, 542, medium, '36" x 40"', 2011, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('grid panel (blue)', 'images/gridPanelBlueThumb.jpg', 'images/gridPanelBlue.jpg', 600, 179, medium, '18" x 60"', 2011, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('grid panel (red)', 'images/gridPanelRedThumb.jpg', 'images/gridPanelRed.jpg', 600, 178, medium, '18" x 60"', 2011, null);
	lSeries.addPhoto(lPhoto);
 
	//lPhoto = new photo('ghosts', 'images/ghostsThumb.jpg', 'images/ghosts.jpg', 600, 494, medium, '30" x 36"', 2011, null);
	//lSeries.addPhoto(lPhoto);
 
 
	// animals in negative
	lSeries = new series('animals in negative', 'images/animalsInNegativeSeries.jpg', '');
	acrylics.addSeries(lSeries);
	
	lPhoto = new photo('orangutan', 'images/orangutanThumb.jpg', 'images/orangutan.jpg', 600, 448, medium, '36" x 48"', 2010, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('eagle', 'images/eagleThumb.jpg', 'images/eagle.jpg', 446, 900, medium, '30" x 60"', 2010, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('drew\'s baby grey in rose', 'images/drewsBabyGreyInRoseThumb.jpg', 'images/drewsBabyGreyInRose.jpg', 600, 725, medium, '48" x 58"', 2009, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('octopus', 'images/octopusThumb.jpg', 'images/octopus.jpg', 600, 629, medium, '40" x 42"', 2010, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('rhino', 'images/rhinoThumb.jpg', 'images/rhino.jpg', 600, 397, medium, '24" x 36"', 2010, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('homesick', 'images/homesickThumb.jpg', 'images/homesick.jpg', 600, 399, medium, '24" x 36"', 2010, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('kudu', 'images/kuduThumb.jpg', 'images/kudu.jpg', 600, 493, medium, '48" x 58"', 2009, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('orrie\'s elephant', 'images/orriesElephantThumb.jpg', 'images/orriesElephant.jpg', 600, 626, medium, '40" x 42"', 2009, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('stubborn arse', 'images/stubbornArseThumb.jpg', 'images/stubbornArse.jpg', 600, 597, medium, '40" x 40"', 2009, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('sailing the vermilion sea', 'images/sailingTheVermilionSeaThumb.jpg', 'images/sailingTheVermilionSea.jpg', 600, 733, medium, '48" x 58"', 2009, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('the stoic', 'images/theStoicThumb.jpg', 'images/theStoic.jpg', 600, 599, medium, '42" x 42"', 2009, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('persistence in zen', 'images/persistenceInZenThumb.jpg', 'images/persistenceInZen.jpg', 600, 598, medium, '42" x 42"', 2009, null);
	lSeries.addPhoto(lPhoto);


	// more impressions
	lSeries = new series('more impressions', 'images/moreImpressionsSeries.jpg', '');
	acrylics.addSeries(lSeries);

	lPhoto = new photo('madras', 'images/madrasThumb.jpg', 'images/madras.jpg', 600, 728, medium, '30" x 36"', 2010, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('caramel bicarbonate', 'images/caramelThumb.jpg', 'images/caramel.jpg', 600, 706, medium, '48" x 54"', 2011, null);
	lSeries.addPhoto(lPhoto);
 
	lPhoto = new photo('helix', 'images/helixThumb.jpg', 'images/helix.jpg', 600, 772, medium, '30" x 36"', 2010, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('gumballs & wonder bread (triptych)', 'images/gumballsIThumb.jpg', 'images/gumballsWonderBread.gif', 600, 900, medium, '84" x 60"', 2010, null);
	lSeries.addPhoto(lPhoto);

	//lPhoto = new photo('gumballs & wonder bread ii', 'images/gumballsIIThumb.jpg', 'images/gumballsII.jpg', 600, 173, medium, '18" x 60"', 2010, null);
	//lSeries.addPhoto(lPhoto);
	
	//lPhoto = new photo('gumballs & wonder bread i', 'images/gumballsIThumb.jpg', 'images/gumballsI.jpg', 600, 466, medium, '48" x 60"', 2010, null);
	//lSeries.addPhoto(lPhoto);

	//lPhoto = new photo('gumballs & wonder bread iii', 'images/gumballsIIIThumb.jpg', 'images/gumballsIII.jpg', 600, 170, medium, '18" x 60"', 2010, null);
	//lSeries.addPhoto(lPhoto);

	lPhoto = new photo('daybreak', 'images/daybreakThumb.jpg', 'images/daybreak.jpg', 600, 598, medium, '42" x 42"', 2009, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('amino', 'images/aminoThumb.jpg', 'images/amino.jpg', 600, 803, medium, '36" x 48"', 2010, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('nurture skews nature', 'images/nurtureSkewsNatureThumb.jpg', 'images/nurtureSkewsNature.jpg', 600, 811, medium, '30" x 40"', 2009, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('sydney opera house', 'images/sydneyThumb.jpg', 'images/sydney.jpg', 600, 696, medium, '48" x 58"', 2010, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('waiting', 'images/waitingThumb.jpg', 'images/waiting.jpg', 600, 516, medium, '50" x 58"', 2009, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('gotham rain', 'images/gothamRainThumb.jpg', 'images/gothamRain.jpg', 600, 892, medium, '24" x 36"', 2010, null);
	lSeries.addPhoto(lPhoto);

	//lPhoto = new photo('time', 'images/timeThumb.jpg', 'images/time.jpg', 600, 501, medium, '50" x 60"', 2010, null);
	//lSeries.addPhoto(lPhoto);

	//lPhoto = new photo('phi', 'images/phiThumb.jpg', 'images/phi.jpg', 600, 493, medium, '48" x 58"', 2009, null);
	//lSeries.addPhoto(lPhoto);


 	// oz
	lSeries = new series('oz', 'images/ozSeries.jpg', '');
	acrylics.addSeries(lSeries);
	
	lPhoto = new photo('gold iii', 'images/goldIIIThumb.jpg', 'images/goldIII.jpg', 600, 725, medium, '30" x 36"', 2011, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('carta', 'images/cartaThumb.jpg', 'images/carta.jpg', 550, 947, medium, '42" x 72"', 2010, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('gold ii', 'images/goldIIThumb.jpg', 'images/goldII.jpg', 600, 718, medium, '30" x 36"', 2011, 'private collection');
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('green ii', 'images/greenIIThumb.jpg', 'images/greenII.jpg', 600, 720, medium, '30" x 36"', 2011, 'private collection');
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('gold', 'images/goldThumb.jpg', 'images/gold.jpg', 600, 667, medium, '48" x 54"', 2010, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('teal', 'images/ozTealThumb.jpg', 'images/ozTeal.jpg', 600, 680, medium, '48" x 54"', 2010, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('blue', 'images/blueThumb.jpg', 'images/blue.jpg', 600, 673, medium, '48" x 54"', 2010, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('green gold', 'images/greenGoldThumb.jpg', 'images/greenGold.jpg', 600, 667, medium, '48" x 54"', 2010, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('chromium oxide', 'images/chromiumOxideThumb.jpg', 'images/chromiumOxide.jpg', 600, 665, medium, '54" x 60"', 2010, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('turquoise', 'images/turquoiseThumb.jpg', 'images/turquoise.jpg', 600, 661, medium, '48" x 54"', 2010, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('crimson', 'images/crimsonThumb.jpg', 'images/crimson.jpg', 600, 669, medium, '48" x 54"', 2010, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('scarlet', 'images/scarletThumb.jpg', 'images/scarlet.jpg', 600, 653, medium, '54" x 60"', 2010, null);
	lSeries.addPhoto(lPhoto);
	
	//lPhoto = new photo('orange', 'images/orangeThumb.jpg', 'images/orange.jpg', 600, 662, medium, '48" x 54"', 2010, null);
	//lSeries.addPhoto(lPhoto);
	
	
	// reality melts
	lSeries = new series('reality melts', 'images/realityMeltsSeries.jpg', '');
	acrylics.addSeries(lSeries);

	lPhoto = new photo('snow lake', 'images/snowLakeThumb.jpg', 'images/snowLake.jpg', 600, 797, medium, '30" x 40"', 2008, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('swimming', 'images/swimmingThumb.jpg', 'images/swimming.jpg', 600, 906, medium, '24" x 36"', 2008, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('icarus', 'images/icarusThumb.jpg', 'images/icarus.jpg', 600, 809, medium, '30" x 40"', 2008, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('emerge', 'images/emergeThumb.jpg', 'images/emerge.jpg', 600, 904, medium, '24" x 36"', 2008, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('melting', 'images/meltingThumb.jpg', 'images/melting.jpg', 600, 801, medium, '30" x 40"', 2008, null);
	lSeries.addPhoto(lPhoto);


	// quadrachrome
	lSeries = new series('silhouettes', 'images/quadrachromeSeries.jpg', '');
	acrylics.addSeries(lSeries);

	lPhoto = new photo('feed the tree', 'images/feedTheTreeThumb.jpg', 'images/feedTheTree.jpg', 600, 608, medium, '54" x 54"', 2009, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('the faceless', 'images/theFacelessThumb.jpg', 'images/theFaceless.jpg', 600, 810, medium, '30" x 40"', 2008, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('quadrachrome', 'images/quadrachromeThumb.jpg', 'images/quadrachrome.jpg', 600, 494, medium, '50" x 60"', 2008, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('glass mirrors', 'images/glassMirrorsThumb.jpg', 'images/glassMirrors.jpg', 600, 572, medium, '40" x 42"', 2009, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('emerald city', 'images/emeraldCityThumb.jpg', 'images/emeraldCity.jpg', 600, 481, medium, '48" x 60"', 2009, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('city of angels', 'images/cityOfAngelsThumb.jpg', 'images/cityOfAngels.jpg', 600, 446, medium, '30" x 40"', 2008, null);
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('silhouettes and a bridge', 'images/silhouettesAndABridgeThumb.jpg', 'images/silhouettesAndABridge.jpg', 600, 586, 2008, medium, '44" x 44"', null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('ballerina', 'images/ballerinaThumb.jpg', 'images/ballerina.jpg', 600, 599, medium, '42" x 42"', 2009, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('pause', 'images/pauseThumb.jpg', 'images/pause.jpg', 600, 595, medium, '38" x 38"', 2008, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('the fire', 'images/theFireThumb.jpg', 'images/theFire.jpg', 600, 476, medium, '24" x 30"', 2008, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('watching', 'images/watchingThumb.jpg', 'images/watching.jpg', 600, 602, medium, '36" x 36"', 2009, null);
	lSeries.addPhoto(lPhoto);

	//lPhoto = new photo('the arrival', 'images/theArrivalThumb.jpg', 'images/theArrival.jpg', 600, 797, medium, '30" x 40"', 2008, null);
	//lSeries.addPhoto(lPhoto);

	lPhoto = new photo('moongazer', 'images/moongazerThumb.jpg', 'images/moongazer.jpg', 600, 467, medium, '24" x 30"', 2008, null);
	lSeries.addPhoto(lPhoto);
	
	//lPhoto = new photo('reflections', 'images/reflectionsThumb.jpg', 'images/reflections.jpg', 600, 789, medium);
	//lSeries.addPhoto(lPhoto);

	//lPhoto = new photo('interrogation', 'images/interrogationThumb.jpg', 'images/interrogation.jpg', 600, 792, medium, '30" x 40"', 2008, null);
	//lSeries.addPhoto(lPhoto);



	// misc
	lSeries = new series('revolution/etc.', 'images/miscSeries.jpg', '');
	acrylics.addSeries(lSeries);

	lPhoto = new photo('revolution clears', 'images/revolutionClearsThumb.jpg', 'images/revolutionClears.jpg', 600, 603, medium, '48" x 48"', 2009, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('evolove', 'images/evoloveThumb.jpg', 'images/evolove.jpg', 600, 599, medium, '42" x 42"', 2010, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('teal', 'images/tealThumb.jpg', 'images/teal.jpg', 600, 601, medium, '42" x 42"', 2010, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('revolution', 'images/revolutionThumb.jpg', 'images/revolution.jpg', 600, 595, medium, '44" x 44"', 2008, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('revolution manifests', 'images/revolutionManifestsThumb.jpg', 'images/revolutionManifests.jpg', 600, 450, medium, '30" x 40"', 2008, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('sandstorm', 'images/sandstormThumb.jpg', 'images/sandstorm.jpg', 600, 720, medium, '30" x 36"', 2008, 'private collection');
	lSeries.addPhoto(lPhoto);
	
	lPhoto = new photo('flyer', 'images/flyerThumb.jpg', 'images/flyer.jpg', 600, 803, medium, '30" x 40"', 2010, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('lose touch', 'images/loseTouchThumb.jpg', 'images/loseTouch.jpg', 600, 596, medium, '42" x 42"', 2009, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('judgement', 'images/judgementThumb.jpg', 'images/judgement.jpg', 600, 605, medium, '44" x 44"', 2009, null);
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('present in the garden', 'images/presentInTheGardenThumb.jpg', 'images/presentInTheGarden.jpg', 600, 480, medium, '24" x 30"', 2008, 'private collection');
	lSeries.addPhoto(lPhoto);

	lPhoto = new photo('radiate', 'images/radiateThumb.jpg', 'images/radiate.jpg', 600, 475, medium, '24" x 30"', 2008, null);
	lSeries.addPhoto(lPhoto);


	
	// set the display object	
	section.displayObj = acrylics;
}
gallery.prototype.configureAcrylics = gallery_configureAcrylics;


function gallery_configureShowList(section)
{
	var lShowList;
	var lShow;
	var lVenue;
	var lPhoto;
	var lReception;
	
	lShowList = new showList();
	lShowList.parentObj = section;
	
	// steven barrett
				   //   name, logo, addr1, addr2, city, state, zip, webURL, phone
	lVenue = new venue('Steven Barrett Salon', 'images/stevenBarrett.jpg', '1907 2nd Avenue', null, 'Seattle', 'WA', '98101', 'http://stevenbarrettsalon.com', '206.448.8466');
	
				  // venue,  start,                  end,  desc
	lShow = new show(lVenue, new Date(2010, 02, 01), new Date(2010, 08, 01), 'impressions');
	
	
							// show, flyer, start, 							  end, 							   desc
	lReception = new reception(lShow, null, new Date(2010, 07, 05, 18, 0, 0), new Date(2010, 07, 05, 21, 0, 0), null);
	lShow.addReception(lReception);
	
	lShow = new show(lVenue, new Date(2011, 04, 01), new Date(2011, 10, 01), 'impressions, fractals/dimension');
	
	lShowList.addShow(lShow);
	

	// anthropologie
	lVenue = new venue('Anthropologie', null, '1509 Fifth Avenue', null, 'Seattle', 'WA', '98101', 'http://www.anthropologie.com', '206.381.5900');
	lShow = new show(lVenue, new Date(2010, 08, 01), new Date(2010, 09, 01), 'animals');
	lShowList.addShow(lShow);

	lShow = new show(lVenue, new Date(2011, 06, 01), new Date(2011, 07, 01), 'animals');
	lShowList.addShow(lShow);
	
	
	// alki arts
	lVenue = new venue('Alki Arts', null, '2820 Alki Avenue SW', null, 'Seattle', 'WA', '98116', 'http://www.alkiarts.com', '206.432.9936');
	lShow = new show(lVenue, new Date(2010, 07, 01), new Date(2011, 11, 01), 'impressions');
	lShowList.addShow(lShow);

	
	// derby
	lVenue = new venue('Derby Salon', null, '16315 Roosevelt Way', null, 'Seattle', 'WA', '98115', 'http://derbysalon.com', '206.526.1470');
	lShow = new show(lVenue, new Date(2010, 04, 01), new Date(2010, 05, 01), 'animals and silhouettes');
	lShowList.addShow(lShow);


	// ola
	lVenue = new venue('Ola Salon', null, '2942 Avalon Way', null, 'Seattle', 'WA', '98126', 'http://www.olasalon.com', '206.933.6702');
	lShow = new show(lVenue, new Date(2010, 02, 01), new Date(2010, 05, 01), null);
	lShowList.addShow(lShow);
	
	lShow = new show(lVenue, new Date(2008, 08, 01), new Date(2008, 10, 01), null);
	lShowList.addShow(lShow);
	
	// bathhouse
	//lVenue = new venue('Alki Bathhouse', null, '2701 Alki Ave. SW', null, 'Seattle', 'WA', null, 'http://www.cityofseattle.net/Parks/Arts/alkiart.htm', '206.684.7430');
	//lShow = new show(lVenue, new Date(2010, 03, 01), new Date(2010, 05, 01), 'selected animals');
	//lShowList.addShow(lShow);

	//lShow = new show(lVenue, new Date(2010, 00, 01), new Date(2010, 02, 01), 'selected animals');
	//lShowList.addShow(lShow);
	
	//lShow = new show(lVenue, new Date(2009, 03, 01), new Date(2009, 05, 01), 'quadrachrome');
	//lShowList.addShow(lShow);

	//lShow = new show(lVenue, new Date(2009, 00, 01), new Date(2009, 02, 01), 'silhouettes');
	//lShowList.addShow(lShow);
	

	// alki mail
	//lVenue = new venue('Alki Mail and Dispatch', null, '4701 SW Admiral Way', null, 'Seattle', 'WA', '98116', 'http://www.alkimail.com', '206.932.2556');
	//lShow = new show(lVenue, new Date(2010, 02, 01), new Date(2010, 02, 01), 'animals');
	//lShowList.addShow(lShow);

	//lShow = new show(lVenue, new Date(2009, 06, 01), new Date(2009, 06, 01), 'silhouettes');
	//lShowList.addShow(lShow);

	
	// coffee to a tea
	//lVenue = new venue('Coffee to a Tea', null, '4541 California Ave. SW', null, 'Seattle', 'WA', '98116', 'http://www.sugarrushbakingcompany.com', '206.937.1495');
	//lShow = new show(lVenue, new Date(2009, 08, 01), new Date(2009, 08, 01), 'animals and revolution');
	//lShowList.addShow(lShow);	
	
	// circa
	lVenue = new venue('Circa', null, '2605 California Ave. SW', null, 'Seattle', 'WA', '98116', 'http://www.circawestseattle.com', '206.923.1102');
	lShow = new show(lVenue, new Date(2011, 02, 01), new Date(2011, 02, 01), 'oz');
	lShowList.addShow(lShow);	
	
	lShow = new show(lVenue, new Date(2010, 01, 01), new Date(2010, 01, 01), 'animals');
	lShowList.addShow(lShow);	

	lShow = new show(lVenue, new Date(2009, 01, 01), new Date(2009, 01, 01), 'revolution, quadrachrome and reality melts');
	lShowList.addShow(lShow);	

	
	// elliott bay
	lVenue = new venue('Elliott Bay Brewery', null, '4720 California Ave. SW', null, 'Seattle', 'WA', '98116', 'http://www.elliottbaybrewing.com', '206.932.8695');
	lShow = new show(lVenue, new Date(2010, 02, 01), new Date(2010, 03, 01), 'animals and impressions');
	lShowList.addShow(lShow);	
	
	lShow = new show(lVenue, new Date(2010, 11, 01), new Date(2010, 11, 01), 'oz');
	lShowList.addShow(lShow);	
	
	lShow = new show(lVenue, new Date(2009, 11, 01), new Date(2010, 00, 01), 'quadrachrome and silhouettes');
	lShowList.addShow(lShow);	
	
	
	// 14 carrot
	//lVenue = new venue('14 Carrot', null, '2305 Eastlake Ave E', null, 'Seattle', 'WA', '98102', null, '206.324.1442');
	//lShow = new show(lVenue, new Date(2009, 00, 01), new Date(2009, 02, 01), 'silhouettes and quadrachrome');
	//lShowList.addShow(lShow);	


	// set the display object	
	section.displayObj = lShowList;
}
gallery.prototype.configureShowList = gallery_configureShowList;


function gallery_draw()
{
	var section;
	var top;
	var obj;
	var x;

	this.galleryNode = obtainElement('div');
	this.galleryNode.style.top = '0px';
	this.galleryNode.style.left = '0px';

	obj = obtainElement('div');
	obj.className = 'header';
	obj.style.top = '0px';
	obj.style.left = '0px';
	obj.style.height = this.HEADER_HEIGHT + 'px';
	obj.style.width = '100%';
	this.galleryNode.appendChild(obj);

	this.contentsNode = obtainElement('div');
	this.contentsNode.style.height = '100%';
	this.contentsNode.style.width = this.WIDTH + 'px';
	this.contentsNode.style.top = '0px';
	//this.contentsNode.style.backgroundColor = 'blue';
	this.galleryNode.appendChild(this.contentsNode);

	this.headerNode = obtainElement('div');
	this.headerNode.className = 'header';
	this.headerNode.style.top = '0px';
	this.headerNode.style.left = '0px';
	this.headerNode.style.height = this.HEADER_HEIGHT + 'px';
	this.headerNode.style.width = '100%';
	this.contentsNode.appendChild(this.headerNode);
	
	this.headerImg = obtainElement('div');
	this.headerImg.style.top = '2px';
	this.headerImg.style.height = '80px';
	this.headerImg.style.width = '80px';
	this.headerImg.style.left = Math.floor((this.INFO_WIDTH - 80) / 2) + 'px';
	this.headerImg.style.backgroundImage = 'url(images/jsa2.jpg)';
	this.headerImg.style.backgroundRepeat = 'no-repeat';
	this.headerImg.style.backgroundPosition = 'center center';
	
	this.tocNode = obtainElement('div');
	this.tocNode.className = 'toc';
	this.tocNode.style.top = '0px';
	this.tocNode.style.left = (this.INFO_WIDTH + 25) + 'px';
	
	this.tocNode.innerHTML = this.getTOC(0);
	
	this.headerNode.appendChild(this.tocNode);
	
	// display
	top = this.HEADER_HEIGHT;
	this.displayNode = obtainElement('div');
	this.displayNode.style.top = top + 'px';
	this.displayNode.style.width = '100%';
	this.displayNode.style.left = '0px';
	
	this.infoNode = obtainElement('div');
	this.infoNode.style.top = '0px';
	this.infoNode.style.left = '0px';
	this.infoNode.style.height = '100%';
	this.infoNode.style.width = this.INFO_WIDTH + 'px';
	this.displayNode.appendChild(this.infoNode);
	
	
	this.displayBodyNode = obtainElement('div');
	this.displayBodyNode.style.top = '0px';
	this.displayBodyNode.style.left = this.INFO_WIDTH + 'px';
	this.displayBodyNode.style.height = '100%';
	this.displayBodyNode.style.width = (this.WIDTH - this.INFO_WIDTH) + 'px';
	this.displayBodyNode.style.backgroundImage = 'url(images/jsa2.gif)';
	this.displayBodyNode.style.backgroundRepeat = 'no-repeat';
	this.displayBodyNode.style.backgroundPosition = 'center center';
	//this.displayBodyNode.style.backgroundColor='red';
	this.displayNode.appendChild(this.displayBodyNode);
	
	// copy
	obj = obtainElement('div');
	obj.className = 'copy';
	obj.innerHTML = 'jason sinclair astorquia' // &copy; ' + new Date().getFullYear();
	obj.style.top = '4px';
	obj.style.right = '0px';
	this.headerNode.appendChild(obj);
	
	this.contentsNode.appendChild(this.displayNode);
	this.contentsNode.appendChild(this.headerImg);
	
	// facebook
	//var fb = new Array();
	//fb.push('<iframe src="http://www.facebook.com/plugins/like.php?app_id=220179754689419');
	//fb.push('&amp;href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FJason-Sinclair-Astorquia%2F162681737130391&amp;');
	//fb.push('send=false&amp;layout=button_count&amp;width=55&amp;show_faces=false&amp;action=like&amp;');
	//fb.push('colorscheme=light&amp;font=tahoma&amp;height=21" scrolling="no" frameborder="0" ');
	//fb.push('style="border:none; overflow:hidden; width:75px; height:21px;" allowTransparency="true"></iframe>');
	//obj = obtainElement('div');
	//obj.className = 'copy';
	//obj.innerHTML = fb.join('');
	//obj.style.top = '26px';
	//obj.style.height = '21px';
	//obj.style.width = '75px';
	//obj.style.left = (parseInt(this.headerImg.style.left) + 85) + 'px';
	//this.contentsNode.appendChild(obj);
	
	
	this.sellersNode = obtainElement('div');
	this.sellersNode.style.height = '50px';
	this.sellersNode.style.width = '300px';
	//this.sellersNode.style.backgroundColor = 'blue';
	
	var contents = new Array();
	contents.push('<div class=\"showDetail\" style=\"padding-left:3px;\">@ photos: <a class=\"showDetail\" href=\"http://drewsellers.com\" target=newwindow style=\"font-weight:bold;\">');
	contents.push('<u>Drew Sellers</u>');
	contents.push('</a></div>');
	contents.push('<div>');
	contents.push('<iframe src="http://www.facebook.com/plugins/like.php?app_id=220179754689419');
	contents.push('&amp;href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FJason-Sinclair-Astorquia%2F162681737130391&amp;');
	contents.push('send=false&amp;layout=button_count&amp;width=55&amp;show_faces=false&amp;action=like&amp;');
	contents.push('colorscheme=light&amp;font=tahoma&amp;height=21" scrolling="no" frameborder="0" ');
	contents.push('style="border:none; overflow:hidden; width:100px; height:21px;padding-left:20px;" allowTransparency="true"></iframe>');
	contents.push('</div>');
	this.sellersNode.innerHTML = contents.join('');
		
	obj = document.getElementById('galleryHome');
	obj.appendChild(this.galleryNode);
	obj.appendChild(this.sellersNode);

	this.redraw();
	
	// show the splash
	this.sections[0].load();
	this.selectedSection = this.sections[0];
}
gallery.prototype.draw = gallery_draw;

function gallery_getContactInfo()
{
	var contents = new Array();
	
	contents.push('<center><table width=100%>');
	
	contents.push('<tr>');
	contents.push('<td class="contact">');
	contents.push('@ artist');
	contents.push('</td>');
	contents.push('</tr>');

	contents.push('<tr>');
	contents.push('<td class="contact">');
	contents.push('@&nbsp;206.300.4863<font color=#797979>5</font>');
	contents.push('</td>');
	contents.push('</tr>');

	contents.push('<tr>');
	contents.push('<td class="contact">');
	contents.push('@ w. seattle, wa');
	contents.push('</td>');
	contents.push('</tr>');

	contents.push('<tr>');
	contents.push('<td class="contact" nowrap>');
	contents.push('@ <a class="mail" href="mailto:jason@storksplace.com">jason@storksplace.com</a>');
	contents.push('</td>');
	contents.push('</tr>');
	
	contents.push('</table></center>')
	
	return contents.join('');
}
gallery.prototype.getContactInfo = gallery_getContactInfo;


function gallery_getTOC(selectedIdx)
{
	var sections = new Array();
	sections.push('<table><tr>');

	//sections.push('<td valign=middle class="toc">');
	//sections.push('<iframe src="http://www.facebook.com/plugins/like.php?app_id=220179754689419');
	//sections.push('&amp;href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FJason-Sinclair-Astorquia%2F162681737130391&amp;');
	//sections.push('send=false&amp;layout=button_count&amp;width=55&amp;show_faces=false&amp;action=like&amp;');
	//sections.push('colorscheme=light&amp;font=tahoma&amp;height=21" scrolling="no" frameborder="0" ');
	//sections.push('style="border:none; overflow:hidden; width:75px; height:21px;" allowTransparency="true"></iframe>');
	//sections.push('</td>');

	for (x = 0; x < this.sections.length; x++) {
		section = this.sections[x];
		
		if (x == selectedIdx) {
			sections.push('<td nowrap class="tocHover" valign=middle onclick="gallery_showSection(');
			sections.push(section.idx);
			sections.push(');">')		
		} else {
			sections.push('<td nowrap class="toc" valign=middle onclick="gallery_showSection(');
			sections.push(section.idx);
			sections.push(');" onmouseover="this.className=\'tocHover\'" onmouseout="this.className=\'toc\';">');		
		}
		sections.push(section.text);
		sections.push('</td>');
	}
	

	sections.push('</tr></table>');
	
	return sections.join('');
}
gallery.prototype.getTOC = gallery_getTOC;

function gallery_showSection(id)
{
	var section;
	var selectedSection;
	
	// get the section
	section = gallery.sections[parseInt(id)];
	if (section == null) return;

	// clear out the display
	gallery.clearDisplay();
	
	// reset the menu 
	gallery.tocNode.innerHTML = gallery.getTOC(id);
	
	// get the selectedSection
	selectedSection = gallery.selectedSection;
	gallery.selectedSection = section;
		
	// load the section
	section.load();
	
	// set it as selected
	if (selectedSection != null) {
		selectedSection.deselect();
	}	
}


function gallery_redraw(isResize)
{
	var width;
	var height;
	var left;
	var top;

	width = document.body.clientWidth;
	width = Math.max(width, this.WIDTH);

	height = document.body.clientHeight;
	height = Math.max(height, this.HEIGHT);

	this.galleryNode.style.height 	= height + 'px';
	this.galleryNode.style.width	= width + 'px';
	
	left = Math.max(0, Math.floor((width - this.WIDTH) / 2))
	this.contentsNode.style.left = left + 'px';
	this.sellersNode.style.left = left + 'px';
	this.sellersNode.style.top = (height - 105) + 'px';

	this.displayNode.style.height = (height - this.HEADER_HEIGHT) + 'px';	
	
	if (isResize) setTimeout('gallery.redraw()', 0);
	
	if (this.displayBodyNode == null) return;
	if (!this.displayBodyNode.hasChildNodes()) return;

	var bodyNode;
	var infoNode;
	bodyNode = this.displayBodyNode.childNodes[0];
	if (this.infoNode.hasChildNodes()) infoNode = this.infoNode.childNodes[0];
	
	this.setDisplay(bodyNode, infoNode);
}
gallery.prototype.redraw = gallery_redraw;

function gallery_adjustWidth()
{
	var width;

	width = document.body.clientWidth;
	width = Math.max(width, gallery.WIDTH);

	gallery.galleryNode.style.width	= width + 'px';
}

function gallery_setDisplay(bodyNode, infoNode, showPhoto)
{	
	this.displayBodyNode.style.backgroundImage = '';
	this.displayBodyNode.appendChild(bodyNode);
	
	var height = parseInt(bodyNode.style.height);

	this.sellersNode.style.display = 'none';
	if (showPhoto) this.sellersNode.style.display = 'block';

	if (this.selectedSection != null) {
		switch (this.selectedSection.type) {
			case 1:
 				if (infoNode == null) {
 					infoNode = obtainElement('div');
					infoNode.className = 'showDetail';
					infoNode.style.top = '10px';
					infoNode.style.left = '0px';
					infoNode.style.width = '100%';
					infoNode.style.height = '400px';
					
					var contents = new Array();
					contents.push('Now showing:<br/>');
					contents.push('<div style=\"padding-left:3px;padding-bottom:4px;\"><a class=\"showDetail\" href=\"http://alkiarts.com\" target=newwindow style=\"font-weight:bold;\">');
					contents.push('<u>Alki Arts</u>');
					contents.push('</a></div>');
					//contents.push('<div style=\"padding-left:3px;padding-bottom:4px;\"><a class=\"showDetail\" href=\"http://www.anthropologie.com/\" target=newwindow style=\"font-weight:bold;\">');
					//contents.push('<u>Anthropologie <small>(5th Ave)</small></u>');
					//contents.push('</a></div>');
					//contents.push('<div style=\"padding-left:3px;\"><a class=\"showDetail\" href=\"http://stevenbarrettsalon.com/\" target=newwindow style=\"font-weight:bold;\">');
					//contents.push('<u>Steven Barrett Salon</u>');
					//contents.push('</a></div>');
					//contents.push('<br/>Upcoming:<br/>');
				
					infoNode.innerHTML = contents.join('');
				}
				break;
		}
	}
	if (infoNode) {
		
	
		infoNode.style.top = '65px';
		this.infoNode.appendChild(infoNode);
		
		var infoHeight = parseInt(infoNode.style.height);
		if (infoHeight > height) height = infoHeight;
	}

	this.displayNode.style.height = height + 'px';
	height += this.HEADER_HEIGHT;

	this.galleryNode.style.height = height + 'px';
	gallery_adjustWidth();
}
gallery.prototype.setDisplay = gallery_setDisplay;

function gallery_clearDisplay()
{
	this.displayBodyNode.style.backgroundImage = 'url(images/jsa2.gif)';
	while (this.displayBodyNode.hasChildNodes()) {
		this.displayBodyNode.removeChild(this.displayBodyNode.childNodes[0]);
	}
	while (this.infoNode.hasChildNodes()) {
		this.infoNode.removeChild(this.infoNode.childNodes[0]);
	}
}
gallery.prototype.clearDisplay = gallery_clearDisplay;


function section(text, type)
{
	this.text 	= text;
	this.type 	= type;
	
	this.idx;
	this.parentObj;
	
	this.displayObj;
		
	this.oid = cortex.getOID();
	cortex.addObj(this);
}
section.prototype.TYPE_SPLASH		= 1;
section.prototype.TYPE_PORTFOLIO 	= 2;
section.prototype.TYPE_ABOUT 		= 3;
section.prototype.TYPE_CONTACTINFO 	= 4;
section.prototype.TYPE_BLOG 		= 5;
section.prototype.TYPE_SHOWS		= 6;

function section_load()
{
	this.displayObj.load();
}
section.prototype.load = section_load;

function section_append(node)
{
	this.parentObj.append(node);
}
section.prototype.append = section_append;

function section_deselect()
{
	if (this.displayObj && this.displayObj.deselect) this.displayObj.deselect();
}
section.prototype.deselect = section_deselect;


function splash()
{
	this.photos = new Array();
	this.slideShow;
	this.parentObj;
	
	this.oid = cortex.getOID();
	cortex.addObj(this);
}

function splash_addPhoto(photo) 
{
	photo.idx = this.photos.length;
	photo.parentObj = this;
	
	this.photos.push(photo);
}
splash.prototype.addPhoto = splash_addPhoto;

function splash_load()
{
	var lPhoto;
	var x;

	for (x = 0; x < this.photos.length; x++) {
		lPhoto = this.photos[x];
		lPhoto.load();
	}
}
splash.prototype.load = splash_load;

function splash_draw()
{
	var lPhoto;
	var x;
	
	// have all the photos been loaded for display?
	for (x = 0; x < this.photos.length; x++) {
		lPhoto = this.photos[x];
		if (!lPhoto.imgLoaded) return;
	}

	// create the slideShow
	if (this.slideShow == null) {
		this.slideShow = new slideShow(null, this.photos, false);
	}
	
	// play
	if (this.parentObj == gallery.selectedSection) this.slideShow.play();
}
splash.prototype.draw = splash_draw;

function splash_deselect()
{
	if (this.slideShow) this.slideShow.pause();
}
splash.prototype.deselect = splash_deselect;

function statement()
{
}

function statement_load()
{
	var div = obtainElement('div');
	var contents = new Array();
	
	contents.push('<center><table width=100%>');
	
	contents.push('<tr>');
	contents.push('<td align=center class="showHead">');
	contents.push('<b>the impressions series</b>');
	contents.push('</td>');
	contents.push('</tr>');

	contents.push('<tr>');
	contents.push('<td align=center class="showDate" style="font-weight:normal;">');
	contents.push('money, in intent and consequence,<br/>');
	contents.push('impresses us.<br/><br/>');
	contents.push('subtly, imperceptibly, it leaves a mark.<br/><br/>');
	contents.push('materially worthless,<br/>');
	contents.push('it has been awarded great value.<br/>');
	contents.push('it compels us to action,<br/>');
	contents.push('it compels us to wit.<br/><br/>');
	contents.push('a model for equality<br/>');
	contents.push('that feeds on necessity and desire,<br/>');
	contents.push('that rewards innovation and toil,<br/>');
	contents.push('that rewards slight of psychological hand.<br/><br/>');
	contents.push('a zero-sum game without fixed supply.<br/>');
	contents.push('the manifestation of thumbs and brains.<br/><br/>');
	contents.push('allocation transcends generations<br/>');
	contents.push('and, more often than not,<br/>');
	contents.push('dictates lot.<br/><br/>');
	contents.push('the impressions series<br/>');
	contents.push('-- figurative, literal --<br/>');
	contents.push('explores the subconscious impact<br/>');
	contents.push('of an abstract concept.<br/><br/>');
	contents.push('money\'s impression<br/>');
	contents.push('influences perception.<br/>');	
	contents.push('</td>');
	contents.push('</tr>');


	contents.push('</table></center>')
	
	div.innerHTML = contents.join('');
	div.style.top = '10px';
	div.style.left = '0px';
	div.style.height = '600px';
	div.style.width = '600px';
	
	var infoNode = obtainElement('div');
	infoNode.style.width = '100%';
	infoNode.style.height = '300px';
	infoNode.style.backgroundImage = 'url(images/impressionSeries.jpg)';
	infoNode.style.backgroundRepeat = 'no-repeat';
	infoNode.style.backgroundPosition = 'center center';
	
	
	gallery.setDisplay(div, infoNode);
}
statement.prototype.load = statement_load;

function about()
{
}

function about_load()
{
	var div = obtainElement('div');
	var contents = new Array();
	
	contents.push('<center><table width=100%>');
	
	contents.push('<tr>');
	contents.push('<td align=center class="showHead">');
	contents.push('<b>the background story</b>');
	contents.push('</td>');
	contents.push('</tr>');

	contents.push('<tr>');
	contents.push('<td align=center class="showDate" style="font-weight:normal;padding:10px;">');
	contents.push('Born and raised in Twin Falls, Idaho, I am the son of educators and am descended from bankers, politicians, ranchers, farmers, business people, common people, proud people, matriarchs, Scots, and Basques.<br/><br/>');  
	contents.push('Trained in Applied Mathematics, my professional life has been consumed with business operations, technology consulting, and software engineering, navigating startup companies and the Fortune 500.<br/><br/>');
	contents.push('I have written music, poetry, and screenplays.  Since July 2004, I am a husband; March 2006, a father; and November 2007, a painter of acrylics on canvas. I have learned through observation and self-directed doing.<br/><br/>');
	contents.push('I live in Seattle and have exhibited in numerous Seattle venues.  My latest series of abstract concept pieces, <i><b>Impressions</b></i>, is on display at the Alki Arts gallery.  My art is in numerous private collections.<br/><br/>');
	contents.push('I experiment in abstract nature, figures, colors, concepts, and process.<br/><br/>');
	contents.push('I really like making art.');
	contents.push('</td>');
	contents.push('</tr>');


	contents.push('</table></center>')
	
	div.innerHTML = contents.join('');
	div.style.top = '10px';
	div.style.left = '0px';
	div.style.height = '600px';
	div.style.width = '800px';
	
	var infoNode = obtainElement('div');
	infoNode.style.width = '100%';
	infoNode.style.height = '300px';
	infoNode.style.backgroundImage = 'url(images/me.jpg)';
	infoNode.style.backgroundRepeat = 'no-repeat';
	infoNode.style.backgroundPosition = 'top center';
	
	
	gallery.setDisplay(div, infoNode);
}
about.prototype.load = about_load;


function contact()
{
}

function contact_load()
{
	var div = obtainElement('div');
	var contents = new Array();
	
	contents.push('<center><table width=100%>');
	
	contents.push('<tr>');
	contents.push('<td class="contactHead">');
	contents.push('jason sinclair astorquia');
	contents.push('</td>');
	contents.push('</tr>');

	contents.push('<tr>');
	contents.push('<td class="contact">');
	contents.push('@ artist / writer painter techie');
	contents.push('</td>');
	contents.push('</tr>');

	contents.push('<tr>');
	contents.push('<td class="contact">');
	contents.push('@ west seattle, wa');
	contents.push('</td>');
	contents.push('</tr>');

	contents.push('<tr>');
	contents.push('<td class="contact">');
	contents.push('@ 206.300.4863');
	contents.push('</td>');
	contents.push('</tr>');

	contents.push('<tr>');
	contents.push('<td class="contact">');
	contents.push('@ <a class="mail" href="mailto:jason@storksplace.com">jason@storksplace.com</a>');
	contents.push('</td>');
	contents.push('</tr>');
	
	contents.push('</table></center>')
	
	div.innerHTML = contents.join('');
	div.style.backgroundImage = 'url(images/rolodex.gif)';
	div.style.backgroundRepeat = 'no-repeat';
	div.style.backgroundPosition = '50px 50px';
	div.style.top = '0px';
	div.style.left = '0px';
	div.style.height = '300px';
	div.style.width = '100%';
	
	gallery.setDisplay(div);
}
contact.prototype.load = contact_load;

function portfolio()
{
	this.series = new Array();
	this.parentObj;
	this.activeSeries;
	
	this.displayNode;
	this.textNode;
	
	this.oid = cortex.getOID();
	cortex.addObj(this);
}
portfolio.prototype.TEXT_HEIGHT = 45;

function portfolio_addSeries(series)
{
	series.idx = this.series.length;
	series.parentObj = this;
	
	this.series.push(series);
}
portfolio.prototype.addSeries = portfolio_addSeries;

function portfolio_load()
{
	var lSeries;
	var x;
	
	for (x = 0; x < this.series.length; x++) {
		lSeries = this.series[x];
		lSeries.loadSeries();
	}
}
portfolio.prototype.load = portfolio_load;

function portfolio_draw()
{
	var lSeries;
	var x;
	
	// have all the series been loaded for display?
	for (x = 0; x < this.series.length; x++) {
		lSeries = this.series[x];
		if (!lSeries.loaded) return;
	}
	
	if (this.displayNode != null) return;
	this.displayNode = obtainElement('div');
	this.displayNode.id = this.oid;
	this.displayNode.style.height = (3 * lSeries.HEIGHT) + 20 + 'px'; 
	this.displayNode.style.width = gallery.DISPLAY_WIDTH + 'px';
	
	//this.textNode = obtainElement('div')
	//this.textNode.style.top = '0px';
	//this.textNode.style.width = '100%';
	//this.textNode.style.height = this.TEXT_HEIGHT;
	//this.textNode.className = 'portfolioTitle';
	//this.textNode.innerHTML = this.parentObj.text;
	//this.displayNode.appendChild(this.textNode);
	
	var perRow = Math.ceil(this.series.length / 3);
	var cellWidth = Math.floor(gallery.DISPLAY_WIDTH / perRow);
	var top = 20; //this.TEXT_HEIGHT;
	var left = 0;
	var leftPad = Math.floor((cellWidth - lSeries.IMG_WIDTH) / 2);

	//this.textNode.style.left = leftPad + 'px';
	
	for (x = 0; x < this.series.length; x++) {
		lSeries = this.series[x];
		lSeries.drawSeries();
		
		lSeries.displayNode.style.top = top + 'px';
		lSeries.displayNode.style.left = (left + leftPad) + 'px';
		//this.displayNode.appendChild(lSeries.displayNode);
		
		switch (x) {
			case 2:
			case 5:
				top += lSeries.HEIGHT;
				left = 0;
				break;
				
			default:
				left += cellWidth;
				break;
		}
		//if ((x == (perRow - 1)) || (x == (perRow - 2)) {
			//top += lSeries.HEIGHT;
			//left = 0;
		//} else {
			//left += cellWidth;
		//}
	}

	gallery.setDisplay(this.displayNode, null, true);
	
	// append children
	setTimeout('portfolio_appendChild(\'' + this.oid + '\', 0)', 50)
}
portfolio.prototype.draw = portfolio_draw;

function portfolio_deselect()
{
	this.displayNode = null;
	if (this.activeSeries) this.activeSeries.deselect();
}
portfolio.prototype.deselect = portfolio_deselect;


function portfolio_appendChild(oid, idx)
{
	var lPortfolio = cortex.getObjByID(oid);
	
	if (idx >= lPortfolio.series.length) return;
	var lSeries = lPortfolio.series[idx];
	
	lPortfolio.displayNode.appendChild(lSeries.displayNode);

	// append children
	var nextIdx = parseInt(idx) + 1;
	setTimeout('portfolio_appendChild(\'' + oid + '\', ' + nextIdx + ')', 50)
}

function series(name, img, desc)
{
	this.name 	= name;
	this.img	= img;
	this.desc 	= desc;
	
	this.photos = new Array();
	this.slideShow;
	
	this.idx;
	this.parentObj;
	
	this.loaded = false;
	
	this.displayNode;
	
	this.oid = cortex.getOID();
	cortex.addObj(this);
}
series.prototype.IMG_HEIGHT = 200;
series.prototype.IMG_WIDTH 	= 200;
series.prototype.HEIGHT 	= 250;

function series_addPhoto(photo)
{
	photo.idx 		= this.photos.length;
	photo.parentObj = this;
	
	this.photos.push(photo);
}
series.prototype.addPhoto = series_addPhoto;

function series_loadSeries()
{
	var obj = obtainElement('div');
	
	this.loaded = false;
	
	obj.style.top = '0px';
	obj.style.left = '0px';
	obj.style.width = '1px';
	obj.style.height = '1px';
	obj.style.opacity = '0';
	obj.style.filter = 'alpha(opacity=0)';	
	obj.innerHTML = '<img src="' + this.img + '" onload="javascript:series_imgLoaded(\'' + this.oid + '\');"/>'

	document.body.appendChild(obj);
}
series.prototype.loadSeries = series_loadSeries;

function series_imgLoaded(id)
{
	var series = cortex.getObjByID(id);
	if (series == null) return;
	if (series.loaded) return;
	
	series.loaded = true;
	series.parentObj.draw();	
}

function series_drawSeries()
{
	if (this.displayNode != null) return;
	
	this.displayNode = obtainElement('div');
	this.displayNode.id = this.oid;
	this.displayNode.className = 'seriesTitle';
	this.displayNode.style.height = this.HEIGHT + 'px'; 
	this.displayNode.style.width = this.IMG_WIDTH + 'px';

	var buf = new Array();
	buf.push('<table>');
	
	// image
	buf.push('<tr>');
	buf.push('<td>');
	buf.push('<img src="');
	buf.push(this.img);
	buf.push('" border=0 height=');
	buf.push(this.IMG_HEIGHT);
	buf.push(' width=');
	buf.push(this.IMG_WIDTH);
	buf.push('>');
	buf.push('</td>');	
	buf.push('</tr>');
	
	// name
	buf.push('<tr>');
	buf.push('<td class="seriesTitle">');
	buf.push(this.name);
	buf.push('</td>');	
	buf.push('</tr>');
	
	// desc
	buf.push('<tr>');
	buf.push('<td class="series">');
	buf.push(this.desc);
	buf.push('</td>');	
	buf.push('</tr>');
	
	buf.push('</table>');
	
	this.displayNode.innerHTML = buf.join('');	
}
series.prototype.drawSeries = series_drawSeries;


function series_load()
{
	var lPhoto;
	var x;
	
	for (x = 0; x < this.photos.length; x++) {
		lPhoto = this.photos[x];
		lPhoto.load();
	}
}
series.prototype.load = series_load;

function series_draw()
{
	var lPhoto;
	var x;

	// have all the photos been loaded for display?
	for (x = 0; x < this.photos.length; x++) {
		lPhoto = this.photos[x];
		//if (!lPhoto.imgLoaded || !lPhoto.thumbLoaded) alert(x + ' not loaded fully');
		if (!lPhoto.imgLoaded) 		return;
		if (!lPhoto.thumbLoaded)	return;
	}

	// create the slideShow
	if (this.slideShow == null) {
		this.slideShow = new slideShow(this.name, this.photos, true);
	}
	
	// play
	this.slideShow.play();
}
series.prototype.draw = series_draw;


function series_handleClick()
{
	// clear out the display
	gallery.clearDisplay();

	this.parentObj.activeSeries = this;
	this.load();
}
series.prototype.handleClick = series_handleClick;

function series_deselect()
{
	this.parentObj.activeSeries = null;
	if (this.slideShow) this.slideShow.pause();
}
series.prototype.deselect = series_deselect;


function photo(name, thumb, img, height, width, medium, dimension, year, otherInfo)
{
	this.name 	= name;
	this.thumb 	= thumb;
	this.img 	= img;
	this.height = height;
	this.width 	= width;
	
	this.medium 	= medium;
	this.dimension 	= dimension;	
	this.year		= year;
	this.otherInfo	= otherInfo;
	
	this.thumbLoaded 	= false;
	this.imgLoaded		= false;
	
	this.idx;
	this.parentObj;
	
	this.thumbButton;
	
	this.oid = cortex.getOID();
	cortex.addObj(this);
}
photo.prototype.THUMB_WIDTH 	= 50;
photo.prototype.THUMB_HEIGHT 	= 50;


function photo_drawThumb()
{
	if (this.thumbButton == null) {
		this.thumbButton = new button(this.thumb, this.THUMB_HEIGHT, this.THUMB_WIDTH, this.text);
		this.thumbButton.draw();
		this.thumbButton.parentObj = this;
		this.thumbButton.idx = this.idx;
		this.thumbButton.displayNode.style.opacity = '.7';
		this.thumbButton.displayNode.style.filter = 'alpha(opacity=70)';
	}
	return this.thumbButton.displayNode;
}
photo.prototype.drawThumb = photo_drawThumb;

function photo_load()
{
	var obj = obtainElement('div');

	this.thumbLoaded = false;
	this.imgLoaded = false;
	
	if (this.thumb) {
		obj.style.top = '0px';
		obj.style.left = '0px';
		obj.style.width = '1px';
		obj.style.height = '1px';
		obj.style.opacity = '0';
		obj.style.filter = 'alpha(opacity=0)';	
		obj.innerHTML = '<img src="' + this.thumb + '" onload="javascript:photo_thumbLoaded(\'' + this.oid + '\');"/>';
	
		document.body.appendChild(obj);
	} else {
		this.thumbLoaded = true;
	}
	
	obj = obtainElement('div');
	
	obj.style.top = '0px';
	obj.style.left = '0px';
	obj.style.width = '1px';
	obj.style.height = '1px';
	obj.style.opacity = '0';
	obj.style.filter = 'alpha(opacity=0)';	
	
	var img = new Array();
	img.push('<img ');
	if (this.name) img.push('alt="' + this.name +  '" ');
	img.push('src="' + this.img + '" onload="javascript:photo_imgLoaded(\'' + this.oid + '\');"/>');
	obj.innerHTML = img.join(''); 

	document.body.appendChild(obj);
}
photo.prototype.load = photo_load;

function photo_handleMouseOver(idx)
{
	if (this.thumbButton && this.thumbButton.displayNode) {
		this.thumbButton.displayNode.style.opacity = '1';
		this.thumbButton.displayNode.style.filter = 'alpha(opacity=100)';
	}
}
photo.prototype.handleMouseOver = photo_handleMouseOver;

function photo_handleMouseOut(idx)
{
	if (this.thumbButton && this.thumbButton.displayNode) {
		this.thumbButton.displayNode.style.opacity = '.7';
		this.thumbButton.displayNode.style.filter = 'alpha(opacity=70)';
	}
}
photo.prototype.handleMouseOut = photo_handleMouseOut;

function photo_handleClick(idx)
{
	this.parentObj.slideShow.setActive(idx);
}
photo.prototype.handleClick = photo_handleClick;


function photo_thumbLoaded(oid)
{
	var lPhoto = cortex.getObjByID(oid);
	if (lPhoto == null) return;
	if (lPhoto.thumbLoaded) return;
	
	lPhoto.thumbLoaded = true;
	lPhoto.parentObj.draw();	
}

function photo_imgLoaded(oid)
{
	var lPhoto = cortex.getObjByID(oid);
	if (lPhoto == null) return;
	if (lPhoto.imgLoaded) return;
	
	lPhoto.imgLoaded = true;
	lPhoto.parentObj.draw();	
}


function slideShow(name, photos, hasThumbs)
{
	this.name			= name;
	this.photos 		= photos;
	this.hasThumbs 		= hasThumbs;
	
	this.activePhoto;
	this.isPlaying;
	
	this.infoNode;
	
	this.buttonsNode;
	this.playBtn;
	this.pauseBtn;
	this.previousBtn;
	this.nextBtn;
		
	this.timer;
	
	this.opacity;
	
	this.displayNode;
	this.titleNode;
	this.descNode;
	this.lineNode;
	this.photoNode;
	
	this.drop;
	
	this.oid = cortex.getOID();
	cortex.addObj(this);
	
	if (this.hasThumbs) this.configureBtns();
}
slideShow.prototype.DURATION 			= 4500;
slideShow.prototype.HEADER_HEIGHT		= 40;
slideShow.prototype.PHOTO_HEIGHT 		= 600;
slideShow.prototype.BUTTONS_HEIGHT 		= 35;
slideShow.prototype.THUMBS_PAD			= 5;
slideShow.prototype.BTN_IDX_PLAY		= 1;
slideShow.prototype.BTN_IDX_PAUSE		= 2;
slideShow.prototype.BTN_IDX_PREVIOUS	= 3;
slideShow.prototype.BTN_IDX_NEXT		= 4;
slideShow.prototype.BTN_IDX_THUMBS		= 5;
slideShow.prototype.BTN_IDX_CLOSE		= 6;
slideShow.prototype.BTN_IDX_SCROLL_UP	= 7;
slideShow.prototype.BTN_IDX_SCROLL_DOWN	= 8;
slideShow.prototype.REF_PHOTO			= 'PHOTO';


function slideShow_configureBtns()
{
	if (this.hasThumbs) {
		this.playBtn = new button('images/play1.jpg', 25, 25, null);
		this.playBtn.idx = this.BTN_IDX_PLAY;
		this.playBtn.parentObj = this;
		 
		this.pauseBtn = new button('images/pause1.jpg', 25, 25, null);
		this.pauseBtn.idx = this.BTN_IDX_PAUSE;
		this.pauseBtn.parentObj = this;
	
		//this.previousBtn = new button('images/previous.jpg', 20, 20, 'previous');
		//this.previousBtn.idx = this.BTN_IDX_PREVIOUS;
		//this.previousBtn.parentObj = this;
	
		//this.nextBtn = new button('images/next.jpg', 20, 20, 'next');
		//this.nextBtn.idx = this.BTN_IDX_NEXT;
		//this.nextBtn.parentObj = this;
	}
}
slideShow.prototype.configureBtns = slideShow_configureBtns;

function slideShow_init()
{
	if (this.displayNode != null) return;
	
	// the displayNode
	this.displayNode = obtainElement('div');
	this.displayNode.id = this.oid;
	this.displayNode.style.height = (this.PHOTO_HEIGHT + this.HEADER_HEIGHT + 12) + 'px'; 
	this.displayNode.style.width = gallery.DISPLAY_WIDTH + 'px';	
	
	var clone;
	var obj;	
	this.drop = obtainElement('div');
	
	clone = obtainElement('div');
	clone.style.backgroundColor = '#000000';
	
	obj = clone.cloneNode(false);
	obj.style.opacity = '.08';
	obj.style.filter = 'alpha(opacity=8)';
	obj.style.top = '5px';
	obj.style.left = '0px';
	this.drop.appendChild(obj);
	
	obj = clone.cloneNode(false);
	obj.style.opacity = '.08';
	obj.style.filter = 'alpha(opacity=8)';
	obj.style.top = '0px';
	obj.style.left = '5px';
	this.drop.appendChild(obj);
	
	obj = clone.cloneNode(false);
	obj.style.opacity = '.08';
	obj.style.filter = 'alpha(opacity=8)';
	obj.style.top = '3px';
	obj.style.left = '1px';
	this.drop.appendChild(obj);
	
	obj = clone.cloneNode(false);
	obj.style.opacity = '.08';
	obj.style.filter = 'alpha(opacity=8)';
	obj.style.top = '1px';
	obj.style.left = '3px';
	this.drop.appendChild(obj);
	
	obj = clone.cloneNode(false);
	obj.style.opacity = '.08';
	obj.style.filter = 'alpha(opacity=8)';
	obj.style.top = '2px';
	obj.style.left = '2px';
	this.drop.appendChild(obj);
		
	this.displayNode.appendChild(this.drop);
	
	var right = 2;
	var pad = 2;
	var btns = 0;
	if (this.hasThumbs) {
		
		this.initInfo();
		
		this.lineNode = obtainElement('div');
		this.lineNode.style.width = '900px';
		this.lineNode.style.height = '1px';
		this.lineNode.style.left = Math.floor((gallery.DISPLAY_WIDTH - 900) / 2) + 'px';
		this.lineNode.style.top = (this.HEADER_HEIGHT - 7) + 'px';
		this.lineNode.style.backgroundColor = '#DDDDDD';
		this.displayNode.appendChild(this.lineNode);

		this.titleNode = obtainElement('div');
		this.titleNode.className = 'title';
		this.titleNode.style.height = this.HEADER_HEIGHT + 'px';
		this.titleNode.style.top = '0px';
		this.displayNode.appendChild(this.titleNode);
		
		this.descNode = obtainElement('div');
		this.descNode.className = 'desc';
		this.descNode.style.height = this.HEADER_HEIGHT + 'px';
		this.descNode.style.top = '0px';
		this.displayNode.appendChild(this.descNode);
		
	}
}
slideShow.prototype.init = slideShow_init;

function slideShow_initInfo()
{
	if (this.infoNode != null) return;
	
	var top;
	var left;
	var obj;
	
	this.infoNode = obtainElement('div');
	this.infoNode.style.width = '100%';
	
	// series name
	obj = obtainElement('div');
	obj.style.top = '0px';
	obj.style.left = '0px';
	obj.style.height = '18px';
	obj.style.width = '100%';
	obj.className = 'info';
	obj.innerHTML = this.name;
	
	this.infoNode.appendChild(obj);	
	
	top = 23;	
	
	this.playBtn.draw();
	this.playBtn.displayNode.style.top 		= top + 'px';
	this.playBtn.displayNode.style.right 	= '0px';
	this.infoNode.appendChild(this.playBtn.displayNode);

	this.pauseBtn.draw();
	this.pauseBtn.displayNode.style.top 	= top + 'px';
	this.pauseBtn.displayNode.style.right 	= '0px';
	this.infoNode.appendChild(this.pauseBtn.displayNode);


	var lPhoto;
	var left = this.THUMBS_PAD;
	var count = 0;
	for (var x = 0; x < this.photos.length; x++) {
		
		lPhoto = this.photos[x];
		obj = lPhoto.drawThumb();
		obj.style.top 	= top + 'px';
		obj.style.left 	= left + 'px';
		this.infoNode.appendChild(obj);
		
		count += 1;
		if (count < 3) {
			left += this.THUMBS_PAD + photo.prototype.THUMB_WIDTH;
		} else {
			count = 0;
			top += this.THUMBS_PAD + photo.prototype.THUMB_HEIGHT;
			left = this.THUMBS_PAD
		}
	}
	this.infoNode.style.height = (top + this.THUMBS_PAD + photo.prototype.THUMB_HEIGHT) + 'px';
}
slideShow.prototype.initInfo = slideShow_initInfo;

function slideShow_showActive()
{
	if (this.activePhoto == null) return;
	
	var obj;
			
	// show the active photo
	if (this.displayNode == null) this.init();
	
	// add the photo
	if (this.photoNode == null) {
		this.photoNode = obtainElement('div');
		this.photoNode.id = this.oid;
		if (ie) this.photoNode.className = 'photo'; 
		this.displayNode.appendChild(this.photoNode);		
	}
	
	var img = new Array();
	img.push('<center><img src="');
	img.push(this.activePhoto.img);
	img.push('" border=0 width=');
	img.push(this.activePhoto.width);
	img.push(' height=')
	img.push(this.activePhoto.height);
	if (this.activePhoto.name) {
		//img.push(' alt="' + this.activePhoto.name + '"');
	}
	img.push('></center>');
	
	if (ie && this.photoNode.filters.length > 0) this.photoNode.filters[0].apply();
	var top = 20;
	if (this.name != null) top = this.HEADER_HEIGHT;
	this.photoNode.style.top = top + 'px';
	this.photoNode.style.height = this.activePhoto.height + 'px'; 
	this.photoNode.style.width = this.activePhoto.width + 'px';	
	this.photoNode.style.left = Math.floor((gallery.DISPLAY_WIDTH - this.activePhoto.width) / 2);
	this.photoNode.innerHTML = img.join('');
	if (!ie && !mobile) {
		this.photoNode.style.opacity = '.6';
		this.drop.style.opacity = '.6';
		this.opacity = 60;
	}
	if (ie && this.photoNode.filters.length > 0) this.photoNode.filters[0].play();
	this.photoNode.abbr = this.REF_PHOTO;
	

	var height = this.activePhoto.height;
	var width = this.activePhoto.width;
	this.drop.style.height 	= height + 'px';
	this.drop.style.width	= width + 'px';
	this.drop.style.top 	= (parseInt(this.photoNode.style.top) + 10) + 'px';
	this.drop.style.left 	= (parseInt(this.photoNode.style.left) + 8) + 'px';
	
	this.drop.childNodes[0].style.height 	= (height - 10) + 'px';
	this.drop.childNodes[0].style.width 	= width + 'px';
	
	this.drop.childNodes[1].style.height 	= height + 'px';
	this.drop.childNodes[1].style.width 	= (width - 10) + 'px';
	
	this.drop.childNodes[2].style.height 	= (height - 6) + 'px';
	this.drop.childNodes[2].style.width 	= (width - 2) + 'px';
	
	this.drop.childNodes[3].style.height 	= (height - 2) + 'px';
	this.drop.childNodes[3].style.width 	= (width - 6) + 'px';
	
	this.drop.childNodes[4].style.height 	= (height - 4) + 'px';
	this.drop.childNodes[4].style.width 	= (width - 4) + 'px';
	
	if (this.hasThumbs) {
		if (this.activePhoto.name) {
			this.titleNode.style.left = (parseInt(this.lineNode.style.left) + 5) + 'px';
			this.titleNode.style.width = (parseInt(this.lineNode.style.width) - 10) + 'px';
			this.titleNode.innerHTML = this.activePhoto.name;
			if (this.activePhoto.otherInfo) {
				this.titleNode.innerHTML += '&nbsp;<span class=\"desc\" style=\"padding-left:0px;font-style:italic;\">(' + this.activePhoto.otherInfo + ')</span>';
			}
		}
		this.descNode.style.left = parseInt(this.titleNode.style.left) + 'px';
		this.descNode.style.width = parseInt(this.titleNode.style.width) + 'px';
		
		var desc = new Array();
		desc.push(this.activePhoto.year);
		desc.push('&nbsp;|&nbsp;');
		desc.push(this.activePhoto.medium);
		desc.push('&nbsp;|&nbsp;');
		desc.push(this.activePhoto.dimension);
		this.descNode.innerHTML = desc.join('');
	}

	this.displayNode.style.height = (top + height + 12) + 'px';
	//this.displayNode.style.backgroundColor = 'green';
	gallery.setDisplay(this.displayNode, this.infoNode, true);
	
	// not ie, manual fade in
	if (!ie && !mobile) {
		setTimeout('slideShow_fadeIn(\'' + this.oid + '\')', 0);
		setTimeout('slideShow_fadeIn(\'' + this.oid + '\')', 0);
		setTimeout('slideShow_fadeIn(\'' + this.oid + '\')', 0);
		setTimeout('slideShow_fadeIn(\'' + this.oid + '\')', 0);
	}
	
	// if we're playing, schedule the next for showing
	if (this.isPlaying) this.timer = setTimeout('slideShow_next(\'' + this.oid + '\')', this.DURATION);
}
slideShow.prototype.showActive = slideShow_showActive;


function slideShow_fadeIn(oid)
{
	var lSlideShow = cortex.getObjByID(oid);
	if (lSlideShow == null) 			return;
	if (lSlideShow.photoNode == null) 	return;
	if (lSlideShow.opacity >= 100)		return;
	
	lSlideShow.opacity += 1;
	lSlideShow.photoNode.style.opacity = (lSlideShow.opacity / 100) + '';
	lSlideShow.drop.style.opacity = (lSlideShow.opacity / 100) + '';
	
	if (lSlideShow.opacity < 100) setTimeout('slideShow_fadeIn(\'' + oid + '\')', 0);
}


function slideShow_play()
{
	if (this.isPlaying) return;

	// flag playing status
	this.isPlaying = true;

	// kill the clock
	this.killClock();
	
	// init the active photo?
	if (this.activePhoto == null) this.activePhoto = this.photos[0];

	// set button state
	if (this.playBtn) 	this.playBtn.hide();
	if (this.pauseBtn) 	this.pauseBtn.show();

	// show the activePhoto
	this.showActive();	
}
slideShow.prototype.play = slideShow_play;

function slideShow_pause()
{
	// flag playing status
	this.isPlaying = false;

	// kill the clock
	this.killClock();
	
	// set button state
	if (this.playBtn) 	this.playBtn.show();
	if (this.pauseBtn) 	this.pauseBtn.hide();
}
slideShow.prototype.pause = slideShow_pause;

function slideShow_killClock()
{
	if (this.timer != null) clearTimeout(this.timer);
}
slideShow.prototype.killClock = slideShow_killClock;


function slideShow_setActive(idx)
{
	this.pause();
	this.activePhoto = this.photos[idx];
	this.showActive();
}
slideShow.prototype.setActive = slideShow_setActive;

function slideShow_next(oid)
{
	var lSlideShow = cortex.getObjByID(oid);
	if (lSlideShow == null) return;
	
	var nextIdx = 0;
	if (lSlideShow.activePhoto) {
		nextIdx = lSlideShow.activePhoto.idx + 1;
		if (nextIdx >= lSlideShow.photos.length) nextIdx = 0;
	}

	lSlideShow.killClock();
	lSlideShow.activePhoto = lSlideShow.photos[nextIdx];
	lSlideShow.showActive();
}
slideShow.prototype.next = slideShow_next;


function slideShow_previous(oid)
{
	var lSlideShow = cortex.getObjByID(oid);
	if (lSlideShow == null) return;
	
	var nextIdx = 0;
	if (lSlideShow.activePhoto) {
		nextIdx = lSlideShow.activePhoto.idx - 1;
		if (nextIdx < 0) nextIdx = lSlideShow.photos.length - 1;
	}
	
	lSlideShow.killClock();
	lSlideShow.activePhoto = lSlideShow.photos[nextIdx];
	lSlideShow.showActive();
}
slideShow.prototype.previous = slideShow_previous;


function slideShow_handleClick(btnIdx)
{
	switch (btnIdx) {
		case this.BTN_IDX_PLAY:
			this.play();
			break;
			
		case this.BTN_IDX_PAUSE:
			this.pause();
			break;
			
		case this.BTN_IDX_PREVIOUS:
			this.previous(this.oid);
			break;
			
		case this.BTN_IDX_NEXT:
			this.next(this.oid);
			break;	
	}
}
slideShow.prototype.handleClick = slideShow_handleClick;

function slideShow_handleMouseUp(btnIdx)
{
	this.handleMouseOut(btnIdx);
}
slideShow.prototype.handleMouseUp = slideShow_handleMouseUp;

function slideShow_handleMouseOver(ce)
{
}
slideShow.prototype.handleMouseOver = slideShow_handleMouseOver;

function slideShow_handleMouseOut(btnIdx)
{
}
slideShow.prototype.handleMouseOut = slideShow_handleMouseOut;


function showList()
{
	this.shows = new Array();
	this.parentObj;
}

function showList_addShow(show)
{
	this.shows.push(show);
	this.shows.sort(showList_sort);
}
showList.prototype.addShow = showList_addShow;

function showList_load()
{
	var div = obtainElement('div');
	var contents = new Array();
	
	contents.push('<table width=80%>');

	var show;
	for (var i = 0;  i < this.shows.length; i++) {	
		
		show = this.shows[i];
		
		contents.push('<tr>');
		contents.push('<td class="title">');
		
		contents.push('<div style=\"border-bottom:1px dashed #EEEEEE;padding-bottom:10px;\">');
		contents.push(show.draw());
		contents.push('</div>');
	
		contents.push('</td>');
		contents.push('</tr>');
	}

	
	contents.push('</table>')
	
	//container.innerHTML = contents.join('');
	//container.style.border = 'solid 1px #AAAAAA';
	//container.style.backgroundColor = 'white';
	//container.style.height = '98%';
	//container.style.width = '80%';
	//container.style.left = '10%';
	
	//div.appendChild(container);
	//div.style.overflowY = 'auto';
	div.style.top = '10px';
	div.style.height = (show.HEIGHT * this.shows.length) + 'px';
	div.style.width = '100%';
	div.innerHTML = contents.join('');
	//div.style.textAlign = 'center';
	
	gallery.setDisplay(div);
}
showList.prototype.load = showList_load;

function showList_sort(showA, showB)
{
	var sortStart = false;
	if ((showA.end == null) && (showB.end != null)) return -1;
	if ((showA.end != null) && (showB.end == null)) return 1;
	if ((showA.end == null) && (showB.end == null)) sortStart = true;

	if (!sortStart) {
		if (showA.end.getTime() < showB.end.getTime()) return 1;
		if (showA.end.getTime() > showB.end.getTime()) return -1;
	}
	
	if (showA.start.getTime() < showB.start.getTime()) return 1;
	if (showA.start.getTime() > showB.start.getTime()) return -1;
	
	return 0;
}



function show(venue, start, end, desc)
{
	this.venue 	= venue;
	
	this.start 	= start;
	this.end 	= end;
	
	this.desc	= desc;
	
	this.receptions;
	this.photos;
}
show.prototype.HEIGHT = 140;

function show_addReception(reception)
{
	if (this.receptions == null) this.receptions = new Array();
	this.receptions.push(reception);
}
show.prototype.addReception = show_addReception;

function show_addPhoto(photo)
{
	if (this.photos == null) this.photos = new Array();
	this.photos.push(photo);
}
show.prototype.addPhoto = show_addPhoto;

function show_draw()
{
	var buf = new Array();
	
	buf.push('<table cellpadding=0 cellspacing=0 border=0>');

	// venue name and date
	buf.push('<tr>');
	buf.push('<td class=\"showHead\" colspan=2 width=95%>');
	buf.push(this.venue.name);
	buf.push('</td>');
	buf.push('<td class=\"showDate\" align=right nowrap width=5%>');
	
	var rightNow = new Date();
	if (this.start.getTime() > rightNow.getTime()) {
		buf.push('<i>UPCOMING:</i> ');
		buf.push(this.getMonth(this.start) + ' ' + this.start.getFullYear());
		if ((this.end != null) && (this.end.getTime() > this.start.getTime())) {
			buf.push(' - ');
			buf.push(this.getMonth(this.end) + ' ' + this.end.getFullYear());	
		}
	}
	else
	{
		if (this.end == null) {
			buf.push('NOW ON DISPLAY');
		}
		else
		{
			if (this.end.getTime() > rightNow.getTime()) {
				buf.push('NOW ON DISPLAY');
			}
			else
			{
				buf.push(this.getMonth(this.start) + ' ' + this.start.getFullYear());
				if (this.end.getTime() > this.start.getTime()) {
					buf.push(' - ');
					buf.push(this.getMonth(this.end) + ' ' + this.end.getFullYear());
				}
			}
		}
	}
	
	buf.push('</td>');
	buf.push('</tr>');

	// venue details & desc
	buf.push('<tr>');
	buf.push('<td nowrap width=5%>');
	
	buf.push('</td>');
	buf.push('<td class=\"showDetail\" nowrap width=95%>');
	buf.push(this.venue.getDetails());
	buf.push('</td>');
	buf.push('<td class=\"showDate\" nowrap align=right valign=middle width=5%><i>');
	if (this.desc) buf.push(this.desc);
	buf.push('</i></td>');
	buf.push('</tr>');
	
	buf.push('</table>');
	
	return buf.join('');
}
show.prototype.draw = show_draw;

function show_getMonth(d)
{
	if (d == null) return '';
	switch (d.getMonth()) {
		case 0:
			return 'Jan';
		case 1:
			return 'Feb';
		case 2:
			return 'Mar';
		case 3:
			return 'Apr';
		case 4:
			return 'May';
		case 5:
			return 'Jun';
		case 6:
			return 'Jul';
		case 7:
			return 'Aug';
		case 8:
			return 'Sept';
		case 9:
			return 'Oct';
		case 10:
			return 'Nov';
		case 11:
			return 'Dec';
	}
}
show.prototype.getMonth = show_getMonth;

function reception(show, flyer, start, end, desc)
{
	this.show 	= show;
	this.flyer	= flyer;
	
	this.start 	= start;
	this.end 	= end;
	
	this.desc	= desc;
}

function venue(name, logo, addr1, addr2, city, state, zip, webURL, phone)
{
	this.name	= name;
	this.logo	= logo;
	
	this.addr1	= addr1;
	this.addr2	= addr2;
	this.city	= city;
	this.state	= state;
	this.zip	= zip;
	
	this.webURL	= webURL;
	this.phone	= phone;
}


function venue_getDetails()
{
	var buf = new Array();
	
	if (this.addr1 != null) buf.push('@ ' + this.addr1 + '<br/>');
	if (this.addr2 != null) buf.push('@ ' + this.addr2 + '<br/>');
	if (this.city != null) {
		buf.push('@ ' + this.city);
		if (this.state != null) {
			buf.push(', ');
			buf.push(this.state);
			if (this.zip != null) buf.push('  ' + this.zip);
		}
		buf.push('<br/>');
	}
	if (this.webURL != null) {
		buf.push('@ ' + '<a class=\"showDetail\" href=\"');
		buf.push(this.webURL);
		buf.push('\" target=\"newwindow\" style=\"padding:0px;\">');
		buf.push(this.webURL);
		buf.push('</a><br/>');
	}
	if (this.phone != null) buf.push('@ ' + this.phone);
		
	return buf.join('');
}
venue.prototype.getDetails = venue_getDetails;

function button(img, height, width, hoverText) 
{
	this.img 		= img;
	this.height 	= height;
	this.width 		= width;
	this.hoverText	= hoverText;
	
	this.idx;
	this.parentObj;
	
	this.displayNode;
		
	this.oid = cortex.getOID();
	cortex.addObj(this);
}

function button_draw()
{
	if (this.displayNode == null) {
		this.displayNode = obtainElement('div');
		this.displayNode.id = this.oid;
		this.displayNode.className = 'btn';
		this.displayNode.style.height = this.height + 'px'; 
		this.displayNode.style.width = this.width + 'px';
		this.displayNode.innerHTML = '<img src="' + this.img + '" border=0 height="' + this.height + '" width="' + this.width + '">';	
	}
	return this.displayNode;	
}
button.prototype.draw = button_draw;

function button_show()
{
	if (this.displayNode) this.displayNode.style.display = '';
}
button.prototype.show = button_show;

function button_hide()
{
	if (this.displayNode) this.displayNode.style.display = 'none';
}
button.prototype.hide = button_hide;

function button_getHoverContents()
{
	if (this.hoverText) {
		if (ie) {
			return this.hoverText + ' '
		}
		return this.hoverText;
	}
}
button.prototype.getHoverContents = button_getHoverContents;

function button_handleClick()
{
	if (this.parentObj == null) 			return;
	if (this.parentObj.handleClick == null)	return;
	
	this.parentObj.handleClick(this.idx);
}
button.prototype.handleClick = button_handleClick;

function button_handleMouseOver()
{
	if (this.hoverText) cortex.scheduleHover(this);
	
	if (this.parentObj == null)					return;
	if (this.parentObj.handleMouseOver == null)	return;
	
	this.parentObj.handleMouseOver(this.idx);
}
button.prototype.handleMouseOver = button_handleMouseOver;

function button_handleMouseOut()
{
	if (this.parentObj == null)					return;
	if (this.parentObj.handleMouseOut == null)	return;
	
	this.parentObj.handleMouseOut(this.idx);
}
button.prototype.handleMouseOut = button_handleMouseOut;

function button_handleMouseDown()
{
	if (this.parentObj == null)					return;
	if (this.parentObj.handleMouseDown == null)	return;
	
	this.parentObj.handleMouseDown(this.idx);
}
button.prototype.handleMouseDown = button_handleMouseDown;

function button_handleMouseUp()
{
	if (this.parentObj == null)					return;
	if (this.parentObj.handleMouseUp == null)	return;
	
	this.parentObj.handleMouseUp(this.idx);
}
button.prototype.handleMouseUp = button_handleMouseUp;



