	/*
	--------------------------------------------------------------------
	"Javafied Javascript" courtesy of:

	http://www.u.arizona.edu/~jscully/javafication.html
	http://www.jtox.blogspot.com/
	--------------------------------------------------------------------
	I suspect that I used it incorrectly, but I like the way it makes
	the code look :) -- Chuck
	--------------------------------------------------------------------
	*/
	
	var inherits = "extends";
	var br = "<br>";

	//This method was deviously invented by Douglas Crockford.
	// http://www.crockford.com/
	Function.prototype.method = function (name, func)
	{
		this.prototype[name] = func;
		return this;
	};

	// And this one was deviously invented by me, after finding out how cool javascript
	// really was from Douglas Crockford's website.
	Function.prototype['extends'] = function (Parent)
	{
		var self = this;
		var i_;
		var ii_;
		var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1); //Used in a loop.
		
		self.prototype.base = function()
		{
			var s = "";
			var prototypeExists = false;
			var parentClass;

			for (i_ = arguments.length-1; i_ > 0;i_--)
			{
				if (typeof(arguments[i_]) == 'string')
					s = "'"+arguments[i_]+"'" + s;
				else 
					s = arguments[i_] + s;

				s ="," + s;
			}

			if (typeof(arguments[0]) == 'string')
				s = "'"+arguments[0]+"'"+s;
			else 
				s = arguments[0] + s;

			parentClass = eval("new Parent("+s+")");


			for (i_ in parentClass)
			{
				prototypeExists = false;
				if ( isOpera && i_.indexOf('toString') != -1) 
					/*Then do nothing*/ ;
				else
				{
					for (ii_ in self.prototype)
					{
						if (i_.indexOf(ii_) != -1) 
							prototypeExists = true;
					}

					if (!prototypeExists) 
						self.prototype[i_] = parentClass[i_];
				}
			}

			if ((self.prototype.toString).toString().indexOf("[native code]") != -1)
				self.prototype['toString'] = parentClass.toString;

			return parentClass;
		};	
	};