﻿function scriptInit() {
if (!document.getElementById) {
	return;
	}
}

function addEvent(elm, evType, fn, useCapture) {
	if (elm.addEventListener) {
	elm.addEventListener(evType, fn, useCapture);
	return true;
	} else if (elm.attachEvent) {
	var r = elm.attachEvent('on' + evType, fn);
	return r;
	} else {
	elm['on' + evType] = fn;
	}
}

function checkActive() {
	var a = document.getElementsByTagName("a");
	if (window.location.href.substr(location.href.length - 1, 1) == '/') {
		var loc = window.location.href + 'default.aspx'; 
	}
	else {
		var loc = window.location.href;
	}
	for(var i=0; i < a.length; i++) {
		if (a[i].href == loc) {
			a[i].setAttribute("class", "active");
			a[i].setAttribute("className", "active");
		}
	}
}

var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = 'img/parkDay/pMenu.png'
theImages[1] = 'img/parkday/pMenu2.png'
theImages[2] = 'img/parkday/pic1.png'
//theImages[3] = 'img/parkday/pic2.png'
//theImages[4] = 'img/parkday/pic14.png'
//theImages[5] = 'img/parkday/pic4.png'
theImages[3] = 'img/parkday/pic5.png'
theImages[4] = 'img/parkday/pic11.png'
theImages[5] = 'img/parkday/pic7.png'
theImages[6] = 'img/parkday/pic8.png'
theImages[7] = 'img/parkday/pic9.png'
theImages[8] = 'img/parkday/pic10.png'
theImages[9] = 'img/parkday/pic6.png'
theImages[10] = 'img/parkday/pic12.png'
//theImages[14] = 'img/parkday/pic13.png'
//theImages[15] = 'img/parkday/pic3.png'

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(more){
    if(more > 0)
    {
        whichImage = whichImage + more;
        whichImage = whichImage >= theImages.length ? whichImage - more - more : whichImage;
    }
    document.write('<img src="'+theImages[whichImage]+'" alt="Anamarc College" style="border:solid 1px black;">');
}
