TITLE = 0;
THUMB = 1;
IMAGE = 2;
TEXT = 3;
PADDING = 4;

var prints = new Array();
prints.push(BuildImage("Impressions", "antoniapinter_monotype_impressionspanelone.jpg", 'image size: 11 x 17" paper size: 22 x 30"<br/>monotype', 10));
prints.push(BuildImage("Impressions", "antoniapinter_monotype_impressionspaneltwo.jpg", 'image size: 11 x 17" paper size: 22 x 30"<br/>monotype', 10));
prints.push(BuildImage("Impressions", "antoniapinter_monotype_impressionspanelthree.jpg", 'image size: 11 x 17" paper size: 22 x 30"<br/>monotype', 10));
prints.push(BuildImage("Rats", "Pinter_1.jpg", '13 x 20"<br/>intaglio', 12));
prints.push(BuildImage("Tree", "Pinter_7.jpg", '6 x 9"<br/>Etching', 5, 11));
prints.push(BuildImage("Preserve the Mammoth", "mammoth.jpg", '5 x 7"<br/>Linoleum relief and letterpress', 10));
prints.push(BuildImage("Rat and Mole", "Pinter_4.jpg", '6 x 9"<br/>Intaglio', 5, 13));
//prints.push(BuildImage("", "", ''));

var drawings = new Array();
drawings.push(BuildImage("Macular Degeneration", "AMD-eyerotated.jpg", '13 x 13"<br/>Charcoal', 5, 6));
//drawings.push(BuildImage("", "", ''));

var mixedMedia = new Array();
mixedMedia.push(BuildImage("Transition Nesting", "antoniapinter_mixedprintmedia_transitionnesting.jpg", '22 x 30"<br/>Mixed print media', 11));
mixedMedia.push(BuildImage("Untitled", "antoniapinter_mixedprintmedia_untitled.jpg", '15 x 22"<br/>Mixed Print Media', 5, 14));
mixedMedia.push(BuildImage("Untitled", "Pinter_3.jpg", '20 x 15"<br/>Mixed print media', 9));
mixedMedia.push(BuildImage("Untitled", "exp_yellow-neuron-foliage.jpg", '5 x 8"<br/>Mixed print media', 5, 15));
mixedMedia.push(BuildImage("Untitled", "exp_peacock.jpg", '4 x 12"<br/>Mixed media', 5, 22));
mixedMedia.push(BuildImage("Untitled", "exp_peacock-and-cells.jpg", '9 x 12"<br/>mixed media', 5, 11));
mixedMedia.push(BuildImage("Preservation and Entropy", "Preservation_and_Entropy_1.jpg", 'dimensions: 16 x 19"<br/>year: 2010<br/>media: monotype, silkscreen, wax, found objects', 13));
mixedMedia.push(BuildImage("Preservation and Entropy", "Preservation_and_Entropy_2.jpg", 'dimensions: 16 x 19"<br/>year: 2010<br/>media: monotype, silkscreen, wax, found objects', 13));
mixedMedia.push(BuildImage("Preservation and Entropy", "Preservation_and_Entropy_3.jpg", 'dimensions: 16 x 19"<br/>year: 2010<br/>media: monotype, silkscreen, wax, found objects', 13));
mixedMedia.push(BuildImage("Preservation and Entropy", "Preservation_and_Entropy_4.jpg", 'dimensions: 16 x 19"<br/>year: 2010<br/>media: monotype, silkscreen, wax, found objects', 13));
mixedMedia.push(BuildImage("Sewn Bird", "sewn_bird_1.jpg", 'dimensions: 20 x 20"<br/>media: thread, paper, found object<br/>year: 2010', 13));
mixedMedia.push(BuildImage("Sewn Bird", "sewn_bird_2.jpg", 'dimensions: 20 x 20"<br/>media: thread, paper, found object<br/>year: 2010', 5, 13));
mixedMedia.push(BuildImage("Lab Rats", "SAM_0721.jpg", 'medium: wax, plexiglass, oil-based ink<br/>dimensions: variable<br/>year: 2010', 13));
mixedMedia.push(BuildImage("Lab Rats", "SAM_0723.jpg", 'medium: wax, plexiglass, oil-based ink<br/>dimensions: variable<br/>year: 2010', 13));
mixedMedia.push(BuildImage("Lab Rats", "SAM_0724.jpg", 'medium: wax, plexiglass, oil-based ink<br/>dimensions: variable<br/>year: 2010', 13));
mixedMedia.push(BuildImage("Lab Rats", "SAM_0725.jpg", 'medium: wax, plexiglass, oil-based ink<br/>dimensions: variable<br/>year: 2010', 13));
mixedMedia.push(BuildImage("Lab Rats", "SAM_0726.jpg", 'medium: wax, plexiglass, oil-based ink<br/>dimensions: variable<br/>year: 2010', 13));
//mixedMedia.push(BuildImage("", "", ''));

var bio = new Array();
bio.push(BuildImage("Antonia Pinter", "antoniapinter_mixedmedia_braincellneuron.jpg", "Antonia Pinter spent her childhood on Vashon Island, Washington, where her interests in art and natural sciences began. She graduated from Vashon High School in 2007, and attended Western Washington University for a brief time. She is currently enrolled at Pacific Northwest College of Art as a printmaking major. She has recently been awarded the Scott Fuentes Printmaking Scholarship and the Vivian & Gordon Gilkey Printmaking Scholarship. She was also named the outstanding entering senior in the department this year. Antonia will graduate in spring 2011."));

var galleries = new Object();
galleries.prints = prints;
galleries.drawings = drawings;
galleries.mixedmedia = mixedMedia;
galleries.bio = bio;

var activeGallery = prints;
var activeGalleryName = "prints";


function BuildImage(title, image, text, paddingTop, paddingLeft) {
	if(paddingTop === undefined) {
		paddingTop = 5;
	}
	if(paddingLeft === undefined) {
		paddingLeft = 5;
	}
	
	var thumb = image.replace(".jpg", "_thumb.jpg");
	
	return [title, "imgs/" + thumb, "imgs/" + image, text, paddingTop + "px 0 0 " + paddingLeft + "px"];
}

function SelectGallery(gid, link) {
	$("#galleries a.active").removeClass("active");
	$(link).addClass("active");
	
	activeGalleryName = gid;
	SetupGallery(galleries[gid]);
}

function SetupGallery(data) {
	activeGallery = data;
	
	$("#image-selector").empty();
	
	if(activeGalleryName != "bio") {
		for(var i = 0; i < data.length; i++) {
			$("#image-selector").append('<a href="#/' + activeGalleryName + '/' + i + '" onclick="DisplayImage(' + i + ')"><img src="' + data[i][THUMB] + '" alt="' + data[i][TITLE] + '" title="' + data[i][TITLE] + '" style="padding:' + data[i][PADDING] + ';" /></a>');
		}
	}
	
	DisplayImage(0);
}

function DisplayImage(index) {
	data = activeGallery[index];
	
	$("#image").attr("src", data[IMAGE]);
	$("#image").attr("alt", data[TITLE]);
	$("#image").attr("title", data[TITLE]);
	
	$("#image-title").html(data[TITLE]);
	$("#image-desc").html(data[TEXT]);
}

$(document).ready(function() {
	if(location.hash == "") {
		SetupGallery(activeGallery);
	} else {
		var tmp = location.hash.split("/");
		if(tmp[1] == "prints" || tmp[1] == "drawings" || tmp[1] == "mixedmedia" || tmp[1] == "bio") {
			activeGalleryName = tmp[1];
			SelectGallery(activeGalleryName);
			
			$("#" + activeGalleryName).addClass("active");
			
			if(tmp[2]) {
				DisplayImage(new Number(tmp[2]));
			}
		} else {
			SetupGallery(activeGallery);
		}
	}
});
