// All of these functions relate to dynamically adding a property to a list or RFP

// called when user selects an rfp to add a property to in the add-to flopup
function addToRfp(prop_id)
{
	if ( prop_id )
	{
		if (!xmlh_lock)
		{
			xmlh_lock = true;
			xmlh_queryPost("/ajax/addPropToRfp.php", "prop_id="+prop_id, addToRfpDone);
		}
	}
}


// callback from addPropToRfp()
function addToRfpDone(response)
{
	var data = eval('(' + response + ')');
	xmlh_lock = false;

	if ( !data["success"] )
	{
		alert(data["msg"]);
		xmlh_lock = false;
		return;
	}


	var oDiv = document.getElementById("in_rfp_"+data["prop_id"]);
	if ( oDiv ) oDiv.className = "in_rfp";

	if ( typeof refreshPanelContents == 'function')
	{ 
		refreshPanelContents(data["prop_id"]);
		openPanel();
	}

	// make sure panel list is refreshed
	if ( typeof refreshPanelList == 'function') refreshPanelList(false);
}
