rem: var dy = 20; 
add: var dy = 13; 
context: function addLegend() {	var x = 1;	var y = 15;	var cx = 10;	var cy = 30;	var cr = 5;	var dx = 0;	var dy = 20;	var ddx = 10;	var ddy = 3;		var legendSVG = menuSvgDocument.getElementById("legend");		if (legendSVG.firstChild != undefined) {		legendSVG.removeChild(legendSVG.firstChild);	}	var legendGroup = menuSvgDocument.createElementNS(svgNS,"g");	var lgtext = menuSvgDocument.createElementNS(svgNS,"text");	lgtext.setAttributeNS(null,"x", x);	lgtext.setAttributeNS(null,"y",y);		var contentText = menuSvgDocument.createTextNode("Severity View");		if ( colorSemaphoreBy == "A") {		contentText = menuSvgDocument.createTextNode("Availability View")		for(var index in AVAIL_MIN) {			var item = menuSvgDocument.createElementNS(svgNS,"circle");			item.setAttributeNS(null,"cx",cx);			item.setAttributeNS(null,"cy",cy);			item.setAttributeNS(null,"r",cr);			item.setAttributeNS(null,"fill",AVAIL_COLOR[index]);			item.setAttributeNS(null,"stroke","black");			legendGroup.appendChild(item);			var textel = menuSvgDocument.createElementNS(svgNS,"text");			textel.setAttributeNS(null,"x", cx+ddx);			textel.setAttributeNS(null,"y",cy+ddy);			var label = "";			if (AVAIL_MIN[index] < 0) {				label = "Unknown";			} else {				label =  " Better " + AVAIL_MIN[index] +"%";			}			var labelText = menuSvgDocument.createTextNode(label);			textel.appendChild(labelText);			legendGroup.appendChild(textel);			cx = cx+dx;			cy = cy+dy;		}	} else if (colorSemaphoreBy == "T") {		contentText = menuSvgDocument.createTextNode("Status View")		for(var index in STATUSES_UEI) {			var item = menuSvgDocument.createElementNS(svgNS,"circle");			item.setAttributeNS(null,"cx",cx);			item.setAttributeNS(null,"cy",cy);			item.setAttributeNS(null,"r",cr);			item.setAttributeNS(null,"fill",STATUSES_COLOR[index]);			item.setAttributeNS(null,"stroke","black");			legendGroup.appendChild(item);			var textel = menuSvgDocument.createElementNS(svgNS,"text");			textel.setAttributeNS(null,"x", cx+ddx);			textel.setAttributeNS(null,"y",cy+ddy);			var labelText = menuSvgDocument.createTextNode(STATUSES_TEXT[index]);			textel.appendChild(labelText);			legendGroup.appendChild(textel);			cx = cx+dx;			cy = cy+dy;		}	} else {		for(var index in SEVERITIES_LABEL) {			var item = menuSvgDocument.createElementNS(svgNS,"circle");			item.setAttributeNS(null,"cx",cx);			item.setAttributeNS(null,"cy",cy);			item.setAttributeNS(null,"r",cr);			item.setAttributeNS(null,"fill",SEVERITIES_COLOR[index]);			item.setAttributeNS(null,"stroke","black");			legendGroup.appendChild(item);			var textel = menuSvgDocument.createElementNS(svgNS,"text");			textel.setAttributeNS(null,"x", cx+ddx);			textel.setAttributeNS(null,"y",cy+ddy);			var labelText = menuSvgDocument.createTextNode(SEVERITIES_LABEL[index]);			textel.appendChild(labelText);			legendGroup.appendChild(textel);			cx = cx+dx;			cy = cy+dy;	    }			}	lgtext.appendChild(contentText);	legendGroup.appendChild(lgtext);	legendSVG.appendChild(legendGroup);	}
meta: 3303	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3303/069d0e7b3a96289b7c94aecc6c8a14fee3498895/menu.js/buggy/opennms-webapp/src/main/webapp/map/menu.js