
	function Binoc(Height, Width, ThumbWidth, ThumbHeight, thumbRightTop, thumbRightLeft, thumbRightImage,  thumbUpsideTop, thumbUpsideLeft, thumbUpsideImage)
	{
		this.height = Height;
		this.width = Width;
		this.imgWidth = ThumbWidth;
		this.imgHeight = ThumbHeight;
		
		this.thumbRightTop = thumbRightTop;
		this.thumbRightLeft = thumbRightLeft;
		this.thumbRightImage = thumbRightImage;
		
		this.thumbUpsideTop = thumbUpsideTop;
		this.thumbUpsideLeft = thumbUpsideLeft;		
		this.thumbUpsideImage = thumbUpsideImage;		
	}



	Binoc.prototype.overImage = function(object, thumb)
	{		
		var oDiv = null;
		try
		{
			oDiv = document.getElementById("testRemove");
		}
		catch(e)
		{
			alert(e.message);
		}
		if (oDiv == null)
			var oDiv = document.createElement("div");
		oDiv.innerHTML = "";
		oDiv.id = "testRemove";
		object.childDiv = "testRemove";
		oDiv.style.width = this.width;
		oDiv.style.height = this.height;
		oDiv.style.position = "absolute";

		var oImg = document.createElement("img");
		oImg.style.width = "100%";
		oImg.style.height = "100%";
		var oImgTumb = document.createElement("img");
		oImgTumb.style.width = this.imgWidth;
		oImgTumb.style.height = this.imgHeight;
		oImgTumb.src = thumb;
		oImgTumb.style.position = "absolute";		
		if (object.offsetTop < this.height)
		{
			oImgTumb.style.top = this.thumbUpsideTop;
			oImgTumb.style.left = this.thumbUpsideLeft;
			oImg.src = this.thumbUpsideImage;
			oDiv.style.top = object.offsetTop + (object.offsetHeight/2);
			oDiv.style.left = object.offsetLeft + object.offsetWidth;
		}
		else
		{
			oImgTumb.style.top = this.thumbRightTop;
			oImgTumb.style.left = this.thumbRightLeft;
			oImg.src = this.thumbRightImage;
			oDiv.style.top = object.offsetTop + (object.offsetHeight/2) - this.height;
			oDiv.style.left = object.offsetLeft + object.offsetWidth;
		}

		oDiv.appendChild(oImg);
		oDiv.appendChild(oImgTumb);
		oDiv.onmouseout = function(){Binoc.outImage(this);}
		oDiv.onmouseover = function(){}
		document.body.appendChild(oDiv);
		activeImage = oDiv;
		if (evt != null)
			evt.cancelBubble = true;
		
	}

	var activeImage = null;

	Binoc.prototype.outImage = function(object)
	{
		//alert("hide");
		if (object != null)
		{
			//object.removeNode(true);
			object.innerHTML = "";
			object.style.width = 0;
			object.style.height = 0;
			
		}
		if (evt != null)
			evt.cancelBubble = true;
	}

	Binoc.prototype.clearBody = function()
	{
		if (activeImage != null)
		{
			activeImage.innerHTML = "";
			activeImage.style.width = 0;
			activeImage.style.height = 0;
		}
		if (evt != null)
			evt.cancelBubble = true;
	}
	
	var evt = null;
	var x;
	var y;
	
	function Mouse(event)
	{
		evt = event || window.event;
		//alert("X: " + evt.clientX + "Y: " + evt.clientY);
		
		x = evt.clientX;
		y = evt.clientY;
		
	}