if (typeof fireunit == "undefined")
{
	function Fireunit()
	{
		this.passCount = 0;
		this.failCount = 0;
		
		Fireunit.prototype.ok = ok;
		Fireunit.prototype.compare = compare;
		Fireunit.prototype.reCompare = reCompare;
		Fireunit.prototype.testDone = testDone;
	
		function ok(expr, msg)
		{
			if (expr)
			{
				this.passCount++;
				document.write("<font color=green>" + msg + "</font><br />\n");
			}
			else {
				this.failCount++;
				document.write("<font color=red>" + msg + "</font><br />\n");
			}	
		}
	
		function compare(obj1, obj2, msg)
		{
			if (obj1 == obj2)
			{
				this.passCount++;
				document.write("<font color=green>" + msg + "</font><br />\n");
			}
			else {
				this.failCount++;
				document.write("<font color=red>" + msg + "</font><br />\n");
			}
		}
	
		function reCompare(obj1, obj2, msg)
		{
			if (obj2.match(obj1))
			{
				this.passCount++;
				document.write("<font color=green>" + msg + "</font><br />\n");
			}
			else {
				this.failCount++;
				document.write("<font color=red>" + msg + "</font><br />\n");
			}
		}
	
		function testDone()
		{
			document.write("<HR />" + String(this.passCount + this.failCount) + " tests executed<br />\n");
			document.write("<font color=green>" + String(this.passCount) + " tests passed</font><br />\n");
			document.write("<font color=red>" + String(this.failCount) + " tests failed</font><br />\n");
		}
	}
	var fireunit = new Fireunit();
}