// JavaScript Document

// Date function

function timer(whatdate) {
var thedate = new Date()
var month = thedate.getMonth()
var year = thedate.getFullYear()
var daynum = thedate.getDate()
if (whatdate == "fulldate"){
   var thisday = ((month + 1) + " - " + daynum + " - " + year)
   return thisday}
else if (whatdate == "currentyear"){
   return year}
 else {
    return "Code Error MT001"}
}

//get random item number
var randomnumber=Math.floor(Math.random()*3);


// Photo Rotation
function mymainphoto(){
	return document.write("<img src=\"images/home/FLASHBOX"+randomnumber+".png\" width=\"880\" height=\"318\" border=\"0\" usemap=\"#Map\" id=\"mainphoto\" />");
}

<!-- Caption Rotation -->
var lr2textStr = new Array();
var lr2i = randomnumber;

//Start Items
lr2textStr[0] = 'Photo caption ONE';
lr2textStr[1] = 'Photo caption TWO';
lr2textStr[2] = 'Photo caption THREE';
lr2textStr[3] = 'Photo caption FOUR';
lr2textStr[4] = 'Photo caption FIVE';
lr2textStr[5] = 'Photo caption SIX';
lr2textStr[6] = 'Photo caption SEVEN';
lr2textStr[7] = 'Photo caption EIGHT';
lr2textStr[8] = 'Photo caption NINE';
//End Items

function lr2Rotate() {
	dom=findDOM("caption",0);
    dom.innerHTML = lr2textStr[lr2i];
}
<!--  End caption Rotation -->

// JavaScript Document
// Global find doc obj model

var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;


if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }
		else { 
			if (isAll) { return (document.all[objectID].style); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else { 
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
}
