var avatar_foot = {

    init: function(){

    if(location.href.match(/action=viewprofile$/) || location.href.match(/ewprofile&user=(.+?)$/) && RegExp.$1 == pb_username){
            this.get_avvy();
            avatar_head.set_avvy();
        }
    },

    set_cookie: function(cookie_name, cookie_value){

        document.cookie = cookie_name + "=" + cookie_value + "; expires = " + (new Date()).toGMTString().replace(/\d{4}/, "2050");
    },

    get_avvy: function(){

        for(i = 0; i < document.images.length; i ++){

            if(document.images[i].alt.match(/\[avatar\]/)){

                this.set_cookie("dre_src", document.images[i].src);
                this.set_cookie("dre_hgt", document.images[i].height);
                this.set_cookie("dre_wdh", document.images[i].width);
            }
        }
    }

}.init();