var curImage=-1;

function swapPicture()
{
  if (document.images)
  {
    var nextImage= Math.floor(Math.random() * numImages);
    if (dimages[nextImage] && dimages[nextImage].complete)
    {
      var target=0;
      if (document.images.newCollection)
        target=document.images.newCollection;
      if (document.all && document.getElementById("newCollection"))
        target=document.getElementById("newCollection");
  
      // 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()", 5000);

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

setTimeout("swapPicture()", 5000);

myimages = new Array;
myimages[0] = new Image;
myimages[0].src = "http://www.funkiehouse.nl/blog/wp-content/themes/funk/images/clock.png";
myimages[1] = new Image;
myimages[1].src = "http://www.funkiehouse.nl/blog/wp-content/themes/funk/images/clock_bird.png";

function roll(num){
	var d = document.getElementById('clock');
	d.src = myimages[num].src;
}