$(document).ready(function(){
	if (mph === null || typeof(mph) !== "object") { var mph = {};}
	mph.blockCarousel = false;
	mph.carouselhome = {
		init : function() {
			$("#imgCarousel li").css({position: "absolute", left: "15px", "z-index": function(index) {
					return index+1;
				}
			});
			$("#imgCarousel").click(function() {
			if (mph.blockCarousel !== true) {	
				mph.blockCarousel = true;
				$("#imgCarousel li").filter(function(index) {
					return parseInt($(this).css("z-index")) === $("#imgCarousel li").length;
				}).css("z-index", function(index, value) {
					var moveLeft = parseInt($(this).css("width")+50)+"px";
					$(this).animate({"left": "-="+moveLeft}, 525, "swing", function() {
						$(this).addClass("bottomOfThePile");
						$(this).css("z-index",1);
						$(this).animate({"left": "+="+moveLeft}, 250, "swing");
						$("#imgCarousel li").filter(function(index) {
							return !($(this).hasClass("bottomOfThePile"));
						}).css("z-index", function(index, value) {
							return parseInt(value)+1;
						});
						$(this).removeClass("bottomOfThePile");
						mph.blockCarousel = false;
					});
				});
			}
			else { return; };
			})
		}
	}
	mph.carouselhome.init();
});
	

