/* Louis W. Adams, Jr.; March 28, 2009 */

window.onload = initAll;

/* Allocate variable names for global scope album data. */
var currImg = 0;
var fileName= "";
var titleText= "";
var captionText = new Array("")

/* All album photos are sequenced using lower case letters at the end of their names.  Add to array to have more photos, but extend the alphabetical sequence shown here. */
var LCLetter = new Array(
    "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","aa","ab","ac","ad"
)

/* Initialize album data. */
function initAll() {
    if (document.getElementById) {
    
        var x = document.getElementsByTagName('a');

        /* Find out which album is first on the list of links, and display it. */
        for (var i=0;i<x.length;i++) {
            if (x[i].className != 'album') continue;
            loadAlbum(x[i].id);
            break;
        }
        
        /* Display an album after the user clicks on an album link on the web page. */
        for (var i=0;i<x.length;i++) {
            if (x[i].className != 'album') continue;
            x[i].onclick = function() {
                loadAlbum(this.id);
                return false;
            }
        }
        
        /* Display the previous photo in album when the "Back" button is clicked. */
    	document.getElementById("AlbumBack").onclick = function() {
    		newSlide(-1); 
    	}
    	
    	/* Display the next photo in album when the "Next" button is clicked. */
    	document.getElementById("AlbumNext").onclick = function() {
    		newSlide(1); 
    	}
        
    }
    else {
        alert("Sorry.  Either the browser is using an old version of JavaScript that won't work here, or security software is blocking it.");
	}
}

/* Display next or previous photo and caption on web page. */
function newSlide(direction) {
	var imgCt = captionText.length;

	currImg = currImg + direction;
	if (currImg < 0) {
		currImg = imgCt-1;
	}
	if (currImg == imgCt) {
		currImg = 0;
	}
    loadPhotoAndCaption();
}

/* Load photo image and caption onto web page. */
function loadPhotoAndCaption() {
	document.getElementById("AlbumPhoto").src = "Shared/Image/Albums_PlantPropagation/" + fileName + LCLetter[currImg] + ".jpg";
	document.getElementById("AlbumText").innerHTML = (currImg+1) + "/" + captionText.length + ":  " + captionText[currImg];        
}

function loadAlbum(selectAlbum) {
    currImg = 0;            // Reset to first image number for album.
    captionText = [];       // Reset caption array to empty.    
    fileName= selectAlbum;  // Prefix for image file names.

    /* Load new album data.  This is the only place in this script to specify album information. Case order is unimportant. */
    switch(selectAlbum) {
        case "PlantPropagation_10-05-10":
            titleText= "Potting (May 2010)";        

            captionText[0]= "Ed Wilde, Will Hawkins, Peggy Romine, and Ben Waddell (left to right) form an assembly line for potting up the cuttings taken during the summer of 2009. The cuttings were moved from the propagation frames to pots so that we could transport them to our new nursery at Spartanburg Community College. This is move is discussed <a href=Albums_SpartanburgCC.html>elsewhere on this website</a>.";
            captionText[1]= "Ben Waddell unloads the potted rooted cuttings, and organizes them.";
            captionText[2]= "Don Crowder checks for any signs of life among the camellias and sasanquas. Unfortunately, none of them survived due to a faulty sprayer nozzle. Members visiting the nursery should check on the condition of all the plants, including those in the propagation frames. Please alert <a href=PlantSales.html>those in charge</a> if you see signs of stress.";
            captionText[3]= "Carole Davis holds up a cutting with a great root system. No matter how many times you see it, it's always exciting to see things grow!";
            captionText[4]= "Ilex 'Burfordii' (Burford holly) really put on good roots during its year in the frame.";
            captionText[5]= "Mac Davis, Lyn Murajda, Ed Wilde, and Lou Adams (left to right) get cuttings ready, pot them, and label them for customers.";
            captionText[6]= "Don Crowder mixes soil and sand (to give the pots weight), and pre-fills pots for those who insert the plants.";
            captionText[7]= "Mac Davis, Lyn Murajda, Ed Wilde, Carole Davis, and Ben Waddell (left to right) take their turns.";
            captionText[8]= "Will Hawkins loads pots into the wagon for a short trip across the nursery where plants are arranged in groups until they are transported to SCC.<br /><br />Photos by Linda McHam.";
            
            break;
        case "PlantPropagation_09-11-21":
            titleText= "Third Planting (November 2009)";        

            captionText[0]= "At Linda McHam's fourth propagation session, Earl Quillen, Ben Waddell, and Ed Wilde take camellia and sasanqua cuttings for our propagation beds. Peggy Romine and Linda McHam also attended.";
            captionText[1]= "Ben, Earl and Ed disbud the camellias and sasanquas.  They also remove the lower leaves, wound the cutting at the stem base, and dip the wounded stem in rooting hormone (Hormodin 3). Twenty cuttings of each variety are taken to ensure a good success rate.";
            captionText[2]= "Peggy Romine, Ben, Ed, and Earl pause for a photo after cleaning up from the propagation session. Note the propagation beds in the background at the left, against the fence.";
            captionText[3]= "The four beds are now filled with plants. It will take up to two years to have them ready to sell from these cuttings, but this saves the Club a huge amount of money as compared to purchasing two and three gallon plants for mark up. Our cost is in time, since the water that the misting unit uses is less than 500 gallons per year.";
            captionText[4]= "Check out these yellow buddleia cuttings that were planted in July. They are a foot tall and blooming! Notice the success rate for the rest of the cuttings. Pretty impressive!<br /><br />Photos by Linda McHam.";
            
            break;
        case "PlantPropagation_09-08-08":
            titleText= "Second Planting (August 2009)";        

            captionText[0]= "At Linda McHam's third propagation-by-cuttings session, John Woodward dips the prepared forsythia cuttings in the rooting hormone.  He will shake off the excess. The cuttings are ready for &quot;sticking&quot; into the propagation bed.";
            captionText[1]= "Lyn Murajda sticks the cuttings into the second bed, lining them up with a measuring board. She uses a pencil to make a hole for the cutting so that the rooting hormone (white powder) does not rub off when it is inserted into the hole. The dirt is then firmed around the cutting.";
            captionText[2]= "Linda McHam, Charles Covert, and Jeff Hayes pose with the newly added 400 cuttings (the leftmost cuttings in the photograph). The new additions include fig, gardenia, crape myrtle, juniper, azalea, and osmanthus. Tasso Ghionis, Lyn Murajda, Gisela Otto, Peggy Romine, Shirley Tirpak, and John Woodward also participated in the session. There are now over 800 cuttings in the beds for future Club sales in about a year. There is room in the beds for about 1,600 cuttings.  The plan is to finish filling them by November.<br /><br />Photos by Linda McHam.";
            
            break;
        case "PlantPropagation_09-07-28":
            titleText= "First Planting (July 2009)";        

            captionText[0]= "Linda McHam organized an introductory plant propagation session at Hatcher Garden, and 14 club members attended.  The idea is to train members to propagate the bulk of the plants for future club plant sales.  SMGC recent sales have used &quot;bought-in&quot; plants, so growing our own saves money.";
            captionText[1]= "Tools for propagation.  Clean and sharp pruners for collecting cuttings and trimming them, pencils to make planting holes in soil, and pads to save knees.  The cut end of a stem is coated with hormone powder to promote root growth; it is inserted into a pre-made hole to prevent hormone from being scraped off by soil during insertion.";
            captionText[2]= "Linda explains the plan to volunteers, with the shade-cloth covered propagation bed in the foreground, and a work table in the background.";
            captionText[3]= "Hatcher Garden allowed the demonstration session to take cuttings from their plants along the walking trails.  Here Linda discusses taking cuttings from a vitex shrub, a traditional landscape plant that has medicinal properties.";
            captionText[4]= "Cuttings from four plants were collected for the two hour propagation session: vitex, osmanthus, forsythia, and crape myrtle.  These plants are relatively easy to propagate, and are popular at plant sales.";
            captionText[5]= "Members trim cuttings before planting them.  Present were Lou Adams, Charles Covert, Lorelei Foster, Jeff Hayes, Linda McHam,  Henry Pittman,  Earl Quillen, Chris Rives, Joe Rives, Ben Waddell, Matthew West, Ed Wilde, Nancy Williamson, and John Woodward.";
            captionText[6]= "The propagation bed before planting, with the shade cloth pulled away from one end.  Only a relatively small area of the bed is planted with the day's cuttings, about 95 cuttings. Approximately 1,600 cuttings fill the beds.";
            captionText[7]= "Cuttings are inserted into holes, with soil tamped firmly.  A board across the bed is a guide for planting straight rows.  A programmable irrigation system keeps the soil moist.";
            captionText[8]= "A few leaves are kept on each piece, and cut in half to reduce metabolic demand until roots sprout.  Some leaf area is necessary to produce food from sunlight for growth.  Note the white rooting hormone powder on stem ends.";
            captionText[9]= "After planting, the shade cloth is put back in place and the irrigation system is turned on.  Linda reviews future propagation plans with the troops.  The offensive has just begun, and the next plant sale is less than two months away!  Stay tuned for club announcements about future sessions.";
            captionText[10]= "Sunlight illuminates a patch of planted cuttings beneath the shade cloth.<br /><br />Photos by Lou Adams.";
            
            break;
        case "PlantPropagation_09-06-16":
            titleText= "Bed Construction (June 2009)";        

            captionText[0]= "Don Crowder, Joe Rives, and Chris Rives (left to right) discuss moving the old propagation beds shown. Steve Patton solarized the beds with red plastic to kill weeds.";
            captionText[1]= "Joe Rives, Chris Rives, Jeff Hall, and Don Crowder (left to right) measure space for new beds adjacent to water and power.";
            captionText[2]= "Matthew West, Bob Reynolds, and Joe Rives (left to right) cover the new propagation beds with a black vinyl sheet to solarize weed seed ('cook' by sunlight).  Not shown are Earl Quillen and Charles Covert, who helped moved the old beds to their new location.";
            captionText[3]= "Bob Reynolds, Matthew West, and Joe Rives (left to right) begin construction of the wood spine for the plastic-ribbed tunnel that will be covered in shade cloth.";
            captionText[4]= "Joe Rives (mostly hidden), Chris Rives, Bob Reynolds, and Matthew West (left to right) finish framing the spine and connecting the water line.";
            captionText[5]= "Bob Reynolds and Matthew West (left to right) add PVC ribs to the frame.";
            captionText[6]= "Joe Rives (left) and Bob Reynolds (right) help Jeff Hall (center), Hatcher Garden horticulturist, connect the water supply.";
            captionText[7]= "Matthew West, Jeff Hall, Joe Rives, Chris Rives, and Bob Reynolds (left to right).";
            captionText[8]= "The completed but uncovered propagation bed. Joe Rives, Matthew West, and Chris Rives (left to right).";
            captionText[9]= "Joe Rives, Jeff Hall, and Bob Reynolds cover the finished frame with shade cloth. The frame is based on a design by Allen Cantrell at Fern Gully Nursery. Thanks Allen!<br /><br />Photos by Linda McHam.";
            
            break;
        case "PlantPropagation_08-01-26":
            titleText= "Jess Taylor (January 2008)";        

            captionText[0]= "Jess Taylor (in red cap), long-time member of SMGC and propagator extraordinaire, shows (left to right) Julie Thompson-Adolph, Chris Rives, and Cooper Cecil and his wife, Holly, and two children Katherine and Calum, how to set up a propagation bed for crape myrtles.";
            captionText[1]= "Steve Patton (left) looks on as Jess Taylor reviews his notes for propagating hardwood cuttings.  See our <a href=GardeningHelp.html>Gardening Help</a> page for one of Jess's guides, and other propagation resources.";
            captionText[2]= "Jess describes how to bundle a set of crape myrtle cuttings. He wraps a rubber band around them and places them in a bucket of sand over the winter. Be sure that the growing end is up!";
            captionText[3]= "Jess holds a bundle of crape myrtle cuttings that he has bundled together. The growing end is cut at an angle and the rooting end is a flat cut. The growing end should be pointed up and the rooting end should be pointed down when placed in the bucket of sand.";
            captionText[4]= "Jess shows how he makes an angled cut on the growing end of the hardwood cutting.";
            captionText[5]= "Jess uses Hormodin 3 (a root stimulator powder in the can) on the growing ends of his hardwood cuttings. One bundle has been placed in the bucket of sand. It will sit in the shade over the winter until the buds break and roots form in the spring.";
            captionText[6]= "Volunteers help &quot;stick&quot; the cuttings in the propagation bed. This propagation bed was later moved and reused in a propagation bed that includes a misting unit. The propagation success rate increased dramatically!  See the other Photo Albums on this page.  Photos by Linda McHam.";
            
            break;
    }
    document.getElementById("AlbumTitle").innerHTML = titleText;    // Load album title onto web page.
    loadPhotoAndCaption();
}