function Obj3(z){
this.z = z;
this.f3 = function(){alert('I was defined in Obj3')};
this.getZ = function(){alert(this.z)};
}
function Obj2(y,z){
this.y = y;
Obj3.call(this, z);
this.f2 = function(){alert('I was defined in Obj2')};
this.getY = function(){alert(this.y)};
}
Obj2.prototype = new Obj3();
Obj2.prototype.constructor = Obj2;
function Obj1(x,y,z){
Obj2.call(this,y,z);
this.x = x;
this.f1 = function(){alert('I was defined in Obj1')};
this.getX = function(){alert(this.x)};
}
Obj1.prototype = new Obj2();
Obj1.prototype.constructor = Obj1;
Obj1.prototype.toString = function(){
return "obj1111";
}
var o = new Obj1(1,2,3);
o.getX();
o.getY();
o.getZ();
var b = new Obj2(5,6);
//alert(b instanceof Obj1);