if (document.getElementById("testo").value.indexOf("p aroladacercare")>=0)

sempreche' tu stia parlando veramente di un "campo testo"...
ciao