Ext.onReady(function(){
		var step = window.step || 0;
		var image_dir = "images/steps/candle_wreath/";
		
		var images = new Array("step1.jpg", "step2.jpg", "step3.jpg", "step4.jpg", "final.jpg");

		var alts = new Array(	"Step One", "Step Two", "Step Three", "Step Four", "Final Step");

		var descriptions = new Array(	"<p>Step One</p><p>Soak water-absorbing ring form in warm water. Place magnolia leaves around the base of the ring form. Fill in holes and gaps with cedar. Create a second layer on the ring with cedar.</p>",
"<p>Step Two</p><p>Place candle in center of ring to help establish the placement of the flowers. Cluster a few roses toward the center of the arrangement, closest to the candle.</p>",
"<p>Step Three</p><p>Place hydrangeas on either side of the candle, pressing stems into form.</p>",
"<p>Step Four</p><p>Tuck in a few fruits for added visual interest. Remove candle before transporting the centerpiece. Place in a cool area away from direct sunlight. Will last up to 5-7 days.</p>",
"<p>Step Five</p><p>Display your completed candle wreath.</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();
	
});	