function Container() {
	this.currentElementIndex = -1
	this.contents = new Array(0)
}

Container.prototype.length = function() {
	return this.contents.length
}

Container.prototype.add = function(newElement) {
	this.contents.push(newElement)
}

Container.prototype.next = function() {
	
	if (this.currentElementIndex == this.contents.length - 1) {
		this.currentElementIndex = 0
		return this.contents[this.currentElementIndex]
	}
	else {
		return this.contents[++this.currentElementIndex]
	}
	
}

Container.prototype.previous = function() {
	
	if (this.currentElementIndex == 0) {
		this.currentElementIndex = this.contents.length - 1
		return this.contents[this.currentElementIndex]
	}
	else {
		return this.contents[--this.currentElementIndex]
	}
	
}

var originalParentOverflow;

function block() {
	//$("#loadingOverlay").height($(document).height())
	originalParentOverflow = $("#loadingOverlay").parent().css("overflow");
	$("#loadingOverlay").parent().css("overflow", "hidden");
	$("#loadingOverlay").show();
}

function unblock() {
	$("#loadingOverlay").fadeOut('slow');
	$("#loadingOverlay").parent().css("overflow", originalParentOverflow);	
}

function removePx(widthInPx) {
	return widthInPx.substring(0, widthInPx.length - 2)
}
