function Gallery(htmlObjectId, galleryMoveBy, moveHorizontal)
{
	
	this.htmlObjectId = htmlObjectId; //Ojbect in page containing the gallery
	this.moveToPrevious = moveToPrevious;
	this.moveToNext = moveToNext;
	this.galleryPosition = 0;
	this.galleryWidth = $(htmlObjectId).offsetWidth;
	this.galleryMoveBy = galleryMoveBy ? galleryMoveBy : 360; //This value can be passed in or default will be used
	this.moveHorizontal = moveHorizontal ? moveHorizontal : false; //If true, gallery scrolls horizontally, else vertically
	if(navigator.appName.indexOf('Explorer') >= 0)
	{
		this.galleryHeight = ($(htmlObjectId).childNodes.length) * this.galleryMoveBy;
	}
	else
	{
		this.galleryHeight = (($(htmlObjectId).getElementsByTagName('div').length/4)-1) * this.galleryMoveBy;
	}
	
	function moveToPrevious()
	{
		if (this.galleryPosition > 0) {
			var xMove = 0;
			var yMove = this.galleryMoveBy;
			
			if(this.moveHorizontal)
			{
				xMove = this.galleryMoveBy;
				yMove = 0;
			}
			
			new Effect.Move(this.htmlObjectId, {
				x: xMove,
				y: yMove,
				transition: Effect.Transitions.sinoidal
			});
			this.galleryPosition -= this.galleryMoveBy;
		}
	}
	
	function moveToNext()
	{
			var canMove = false;
			var propertyMeasure = this.galleryHeight;
			
			var xMove = 0;
			var yMove = -(this.galleryMoveBy);
			
			if(this.moveHorizontal)
			{
				xMove = -(this.galleryMoveBy);
				yMove = 0;
				propertyMeasure = this.galleryWidth;
			}
			
			if ((this.galleryPosition + this.galleryMoveBy) <= getMaxScrollTo(propertyMeasure)) {
				canMove = true;
			}
		
			if(canMove)
			{
				new Effect.Move(this.htmlObjectId, {
					x: xMove,
					y: yMove,
					transition: Effect.Transitions.sinoidal
				});
				this.galleryPosition += this.galleryMoveBy;
			}
	}
	
	function getMaxScrollTo(galleryWidthDefault)
	{
		var maxScrollPos = 0;
		if(navigator.appName.indexOf('Explorer') >= 0)
		{
			maxScrollPos = galleryWidthDefault - 250;
			return maxScrollPos;
		}
		else
		{
			maxScrollPos = galleryWidthDefault + 225;
			return maxScrollPos;
		}
	}
}