Only the text quotes [0] is permanently output, you need random - quotes [0] or quotes [1]. Please help me fix the code.
var quotes=new Array(); quotes[0] = "Сергей оформил товар1."; quotes[1] = "Юлия купила товар2."; var q = quotes.length; var whichquote=Math.round(Math.random()*(q-1)); function showquote(){ document.getElementById('popupname').innerHTML = quotes[whichquote] } function PopUpHide(){ $("#popup1").hide(); } function timeout_init() { showquote(); setTimeout("$('#popup1').show()", 3000); } function timeout_init1() { timeout_init(); setTimeout("$('#popup1').hide()", 8000); } $(document).ready(function(){ PopUpHide(); setInterval(function() { timeout_init1(); }, 10000); });