function $(id) {
    return document.getElementById(id);
}
function expand() {
    $('top').style.display='block';
    createCookie('collapse',0,365);
    $('exp_col').onclick=collapse;
    $('exp_col').childNodes[0].src='/images/top_collapse.png';
    return false;
}
function collapse() {
    $('top').style.display='none';
    createCookie('collapse',1,365);
    $('exp_col').onclick=expand;
    $('exp_col').childNodes[0].src='/images/top_expand.png';
    return false;
}

function createCookie(name,value,days) {
        if (days) {
                var date = new Date();
                date.setTime(date.getTime()+(days*24*60*60*1000));
                var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(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;
}

function eraseCookie(name) {
       // alert("Óäàëÿþ "+name);
        createCookie(name,"",-1);
}

function $(id){
        return document.getElementById(id);
}

function openid_logout(){
        createCookie('openid_id',false,-1);
        createCookie('openid_hash',false,-1);
        createCookie('openid_returnurl',false,-1);
        $('openid_welcome').innerHTML='';
        return false;
}

