Ext.onReady(function(){
		var step = window.step || 0;
		var image_dir = "images/steps/christmas_topiary/";
		
		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 tree form in warm water. Make a small wreath out of ivy and place on base. </p>",
"<p>Step Two</p><p>Place form on top of base. Trim roses and place around base of form. Work your way up the form. </p>",
"<p>Step Three</p><p>Fill in holes using Sedum or other filler of your choice.</p>",
"<p>Step Four</p><p>Hot glue fruits in between gaps of flowers and filler. Tuck ivy around form to add movement. Place in a cool area away from direct sunlight. Will last up to 5-7 days.</p>",
"<p>Step Five</p><p>Display your finished Christmas topiary.</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();
	
});	