
function pickRandom(range) {

var now = new Date();
return (now.getDate()) % range;

}
function loadImage(){
var imgs = new Array
(
"bkgd_0.jpg", "bkgd_1.jpg", "bkgd_2.jpg", "bkgd_3.jpg", "bkgd_4.jpg", "bkgd_6.jpg", "bkgd_7.jpg", "bkgd_8.jpg", "bkgd_9.jpg"
);

var ic = imgs.length; // Number of alternative images
var now = new Date();
var choice = (now.getDate()) % ic;
newImage = "images/bkgd/" + imgs[choice];
/*document.write(newImage);*/
document.body.style.backgroundImage = "url("+newImage+")";
/*
if (document.getElementById)
{
document.getElementById('main_pict').style.backgro undImage = newImage;
}
else if (document.all)
{
document.all('main_pict').style.backgroundImage = newImage;
}
else if (document.layers)
{
document.layers('main_pict').style.backgroundImage = newImage;
}
*/
}

function swapImage(newImage) {
	document.body.style.backgroundImage = "url(images/bkgd/"+newImage+")";
/*	document.write("./images/bkgd/"+newImage); */
}

var groupA = new Array();
groupA[groupA.length] = "list_a_excl";
groupA[groupA.length] = "list_b_excl"; 
groupA[groupA.length] = "list_c_excl"; 
groupA[groupA.length] = "list_d_excl"; 
groupA[groupA.length] = "list_e_excl"; 
groupA[groupA.length] = "list_f_excl"; 
groupA[groupA.length] = "list_g_excl"; 
groupA[groupA.length] = "list_h_excl"; 
groupA[groupA.length] = "list_i_excl"; 
groupA[groupA.length] = "list_j_excl"; 
groupA[groupA.length] = "list_k_excl"; 
groupA[groupA.length] = "list_l_excl"; 
groupA[groupA.length] = "list_m_excl"; 
groupA[groupA.length] = "list_n_excl"; 
groupA[groupA.length] = "list_o_excl"; 

function swap(listIdPrefix,group) {
    collapsedList = document.getElementById(listIdPrefix + "_collapsed");
    expandedList = document.getElementById(listIdPrefix + "_expanded");
    if (collapsedList.style.display == "block") {
        collapsedList.style.display = "none";
        expandedList.style.display = "block";
    } else {
        collapsedList.style.display = "block";
        expandedList.style.display = "none";
    }
    if (group) {
        ensureExclusivity(listIdPrefix,group);
    }
} 

function ensureExclusivity(listIdPrefix,group) {
    for (var i = 0 ; i < group.length ; i++) {
        if (group[i] != listIdPrefix) {
            document.getElementById(group[i] + "_collapsed").style.display = "block";
            document.getElementById(group[i] + "_expanded").style.display = "none";
        }
    }
} 