var CURRENT_SAVE_STATUS = "";

function PrefCurrencies()
{
	this.savePrefCurrencies = savePrefCurrencies;
	this.processFailure = processFailure;
	this.processComplete = processComplete;
	this.processException = processException;
	this.processCurrencyPrefChange = processCurrencyPrefChange;
}

function savePrefCurrencies(prefCurrency)
{
	logToWindow("savePrefCurrencies - started to save currency string: " + prefCurrency);
	var requestString ="/bzJApp/SavePreferredCurrencies.action?sid=100&tid=100&prefCurrency="+prefCurrency;
	var ajaxReq = new Ajax.Request(
			requestString,
		{ 	method: 'post', 
			onSuccess: this.processCurrencyPrefChange, 
			onFailure : this.processFailure, 
			onComplete : this.processComplete, 
			onException : this.processException 
		}
	);	
}

function processFailure(transport) {
	logToWindow("processFailure - failed. " + transport.status);
	$('currencySaveStatDiv').innerHTML = '<span>Save failed.<br />Int\351ntalo nuevamente.<br /></span>'; 
}//END: processFailure

function processComplete(transport) {
	logToWindow("processComplete - complete.");
}//END: processComplete

function processException(Req, Ex1) {
	logToWindow("processException - execption " + Ex1);
}//END: processException

function processCurrencyPrefChange(transport)
{
	logToWindow("processCurrencyPrefChange - successful. transport status: " + transport.status);
	$('currencySaveStatDiv').innerHTML = '<span>Se ha guardado la moneda.<br />Actualiza para ver<br />tu nueva configuraci\363n.</span>'; 
}