Is it possible to combine this whole definition into one declaration and not break it down?
First part
var Pan = function(){};
The second part of
Pan.prototype = { //private variables Id: null, //public methods GetId: function(){ alert(Id); } }
You can always do:
var Pan = function () { var Id = null; this.GetId = function(){ alert(Id); } };