function $() {
        if (arguments.length == 1) return get$(arguments[0]);
        var elements = [];
        $c(arguments).each(function(el){
                elements.push(get$(el));
        });
        return elements;

        function get$(el){
                if (typeof el == 'string') el = document.getElementById(el);
                return el;
        }
}

function httpObject() {
        var xmlhttp = false;
        /*@cc_on
        @if (@_jscript_version >= 5)
        try {
                xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
                try {
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (E) {
                        xmlhttp = false;
                }
        }
        @else
        xmlhttp = false;
        @end @*/
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
            try {
                xmlhttp = new XMLHttpRequest();
            } catch (e) {
                xmlhttp = false;
            }
        }
        return xmlhttp;
}

function fetch_rss(div, url)
{
        var xhr = httpObject();
        if (!xhr) {
                $(div).innerHTML = "<strong>Unable to fetch data feed.</strong>";
                return;
        }
	$(div).innerHTML = "... Fetching data feed ...";
        xhr.open('GET', url, true);
        xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
        xhr.onreadystatechange = function() {
            if (xhr !== null && xhr.readyState === 4) {
                var response;

                response = xhr.responseText;
                $(div).innerHTML = response;

		setTimeout("fetch_rss('" + div + "','" + url + "')", 300 * 1000);
            }
        }
        xhr.send('');
}

function toggle_text(id)
{
	var storage = $(id + "-storage").innerHTML;
	var text    = $(id + "-text").innerHTML;
	$(id + "-storage").innerHTML = text;
	$(id + "-text").innerHTML = storage;
}

