function testSessionCookie () {
  document.cookie ="testSessionCookie=Enabled";
  if (getCookieValue ("testSessionCookie")=="Enabled")
    return true 
  else
    return false;
}

function writeSessionCookie (cookieName, cookieValue) {
  if (testSessionCookie()) {
    document.cookie = escape(cookieName) + "=" + escape(cookieValue) + "; path=/";
    return true;
  }
  else return false;
}

function getCookieValue (cookieName) {
  var exp = new RegExp (escape(cookieName) + "=([^;]+)");
  if (exp.test (document.cookie + ";")) {
    exp.exec (document.cookie + ";");
    return unescape(RegExp.$1);
  }
  else return false;
}

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below

myCookieName = "homepage";
myCookieValue = "yes";

Pic[0] = 'images/People1Gold.jpg'
Pic[1] = 'images/People2Gold.jpg'
Pic[2] = 'images/People3Gold.jpg'
Pic[3] = 'images/People14Gold.jpg'
Pic[4] = 'images/People5Gold.jpg'
Pic[5] = 'images/People6Gold.jpg'
Pic[6] = 'images/People7Gold.jpg'
Pic[7] = 'images/People8Gold.jpg'
Pic[8] = 'images/People9Gold.jpg'
Pic[9] = 'images/People10Gold.jpg'
Pic[10] = 'images/People11Gold.jpg'
Pic[11] = 'images/People12Gold.jpg'
Pic[12] = 'images/People13Gold.jpg'
Pic[13] = 'images/People4Gold.jpg'

// do not edit anything below this line
var t;
var j = Math.floor(Math.random()*14);
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {

writeSessionCookie (myCookieName, myCookieValue);

if (document.all) {
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}
//  End -->

function initPage()
{
value = getCookieValue (myCookieName);
if(value != "yes")
	{
	runSlideShow();
	}
else
	{
	if (document.all) {
	document.images.SlideShow.style.filter="blendTrans(duration=2)";
	document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
	document.images.SlideShow.filters.blendTrans.Apply();
	}
	document.images.SlideShow.src = preLoad[j].src;
	if (document.all) {
	document.images.SlideShow.filters.blendTrans.Play();
	}
	}
}