var HoldingLocation = "";
function Initialize(){
	HideChildNodes('Rings');
	HideChildNodes('PropertyDetails');
	//document.getElementById('Ring').style.visibility = 'visible';
	//document.getElementById('Details').style.visibility = 'visible';
}
Initialize();

function HoldLocation(LocationName){
	HideChildNodes('Rings');
	HideChildNodes('PropertyDetails');
	ShowPropertyElement(LocationName);
	ShowPropertyDetails(LocationName);
	HoldingLocation = LocationName;
}
function MouseOverLocation(LocationName){
	ShowPropertyElement(LocationName);
}
function MouseOutLocation(LocationName){	
	if(HoldingLocation != LocationName) {
		document.getElementById(StripSpaces(LocationName) + 'Ring').style.visibility = 'hidden';
		document.getElementById(StripSpaces(LocationName) + 'Details').style.visibility = 'hidden';
	}
	document.getElementById('RingInstructions').style.visibility = 'hidden';
}
function HideChildNodes(ParentNodeId){
	pNode = document.getElementById(ParentNodeId);
	if(pNode){
		for(cNode = 0; cNode < pNode.childNodes.length; cNode++){
			if(pNode.childNodes[cNode].style) {
				pNode.childNodes[cNode].style.visibility = 'hidden';
			}
		}	
	}
}
function ShowPropertyElement(LocationName){
	document.getElementById(StripSpaces(LocationName) + 'Ring').style.visibility = 'visible';
	
	var instEl = document.getElementById('RingInstructions');
	instEl.style.visibility = 'visible';
	instEl.style.left = document.getElementById(StripSpaces(LocationName) + 'Ring').offsetLeft + 35 + 'px';
	instEl.style.top = document.getElementById(StripSpaces(LocationName) + 'Ring').offsetTop + 'px';
	instEl.innerHTML = '<b style="color:#FBDDAA;">' + LocationName + '</b><br/>Click for details';
}
function ShowPropertyDetails(LocationName){
	document.getElementById(StripSpaces(LocationName) + 'Details').style.visibility = 'visible';	
}
function StripSpaces(Input) {
	return(Input.replace(/[\s\W]/g,""));
}

