<!--

// <![CDATA[
//  This is inprogress!!!!

var Images = new Array ();
var Playing = false;
var Current_Pic = 0;
var Last_Pic = 0;
var MyInterval = 5;
var MyTimer = setInterval("",3000);

function Image_Preloading(){
  
     var Where = "http://www.GregoryPossman.com/images/Heidal2008/";
     var x = 0;
     var Array_Index = 0;
     if (Math.floor(Image_Preloading.arguments.length/2) == (Image_Preloading.arguments.length/2)) {
          for (x=0; x<Image_Preloading.arguments.length; x = x + 2 ){
               Images[Array_Index] = new Array(2);
               Images[Array_Index][0] = new Image();
               Images[Array_Index][0].src = Where + Image_Preloading.arguments[x];
               Images[Array_Index][1] = Image_Preloading.arguments[x+1];
               Array_Index++;
               }
          }
     else {
          alert("invalid number of arguments passed to Image_Preloading rotuine");
          }
     }


function UpdateInterval () {

               if ((MyInterval >= 1) && (MyInterval <= 20)){
                    MyInterval = MyInterval * 1000;
                    }
               else MyInterval = 3000;
               if (Playing) {
                    clearInterval(MyTimer);
                    MyTimer = setInterval("Fwd()",MyInterval);
                    }     
     }

function Play () {
       if (document.getElementById)
          {
          SliderBut = document.getElementById("slider01");
//        We are stoped so toggle to playing mode
          if (!Playing) {
               Playing = true;
               Current_Pic = 0;
               Last_Pic = 0;
               SliderBut.style.visibility = "visible";
               PlayBut = document.getElementById("P3PlayBtn");
               NameIndex = PlayBut.src.lastIndexOf("/");
               New_Src = "";
               New_Src = PlayBut.src.substr(0,NameIndex+1);
               New_Src = New_Src + "Pause.png";
               PlayBut.src = New_Src;
               MyTimer = setInterval("Fwd()",MyInterval);
                }
           else {
//        We are Playing so toggle to stopped
               Playing = false;
               clearInterval(MyTimer);
               Current_Pic = 0;
               Last_Pic = 0;
               SliderBut.style.visibility = "hidden";
               PlayBut = document.getElementById("P3PlayBtn");
               NameIndex = PlayBut.src.lastIndexOf("/");
               New_Src = "";
               New_Src = PlayBut.src.substr(0,NameIndex+1);
               New_Src = New_Src + "Play.png";
               PlayBut.src = New_Src;
             }
         }
     }
function Back () {
       if (document.getElementById)
          {
            Pict = document.getElementById("P3Image");
            Desc = document.getElementById("P3Desc");
            x = Current_Pic;
            x--;
            if ((x < 0) || (x > Images.length - 1))
               x = Images.length - 1;
            Current_Pic = x;
            Last_Pic = Current_Pic;
            Pict.src = Images[x][0].src;
            Pict.width = Images[x][0].width;
            Pict.height = Images[x][0].height;
            Desc.innerHTML = Images[x][1];
          }
     }
function Fwd () {
       if (document.getElementById)
          {
            Pict = document.getElementById("P3Image");
            Desc = document.getElementById("P3Desc");
            x = Current_Pic;
            x++;
            if ((x > Images.length - 1) || ( x < 0) )
               x = 0;
            Current_Pic = x;
            Last_Pic = Current_Pic;
            Pict.src = Images[x][0].src;
            Pict.width = Images[x][0].width;
            Pict.height = Images[x][0].height;
            Desc.innerHTML = Images[x][1];
         }
     }
function Init(e) {
     if (!e) {
          var e = window.event
          // if e doesn't already exist, assign window.event to e
          }
     if (document.getElementById)
          {
          BackBtn = document.getElementById("P3BackBtn");
          PlayBtn = document.getElementById("P3PlayBtn");
          FwdBtn = document.getElementById("P3FwdBtn");
          Interval = document.getElementById("P3Interval");
          BackBtn.onclick = Back;
          PlayBtn.onclick = Play;
          FwdBtn.onclick = Fwd;
          }
     if (document.images)
          {
          Image_Preloading(
               "Gregory.png","Our hard working Host and Facilitator Gregory A. Possman",
               "Synnove.png","Our hard working Hostess and Facilitator, Synnove Bakke",
               "Mushroom-Stew.png","Enjoy natural, wild mushroom stew, prepared by one of our wild mushroom experts.",
               "goats.png","Experience dangerous and exciting wildlife encounters!",
               "UFO.png","A potential UFO monitoring our activity. (the image is enhanced)",
               "natural-power-vortexes.png","Absorb energy at several natural power vortexes.",
               "Smadalen.png","Watching the Reindeer at Smadalen where we hear from Ena the Extra Terrestrial.",
               "Man-Made-Norwegian-Beauty.png","Man Made Norwegian Beauty",
               "Group.png","Our Group Photo from the 2008 Retreat"
               );
          }
     }  //Init()

window.onload = Init;

// ]]>

//