var QUOTE_TBL =
[
	["If you want inner peace find it in solitude, not speed, and if you would find yourself, look to the land from which you came and to which you go.", "-Stewart L. Udall"],
	["Nature is painting for us, day after day, pictures of infinite beauty.", "-John Ruskin"],
	["In all things of nature there is something of the marvelous.", "-Aristotle"],
	["Not to dream boldly may turn out to be simply irresponsible.", "-George Leonard"],
	["In the end, our society will be defined not only by what we create, but by what we refuse to destroy.", "-John Sawhill"],
	["The Wilderness holds answers to more questions than we have yet learned to ask.", "-Nancy Newhall"],
	["To the dull mind nature is leaden. To the illumined mind the whole world burns and sparkles with light.", "-Ralph Waldo Emerson"],
	["To see a world in a grain of sand And a heaven in a wild flower, Hold infinity in the palm of your hand And eternity in an hour", "-William Blake"],
	["Climb the mountains and get their good tidings. Nature's peace will flow into you as sunshine flows into trees. The winds will blow their freshness into you, and the storms their energy, while cares will drop off like falling leaves.", "-John Muir"],
	["Those who contemplate the beauty of the earth find reserves of strength that will endure as long as life lasts.", "-Rachel Carson"],
	["The world is what it is, no less and no more, and therein lies its entire and sufficient meaning.", "-Edward Abbey"],
	["The longest journey begins with a single step, not with the turn of an ignition key.", "-Edward Abbey"],
	["The clearest way into the Universe is through a forest wilderness.", "-John Muir"],
	["Winds are advertisements of all they touch, however much or little we may be able to read them: telling of their wanderings even by their scents alone.", "-John Muir"],
	["We need the tonic of wildness...We can never have enough of nature.", "-Henry David Thoreau"],
	["In wisdom gathered over time I have found that every experience is a form of exploration.", "-Ansel Adams"],
	["There are no rules for good photographs, there are only good photographs.", "-Ansel Adams"],
	["Landscape photography is the supreme test of the photographer - and often the supreme disappointment.", "-Ansel Adams"],
	["Myths and creeds are heroic struggles to comprehend the truth in the world.", "-Ansel Adams"],
	["When words become unclear, I shall focus with photographs. When images become inadequate, I shall be content with silence.", "-Ansel Adams"],
	["Not everybody trusts paintings but people believe photographs.", "-Ansel Adams"],
	["Ultimately, my hope is to amaze myself. The anticipation of discovering new possibilities beomes my greatest joy.", "-Jerry Uelsmann"],
	["Success is what happens when 10,000 hours of preparation meet with one moment of opportunity.", "-Anonymous"],
	["Joy in looking and comprehending is nature's most beautiful gift.", "-Albert Einstein"],
	["Come forth into the light of things, Let Nature be your teacher.", "-William Wordsworth"],
	["Under the desert sun, in the dogmatic clarity, the fables of theology and the myths of classical philosophy dissolve like mist. The air is clean, the rock cuts cruelly into flesh; shatter the rock and the odor of flint rises to your nostrils, bitter and sharp. Whirlwinds dance accross the salt flats, a pillar of dust by day; the thornbush breaks into flame at night. What does it mean? It means nothing. It is as it is and has no need for meaning. The desert lies beneath and soars beyond any possible human qualification. Therefore, sublime.", "-Edward Abbey"],
	["There is a love of wild nature in everybody, an ancient mother-love showing itself whether recognized or no, and however covered by cares and duties.", "-John Muir"],
	["I never found a companion that was so companionable as solitude.", "-Henry David Thoreau"],
	["A life in harmony with nature, the love of truth and virtue, will purge the eyes to understanding her text.", "-Ralph Waldo Emerson"],
	["Come on in. The earth, like the sun, like the air, belongs to everyone and to no one.", "-Edward Abbey"],
	["I am I plus my surroundings and if I do not preserve the latter, I do not preserve myself.", "-Jose Ortega Y Gasset"],
	["Many go fishing all their lives without knowing that it is not fish they are after.", "-Henry David Thoreau"],
	["If I wished to see a mountain or other scenery under the most favorable auspices, I would go to it in foul weather, so as to be there when it cleared up; we are then in the most suitable mood, and nature is most fresh and inspiring.", "-Henry David Thoreau"],
	["Vision is the art of seeing things invisible.", "-Jonathan Swift"],
	["The clear skies, the brilliant stars, the far-reaching visions, the wonderful colors of the rocks have found expression in poetry and legend, and man has been led to high things as he has wandered amid the exhilarating silence of the deserts.", "-Richard Elwood Dodge"],
	["While most everyone enjoys looking at images of wild landscapes and creatures, it’s not so obvious to what degree they serve as direct substitutes for being there.", "-Galen Rowell"],
	["The beauty of Delicate Arch explains nothing, for each thing in its way, when true to its own character, is equally beautiful.", "-Edward Abbey"],
	["The voice of nature is always encouraging.", "-Henry David Thoreau"],
	["In the end we will conserve only what we love; we will love only what we understand; and we will understand only what we have been taught.", "-Baba Dioum"],
	["A true conservationist is a man who knows that the world is not given by his fathers but borrowed from his children.", "-Robert Audubon"],
	["Great things are done when men and mountains meet.", "-William Blake"],
	["For me, a landscape does not exist in its own right, since its appearance changes at every moment; but the surrounding atmosphere brings it to life - the light and the air which vary continually. For me, it is only the surrounding atmosphere which gives subjects their true value.", "-Claude Monet"],
	["Autumn is a second spring when every leaf is a flower.", "-Albert Camus"],
	["The sun, with all those planets revolving around it and dependent on it, can still ripen a bunch of grapes as if it had nothing else in the universe to do.", "-Galileo Galilei"],
	["Spring is when you feel like whistling even with a shoe full of slush.", "-Doug Larsen"],
	["Nature is just enough; but men and women must comprehend and accept her suggestions.", "-Antoinette Brown Blackwell"],
	["When we understand that man is the only animal who must create meaning, who must open a wedge into neutral nature, we already understand the essence of love. Love is the problem of an animal who must find life, create a dialogue with nature in order to experience his own being.", "-Ernest Becker"],
	["... everything in nature is lyrical in its ideal essence, tragic in its fate, and comic in its existence.", "-George Santayana"],
	["If a man walks in the woods for love of them half of each day, he is in danger of being regarded as a loafer. But if he spends his days as a speculator, shearing off those woods and making the earth bald before her time, he is deemed an industrious and enterprising citizen.", "-Henry David Thoreau"],
	["Nature abhors a vacuum, and if I can only walk with sufficient carelessness I am sure to be filled.", "-Henry David Thoreau"],
	["Nature will bear the closest inspection. She invites us to lay our eye level with her smallest leaf, and take an insect view of its plain.", "-Henry David Thoreau"],
	["Nature teaches more than she preaches. There are no sermons in stones. It is easier to get a spark out of a stone than a moral.", "-John Burroughs"],
	["Let children walk with Nature, let them see the beautiful blendings and communions of death and life, their joyous inseparable unity, as taught in woods and meadows, plains and mountains and streams of our blessed star, and they will learn that death is stingless indeed, and as beautiful as life.", "-John Muir"],
	["Only within the moment of time represented by the present century has one species -- man -- acquired significant power to alter the nature of his world.", "-Rachel Carson"],
	["Those who dwell, as scientists or laymen, among the beauties and mysteries of the earth are never alone or weary of life.", "-Rachel Carson"],
	["It is a wholesome and necessary thing for us to turn again to the earth and in the contemplation of her beauties to know of wonder and humility.", "-Rachel Carson"],
	["Everything in nature contains all the power of nature. Everything is made of one hidden stuff.", "-Ralph Waldo Emerson"],
	["Nature uses only the longest threads to weave her patterns, so that each small piece of her fabric reveals the organization of the entire tapestry.", "-Richard Feynmann"],
	["One impulse from a vernal wood \ May teach you more of man, \ Of moral evil and of good, \ Than all the sages can.", "-William Wordsworth"],
	["The tree which moves some to tears of joy is in the eyes of others only a green thing that stands in the way. Some see nature all ridicule and deformity . . . and some scarce see nature at all. But to the eyes of the man of imagination, nature is imagination itself.", "-William Blake"],
	["A society grows great when old men plant trees whose shade they know they shall never sit in.", "-Old Greek Proverb"],
	["The mountains, the forest, and the sea, render men savage; they develop the fierce, but yet do not destroy the human.", "-Victor Hugo"],
	["Human subtelty will never devise an invention more beautiful, more simple or more direct than does Nature, because in her inventions, nothing is lacking and nothing is superfluous.", "-Leonardo da Vinci"],
	["The forest is the poor man's overcoat.", "-New England Proverb"],
	["We do not see nature with our eyes, but with our understandings and our hearts.", "-William Hazlitt"],
	["What nature requires is obtainable, and within easy reach. It is for the superfluous we sweat.", "-Seneca"],
	["Forget not that the earth delights to feel your bare feet and the wind longs to play with your hair.", "-Kahlil Gibran"],
	["Thousands of tired, nerve-shaken, over-civilized people are beginning to find out that going to the mountain is going home; that wildness is necessity; that mountain parks and reservations are useful not only as fountains of timber and irrigating rivers, but as fountains of life.", "-John Muir"],
	["If future generations are to remember us with gratitude rather than contempt, we must leave them more than the miracles of technology. We must leave them a glimpse of the world as it was in the beginning, not just after we got through with it.", "-President Lyndon B. Johnson"],
	["Nature is a mutable cloud which is always and never the same.", "-Ralph Waldo Emerson"],
	["In the vaunted works of Art, The master-stroke is Nature's part.", "-Ralph Waldo Emerson"],
	["Everything has beauty but not everyone sees it.", "-Confucious"],
	["Alone in the silence, I understand for a moment the dread which many feel in the presence of primeval desert, the unconscious fear which compels them to tame, alter or destroy what they cannot understand, to reduce the wild and prehuman to human dimensions. Anything rather than confront directly the antehuman, that other world which frightens not through danger or hostility but in something far worse—its implacable indifference.", "-Edward Abbey"],
	["If a man’s imagination were not so weak, so easily tired, if his capacity for wonder not so limited, he would abandon forever such fantasies of the supernal. He would learn to perceive in water, leaves and silence more than sufficient of the absolute and marvelous, more than enough to console him for the loss of the ancient dreams.", "-Edward Abbey"],
	["There are no vacant lots in nature.", "-Edward Abbey"],
	["In the desert, there is all and there is nothing. God is there and man is not.", "-Balzac"],
	["The desert holds a perfect and natural balance between lifelessness and living vibrancy.", "-Edward Abbey"],
	["The desert can appear timeless, to span eternity.", "-Edward Abbey"],
	["Happiness is like a butterfly--if you chase it, it will elude you.  However, if you turn your attention to other things, it will softly land upon your shoulder.", "-Henry David Thoreau"]
];

var COLLECTOR_TBL = 
[
	"images/collector/tn/AnasaziRuin.jpg",
	"images/collector/tn/AspenGlow-1.jpg",
	"images/collector/tn/AspenSunset-2.jpg",
	"images/collector/tn/BryceDetail-1.jpg",
	"images/collector/tn/BryceThorsHammer.jpg",
	"images/collector/tn/CalfCreekReflection.jpg",
	"images/collector/tn/CapitolReefSunset.jpg",
	"images/collector/tn/CedarMesaHoodoo.jpg",
	"images/collector/tn/CirqueSanddune.jpg",
	"images/collector/tn/CirqueVert.jpg",
	"images/collector/tn/CoyoteButtesReflection.jpg",
	"images/collector/tn/DesertButteRockSunrise.jpg",
	"images/collector/tn/DevilsGardenArch.jpg",
	"images/collector/tn/DoubleSwirl-SunsetHiker.jpg",
	"images/collector/tn/GeyserDetail.jpg",
	"images/collector/tn/GreenRiverOlookSunset.jpg",
	"images/collector/tn/Hoodoo-Sunrise.jpg",
	"images/collector/tn/HoodooDetail1.jpg",
	"images/collector/tn/HoodooDetail2.jpg",
	"images/collector/tn/HoodooDetail3.jpg",
	"images/collector/tn/HoodooGlow.jpg",
	"images/collector/tn/IslandLakeSunrise.jpg",
	"images/collector/tn/LakePowellSunset-1.jpg",
	"images/collector/tn/LakePowellSunset-2.jpg",
	"images/collector/tn/MarcellinaMtn.jpg",
	"images/collector/tn/MaroonFallColor.jpg",
	"images/collector/tn/MaroonMidday.jpg",
	"images/collector/tn/MaroonSunrise.jpg",
	"images/collector/tn/MetateArch.jpg",
	"images/collector/tn/RedSkiesAtMorning1.jpg",
	"images/collector/tn/RedSkiesAtMorning2.jpg",
	"images/collector/tn/SBeckwithMtn.jpg",
	"images/collector/tn/ShrineBeaverPonds.jpg",
	"images/collector/tn/ShrineBouquet1.jpg",
	"images/collector/tn/ShrineBouquet2.jpg",
	"images/collector/tn/AspenGlow-4.jpg",
	"images/collector/tn/CraterBells.jpg",
	"images/collector/tn/CrystalMill.jpg",
	"images/collector/tn/Fragile.jpg",
	"images/collector/tn/GoldenShawl.jpg",
	"images/collector/tn/GreenEnvy.jpg",
	"images/collector/tn/HangingWaterfall.jpg",
	"images/collector/tn/MaplesFerns.jpg",
	"images/collector/tn/PorphyryGold.jpg",
	"images/collector/tn/SanJuanMorning.jpg",
	"images/collector/tn/SisterMoon.jpg",
	"images/collector/tn/SpoutingRock.jpg",
	"images/collector/tn/TranquilShore.jpg",
	"images/collector/tn/WhiteRiverAspen.jpg",    
	"images/collector/tn/ShrineRedRocks.jpg",
    "images/collector/tn/RegalFlowers-5-36.jpg",
    "images/collector/tn/FleetingMoments-4-19.jpg",
    "images/collector/tn/ColumbineOnGranite-6-14.jpg",
    "images/collector/tn/RainbowBridge-3-11.jpg",
    "images/collector/tn/ColumbineOnGraniteNo3-6-19.jpg",
    "images/collector/tn/ShrineRidge-4-3.jpg",
    "images/collector/tn/ThreeWarriors-1-16.jpg",
    "images/collector/tn/StairwayToHeaven-1-5.jpg",
    "images/collector/tn/LakePowellCliffs-2-19.jpg",
    "images/collector/tn/ColumbineOnGraniteNo2-6-23.jpg",
    "images/collector/tn/BearCreekFalls-6-11.jpg",
    "images/collector/tn/TroutLake-6-4.jpg",
    "images/collector/tn/HarshBeauty-3-2.jpg",
    "images/collector/tn/Sunflowers-5-17.jpg",
    "images/collector/tn/ColumbineNo2-5-3.jpg",
    "images/collector/tn/CrestedButteMorning-6-21.jpg",
    "images/collector/tn/VerticalSlotCanyonGlow.jpg",
    "images/collector/tn/JTNP-Sunset.jpg",
    "images/collector/tn/JTNP-Cactus.jpg",
    "images/collector/tn/PoppyMountain.jpg"
];

var ELITE_TBL = 
[
	"images/elite/tn/AntelopeCanyon-HoleInTheRockArch.jpg",
	"images/elite/tn/AspenVert1.jpg",
	"images/elite/tn/AspenVert2.jpg",
	"images/elite/tn/BeckwithReflection.jpg",
	"images/elite/tn/BryceVertical.jpg",
	"images/elite/tn/COHoodoo.jpg",
	"images/elite/tn/CascadeSide.jpg",
	"images/elite/tn/ColumbineLakeSunset.jpg",
	"images/elite/tn/CoyoteButtesHoodoo.jpg",
	"images/elite/tn/CraterBells.jpg",
	"images/elite/tn/CraterBellsTips.jpg",
	"images/elite/tn/DallasMtn.jpg",
	"images/elite/tn/DoubleSwirl-Sunset.jpg",
	"images/elite/tn/Geyser.jpg",
	"images/elite/tn/HangingLake.jpg",
	"images/elite/tn/HoodooSunrise.jpg",
	"images/elite/tn/HorseshoeBend.jpg",
	"images/elite/tn/LandscapeArch.jpg",
	"images/elite/tn/MayflowerCreek.jpg",
	"images/elite/tn/MayflowerPinkClouds.jpg",
	"images/elite/tn/MesaArch.jpg",
	"images/elite/tn/MonValleySidelit.jpg",
	"images/elite/tn/MonumentValley-Sunset.jpg",
	"images/elite/tn/PorphyryBasinMidday.jpg",
	"images/elite/tn/RiverOfStone.jpg",
	"images/elite/tn/ShrinePink.jpg",
	"images/elite/tn/ShrineRidgePaintbrush.jpg",
	"images/elite/tn/SlotCanyonGlow-Close.jpg",
	"images/elite/tn/Staircase.jpg",
	"images/elite/tn/SubwayDown.jpg",
	"images/elite/tn/SubwayUp.jpg",
	"images/elite/tn/TeardropArch-Close.jpg",
	"images/elite/tn/TheStation.jpg",
	"images/elite/tn/UncompaghreShot.jpg",
	"images/elite/tn/VermillionCliffPink.jpg",
	"images/elite/tn/VermillionCliffs-Sunrise.jpg",
    "images/elite/tn/BeautifulFalls.jpg",
    "images/elite/tn/CrestedButteMtn.jpg",
    "images/elite/tn/GhostInTheMtn.jpg",
    "images/elite/tn/SeaOfSticks.jpg",
    "images/elite/tn/DallasDivideSide.jpg",
    "images/elite/tn/LakePowellRuin.jpg",
    "images/elite/tn/LakePowellSunset.jpg",
    "images/elite/tn/LakePowellSunset2.jpg",
    "images/elite/tn/MaroonMtnFog.jpg",
    "images/elite/tn/FlatironsEasterPink.jpg",
    "images/elite/tn/FlatironGold.jpg",
    "images/elite/tn/CourthouseTowers.jpg",
    "images/elite/tn/IceplantMosaic.jpg",
    "images/elite/tn/JT-RabbitBrush-Goldfield.jpg",
    "images/elite/tn/AntelopeCanyon-LowestPt.jpg",
    "images/elite/tn/AntelopeCanyon-DoubleBeam.jpg"
];

function randomQuote()
{
	var num 	= Math.min(Math.round(Math.random()*QUOTE_TBL.length), QUOTE_TBL.length-1);
	var tag 	= document.getElementById("quoteTable");
	var divElem 	= document.createElement("div");
	tag.appendChild(divElem);
    divElem.appendChild(document.createTextNode(QUOTE_TBL[num][0]));
    divElem 	= document.createElement("div");
    tag.appendChild(divElem);
    divElem.appendChild(document.createTextNode(QUOTE_TBL[num][1]));
}

function randomImage(avoidIndexes, imgTagName, imgTable)
{
    var goodCandidate = false;
    var num;
    while (!goodCandidate)
    {
        num     = Math.min(Math.round(Math.random()*imgTable.length), imgTable.length-1);
        if (null != avoidIndexes)
        {
            var alreadyUsed = false;
            for (var i=0; i<avoidIndexes.length; i++)
            {
                if (num == avoidIndexes[i])
                {
                    alreadyUsed == true;
                    break;
                }
            }
            if (!alreadyUsed) goodCandidate = true;
        }
        else
        {
            goodCandidate = true;
        }
    }
    var tag = document.getElementById(imgTagName);
    tag.src = imgTable[num];
    return num;
}

function randomCollectorImage(avoidIndexes, imgTagName)
{
    return randomImage(avoidIndexes, imgTagName, COLLECTOR_TBL);
}

function randomEliteImage(avoidIndexes, imgTagName)
{
    return randomImage(avoidIndexes, imgTagName, ELITE_TBL);
}
