
var onProperty = false
// var infoObj = false;

function showProperty(key) {
	if (key != onProperty) {
		if (onProperty) {
			onProperty = false;
		}
		if (key) {
		
		
			elm = document.getElementById('vaMap'+ key);
			coordString = elm.getAttribute('rel');
			if (coordString.indexOf(',') > 0) {
				
			} else {
				coordString = '600,275';
			}
			coords = coordString.split(',');
			title = elm.getAttribute('title');

		//	document.getElementById('vaMapInfo').innerHTML = 'title';
			
		//	pointerObj = document.getElementById('vaMapPointer');
			var infoObj = document.getElementById('vaMapInfo');
			
		//	pointerObj.style.top = coords[1] +'px';
		//	pointerObj.style.left = coords[0] +'px';

			infoObj.style.top = (parseFloat(coords[1]) - 45) +'px';
			infoObj.style.left = (parseFloat(coords[0]) - 100) +'px';

		//	top.alert(key +':'+ coordString);
			
		//	pointerObj.style.display = 'block';
			infoObj.style.visibility = 'visible';

			if (infoObj.childNodes.length == 0) {
				txt = document.createTextNode(title);
				spn = document.createElement('span');
				spn.appendChild(txt);
				infoObj.appendChild(spn);
			} else {
				spn = infoObj.childNodes[0];
			//	txt = spn.childNodes[0];
			//	top.alert(spn.innerHTML);
				spn.innerHTML = title;
			//	txt.replaceWholeText(title);
			}
		//	document.getElementById('vamaptitle').innerHTML = title;
										
			onProperty = key;
		}
	}
}

function loadProperties () {

	var map = document.getElementById('vaproperties');
	
	//pointerObj = document.createElement('div');
	//pointerObj.setAttribute('id','vaMapPointer');
	var infoObj = document.createElement('span');
	infoObj.setAttribute('id','vaMapInfo');
	var listObj = document.createElement('span');
	listObj.setAttribute('id','vaMapList');
	
	//document.getElementById('vaproperties').innerHTML = currentMap +"<span id='vaMapList'></span><span id='vaMapInfo'><span id='vamaptitle'></span></span>";
	listInfo = document.getElementById('propertyList');
	listObj.innerHTML = listInfo.innerHTML;
	
	map.appendChild(listObj)
	map.appendChild(infoObj);

}


	function addOnLoadEvent(func) {

	  var oldonload = window.onload;

	  if (typeof window.onload != 'function') {

		window.onload = func;

	  } else {

	//	top.alert(oldonload)
	//	top.alert(func)

		window.onload = function() {

		  if (oldonload) {
			oldonload();
		  }
		  eval (func +'()');

		}

	  }

	}

