			var current = 0;
			var maxLength = 0;
			var objMantleWidth = 0;
			var objMantleImage = new Object();
			var objMantleButton = new Object();
			var myTimer;
			
			jQuery(document).ready(function() {
				
				maxLength = jQuery('div#mantle-slider div.mantle-item').length;
				objMantleWidth = jQuery('div#mantle-slider').width();
				objMantleImage = jQuery("div#mantle-images");
				objMantleButton = jQuery("div#mantle-buttons a");
				
				objMantleButton.click(function(){
					current = objMantleButton.index(this);
					mantleAction(current);
					window.clearInterval(myTimer); //Stop the rotation
					mantleSwitch();
				});
				
				mantleAction = function(){
					objMantleImage.animate({left:-objMantleWidth * current});
					objMantleButton.removeClass('active');
					objMantleButton.eq(current).addClass('active');
				}
				
				mantleSwitch = function(){
					myTimer = setInterval(function(){
						current++;
						if(current > (maxLength -1)){
							current = 0;
						}
						mantleAction();
					},10000);
				}
				
				mantleSwitch();
				
			});
