function onFolderSort() {
	new Ajax.Request('index.php?c=sort/all&id=' + id + '&w=' + what,
		{ parameters: Sortable.serialize('pages'), onSuccess: onFolderSortSuccess, onFailure: onAjaxFailure } );
}

function onFolderSortSuccess(r) {
	if (r.responseText != '')
		return onAjaxFailure(r);
	new Effect.Highlight('pages', { restorecolor: '#fffff' });
}

function onAjaxFailure(r) {
	alert(r.responseText);
}

function flash(id) {
	try {
		new Effect.Highlight('page_' + id, { duration: 2.0 });
	} catch (e) {
	}
}

// Votazione contributi

function loadVotes(url) {
	//document.getElementById('ticker').innerHTML = 'loading...';
	new Ajax.Request(url,
		{ onSuccess: function(r) { onVotesLoaded(r) } }
	);
}

function onVotesLoaded(r) {
	if (r.responseText != '')
		document.getElementById('votes').innerHTML = r.responseText;
}
