rem: var ref = this; $('edit-tilelayerlink-new-a').onclick = function(){ref.editTilelayer(null, i);}; 
add: $('edit-tilelayerlink-new-a').onclick = this.handleEvent('editTilelayer',null, i); 
context: 	"editMaptypeTilelayers": function(i){		this.cancelNewMaptype();		this.toggleMenuOptsStyles( "maptype", this.Map.maptypes.length, i, 'edit-selected' );				this.cancelEditMaptype();		var m_id = this.Map.maptypes[i].maptype_id;		//set some constants		var tilelayersTable = $('edit-tilelayers-table');		var tilelayersLinksList = $('edit-tilelayers-list');		var tilelayersLinks = tilelayersLinksList.getElementsByTagName("li");		//Clear all the existing tilelayers listed  		//We leave the first two, the first is the model we clone, the second if for a new tilelayer		var count = tilelayersLinks.length;		for (n=count-1; n>1; n--){			tilelayersLinksList.removeChild(tilelayersLinks.item(n));		}		var ref = this;		$('edit-tilelayerlink-new-a').onclick = function(){ref.editTilelayer(null, i);};		//For each tilelayer in our new maptype, add a link		var firstselected = false;		for (var n=0; n<this.Map.tilelayers.length; n++) {			var t = this.Map.tilelayers[n];			if (t.maptype_id == m_id){				var li = tilelayersLinks.item(0).cloneNode(true);				li.id = 'edit-tilelayerlink-'+n;				var link = li.getElementsByTagName("a").item(0);				var nn = n;				var ref = this;				link.onclick = function(){ref.editTilelayer(nn,i);};				link.innerHTML = t.tiles_name;				tilelayersLinksList.appendChild(li);				li.style.display = "block";				if (firstselected != true){					this.editTilelayer(n, i);					firstselected = true;				}	        			}		}				if (firstselected == false){			this.editTilelayer(null, i);		}	},
meta: 1713	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1713/8e37dd0e7c2b0bc8163139e9ad13be19b0e0ff18/Edit.js/clean/templates/Edit.js