var n= 0;

timedelay = 5;  // secs between pics
if (document.all){ // need more time with fade
 timedelay += 1; 
}
timedelay *= 1000;

// Set the delay for the fading effect in seconds
var fadeDelay = 3;
if (document.images) {
    splash1 = new Image
	splash2 = new Image
	splash3 = new Image
	splash4 = new Image
	splash5 = new Image
	splash6 = new Image
	splash7 = new Image
	splash8 = new Image
	splash9 = new Image
	splash10 = new Image
	splash11 = new Image
	splash12 = new Image
	
  // for dial-up users, load the main splash page non-rotating images before slideshow:
    splash10.src="images/logo.jpg";
	splash11.src="images/tag.gif";
	splash1.src="images/find_organizer.gif";
    splash2.src="images/about_napo_gpc.gif";
	splash3.src="images/become_organizer.gif";
    splash4.src="images/member_login.gif";
	splash5.src="images/clock.jpg";
    splash6.src="images/keys.jpg";
	splash7.src="images/hangers.jpg";
	splash8.src="images/paper-clips.jpg";
	splash9.src="images/pen.jpg";
	splash12.src="images/grad-textarea.jpg";
	
 // Photos to rotate --Initially photo changes immediately so use first twice,
   var imgs1 = new Array(); 
   imgs1[0] = 'images/main_photo1.jpg';
   imgs1[1] = 'images/main_photo2.jpg';  
   imgs1[2] = 'images/main_photo1.jpg';      
   imgs1[3] = 'images/main_photo3.jpg';   
   
   //Pre-load the rotating images for sake of dial-up folks:
   var imageLoader = new Array(); 
   for (i = 1; i < 4; i++){
	imageLoader[i] = new Image();
	imageLoader[i].src = imgs1[i];
}
   
   function rotateAll() {
	if (document.all){
     document.images.SlideShow.style.filter="blendTrans(duration=fadeDelay)";
     document.images.SlideShow.filters.blendTrans.Apply();
	}
   document.images.SlideShow.src =  imgs1[n];
   
   if (document.all) {
	   document.images.SlideShow.filters.blendTrans.Play();
	}
    (n  == (imgs1.length - 1)) ? n = 0 : n++;
 
    window.setTimeout("rotateAll()", timedelay);   
   }  
   //window.onload = rotateAll;  
  }
  
