function getCounterCookieVal(cookieName)    {	var allCookies = document.cookie;	if(allCookies == "")	{		return -1;	}	var start = allCookies.lastIndexOf(cookieName + "=");	if(start == -1)	{		return -1;		}	start += (cookieName.length + 1);	var end = allCookies.indexOf(';', start);	if(end == -1)	{		end = allCookies.length;	}	if(isNaN(parseInt(allCookies.substring(start,end))))	{		return -1;	}	return allCookies.substring(start,end);    }	 function writeCookie(szCookieName, nImageNum, nExpireDays)    {	var expiration = new Date((new Date()).getTime() + nExpireDays*86400000);	var szCookie = szCookieName + "=" + nImageNum + "; path=" + "/" + "; expires=" + expiration.toGMTString() + ";";	document.cookie = szCookie;    }	 function runImageLookup()    {	var pictureNum = 0 - 0; 	var cookieVal = getCounterCookieVal("IMAGECOUNT");	// this is the number of pictures that the script cycles through	if((cookieVal < 0) || (cookieVal > 15)) 	{		cookieVal = 1;	}	// to make pictureNum an integer	pictureNum = cookieVal; // this is the source for the pictures, directory = photo, file = photo plus number  document.writeln('<A HREF="photos/photo'                 +pictureNum                 +'.htm"><IMG SRC="photos/photo'                 +pictureNum                 +'.jpg" BORDER="0"></A>');       // -0 to force addition over concatenation	pictureNum = pictureNum - 0 + 1; 	//cycle of photos set to 15	if(pictureNum > 15) pictureNum = 1; 	// sets expiration date for the cookie	writeCookie("IMAGECOUNT", pictureNum, 30);     }
