    picUrls = new Array(
        'images/000000726484XSmall.jpg', // 0: girl
        'images/000001050746XSmall.jpg', // 1: couple smiling closeup
        'images/000001604159XSmall.jpg', // 2: smiling patient closeup
        'images/000002856016XSmall.jpg', // 3: friends in field
        'images/000003197327XSmall.jpg', // 4: b&w man
        'images/000003605556XSmall.jpg', // 5: senior citizen
        'images/000003717640XSmall.jpg', // 6: family
        'images/000004038217XSmall.jpg', // 7: senior citizen couple
        'images/000004107146XSmall.jpg', // 8: colorful children
        'images/000004330324XSmall.jpg', // 9: sisters
        'images/000004429496XSmall.jpg', // 10: on the farm
        'images/000004891531XSmall.jpg', // 11: smile closeup
        'images/000005062631XSmall.jpg', // 12: young couple
        'images/000005151550XSmall.jpg', // 13: boy
        'images/000005171246XSmall.jpg', // 14: smile closeup
        'images/000005383890XSmall.jpg'  // 15: dental xray
    );
    pics = new Array(
        new Array( 0, 1, 12, 3 ), //pics from above for 1st slot
        new Array( 4, 5, 6, 7 ), //pics from above for 2nd slot
        new Array( 10, 9, 2, 11 ), //pics from above for 3rd slot
        new Array( 8, 14, 15, 13 ) //pics from above for 4th slot
    );
    picNames = new Array( "pic1", "pic2", "pic3", "pic4" );

    current = new Array( 0, 0, 0, 0 );  //current picture in slots 1-4
    picObjs = new Array(); // for preloading

    //function that gets called repeatedly to do fading
    function fade(location,opacity,increment)
    {
        if ( increment < 0 )
        {
            if ( opacity > 0 ) // fading out
            {
                img = document.getElementById(picNames[location]);
                opacity += increment;
                setOpacity(img,opacity);
                window.setTimeout("fade(" + location + 
                    ", " + opacity + ", " + increment + ")", 100 );
            }
            else  //we've completely faded out, time to fade in new pic
            {
                current[location] += 1;
                if ( current[location] >= pics[location].length )
                {
                    current[location] = 0;
                }
                img = document.getElementById(picNames[location]);
                img.src = picUrls[pics[location][current[location]]];
                window.setTimeout("fade(" + location + 
                    "," + opacity + ", 10 )", 100 );
            }
        }
        else if ( increment > 0 ) // fading in
        {
            if ( opacity < 100 )
            {
                img = document.getElementById(picNames[location]);
                opacity += increment;
                setOpacity(img,opacity);
                window.setTimeout("fade(" + location + 
                    ", " + opacity + ", " + increment + ")", 100 );
            }
            else   // we've completely faded in, move on to next slot
            {
                location += 1;
                if ( location >= pics.length )
                {
                    location = 0;
                }
                window.setTimeout("fade(" + location + 
                    "," + opacity + ", -10 )", 2000 );
            }
        }
    }
    // sets opacity for various browsers
    function setOpacity(obj, opacity)
    {
        opacity = (opacity == 100)?99.999:opacity;
        obj.style.filter = "alpha(opacity:"+opacity+")";
        obj.style.KHTMLOpacity = opacity/100;
        obj.style.MozOpacity = opacity/100;
        obj.style.opacity = opacity/100;
    }
    // preload images, kickoff fade function
    function init()
    {
        for( index = 0; index < picUrls.length; index++ )
        {
            picObjs[index] = new Image();
            picObjs[index].src = picUrls[index];
        }
        window.setTimeout("fade(0,100,-10)", 4000 );
    }
    window.onload = function() {init()}

