function Exhibitionist_imageObject(){
	this.defaultStepTime = 30;
	this.description = "";
	this.opacityPercent = 0;
	this.exhibitionist;
	this.image = new Image();
	
	this.holder = document.createElement('div');
	this.holder.setAttribute('id', "imageHolder");
	this.holder.style.overflow = "visible";
	
	this.holderHolder = document.createElement('div');
	this.holderHolder.setAttribute('id', "imageHolderHolder");
	
	this.title = document.createElement('div');
	this.title.setAttribute('id', "imageTitle");
	this.title.displayHeight = 0;
	
	this.step = 69;
	this.caption = document.createElement('div');
	this.caption.setAttribute('id', "imageCaption");
	this.caption.displayHeight = 0;
	
	this.aboveElement = document.createElement('div');
	this.aboveElement.setAttribute('id', "aboveInfoElement");
	
	this.belowElement = document.createElement('div');
	this.belowElement.setAttribute('id', "belowInfoElement");
	
	this.leftElement = document.createElement('div');
	this.leftElement.setAttribute('id', "leftInfoElement");
	this.leftElement.style.height = "100%";
	
	this.rightElement = document.createElement('div');
	this.rightElement.setAttribute('id', "rightInfoElement");
	this.rightElement.style.height = "100%";
	
	
	this.fadeInComplete = false;
	this.fadeOutComplete = false;
	this.onFadedOut = function(){};
	this.onFadedIn = function(){};
	this.alignable = false;
	this.thumbnail;
	this.removeTitle = function(){
		this.title.displayHeight = 0;
		this.holderHolder.removeChild(this.title);
	}
	this.removeCaption = function(){
		this.caption.displayHeight = 0;
		this.holderHolder.removeChild(this.caption);
	}
	this.init = function(exhibitionist,imageURL,imageWidth,imageHeight,thumbnailURL,thumbWidth,thumbHeight,caption,description,title){
		this.alignable = true;
		this.exhibitionist = exhibitionist;
		this.thumbnailURL = thumbnailURL;
		this.thumbnailWidth = thumbWidth;
		this.thumbnailHeight = thumbHeight;
		this.imageWidth = imageWidth;
		this.imageHeight = imageHeight;
		this.titleText = title;
		this.descriptionText = description;
		this.captionText = caption;
		this.thumbnail = new Exhibitionist_thumbnailObject;
		this.thumbnail.init(exhibitionist,thumbWidth,thumbHeight,thumbnailURL);
		
		this.image.src = imageURL;
		this.image.width = imageWidth;
		this.image.height = imageHeight;
		this.imageClickHolder = document.createElement("a");
		this.imageClickHolder.setAttribute("href","#");
		this.imageClickHolder.onclick = this.bigImageClick;
		this.imageClickHolder.appendChild(this.image);
		this.holderHolder.appendChild(this.imageClickHolder);
		
		if (exhibitionist.optionsArray['imageTitleEnable'] == true){
			var objectType = exhibitionist.optionsArray['imageTitleObjectType'];
			var objectClass = exhibitionist.optionsArray['imageTitleObjectClass'];
			var objectAlign = exhibitionist.optionsArray['imageTitleTextAlign'];
			this.title.text = title;
			this.title.innerHTML = "<div id='imageTitle'>"+this.title.text+"</div>";
			exhibitionist.container.appendChild(this.title);
			this.title.displayHeight = this.title.offsetHeight;
			exhibitionist.container.removeChild(this.title);
			this.holderHolder.appendChild(this.title);
		}
		
		if (exhibitionist.optionsArray['imageCaptionEnable'] == true){
			var objectType = exhibitionist.optionsArray['imageCaptionObjectType'];
			var objectClass = exhibitionist.optionsArray['imageCaptionObjectClass'];
			var objectAlign = exhibitionist.optionsArray['imageCaptionTextAlign'];
			this.caption.text = caption
			this.caption.innerHTML = "<div id='imageCaption'>"+this.caption.text+"</div>";
			exhibitionist.container.appendChild(this.caption);
			this.caption.displayHeight = this.caption.offsetHeight;
			exhibitionist.container.removeChild(this.caption);
			this.holderHolder.appendChild(this.caption);
		}
		
		if (exhibitionist.optionsArray['imageDescriptionEnable'] == true){
			this.description = document.createElement("div");
			this.description.text = description;
			this.description.id = 'imageDescription';
			this.description.innerHTML = this.description.text;
			exhibitionist.container.appendChild(this.description);
			this.description.displayHeight = this.description.offsetHeight;
			exhibitionist.container.removeChild(this.description);
			this.holderHolder.appendChild(this.description);
		}
		
		
		this.leftRightTable = document.createElement("table");
		this.leftRightTableBody = document.createElement("tbody");
		this.leftRightTableBodyRow1 = document.createElement("tr");
		this.leftRightTableBodyRow2 = document.createElement("tr");
		this.leftRightTableBodyRow3 = document.createElement("tr");
		
		this.leftRightTableBodyRow1Cell1 = document.createElement("td");
		this.leftRightTableBodyRow1Cell2 = document.createElement("td");
		this.leftRightTableBodyRow1Cell3 = document.createElement("td");
		
		this.leftRightTableBodyRow2Cell1 = document.createElement("td");
		this.leftRightTableBodyRow2Cell1.style.verticalAlign = "top";
		this.leftRightTableBodyRow2Cell2 = document.createElement("td");
		this.leftRightTableBodyRow2Cell2.style.verticalAlign = "top";
		this.leftRightTableBodyRow2Cell3 = document.createElement("td");
		this.leftRightTableBodyRow2Cell3.style.verticalAlign = "top";
		
		this.leftRightTableBodyRow3Cell1 = document.createElement("td");
		this.leftRightTableBodyRow3Cell2 = document.createElement("td");
		this.leftRightTableBodyRow3Cell3 = document.createElement("td");
		
		this.leftRightTable.appendChild(this.leftRightTableBody);
		this.leftRightTableBody.appendChild(this.leftRightTableBodyRow1);
		this.leftRightTableBody.appendChild(this.leftRightTableBodyRow2);
		this.leftRightTableBody.appendChild(this.leftRightTableBodyRow3);
		
		this.leftRightTableBodyRow1.appendChild(this.leftRightTableBodyRow1Cell1);
		this.leftRightTableBodyRow1.appendChild(this.leftRightTableBodyRow1Cell2);
		this.leftRightTableBodyRow1.appendChild(this.leftRightTableBodyRow1Cell3);
		
		this.leftRightTableBodyRow2.appendChild(this.leftRightTableBodyRow2Cell1);
		this.leftRightTableBodyRow2.appendChild(this.leftRightTableBodyRow2Cell2);
		this.leftRightTableBodyRow2.appendChild(this.leftRightTableBodyRow2Cell3);
		
		this.leftRightTableBodyRow3.appendChild(this.leftRightTableBodyRow3Cell1);
		this.leftRightTableBodyRow3.appendChild(this.leftRightTableBodyRow3Cell2);
		this.leftRightTableBodyRow3.appendChild(this.leftRightTableBodyRow3Cell3);
		
		
		this.leftRightTableBodyRow1Cell2.appendChild(this.aboveElement);
		
		this.leftRightTableBodyRow2Cell1.appendChild(this.leftElement);
		this.leftRightTableBodyRow2Cell2.appendChild(this.holderHolder);
		this.leftRightTableBodyRow2Cell3.appendChild(this.rightElement);
		
		this.leftRightTableBodyRow3Cell2.appendChild(this.belowElement);
		
		this.holder.appendChild(this.leftRightTable);
		
		this.setOpacity(0);
		this.holder.style.zoom = 1;
	}
	this.bigImageClick = function(){
		return false;
	}
	this.setHorizontalPadding = function(left,right){
		this.leftRightTableBodyRow2Cell2.style.paddingLeft = left+"px";
		this.leftRightTableBodyRow2Cell2.style.paddingRight = right+"px";
	}
	this.setVerticalPadding = function(top,bottom){
		this.holderHolder.style.paddingTop = top+"px";
		this.holderHolder.style.paddingBottom = bottom+"px";
	}
	this.setPosition = function(position){
		this.holder.style.position = position;
	}
	this.initUsingObject = function(object){
		this.holder.appendChild(object);
		this.setOpacity(0);
		this.holder.style.zoom = 1;
	}
	this.setOpacity = function(number){
		this.opacityPercent = number;
		this.holder.style.opacity = (this.opacityPercent * 0.01);
		this.holder.style.filter = "alpha(opacity = "+number+")";
	}
	this.increaseOpacity = function(number){
		if (this.opacityPercent < 100){
			this.opacityPercent = this.opacityPercent + number;
			this.setOpacity(this.opacityPercent);
		}
	}
	this.decreaseOpacity = function(number){
		if (this.opacityPercent > 0){
			this.opacityPercent = this.opacityPercent - number;
			this.setOpacity(this.opacityPercent);
		}
	}
	this.fadeIn = function(step){
		this.fadeInComplete = false;
		if (this.opacityPercent < 100){
			this.increaseOpacity(step);
			setTimeout(function(object,step){
						return function(){
							object.fadeIn(step);
						}
			}(this,step),this.defaultStepTime);
		}else{
			this.fadeInComplete = true;
			this.onFadedIn();
		}
	}
	this.fadeOutRecipritator = function(parent){
		parent.fadeOut(parent.step);
	}
	this.fadeOut = function(step){
		this.fadeOutComplete = false;
		if (this.opacityPercent > 0){
			this.decreaseOpacity(step);
			this.step = step;
			setTimeout(function(object,step){
						return function(){
							object.fadeOut(step);
						}
			}(this,step),this.defaultStepTime);
		}else{
			this.fadeOutComplete = true;
			this.onFadedOut();
		}
	}
}
function Exhibitionist_thumbnailObject(){
	this.src;
	this.exhibitionist;
	this.width = 0;
	this.height = 0;
	this.paddedImageWidth = 0;
	this.paddedImageHeight = 0;
	this.totalWidth = 0;
	this.totalHeight = 0;
	this.image = new Image();
	this.image.setAttribute('id', "thumbnailImage");
	
	this.init = function(exhibitionist,thumbnailWidth,thumbnailHeight,thumbnailURL){
		this.exhibitionist = exhibitionist;
		this.src = thumbnailURL;
		this.width = thumbnailWidth;
		this.height = thumbnailHeight;
	}
	this.make = function(thumbnailPadding,thumbnailCenterMode,noXPadding,noYPadding){
		this.image.src = this.src;
		this.image.height = this.height;
		this.image.width = this.width;
		this.image.style.height = this.height+"px";
		this.image.style.width = this.width+"px";
		if (thumbnailPadding == undefined){
			var thumbnailPadding = this.exhibitionist.optionsArray['thumbnailPadding'];
			var doPadding = this.exhibitionist.optionsArray['thumbnailCentering'];
		}else{
			doPadding = true;
			//alert("Using Thumb Padding by var pass");
		}
		if (doPadding == true){
			//calculate padding
			var paddingLefrRight = 0;
			var paddingTopBottom = 0;
			if (thumbnailCenterMode == undefined){
				thumbnailCenterMode = this.exhibitionist.optionsArray['thumbnailCenterMode'];
			}
			if (thumbnailCenterMode == true){
				//center using largest thumbnail
				paddingLefrRight = 0.5 * (this.exhibitionist.widestThumbWidth - this.width);
				paddingTopBottom = 0.5 * (this.exhibitionist.heighestThumbHeight - this.height);
			}else{
				//center using this thumbnail
				if (this.height > this.width){
					//height is bigger
					paddingTopBottom = 0;
					paddingLefrRight = 0.5 * (this.height - this.width);
					
				}else{
					//width is bigger
					paddingLefrRight = 0;
					paddingTopBottom = 0.5 * (this.width - this.height);
				}
			}
			if (noYPadding == true){
				//add X padding
				paddingTopBottom = 0;
			}
			if (noXPadding == true){
				//add Y padding
				paddingLefrRight = 0;
			}
			
			//add both
			this.image.style.paddingTop = 		(thumbnailPadding + paddingTopBottom)+"px";
			this.image.style.paddingBottom = 	(thumbnailPadding + paddingTopBottom)+"px";
			//this.image.style.paddingLeft = 		(thumbnailPadding + paddingLefrRight)+"px";
			this.image.style.paddingRight = 	(thumbnailPadding + paddingLefrRight)+"px";
			this.paddedImageWidth = 	this.width +
										paddingLefrRight +
										paddingLefrRight +
										thumbnailPadding +
										thumbnailPadding;
			this.paddedImageHeight = 	this.height +
										paddingTopBottom +
										paddingTopBottom +
										thumbnailPadding +
										thumbnailPadding;
		}
		
		this.thumbnail = document.createElement('a');
		this.thumbnail.setAttribute('id', "thumbnail");
		this.thumbnail.href = "#";
		
		
		this.totalWidth = this.paddedImageWidth;
		this.totalHeight = this.paddedImageHeight;
		this.thumbnail.parent = this;
		this.thumbnail.appendChild(this.image);
		return this;
	}
}