function ContentSlider(container, options) {
	if (!container.nodeName) //passing in a string
		container = $(container); 

	if (container.id) this.containerId = container.id;
	this.curIndex = -1;
	
	if (options.cssRule) this.elements = container.select(options.cssRule);
	else this.elements = container.childElements();
	
	if (!options || !options.noInitialHidden) {
		this.hideAll();
	}

	if (options.show >= 0 || options.show.length >= 0) this.showElement(options.show);
}

ContentSlider.prototype.moveTo = function(s) {
	this.showElement(s);
}

ContentSlider.prototype.hideAll = function() {
	for (var i = 0; i < this.elements.length; i++)
		this.elements[i].style.display = 'none';
}

ContentSlider.prototype.showElement = function(s) {
	if (s.nodeName) {
		for (var i = 0; i < this.elements.length; i++) {
			if (this.elements[i] === s) {
				if (this.curIndex >= 0) this.elements[this.curIndex].toggle();
				s.toggle();
				this.curIndex = i;
				return;
			}
		}
	} else if (s.length) {	// id string
		for (var i = 0; i < this.elements.length; i++) {
			if (this.elements[i].id == s) {
				if (this.curIndex >= 0) this.elements[this.curIndex].toggle();
				this.elements[i].toggle();
				this.curIndex = i;
				return;
			}
		}
	} else {	// index
		if (this.curIndex >= 0) this.elements[this.curIndex].toggle();
		if (s >= 0 && s < this.elements.length) this.elements[s].toggle();
		this.curIndex = s;
	}
}
