Rewrite this simple function into jQuery?

Rewrite this simple function into jQuery?

This causes an img element with the id "loading" to blink on and off at a 35 millisecond interval, until the web page is loaded.

I'm just curious if there's a (better?) way to do the following function with the jQuery API:

  1. function flash() {
        r=document.getElementById("loading");
        r.style.visibility=(r.style.visibility=="hidden"?"visible":"hidden");
    }
    i=setInterval(flash,35);

    $(window).load(function() {
        clearInterval(i);
        $("#loading").remove();
    });