﻿var aryImages = new Array(23);
aryImages[0] = "../images/communityPage/ElDorado.gif";
aryImages[1] = "../images/communityPage/Sacramento.gif";
aryImages[2] = "../images/communityPage/Amador.gif";
aryImages[3] = "../images/communityPage/Placerville.gif";
aryImages[4] = "../images/communityPage/SanJoaquin.gif";
aryImages[5] = "../images/communityPage/Yolo.gif";
aryImages[6] = "../images/communityPage/Solano.gif";
aryImages[7] = "../images/communityPage/Yuba.gif";
aryImages[8] = "../images/communityPage/Sutter.gif";
aryImages[9] = "../images/communityPage/ContraCosta.gif";
aryImages[10] = "../images/communityPage/Nevada.gif";
aryImages[11] = "../images/communityPage/Alameda.gif";
aryImages[12] = "../images/communityPage/Stanislaus.gif";
aryImages[13] = "../images/communityPage/Napa.gif";
aryImages[14] = "../images/communityPage/Alpine.gif";
aryImages[15] = "../images/communityPage/Calaveras.gif";
aryImages[16] = "../images/communityPage/Merced.gif";
aryImages[17] = "../images/communityPage/SantaClara.gif";
aryImages[18] = "../images/communityPage/Sonoma.gif";
aryImages[19] = "../images/communityPage/Marin.gif";
aryImages[20] = "../images/communityPage/SanMateo.gif";
aryImages[22] = "../images/communityPage/San-Fran.gif";
aryImages[21] = "../images/communityPage/Mouseover-Base-Map.gif";

for (i = 0; i < aryImages.length; i++) {
    var preload = new Image();
    preload.src = aryImages[i];
}
function swap(imgIndex) {
    document.getElementById("ImageMap").src = aryImages[imgIndex];
}

function wopen(url, name, w, h) {
    
    w += 32;
    h += 96;
    wright = (screen.width - 477) / 1;
    wtop = (screen.height - 676) / 2;
    // IE5 and other old browsers might allow a window that is
    // partially offscreen or wider than the screen. Fix that.
    // (Newer browsers fix this for us, but let's be thorough.)
    if (wright < 0) {
        w = screen.width;
        wleft = 0;
    }
    if (wtop < 0) {
        h = screen.height;
        wtop = 0;
    }
    var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wright + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=yes, resizable=no');
    // Just in case width and height are ignored
    win.resizeTo(w, h);
    // Just in case left and top are ignored
    win.moveTo(wright, wtop);
    win.focus();
}

var ids = new Array('ALA', 'AMA', 'ALP', 'CALA', 'CONTRA', 'ELD', 'MARIN', 'MER', 'NAPA', 'NEV', 'PLAC', 'SAC', 'SANFRAN', 'SAN',
                    'SANMATEO', 'SANTACLAR', 'SOLA', 'SONA', 'STANI', 'SUTTER', 'YOLO', 'YUBAland');

function switchid(id) {
    hideallids();
    showdiv(id);
}

function hideallids() {
    for (var i = 0; i < ids.length; i++) {
        hidediv(ids[i]);
    }
}

function hidediv(id) {
    if (document.getElementById) {
        document.getElementById(id).style.visibility = 'hidden';
    }
    else {
        if (document.layers) {
            document.id.visibility = 'hidden';
        }
        else {
            document.all.id.style.visibility = 'hidden';
        }
    }
}

function showdiv(id) {
    if (document.getElementById) {
        document.getElementById(id).style.visibility = 'visible';
    }
    else {
        if (document.layers) {
            document.id.visibility = 'visible';
        }
        else {
            document.all.id.style.visibility = 'visible';
        }
    }
}