$.fn.aatype = function(aafilter)
{
  this.each(function(){
    str = $(this).html();
    w = $(this).width(),
    h = $(this).height(),
    $(this).html("");
    if ( jQuery.browser["mozilla"] || jQuery.browser["safari"] )
    {
      rgb = $(this).css('color').match(/\d{1,3}/g);
      c = "#";
      for ( i = 0; i < rgb.length; i++ )
      {
        c += parseInt(rgb[i]).toString(16);
      }
    }
    else
      c = $(this).css('color');
    
    if (!aafilter)
    {
      flashVarsArr = {
        aaString: str,
        aaFont: $(this).css('fontFamily'),
        aaSize: $(this).css('fontSize'),
        aaColor: c,
        aaAlign: $(this).css('textAlign'),
        aaVAlign: $(this).css('verticalAlign')
      };
    }
    
    else
    {
      flashVarsArr = {
        aaString: str,
        aaFont: $(this).css('fontFamily'),
        aaSize: $(this).css('fontSize'),
        aaColor: c,
        aaAlign: $(this).css('textAlign'),
        aaVAlign: $(this).css('verticalAlign'),
        aaFilter: aafilter["filter"],
        aaFilterStrength: aafilter["strength"],
        aaFilterMove: aafilter["move"],
        aaFilterX: aafilter["x"],
        aaFilterY: aafilter["y"],
        aaFilterColor: aafilter["color"].replace( "#", "0x" )
      };
    }
    
    $(this).flash({
      src: 'http://www.agarisho.com/aatext.swf',
      width: w,
      height: h,
      wmode: 'transparent',
      base: '.',
      salign: 'TL',
      flashvars: flashVarsArr
    });
  });
}