﻿// JavaScript Document


function startList() {

    
   if (document.all&&document.getElementById) {         // CHECK FOR STANDARD
        navRoot = document.getElementById("nav");      // FIND/assign ID "nav"
        for (i=0; i<navRoot.childNodes.length; i++) { // LOOP THROUGH nav NODES
            node = navRoot.childNodes[i];            // first/last node array
            if (node.nodeName=="LI") {             // IF NODE IS <li>
                //alert(node.nodeName);
                node.onmouseover=function() {     // ASSIGN result of Function 
                    this.className+=" cover";    // ALTER className append cover
                }                               // END anonymous Function
                node.onmouseout=function() {   // ASSIGN result of Function
                    // replace classname - find and replace " cover" with ""
                    this.className=this.className.replace(" cover", "");
                }                          // END anonymous Function
            }                             // END if (node.nodeName=="LI")
        }                                // END LOOP THROUGH nav NODES
   }                                    // END CHECK FOR STANDARD
}                                     // END shorthand anonymous Function


function toggleLayer(whichLayer){// See Class 4 for explanation of toggleLayer
  if (document.getElementById)
  {
    // this is the way the standards work
    var style2 = document.getElementById(whichLayer).style;
    style2.display = style2.display? "":"block";
  }
   else if (document.all)
  {
    // this is the way old msie versions work
    var style2 = document.all[whichLayer].style;
    style2.display = style2.display? "":"block";
  }
  else if (document.layers)
  {
    // this is the way nn4 works
    var style2 = document.layers[whichLayer].style;
    style2.display = style2.display? "":"block";
  }
}

var j = 0;
function slideShow() {
    var imageX = new Array()
    imageX[0] = 'images/istockpics/main1.jpg';
    imageX[1] = 'images/istockpics/main2.jpg';
    imageX[2] = 'images/istockpics/main3.jpg';
    document.getElementById('myImage').src = imageX[j];
    j = j + 1;
    if (j == 3) { j = 0 }
}