function WoodSpecies(name, desc, imageSrc)
{
  this.name = name;
  this.desc = desc;
  this.imageSrc = imageSrc;
}

var WoodSpeciesArray = new Array();

var species = new WoodSpecies();

species.name = "Douglas Fir";
species.desc = "The Simpson name has been synonymous with fir doors since the beginning. Clean lines and warm coloring give our vertical grain Douglas Fir doors an enduring appeal.";
species.imageSrc = "fir.jpg"

WoodSpeciesArray.push(species);

// Array index 1 is unused.
var species = new WoodSpecies();
WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Western Hemlock";
species.desc = "Western Hemlock is often used interchangeably with Douglas Fir, depending on the region of the country. It is characterized by a lighter, creamier color that accepts a variety of stains.";
species.imageSrc = "westernhemlock.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Eastern White Knotty Pine";
species.desc = "Looking for doors that will give your home a rustic, comfortable feel? Our Knotty Pine doors can help accentuate a casual or country style with their characteristic tight, close knots and light color.";
species.imageSrc = "knottypine.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Poplar";
species.desc = "Warm up your home with the understated look of poplar. Compared to other woods, poplar has a relatively uniform texture, with a fine to medium grain. The color tone can range from yellow brown to an olive green. Poplar can be stained and is often used when a very smooth paint finish is required.";
species.imageSrc = "poplar.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Maple";
species.desc = "There is a nearly universal appeal to maple; it is equally at home in Colonial or contemporary settings. Maple is light in color. In some instances, hard Maple may have curvy, birdseye or fiddleback configurations that add visual interest.";
species.imageSrc = "maple.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Red Oak";
species.desc = "Homeowners have long appreciated the striking, open grain of Oak, as well as the rugged durability of the species. Our Oak doors display an image of timeless appeal and enduring strength.";
species.imageSrc = "oak.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Cherry";
species.desc = "Nothing matches the smooth, satin texture of Cherry. The wood is reddish brown in tone with a fine, straight grain. Frequently used in high-end furniture, Cherry is a natural choice for upscale living.";
species.imageSrc = "cherry.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Knotty Alder";
species.desc = "Knotty Alder has the strength of maple and the personality of pine. The wood is light brown in color with yellow and peach hues. Stains can further highlight the beautiful grain. The open, solid knots give Alder a more informal presence.";
species.imageSrc = "knottyalder.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Western Red Cedar";
species.desc = "Western Red Cedar is valued for its warm, cinnamon hues.  Doors made of this wood provide a stunning visual complement in homes with red cedar decks, siding or shingles.";
species.imageSrc = "westernredcedar.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Ash";
species.desc = "A durable and beautiful Ash door is the perfect way to create an All-American appeal in your home.  Its pale-brown color and straight grain recall the look of classic home furnishings.";
species.imageSrc = "ash.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "White Birch";
species.desc = "Widely used in woodworking projects, White Birch has a light-toned color reminiscent of maple.  It accepts a range of stains and paints to fit a multitude of home styles.";
species.imageSrc = "whitebirch.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Hickory";
species.desc = "Hickory is synonymous with toughness.  This hardwood stands the test of time, and its deep brown and reddish tones provide a look of class and prestige.";
species.imageSrc = "hickory.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Quarter Sawn Red Oak";
species.desc = "Fashionable for Arts and Crafts style furniture, this wood is produced with a unique cutting technique for a straight, tight grain.  Eye-catching patterns add to its attractiveness in doors.";
species.imageSrc = "quartersawnredoak.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Black Locust";
species.desc = "Black Locust is one of North America's most durable hardwoods and is naturally decay-resistant, making it an excellent choice for exterior doors.  Coloring is pale, yellowish-brown.";
species.imageSrc = "blacklocust.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Nootka Cypress";
species.desc = "Also known as Alaskan Yellow Cedar, this wood has long been prized by native peoples of the North.  Nootka Cypress has a uniform color and straight grain for a fine, smooth finish.";
species.imageSrc = "cypress.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "African Mahogany";
species.desc = "Add traditional sophistication to your living space with a door made from African Mahogany.  Its deep, rich colors make it one of the world's most treasured woods for interior finishes.";
species.imageSrc = "mahogany.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Sapele";
species.desc = "Popular for European-styled interiors and Simpson's standard mahogany species, Sapele hardwood has a tight grain and reddish-brown color. The distinctive patterns created by the wood's varied colors and graining make for an eye-catching door.";
species.imageSrc = "sapele.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Bamboo";
species.desc = "Bamboo's warmth and richness match a wide-range of home styles, from modern to retro.  With a textile-like surface appearance, bamboo doors complement cabinets, floors and furnishings for an integrated home design.";
species.imageSrc = "bamboo.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Walnut";
species.desc = "An American classic, Walnut is synonymous with fine interior finishes.  Its chocolate-brown coloring, straight grain and whorls are reflective of Colonial-style homes and quality antiques.";
species.imageSrc = "walnut.jpg"

WoodSpeciesArray.push(species);

var species = new WoodSpecies();

species.name = "Ponderosa Pine";
species.desc = "Honey-toned Ponderosa Pine is a natural choice for classic Americana.  From log homes to Santa Fe adobes to contemporary interiors, it speaks to relaxation and hominess.  Ponderosa Pine takes a range of finishes well.";
species.imageSrc = "ponderosapine.jpg"

WoodSpeciesArray.push(species);

$(document).ready(function ()
{
  $("#chooseSpecies").change(function ()
  {
    var speciesIndex = $("#chooseSpecies").val();

    $("#detailTitle").html(WoodSpeciesArray[speciesIndex].name);

    $("#detailDesc").html(WoodSpeciesArray[speciesIndex].desc);

    $("#detailImage").fadeOut("fast", function ()
    {
      $("#loadingOverlay").fadeIn("fast", function ()
      {
        $("#detailImage").attr("src", "/door-products/wood-species/images/" + WoodSpeciesArray[speciesIndex].imageSrc).load(function ()
        {
          $("#loadingOverlay").fadeOut("fast", function ()
          {
            $("#detailImage").fadeIn();
          });
        });
      });
    });
  });

  $("#chooseByColor img").hover(function ()
  {
    $(this).next("em").stop(true, true).fadeIn("normal");
  }, function ()
  {
    $(this).next("em").fadeOut("fast");
  });

  $("#chooseByColor p").click(function ()
  {
    var speciesIndex = $(this).attr("id").replace("color", "");

    $("#detailTitle").html(WoodSpeciesArray[speciesIndex].name);

    $("#detailDesc").html(WoodSpeciesArray[speciesIndex].desc);

    $("#detailImage").fadeOut("fast", function ()
    {
      $("#loadingOverlay").fadeIn("fast", function ()
      {
        $("#detailImage").attr("src", "/door-products/wood-species/images/" + WoodSpeciesArray[speciesIndex].imageSrc).load(function ()
        {
          $("#loadingOverlay").fadeOut("fast", function ()
          {
            $("#detailImage").fadeIn();
          });
        });
      });
    });
  });
});