function ImageManager(parentObj, leftArrowClassName, rightArrowClassName, useClick, descrBoxId) {
	this.leftArrow = null;
	this.leftArrowActive = false;
	this.rightArrow = null;
	this.rightArrowActive = false;
	
	this.imageArray = null;
	this.object = null;
	
	this.imageBox = null;
	
	this.width = null;
	this.height = null;
	
	this.hideArrowsAfterClick = false;
	this.clicked = false;
	
	this.descrBox = null;
	
	this.Init = function(parentObj, leftArrowClassName, rightArrowClassName, useClick, descrBoxId) {
		this.object = $(parentObj);
		
		if(!this.object) {
			alert("Slide show object not found");
			return false;
		}
				
		this.imageBox = this.object;
		
		this.width = this.object.clientWidth;
		this.height = this.object.clientHeight;
		
		this.leftArrow = getChildByClassName(this.object, leftArrowClassName);
		this.rightArrow = getChildByClassName(this.object, rightArrowClassName);
		
		if(!this.leftArrow || !this.leftArrow) {
			alert("Parts of slide show was not Initialized");
			return false;
		}
		
		if(useClick) {
			this.hideArrowsAfterClick = true;
			this.clicked = (this.object.getAttribute("clicked")) ? true : false;
			
		}
		
		if(descrBoxId) this.descrBox = $(descrBoxId);
		
		this.imageArray = this.imageBox.getElementsByTagName("img");

		/* Events Init */
		var imageManagerInstance = this;
		this.object.onmouseout = function() {
			//imageManagerInstance.HideAllControls();
			if(imageManagerInstance.hideArrowsAfterClick && !imageManagerInstance.clicked) {
				if(imageManagerInstance.leftArrowActive == false && imageManagerInstance.rightArrowActive == false) {
					var arrowButton = getAnimationManager().add(imageManagerInstance.rightArrow, resizeOnly=true);
					arrowButton.setAction({method: "fade", alpha: 50, duration: 300});
					arrowButton.play();
				}
			}
		}
		/*
		this.object.onmousemove = function() {
			imageManagerInstance.MouseMoveHandle();
		}*/
		
		this.leftArrow.onclick = function() {
			if(imageManagerInstance.hideArrowsAfterClick && !imageManagerInstance.clicked) {
				imageManagerInstance.clicked = true;
				imageManagerInstance.object.setAttribute("clicked", true);
			}
			this.blur();
			return imageManagerInstance.ChangeImage("left");
		}
		
		this.leftArrow.onmouseover = function() {
			imageManagerInstance.leftArrowActive = true;
			imageManagerInstance.checkRight();

			var arrowButton = getAnimationManager().add(this, resizeOnly=true);
			arrowButton.setAction({method: "fade", alpha: 50, duration: 300});
			arrowButton.play();
		}
		
		this.leftArrow.onmouseout = function() {
			imageManagerInstance.leftArrowActive = false;
			
			var arrowButton = getAnimationManager().add(this, resizeOnly=true);
			arrowButton.setAction({method: "fade", alpha: 0, duration: 300});
			arrowButton.play();
		}

		this.rightArrow.onclick = function() {
			if(imageManagerInstance.hideArrowsAfterClick && !imageManagerInstance.clicked) {
				imageManagerInstance.clicked = true;
				imageManagerInstance.object.setAttribute("clicked", true);
			}
			this.blur();
			return imageManagerInstance.ChangeImage("right");
		}
		
		this.rightArrow.onmouseover = function() {
			imageManagerInstance.rightArrowActive = true;
			
			var arrowButton = getAnimationManager().add(this, resizeOnly=true);
			arrowButton.setAction({method: "fade", alpha: 50, duration: 300});
			arrowButton.play();
		}
		
		this.rightArrow.onmouseout = function() {
			imageManagerInstance.rightArrowActive = false;
			
			if(!imageManagerInstance.hideArrowsAfterClick || (imageManagerInstance.hideArrowsAfterClick && imageManagerInstance.clicked)) {
				var arrowButton = getAnimationManager().add(this, resizeOnly=true);
				arrowButton.setAction({method: "fade", alpha: 0, duration: 300});
				arrowButton.play();
			}
		}

	}
	
	this.checkRight = function() {
			var arrowButton = getAnimationManager().add(this.rightArrow, resizeOnly=true);
			arrowButton.setAction({method: "fade", alpha: 0, duration: 300});
			arrowButton.play();
			this.rightArrowActive = false;
	}
	
	this.MouseMoveHandle = function() {
		this.dx = this.mouse.x - this.x;
		if(this.dx < 125) this.ShowLeftArrow();
		else if(this.dx > this.width - 125) this.ShowRightArrow();
		else this.HideInsideAllControls();
	}
	
	this.ShowLeftArrow = function() {
		this.leftArrow.style.display = "block";
		this.rightArrow.style.display = "none";
	}	
	
	this.ShowRightArrow = function() {
		this.leftArrow.style.display = "none";
		this.rightArrow.style.display = "block";
	}

	this.ChangeImage = function(direction) {
		var imgShift = (direction=='left') ? -1 : 1;
		var imgArray = this.imageArray;
		var imgAlt = "";
		var imageChanged = false;
		
		for( var i=0; i < imgArray.length; i++) {
			if(imgArray[i].className.indexOf("hidden") < 0){
				addClass(imgArray[i], "hidden");
				if(i == 0 && imgShift < 0 ) {
					removeClass(imgArray[imgArray.length-1], "hidden");
					imgAlt = imgArray[imgArray.length-1].alt;
				} else if (i == imgArray.length-1 && imgShift > 0) {
					removeClass(imgArray[0], "hidden");
					imgAlt = imgArray[0].alt;
				} else {
					removeClass(imgArray[i+imgShift], "hidden");
					imgAlt = imgArray[i+imgShift].alt;
				}
				imageChanged = true;
				break;
			}
		}
		
		if(!imageChanged) {
			removeClass(imgArray[0], "hidden");
			imgAlt = imgArray[0].alt;
		}
		
		if(this.descrBox) this.descrBox.innerHTML = imgAlt;
		return false;
	}
	
	this.HideInsideAllControls = function() {
		this.leftArrow.style.display = "none";
		this.rightArrow.style.display = "none";
	}

	this.HideAllControls = function() {
		this.dx = this.mouse.x - this.x;
		this.dy = this.mouse.y - this.y;
		if(this.dx < 10 || this.dx > this.width-10 || this.dy < 10 || this.dy > this.height - 10) {
			this.leftArrow.style.display = "none";
			this.rightArrow.style.display = "none";
			this.object.onmousemove = function() {}
		}
	}	

	this.Init(parentObj, leftArrowClassName, rightArrowClassName, useClick, descrBoxId);
}