You're still trying to do one for each avatar, it cycles through them by adding one. So if Hero is avatar fav 1 when you do ClickFav($var); $var will be 1, then when $var is 2, you get fav 2.
function AvatarCycle()
{
$**r++;
if($**r>3)
$**r=1;
A******ui.*******v($**r);
A*****_***e();
s******e(5000,0,A**********);
}
Like so, just change all the *'s to what you believe they should be.