function AvatarAnim(WhatToDo,ID) { //when run this function do this
if (WhatToDo == 'SHOW') {
$gameScreen.showPicture(ID, 'H1-IDLE-talking-happy-6', 1, -280, GameReScreenY-250, 100, 100, 255, 0);
$gameScreen.picture(ID)._angle = -40;
new IAVRA.ANIMATE.Tween($gameScreen.picture(ID), { _x: 160,_angle: 0, _scaleY: 100 }).easing(IAVRA.EASING.quad.out).duration(20).start();
// here clear timer inside the var timerAvatar if exist
clearTimeout(timerAvatar);
// here add new timer to var timerAvatar with 500 MS
var timerAvatar = setTimeout(function() {$gameScreen.showPicture(ID, 'H1-IDLE-0', 1, $gameScreen.picture(ID)._x, $gameScreen.picture(ID)._y, 100, 100, 255, 0); }, 500);;
}
}