// Javascript for Rend Lake Web site
// Sniff out the browser
 if (document.getElementById) {
			stdBrowser = true
		}
		else {
			stdBrowser = false
		}
 //Grooby drop down menus
		function toggleMenu(currElem,nextPos) {
			if (stdBrowser) {
				menuObj = document.getElementById(currElem).style
			}
			else {
				menuObj = eval("document." + currElem)
			}
			if (toggleMenu.arguments.length == 1) {
				if (parseInt(menuObj.top) == 325) {
					nextPos = 125
				}
				else {
					nextPos = 325
				}
			}
			if (stdBrowser) {
				menuObj.top = nextPos + "px"
			}
			else {
				menuObj.top = nextPos
			}
		}
// Simpler drop down menus
function rlmenus(obj2, seeit) {
    if(stdBrowser)
            {
            document.getElementById(obj2).style.height = seeit
          }
    else
        {
            menuObj = eval("documnt." + obj2 + ".style")
            menuObj.height = eval(seeit)
        }
      }
// function to autocycle little bitty pictures for a pleaseing effect
// variables for the cycling pictures
var thisPic = 0
var picct = 8
// The functions that cycle the pictures
// Here is the first one, Fritz
function cycleGallery() {
	if (document.images) {
	thisPic++ 
	if (thisPic == picct) {
	     thisPic = 0 
          }
// Objects that put pictures in separate cells in a table
	document.GalleryCycle.src=details1[thisPic];
// A timer to rotate the pictures
        setTimeout("cycleGallery()", 2 * 2000)
      }
}
//
var thisPic2 = 0
var picct2 = 8
// The second function that cycles the pictures
function cycleGallery2() {
	if (document.images) {
	thisPic2++ 
	if (thisPic2 == picct2) {
	     thisPic2 = 0 
          }
// Objects that put pictures in separate cells in a table
	document.GalleryCycle2.src=details2[thisPic2];
// A timer to rotate the pictures
        setTimeout("cycleGallery2()", 3 * 2000)
      }
}
//
var thisPic3 = 0
var picct3 = 8
// The third function that cycles the pictures boy is this tedious
function cycleGallery3() {
	if (document.images) {
	thisPic3++ 
	if (thisPic3 == picct3) {
	     thisPic3 = 0 
          }
// Objects that put pictures in separate cells in a table
	document.GalleryCycle3.src=details3[thisPic3];
// A timer to rotate the pictures
        setTimeout("cycleGallery3()", 5 * 2000)
      }
}
//
var thisPic4 = 0
var picct4 = 8
// The fourth and last function that cycles the pictures, thank goodness
function cycleGallery4() {
	if (document.images) {
	thisPic4++ 
	if (thisPic4 == picct4) {
	     thisPic4 = 0 
          }
// Objects that put pictures in separate cells in a table
	document.GalleryCycle4.src=details4[thisPic4];
// A timer to rotate the pictures
        setTimeout("cycleGallery4()", 4 * 2000)
      }
}
//Fucntion for the photo tour
//declare empty variables for cycling pictures
//Function that sets the variable.
 checker = 0
function setGalleryVar(galleryvar, gallerychoice, pics){
    nextPic2= galleryvar
    gallery = gallerychoice
    next2 = pics
    checker=1
        }
//Function to actually browse the pics
function galleryBrowse2() {
    if(checker==1) {
    if (document.images) {
    nextPic2++
    if (nextPic2 == next2) {
    nextPic2 = 0 
        }
        document.tour.src = gallery[nextPic2];
        }
      }
        else
        {alert("Please select a tour by clicking on one of the three buttons")}
}
// now we create the room array
var interiorGallery = new Array(9)
interiorGallery[0] = "images/roomtour-1.jpg";
interiorGallery[1] = "images/roomtour-2.jpg";
interiorGallery[2] = "images/roomtour-3.jpg";
interiorGallery[3] = "images/roomtour-4.jpg";
interiorGallery[4] = "images/roomtour-5.jpg";
interiorGallery[5] = "images/roomtour-6.jpg";
interiorGallery[6] = "images/roomtour-7.jpg";
interiorGallery[7] = "images/roomtour-8.jpg";
interiorGallery[8] = "images/roomtour-9.jpg";
//now we create the aerial photo array, boy is it cool
var aboveGallery  = new Array(12)
aboveGallery[0] = "images/photo_aerial_secludedcabins.jpg";
aboveGallery[1] = "images/photo_rl_above.jpg";
aboveGallery[2] = "images/photo_rl_above1.jpg";
aboveGallery[3] = "images/photo_rl_above4.jpg";
aboveGallery[4] = "images/photo_rl_above5.jpg";
aboveGallery[5] = "images/photo_rl_above6.jpg";
aboveGallery[6] = "images/photo_rl_above7.jpg";
aboveGallery[7] = "images/photo_rl_above8.jpg";
aboveGallery[8] = "images/photo_rl_above9.jpg";
aboveGallery[9] = "images/photo_rl_above12.jpg";
aboveGallery[10] = "images/photo_rl_above13.jpg";
aboveGallery[11] = "images/photo_rl_above14.jpg";
// now we create the outside tour array and is this a great resort or what?
var outsideGallery = new Array(22)
outsideGallery[0] = "images/photo_lake_boater320.jpg";
outsideGallery[1] = "images/photo_rl_outside9.jpg";
outsideGallery[2] = "images/photo_paddlewheel320.jpg";
outsideGallery[3] = "images/photo_biketrail320.jpg";
outsideGallery[4] = "images/photo_shooters.jpg";
outsideGallery[5] = "images/photo_waterEdge.jpg";
outsideGallery[6] = "images/photo_geesinwater.jpg";
outsideGallery[7] = "images/photo_cabins_fall_320.jpg";
outsideGallery[8] = "images/photo_sunsetfisher_320.jpg";
outsideGallery[9] = "images/photo_leafyroad320.jpg";
outsideGallery[10] = "images/photo_cove2_320.jpg";
outsideGallery[11] = "images/photo_sunset_6_320.jpg";
outsideGallery[12] = "images/photo_sunset_5_320.jpg";
outsideGallery[13] = "images/photo_sunset10_320.jpg";
outsideGallery[14] = "images/photo_rl_outside_boating.jpg";
outsideGallery[15] = "images/photo_rl_outside320.jpg";
outsideGallery[16] = "images/photo_rl_outside6.jpg";
outsideGallery[17] = "images/photo_rl_outside8.jpg";
outsideGallery[18] = "images/photo_cabins_water320.jpg";
outsideGallery[19] = "images/photo_rl_turkeymeet.jpg";
outsideGallery[20] = "images/photo_rl_outside5.jpg";
outsideGallery[21] = "images/photo_rl_outside3.jpg";
// now we create the first of the little detail arrays used as rotating pics to show how wonderful rend lake resort is
var details1 = new Array(9)
details1[0] =  "images/photo_aerial.jpg";
details1[1] =  "images/photo_onphone.jpg";
details1[2] =  "images/photo_aerial3.jpg";
details1[3] =  "images/photo_boathouse2l.jpg";
details1[4] =  "images/photo_restaurant_entry.jpg";
details1[5] =  "images/photo_fallcolor.jpg";
details1[6] =  "images/photo_wedding_fireplace177.jpg";
details1[7] =  "images/photo_pool1_177.jpg";
// next details array
var details2 = new Array(8)
details2[0] =  "images/photo_banquet.jpg";
details2[1] =  "images/photo_bigbass.jpg";
details2[2] =  "images/photo_hottub177.jpg";
details2[3] =  "images/photo_bikes.jpg";
details2[4] =  "images/photo_deerinroad.jpg";
details2[5] =  "images/photo_aerial4.jpg";
details2[6] =  "images/photo_eaglesnatch177.jpg";
details2[7] =  "images/photo_sunset_6_177.jpg";
// the third details array
var details3 = new Array(8)
details3[0] =  "images/photo_drive.jpg";
details3[1] =  "images/photo_aerial2.jpg";
details3[2] =  "images/photo_flowers.jpg";
details3[3] =  "images/photo_greatroom.jpg";
details3[4] =  "images/photo_guyfishing1.jpg";
details3[5] =  "images/photo_openwater.jpg";
details3[6] =  "images/photo_sunset_5_177.jpg";
details3[7] =  "images/photo_cabins_water177.jpg";
// the fourth details array
var details4 = new Array(8)
details4[0] =  "images/photo_horseyback.jpg";
details4[1] =  "images/photo_leafyroad.jpg";
details4[2] =  "images/photo_lilly.jpg";
details4[3] =  "images/photo_openwater.jpg";
details4[4] =  "images/photo_aerial6.jpg";
details4[5] =  "images/photo_windytrail.jpg";
details4[6] =  "images/photo_room_lowlight177.jpg";
details4[7] =  "images/photo_kitchenette177.jpg";
// This function is for the cool rollover buttons
// First, we must declare the image objects
if (document.images) {
// declare the image objects
            buttonNextpic1 = new Image
            buttonNextpic2 = new Image
            buttonRooms1 = new Image
            buttonRooms2 = new Image
            buttonFromabove1 = new Image
            buttonFromabove2 = new Image
            buttonResort1 = new Image
            buttonResort2 = new Image
// assign the image URLS
            buttonNextpic1.src = "images/art_button_nextpic1.gif"
            buttonNextpic2.src = "images/art_button_nextpic2.gif"
            buttonRooms1.src = "images/art_button_rooms1.gif"
            buttonRooms2.src = "images/art_button_rooms2.gif"
            buttonFromabove1.src = "images/art_button_fromabove1.gif"
            buttonFromabove2.src = "images/art_button_fromabove2.gif"
            buttonResort1.src = "images/art_button_resort1.gif"
            buttonResort2.src = "images/art_button_resort2.gif"
          }
// Rescue dinosaur browsers from making an error
          else {
            buttonMextpic1 = ""
            buttonNextpc2 = ""
            buttonRooms1 = ""
            buttonRooms2 = ""
            buttonFromabove1 = ""
            buttonFromabove2 = ""
            buttonResort1 = ""
            buttonResort2 = ""
            document.tour = ""
            document.rooms = ""
            document.fromabove = ""
            document.resort = ""
                  }
/* Now, in the script of the page we will call the objects for the rollover by using the following pattern-- onmouseover= document.ANAME.IMAGE_OBJECT.src = IMAGE.EXT */
// Make a function that toggles a list of e-mail addresses to select them for e-mail
function ToggleCheckAll( state ) {
        var f = document.listServe.elements;
        for (var ii=0; ii < document.listServe.elements.length; ii++) {
                if (state == 'true')
                        document.listServe.elements[ii].checked = true;
                else
                        document.listServe.elements[ii].checked = false;
        }
        return false;
}

