var xmlHttp

//<![CDATA[ 
var map_listings = null;				 
 
var mls_num = [];  
var street_num = [];  
var street_address = [];  
var price = [];  
var beds = [];  
var baths = [];  
var sqft = [];  
var description = [];  
var vtour_link = [];  
var home_latitude = [];  
var home_longitude = [];    
var photo = [];   
var map_mls_num = '';

var i_marker_listings = 0;				var MyMarkers_listings =[];			var markers_listings =[];					var point_listings = [];
 
function load_listings(url_google) 
{ 	
 
	if (GBrowserIsCompatible()) 
	{
		map_listings = new GMap2(document.getElementById("map_listings")); 
		map_listings.addControl(new GLargeMapControl());
		map_listings.addControl(new GMapTypeControl()); 
		map_listings.setCenter(new GLatLng(32.311740, -106.782026), 12 );
		map_listings.setMapType(G_NORMAL_MAP);		
		map_listings.disableDoubleClickZoom();
		map_listings.addControl(new GOverviewMapControl());
		map_listings.addControl(new GScaleControl());
	 	 
		 
		var url_listings = url_google;
		//prompt("url_listings",url_listings);
		GDownloadUrl(url_listings, function(data) 
		{ 
			
			var xml_listings = GXml.parse(data);
			
			markers_listings = xml_listings.documentElement.getElementsByTagName("markers_listing");
			//alert(markers_listings.length);
			var current_id_listings;  
			for (i_marker_listings = 0; i_marker_listings < markers_listings.length; i_marker_listings++) 
			{
				 
				current_id_listings 							= markers_listings[i_marker_listings].getAttribute("mls_num");
				mls_num[current_id_listings] 					= markers_listings[i_marker_listings].getAttribute("mls_num");
				street_num[current_id_listings] 				= markers_listings[i_marker_listings].getAttribute("street_num");
				street_address[current_id_listings] 			= markers_listings[i_marker_listings].getAttribute("street_address");
				price[current_id_listings] 						= markers_listings[i_marker_listings].getAttribute("price"); 
				beds[current_id_listings] 						= markers_listings[i_marker_listings].getAttribute("beds");
				baths[current_id_listings] 						= markers_listings[i_marker_listings].getAttribute("baths");
				sqft[current_id_listings] 						= markers_listings[i_marker_listings].getAttribute("sqft");
				description[current_id_listings] 				= markers_listings[i_marker_listings].getAttribute("description"); 
				vtour_link[current_id_listings] 				= markers_listings[i_marker_listings].getAttribute("vtour_link");
				home_latitude[current_id_listings] 				= markers_listings[i_marker_listings].getAttribute("home_latitude");
				home_longitude[current_id_listings] 			= markers_listings[i_marker_listings].getAttribute("home_longitude"); 		
				photo[current_id_listings] 						= markers_listings[i_marker_listings].getAttribute("photo"); 
				  
				point_listings[current_id_listings] 		= new GLatLng(home_latitude[current_id_listings],-home_longitude[current_id_listings],false);
				MyMarkers_listings[current_id_listings] 	= createMarker_listings(point_listings[current_id_listings],	mls_num[current_id_listings],	street_num[current_id_listings],	street_address[current_id_listings],	price[current_id_listings],	beds[current_id_listings],	baths[current_id_listings],	sqft[current_id_listings],	description[current_id_listings] ,	vtour_link[current_id_listings],	home_latitude[current_id_listings],	home_longitude[current_id_listings],	photo[current_id_listings], current_id_listings);
				
				map_listings.addOverlay(MyMarkers_listings[current_id_listings]);
			}
		});
		 
	}
	
}
function createMarker_listings(point_listings, mls_num, street_num, street_address, price, beds, baths, sqft, description , vtour_link, home_latitude, home_longitude, photo, current_id_listings) 
{
  
	var icon_listings 					= new GIcon();
    icon_listings.image 				 =  "http://www.lascrucesdreamteam.com/listings/google_maps/images/flag.png";
    icon_listings.shadow 				 =  "http://www.lascrucesdreamteam.com/listings/google_maps/images/shadow-flag.png";
    icon_listings.iconSize 				= new GSize(35.0, 35.0);
    icon_listings.shadowSize 			= new GSize(53.0, 35.0);
    icon_listings.iconAnchor 			= new GPoint(17.0, 17.0);
    icon_listings.infoWindowAnchor 		= new GPoint(17.0, 17.0);
	
 	//alert(mls_num);
	
	var marker_listings = new GMarker(point_listings, icon_listings);
	var info 	= "<b>MLS #:  " + mls_num +  "</b><br/>Price:  $" + price + "</b><br/>Beds:  " + beds+ "</b><br/>Baths:  " + baths + "</b><br/>Sq Ft:  " + sqft + "</b><br/>" + street_num + " " + street_address + "<br/><br/><a href=\"javascript:activateWindowListing('../residential/"+ mls_num +"/');\">View More &raquo;</a>";
    var photo2 	= "<center><a href='http://www.steinborn.com/listings/listing.php?num="+ mls_num +"','" + street_num + " " + street_address + "');' target='_blank'><img src='" + photo + "' width='250' border='0'  /></a><br></center>";
   // var desc 	= "<b>description</b>";
    
	var infoTabs = [
          new GInfoWindowTab("Info", "test"),
          new GInfoWindowTab("Photo", "test"),
         // new GInfoWindowTab("Description", desc) 
        ];
	
	GEvent.addListener(marker_listings, 'click', function() 
	{
		marker_listings.openInfoWindowHtml(info);
		map_listings.setCenter(point_listings, 14,G_NORMAL_MAP);
	}); 
		
	return marker_listings;
}

function map_listing(map_mls_num) 
{
	GEvent.trigger(MyMarkers_listings[map_mls_num], "click");
	map_listings.setCenter(point_listings[map_mls_num], 14,G_NORMAL_MAP);
}

/* functions

validation
//////////////////////////////////////////

function validate_neighborhood_alert(form)
function validate_share_listing(form) 

AJAX/Other
//////////////////////////////////////////

function removeMyHome(account_system_num,mls_num)
function updateRank(rating,account_system_num,mls_num)
function clearDiv(mls_num
function compareHome(account_system_num,mls_num)
function updateCompareHome(account_system_num,mls_num)
function compareHomePopup(account_system_num,mls_num)
function drivingRoute(account_system_num,mls_num)
function removedrivingRoute(account_system_num,mls_num)
function toggle_map()
function toggle_street_options(thisCheckbox)
function showMyHome(thisCheckbox)
function toggle_text_alert(thisCheckbox)

*/
function validate_share_listing(form) 
{
	var e = form.elements, m = '';
	
	if(!e['first_name'].value) 
	{
		m += '- Your First name is required.\n\n';
	}
	if(!e['email'].value) 
	{
		m += '- Your email is required.\n\n';
	}
	if(e['email'].value) 
	{
		var str = e['email'].value;
		var reg = new RegExp("([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})");
				
		if (!reg.test(str))
		{
			m += '- Your E-Mail address is not valid.\n\n';
		}
	}
	if(!e['recipients_first_name'].value) 
	{
		m += '- Recipient\'s First name is required.\n\n';
	}
	if(!e['message'].value) 
	{
		m += '- Message is required.\n\n';
	}
	if(!e['recipients_email'].value) 
	{
		m += '- Recipient\'s email is required.\n\n';
	}
	if(e['recipients_email'].value) 
	{
		var str = e['recipients_email'].value;
		var reg = new RegExp("([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})");
				
		if (!reg.test(str))
		{
			m += '- Recipient\'s E-Mail address is not valid.\n\n';
		}
	}
	if(m) 
	{
		alert('The following error(s) occurred:\n\n' + m);
		return false;
	}
	return true;
}

function validate_neighborhood_alert(form) 
{
	var e = form.elements, m = '';
		 
	 
	if(e['receive_na_listings_txt'].checked) 
	{			
		var str = e['na_txt_phone_num'].value;
		var reg = new RegExp("[1-9][0-9]{9}");
		
		if (!reg.test(str))
		{
			m += '- Cell Number must be 10 digits and no other characters.\n\n';
		}	
	}
	
	if(m) 
	{
		alert('The following error(s) occurred:\n\n' + m);
		return false;
	}
	return true;
}

//////	AJAX	//////////////////////////////////////////////////////////////////////////////////////////////

function updateRank(include_url,rating,account_system_num,mls_num)
{
	xmlHttp = GetXmlHttpObject();

	if(xmlHttp == null)
	{
		alert("Browser does not support HTTP Request");
		return;
	} 
	if(account_system_num == "")
	{
		alert("Please Login or Create a VIP Account To Rate This Home");
		return;
	} 
	var   url=include_url+"/modules/mls/assets/php/update_rank.php"
	url	= url+"?account_system_num="+ account_system_num
	url	= url+"&mls_num="+ mls_num
	url	= url+"&rating="+ rating 
	url	= url+"&sid="+Math.random()
	 
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4)
		{ 
			//document.getElementById('mls_rating_' + mls_num).innerHTML = xmlHttp.responseText; 
			//setTimeout("clearDiv('"+mls_num+"')",5000);
			rating = rating * 25;
			document.getElementById('current_rating_'+ mls_num).style.width = rating+'px';
				
			if(rating != 0)
			{
				document.getElementById('no_rating_' + mls_num).style.display = 'block';
			}
			else
			{
				document.getElementById('no_rating_' + mls_num).style.display = 'none';
			}
		}  
	}   
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null); 
} 
 
function clearDiv(mls_num)  
{
	document.getElementById('mls_rating_' + mls_num).innerHTML = ""; 
}
function saveHome(include_url,account_system_num,mls_num)
{
	xmlHttp = GetXmlHttpObject();

	if(xmlHttp == null)
	{
		alert("Browser does not support HTTP Request");
		return;
	} 
	if(account_system_num == "")
	{
		alert("Please Login or Create a VIP Account To Save This Home.");
		return;
	} 
	
	var   url=include_url+"/modules/mls/assets/php/save_homes.php"
	url	= url+"?account_system_num="+ account_system_num
	url	= url+"&mls_num="+ mls_num 
	url	= url+"&sid="+Math.random()
	
	//prompt ("",url)
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4)
		{ 
			var is_saved_home = xmlHttp.responseText; 
			if(is_saved_home != 0)
			{				
				alert("You have already saved this home.");
				return;
			}  
			else
			{
				document.getElementById('sh_' + mls_num).innerHTML = '<a href="javascript:removeMyHome(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result"><img src="'+include_url+'/modules/mls/assets/files/icons/save_icon_checked.jpg" alt="Already Saved to My Homes" width="20" height="40" border="0" /></a>';
				document.getElementById('sh_change_' + mls_num).innerHTML = '<a href="javascript:removeMyHome(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result">Unsave Home</a>';				
				//alert("Your home has been saved.");
				return;
			}  
		}  
	}   
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null); 
}
function removeMyHome(include_url,account_system_num,mls_num)
{
	xmlHttp = GetXmlHttpObject();

	if(xmlHttp == null)
	{
		alert("Browser does not support HTTP Request");
		return;
	} 
	/*
	if (!confirm("Are you sure you want to delete this home from your saved homes?"))
	{
		return;
	}
	*/
	var   url=include_url+"/modules/mls/assets/php/remove_home.php"
	url	= url+"?account_system_num="+ account_system_num
	url	= url+"&mls_num="+ mls_num 
	url	= url+"&sid="+Math.random()
	
	//prompt ("",url)
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4)
		{ 			
			document.getElementById('sh_' + mls_num).innerHTML = '<a href="javascript:saveHome(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result"><img src="'+include_url+'/modules/mls/assets/files/icons/save_icon.jpg" alt="Add to My Homes" width="20" height="40" border="0" /></a>';
			document.getElementById('sh_change_' + mls_num).innerHTML = '<a href="javascript:saveHome(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result">Save Home</a>';							
			//alert("Your home has been Unsaved.");
	   		//document.getElementById('mls_num_' + mls_num).style.display = 'none';
			return; 
		}  
	}   
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null); 
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//		Compare Functions
// 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function compareHome(include_url,account_system_num,mls_num)
{
	xmlHttp = GetXmlHttpObject();

	if(xmlHttp == null)
	{
		alert("Browser does not support HTTP Request");
		return;
	} 
	if(account_system_num == "")
	{
		alert("Please Login or Create a VIP Account To Compare This Home.");
		return;
	} 
	if(mls_num == "")
	{
		activateWindowCompare(include_url+"/modules/mls/assets/content/compare.php");
		return;
	}  
	var   url=include_url+"/modules/mls/assets/php/compare_homes.php"
	url	= url+"?account_system_num="+ account_system_num
	url	= url+"&mls_num="+ mls_num 
	url	= url+"&sid="+Math.random()
	
	//prompt ("",url)
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4)
		{ 
			var is_compared_home = xmlHttp.responseText; 
			
			/*
			if(is_compared_home == 0)
			{				
				alert("You must first do a home search to choose the homes you'd like to compare.");
				return;
			}			
			*/
			if(is_compared_home != 0)
			{				
				document.getElementById('ch_' + mls_num).innerHTML = '<a href="javascript:compareHomePopup(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result"><img src="'+include_url+'/modules/mls/assets/files/icons/compare_icon_checked.jpg" alt="Already Compared" width="20" height="40" border="0" /></a>';
				document.getElementById('ch_change_' + mls_num).innerHTML = '<a href="javascript:compareHomePopup(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result">View Compared</a>';				
				
				return;
			}			
			else
			{
				document.getElementById('ch_' + mls_num).innerHTML = '<a href="javascript:compareHomePopup(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result"><img src="'+include_url+'/modules/mls/assets/files/icons/compare_icon_checked.jpg" alt="Already Compared" width="20" height="40" border="0" /></a>';
				document.getElementById('ch_change_' + mls_num).innerHTML = '<a href="javascript:compareHomePopup(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result">View Compared</a>';								
			
				return;
			}  
		}  
	}   
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null); 
}

function compareHomePopup(include_url,account_system_num,mls_num)
{
	xmlHttp = GetXmlHttpObject();

	if(xmlHttp == null)
	{
		alert("Browser does not support HTTP Request");
		return;
	} 
	if(account_system_num == "")
	{
		alert("Please Login or Create a VIP Account To Compare This Home.");
		return;
	} 
	if(mls_num == "")
	{
		activateWindowCompare(include_url+"/modules/mls/assets/content/compare.php");
		return;
	}  
	var   url=include_url+"/modules/mls/assets/php/compare_homes.php"
	url	= url+"?account_system_num="+ account_system_num
	url	= url+"&mls_num="+ mls_num 
	url	= url+"&sid="+Math.random()
	
	//prompt ("",url)
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4)
		{ 
			var is_compared_home = xmlHttp.responseText; 
			
			if(is_compared_home == 0)
			{				
				alert("You must first do a home search to choose the homes you'd like to compare.");
				return;
			}	
			if(is_compared_home != 0)
			{
				
				document.getElementById('ch_' + mls_num).innerHTML = '<a href="javascript:compareHome(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result"><img src="'+include_url+'/modules/mls/assets/files/icons/compare_icon_checked.jpg" alt="Already Compared" width="20" height="40" border="0" /></a>';
				document.getElementById('ch_change_' + mls_num).innerHTML = '<a href="javascript:compareHome(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result">View Compared</a>';				
				
				activateWindowCompare(include_url+"/modules/mls/assets/content/compare.php");				
				return;
			}			
			else
			{
				document.getElementById('ch_' + mls_num).innerHTML = '<a href="javascript:compareHome(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result"><img src="'+include_url+'/modules/mls/assets/files/icons/compare_icon_checked.jpg" alt="Already Compared" width="20" height="40" border="0" /></a>';
				document.getElementById('ch_change_' + mls_num).innerHTML = '<a href="javascript:compareHome(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result">View Compared</a>';								
				
				activateWindowCompare(include_url+"/modules/mls/assets/content/compare.php");
				return;
			}  
		}  
	}   
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null); 
} 
function updateCompareHome(include_url,account_system_num,mls_num)
{
	xmlHttp = GetXmlHttpObject();

	if(xmlHttp == null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}  
	if(mls_num != '')
	{
		if (!confirm("Are you sure you want to delete this home from your compare list?"))
		{
			return;
		}
	}
	
	var   url=include_url+"/modules/mls/assets/php/update_my_compared_homes.php"
	url	= url+"?account_system_num="+ account_system_num
	url	= url+"&mls_num="+ mls_num 
	url	= url+"&sid="+Math.random()
	
	//prompt ("",url)
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4)
		{  
			document.getElementById('mls_compare_homes').innerHTML = xmlHttp.responseText;			
		}  
	}   
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null); 
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//		END Compare Functions
// 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function drivingRoute(include_url,account_system_num,mls_num)
{
	xmlHttp = GetXmlHttpObject();
	if(account_system_num == "")
	{
		alert("Please Login or Create a VIP Account To Add To Driving Route.");
		return;
	} 
	if(xmlHttp == null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}  
	var   url=include_url+"/modules/mls/assets/php/driving_route.php" 
	url	= url+"?mls_num="+ mls_num 
	url	= url+"&sid="+Math.random()
	
	//prompt ("",url)
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4)
		{ 
			var already_added = xmlHttp.responseText; 
			//alert(already_added);
			if(already_added == 0)
			{
				document.getElementById('dr_' + mls_num).innerHTML = '<a href="javascript:removedrivingRoute(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result"><img src="'+include_url+'/modules/mls/assets/files/icons/driving_route_icon_checked.jpg" alt="Already Added to Driving Route" width="20" height="40" border="0" /></a>';
				document.getElementById('dr_change_' + mls_num).innerHTML = '<a href="javascript:removedrivingRoute(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result">Remove From My<br />Driving Route</a>';
				//alert("This home has been added to your driving route.");
				return;
			}
			else
			{
				alert("This home has already been added to your driving route.");				
				return;
			}
		}  
	}   
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null); 
}    
function removedrivingRoute(include_url,account_system_num,mls_num)
{
	xmlHttp = GetXmlHttpObject();

	if(xmlHttp == null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}  
	/*
	if(mls_num != '')
	{
		if (!confirm("Are you sure you want to delete this listing from your driving route?"))
		{
			return;
		}
	}
	*/
	var   url=include_url+"/modules/mls/assets/php/update_driving_route.php" 
	url	= url+"?mls_num="+ mls_num 
	url	= url+"&sid="+Math.random()
	
	//prompt ("",url)
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4)
		{  
			var thing = xmlHttp.responseText;
			document.getElementById('dr_' + mls_num).innerHTML = '<a href="javascript:drivingRoute(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result"><img src="'+include_url+'/modules/mls/assets/files/icons/driving_route_icon.jpg" alt="Add to Driving Route" width="20" height="40" border="0" /></a>';
			document.getElementById('dr_change_' + mls_num).innerHTML = '<a href="javascript:drivingRoute(\''+include_url+'\','+account_system_num+','+mls_num+');"  class="mls_result">Add to My<br />Driving Route</a>';							
			//alert("Your listing has been removed from your driving route.");
		}  
	}   
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null); 
} 

function toggle_map()
{
	if (document.getElementById('mls_map_row').style.display == 'block')
	{
		//This closes
		
		xmlHttp = GetXmlHttpObject();

		if(xmlHttp == null)
		{
			alert("Browser does not support HTTP Request");
			return;
		} 
		
		//var   url="../../listings/includes/mls/ajax_php/session_map.php"
		var   url="../php/session_map.php"
		url	= url+"?type=closed" 
		url	= url+"&sid="+Math.random()
		 
		xmlHttp.onreadystatechange = function()
		{
			if(xmlHttp.readyState == 4)
			{ 
				document.getElementById('mls_map_row').style.display = 'none';
				document.getElementById('mls_map_row_arrow_open').style.display = 'block';
				document.getElementById('mls_map_row_arrow_close').style.display = 'none';
			}  
		}   
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);    
	}
	else
	{	
		//This opens
		xmlHttp = GetXmlHttpObject();

		if(xmlHttp == null)
		{
			alert("Browser does not support HTTP Request");
			return;
		} 
		
		//var   url="../../listings/includes/mls/ajax_php/session_map.php"
		var   url="../php/session_map.php"
		url	= url+"?type=open" 
		url	= url+"&sid="+Math.random()
		 
		xmlHttp.onreadystatechange = function()
		{
			if(xmlHttp.readyState == 4)
			{ 
				document.getElementById('mls_map_row').style.display = 'block';
				document.getElementById('mls_map_row_arrow_open').style.display = 'none';
				document.getElementById('mls_map_row_arrow_close').style.display = 'block';
			}  
		}   
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null); 
		
	} 
} 
function toggle_street_options(thisCheckbox) 
{
 	if (thisCheckbox.checked) 
	{  
		document.getElementById("street_text_field").style.display = 'block';
		document.getElementById("street_select").style.display = 'none';
    }
	else 
	{
		document.getElementById("street_text_field").style.display = 'none';		
		document.getElementById("street_select").style.display = 'block';
	}
}
 
function showMyHome(thisCheckbox) 
{
 	if (thisCheckbox.checked) 
	{  
		document.getElementById("my_home_title").style.display = 'block';
		document.getElementById("my_home_photo").style.display = 'block';
		document.getElementById("my_home_address").style.display = 'block';
		document.getElementById("my_home_mls_num").style.display = 'block';
		document.getElementById("my_home_price").style.display = 'block';
		document.getElementById("my_home_beds").style.display = 'block';
		document.getElementById("my_home_baths").style.display = 'block';
		document.getElementById("my_home_garages").style.display = 'block';
		document.getElementById("my_home_fireplaces").style.display = 'block';
		document.getElementById("my_home_sqft").style.display = 'block';
		document.getElementById("my_home_lot_size").style.display = 'block';
		document.getElementById("my_home_address1").style.display = 'block';
		document.getElementById("my_home_address2").style.display = 'block';
		document.getElementById("my_home_area").style.display = 'block';
		document.getElementById("my_home_landscape").style.display = 'block';
		document.getElementById("my_home_structure").style.display = 'block';
		document.getElementById("my_home_year_built").style.display = 'block';
		document.getElementById("my_home_class").style.display = 'block';
		document.getElementById("my_home_type").style.display = 'block';
		document.getElementById("my_home_style").style.display = 'block';
		document.getElementById("my_home_vt").style.display = 'block';
		document.getElementById("my_home_description").style.display = 'block';
		document.getElementById("my_home_courtesy").style.display = 'block'; 
		
    }
	else 
	{
		document.getElementById("my_home_title").style.display = 'none';
		document.getElementById("my_home_photo").style.display = 'none';
		document.getElementById("my_home_address").style.display = 'none';
		document.getElementById("my_home_mls_num").style.display = 'none';
		document.getElementById("my_home_price").style.display = 'none';
		document.getElementById("my_home_beds").style.display = 'none';
		document.getElementById("my_home_baths").style.display = 'none';
		document.getElementById("my_home_garages").style.display = 'none';
		document.getElementById("my_home_fireplaces").style.display = 'none';
		document.getElementById("my_home_sqft").style.display = 'none';
		document.getElementById("my_home_lot_size").style.display = 'none';
		document.getElementById("my_home_address1").style.display = 'none';
		document.getElementById("my_home_address2").style.display = 'none';
		document.getElementById("my_home_area").style.display = 'none';
		document.getElementById("my_home_landscape").style.display = 'none';
		document.getElementById("my_home_structure").style.display = 'none';
		document.getElementById("my_home_year_built").style.display = 'none';
		document.getElementById("my_home_class").style.display = 'none';
		document.getElementById("my_home_type").style.display = 'none';
		document.getElementById("my_home_style").style.display = 'none';
		document.getElementById("my_home_vt").style.display = 'none';
		document.getElementById("my_home_description").style.display = 'none';
		document.getElementById("my_home_courtesy").style.display = 'none'; 
	}
} 
function toggle_text_alert(thisCheckbox)
{

 	if (thisCheckbox.checked) 
	{  
		document.getElementById("cell_number").style.display = 'block';
    }
	else 
	{
		document.getElementById("cell_number").style.display = 'none';		
	}
} 
function activateWindow(url)
{ 
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: true,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: '<b>Las Cruces Dream Team</b>',
			'href'			: url,
			'type'			: 'iframe'
			
		});

}
function activateWindowIndex(url)
{ 
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: true,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: '<b>Las Cruces Dream Team</b>',
			'href'			: url,
			'type'			: 'iframe'
			
		});
}
function activateWindowListing(url,title_listing)
{ 
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: true,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: title_listing,
			'href'			: url,
			'type'			: 'iframe'
			
		});
}
function activateWindowCompare(url)
{ 
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: true,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'width'			: '930',
			'height'		: '600',
			'title'			: '<b>Las Cruces Dream Team</b>',
			'href'			: url,
			'type'			: 'iframe'
			
		});
}
function activateWindowCompareMyHome(url)
{ 
	$.fancybox({
		'padding'		: 0,
		'autoScale'		: true,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none',
		'title'			: '<b>Las Cruces Dream Team</b>',
		'href'			: url,
		'type'			: 'iframe'
		
	});
}
function activateWindowShareListing(url,account_system_num)
{
	if(account_system_num == '')
	{
		alert("Please Login or Create an Account to Share This Home");
		return;
	} 
	else
	{
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: true,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: '<b>Las Cruces Dream Team</b>',
			'href'			: url,
			'type'			: 'iframe'
			
		});
	}
}
function activateWindowRental(url,rental_address)
{ 
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: true,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: rental_address,
			'href'			: url,
			'type'			: 'iframe'
			
		});
}
function activateWindowLand(url,land_title)
{ 
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: true,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: land_title,
			'href'			: url,
			'type'			: 'iframe'
			
		});
}
function activateWindowCommunity(url,community_title)
{ 
	$.fancybox({
		'padding'		: 0,
		'autoScale'		: true,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none',
		'title'			: community_title,
		'href'			: url,
		'type'			: 'iframe'
		
	});
}
function activateWindowAgent(url,realtor)
{ 
	Shadowbox.open({
		type: 'iframe',
		title: realtor,
		content: url, 
		width: '900', 
		height: '525' 
	});
}
function activateWindowRCpopUp(url)
{ 
	Shadowbox.open({
		type: 'iframe',
		title: "<b>Las Cruces Dream Team</b>",
		content: url, 
		width: '540', 
		height: '394'  
	});
}
function activateWindowSetUpApptResidential(url,account_system_num)
{ 
	Shadowbox.open({
		type: 'iframe',
		title: account_system_num,
		content: url, 
		width: '800',  
		height: '525' 
	});
}
function GetXmlHttpObject(){var xmlHttp=null;try{ xmlHttp=new XMLHttpRequest();}catch (e){ try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}return xmlHttp;}
