//<![CDATA[
// functions to rotate pictures

// globals
var picsFor = {
    'ginapic': [
	['images/gina.jpg', 'gina in her office'],
	['images/ginademo.jpg', 'health fair demo'],
	['images/ginakids.jpg', 'gina and daughters'],
	['images/ginatree.jpg', 'gina and cherimoya tree']
    ],
    'carepic': [
        ['images/gina2.jpg', 'gina in her office'],
	['images/office.jpg', 'the treatment area'],
	['images/takingpulse.jpg', 'gina taking pulse']
    ]
};
var i = Math.round(Math.random() * 10) % 3;

function changePic(id)
/* 
   name:    changePic
   purpose: periodically put a new picture in element named by id.
*/
{
    img = document.getElementById(id);
    pics = picsFor[id];
    if (i >= pics.length) {
	i = 0;
    } 
    img.src   = pics[i][0];
    img.title = pics[i][1];
    img.alt   = pics[i][1];
    i++;
    var t     = setTimeout("changePic('" + id + "')", 6000);
}

//]]>

