function BxUserStatus()
{
    this.HomeUrl;
    this.bIsProfilePage;
    this.sCurrentStatusImgId = 'current_members_status_img';
    this.userStatusInit = function(sHomeUrl, bProfilepage) 
    {
        this.HomeUrl = sHomeUrl;
        this.bIsProfilePage = (bProfilepage) ? true : false;
    }
    this.setUserStatus = function( sStatus, oObject ) 
    {
    	var self = this;
        var sStatus = encodeURIComponent(sStatus);
        var _sRandom = Math.random();

    	$.post(this.HomeUrl + 'list_pop.php?action=change_status&mode=ajax&status=' + sStatus + '&_r=' + _sRandom, 
    	function(sData) {
            if ( self.bIsProfilePage ) {
                document.location.reload();
            }
            else {
                $('#' + self.sCurrentStatusImgId).attr( {'src' : sData, 'alt' : sStatus} );
                self.closeSubMenu(oObject);
            }
    	});
    }
    this.sendStatusMessage = function(e, oObject)
    {
        var self = this;

        if( !e ) {
            if( window.event ) { 
              e = window.event;
            } 
            else { 
              return;
            }
        }
        var n = e.keyCode ? e.keyCode : e.charCode; 
        if (n == 13) { 
            self.PerformSendingStatusMess(oObject);
        }
    }
    this.PerformSendingStatusMess = function(oObject) {
        var self = this;
        var _sRandom = Math.random();

        $.post( this.HomeUrl + 'list_pop.php?action=change_status_message&mode=ajax' + '&_r=' + _sRandom, { status_message : oObject.value }, 
            function(sData) {
                $('#StatusMessage').text(oObject.value).show();
                $('#inloadedStatusMess').html('');
            }
        );
    }

    this.closeSubMenu = function (oObject)
    {
        if ( typeof membermenu != 'undefined' ) {
            membermenu.close_popup( $(oObject).attr('id') );
        }
    }
}
