Could somebody please help me get my head around prototype inheritance I've done a lot of reading and not found something quite specific to what I am doing. Basically for a simplified example I have a game with levels, so I have a generic 'level' function that I want to base levels off.

So I've written my code for that template level
function level() {
//generic level functionality
Then I want to write a level1 function that inherits properties and methods from level but I don't want anything in the level constructor to execute until level1 is instantiated. So at the end I will have something like
var RunLevel
StartGameButton.onClick = function()
{RunLevel = new level1();
And I ASSUME, assuming wrong.. Is, level1 is something like,
level1 = function() {
this.prototype = new level();
//level 1 functionality

//Rather than this being outside the level1 function
level1.prototype = new level();
When I try the second I get everything in the level constructor executing at runtime which I don't want, I don't want it until the StartGameButton is hit and hence, level1 instantiated.

If I'm going about this completely the wrong way let me know because I probably am. I've got a published project in Flash/AS3.0 that I'm trying to port to Javascript and the class to prototypes business is what's going to trip me up I think.

Cheers for any help in advance,