// JavaScript Document// JavaScript Document
function domFunction(f, a)
{
	var n = 0;
	var t = setInterval(function()
	{
		var c = true;
		n++;
		if(typeof document.getElementsByTagName != 'undefined' && (document.getElementsByTagName('body')[0] != null || document.body != null))
		{
			c = false;
			if(typeof a == 'object')
			{
				for(var i in a)
				{
					if ( (a[i] == 'id' && document.getElementById(i) == null) || (a[i] == 'tag' && document.getElementsByTagName(i).length < 1)	) 
					{ 
						c = true; 
						break; 
					}
				}
			}
			if(!c) { f(); clearInterval(t); }
		}
		if(n >= 60)
		{
			//clear the timer
			clearInterval(t);
		}
		
	}, 250);
}
function hideProperties(geo){
	var a = ["atlanta","austin","boston","central_florida", "chicago", "cleveland","dallas","denver","detroit","greenville","houston","los_angeles","minneapolis","nashville","new_york","philadelphia","phoenix","portland","seattle","south_florida","washington"]; 
	for(var i=0;i<=a.length;i++){
		var num = 0;
		for(var j=1; j<5; j++){
			if (document.getElementById(a[i]+'-'+j)){num = num + 1;}
		}
		if(a[i] != geo){
			var a1 = document.getElementById(a[i]+'-1');
			var a2 = document.getElementById(a[i]+'-2');
			var a3 = document.getElementById(a[i]+'-3');
			var a4 = document.getElementById(a[i]+'-4');
			if(num == 1){a1.style.display = "none";}
			if(num == 2){a1.style.display = "none"; a2.style.display = "none";}
			if(num == 3){a1.style.display = "none"; a2.style.display = "none"; a3.style.display = "none";}
			if(num == 4){a1.style.display = "none"; a2.style.display = "none"; a3.style.display = "none"; a4.style.display = "none";}
		}
	}
	document.getElementById('info').style.display = "none";
}
function displayProperty(geo){
	hideProperties(geo);
	var num = 0;
	for(var i=1; i<5; i++){
		if (document.getElementById(geo+'-'+i)){num = num + 1;}
	}
	var a1 = document.getElementById(geo+'-1');
	var a2 = document.getElementById(geo+'-2');
	var a3 = document.getElementById(geo+'-3');
	var a4 = document.getElementById(geo+'-4');
	if(num == 1){a1.style.display = "block";}
	if(num == 2){a1.style.display = "block";a2.style.display = "block";}
	if(num == 3){a1.style.display = "block";a2.style.display = "block";a3.style.display = "block";}
	if(num == 4){a1.style.display = "block";a2.style.display = "block";a3.style.display = "block";a4.style.display = "block";}
}