
var g_init = true;		        		// boolean specifying if slideshow is running
var g_slidesArray = new Array();  // array of slideshow's slide objects
var g_currSlideIndex = 0;         // index of current g_slidesArray[] slide
var g_isPlaying = true;		        // boolean specifying if slideshow is running
var g_isPaused  = false;          // boolean specifying if slideshow is paused
var g_duration = 8;               // num seconds each slide is displayed
var g_loop = false;               // boolean specifying if slideshow is looping
var g_HTMLstring = "";            // HTML string to write in slideFrame
var g_justStarted = true;         // boolean specifying if slideshow just started
var pause = 1000;		// pause variable.  1000 is about 5 seconds

function loadup()  // initialize everything
  {
  initSlideShow();
  g_isPlaying = true;
  timeoutID = setTimeout("slideshowStart();", 1000);
  }

//function bigPicWin()  // Open plain window for big view of photos
//  {
//    // url, name, features, replace
//    var x;
//    window.open("","BigPic", "scrollbars, resizable, 640, 480");
//  }

function initSlideShow()  // initialize the slideshow
  {
  makeSlideShow();  // populate g_slidesArray[] with slide objects
  dispSlide(0);
  g_init=false;
  }

function slide(pic, bigpic, just, title, text)  // slide object constructor function
  {
  this.pic		= pic;		// slide image file
  this.bigpic		= bigpic;	// slide image file
  this.just		= just;		// image justification: left/right
  this.title		= title;	// slide title property
  this.text		= text;		// slide text property
  }


function makeSlideShow()  // populate g_slidesArray[] with slide objects
  {
  // this is where you specify the slides for your show; use the syntax:
  //   new slide ("pic", "bigpic", "just", "title", "text")

// 1
  index=0;
  g_slidesArray[index] = new slide("aerial-se-250.jpg", "aerial-se-big.jpg", "left", "Aerial View",
    "<UL><LI><FONT SIZE=\"+2\"><B>" +
    "3,000 x 48 feet asphalt, lighted runway</B></FONT></LI>" +
		"<LI>Protective Covenants</LI>" +
		"<LI>Acreages on runway with taxiway access</LI>" +
		"<LI>Homesites off runway</LI>" +
		"<LI>Runway sealed and striped 1998</LI><UL>");

// 2
  index++;
  g_slidesArray[index] = new slide("aerial-wsw-250.jpg", "aerial-wsw-big.jpg", "right", "View: SW to NE",
    "<B>Located on beautiful<BR>" +
		"<FONT SIZE=\"+2\">Bull Shoals Lake</FONT><BR>" +
		"in Southwest Missouri, 16NM from Mountain Home, Arkansas</B>");

// 3
  index++;
  g_slidesArray[index] = new slide("p12-250.jpg", "p12-big.jpg", "left", "Live with a view!",
    "<B>You could live with a view like this!!</B>" +
		"<BR><B>(Homesite 12)</B>" +
		"<BR><B></B>" +
		"<BR><B>A new subdivision, &quot;Eagle Wing Addition&quot; consists " +
		"of 3 acre homesites with taxiway access to the runway.</B>");

// 4
  index++;
  g_slidesArray[index] = new slide("lt2-home-250.jpg", "lt2-home-big.jpg", "right", "Tree-covered homesites!",
    "<B>Homesites off the airport are available " +
		"with lake views and pastoral views.</B>");

// 5
  index++;
  g_slidesArray[index] = new slide("ac-on-rw-250.jpg", "ac-on-rw-big.jpg", "left", "Asphalt Landings!",
    "<B>There are those here who prefer asphalt for landings and " +
		"for takeoffs...</B>");

// 6
  index++;
  g_slidesArray[index] = new slide("float-app-250.jpg", "float-app-big.jpg", "right", "Lake Landings!",
    "<B>... while others prefer a different approach!</B>");

// 7
  index++;
  g_slidesArray[index] = new slide("boat-dock-250.jpg", "boat-dock-big.jpg", "left", "Boat Docks!",
    "<B>A cove adjacent to the property is zoned for boat docks!</B>");

// x
//  index++;
//  g_slidesArray[index] = new slide("ski-barefoot-250.jpg", "ski-barefoot-big.jpg", "right", "Barefoot Skiing!",
//    "<B>The water is so clean, and often calm," +
//		"<BR>some of our neighbors</B><BR><B>ski <U>barefoot</U>!</B>");

// 8
  index++;
  g_slidesArray[index] = new slide("p8-250.jpg", "p8-big.jpg", "right", "Lake view through trees",
    "<B>So, if you want to live with a view...<BR><BR>" +
		"<FONT SIZE=\"-2\">(Homesite #8)</FONT></B>");

// 9
  index++;
  g_slidesArray[index] = new slide("skiscene-250.jpg", "skiscene-big.jpg", "left", "Skiing",
    "<P><B>... or play in the clear, clean waters of Bull Shoals Lake,</B></P>" +
		"<P><B>we will be pleased to show you...</B></P>");

// 10
  index++;
  g_slidesArray[index] = new slide("baron-hang-250.jpg", "baron-hang-big.jpg", "right", "Hangars",
    "<B>...Homesites that are adjacent to the " +
		"runway, and those that are off the runway...</B>");

// 11
  index++;
  g_slidesArray[index] = new slide("dock-floatplane-250.jpg", "dock-floatplane-big.jpg", "left", "Lake flying",
    "<B>... as well as the beauty of the lake adjacent to the property!</B>");

// 12
//  index++;
//  g_slidesArray[index] = new slide("p1-250.jpg", "p1-big.jpg", "right", "Homesite 1",
//    "<B>So, just sit back and see some of the views available<BR>such as this one from Homesite 1</B>");

// 13
//  index++;
//  g_slidesArray[index] = new slide("p4-250.jpg", "p4-big.jpg", "left", "Homesite 4",
//    "<B>Here's the view from Homesite 4...</B>");

// 14
//  index++;
//  g_slidesArray[index] = new slide("p6-250.jpg", "p6-big.jpg", "right", "Homesite 6",
//    "<B>View from Homesite 6, looking northeast...</B>");

// 15
//  index++;
//  g_slidesArray[index] = new slide("p7-250.jpg", "p7-big.jpg", "left", "Homesite 7",
//    "<B>View from Homesite 7...</B>");

// 16
//  index++;
//  g_slidesArray[index] = new slide("p10-250.jpg", "p10-big.jpg", "left", "Homesite 10",
//    "<B>View from the northeast corner of Homesite 10, looking northeast...</B>");

// Below added 20031207

// 12
  index++;
  g_slidesArray[index] = new slide("20031207_Lost_Mine_Road_250.jpg", "20031207_Lost_Mine_Road_Big.jpg", 
    "right", "Lost Mine Road", "<B>Lost Mine Road</B>");

// 13
  index++;
  g_slidesArray[index] = new slide("20031207_Homesites_7-10_250.jpg", "20031207_Homesites_7-10_Big.jpg", 
    "left", "Homesites 7-10", "<B>Homesites 7-10</B>");

// 14
  index++;
  g_slidesArray[index] = new slide("20031207_Rwy_28_250.jpg", "20031207_Rwy_28_Big.jpg", 
    "right", "Runway 28", "<B>Runway 28</B>");

// 15
  index++;
  g_slidesArray[index] = new slide("20031207_Eagle_Wing_North_Cove_250.jpg", "20031207_Eagle_Wing_North_Cove_Big.jpg", 
    "left", "Eagle Wing, North Cove", "<B>Eagle Wing, North Cove</B>");

// 16
  index++;
  g_slidesArray[index] = new slide("20031207_Rwy_28_North_Cove_250.jpg", "20031207_Rwy_28_North_Cove_Big.jpg", 
    "right", "Runway 28, North Cove", "<B>Runway 28, North Cove</B>");

// 17
  index++;
  g_slidesArray[index] = new slide("20031207_Boat_Ramp_Looking_North_250.jpg", "20031207_Boat_Ramp_Looking_North_Big.jpg", 
    "left", "Boat ramp, looking North", "<B>Boat ramp, looking North</B>");

// 18
  index++;
  g_slidesArray[index] = new slide("20031207_Rwy_10_250.jpg", "20031207_Rwy_10_Big.jpg", 
    "right", "Runway 10", "<B>Runway 10</B>");

// 19
  index++;
  g_slidesArray[index] = new slide("20031207_Lost_Mine_Ranch_250.jpg", "20031207_Lost_Mine_Ranch_Big.jpg", 
    "left", "Lost Mine Ranch", "<B>Lost Mine Ranch</B>");

// 20
  index++;
  g_slidesArray[index] = new slide("20031207_Eagle_Wing_Dr_Rwy_10_250.jpg", "20031207_Eagle_Wing_Dr_Rwy_10_Big.jpg", 
    "right", "Eagle Wing Drive, Runway 10", "<B>Eagle Wing Drive, Runway 10</B>");

// 21
  index++;
  g_slidesArray[index] = new slide("20031207_Looking_South_250.jpg", "20031207_Looking_South_Big.jpg", 
    "left", "Looking South", "<B>Looking South</B>");

// Above added 20031207

// 17
  index++;
  g_slidesArray[index] = new slide("layout-250.gif", "layout-big.gif", "right", "Plat Drawing",
    "<B>Here's a Plat drawing.</B>");

// 18
  index++;
  g_slidesArray[index] = new slide("p8-neighbor-2-250.jpg", "p8-neighbor-2-big.jpg", "right", "View from Homesite 8",
    "<B>Local wisdom indicates that we get one white Christmas every 20 years. " + 
    "The other 19 are spent playing golf, boating or fishing.<BR>" + 
    "Here are some of our neighbors and some winter season views of the lake " + 
    "from lots off the runway not associated with Eagle Wing Addition.</B>");

// 19
  index++;
  g_slidesArray[index] = new slide("p9-neighbor-250.jpg", "p9-neighbor-big.jpg", "left", "Lot 9 Neighbor",
    "<B>Lot 9 neighbor...</B>");

// 20
  index++;
  g_slidesArray[index] = new slide("p9-view-250.jpg", "p9-view-big.jpg", "right", "Lot 9 View",
    "<B>View from Lot 9</B>");

// 21
  index++;
  g_slidesArray[index] = new slide("p21-lr-view-250.jpg", "p21-lr-view-big.jpg", "left", "View from Lot 21",
    "<B>A view from Lot 21 living room...</B>");

// 22
  index++;
  g_slidesArray[index] = new slide("sectional.jpg", "sectional.jpg", "left", "Location on sectional",
    "<UL><LI>30NM East of Branson, MO</LI>" +
		"<LI>58 NM southeast of Springfield</LI>" +
		"<LI>Almost equidistant to KCI &amp; STL</LI>" +
		"<LI>DFW a bit farther</LI>" +
		"<LI>Check the FAA records at " +
		"<A HREF=\"http://www.airnav.com/cgi-bin/airport-info?MO56\">" +
		"<IMG SRC=\"../img/airnav.gif\" ALT=\"AIRNAV\" WIDTH=\"74\" HEIGHT=\"20\"></A>" +
		"<BR>( <A HREF=\"http://www.airnav.com/cgi-bin/airport-info?MO56\">" +
		"www.airnav.com</A> )</LI></UL>");
  }

function slideshowStart()  // start/run slideshow
  {
//  if (parent.slideFrame.document.images[0].complete)  // wait until slide is loaded!
  if (1)  // wait until slide is loaded!
    {
    if (g_justStarted)  // show just starting
      {
      g_justStarted = false;
      document.slideshowForm.slideshowPlayBtn.value = "Restart";
      }
    else                // show already running
      {
      slideNext();
      }
    if (document.slideshowForm.slideshowPauseBtn.value == "Play")
      {
      document.slideshowForm.slideshowPauseBtn.value = "Pause"
      g_isPaused = false;
      }
    }
  g_isPlaying = true;
  timeoutID = setTimeout("slideshowStart();", g_duration * pause);
  }

function slideshowPause()  // pause slideshow
  {
  clearTimeout(timeoutID);
  document.slideshowForm.slideshowPauseBtn.value = "Play"
  g_isPaused = true;
  }

function slideshowResume()  // resume slideshow (after pausing)
  {
  document.slideshowForm.slideshowPauseBtn.value = "Pause"
  g_isPaused = false;
  slideshowStart();
  }

function doPauseClick()  // process Pause/Resume button click
  {
  if (! g_isPlaying)     // don't toggle to "Play" if show not playing
    return;
  if (! g_isPaused)
    slideshowPause()
  else
    slideshowResume();
  }

function doPlayClick()  // process Play/Stop button click
  {
    dispSlide(0);
		g_currSlideIndex = 0;  // update slide index
		g_justStarted = true;  // act as if we just started
		slideIndex = 0;  // update slide index
		//slideshowStart();
    clearTimeout(timeoutID);
    timeoutID = setTimeout("slideshowStart();", g_duration * pause);
  }

function dispSlide(slideIndex)  // display current slide
  {

  	if (g_init) {
    	g_currSlideIndex = 0;  // update slide index
			}
  	else {
			if (parent.slideFrame.document.images[0].complete)  // wait until slide is loaded!
				{
			g_currSlideIndex = slideIndex;  // update slide index
			}
		}

		document.slideshowForm.slideNumber.value = slideIndex + 1;
	
  	g_HTMLstring = "<TABLE BORDER='0'><TR><TD>";
    if (g_slidesArray[g_currSlideIndex].just == "left") {
      g_HTMLstring += 
      "<A HREF='" + g_slidesArray[g_currSlideIndex].bigpic +
      "' TARGET='BigPic' " + 
      "onClick='window.open(\"\",\"BigPic\", " + 
      "\"scrollbars,resizable,width=656,height=496\");' " +
      "><IMG SRC='" + g_slidesArray[g_currSlideIndex].pic + "' " +
      "ALT='" + g_slidesArray[g_currSlideIndex].title + "' " +
      "NAME='slideImage'></A></TD>" +
      "<TD>" + g_slidesArray[g_currSlideIndex].text + "</TD>";
      }
    else {
      g_HTMLstring += g_slidesArray[g_currSlideIndex].text + "</TD>" +
      "<TD><A HREF='" + g_slidesArray[g_currSlideIndex].bigpic +
      "' TARGET='BigPic' " + 
      "onClick='window.open(\"\",\"BigPic\", " + 
      "\"scrollbars,resizable,width=656,height=496\");' " +
      "><IMG SRC='" + g_slidesArray[g_currSlideIndex].pic + "' " +
      "ALT='" + g_slidesArray[g_currSlideIndex].title + "' " +
      "NAME='slideImage'></A>";
      }
    g_HTMLstring += "</TD></TR></TABLE>";
//    top.slideFrame.location.href = "slide.html";
    parent.slideFrame.location.href = "slide.html";
  }

function slidePrev()  // display previous slide
  {
  slideshowPause();
  if (--g_currSlideIndex < 0)   // first slide is displayed
    {
    if (g_loop)                 // Loop is checked, go to last slide
      {
      g_currSlideIndex = g_slidesArray.length - 1;
      }
    else                        // Loop is unchecked, do nothing
      {
      g_currSlideIndex = 0;
      return;
      }
    }
  dispSlide(g_currSlideIndex);  // display slide
  }

function slideNext()  // display next slide
  {
  slideshowPause();
  if (++g_currSlideIndex > g_slidesArray.length - 1)  // last slide displayed
    {
    if (g_loop)                 // Loop is checked, go to first slide
      {
      g_currSlideIndex = 0;
      }
    else                        // Loop is unchecked, do nothing
      {
      g_currSlideIndex = g_slidesArray.length - 1
      return;
      }
    }
  dispSlide(g_currSlideIndex);  // display slide
  }

function slideshowSpeed()  // set show speed on the fly
  {
  var index = document.slideshowForm.speedSelect.selectedIndex;
  g_duration  = document.slideshowForm.speedSelect.options[index].text;
  }

function doLoop()  // process Loop checkbox clicks
  {
  if (document.slideshowForm.loopCheckbox.checked)   // user checked Loop
    g_loop = true;
  else                                               // user unchecked Loop
    g_loop = false;
  }


