


var gCallCount = 0;
	var slideshow = { 
		start: function() { 
	    new PeriodicalExecuter(slideshow.cycle, 6) // change image every 5 seconds 
		}, 
		  cycle: function(pe) {
		  	if (++gCallCount > 10)
		    pe.stop();
		    else
		    
		    var response = new Ajax.Request('/photos/ss_get_next', {
		    	method: 'post',
		    	onSuccess: function(t) {
		    		var image = $('image');
		    				
		    			new Effect.Fade('image', {
							duration: 1, 
							fps: 50, 
		    				queue:'end',
		    				afterFinish: function() {
		    					image.update(t.responseText);
			    				new Effect.Appear('image', {
					              duration: 1,
					              fps: 50,
					              queue:'end'	
			    				});
		    				}	
		    			});				  
		    							
		    			
		    			
		    			
		    			
		    							
		    	}
		    });		  
		} 
	} 
	window.onload = slideshow.start	
/*
	
	var gCallCount = 0;
	var slideshow = { 
		start: function() { 
	    new PeriodicalExecuter(slideshow.cycle, 8) // change image every 5 seconds 
		}, 
		  cycle: function(pe) {
		  	if (++gCallCount > 5)
		    pe.stop();
		    else
		    new Effect.Fade('image', { // the id of the <DIV> containing the photos 
		      duration: 1, 
		      fps: 50, 
		      afterFinish: function() { 
		        new Ajax.Updater('image','/photos/ss_get_next', { // URL for next <IMG> tag 
		          asynchronous: true, 
		          onSuccess: function() { 
		            new Effect.Appear('image', {
		              duration: 1,
		              fps: 50,
		              queue:'end'
		            })
		          } 
		        }) 
		      } 
		    }) 
		  } 
		} 

	window.onload = slideshow.start




/*
var gCallCount = 0;
	var slideshow = { 
		start: function() { 
	    new PeriodicalExecuter(slideshow.cycle, 7) // change image every 5 seconds 
		}, 
		  cycle: function(pe) {
		  	if (++gCallCount > 5)
		    pe.stop();
		    else
		    
		    var response = new Ajax.Request('/photos/ss_get_next', {
		    	method: 'get',
		    	onSuccess: function(t) {
		    		var image = $('image');
		    				
		    			new Effect.Fade('image', {
							duration: 1, 
							fps: 50, 
		    				queue:'end',
		    				afterFinish: function() {
		    					image.update(t.responseText);
			    				new Effect.Appear('image', {
					              duration: 1,
					              fps: 50,
					              queue:'end'	
			    				});
		    				}	
		    			});				  
		    							
		    			
		    			
		    			
		    			
		    							
		    	}
		    });		  
		} 
	} 
	
*/	