var map = null;
window.onload = function () {
	if (property_sold) {
		addSoldSign();
	}

	map = new VEMap('minimap');
	map.onLoadMap = function () {
		map.Find(null, prop_street+' '+prop_city+', '+prop_state+' '+prop_zip, null, null, null, null, null, null, null, null, addPinCenter);		
	};
	map.LoadMap();
	map.ShowDisambiguationDialog(false);
}

function neighborhoodMap () {
	window.location.href = '/property/neighborhood/?property=' + prop_id;
};

function addPinCenter (result) {
	var shape = new VEShape(VEShapeType.Pushpin, map.GetCenter());                                 
	
	shape.SetTitle('<strong>'+prop_title+'</strong>');         
	shape.SetDescription(prop_details+'<br />'+prop_street+'<br />'+prop_city+', '+prop_state+' '+prop_zip);                  
	
	//Add the shape the the map        
	map.AddShape(shape);
}

function addSoldSign () {
	// creates and displays a "SOLD" div over the big image container
	var _big_image = document.getElementById("big_image");
	
	var _sold = document.createElement("div");
	_sold.className = "sold_div";
	_sold.innerHTML = property_sold;
	_sold.style.position = "absolute";
	_sold.style.left = (_big_image.offsetLeft + 1) + "px";
	_sold.style.top = (_big_image.offsetTop + 228) + "px";
	
	// attach that junk
	document.body.appendChild(_sold);
}
