
function CObject()
{
	CObject_Constructor(this);
}
function CObject_Constructor(_this)
{
	_this.m_sObjName = "";
	_this.virtual = CObject_DefineVirtualMethod;
	_this.SetClassName = CObject_SetClassName;
	_this.GetClassName = CObject_GetClassName;
	_this.IsTypeOf = CObject_IsTypeOf;
	_this.IsKindOf = CObject_IsKindOf;

       	_this.GetObjectName = CObject_GetObjectName;
       	_this.SetObjectName = CObject_SetObjectName;

	_this.m_arClasses = new Array();
	_this.SetClassName("CObject");

}
function CObject_SetClassName(sName)
{
	this.m_sClassName = sName;
	this.m_arClasses[sName] = true;
}
function CObject_GetClassName()
{
	return this.m_sClassName;
}
function CObject_GetObjectName()
{
	return this.m_sObjName;
}
function CObject_SetObjectName(sName)
{
	this.m_sObjName = sName;
}
function CObject_IsTypeOf(sName)
{
	return this.m_sClassName == sName;
}
function CObject_IsKindOf(sName)
{
	return this.m_arClasses[sName];
}
function CObject_DefineVirtualMethod(sMethod)
{
	var sFullMethod = this.m_sClassName + "_" + sMethod;
	eval(
	"if (this." + sMethod + " != null)"+
	"	this.Base_" + sMethod + " = this." + sMethod
	); 
	eval("this." + sFullMethod + "=" + sFullMethod + ";");
	eval("this." + sMethod + "=" + sFullMethod + ";");
}
