Ext.onReady(function(){
		var step = window.step || 0;
		var image_dir = "images/steps/white-chocolate_raspberry_cookies/";
		
		var images = new Array("step1.jpg", "step2.jpg", "step3.jpg", "step4.jpg");

		var alts = new Array(	"Step One", "Step Two", "Step Three", "Step Four");


		var descriptions = new Array("<p>After removing cookies from oven, use your thumb or the back of a spoon to make a depression in center of each cookie while still warm. Let cookies cool.<p>",
										"<p>Melt raspberry jam in a microwavable bowl or in a small saucepan. Spoon melted jam into depressions in cookies.</p>",
										"<p>Combine chopped white chocolate and shortening in a resealable plastic bag and melt in a microwave oven. Using scissors, snip one corner of bag.</p>",
										"<p>Drizzle melted white chocolate over cookies. Let chocolate set before enjoying.</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();
});	