function ffSimpleSlider() {
	var count = 0;
	var dir = -1;
	var imageUrl = "./_images/dot.gif";
	var imageUrlInactive = new Image();
	imageUrlInactive.src = "./_images/dot_inactive.gif";
	var isComplete = new Boolean(true);
	var numSlides;
	var otherChildren = new Array();
	var otherContainer;
	var otherId = "";
	var slideChildren = new Array();
	var slideContainer;
	var sliderId = "";
	var slideWidth;
	
	this.init = function(sid, oid) {
		sliderId = sid;
		slideContainer = document.getElementById(sliderId);
		slideChildren = $(sliderId).childElements();
		
		otherId = oid;
		otherContainer = document.getElementById(otherId);
		
		slideWidth = slideChildren[0].offsetWidth;
		numSlides = slideChildren.length;
		
		slideContainer.insertBefore(slideChildren[numSlides - 1].cloneNode(true), slideChildren[0]);
		slideContainer.appendChild(slideChildren[0].cloneNode(true));
		
		slideContainer.style.width = slideWidth * (numSlides + 2) + "px";
		slideContainer.style.left = -slideWidth + "px";

		addItems(true);
	}
	
	this.slideContent = function(e) {
		if (isComplete) {
			isComplete = false;
			dir = (e.id.match(/next/i)) ? -1 : 1;
			count -= dir;
			if (count >= numSlides) count = 0;
			if (count < 0) count = numSlides - 1;
			var endPoint = -(slideWidth * numSlides) + 'px';
			new Effect.Move(sliderId, {
				x: dir * slideWidth,
				duration: 0.35,
				afterFinish: function(){ 
					isComplete = true;
					slideContainer.style.left = -((count + 1) * slideWidth) + "px";
				}
			});
			addItems(false);
		}
	}
	
	this.quickSlide = function(i) {
		if (isComplete) {
			isComplete = false;
			var dif = Math.abs(count - i);
			count = i;
			new Effect.Move(sliderId, {
				x: -((i + 1) * slideWidth),
				mode: 'absolute',
				duration: 0.25 * dif,
				afterFinish: function(){ 
					isComplete = true;
				}
			});
			addItems(false);
		}
	}
	
	function addItems(bool) {
		if (bool) {
			for (var i = 0; i < numSlides; i++) {
				otherContainer.innerHTML += "<img onclick=\"ffss.quickSlide(" + i + ")\" src=\"" + imageUrl + "\" />";
			}
			otherChildren = $(otherId).childElements();
		} 
		for (var j = 0; j < numSlides; j++) {
			if (j != count) otherChildren[j].src = imageUrlInactive.src;
		}
		//new Effect.Opacity(otherContainer.childElements()[count].childElements()[0], {to: 1, duration: .35});
		otherChildren[count].src = imageUrl;
	}
}
var ffss = new ffSimpleSlider();
//$('factsContainer').observe('load', ffss.init('factsContainer', 'items'));
