function deleteCollection(collection)
{
    params = "id=" + collection;
    cname = "c" + collection;
    ask = confirm("Are you sure?");
    if(ask == true)
    {
        new Ajax.Request('/codebin/v2/system/collections/delete_collection.php', 
        {asynchronous:true, method:'post', postBody:params, onSuccess:function(){Effect.DropOut(cname);}});
    }
    
}

function toggleCollections(id)
{
    c = document.getElementById(id);
    if(c.className == "hide")
        c.className = "show";
    else
        c.className = "hide";
}

function add2collection(item, id, search)
{
    params = "item=" + item + "&id=" + id;
    whereto = "http://www.gnosh.org/view.php?type=myGnosh&mygnosh=collections&search=" + search;
    
    new Ajax.Request('/codebin/v2/system/collections/add2collection.php', 
    {asynchronous:true, method:'post', postBody:params, onSuccess:function(){window.location.href=whereto;}});
}

function shrink()
{
    trash = document.getElementById("trash");
    new Effect.Shrink(trash.childNodes[0]);
        
    params = "item=" + trash.childNodes[0].getAttribute('id');
        
    new Ajax.Request('/codebin/v2/system/collections/delete_item.php', 
    {asynchronous:true, method:'post', postBody:params, onSuccess:function(){trash.removeChild(trash.childNodes[0]);}});
}