add:  var found=false; for(i in mapHistory){ if(mapHistory[i]==currentMapId){ found=true; mapHistoryIndex=parseInt(i); } } if(currentMapId!=NEW_MAP && !found){ if(mapHistory.length==0){ mapHistory.push(currentMapId); mapHistoryName.push(currentMapName); mapHistoryIndex = 0; }else{  ++mapHistoryIndex; var firstPart = mapHistory.slice(0,mapHistoryIndex); var secondPart = mapHistory.slice(mapHistoryIndex); var center = new Array(); center.push(currentMapId); firstPart=firstPart.concat(center,secondPart); mapHistory=firstPart; /*for(ind in mapHistory){ alert(ind+" "+mapHistory[ind]); }*/   firstPart = mapHistoryName.slice(0,mapHistoryIndex); secondPart = mapHistoryName.slice(mapHistoryIndex); center = new Array(); center.push(currentMapName); firstPart=firstPart.concat(center,secondPart); mapHistoryName=firstPart; /*for(ind in mapHistoryName){ alert(ind+" "+mapHistoryName[ind]); }*/ }  }  
context: function viewSaveResponse(data) {	if(data.success) {				var answerST = data.content.split("+");		//alert(answerST[0]);		if(answerST[0]!="saveMapOK")			{				alert('Saving Map has failed ');				clearDownInfo();			enableMenu();			return;			}		//alert(answerST[0]+" "+answerST[1]+" "+answerST[2]+" "+answerST[3]+" "+answerST[4]+" "+answerST[5]+" "+answerST[6]+" "+answerST[7]+" "+answerST[8]);						var packet = answerST[9];		var totalPackets = answerST[10];		//alert("viewSaveResponse: packet="+packet+" totalPackets="+totalPackets);		if(packet==totalPackets){			currentMapId=parseInt(answerST[1]);			currentMapBackGround=answerST[2];			currentMapAccess=answerST[3];			currentMapName=answerST[4];			currentMapOwner=answerST[5];			currentMapUserlast=answerST[6];			currentMapCreatetime=answerST[7];			currentMapLastmodtime=answerST[8];					LoadMaps();			clearMapInfo();			viewMapInfo();			savedMapString = getMapString();						clearDownInfo();			var childNode = menuSvgDocument.getElementById("DownInfoText");			if (childNode)				menuSvgDocument.getElementById("DownInfo").removeChild(childNode);						menuSvgDocument.getElementById("DownInfo").appendChild(parseXML("<text id=\"DownInfoText\" x=\"5\" y=\"20\">Map '" +currentMapName+"' saved."+			"</text>",menuSvgDocument));			enableMenu();					}else{			saveMap2(packet, totalPackets); 		}			} else {		alert('Saving Map has failed');		clearDownInfo();		enableMenu();		return;	}		}
meta: 8692	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8692/d5b0121ba147eea97a444ae288f11e94118d5a54/ApplicationMap.js/clean/opennms-webapp/src/main/webapp/map/ApplicationMap.js