derive(ActionHidden, ClassBase);
function ActionHidden() {

    this.ItemsToChangeDisplay = new Array();
    this.ValidatorsToChangeEnabled = new Array();
    this.ItemsToRenderOnTrue = new Array();
    this.ItemsToRenderOnFalse = new Array();
    this.ControlsToGetValue = "";
    
    this.OnUpdateStatus = null;

    override(this, 'Init')
    this.Init = function() {
        this.ClassBase_Init(arguments[0],arguments[1],arguments[2]);
        this.ItemsToChangeDisplay = arguments[3];
        this.ValidatorsToChangeEnabled = arguments[4];
        this.ItemsToRenderOnTrue = arguments[5];
        this.ItemsToRenderOnFalse = arguments[6];
        this.ControlsToGetValue = arguments[7];
        if(Designer_obj) {
            this.ArrProp = new Array();
            this.Property_Add(35, 'Identificaci&oacute;n', 'Text', 'Ident', 'Ident');
        }
    }
    
    this.get_Status = function() {
        var lRef = document.getElementById(this.ClientId);
        return lRef.getAttribute('t05') != null && lRef.getAttribute('t05') == '1' ? true : false;
    }
    this.set_Status = function(aValue) {
        var lRef = document.getElementById(this.ClientId);
        lRef.setAttribute('t05', aValue);
    }
    
    this.ChangeStatus = function(aValue) {
        if(this.get_Status() != aValue) {
            this.set_Status(aValue);
            this.ProcessStatusChange(true);
        }
    }
    
    this.ProcessStatusChange = function(aRender) {
        if(this.ItemsToChangeDisplay && this.ItemsToChangeDisplay.length > 0) {
            for(var i = 0; i < this.ItemsToChangeDisplay.length; i++) {
                var lref = document.getElementById(this.ItemsToChangeDisplay[i]);
                if(lref && lref.style)
                    lref.style.display = this.get_Status() ? '' : 'none';
            }
        }
        if(this.ValidatorsToChangeEnabled && this.ValidatorsToChangeEnabled.length > 0) {
            for(var i = 0; i < this.ValidatorsToChangeEnabled.length; i++) {
                window[this.ValidatorsToChangeEnabled[i]].enabled = this.get_Status();
            }
        }
        if(aRender) {
            if(this.get_Status()) {
                if(this.ItemsToRenderOnTrue && this.ItemsToRenderOnTrue.length > 0) {
                    var larr = new Array();
                    for(var i = 0; i < this.ItemsToRenderOnTrue.length; i++) {
                        var lref = window[this.ItemsToRenderOnTrue[i] + '_obj'];
                        if(lref && lref.Render)
                            larr[larr.length] = lref;
                    }
                    Page_obj.DoCallback(larr,{ctrlid:{ControlsToGetValue:this.ControlsToGetValue}},'Status',true);
                }
            } else {
                if(this.ItemsToRenderOnFalse && this.ItemsToRenderOnFalse.length > 0) {
                    var larr = new Array();
                    for(var i = 0; i < this.ItemsToRenderOnFalse.length; i++) {
                        var lref = window[this.ItemsToRenderOnFalse[i] + '_obj'];
                        if(lref && lref.Render)
                            larr[larr.length] = lref;
                    }
                    Page_obj.DoCallback(larr,{ctrlid:{ControlsToGetValue:this.ControlsToGetValue}},'Status',true);
                }
            }
        }
    } 
    
    this.get_AllowDropBefore = function() {
        return true;
    }

    this.get_AllowDrop = function() {
        return false;
    }

    this.get_AllowDrag = function() {
        return true;
    }

	this.set_Width = function(aValue) {
        return null;
	}
	
	this.set_Height = function(aValue) {
	    return null;
	}

    this.set_Ident = function(aValue) {
        var lRef = document.getElementById(this.ClientId);
        lRef.setAttribute('t01', aValue.replace(/[^a-zA-Z0-9.]/, ''));
        document.getElementById(this.ClientId + '_txt').innerHTML = aValue;
        if(Designer_obj)
            Designer_obj.RefreshAction();
    }

    this.InitDesignMode = function() {
        var lCtrl = window[this.get_CtrlID() + '_obj'];
        if(lCtrl && typeof(lCtrl['get_' + this.get_CtrlEvt()]) != 'undefined') {
            if(lCtrl['get_' + this.get_CtrlEvt()]() == this.ClientId) {
                lCtrl['set_' + this.get_CtrlEvt()](this.get_Ident());
            }
            if(!lCtrl['_Evt' + this.get_CtrlEvt()])
                lCtrl['_Evt' + this.get_CtrlEvt()] = new Object();
            lCtrl['_Evt' + this.get_CtrlEvt()][this.ClientId] = 1;
            if(pwAction_obj && pwAction_obj['SelectedId'] != null && pwAction_obj['SelectedAction'] != null) {
                if(pwAction_obj.SelectedId == this.get_CtrlID() && pwAction_obj.SelectedAction == this.get_CtrlEvt())
                    Designer_obj.RefreshAction();
            }
        }
        
        //setTimeout(this.ClientId + '_obj.set_DesignMarkNor()',10);
    }    
    
    this.set_DesignMarkNor = function() {
        if(Designer_obj) {
            var lref = document.getElementById(this.ClientId);
            Designer_obj.set_DesignMarkSelfNor(lref);
        }
    }
    
    this.set_DesignMarkSel = function() {
        if(Designer_obj) {
            var lref = document.getElementById(this.ClientId);
            Designer_obj.set_DesignMarkSelfSel(lref);
        }
    }

    this.get_NextActID = function() {
        var lRef = document.getElementById(this.ClientId);
        return lRef.getAttribute('t06') != null ? lRef.getAttribute('t06') : '';
    }
    this.set_NextActID = function(aValue) {
        var lRef = document.getElementById(this.ClientId);
        lRef.setAttribute('t06', aValue);
        this.Frm[0] = aValue;
    }
    
    this.get_CtrlID = function() {
        if(Designer_obj)
            return this.Frm[1];
        return this.get_Attr('t07');
    }
    this.set_CtrlID = function(aValue) {
        this.set_Attr('t07', aValue);
        this.Frm[1] = aValue;
    }

    this.get_CtrlEvt = function() {
        if(Designer_obj)
            return this.Frm[2];
        return this.get_Attr('t08');
    }
    this.set_CtrlEvt = function(aValue) {
        this.set_Attr('t08', aValue);
        this.Frm[2] = aValue;
    }
    
    this.get_Param = function(aIndex) {
        return this.Frm[3][aIndex];
    }
    this.set_Param = function(aIndex, aValue) {
        this.Frm[3][aIndex] = aValue;
    }

    this.Execute = function(aRef, aEffect) {
        if (aRef && aRef.type != 'text' && aEffect) {
            Page_obj._ActionRef = aRef;
            aRef.disabled = true;
            if (aRef.id != '')
                setTimeout('document.getElementById("' + aRef.id + '").disabled=false;Page_obj._ActionRef=null;', 500);
            else
                setTimeout('if(Page_obj._ActionRef) Page_obj._ActionRef.disabled=false;Page_obj._ActionRef=null;', 500);
        }
        if (this.OnExecute()) {
            var lAct = window[this.get_NextActID() + '_obj'];
            if (lAct)
                lAct.Execute();
            /*else if (Page_obj._ActionRef && !Page_obj._ActionRefRender) {
            Page_obj._ActionRef.disabled = false;
            Page_obj._ActionRef = null;
            }*/
        } /*else if (Page_obj._ActionRef && !Page_obj._ActionRefRender) {
            Page_obj._ActionRef.disabled = false;
            Page_obj._ActionRef = null;
        }*/
    }
    
    this.OnExecute = function() {
        this.Render("Exec");
        return false;
    }

	this.set_HiddenClient = function(aValue) {
        var lref = document.getElementById(this.ClientId);
        lref.style.display = 'none';
	}
}

