dojo.require("dojo.io.*");
function addToEditorsList(cid) {
  var bindArgs = {
    url: "/ajax_editor_add_cover_item.php?cid="+cid,
    mimetype: "application/json",
    //admittedly load and error do the same thing.
    //maybe this should just be 'handle'?
    load: function(type, data, evt){
/*      alert(eval(data.messages)); */
alert("Success: " + eval(data.messages));
    }, 
    error: function(type, data, evt){
/*      alert(eval(data.messages)); */
alert("Error: " + eval(data.messages));
    },
    timeout: function() {
      alert('The server is not responding. You should tell Jim: jruga\@salon.com.');
    },
    timeoutSeconds: 10
  };
var request = dojo.io.bind(bindArgs);
}

function removeFromEditorsList(cid) {
  var bindArgs = {
    url: "/ajax_editor_add_cover_item.php?cid="+cid+"&remove=1",
    mimetype: "application/json",
    //admittedly load and error do the same thing.
    //maybe this should just be 'handle'?
    load: function(type, data, evt){
/*      alert(eval(data.messages)); */
alert("Success: " + eval(data.messages));
    }, 
    error: function(type, data, evt){
/*      alert(eval(data.messages)); */
alert("Error: " + eval(data.messages));
    },
    timeout: function() {
      alert('The server is not responding. You should tell Jim: jruga\@salon.com.');
    },
    timeoutSeconds: 10
  };
var request = dojo.io.bind(bindArgs);
}
