function AddReleaseToCart(ReleaseID){
 new Ajax('cart.html',
         {method:'get',
          data:Object.toQueryString({action:'add', r:ReleaseID}),
          onComplete:RefreshCartInfo
         }).request();
}

function AddFileToCart(FileID){
 new Ajax('cart.html',
         {method:'get',
          data:Object.toQueryString({action:'add', f:FileID}),
          onComplete:RefreshCartInfo
         }).request();
}

function AddToCart(Type){
 var Selection = '';
 $$('input.multicheckbox').each(function(Entry){
                            if(Entry.checked)
                             Selection=='' ? Selection = Entry.value : Selection += ','+Entry.value;
                           });
 if(Selection==''){
  alert('Please check at least one checkbox.');
  return;
 }
 
 new Ajax('cart.html',
         {method:'get',
          data:'action=add&'+Type+'='+Selection,
          onComplete:RefreshCartInfo
         }).request();
}

function CreateNZB(Type, Release){
 var Selection = '';
 $$('input.multicheckbox').each(function(Entry){
                            if(Entry.checked)
                             Selection=='' ? Selection = Entry.value : Selection += ','+Entry.value;
                           });
 if(Selection==''){
  alert('Please check at least one checkbox.');
  return;
 }
 
 window.location.href = "nzb.html?"+Type+"="+Selection+(Release>0 ? "&r="+Release : "");
}

/*
function SelectAll(){
 var checkboxes = $$('input.multicheckbox');
 for(var i=0;i<checkboxes.length;i++){
  var checkbox = $('checkbox_'+checkboxes[i].value);
  checkbox.checked = true;
 }
}

function InverseSelection(){
 var checkboxes = $$('input.multicheckbox');
 for(var i=0;i<checkboxes.length;i++){
  var checkbox = $('checkbox_'+checkboxes[i].value);
  checkbox.checked = !checkbox.checked;
 }
}
*/