とほほのスタイルシート入門

/**
 * change Opacity
 * @param string id
 * @param integer  num 0% to 100%
 */
function _changeOpacity(id, num)
{
   if(document.all)
   {
      document.getElementById(id).style.filter="alpha(opacity=0)";
      document.getElementById(id).filters.alpha.opacity  = num;
   }
   else if(ua.indexOf('Gecko')!=-1)
   {
      document.getElementById(id).style.MozOpacity = (num / 100);
   }
}