//Global object to be used for scope problems
var obj;
var prop_id;
var progress_win;
var hisDiv;

var args = ['foo','bar','ddd'];
var responseSuccess = function(o){
	var resultDiv = eval('document.getElementById(\'result'+prop_id+'\')');
	var histDiv = eval('document.getElementById(\'his'+prop_id+'\')');
	if(resultDiv){
		resultDiv.innerHTML = o.responseText;
		strip_response(o.responseText);
	}
	if(histDiv){
		histDiv.innerHTML = o.responseText;
		strip_response(o.responseText);
	}
	
};
var responseFailure = function(o){
}
var callback =
{
  success:responseSuccess,
  failure:responseFailure,
  argument:args
};

function strip_response(stext)
{
	var htstring = stext;
	var stripped = htstring.replace(/(<([^>]+)>)/ig,"");
	alert(stripped);
}

function handleSave(property_id){
	prop_id=property_id;
	var tmpUrl = urlSaveProp + "?property_id="+property_id;
	var transaction = YAHOO.util.Connect.asyncRequest('GET', tmpUrl, callback);
}


var clearHistoryCallback =
{
  success: function(o){
	var myAnim = new YAHOO.util.Anim(document.getElementById('area_history').id, {  
			opacity: { from:100, to: 0 }
			}, 0.5, YAHOO.util.Easing.easeIn);
	myAnim.animate();
	setTimeout("document.getElementById('area_history').style.display = 'none'",1000);
  },
  failure:function(o){},
  argument:args
};

function HandleClearHistory()
{
	url = clhURL;
	var transaction = YAHOO.util.Connect.asyncRequest('GET', url, clearHistoryCallback);	
}

