    var makingData = [];
makingData[1] = [];

makingData[1][1] = [];
makingData[1][2] = [];
makingData[1][3] = [];

makingData[2] = [];

makingData[2][1] = [];
makingData[2][2] = [];
makingData[2][3] = [];

makingData[1][1][1] = {
	title: 'W-right in a box',
	text: '36 x 16.5 x 37.75 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '',
	available: false,
	thumb: 'w-right_thumb.jpg',
	image: ['w-right.jpg', 'w-right_detail.jpg']
};

makingData[1][2][1] = {
	title: 'Speaker\'s Corner',
	text: '30.5 x 20 x 43.5 inches<br>appropriated shipping crate plywood with altered walnut cabinetry<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '',
	available: false,
	thumb: 'speaker_t.jpg',
	image: ['speaker1.jpg','speaker2.jpg','speaker3.jpg','speaker4.jpg']
};

makingData[1][3][1] = {
	title: 'Inside-Out Corner Bench',
	text: '122 x 42 x 28.5 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '$8,500',
	available: true,
	thumb: 'bench_t.jpg',
	image: ['bench1.jpg','bench2.jpg','bench3.jpg']
};

makingData[1][1][2] = {
	title: 'Chicago Chair One',
	text: '30.25 x 24 x 30.25 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '$6,500',
	available: true,
	thumb: 'chicago1_t.jpg',
	image: ['chicago11.jpg','chicago12.jpg','chicago13.jpg']
};

makingData[1][2][2] = {
	title: 'Chicago Chair Two',
	text: '35.5 x 20.5 x 31 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '',
	available: false,
	thumb: 'chicago2_t.jpg?id=ddd',
	image: ['chicago21.jpg','chicago22.jpg','chicago23.jpg']
};

makingData[1][3][2] = {
	title: 'Wendy Chair',
	text: '30.5 x 24.5 x 39 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '',
	available: false,
	thumb: 'wendy_t.jpg?r=d',
	image: ['wendy1.jpg','wendy2.jpg','wendy3.jpg', 'wendy4.jpg']
};

makingData[1][1][3] = {
	title: 'Jim Chair',
	text: '30.5 x 31 x 39 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '',
	available: false,
	thumb: 'jim_t.jpg',
	image: ['jim1.jpg']
};

makingData[1][2][3] = {
	title: 'Mono-Corner chair',
	text: '26 x 24 x 37.75 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '',
	available: false,
	thumb: 'mono_t.jpg?id=ddd',
	image: ['mono1.jpg','mono2.jpg','mono3.jpg']
};

makingData[1][3][3] = {
	title: 'Olivia Chair',
	text: '24.5 x 21.5 x 42.75 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '',
	available: false,
	thumb: 'olivia_t.jpg',
	image: ['olivia1.jpg','olivia2.jpg','olivia3.jpg','olivia4.jpg']
};

makingData[2][1][1] = {
	title: 'A Leg and an Arm chair',
	text: '26.75 x 20 x 28 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '',
	available: false,
	thumb: 'legarm_t.jpg',
	image: ['legarm1.jpg','legarm2.jpg']
};

makingData[2][2][1] = {
	title: 'An Arm and a Leg chair',
	text: '34 x 27 x 27.75 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '',
	available: false,
	thumb: 'armleg_t.jpg',
	image: ['armleg1.jpg']
};

makingData[2][3][1] = {
	title: 'T bench',
	text: '45 x 23 x 29 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique. Signed by the artist to the underside.',
	price: '$6,500',
	available: true,
	thumb: 'tbench_t.jpg',
	image: ['tbench1.jpg','tbench2.jpg']
};

makingData[2][1][2] = {
	title: 'Artist\'s Proof',
	text: '28 x 19 x 25 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique.',
	price: '',
	available: false,
	thumb: 'ap1_t.jpg',
	image: ['ap11.jpg','ap12.jpg', 'ap13.jpg']
};

makingData[2][2][2] = {
	title: 'Artist\'s Proof',
	text: '17 x 28.5 x 30 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique.',
	price: '',
	available: false,
	thumb: 'ap2_t.jpg',
	image: ['ap21.jpg','ap22.jpg','ap23.jpg']
};

makingData[2][3][2] = {
	title: 'Arco chair',
	text: '30 x 26.25 x 51.25 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique.',
	price: '',
	available: false,
	thumb: 'arco_t.jpg',
	image: ['arco1.jpg','arco2.jpg','arco3.jpg']
};


makingData[2][1][3] = {
	title: 'Sunday Morning with Harry chair',
	text: '31 x 25 x 30 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique.',
	price: '',
	available: false,
	thumb: 'sunday_t.jpg',
	image: ['sunday1.jpg','sunday2.jpg','sunday3.jpg', 'sunday4.jpg']
};

makingData[2][2][3] = {
	title: 'Tagliata Arne chair',
	text: '28 x 19 x 31 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique.',
	price: '',
	available: false,
	thumb: 'tagliata_t.jpg',
	image: ['tagliata1.jpg','tagliata2.jpg','tagliata3.jpg', 'tagliata4.jpg']
};

makingData[2][3][3] = {
	title: 'Chair n\' Box',
	text: '24 x 25 x 35 inches<br>appropriated shipping crate plywood and furniture elements<br>2008<br><br>This work is unique.',
	price: '$6,500',
	available: true,
	thumb: 'chairnbox_t.jpg',
	image: ['chairnbox1.jpg','chairnbox2.jpg','chairnbox3.jpg']
};


function hideOverlay() {
	
	$('#overlay_contents').fadeOut('fast', function() {
		$('#overlay').fadeOut('fast', function() {    $('#slide1').show(); });
	});
}

function showImage(p, x, y, z) {
        cz = z;
		$('#oc_img').get(0).src = 'images/making/'+makingData[p][x][y].image[z];
}

function showWork(p, x, y) {
    cx = x;
    cy = y;
    cz = 0;
    
	//alert(x+', '+y);
	
	$('#slide1').hide();
	
	$('#overlay').fadeIn('fast', function() {	
		$('#oc_img').get(0).src = 'images/making/'+makingData[p][x][y].image[0];
		
		if (makingData[p][x][y].available) {
			var pf = '<br><br><b>'+makingData[p][x][y].price+'</b><br><br><a href="mailto:sales@wright20.com?subject=Purchase - Gamper - '+makingData[p][x][y].title+'">Buy this item</a> <b>/</b> <a href="#" onclick="hideOverlay(); return false;">Back to Overview</a>';
		}
		else {
			var pf = '<br><br><b>RESERVED</b><br><br><a href="#" onclick="hideOverlay(); return false;">Back to Overview</a>';
		}
		
		
		if (makingData[p][x][y].image.length>1) {
		
			var pfpf = '<br><br>Photos: ';
			for(var z = 0; z < makingData[p][x][y].image.length; z++) {
				pfpf += '<a href="#" onclick="showImage('+p+','+x+','+y+', '+z+'); return false;">'+(z+1)+'</a> ';
			}
			
			pf = pfpf + '' + pf;
		}
		
		$('#content').html('<strong>'+makingData[p][x][y].title+'</strong>'+makingData[p][x][y].text+''+pf);
		
		$('#overlay_contents').show();
	
	
	 });
	
	return false;
}

function loadWorks() {
	for(var i in makingData[p]) {
		for(var j in makingData[p][i]) {
			$('body').append('<div class="box'+i+j+'"><a href="#" onclick="this.blur(); return showWork('+p+', '+i+','+j+');"><img src="images/making/'+makingData[p][i][j].thumb+'" width="100" height="86" alt="" title="" /></a></div>');
		}
	}
}

var cz = 0;
var cx = 0;
var cy = 0;

function loadNext() {
    if (cz+1<makingData[p][cx][cy].image.length)
        showImage(p, cx, cy, cz+1);
    else
        showImage(p, cx, cy, 0);
}