function a_co_il_obj()
{
    // cookie functions stolen from: http://www.quirksmode.org/js/cookies.html
    // thanks!

    this.createCookie = function(name,value,days) {
        if (!days) days = 30;
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        document.cookie = name+"="+value+expires+"; path=/";
    }

    this.readCookie = function(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
    }

    this.eraseCookie = function(name) {
        this.createCookie(name,"",-1);
    }

    // sync this func with php hmm
    // use this to create links that go through a redirection script
    this.url_to = function(url) {
        return BASE_URL + "redir.php?url=" + encodeURIComponent(url);
    }

    // sync this func with php hmm
    // this function is for making url's created with url_to() raw again
    this.url_to_make_raw = function(url) {
        return url.replace('redir.php?url=', '');
    }
}
var a_co_il = new a_co_il_obj();

