function AqbDstMain(oOptions) {
    this._sActionsUrl = oOptions.sActionUrl;
    this._sObjName = oOptions.sObjName == undefined ? 'oAqbFltMain' : oOptions.sObjName;
    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'slide' : oOptions.sAnimationEffect;
    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
    this._oHtmlIds = oOptions.oHtmlIds == undefined ? {} : oOptions.oHtmlIds;
    this._iUserId = oOptions.iUserId == undefined ? 0 : oOptions.iUserId;
    this._sUserName = oOptions.sUserName == undefined ? 'none' : oOptions.sUserName;
}
AqbDstMain.prototype.changePageSnippets = function(sType, sUsername, iStart, iPerPage) {
	var oDate = new Date();
    var $this = this;
    var sLoadingId = '#' + this._oHtmlIds['loading_snippets'];
    var sSnippetsId = '#' + this._oHtmlIds['snippets'];

    if(sUsername == undefined || sUsername.length == 0)
    	sUsername = this._sUserName;

    $(sLoadingId).bx_loading();
    $.post(
        this._sActionsUrl + 'act_get_snippets/' + sType +'/' + sUsername + '/' + iStart + '/' + iPerPage + '/',
        {
            _t:oDate.getTime()
        },
        function(sData){
        	$(sLoadingId).bx_loading();

            $(sSnippetsId).bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
                $(this).replaceWith(sData);
            });            
        },
        'html'
    );
};
AqbDstMain.prototype.remove = function(iId) {
	var $this = this;
	var oDate = new Date();

	if(!confirm(aDolLang['_aqb_dst_msg_delete']))
		return;

	$.post(
        this._sActionsUrl + 'act_remove/' + iId,
        {
            _t:oDate.getTime()
        },
        function(oData){
        	alert(oData.message);
        	if(parseInt(oData.code) == 0)
        		document.location.href = $this._sActionsUrl + 'disputes/'; 
        },
        'json'
	);
};
AqbDstMain.prototype.join = function(iDisputeId, iSide) {
	var $this = this;
	var oDate = new Date();

	$.post(
        this._sActionsUrl + 'act_join/' + iDisputeId + '/' + iSide + '/',
        {
            _t:oDate.getTime()
        },
        function(oData){
        	alert(oData.message);
        	if(parseInt(oData.code) == 0) {
        		for(var sKey in oData.counters)
        			$('#' + $this._oHtmlIds['counter'] + sKey).html(oData.counters[sKey]);

        		document.location.href = document.location.href; 
        	}
        },
        'json'
    );
};
