
function slide_o_matic(slider_id,slider_max,slider_amount,slider_is_horizontal) {
	this.id = slider_id;
	this.pos = 0;
	this.max = slider_max;
	this.amount = slider_amount;
	this.is_horizontal = slider_is_horizontal;
}

slide_o_matic.prototype.slide_pos_set = function (obj) {
	var a = ( (this.amount * -1 ) * this.pos ) + 'px';
	if ( this.is_horizontal ) {
		obj.style.marginLeft = a;
	} else {
		obj.style.marginTop = a;
	}
}

slide_o_matic.prototype.slide_forward = function () {
	if ( this.pos <= 0 ) {
		return;
	}
	var obj = document.getElementById(this.id);
	if ( obj ) {
		this.pos = this.pos - 1;
		this.slide_pos_set(obj);
	}
}

slide_o_matic.prototype.slide_backward = function () {
	if ( (this.pos +1) >= this.max ) {
		return;
	}
	var obj = document.getElementById(this.id);
	if ( obj ) {
		this.pos = this.pos + 1;
		this.slide_pos_set(obj);
	}
}

