// custom AJAX functions go here


/* this is a generic Ajax function which accepts
 * - the name/object of the calling element
 * - the url PHP script which will be executed
 */
var divPrefix = 'ajaxResult';
function callAjax(element, _name, unique) {
	//alert("callAjax: name: " + _name + ", val: " + $F(element) + ", unique: " + unique);
	var params = 'arg0=' + $F(element);
	var url = "ajax_" + _name + ".php";
	var ajax = new Ajax.Updater(
		{success: divPrefix + _name},
		url,
		{method: 'get', parameters: params, onFailure: reportError});
}

function reportError(request) {
	$F(divPrefix + "get_photo") = "Error";
}
