/*
W. Gregg, random-pics.js, March 2006. Concept from Random Image Link Script
by Website Abstraction (http://www.wsabstract.com) and Java-scripts.net
(http://www.java-scripts.net)

NS4 doesn't tolerate style for image here.
Substitute deprecated image align/vspace/hspace.

NS3 doesn't close img w/o unsuitable width and height attributes.
Compensate in HTML with <a class="NS3ImgClose" name="xx"></a> after image.

May 2007: Links 2.1 errors out on type coercion-free compares. Change
to type coercion-applied forms and then to prefered syntax.  That is:
if (x === 0) to if (x == 0) to if (!x); and
if (x !== 0) to if (x != 0) to if (x).
*/

var jsRandom = true;
var a;
var enda; // Replacing 'close', which acted like a reserved word.
var style;
var alt;
var title;
var src;
var ry;

function random_landscape() { // THE RANDOM LANDSCAPES SELECTOR
//  var landscape_thumb = [];          // Requires JS1.2 or better
    var landscape_thumb = new Array(); // Supports JS1.0/1.1
    landscape_thumb[1] = "2007/stillimage/thumbnail/fall_back-yukon-canada.jpg";
    landscape_thumb[2] = "2007/stillimage/thumbnail/looking_up-gold_creek_valley-juneau_alaska.jpg";
    landscape_thumb[3] = "2007/stillimage/thumbnail/moraine_forest-mendenhall_glacier-juneau_alaska.jpg";
    landscape_thumb[4] = "2007/stillimage/thumbnail/outer_point-douglas_island-juneau_alaska.jpg";
    landscape_thumb[5] = "2007/stillimage/thumbnail/redwing_marsh-montana_creek-juneau_alaska.jpg";
    landscape_thumb[6] = "2007/stillimage/thumbnail/reflection-peterson_creek-juneau_alaska.jpg";
    landscape_thumb[7] = "2007/stillimage/thumbnail/sunday-douglas_island-juneau_alaska.jpg";
    landscape_thumb[8] = "2007/stillimage/thumbnail/tombstone_greeting-yukon_provincial_park_system-canada.jpg";
    landscape_thumb[9] = "2007/stillimage/thumbnail/valley-sheep_creek-juneau_alaska.jpg";
    ry = Math.floor(Math.random() * landscape_thumb.length);
    if (!ry) {
        ry = 1;
    }
    a      = '<a href = "http://www.jimfowler.us/2007/text/2007b13-home.htm"><img ';
    style  = 'align = "left" vspace="4" hspace="4" border="2"';
    alt    = 'alt = "Alaska Plein-Air Landscape Paintings." '; // Image substitute
    title  = 'title = "Latest plein-air landscapes page" ';    // Mouseover message
    src    = 'src = "' + landscape_thumb[ry] + '" ';
    enda   = '><\/a> ';
    document.write(a + style + alt + title + src + enda);
}

function random_book() { // THE RANDOM BOOK THUMBNAIL SELECTOR
//  var book_thumb = [];             // Requires JS1.2 or better
    var    book_thumb = new Array(); // Supports JS1.0/1.1
    book_thumb[1] = "latest/stillimage/thumbnail/albertina_the_animals_and_me-susi_gregg_fowler.jpg";
    book_thumb[2] = "latest/stillimage/thumbnail/albertina_the_practically_perfect-susi_gregg_fowler.jpg";
    book_thumb[3] = "latest/stillimage/thumbnail/beautiful-susi_gregg_fowler.jpg";
    book_thumb[4] = "latest/stillimage/thumbnail/benny-s_flag-phyllis_krasilovsky.jpg";
    book_thumb[5] = "latest/stillimage/thumbnail/dolphin_adventure-wayne_grover.jpg";
    book_thumb[6] = "latest/stillimage/thumbnail/dolphin_freedom-wayne_grover.jpg";
    book_thumb[7] = "latest/stillimage/thumbnail/dolphin_treasure-wayne_grover.jpg";
    book_thumb[8] = "latest/stillimage/thumbnail/first_salmon-roxane_beauclair_salonen.jpg";
    book_thumb[9] = "latest/stillimage/thumbnail/fog-susi_gregg_fowler.jpg";
    book_thumb[10] = "latest/stillimage/thumbnail/i-ll_see_you_when_the_moon_is_full-susi_gregg_fowler.jpg";
    book_thumb[11] = "latest/stillimage/thumbnail/the_secret_moose-jean_rogers.jpg";
    book_thumb[12] = "latest/stillimage/thumbnail/when_joel_comes_home-susi_gregg_fowler.jpg";
    ry = Math.floor(Math.random() * book_thumb.length);
    if (!ry) {
        ry = 1;
    }
    a      = '<a href = "http://www.jimfowler.us/latest/text/books.htm"><img ';
    style = 'align = "left" vspace="4" hspace="4" border = "2"';
    alt    = 'alt = "Jim Fowler\'s Children\'s Book Illustrations." '; // Image substitute
    title  = 'title = "Children\'s book illustrations page" '; // Mouseover message
    src    = 'src = "' + book_thumb[ry] + '" ';
    enda   = '><\/a> ';
    document.write(a + style + alt + title + src + enda);
}
