Ext.onReady(function(){
		var step = window.step || 0;
		var image_dir = "images/steps/avocados/";
		
		var images = new Array("step01.jpg", "step02.jpg", "step03.jpg", "step04.jpg", "step05.jpg", "step06.jpg");

		var alts = new Array("step one", "step two", "step three", "step four", "step five", "step six");


		var descriptions = new Array(	"<p>1. Cut around the avocado lengthwise along the seed.</p>",
										"<p>2. Rotate the avocado halves to separate them. </p>",
										"<p>3. Rotate the avocado halves to separate them. </p>",
										"<p>4. Remove the seed by inserting the blade of a knife firmly into the seed and giving it a twist to loosen it from the meat. </p>",
										"<p>5. Peel the skin from each half of the avocado. </p>",
										"<p>6. Slice the avocado into desired sizes.  </p>"
																	);	
			

	var vimg = Ext.getDom('viewer_img');
	var vtext = Ext.getDom('viewer_text');
	
	Ext.get('next').on('click', function(){
		Ext.get('ss_left').show();
		step = step + 1;
		if(step>images.length-1){
			step=0;
		}
		vimg.alt = alts[step];
		vimg.src = image_dir + images[step];
		vtext.innerHTML = descriptions[step];
		if(step==images.length-1){
			Ext.get('ss_right').hide();
		}
	});
	
	Ext.get('prev').on('click', function(){
		Ext.get('ss_right').show();
		step = step - 1;
		if(step<0){
			step=images.length-1;
		}
		vimg.alt = alts[step];
		vimg.src = image_dir + images[step];
		vtext.innerHTML = descriptions[step];
		if(step==0){
			Ext.get('ss_left').hide();
		}
																			 
	});
	
	
	//load intial photo and text
	vimg.alt = alts[step];
	vimg.src = image_dir + images[step];
	vtext.innerHTML = descriptions[step];
	
	//hide previous button initially
	Ext.get('ss_left').hide();
	
});	