function open_email_home(homeID)
{
	window.open("home_emailquestion.asp?home=" + homeID,"Email", "width=500,height=400,resizable=1,scrollbars=1")
}

function open_additional_homes_photo(homeID, photoID)
{	
	window.open("home_pix.asp?home=" + homeID + "&photo=" + photoID, "Home", "width=550,height=450,resizable=1,scrollbars=1")
}

function home_search(price, sq_feet, viewAll)
{
	location.href = "home_listings.asp?price=" + price + "&sq_feet=" + sq_feet + "&viewAll=" + viewAll
}

function setText(textControlName, text)
{
	document.getElementById(textControlName).innerHTML = text;
}

function create_areamap_amenities(area)
{
	var x = 0;
	var tbl_amenities = document.getElementById("tbl_amenities");
	
	//************************************************
	var rows = tbl_amenities.rows.length;
			
	//delete all rows in table, so we can start a new table
	if (rows >= 1)
	{	
		for(var x = 1 ; x <= rows ; x ++)
		{	
			tbl_amenities.deleteRow(rows - x);
		}
	}
	//****************************
			
	var amenities;

	if( area == "one" )
	{		
		amenities = ["Olivia’s Green (central neighborhood park)", "num_1.gif", "nbr_firepit.jpg"];
	}
	else if( area == "two" )
	{
		amenities = ["Playground For All Ages", "num_2.gif", "nbr_gazebo.jpg"];
	}
	else if( area == "three" )
	{
		amenities = ["Northern Community Park & Pool", "num_3.gif", "nbr_northpark.jpg"];
	}
	else if( area == "four" )
	{
		amenities = ["Protected Wetlands", "num_4.gif", "nbr_wetlands.jpg"];
	}
	else if( area == "five" )
	{
		amenities = ["Olivia Beach Ocean Bluff", "num_5.gif", "nbr_bluff.jpg"];
	}
	else if( area == "six" )
	{
		amenities = ["Nelscott Reef Surfing", "num_6.gif", "nbr_reef.jpg"];
	}
	else if( area == "seven" )
	{
		amenities = ["Future Pathway to the Beach", "num_7.gif", "nbr_beachway.jpg"];
	}
	else if( area == "eight" )
	{
		amenities = ["Historic Nelscott Shops", "num_8.gif", "nbr_shops.jpg"];
	}
		else if( area == "nine" )
	{
		amenities = ["Walking Paths & Trails", "num_9.gif", "nbr_trails.jpg"];
	}
		else if( area == "ten" )
	{
		amenities = ["The Beach", "num_10.gif", "nbr_beach_2.jpg"];
	}
if( amenities )
	{
		//create output table rows and cells
		for (var x = 0 ; x < 2 ; x+=1)
		{
			var row = tbl_amenities.insertRow(x);//insert row at next position avail
			var cell_1 = row.insertCell(0);//insert cell at position 0
			var cell_2 = row.insertCell(1);//insert cell at position 1
			cell_2.className = 'bodytext';
			
			if( x == 0 ) 
			{
				cell_1.innerHTML = "<img src='images/" + amenities[1] + "' width='24' height='24'>"
				cell_2.innerHTML = amenities[0]
			}
			else if( x == 1 )
			{
				cell_1.innerHTML = "&nbsp;"
				cell_2.innerHTML = "<img src='images/" + amenities[2] + "'>"
			}
			
		}
	
	}
}

function clear_areamap_amenities()
{
	var tbl_amenities = document.getElementById("tbl_amenities");
	var rows = tbl_amenities.rows.length;
			
	//delete all rows in table, so we can start a new table
	if (rows >= 1)
	{	
		for(var x = 1 ; x <= rows ; x ++)
		{	
			tbl_amenities.deleteRow(rows - x);
		}
	}
}


