function getselectedvalue(listname)
{
// when passed a select item, iterate through and return the selected text.
// if there isn't any selected text, return "All" by default


if (listname.type.indexOf("select") ==-1)
  {
    // whatever was passed to the function doesn't have options
    return "All";
  }
   else
     {
       for (i=0;listname.length;i++)
        {
          if (listname.options[i].selected)
            {
              // this item's been selected!
              return listname.options[i].text
            }
        }
        // we didn't find any selected options
        return "All"
     }

}