// common images to be cached
var commonImages = new Array(
        "tab-home-on.gif",
        "tab-about-on.gif",
        "tab-services-on.gif",
        "tab-contact-on.gif",
        "tab-client-on.gif"
        );

// custom cachesets
var customImg = new Array();


function cacheImages() {
    // create div id=cache and place in page element
    var page = document.getElementById("footer");
    var c = document.createElement("div");
    c.id = "cache";
    page.appendChild(c);
    // for each value in array, add caching div for that image
    var divs = "";
    // build common cache divs
    for (var x in commonImages) {
        divs = divs + cache(commonImages[x])
    }
    // write to cache container
    document.getElementById("cache").innerHTML = divs;
}

function cache(imagename) {
    // build cache div
    return "<div style='background-image: url( ../img/" + imagename + " );'></div>";
}

function fixHeight() {
    // get shadows to correctly size to page height in ie6
    var contentheight;
    contentheight = document.getElementById("page").clientHeight;
    document.getElementById("shadow-l").style.height = contentheight;
    document.getElementById("shadow-r").style.height = contentheight;
}

function init() {
    cacheImages();
    fixHeight();
}

window.onload = init;