// Define history model and handlers


NetVisHistory = function() {
	BaseNetVisModel.apply(this); // History class inherits from baseModel
	
	this.loadEvent = function(obj, momentTime) {
		log.console('loading event ', obj);
		obj._t = momentTime;
		obj.time = momentTime.toISOString();
		var isoTime = momentTime.toISOString();
		var i=0;
		var eventID = isoTime; 
		// eventID to be unique and contain timestamp
		// of form "<timestamp>#3" where 3 is count of events with
		// the same timestamp
		log.console(eventID);
		while (this.asObject[eventID]){
			i++;
			eventID = isoTime + "#" + i;
		}
		obj.id = eventID;
		this.load(obj);
	};
	// add default time margin moments
	this.loadEvent({"tag":"start"},moment("1970-01-01"));	
	this.loadEvent({"tag":"end"},moment("3000-01-01"));	
};
@@ -184,46 +184,8 @@
 ) %7B%0A
-%09%09log.console('loading event ', obj);%0A
 %09%09ob
@@ -246,87 +246,8 @@
 ();%0A
-%09%09var isoTime = momentTime.toISOString();%0A%09%09var i=0;%0A%09%09var eventID = isoTime; %0A
 %09%09//
@@ -381,28 +381,37 @@
 p%0A%09%09
-log.console(eventID)
+var i=1,%0A%09%09%09obj.id = obj.time
 ;%0A%09%09
@@ -419,15 +419,15 @@
 hile
- 
 (this.
+_
 asOb
@@ -431,23 +431,22 @@
 sObject%5B
-eventID
+obj.id
 %5D)%7B%0A%09%09%09i
@@ -456,22 +456,22 @@
 %0A%09%09%09
-eventID = isoT
+obj.id = obj.t
 ime 
@@ -496,23 +496,24 @@
 bj.id = 
-eventID
+obj.time
 ;%0A%09%09this

Fix bug asObject --> _asObject