/**
* General javascript for elkins potter site.
* This is a repository for all the JS. Almost nothing is embedded in the pages.
* Note there is some JS in the gallery_nav.asp include file too.
* Developed Sept 2009
**/
 

// navbar
//      Used to display the highlighted version of a nav bar graphic.
//      Also used to turn off (back to normal version).
// Usage
//      Part of the included /inc/header page, so its part of all pages.
// Known issues:
//      If the user browses back it doesn't clear the last highlighting.
function navbar(elThis, elSourceName)
{
    elThis.src = document.getElementById(elSourceName).src;
}




// parchmentUnsparkle
//      Turns off "sparkle" graphic for all images with "sparkle_" IDs.
// Usage
//      Used in the gallery index page only.
//      Called w/ "onmouseout" for all parchment graphics.
//      Also called by parchmentSparkle(), just in case.
//      Also called by body.onUnload to prevent old sparkles w/ Back button.
function parchmentUnsparkle() {
    for (var indx in document.images) {
        try {
            if (document.images[indx].id.substring(0,8) == "sparkle_") {
                with (document.images[indx]) {
                    width = 0;
                    height = 0;
                }
            }
        } catch (e) {}
    }
}

// parchmentSparkle
//      Turn on animated gif "sparkle.gif" for parchments.
// Usage
//      On the gallery index page only, w/ "onmouseover" for parchments.
function parchmentSparkle(thisName) {
    // Just in case, turn off all sparkles first.
    parchmentUnsparkle();
    with (document.getElementById("sparkle_"+thisName)) {
        // Can't use naturalWidth & Height. Doesn't work in old IE.
        // width = naturalWidth;
        // height = naturalHeight;
        width = 140;
        height = 47;
    }
}



