function Car() { }
Car.prototype.color = "red";
Car.prototype.price = 20000;
Car.prototype.spleed = 30;
Car.prototype.showColor = function() {
document.writeln("color: " + this.color);
};
Car.prototype.addSpleed = function(s) {
if (s == undefined) {
this.spleed++;
} else {
this.spleed = this.spleed + s;
}
};
Car.prototype.showSpleed = function() {
document.writeln("spleed: " + this.spleed);
};
window.onload = function() {
var car = new Car();
car.showColor();
car.addSpleed(12);
car.showSpleed();
document.writeln("end");
}