/*

Script to swap between the map and sales list views

*/
$(document).ready(function() {
													 
		function hideAll() {
				$("#about_homes").hide();
				$("#legend").hide();
				$("#sales_list").hide();
		}
		
		// when 'list_link' is clicked
		$(".list_link").click(function() {
				hideAll();
				$("#sales_list").fadeIn();
				return false;				
		});
		
		// when 'map_link' is clicked
		$(".legend_link").click(function() {
				hideAll();
				$("#legend").fadeIn();
				return false;
		});
		
		// when about link is clicked
		$(".about_link").click(function() {
				hideAll();
				$("#about_homes").fadeIn();
				return false;
		});
		
		//map links for SOLDs
		$(".map_sold").click(function() {
				//alert('this is SOLD!');
				return false;
		});
		
		
		// decide which to show first
		//alert ($(document).getUrlParam("show"));
		if ( $(document).getUrlParam("show") == 'map') {;
				hideAll();
				$("#legend").fadeIn();
		} else if ( $(document).getUrlParam("show") == 'about') {;
				hideAll();
				$("#about_homes").fadeIn();
		} else {
				//default is:
				$("#legend").hide();
				$("#about_homes").hide();
		}
		
		//$("area.sold")
		

																			
		
});