if (!window.S$) {
  window.Spinscape = window.S$ = function(id) {
    return document.getElementById(id);
  };
}

S$.Redirect = {

    _init: function(url, delay, showerId) {
        if (delay > 1) {
            timer(delay);
        } else {
            redirect(url);
        }

        function redirect(url) {
            document.location.href = url;
        }

        function timer(delay) {
            if (delay > 0) {
                $j("#" + showerId).html("<b>" + delay + "</b> second(s)");
                setTimeout(function(){timer(delay - 1)}, 1000);
            } else {
                $j("#" + showerId).text("");
                redirect(url);
            }
        }
    }
};
