// constructor
function Pet(name)
{
	this.name = name;
}

Pet.prototype = {
	getName:function()
	{
		return this.name;
	}
	setName:function(newName)
	{
		this.name = newName;
	}
};

var aPet = new Pet("doggy");
alert(aPet.getName());
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2008-08-27 17:32:32
Processing time 0.0060 sec