_image = function()
{
	this.IE      = false;
	this.mouseX  = 0;
	this.mouseY  = 0;
	this.caption = -1;

	/* -------------------------------------- */
	// Image Rollover
	/* -------------------------------------- */
	this.init = function()
	{
		this.IE = document.all ? true : false;

		if (!this.IE) 
		{
			document.captureEvents(Event.MOUSEMOVE)
		}

		document.onmousemove = image.getMouseXY;
	}

	/* -------------------------------------- */
	// Image Rollover
	/* -------------------------------------- */
	this.getMouseXY = function(e) 
	{
  		if ( image.IE ) 
		{
    			image.mouseX = event.clientX + document.body.scrollLeft
    			image.mouseY = event.clientY + document.body.scrollTop
  		} 
		else 
		{
    			image.mouseX = e.pageX
    			image.mouseY = e.pageY
  		}  

  		if (image.mouseX < 0){ image.mouseX = 0 }
  		if (image.mouseY < 0){ image.mouseY = 0 }  

  		return true
	}

	/* -------------------------------------- */
	// Image Rollover
	/* -------------------------------------- */
	this.imgRollover = function(imgnum, link)
	{
		if ( this.caption > -1 )
		{
			this.imgRollout(this.caption);
		}

		var rollover = fetch_object('imgRollover_' + imgnum);

		if ( !fetch_object('imgCaption_' + imgnum) )
		{
			return false;
		}

		var rollout  = fetch_object('imgCaption_' + imgnum);

		if ( !rollout || rollout.style.display == '' )
		{
			return false;
		}

		if ( link )
		{
			document.body.style.cursor = 'pointer';
		}

		this.caption = imgnum;

		// ------------------------------------------
		// Save height and width (fix for flickering)
		// ------------------------------------------
		rollout.style.width  = (parseInt(rollover.childNodes[0].offsetWidth) - 50) + 'px';
		rollout.style.height = (parseInt(rollover.childNodes[0].offsetHeight) - 50) + 'px';
		rollout.style.padding = '25px';

		// ------------------------------------------
		// HTML
		// ------------------------------------------
		rollover.style.display = 'none';
		rollout.style.display = '';
	}

	/* -------------------------------------- */
	// Image rollout
	/* -------------------------------------- */
	this.imgRollout = function(imgnum)
	{
		if ( !imgnum )
		{
			imgnum = this.caption;
		}

		if ( !fetch_object('imgCaption_' + imgnum) )
		{
			return false;
		}

		fetch_object('imgCaption_' + imgnum).style.display = 'none';
		fetch_object('imgRollover_' + imgnum).style.display = '';

		document.body.style.cursor = 'default';

		this.caption = 0;
	}
}

