Resig inheritance, JavaScript: An implementation of Resig Inheritance