/*
'---------------------------------------------------------------------------------------------
' JS(CommonFunctions.js)                                                                 09/04
'
' Developers : Brian Garber
' Area       : Navagation
'
' This page contains all the JavaScript functions used on the site.
'---------------------------------------------------------------------------------------------
' Revisions  :
'---------------------------------------------------------------------------------------------
*/

//--------------------------------------------------------------------------------------------
// Function is used to display a random animal header image and update the alt attribute too.
//--------------------------------------------------------------------------------------------
function fcnDisplayRandomImage()
{
  var IMAGE_PATH     = "/Images/Headers/";
  var strImageName   = "";
  var objTopImage    = null;
  var objBottomImage = null;

  var intRandomID = Math.floor(Math.random() * 5) + 1;

  //What Image was selected.
  if (intRandomID == 1)
  {
    objTopImage        = document.getElementById("TopAnimal");
    objTopImage.src    = IMAGE_PATH + "PheasantTop.gif";
    objTopImage.alt    = "Ringed-neck pheasant photo";
    objBottomImage     = document.getElementById("BottomAnimal");
    objBottomImage.src = IMAGE_PATH + "PheasantBottom.gif";
    objBottomImage.alt = "Ringed-neck pheasant photo";
  }
  else if (intRandomID == 2)
  {
    objTopImage        = document.getElementById("TopAnimal");
    objTopImage.src    = IMAGE_PATH + "TurkeyTop.gif";
    objTopImage.alt    = "Turkey photo";
    objBottomImage     = document.getElementById("BottomAnimal");
    objBottomImage.src = IMAGE_PATH + "TurkeyBottom.gif";
    objBottomImage.alt = "Turkey photo";
  }
  else if (intRandomID == 3)
  {
    objTopImage        = document.getElementById("TopAnimal");
    objTopImage.src    = IMAGE_PATH + "DeerTop.gif";
    objTopImage.alt    = "White tail deer photo";
    objBottomImage     = document.getElementById("BottomAnimal");
    objBottomImage.src = IMAGE_PATH + "DeerBottom.gif";
    objBottomImage.alt = "White tail deer photo";
  }
  else if (intRandomID == 4)
  {
    objTopImage        = document.getElementById("TopAnimal");
    objTopImage.src    = IMAGE_PATH + "PrairieDogTop.gif";
    objTopImage.alt    = "Prairie dog photo";
    objBottomImage     = document.getElementById("BottomAnimal");
    objBottomImage.src = IMAGE_PATH + "PrairieDogBottom.gif";
    objBottomImage.alt = "Prairie dog photo";
  }
  else if (intRandomID == 5)
  {
    objTopImage        = document.getElementById("TopAnimal");
    objTopImage.src    = IMAGE_PATH + "WalleyeTop.gif";
    objTopImage.alt    = "Walleye fish photo";
    objBottomImage     = document.getElementById("BottomAnimal");
    objBottomImage.src = IMAGE_PATH + "WalleyeBottom.gif";
    objBottomImage.alt = "Walleye fish photo";
  }
}

//--------------------------------------------------------------------------------------------
// Function is used to display new windows.
//--------------------------------------------------------------------------------------------
function fcnOpenNewWindow(a_strURL, a_strWindowName, a_strFeatures)
{
  window.open(a_strURL,a_strWindowName,a_strFeatures);
  return(false);
}

//--------------------------------------------------------------------------------------------
// Function is used for site tracking.
//--------------------------------------------------------------------------------------------
function pr()
{
  an = navigator.appName;
  d = document;
  srb="na";
  srw="na";

  s=screen;
  srw=s.width;
  an!="Netscape"? srb=s.colorDepth:srb=s.pixelDepth;
  r=41;
  d.images?r=d.getElementById("im").width:z=0;

  d.write("<img src='http://v0.extreme-dm.com/0.gif?tag=garberb&j=y&srw=" + srw + "&srb=" + srb + "&rs=" + r + "&l=" + escape(d.referrer) + "' height='1' width='1' />");
}


