var pics = [ //picturename, link
                ['StrollDancingHands_small.gif','http://www.thedancinghandsgallery.com'],
                ['StrollRedstone_small.gif','http://www.theredstonegallery.com'],
                ['StrollTCMccarthy_small.gif','http://www.mccartheygallery.net'],
                ['Strolltersian_small.gif','http://www.terziangalleries.com'],
                ['StrollThomasAnthony_small.gif','http://www.thomasanthonygallery.com.'],
                ['StrollWildSpirits_small.gif','http://www.wildspiritsparkcity.com'],
                ['StrollStanfield_small.jpg','http://www.stanfieldfineart.com'],
                ['StrollSilverQueen_small.gif','http://www.silverqueenfineart.com'],
                ['StrollPhoenix.gif','http://www.phoenixparkcity.com'],
                ['ByTheFire14x20.jpg','http://www.mountaintrailsgalleries.com'],
                ['StrollPhoenix_index.jpg','http://www.phoenixparkcity.com'],
                ['Foss_ShroudedView_small.jpg','http://www.julienestergallery.com'],
                ['StrollKimball_small.gif','http://www.kimball-art.org'],
                ['StrollLannyBarnard_small.jpg','http://www.lannybarnard.com'],
                ['Strong_small.gif','http://www.meyergallery.com'],
                ['StrollMontgomery_small.gif','http://www.montgomeryleefineart.com'],
                ['StrollPCcolors_small.gif','http://www.reneemoxhall.artspan.com'],
                ['StrollScanlan_small.gif','http://www.scanlan.com'],
                ['StrollIronHorse_small.jpg','http://www.ironhorseARTgallery.com'],
                ['StrollImagesofNature_small.gif','http://www.mangelsen.com'],
                ['gsHopeGalley_small.jpg','http://www.hopegallery.com'],
                ['StrollMerrill_small.gif','http://www.davidmerrill.info'],
                ['StrollArtworks_small.jpg','http://www.artworksparkcity']
           ];
var openInt;
var root = "./images/";
var picnum = 1;

function preloadImages(){
    for (x=0; x<pics.length; x++){
        myimages[x] = new Image();
        myimages[x].src = root+pics[x][0];
    }
}
function setTimer(){
    openInt = setInterval("changePic();", 2000);
}

function changePic(){
    var randomnumber=Math.floor(Math.random()*pics.length);
    //var picno = Math.floor(Math.random()*3);
    var newpic = pics[randomnumber];
    if(picnum == 4) picnum = 1;
    if(newpic != null){
        document.getElementById('picref'+picnum).href = newpic[1];
        document.getElementById('pic'+picnum).src = root+newpic[0];
    }
    picnum++;
}
