Ext.onReady(function(){
		var step = window.step || 0;
		var image_dir = "images/steps/springtime_spread/";
		
		var images = new Array("one.jpg", "two.jpg", "three.jpg", "four.jpg", "five.jpg", "six.jpg");

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


		var descriptions = new Array(	"<p>Include bursts of greens, pinks, purples, and yellows&mdash;traditional pastels of the Easter palette. And throw in some porcelain birds and lambs for good measure. To add charm and beauty, mix in vibrant flowers, green grass, and jellybeans, and top with light china and neutral chargers, which accent the myriad spring colors.</p>","<p>Easter is just around the corner, so create a table setting that's bright and sunny just for the occasion. Include bursts of greens, pinks, purples, and yellows&mdash;traditional pastels of the Easter palette. And throw in some porcelain birds and lambs for good measure. To add charm and beauty, mix in vibrant flowers, green grass, and jellybeans, and top with light china and neutral chargers, which accent the myriad spring colors.</p>","<p>Easter is just around the corner, so create a table setting that's bright and sunny just for the occasion. Include bursts of greens, pinks, purples, and yellows&mdash;traditional pastels of the Easter palette. And throw in some porcelain birds and lambs for good measure. To add charm and beauty, mix in vibrant flowers, green grass, and jellybeans, and top with light china and neutral chargers, which accent the myriad spring colors.</p>","<p>Easter is just around the corner, so create a table setting that's bright and sunny just for the occasion. Include bursts of greens, pinks, purples, and yellows&mdash;traditional pastels of the Easter palette. And throw in some porcelain birds and lambs for good measure. To add charm and beauty, mix in vibrant flowers, green grass, and jellybeans, and top with light china and neutral chargers, which accent the myriad spring colors.</p>","<p>Easter is just around the corner, so create a table setting that's bright and sunny just for the occasion. Include bursts of greens, pinks, purples, and yellows&mdash;traditional pastels of the Easter palette. And throw in some porcelain birds and lambs for good measure. To add charm and beauty, mix in vibrant flowers, green grass, and jellybeans, and top with light china and neutral chargers, which accent the myriad spring colors.</p>","<p>Easter is just around the corner, so create a table setting that's bright and sunny just for the occasion. Include bursts of greens, pinks, purples, and yellows&mdash;traditional pastels of the Easter palette. And throw in some porcelain birds and lambs for good measure. To add charm and beauty, mix in vibrant flowers, green grass, and jellybeans, and top with light china and neutral chargers, which accent the myriad spring colors.</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();
	
});	