Isolating Zone Javascript Using Prototype Classes

Often I am faced with creating JavaScript code that only applies to a single zone, but shares common functions names with another zone. A solution to this issue is to use Prototype to create JavaScript objects for each zone. An example outline of a default zone class is included below. This idea can be easily be expounded to create persistent JavaScript object where the data is exported by the zone using json_encode then loaded by the class. You could then create persistent JavaScript Objects which are used through out the zone.

Please note that this is meant as a best practice suggestion to help other programmers who are new to Zoop and its zone construction, but who may be familiar with Prototype. Zones DO NOT automatically create or load JavaScript that matches this format this is just how I handle JavaScript in relation to zones.

//HTML with the zone can then call zone specific functions
<script src="zone_default.js"></script>
<script>zone_default.initZone();</script>

//zone_default.js
var DefaultZone = Class.create();
DefaultZone.prototype = {
	zone_value: null,
	aonther_zone_value: null,
 
	initialize: function(id) {
	},
 
	initZone: function() {
		//Do some fancy javascript
	}
}
 
var default_zone = new DefaultZone();