window.onload = initLinks;

var myPics = new Array(
"url('images/content/tailgating/photo-1.jpg')", 
"url('images/content/tailgating/photo-2.jpg')", 
"url('images/content/tailgating/photo-3.jpg')", 
"url('images/content/tailgating/photo-4.jpg')", 
"url('images/content/tailgating/photo-5.jpg')", 
"url('images/content/tailgating/photo-6.jpg')", 
"url('images/content/tailgating/photo-7.jpg')", 
"url('images/content/tailgating/photo-8.jpg')", 
"url('images/content/tailgating/photo-9.jpg')", 
"url('images/content/tailgating/photo-10.jpg')", 
"url('images/content/tailgating/photo-11.jpg')", 
"url('images/content/tailgating/photo-12.jpg')", 
"url('images/content/tailgating/photo-13.jpg')", 
"url('images/content/tailgating/photo-14.jpg')", 
"url('images/content/tailgating/photo-15.jpg')", 
"url('images/content/tailgating/photo-16.jpg')", 
"url('images/content/tailgating/photo-17.jpg')", 
"url('images/content/tailgating/photo-18.jpg')", 
"url('images/content/tailgating/photo-19.jpg')");

var myThumbs = new Array(
"thumb1", 
"thumb2", 
"thumb3", 
"thumb4", 
"thumb5", 
"thumb6", 
"thumb7", 
"thumb8", 
"thumb9", 
"thumb10", 
"thumb11", 
"thumb12", 
"thumb13", 
"thumb14", 
"thumb15", 
"thumb16", 
"thumb17", 
"thumb18", 
"thumb19");
var myTitles = new Array(
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"",
"",
"",
"");
var myTexts = new Array(
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"", 
"",
"",
"",
"");
var thisPic = 0;

function initLinks() {
	document.getElementById("thumb1").onclick = processThis1;
	document.getElementById("thumb2").onclick = processThis2;
	document.getElementById("thumb3").onclick = processThis3;
	document.getElementById("thumb4").onclick = processThis4;
	document.getElementById("thumb5").onclick = processThis5;
	document.getElementById("thumb6").onclick = processThis6;
	document.getElementById("thumb7").onclick = processThis7;
	document.getElementById("thumb8").onclick = processThis8;
	document.getElementById("thumb9").onclick = processThis9;
	document.getElementById("thumb10").onclick = processThis10;
	document.getElementById("thumb11").onclick = processThis11;
	document.getElementById("thumb12").onclick = processThis12;
	document.getElementById("thumb13").onclick = processThis13;
	document.getElementById("thumb14").onclick = processThis14;
	document.getElementById("thumb15").onclick = processThis15;
	document.getElementById("thumb16").onclick = processThis16;
	document.getElementById("thumb17").onclick = processThis17;
	document.getElementById("thumb18").onclick = processThis18;
	document.getElementById("thumb19").onclick = processThis19;
	document.getElementById("myPicture").onclick = processNext;
}

function processPrevious() {
	if (thisPic == 0) {
		thisPic = myPics.length;
	}
	thisPic--;
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	clearThumb();
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
	return false;
}

function processNext() {
	thisPic++;
	if (thisPic == myPics.length) {
		thisPic = 0;
	}
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	clearThumb();
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
	return false;
}

function clearThumb() { 
	document.getElementById("thumb1").className = "photo_gallery_mini";	
	document.getElementById("thumb2").className = "photo_gallery_mini";	
	document.getElementById("thumb3").className = "photo_gallery_mini";	
	document.getElementById("thumb4").className = "photo_gallery_mini";	
	document.getElementById("thumb5").className = "photo_gallery_mini";	
	document.getElementById("thumb6").className = "photo_gallery_mini";	
	document.getElementById("thumb7").className = "photo_gallery_mini";
	document.getElementById("thumb8").className = "photo_gallery_mini";
	document.getElementById("thumb9").className = "photo_gallery_mini";
	document.getElementById("thumb10").className = "photo_gallery_mini";
	document.getElementById("thumb11").className = "photo_gallery_mini";
	document.getElementById("thumb12").className = "photo_gallery_mini";
	document.getElementById("thumb13").className = "photo_gallery_mini";
	document.getElementById("thumb14").className = "photo_gallery_mini";
	document.getElementById("thumb15").className = "photo_gallery_mini";
	document.getElementById("thumb16").className = "photo_gallery_mini";
	document.getElementById("thumb17").className = "photo_gallery_mini";
	document.getElementById("thumb18").className = "photo_gallery_mini";
	document.getElementById("thumb19").className = "photo_gallery_mini";
}

function processThis1() { 
	thisPic = 0;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis2() { 
	thisPic = 1;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];	
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis3() { 
	thisPic = 2;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis4() { 
	thisPic = 3;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis5() { 
	thisPic = 4;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis6() { 
	thisPic = 5;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis7() { 
	thisPic = 6;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis8() { 
	thisPic = 7;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis9() { 
	thisPic = 8;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis10() { 
	thisPic = 9;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis11() { 
	thisPic = 10;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis12() { 
	thisPic = 11;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis13() { 
	thisPic = 12;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis14() { 
	thisPic = 13;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis15() { 
	thisPic = 14;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis16() { 
	thisPic = 15;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis17() { 
	thisPic = 16;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis18() { 
	thisPic = 17;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}
function processThis19() { 
	thisPic = 18;
	clearThumb();
	document.getElementById("myPicture").style.backgroundImage = myPics[thisPic];	
	document.getElementById("myText").innerHTML = myTexts[thisPic];
	document.getElementById("myTitle").innerHTML = myTitles[thisPic];
	document.getElementById(myThumbs[thisPic]).className = "photo_gallery_mini_active";
}