~
function()
{
	if (typeof HTMLElement != "undefined")
	{
		if (window.Event)
		{
			Event.prototype.__defineSetter__("returnValue",
			function(b)
			{
				if (!b) this.preventDefault();
				return  b
			});
			Event.prototype.__defineSetter__("cancelBubble",
			function(b)
			{
				if (b) this.stopPropagation();
				return  b
			});
			Event.prototype.__defineGetter__("srcElement",
			function()
			{
				var a = this.target;
				while (a && a.nodeType != 1) a = a.parentNode;
				return  a
			})
		}
		if (window.Document)
		{}
		if (window.Node)
		{
			Node.prototype.removeNode = function(r)
			{
				if (r) try
				{
					return  this.parentNode.removeChild(this)
				}
				catch(e)
				{
					document.body.removeChild(this)
				}
				else
				{
					var a = document.createRange();
					a.selectNodeContents(this);
					return  this.parentNode.replaceChild(a.extractContents(), this)
				}
			}
		}
		if (window.HTMLElement)
		{
			function _attachEvent(o, e, h)
			{
				var a = /^onmousewheel$/i.test(e) ? "DOMMouseScroll": e.replace(/^on/i, "");
				return  o.addEventListener(e, h, false)
			}
			HTMLElement.prototype.attachEvent = function(e, h)
			{
				return  _attachEvent(this, e, h)
			};
			window.attachEvent = function(e, h)
			{
				return  _attachEvent(window, e, h)
			};
			document.attachEvent = function(e, h)
			{
				return  _attachEvent(window, e, h)
			};
			function _detachEvent(o, e, h)
			{
				e = /^onmousewheel$/i.test(e) ? "DOMMouseScroll": e.replace(/^on/i, "");
				return  o.removeEventListener(e, h, false)
			}
			HTMLElement.prototype.detachEvent = function(e, h)
			{
				return  _detachEvent(this, e, h)
			};
			window.detachEvent = function(e, h)
			{
				return  _detachEvent(window, e, h)
			};
			document.detachEvent = function(e, h)
			{
				return  _detachEvent(window, e, h)
			};
			HTMLElement.prototype.__defineSetter__("outerHTML",
			function(a)
			{
				var r = this.ownerDocument.createRange();
				r.setStartBefore(this);
				var b = r.createContextualFragment(a);
				this.parentNode.replaceChild(b, this);
				r = null;
				return  a
			});
			HTMLElement.prototype.__defineGetter__("outerHTML",
			function()
			{
				var a;
				var b = this.attributes;
				var c = "<" + this.tagName;
				for (var i = 0; i < b.length; i++)
				{
					a = b[i];
					if (a.specified) c += " " + a.name + '="' + a.value + '"'
				}
				if (!this.canHaveChildren) return  c + ">";
				return  c + ">" + this.innerHTML + "</" + this.tagName + ">"
			});
			HTMLElement.prototype.__defineGetter__("canHaveChildren",
			function()
			{
				switch (this.tagName.toLowerCase())
				{
				case "area":
				case "base":
				case "basefont":
				case "col":
				case "frame":
				case "hr":
				case "img":
				case "br":
				case "input":
				case "isindex":
				case "link":
				case "meta":
				case "param":
					return  false
				}
				return  true
			});
			HTMLElement.prototype.setCapture = function()
			{
				document.onselectstart = function()
				{
					return  false
				};
				window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP)
			};
			HTMLElement.prototype.releaseCapture = function()
			{
				document.onselectstart = null;
				window.releaseEvents(Event.MOUSEMOVE);
				window.releaseEvents(Event.MOUSEUP)
			}
		}
	}
	if (window.addEventListener)
	{
		FixPrototypeForGecko()
	}
	function FixPrototypeForGecko()
	{
		window.constructor.prototype.__defineGetter__("event", window_prototype_get_event);
		Event.prototype.__defineGetter__("keyCode", event_prototype_get_keyCode);
		Event.prototype.__defineGetter__("offsetX", event_prototype_get_ox);
		Event.prototype.__defineGetter__("offsetY", event_prototype_get_oy);
		function event_prototype_get_ox()
		{
			return  event_prototype_get_oxy(this).offsetX
		}
		function event_prototype_get_oy()
		{
			return  event_prototype_get_oxy(this).offsetY
		}
		function event_prototype_get_oxy(a)
		{
			var b = a.target;
			var c = getPageCoord(b);
			var d =
			{
				x: window.pageXOffset + a.clientX,
				y: window.pageYOffset + a.clientY
			};
			var e =
			{
				offsetX: d.x - c.x,
				offsetY: d.y - c.y
			};
			return  e
		}
		function getPageCoord(a)
		{
			var b =
			{
				x: 0,
				y: 0
			};
			while (a)
			{
				b.x += a.offsetLeft;
				b.y += a.offsetTop;
				a = a.offsetParent
			}
			return  b
		}
		if (typeof(document.documentElement.style.cssText) == "undefined")
		{
			HTMLElement.prototype.__defineGetter__("cssText", element_prototype_get_cssText);
			HTMLElement.prototype.__defineSetter__("cssText", element_prototype_set_cssText)
		}
	}
	function event_prototype_get_offsetX()
	{
		return  this.offsetX
	}
	function element_prototype_get_cssText()
	{
		var a = "";
		for (var i in this)
		{
			a += i + ":" + this[i] + ";"
		}
		return  a
	}
	function element_prototype_set_cssText()
	{
		var a = "";
		for (var i in this)
		{
			a += i + ":" + this[i] + ";"
		}
		this.setAttribute("style", a)
	}
	function event_prototype_get_keyCode()
	{
		return  event.which
	}
	function window_prototype_get_event()
	{
		return  SearchEvent()
	}
	function SearchEvent()
	{
		if (document.all) return  window.event;
		var a = SearchEvent.caller;
		while (a != null)
		{
			var b = a.arguments[0];
			if (b)
			{
				if (b.constructor == Event || b.constructor == MouseEvent) return  b
			}
			a = a.caller
		}
		a = null;
		return  null
	}
} ();