// JavaScript Document

//Declare an array of 4 pictures

var photo_array = new Array ("images/homepg/pic1.jpg", "images/homepg/pic2.jpg", "images/homepg/pic3.jpg","images/homepg/pic4.jpg");
							 
 var length_var = photo_array.length; 
 var index_ptr;
 var newpict = new Image();
 
 //This function changes the picture.  
 
 function changepict(indx)
{
	newpict.src=photo_array[indx];
	document.images.homepict.src = newpict.src;
	if (indx == length_var-1)
		{indx=0;
		}
	else
		{indx++;
		}
	return indx;
}

 function window_onload()
 {
   index_ptr=0;
   setInterval("index_ptr=changepict(index_ptr)",4000);
 }