context: function openDownloadedMap(data) {	var str = '';	var action = null;	//reset zoom and pan	reset();	if(data.success) {		str = data.content;		var tmpStr=str.substring(0,OPENMAP_ACTION.length+2);		if(tmpStr==OPENMAP_ACTION+"OK"){			str=str.substring(OPENMAP_ACTION.length+2,str.length);			action = OPENMAP_ACTION;			selectedMapInList=0;		} else {			tmpStr=str.substring(0,NEWMAP_ACTION.length+2);			if(tmpStr==NEWMAP_ACTION+"OK"){				str=str.substring(NEWMAP_ACTION.length+2,str.length);				action = NEWMAP_ACTION;			} else {					tmpStr=str.substring(0,CLOSEMAP_ACTION.length+2);				if(tmpStr==CLOSEMAP_ACTION+"OK"){					str=str.substring(CLOSEMAP_ACTION.length+2,str.length);					action = CLOSEMAP_ACTION;				} else {								alert('Loading Map Failed!');					loading--;					assertLoading();					return;					}			}		}	} else {		        alert('Loading Map: Response Failed!');				loading--;				assertLoading();				return;	}	//alert(str);	var st = str.split("&");	for(var k=0;k<st.length;k++){		var nodeToken = st[k];		var nodeST = nodeToken.split("+");		var counter=0;		if(k==0){			while(counter< nodeST.length){				var tmp = nodeST[counter];				if(counter==0)				{					currentMapId=tmp;				}				if(counter==1)				{					if(tmp!="null")						currentMapBackGround=tmp;					else currentMapBackGround=DEFAULT_BG_COLOR;				}				if(counter==2)					{					if(tmp!="null")						currentMapAccess=tmp;					else currentMapAccess="";					}				if(counter==3)					{					if(tmp!="null")						currentMapName=tmp;					else currentMapName="";					}				if(counter==4)					{					if(tmp!="null")						currentMapOwner=tmp;					else currentMapOwner="";					}				if(counter==5)					{					if(tmp!="null")						currentMapUserlast=tmp;					else currentMapUserlast="";					}				if(counter==6)					{					if(tmp!="null")						currentMapCreatetime=tmp;					else currentMapCreatetime="";					}				if(counter==7)					{					if(tmp!="null")						currentMapLastmodtime=tmp;					else currentMapLastmodtime="";					}								//alert(counter);					counter++;			}			clearMapInfo();			clearTopInfo();			clearDownInfo();			if(action==CLOSEMAP_ACTION){				hideMapInfo();			}else{				viewMapInfo();			}		}			if (k>0 && nodeST.length > 2) {			var id,x=0,y=0,iconName=DEFAULT_ICON,labelText="",avail=100,status=0,severity=0;						while(counter< nodeST.length){				var tmp = nodeST[counter];								//read the information of the map (id, name, ecc.)							if(counter==0) 				{					id=tmp;				}				if(counter==1)				{					if(tmp!="null")						x=parseInt(tmp);					else x=0;				}				if(counter==2) 					{					if(tmp!="null")						y=parseInt(tmp);					else y=0;					}				if(counter==3)					{					if(tmp!="null")						iconName=tmp;					}				if(counter==4)					{					if(tmp!="null")						labelText=tmp;					}				if(counter==5)					{					if(tmp!="null")						avail=tmp;					}									if(counter==6)					{					if(tmp!="null")						status=tmp;					}								if(counter==7)					{					if(tmp!="null")						severity=tmp;					}									//alert(counter);					counter++;			}			var semaphoreColor=getSemaphoreColorForNode(severity,avail,status);			var semaphoreFlash = getSemaphoreFlash(severity,avail);			//alert("add element " + id);			map.addMapElement(new MapElement(id,iconName, labelText, semaphoreColor, semaphoreFlash, x, y, mapElemDimension, status, avail,severity));		}		if (k>0 && nodeST.length == 2) {			var id1,id2;						while(counter< nodeST.length){				var tmp = nodeST[counter];								//read the information of the map (id, name, ecc.)							if(counter==0) 				{					id1=tmp;				}				if(counter==1)				{					id2=tmp;				}				counter++;			}			map.addLink(id1,id2,"green",1);		}	}	map.render();	reloadGrid();	loading--;	assertLoading();	savedMapString=getMapString();	enableMenu();//	alert('Opening Map OK!');		}
meta: 2281	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2281/d5b0121ba147eea97a444ae288f11e94118d5a54/ApplicationMap.js/buggy/opennms-webapp/src/main/webapp/map/ApplicationMap.js