/* 

   Name:        Guy Huntley
   Date:        7/1/07
*/

/*

<!--        <script src="spam.js" type="text/javascript"></script>   


        <script type="text/javascript">
          <!-- Hide from non-Javascript browsers
            emLink("yeltnuH yuG", "ten.asu@yeltnuhg");
          // stop hiding -->
        </script>
-->
<!-- <a href="mailto:ghuntley@usa.net">Guy Huntley</a>  -->

*/
var IEDOM;
var W3CDOM;
var theArea = "";
var soMuch, theMainMenu, theTxtSki, theLowerLeftContent, theSkierImage;
var t, s;

function getName(e) {
  if (IEDOM) {
    t = event.toElement.id;
    s = event.srcElement.id;
  } else {
    t = e.target.id;
    s = e.currentTarget.id;
  };
  if (s.length > 3) {
    temp = s.substr(0,3);
    if (temp == 'ski') {
      return 'txt' + s.substring(3)
    } else {
      return s;
    }
  } else {
    return s;
  }
}

function initIt() {

  soMuch = document.getElementById('txt01');
  theMainMenu = document.getElementById('mainMenu');
  theTxtSki = document.getElementById('txtSki');
  theLowerLeftContent = document.getElementById('lowerLeftContent');
  theSkierImage = document.getElementById('skierImage');
}

function doOver(e) {
  var name = getName(e);
//  alert('doOver, name = '+name);
  if (name.length > 0) {
//    alert('doOver, new name length = '+name.length);
    soMuch.style.visibility = "hidden";
    soMuch = document.getElementById(name);
    soMuch.style.visibility = "visible";
//    alert(name+' is '+soMuch.style.visibility);
    theMainMenu.style.visibility = "hidden";
    theLowerLeftContent.style.visibility = "hidden";
    theSkierImage.style.visibility = "hidden";
    theTxtSki.style.visibility = "visible";
    theArea = name;
  }
}

function doOut(e) {
  getName(e);
  if (IEDOM) {
    var check = (theArea != "" && ( t != "boxInner" && s == "boxInner"));
  } else {
    var check = (theArea!="" && ( t == "boxInner" && s == "boxInner") || (t == "boxOuter" && s == "boxOuter") || (t == "" && s == "boxOuter"));
  }
  if (check) {
     doHide();
  }
}

function doHide() {
  soMuch.style.visibility = "hidden";
  theTxtSki.style.visibility = "hidden";
  theMainMenu.style.visibility = "visible";
  theSkierImage.style.visibility = "visible";
  theLowerLeftContent.style.visibility = "visible";
}

function pageInit() {
  IEDOM = document.all ? true : false;
  W3CDOM = document.getElementById ? true : false;
  if (!W3CDOM) { alert ("You need to upgrade to IE7 or Firefox 1.5 for this page to work") }
  var soMuch = document.getElementById("theContent");
  if (IEDOM) {
    soMuch.style.width = "358px";
  } else {
    soMuch.style.width = "337px";
  }
}
