
function showabbr()
   {
   window.open('/trailtype.html','Sample','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=250,height=260');
   }

function getid(id)
   {
   if(document.getElementById) return document.getElementById(id);
   else if(document.all) return document.all[id];
   else if(document.layers) return document.layers[id];
   else return document.id;
   }
   
function selectthis(id,me)
   {
   theform = getid(id);
   for(x=0;x<theform.SEND.length;x++) 
      { 
      if(theform.SEND[x].value == me) 
         theform.SEND[x].checked = 1; 
      else 
         theform.SEND[x].checked = 0;
      } 
   }

function selectsomething(id,me)
   {
   theform = getid(id);
   for(x=0;x<theform.UNTIL.length;x++) 
      { 
      if(theform.UNTIL[x].value == me) 
         theform.UNTIL[x].checked = 1; 
      else 
         theform.UNTIL[x].checked = 0;
      } 
   }

function selectsomethingelse(id,notme)
   {
   theform = getid(id);
   for(x=0;x<theform.UNTIL.length;x++) 
      { 
      if(theform.UNTIL[x].value == notme
      && theform.UNTIL[x].checked) 
         {
         theform.UNTIL[x].checked=0; 
         if(x==0) theform.UNTIL[1].checked=1;
         else theform.UNTIL[0].checked=1;
         }
      }
   }

function unselecttheany(id,me) //unselect the 'any' value
   {
   theform = getid(id);
   if (me.checked == true) 
      {
      for(i=0; i<theform.elements.length; i++) 
         { 
         if(theform.elements[i].type == "checkbox" 
         && theform.elements[i].value == "ANY") 
            theform.elements[i].checked = false; 
         } 
      }   
   return true;
   }


function unselecttherest(id,me) //unselect all but this one.
   {
   theform = getid(id);
   if (me.checked == true) 
      {
      for(i=0; i< theform.elements.length; i++) 
         { 
         if(theform.elements[i].type == "checkbox" 
         && theform.elements[i].value != me.value) 
            theform.elements[i].checked = false; 
         } 
      }   
   return true;
   }
   
function selectall(id)
   {
   theform = getid(id);
   for(i=0; i<theform.elements.length; i++)
      { 
      if(theform.elements[i].type == "checkbox") 
         theform.elements[i].checked = true; 
      } 
   return false;
   }
   
function invertall(id)
   {
   theform = getid(id)
   for(i=0; i<theform.elements.length; i++)
      { 
      if(theform.elements[i].type == "checkbox")
         theform.elements[i].checked = !theform.elements[i].checked; 
      } 
   return false;
   }
