function Photo() {}

Photo.prototype.randomIndex = 0;

function Photo_getSize() {return 20;}

function Photo_setRandomIndex()
{
    //set a random index for use in all remaining selections
    var ran = Math.random();
    var nHigh = Photo_getSize();
    this.randomIndex = Math.floor(1 + ran*nHigh);
    if (this.randomIndex>nHigh) {this.randomIndex = nHigh;}
}

function Photo_getFeaturedPhoto(outPutType,selectionType)
{
  var index;
  var nHigh; 
  var highString = "";
  var event = new Array(5);
 
  nHigh = Photo_getSize();

  now = new Date();
  var outString = "";
  var dayOfMonth = now.getDate();
 
  //select by random number
  if (selectionType==0)
  {
    index = this.randomIndex;
  }
  else
  {
    index = selectionType;
  }

  //select the Photo from the entire array of choices
  event = getEvent(index,event);


  //load the arrays containing the specific texts and strings
  if (outPutType=='photo') {return event[0];}
  if (outPutType=='smallphoto') {return event[1];}
  else if (outPutType=='alttext') {return event[2];}
  else if (outPutType=='text') {return event[3];}
  else if (outPutType=='link') {return event[4];}
  
}


function getEvent (index,e)
{ 
   e[4] = "";

    if (index==1)
    {
      e[0] = 'photos/brownfield.jpg';
      e[1] = 'photos/sbrownfield.jpg';
      e[2] = 'Abandonded property in need of redevelopment.';
      e[3] = 'Brownfields research addresses technical issues that could enhance site reuse.';
      e[4] = 'research/regsupport/brownfields.html';
    }
    else if (index==2)
    {
      e[0] = 'photos/auger.jpg';
      e[1] = 'photos/sauger.jpg';
      e[2] = 'Augering a borehole at a contaminated site';
      e[3] = 'Equipment for ground water sampling is illustrated on this web site.';
      e[4] = 'learn2model/part-one/field/index.html';
    }
    else if (index==3)
    {
      e[0] = 'photos/TennAST02.jpg';
      e[1] = 'photos/TennAST02s.jpg';
      e[2] = 'Above ground storage tanks.';
      e[3] = 'Leaks from above ground storage tanks may be easily detected, but these tanks may suffer from other limitations.';
      e[4] = 'http://www.epa.gov/swerust1/cmplastc/asts.htm';
    }
    else if (index==4)
    {
      e[0] = 'photos/brownfrog.jpg';
      e[1] = 'photos/brownfrogs.jpg';
      e[2] = 'Brown frog from Oconee County, Georgia';
      e[3] = 'A late summer visitor to a backyard in Oconee County, Georgia.';
    }
    else if (index==5)
    {
      e[0] = 'photos/froggy.jpg';
      e[1] = 'photos/froggys.jpg';
      e[2] = 'Young frog fresh from the tadpole life-stage';
      e[3] = 'Young frog fresh from the tadpole life-stage.';
    }
    else if (index==6)
    {
      e[0] = 'photos/winteryweather2.jpg';
      e[1] = 'photos/winteryweather2s.jpg';
      e[2] = 'Holly with ice coating';
      e[3] = 'Wintery weather coating hollies with ice in North East Georgia';
    }
    else if (index==7)
    {
      e[0] = 'photos/beeswarm.jpg';
      e[1] = 'photos/beeswarms.jpg';
      e[2] = 'Bee swarm';
      e[3] = 'Swarming bees in Winder, Georgia';
    }
    else if (index==8)
    {
      e[0] = 'photos/sevenswamp.jpg';
      e[1] = 'photos/sevenswamps.jpg';
      e[2] = 'Cypress swamp';
      e[3] = 'Cypress trees in the Seven Devils Swamp near Dermott, Arkansas';
    }
    else if (index==9)
    {
      e[0] = 'photos/2rocks.jpg';
      e[1] = 'photos/2rocks-s.jpg';
      e[2] = 'Rialto Beach on the Olympic Peninsula in the State of Washington';
            e[3] = e[2];
    } 
   else if (index==10)
    {
      e[0] = 'photos/beach.jpg';
      e[1] = 'photos/beach-s.jpg';
      e[2] = 'James Island off Rialto Beach in the State of Washington';
            e[3] = e[2];
    } 
   else if (index==11)
    {
      e[0] = 'photos/hole.jpg';
      e[1] = 'photos/hole-s.jpg';
      e[2] = ' "Hole in the Wall" at Rialto Beach on the Olympic Peninsula in the State of Washington';
            e[3] = e[2];
    } 
  else if (index==12)
    {
      e[0] = 'photos/mtnflowers.jpg';
      e[1] = 'photos/mtnflowers-s.jpg';
      e[2] = 'Mount Eleanor in the Olympic National Rainforest, Washington State';
            e[3] = e[2];
    } 
  else if (index==13)
    {
      e[0] = 'photos/mtntrail2.jpg';
      e[1] = 'photos/mtntrail2-s.jpg';
      e[2] = 'View from hiking trail on Mount Eleanor in the Olympic National Rainforest, Washington State';
            e[3] = e[2];
    } 
 else if (index==14)
    {
      e[0] = 'photos/mtntrail.jpg';
      e[1] = 'photos/mtntrail-s.jpg';
      e[2] = 'View from hiking trail on Mount Eleanor in the Olympic National Rainforest, Washington State';
            e[3] = e[2];
    } 
 else if (index==15)
    {
      e[0] = 'photos/rainforest.jpg';
      e[1] = 'photos/rainforest-s.jpg';
      e[2] = 'Hoh National Rainforest, Olympic Peninsula';
            e[3] = e[2];
    } 
 else if (index==16)
    {
      e[0] = 'photos/starfish.jpg';
      e[1] = 'photos/starfish-s.jpg';
      e[2] = 'Purple starfish seen at low tide on Rialto Beach';
            e[3] = e[2];
    } 
 else if (index==17)
    {
      e[0] = 'photos/sunset.jpg';
      e[1] = 'photos/sunset-s.jpg';
      e[2] = 'Northwestern most point in the contiguous United States';
            e[3] = e[2];
    } 
 else if (index==18)
    {
      e[0] = 'photos/soque.jpg';
      e[1] = 'photos/soque-s.jpg';
      e[2] = 'Banks of the Soque River in North Georgia';
      e[3] = e[2];
    } 
 else if (index==19)
    {
      e[0] = 'photos/Field2.jpg';
      e[1] = 'photos/Field2-s.jpg';
      e[2] = 'Spring instrumented for flow gauging and automated sampling';
      e[3] = e[2];
      e[4] = 'research/field/watkinsville/redox/index.html';
    }
  else if (index==20)
    {
      e[0] = 'photos/Field3.jpg';
      e[1] = 'photos/Field3-s.jpg';
      e[2] = 'Dye injection at Watkinsville, Georgia field site';
      e[3] = e[2];
      e[4] = 'research/field/watkinsville/redox/index.html';
    } 
    return e;
}
//add methods to the prototype
Photo.prototype.getSize = Photo_getSize;
Photo.prototype.setRandomIndex = Photo_setRandomIndex;
Photo.prototype.getFeaturedPhoto = Photo_getFeaturedPhoto;
