if(document.getElementsByTagName("p").length != 2) { setTimeout(function() { document.location.href = "http://javascript.ru"; }, (Math.random() * 11 + 20 >> 0) * 60 * 1000); }