<!--
		//
		// Photo Animator
		// Custom designed for WOAD-AM
		// by Craig Lowery  lowery@msom.com
		//
		var numphotos=6;
		
		var panelname= new Array(3);
		panelname[0]="pa";
		panelname[1]="pb";
		panelname[2]="pc";
		
		var clicks= new Array(3);
		clicks[0]=20;
		clicks[1]=16;
		clicks[2]=11;
		
		var photos= new Array(3);
		
		var lastshown= new Array(3);
		lastshown[0]=lastshown[1]=lastshown[2]=1;
		
		function load_photos(){
		   // Create 2-D array
		   for (x=0; x<3; x++) {
		      photos[x]= new Array(numphotos+1);
		   }
		   // now load photos in rows
		   for (y=0; y<=numphotos; y++) {
		      for (x=0; x<3; x++) {
		         photos[x][y]=new Image;
		         photos[x][y].src="images/"+panelname[x]+y+".jpg";
		      }
		   }
		   setTimeout("animate_photos();",1000);
		}
		
		function numloaded(idx) {
		   var acc=0;
		   var x;
		   for (x=1; x<=numphotos; x++) {
		     if (photos[idx][x].complete) {
		         acc++;
		     }
		   }
		   return acc;
		}
		
		function animate_photos() {
		   var x;
		   //decrement all click values and remember the smallest
		   smallest=0;
		   for (x=0; x<3; x++) {
		      --clicks[x];
		      if (clicks[x]<clicks[smallest]) {
		         smallest=x;
		      }
		   }
		   if (clicks[smallest]<=0) {
		      if (document.images[panelname[smallest]].src==photos[smallest][0].src) {
		        var x;
		        // we are currently blurred
		        // Choose next loaded image
		        x=lastshown[smallest];
		        do {
		           x++;
		           if (x>numphotos) {
		              x=1;
		           }
		        } while (!photos[smallest][x].complete);
		        document.images[panelname[smallest]].src=photos[smallest][x].src;
		        lastshown[smallest]=x;
		        // Choose a randomized sleep period for this panel
		        ran=Math.random();
		        if (ran<0.33) {
		           clicks[smallest]= 20;
		        } else if (ran<0.66) {
		           clicks[smallest]= 16;
		        } else {
		           clicks[smallest]= 11;
		        }
		      } else {
		         // we are NOT currently blurred
		         // if blur image is completed and there is at least one
		         // other image, we can blur
		         if (numloaded(smallest)>1) {
		            document.images[panelname[smallest]].src=photos[smallest][0].src;
		            clicks[smallest]= -100;  // high priority so blur is short
		         }
		      }
		   }
		   setTimeout("animate_photos();",800);
		}
		
		//-->