var MainSlider = Class.create({

  initialize: function() {
		this.horz_pos = 1;
		this.vert_pos = 1;
  },

  move_left: function() {
		return this.move_horz(this.horz_pos-1);
  },

  move_right: function() {
		return this.move_horz(this.horz_pos+1);
  },

  move_up: function() {
		return this.move_vert(this.vert_pos-1);
  },

  move_down: function() {
		return this.move_vert(this.vert_pos+1);
  },

  move_horz: function(slide) {
		if(slide < 1) slide = 1;
		this.horz_pos = slide;
		new Effect.Move('slider_big', { x: this.x(), y: 0, duration: 1, mode: 'absolute', queue: 'end', afterFinish: vert_reset });
  },

  move_vert: function(slide) {
		if(slide < 1) slide = 1;
		this.vert_pos = slide;
		return new Effect.Move('slider_vert_'+this.horz_pos, { x: 0, y: this.y(), duration: 1, mode: 'absolute', queue: 'end' });
  },

  x: function() {
		return (-874*(this.horz_pos-1));
	},

  y: function() {
		return (-375*(this.vert_pos-1));
	}

});


//---------------------------------
var sliderObj = new MainSlider();

function vert_reset() {
	sliderObj.move_vert(1);
}

// //------------------------------
// function case_pics_cancel() {
// 	var queue = Effect.Queues.get('before_after');
// 	queue.each(function(effect) { effect.cancel(); });
// }

