/*
	Simple structure to hold information about furniture pieces.  
	We'll see how well this works...
*/

function Piece_init(name, image, description, detail)
{
	this.name = name;
	this.image = image;
	this.description = description;
	this.detail = detail;
}

function Piece(name, image, description)
{
	this.name = null;
	this.image = null;
	this.description = null;
	this.detail = false;
	this.init = Piece_init;
}

var portfolio_size = 0;
var portfolio = null;
var piece = 0, prev = 0, next = 0;

function onLoad()
{
	var start = 0;
	
	// alert("in onLoad");
	portfolio = new Array();

	portfolio[0] = new Piece();
	portfolio[0].init("", "", "");
	
	portfolio[1] = new Piece();
	portfolio[1].init("Adams Dining Room", "adams-dining-room",
	"Sokolow dining table, Cherry with rosewood inlay, 29h x 96 x 42 in.<br>" +
	"Sokolow chairs, Cherry with handmade fabric, 44 x 19 x 18 in.<br>" +
	"Furno credenza, Cherry with basswood and maple, 32 x 63 x 18 in., <br>" +
	"Shoji and surround, Alaskan yellow cedar and handmade paper", false);
	
	portfolio[2] = new Piece();
	portfolio[2].init("Adams Dining Room", "sokolow-chairs",
	"Furno Credenza and Sokolow dining chair", false);
	
	portfolio[3] = new Piece();
	portfolio[3].init("Kusaka Sideboard", "kusaka-sideboard",
	"Walnut with bubinga, 36 x 48 x 13 in.", true);
	
	portfolio[4] = new Piece();
	portfolio[4].init("David Sideboard", "david-sideboard",
	"Walnut with maple, 31 x 63 x 18 in.", false);

	portfolio[5] = new Piece();
	portfolio[5].init("Sweren Sideboard", "sweren-sideboard",
	"Walnut with maple, 31 1/2 x 72 x 19 in.", true);

	portfolio[6] = new Piece();
	portfolio[6].init("Winston Credenza", "winston-credenza",
	"Cherry with maple and basswood, 29 1/2 x 55 x 17 in.", true);

	portfolio[7] = new Piece();
	portfolio[7].init("Kusaka Liquor Cabinet", "kusaka-cabinet",
	"Walnut with bubinga, 60 x 36 x 16 in.", true);
	
	portfolio[8] = new Piece();
	portfolio[8].init("Tall Tansu Dresser", "tall-tansu",
	"Cherry with rosewood, maple and basswood, 50 x 38 1/2 x 17 in.", true);

	portfolio[9] = new Piece();
	portfolio[9].init("Asato Writing Cabinet", "asato-cabinet",
	"Walnut with rosewood and maple, 54 x 36 x 17 in.", true);

	portfolio[10] = new Piece();
	portfolio[10].init("Jasmine Cabinet", "jasmine-cabinet",
	"Cherry with rosewood, 54 x 29 x 15 in.", true);

	portfolio[11] = new Piece();
	portfolio[11].init("Rhomberg Cabinet", "rhomberg-cabinet",
	"Cherry with rosewood, maple and basswood, 32 x 32 x 17 in.", true);

	portfolio[12] = new Piece();
	portfolio[12].init("Cabinet On Stand", "cabinet-on-stand",
	"Walnut with bloodwood, maple and basswood, 50 x 24 x 15 in.", true);

	portfolio[13] = new Piece();
	portfolio[13].init("Small Cherry Armoire", "cherry-armoire",
	"Cherry, 48 x 35 x 18 in.", true);

	portfolio[14] = new Piece();
	portfolio[14].init("Taylor Sideboard", "taylor-sideboard",
	"Walnut, maple, handmade paper, hand hammered iron pulls, 24 x 84 x 13 in.", false);

	portfolio[15] = new Piece();
	portfolio[15].init("Cole Sideboard", "cole-sideboard",
	"Walnut, maple, hand hammered iron pulls, 36 x 48 x 16 in.", false);

	portfolio[16] = new Piece();
	portfolio[16].init("Furno Night Stand", "furno-night-stand",
	"Cherry with handmade paper, 24 x 24 x 14 in.", false);

	portfolio[17] = new Piece();
	portfolio[17].init("Furno Bed", "furno-bed",
	"Photo of headboard and footboard, Cherry, 38 x 69 x 84 in. (Queen)", false);

	portfolio[18] = new Piece();
	portfolio[18].init("Winston Bed", "winston-bed",
	"Photo of headboard and footboard, Cherry with rosewood, 37 x 72 x 84 in. (Queen)", false);

	portfolio[19] = new Piece();
	portfolio[19].init("Waingrow End Tables", "waingrow-end-tables",
	"Walnut with bubinga and maple, 19 x 22 x 14 in.", false);

	portfolio[20] = new Piece();
	portfolio[20].init("Kusaka Hall Table", "kusaka-hall-table",
	"White oak with wenge, 35 x 57 x 14 in.", false);

	portfolio[21] = new Piece();
	portfolio[21].init("Emspak Hall Table", "emspak-hall-table",
	"Cherry with ebonized walnut, 32 x 54 x 14 in.", false);

	portfolio[22] = new Piece();
	portfolio[22].init("Peirce Low Table", "peirce-low-table",
	"Jatoba (Brazilian Cherry), 13 x 84 x 14 in.", false);

	portfolio[23] = new Piece();
	portfolio[23].init("Emspak Dining Table", "emspak-dining-table",
	"Cherry with rosewood and ebonized walnut, 29 x 78 x 39 in.", true);

	portfolio[24] = new Piece();
	portfolio[24].init("Sokolow Dining Chair", "sokolow-chair",
	"Walnut", false);

	portfolio[25] = new Piece();
	portfolio[25].init("Bolker Dining Table", "bolker-dining-table",
	"Walnut, 29 x 84 x 39 in.", false);

	portfolio[26] = new Piece();
	portfolio[26].init("Shoji Snowflake Screen", "shoji",
	"Alaskan Yellow Cedar", true);

	portfolio[27] = new Piece();
	portfolio[27].init("Lueders Cabinet", "lueders-cabinet",
	"Walnut, Alaskan Yellow Cedar, handmade paper, 34 x 66 x 18 in.", false);

	portfolio[28] = new Piece();
	portfolio[28].init("Lamps", "lamps",
	"Walnut, Cherry, Alaskan Yellow Cedar", false);

	portfolio[29] = new Piece();
	portfolio[29].init("Donna Cabinet", "donna-cabinet-2116",
	"Cherry with Port Orford Cedar and paper, 32 x 39.5 x 15 in. deep", false);

	portfolio[30] = new Piece();
	portfolio[30].init("Chair", "cherry-chair", "Cherry", false);

	portfolio[31] = new Piece();
	portfolio[31].init("Chestnut Hall Table", "chestnut-hall-table",
	"Chestnut, 60 x 30 x 15 in. deep", false);

	start = document.location.href.indexOf("=");
	if (start != -1)
		piece = document.location.href.substring(start+1, document.location.href.length);
	if (piece <= 0 || piece >= portfolio.length)
		piece = 1;
}
