stop(); var id=setInterval(pl,7000,'где надо'); function pl (where) { if(where=='где надо'){ play(); clearInterval(id); } }