Where you're using document.getElementById() in javascript, you're probably not getting the right element. If you right click on the element and inspect it in your web browser, you'll see that it has an id like zen13 or something similar.

Instead of document.getElementById('loading') try using just zen('loading'), for example:

zen("loading").style.display = "none"      

You can send texts through SMTP if you know the SMS gateway for the service provider. Several of these should be preconfigured on your instance of Cache or IRIS under System Administration, Security, Mobile Phone. You use the phone number @ that server as the email address to send to. For instance, if the phone number was 999-999-9999 and it was on AT&T, you'd send the email to 9999999999@txt.att.net.

So that's one way to do it, but I'm sure there are better ones.