﻿// Javascript switching function for random "Cougar in Action" articles on homepage (December 2007)

var totalStories = document.getElementById("home-first").getElementsByTagName("div");
var which = Math.round((totalStories.length/2 - 1)*Math.random() + 1)

function showSection (which)
{
    var selectedDiv = document.getElementById('home-first-'+which);
    for (var i=1;i<=(totalStories.length/2);i++)
    {
        var hiddenDiv = document.getElementById('home-first-'+i);
        hiddenDiv.style.display='none';
    }
    selectedDiv.style.display='block';
}

showSection(which);


