window.onload = init;

function init()
{
   if(document.forms && document.forms.remove && document.forms.remove.mangle == 'Remove selected')
   {
      document.forms.remove.onsubmit = removeItem;
   }
   // alert(document.cookie);
}

function removeItem()
{
   var checked = 0;
   for(var i = 0; i < this.elements.length; i++)
   {
      if(this.elements[i].type.toLowerCase() == 'checkbox')
      {
	 if(this.elements[i].checked)
	 {
	    checked++;
	 }
      }
   }
   if(checked == 0)
   {
      this.innerHTML = '<p><strong>Error</strong>: No item selected for removal</p>' + this.innerHTML;
      return false;
   }
}
