// create picture objects
p0 = new Pic("images/gallery/asskicker_large.jpg", "Asskicker is looking good!");
p1 = new Pic("images/gallery/bobomo_large.jpg", "Bobomo is looking good!");
p2 = new Pic("images/gallery/dev20_large.jpg", "dev_20 is looking good!");
p3 = new Pic("images/gallery/fullmetal_large.jpg", "Fullmetal is looking good!");
p4 = new Pic("images/gallery/rastafa_large.jpg", "Rastafa is looking good!");
p5 = new Pic("images/gallery/wabargh_large.jpg", "Wabargh is looking good!");
p6 = new Pic("images/gallery/matrix_large.jpg", "Matrix Pyro");
p7 = new Pic("images/gallery/goldrush1_large.jpg", "Goldrush Destruction");
p8 = new Pic("images/gallery/notaspy_large.jpg", "Not a Spy");
p9 = new Pic("images/gallery/grunvagr_large.jpg", "Grunvagr is looking good!");
p10 = new Pic("images/gallery/rare1_large.jpg", "Rare Endangered Spy Crab is looking good!");
p11 = new Pic("images/gallery/noodles_large.jpg", "Noodles is looking good!");

// set up pics in array
pictures = new Array();
pictures[0] = p0;
pictures[1] = p1;
pictures[2] = p2;
pictures[3] = p3;
pictures[4] = p4;
pictures[5] = p5;
pictures[6] = p6;
pictures[7] = p7;
pictures[8] = p8;
pictures[9] = p9;
pictures[10] = p10;
pictures[11] = p11;

// generate random pic onload
var i = pictures.length - 1;
num1 = Math.floor(Math.random() * i);
num2 = (num1==i) ? 0 : 1 + num1;
num3 = (num2==i) ? 0 : 1 + num2;
num4 = (num3==i) ? 0 : 1 + num3;
num5 = (num4==i) ? 0 : 1 + num4;
num6 = (num5==i) ? 0 : 1 + num5;

// define each pic for Display()
function Pic(url,alt) {
	this.url = url;
	this.alt = alt;
	this.Display = Display;
}

// show each pic
function Display() {
	a = "<a href='" + this.url;
	b = "'><img class='img' src='" + this.url;
	c = "' alt='" + this.alt + "' /></a>";
	document.write(a + b + c);
}

a = "http://thephraseoftheday.com/kfc/index.html";
b = "http://www.thephraseoftheday.com/kfc/index.html";
c = "http://thephraseoftheday.com/kfc";
d = "http://www.thephraseoftheday.com/kfc";
e = "http://thephraseoftheday.com/kfc/";
f = "http://www.thephraseoftheday.com/kfc/";

g = "http://thephraseoftheday.com/kfc/gallery.htm";
h = "http://www.thephraseoftheday.com/kfc/gallery.htm";

if (window.location == a || window.location == b || window.location == c || window.location == d || window.location == e || window.location == f) {
	u = pictures[num1];
	v = pictures[num2];
	w = pictures[num3];
	u.Display();
	v.Display();
	w.Display();
} else if (window.location == g || window.location == h) {
	u = pictures[num1];
	v = pictures[num2];
	w = pictures[num3];
	x = pictures[num4];
	y = pictures[num5];
	z = pictures[num6];
	u.Display();
	v.Display();
	w.Display();
	x.Display();
	y.Display();
	z.Display();
} else {
	for(i=0; i<pictures.length; i++) {
		x = pictures[i];
		x.Display();
	}
}