var timeouts=[];function setAnimationTimeout(func,delay){var timeout=setTimeout(func,delay);timeouts.push(timeout);}function clearAnimationTimeouts(){timeouts.forEach(clearTimeout);timeouts=[];}function loop_animation(){ setAnimationTimeout(function(){$("#video_effect #cursor").addClass("move_step_1"); },400);setAnimationTimeout(function(){$("#video_effect #cursor").addClass("tap1"); },1000);setAnimationTimeout(function(){$("#video_effect img:nth-child(3)").fadeOut(); },1400);setAnimationTimeout(function(){$("#video_effect #cursor").addClass("move_step_2"); },3200);setAnimationTimeout(function(){$("#video_effect #cursor").addClass("move_step_2");$("#video_effect #cursor").addClass("tap2"); },3500);setAnimationTimeout(function(){$("#video_effect img:nth-child(2)").fadeOut(); },3700);setAnimationTimeout(function(){$("#video_effect #cursor").addClass("move_step_3"); },5700);setAnimationTimeout(function(){$("#video_effect #cursor").removeClass("tap1 tap2");$("#video_effect #cursor").removeClass("move_step_1 move_step_2 move_step_3");$("#video_effect img:nth-child(3)").fadeIn(400,function(){$("#video_effect img:nth-child(2)").show(); }); },6700);setAnimationTimeout(loop_animation,8000);}$(document).on('visibilitychange',function(){if(document.hidden){ clearAnimationTimeouts(); }else{ loop_animation(); }});$(window).on('load',loop_animation);