/* scotus.js - brian@AlexanderZ.net . 20091106 */

window.status =  "Position cursor over link for preview. ";
window.status += "Click link for larger picture in right frame.";

thePath = "images/";

// Photo elements: [0] name, [1] pres, [2] state, [3] oath, [4] .htm filespec, [5] gif, [6] width, [7] height
function Photo(place, pres, state, oath, htm, pic, w, h) { // , bio) {
	this.place = place;
	this.pres = pres;
	this.state = state;
	this.oath = oath;
	this.htm = htm;
	this.pic = pic;
	this.w = w;
	this.h = h;
//	this.bio = bio;
}
/* Justices and Appointment Dates:
John G. Roberts, Jr., Chief Justice, 2005
Samuel Anthony Alito, Jr., Associate Justice, 2006
Stephen G. Breyer, Assoc, 1994
Ruth Bader Ginsburg, Assoc, 1993
Anthony M. Kennedy, Assoc, 1988
Antonin Scalia, Assoc, 1986
John Paul Stevens, Assoc, 1975
Sonia Sotomayor, Assoc, 2009
Clarence Thomas, Assoc, 1991
*/
var photo = new Array();
photo[0] = new Photo("The Roberts Court", "The Roberts Court", "Washinton D.C.", 2009, "court.htm", "justices.jpg", 550, 425); 
photo[1] = new Photo("John G. Roberts, Jr.", "G. W. Bush", "Maryland", 2005, "robe.htm", "roberts.jpg", 600, 465);
photo[2] = new Photo("Samuel Anthony Alito, Jr.", "G. W. Bush", "New Jersey", 2006, "alit.htm", "alito.jpg", 600, 444);
photo[3] = new Photo("Steven G. Breyer", "Clinton", "Massachusetts", 1994, "brey.htm", "breyer.jpg", 481, 600);
photo[4] = new Photo("Ruth Bader Ginsburg", "Clinton", "New York", 1993, "gins.htm", "ginsburg.jpg", 481, 600);
photo[5] = new Photo("Anthony M. Kennedy", "Reagan", "California", 1988, "kenn.htm", "kennedy.jpg", 410, 600);

photo[6] = new Photo("Antonin Scalia", "Reagan", "Virginia", 1986, "scal.htm", "scalia.jpg", 600, 483);
photo[7] = new Photo("Sonia Sotomayor", "Obama", "New York", 2009, "soto.htm", "sotomayor.jpg", 600, 444);
photo[8] = new Photo("John Paul Stevens", "Carter", "Illinois", 1975, "stev.htm", "stevens.jpg", 600, 419);
photo[9] = new Photo("Clarence Thomas", "G. H. W. Bush", "Geogria", 1991, "thom.htm", "thomas.jpg", 410, 600);
photo[10] = new Photo("Links and Credits", "Obama", "Washinton D.C.", 2009, "links.htm", "spacer.gif", 481, 600);

theImage = new Array ();
if (document.images) {
	for (i in photo) {
		theImage[i] = new Image(photo[i].w, photo[i].h);
		theImage[i].src = thePath + photo[i].pic;
	}
}
function show(i) {
//	document.getElementById("displayHdr").innerHTML = "";
	document["displayPic"].src = theImage[i].src; 
//	document.getElementById("display").style.visibility = "visible";
	document.getElementById("displayPlace").innerHTML = "<h4>" + photo[i].place + "</h4>";
//	document.getElementById("bio").innerHTML = photo[i].bio;
//	document.getElementById("displayHdr").innerHTML = photo[i].htm;
}

/*
onHold = false;

function preView(i) {
	onHold = true;
	document.getElementById("thePlace").innerHTML = photo[i].place; // thisPlace;
	document["thePic"].src = theImage[i].src; 
}
function preViewEnd() {
	onHold = false;
}
var i = 0;
function slideshow() {
	if (onHold == true) return;
	i += 1;
	document.getElementById("slidePlace").innerHTML = photo[i].place; // thisPlace;
	document["slidePic"].src = theImage[i].src; // thePath + photo[i].pic;  // thisPic;
	if (i == photo.length-1) i = 0; // Bypass opening screen
}
*/
/*
function start_show() {
	setInterval("slideshow()", 3000);
}
*/