function SpotTheBall($post_name, $image_path, $attempts)
	{
		this.$attempts       = 0;
		this.$total_attempts = $attempts || 3;
		this.$name           = 'spottheball_' + parseInt(Math.random() * 100000, 10);
		this.$post_name      = $post_name || "SpotTheBall";
		this.$image_path     = $image_path || "/img/";

document.write('<div style="background: url(' + this.$image_path + 'background.jpg) left top no-repeat; margin-left:20px;" class="SpotTheBall" id="' + this.$name + '"><div id="' + this.$name + '_result"></div></div>');
		this.$element = document.getElementById(this.$name);
		this.$results = document.getElementById(this.$name + "_result");

		this.$element.$super = this;
		this.$element.onclick = function($event)
		{
			if (this.$super.$attempts < this.$super.$total_attempts) {
				$event = $event || window.event;
				var $x = $event.pageX || ($event.clientX + (document.body.scrollLeft || document.documentElement.scrollLeft) - document.documentElement.clientLeft);
				var $y = $event.pageY || ($event.clientY + (document.body.scrollTop  || document.documentElement.scrollTop)  - document.documentElement.clientTop);

				var $element = this;
				$x -= $element.offsetLeft;
				$y -= $element.offsetTop;
				while ($element = $element.offsetParent) {
				$x -= $element.offsetLeft;
				$y -= $element.offsetTop;
			}

				var $ball = document.createElement("img");
				$ball.src = this.$super.$image_path + "ball.gif";
				$ball.className = "ball";
				$ball.style.left = ($x - 6) + "px";
				$ball.style.top  = ($y - 6) + "px";
				this.appendChild($ball);

				this.$super.$attempts++;

//JUST MAKE THESE FIELDS HIDDEN IN PRODUCTION
				this.$super.$results.innerHTML +=
				'<input name="' + this.$super.$post_name + '[' + this.$super.$attempts + '][x]" type="text" readonly="true" value="' + $x + '" />' + 'x' +     //REMOVE THIS LINE IN PRODUCTION
				'<input name="' + this.$super.$post_name + '[' + this.$super.$attempts + '][y]" type="text" readonly="true" value="' + $y + '" />' + '<br />'; //REMOVE THIS LINE IN PRODUCTION

//SEE EXACTLY WHAT FIELDS ARE WE POSTING?
//alert(this.$super.$results.innerHTML);

					}
				};
			}