function update_image_order() {
  var options = {
                  method: 'post',
		  parameters: Sortable.serialize('project_images')
		};
  new Ajax.Request('/admin/update_image_order.php', options);
}

window.onload = function() {
  var as = document.getElementsByTagName('a');
  for (i=0; i < as.length; i++) {
    if (as[i].className == 'delete_link') {
      as[i].onclick = function() {
        return(window.confirm("Are you sure you wish to delete this item?\n\nPress OK to continue."));
      }
    }
  }
  if (document.getElementById('project_images')) {
    Sortable.create('project_images', { onUpdate: update_image_order });
  }
}

