function doRemoveItems (f, type, plural, nameRestrict) 
{
    var base = './lib/actions.php?&type=' + type;
    var url = '';
    var e = f.id;
    if (!e) return;
    if (e.value && e.checked)
        url += '&id=' + e.value;
    else
	if (nameRestrict) 
	{
	    for (i=0; i<e.length; i++)
        	if (e[i].checked && (e[i].name == nameRestrict))
                    url += '&id=' + e[i].value;
	} else 
	{
	    for (i=0; i<e.length; i++)
        	if (e[i].checked)
                    url += '&id' + i + '=' + e[i].value;
	}
    if (!url) 
    {
        alert('You did not select any ' + plural + ' to delete.');
        return false;
    }
    url = base + url;
    var conf = confirm ('are you sure you want to delete these items? This action is not undoable.');
    if (conf)
    	window.location = url
    else	
    	window.location("./login_index.php")
    //window.open(url, 'confirm_delete', 'width=370,height=250,scrollbars=yes');
}

