﻿///////////////////////////////////////////////////////////////
/*
    Extensiones Juniper sobre ExtJS
*/
///////////////////////////////////////////////////////////////

// Función text

    // Gets or sets the text for an element
    // @el: id, elemento o clase que pasar a Est.get(..)
    // @text:   New text for the Element
    // Remarks:
    //  Get: returns the Element text
    //  Set: Sets the new text for the Element, returns old one
    function ExtText(el, text){
        // Get
        if (text == null) return Ext.get(el).dom.innerHTML;
        // Set
        var old = Ext.get(el).dom.innerHTML;
        Ext.get(el).dom.innerHTML = text;
        return old;
    }

    // Gets or sets the value for an element
    // @value:   New value for the Element
    // Remarks:
    //  Get: returns the Element value
    //  Set: Sets the new value for the Element, returns old one
    //  (!Sólo items que tengan el attributo "value") 
    function ExtVal(el, value){
        // Get
        if (value == null) return Ext.get(el).dom.value;
        // Set
        var old = Ext.get(el).dom.value;
        Ext.get(el).dom.value = value;
        return old;
    }
