//// Portal-specific scripts ////

//// tabpanel_mouseover
//// This function is called when a tabpanel tab is hovered

function tabpanel_mouseover(node)
{
  var panel_1_width = document.getElementById("tabpanel_1_sublist").offsetWidth; // Needed for IE
  document.getElementById("tabpanel_1").className = ""; // De-activate default item
  node.className = "tabpanel_default"; // Activate the hovered item
  if (panel_1_width) {
    document.getElementById("tabpanel_2_sublist").style.width = (panel_1_width - 2) + "px"; // Needed for IE
    document.getElementById("tabpanel_3_sublist").style.width = (panel_1_width - 2) + "px"; // Needed for IE
   if (document.getElementById("tabpanel_4_sublist"))
document.getElementById("tabpanel_4_sublist").style.width = (panel_1_width - 2) + "px"; // Needed for IE
if (document.getElementById("tabpanel_5_sublist"))
document.getElementById("tabpanel_5_sublist").style.width = (panel_1_width - 2) + "px"; // Needed for IE

  }
}

//// tabpanel_mouseout
//// This function is called on mouseout

function tabpanel_mouseout(node)
{
  node.className = ""; // De-activate this item
  document.getElementById("tabpanel_1").className = "tabpanel_default"; // Activate default item
}

//// randomImage
//// Selects a random image for the homepage

function randomImage() // Random Image function
{
  var iNumImages = 10; // Number of images
  var aSource = new Array(iNumImages); // Path to the images
  var aAlttext = new Array(iNumImages); // Alt text
  var iRandomNumber = Math.floor(Math.random() * iNumImages);

  aSource = [
  "/images/home_vertical/fortBragg.jpg",
  "/images/home_vertical/juliaPfeiffer.jpg",
  "/images/home_vertical/lakeTahoe2.jpg",
  "/images/home_vertical/lakeTahoe.jpg",
  "/images/home_vertical/monoLake.jpg",
  "/images/home_vertical/pointLobos.jpg",
  "/images/home_vertical/sacramento.jpg",
  "/images/home_vertical/SF.jpg",
  "/images/home_vertical/yosemite2.jpg",
  "/images/home_vertical/yosemite.jpg"
  ];

  aAlttext = [
  "Fort Bragg, CA",
  "Julia Pfeiffer SP, CA",
  "Lake Tahoe, CA",
  "Lake Tahoe, CA",
  "Mono Lake, CA",
  "Point Lobos SP, CA",
  "Sacramento, CA",
  "San Francisco, CA",
  "Yosemite NP, CA",
  "Yosemite NP, CA"
  ];
  
  if ((document.getElementById) && document.getElementById('rotating_image'))
    document.getElementById('rotating_image').innerHTML = '<img src="' + aSource[iRandomNumber] + '" alt="' + aAlttext[iRandomNumber] + '" />';
}

//// portalOnload
//// This is called from navigation.js

function portalOnload()
{
  randomImage();  // Select the random image for the "information about" section
}
