
	function FancyImage()
	{
	    this.x = 0;
	    this.y = 0;
		this.width = 0;
		this.height = 0;
		this.position = "relative";
		this.name = "";
		this.index = 0;
		this.image = "";
		this.parentDiv = 'myDiv';
	}
	
	FancyImage.prototype.BuildMe = function(){

		var txt = document.createElement("div");
		this.htmlelement = txt;
		document.getElementById(this.parentDiv).appendChild(txt);
		this.PaintMe();
	}
	
	FancyImage.prototype.PaintMe = function()
	{
	
		if (typeof document.body.style.maxHeight != "undefined") {
		} else {
			this.image = this.image.replace(".png",".gif");
		}
	
		var divText;
		divText = "<div id='ImageDiv" + this.index + "' ";
		divText += "style=\"";
		divText += "cursor:" + this.cursor + ";";
		divText += "position:" + this.position + ";";
		divText += "left:" + this.x + ";";
		divText += "top:" + this.y + ";";
		if(this.width>0){
			divText += "width:" + this.width + ";";
		}
		if(this.height>0){
			divText += "height:" + this.height + ";";
		}
		divText += "\">";
		divText += "<img id='Image" + this.index + "' src='" + this.image + "' ";
		if(this.width>0){
			divText += "width=" + this.width + " ";
		}
		if(this.height>0){
			divText += "height=" + this.height + " ";
		}
		divText += "onclick='myArray[" + this.index + "].OnClick();' ";
		divText += ">";

		divText += "</div>";
		
		this.htmlelement.innerHTML = divText;
	}
	
	FancyImage.prototype.OnClick = function(){
		eventHandler(this.name,"click");
	}

	FancyImage.prototype.SetImage = function(sImage){
		var imgVar;
		imgVar = document.getElementById("Image" + this.index);
		this.image = sImage;
		if (typeof document.body.style.maxHeight != "undefined") {
		} else {
			this.image = this.image.replace(".png",".gif");
		}
		imgVar.src = this.image;
	}
