var dimages=new Array();
var numImages=5;
for (i=0; i<numImages; i++)
{
  dimages[i]=new Image();
  dimages[i].src="./images/img000"+(i+1)+".gif";
}
var curImage=-1;

function swapPicture()
{
  if (document.images)
  {
    var nextImage=curImage+1;
    if (nextImage>=numImages)
      nextImage=0;
    if (dimages[nextImage] && dimages[nextImage].complete)
    {
      var target=0;
      if (document.images.myImage)
        target=document.images.myImage;
      if (document.all && document.getElementById("myImage"))
        target=document.getElementById("myImage");

      // make sure target is valid.  It might not be valid
      //   if the page has not finished loading
      if (target)
      {
        target.src=dimages[nextImage].src;
        curImage=nextImage;
      }

     setTimeout("swapPicture()", 3000);

    }
    else
    {
      setTimeout("swapPicture()", 3000);
    }
  }
}

setTimeout("swapPicture()", 3000);

function menucolor(whichid,intype)
{
	if (intype=='over')	{document.getElementById(whichid).style.textDecoration='underline';}
	if (intype=='out') 	{document.getElementById(whichid).style.textDecoration='none';}
}

function mhide(box) {document.getElementById(box).style.visibility="hidden";}
function mshow(box) {document.getElementById(box).style.visibility="visible";}

function switchImg(i) {document.images["gallery_main_img"].src = i;}

