var lArrEffect1 = new Object();

derive(InputMatrixData, ClassDataInput);
function InputMatrixData() {

    this.EmptySelection = true;
    this._IntervalEffect = null;
    
    override(this, 'Init');
    this.Init = function() {
    this.ClassDataInput_Init(arguments[0], arguments[1], arguments[2], arguments[3]);
        if (this.get_SyncFields() && !Designer_obj) {
            Page_obj.AddSync1(this);
        }
        var lref = document.getElementById('Effect1');
        if (lref) {
            if (lArrEffect1[this.ClientId] == null)
                Util_obj.AddEvent(window, 'resize', ProcEffect1);
            lArrEffect1[this.ClientId] = this;
        }
        if (Designer_obj) {
            this.Property_Add(5, 'Acci&oacute;n Click', 'ActionList', 'ActClick', 'ActClick');
            this.Property_Add(40, 'Campos', 'Field', 'DataItemFieldOne', 'DataItemFieldOne');
            this.Property_Add(41, 'Reg. a Mostrar', 'Text', 'RecordPerPage', 'RecordPerPage');
            this.Property_Add(42, 'Plantilla', 'Template', 'ItemTempID', 'ItemTempID');
            this.Property_Add(43, 'Columnas', 'Text', 'CountColumns', 'CountColumns');
            this.Property_Add(44, 'Solo lectura', 'Combo', 'ReadOnlyStr', 'ReadOnlyStr', 'True|Si,False|No(Con Check),False2|No(Sin Check)');
            this.Property_Add(45, 'Campos a Sinc.', 'Text', 'SyncFields', 'SyncFields');
            this.Property_Add(46, 'Tipo paginado', 'Combo', 'PagingType', 'PagingType', '0|Estilo 1,1|Estilo 2');
            this.Property_Add(47, 'Pag.img.normal', 'Image', 'PagingImgNor', 'PagingImgNor');
            this.Property_Add(48, 'Pag.ima.sel', 'Image', 'PagingImgSel', 'PagingImgSel');
            this.Property_Add(49, 'Pag. color', 'PickColor', 'PagingBackColor', 'PagingBackColor');
            this.Property_Add(50, 'Efecto', 'Combo', 'Effect', 'Effect', '1|Efecto 1');
            this.Property_Add(51, 'Flash', 'Image', 'Flash', 'Flash');
            this.Property_Add(52, 'FieldImage', 'Text', 'FieldImage', 'FieldImage');
        }
    }

    this.ClientToServerPass = function() {
        return (this.get_RecordPage() != '' && this.get_RecordPage() > 0) || !this.get_ReadOnly() ? true : false;
    }

    this.RenderSelection = function(aMark) {
        var lsel_index = this.get_SelectedIndex();
        if(typeof(lsel_index) == 'object') {
            for(var i = 0; i < this.get_DataKeys().length; i++) {
                var lref = document.getElementById(this.ClientId + 'chk' + i);
                if(lref)
                    lref.checked = false;
            }
            for(var i = 0; i < lsel_index.length; i++) {
                var lref = document.getElementById(this.ClientId + 'chk' + lsel_index[i]);
                if(lref)
                    lref.checked = aMark;
            }
        } else {
            var lref = document.getElementById(this.ClientId + 'chk' + lsel_index);
            if(lref)
                lref.checked = aMark;
        }
    }
    
    this.set_Focus = function() {
        var lref = document.getElementById(this.ClientId + 'chk0');
        if(lref)
            lref.focus();
    }
    
    this.get_ItemTempID = function() {
        return this.Frm[this.FrmCount + 1];
    }
    this.set_ItemTempID = function(aValue) {
        this.Frm[this.FrmCount + 1] = aValue;
        if(Designer_obj)
            setTimeout('Designer_obj.Render()',500);
    }
    
    this.get_CountColumns = function() {
        return this.Frm[this.FrmCount + 2];
    }
    this.set_CountColumns = function(aValue) {
        this.Frm[this.FrmCount + 2] = aValue;
        if(Designer_obj)
            setTimeout('Designer_obj.Render()',500);
    }

    this.get_RecordPerPage = function() {
        return this.Frm[this.FrmCount + 3];
    }
    this.set_RecordPerPage = function(aValue) {
        this.Frm[this.FrmCount + 3] = parseInt(aValue);
        if(Designer_obj)
            setTimeout('Designer_obj.Render()',500);
    }
    
    this.get_DataItemField = function() {
        return this.Frm[this.FrmCount + 4];
    }
    this.set_DataItemField = function(aValue) {
        this.Frm[this.FrmCount + 4] = aValue;
    }

    this.get_DataItemFieldOne = function() {
        return this.Frm[this.FrmCount + 4].split('_')[0].split('.')[0];
    }
    this.set_DataItemFieldOne = function(aValue) {
        this.Frm[this.FrmCount + 4] = aValue;
    }
    
    override(this, 'set_DataSourceTop');
    this.set_DataSourceTop = function(aValue) {
        this.ClassDataInput_set_DataSourceTop(aValue);
        if(Designer_obj)
            setTimeout('Designer_obj.Render()',500);
    }

    this.get_ReadOnlyStr = function() {
        return this.Frm[this.FrmCount + 5];
    }
    this.set_ReadOnlyStr = function(aValue) {
        this.Frm[this.FrmCount + 5] = aValue;
        if(Designer_obj)
            setTimeout('Designer_obj.Render()',500);
    }

    this.get_SyncFields = function() {
        if(Designer_obj)
            return this.Frm[this.FrmCount + 6];
        return this.get_Attr('t17');
    }
    this.set_SyncFields = function(aValue) {
        this.Frm[this.FrmCount + 6] = aValue;
        this.set_Attr('t17', aValue);
    }

    this.get_SyncIds = function() {
        return this.get_Attr('t18');
    }
    this.set_SyncIds = function(aValue) {
        this.set_Attr('t18', aValue);
    }

    this.SyncRefresh = function() {
        var lObj = Page_obj._int_sync1_res;
        if (lObj) {
            var lArrIds = this.get_SyncIds().split(',');
            var lCount = 0;
            for (var lAtt in lObj) {
                for (var i = 0; i < lArrIds.length; i++) {
                    var lRef = document.getElementById(this.ClientId + '_' + lAtt.replace('Key', '') + '_' + lArrIds[i]);
                    if (lRef && lRef.id != '') {
                        var lRefObj = window[lRef.id + '_obj'];
                        if (lRefObj && lRefObj.set_Text) {
                            lRefObj.set_Text(lObj[lAtt][i] == null ? '' : lObj[lAtt][i].toString());
                        }
                    }
                }
                lCount++;
            }
            /*if (lCount != this.get_ItemsCount() && this._mytimeout == null)
            this._mytimeout = setTimeout(this.ClientId + '_obj.Render();' + this.ClientId + '_obj._mytimeout=null;', 90000);*/
        }
    }
    
    this.set_ActClick = function(aValue) {
        this.set_Attr('t20', aValue);
        this.Frm[this.FrmCount + 7] = aValue;
    }
    this.get_ActClick = function() {
        if(Designer_obj)
            return this.Frm[this.FrmCount + 7];
        return this.get_Attr('t20'); 
    }
    this.ExecActClick = function(aRef) {
        var lObj = window[this.get_ActClick() + '_obj'];
        if(lObj) {
            lObj.Execute(aRef);
        }
    }

    this.set_PagingType = function(aValue) {
        this.Frm[this.FrmCount + 8] = aValue;
        if(Designer_obj)
            setTimeout('Designer_obj.Render()',500);
    }
    this.get_PagingType = function() {
        return this.Frm[this.FrmCount + 8];
    }

    this.set_PagingImgNor = function(aValue) {
        this.Frm[this.FrmCount + 9] = aValue;
        if(Designer_obj)
            setTimeout('Designer_obj.Render()',500);
    }
    this.get_PagingImgNor = function() {
        return this.Frm[this.FrmCount + 9];
    }

    this.set_PagingImgSel = function(aValue) {
        this.Frm[this.FrmCount + 10] = aValue;
        if(Designer_obj)
            setTimeout('Designer_obj.Render()',500);
    }
    this.get_PagingImgSel = function() {
        return this.Frm[this.FrmCount + 10];
    }

    this.set_PagingBackColor = function(aValue) {
        this.Frm[this.FrmCount + 11] = aValue;
        if(Designer_obj)
            setTimeout('Designer_obj.Render()',500);
    }
    this.get_PagingBackColor = function() {
        return this.Frm[this.FrmCount + 11];
    }

    this.set_Effect = function(aValue) {
        this.Frm[this.FrmCount + 12] = aValue;
    }
    this.get_Effect = function() {
        return this.Frm[this.FrmCount + 12];
    }

    this.set_Flash = function(aValue) {
        this.Frm[this.FrmCount + 15] = aValue;
        if (Designer_obj)
            setTimeout('Designer_obj.Render()', 500);
    }
    this.get_Flash = function() {
        return this.Frm[this.FrmCount + 15];
    }

    this.set_FieldImage = function(aValue) {
        this.Frm[this.FrmCount + 16] = aValue;
    }
    this.get_FieldImage = function() {
        return this.Frm[this.FrmCount + 16];
    }

    this.AnalizeWidth = function() {
        var lref = document.getElementById('Effect1');
        lref.style.width = '10px';
        var lnewwidth = lref.parentNode.offsetWidth;
        lref.style.width = (lnewwidth - 4) + 'px';
    }
}

function ProcEffect1() {
    for(var lAtt in lArrEffect1)
        lArrEffect1[lAtt].AnalizeWidth();
}


