/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
YAHOO.util.Chain = function() {
    this.q = [].slice.call(arguments);
    this.createEvent("end");
};
YAHOO.util.Chain.prototype = {id:0,run:function() {
    var F = this.q[0],C;
    if (!F) {
        this.fireEvent("end");
        return this;
    } else {
        if (this.id) {
            return this;
        }
    }
    C = F.method || F;
    if (typeof C === "function") {
        var E = F.scope || {},B = F.argument || [],A = F.timeout || 0,D = this;
        if (!(B instanceof Array)) {
            B = [B];
        }
        if (A < 0) {
            this.id = A;
            if (F.until) {
                for (; !F.until();) {
                    C.apply(E, B);
                }
            } else {
                if (F.iterations) {
                    for (; F.iterations-- > 0;) {
                        C.apply(E, B);
                    }
                } else {
                    C.apply(E, B);
                }
            }
            this.q.shift();
            this.id = 0;
            return this.run();
        } else {
            if (F.until) {
                if (F.until()) {
                    this.q.shift();
                    return this.run();
                }
            } else {
                if (!F.iterations || !--F.iterations) {
                    this.q.shift();
                }
            }
            this.id = setTimeout(function() {
                C.apply(E, B);
                if (D.id) {
                    D.id = 0;
                    D.run();
                }
            }, A);
        }
    }
    return this;
},add:function(A) {
    this.q.push(A);
    return this;
},pause:function() {
    clearTimeout(this.id);
    this.id = 0;
    return this;
},stop:function() {
    this.pause();
    this.q = [];
    return this;
}};
YAHOO.lang.augmentProto(YAHOO.util.Chain, YAHOO.util.EventProvider);
YAHOO.widget.ColumnSet = function(A) {
    this._sId = "yui-cs" + YAHOO.widget.ColumnSet._nCount;
    A = YAHOO.widget.DataTable._cloneObject(A);
    this._init(A);
    YAHOO.widget.ColumnSet._nCount++;
};
YAHOO.widget.ColumnSet._nCount = 0;
YAHOO.widget.ColumnSet.prototype = {_sId:null,_aDefinitions:null,tree:null,flat:null,keys:null,headers:null,_init:function(I) {
    var J = [];
    var A = [];
    var G = [];
    var E = [];
    var C = -1;
    var B = function(M, S) {
        C++;
        if (!J[C]) {
            J[C] = [];
        }
        for (var O = 0; O < M.length; O++) {
            var K = M[O];
            var Q = new YAHOO.widget.Column(K);
            K.yuiColumnId = Q._sId = YAHOO.widget.Column._nCount + "";
            if (!YAHOO.lang.isValue(Q.key)) {
                Q.key = "yui-dt-col" + YAHOO.widget.Column._nCount;
            }
            YAHOO.widget.Column._nCount++;
            A.push(Q);
            if (S) {
                Q.parent = S;
            }
            if (YAHOO.lang.isArray(K.children)) {
                Q.children = K.children;
                var R = 0;
                var P = function(V) {
                    var W = V.children;
                    for (var U = 0; U < W.length; U++) {
                        if (YAHOO.lang.isArray(W[U].children)) {
                            P(W[U]);
                        } else {
                            R++;
                        }
                    }
                };
                P(K);
                Q._nColspan = R;
                var T = K.children;
                for (var N = 0; N < T.length; N++) {
                    var L = T[N];
                    if (Q.className && (L.className === undefined)) {
                        L.className = Q.className;
                    }
                    if (Q.editor && (L.editor === undefined)) {
                        L.editor = Q.editor;
                    }
                    if (Q.editorOptions && (L.editorOptions === undefined)) {
                        L.editorOptions = Q.editorOptions;
                    }
                    if (Q.formatter && (L.formatter === undefined)) {
                        L.formatter = Q.formatter;
                    }
                    if (Q.resizeable && (L.resizeable === undefined)) {
                        L.resizeable = Q.resizeable;
                    }
                    if (Q.sortable && (L.sortable === undefined)) {
                        L.sortable = Q.sortable;
                    }
                    if (Q.width && (L.width === undefined)) {
                        L.width = Q.width;
                    }
                    if (Q.type && (L.type === undefined)) {
                        L.type = Q.type;
                    }
                    if (Q.type && !Q.formatter) {
                        Q.formatter = Q.type;
                    }
                    if (Q.text && !YAHOO.lang.isValue(Q.label)) {
                        Q.label = Q.text;
                    }
                    if (Q.parser) {
                    }
                    if (Q.sortOptions && ((Q.sortOptions.ascFunction) || (Q.sortOptions.descFunction))) {
                    }
                }
                if (!J[C + 1]) {
                    J[C + 1] = [];
                }
                B(T, Q);
            } else {
                Q._nKeyIndex = G.length;
                Q._nColspan = 1;
                G.push(Q);
            }
            J[C].push(Q);
        }
        C--;
    };
    if (YAHOO.lang.isArray(I)) {
        B(I);
        this._aDefinitions = I;
    } else {
        return null;
    }
    var F;
    var D = function(L) {
        var M = 1;
        var O;
        var N;
        var P = function(T, S) {
            S = S || 1;
            for (var U = 0; U < T.length; U++) {
                var R = T[U];
                if (YAHOO.lang.isArray(R.children)) {
                    S++;
                    P(R.children, S);
                    S--;
                } else {
                    if (S > M) {
                        M = S;
                    }
                }
            }
        };
        for (var K = 0; K < L.length; K++) {
            O = L[K];
            P(O);
            for (var Q = 0; Q < O.length; Q++) {
                N = O[Q];
                if (!YAHOO.lang.isArray(N.children)) {
                    N._nRowspan = M;
                } else {
                    N._nRowspan = 1;
                }
            }
            M = 1;
        }
    };
    D(J);
    for (F = 0; F < J[0].length; F++) {
        J[0][F]._nTreeIndex = F;
    }
    var H = function(K, L) {
        E[K].push(L._sId);
        if (L.parent) {
            H(K, L.parent);
        }
    };
    for (F = 0; F < G.length; F++) {
        E[F] = [];
        H(F, G[F]);
        E[F] = E[F].reverse();
    }
    this.tree = J;
    this.flat = A;
    this.keys = G;
    this.headers = E;
},getId:function() {
    return this._sId;
},toString:function() {
    return"ColumnSet instance " + this._sId;
},getDefinitions:function() {
    var A = this._aDefinitions;
    var B = function(D, F) {
        for (var C = 0; C < D.length; C++) {
            var E = D[C];
            var G = F.getColumnById(E.yuiColumnId);
            if (G) {
                E.abbr = G.abbr;
                E.className = G.className;
                E.editor = G.editor;
                E.editorOptions = G.editorOptions;
                E.formatter = G.formatter;
                E.hidden = G.hidden;
                E.key = G.key;
                E.label = G.label;
                E.minWidth = G.minWidth;
                E.resizeable = G.resizeable;
                E.selected = G.selected;
                E.sortable = G.sortable;
                E.sortOptions = G.sortOptions;
                E.width = G.width;
            }
            if (YAHOO.lang.isArray(E.children)) {
                B(E.children, F);
            }
        }
    };
    B(A, this);
    this._aDefinitions = A;
    return A;
},getColumnById:function(C) {
    if (YAHOO.lang.isString(C)) {
        var A = this.flat;
        for (var B = A.length - 1; B > -1; B--) {
            if (A[B]._sId === C) {
                return A[B];
            }
        }
    }
    return null;
},getColumn:function(C) {
    if (YAHOO.lang.isNumber(C) && this.keys[C]) {
        return this.keys[C];
    } else {
        if (YAHOO.lang.isString(C)) {
            var A = this.flat;
            var D = [];
            for (var B = 0; B < A.length; B++) {
                if (A[B].key === C) {
                    D.push(A[B]);
                }
            }
            if (D.length === 1) {
                return D[0];
            } else {
                if (D.length > 1) {
                    return D;
                }
            }
        }
    }
    return null;
},getDescendants:function(D) {
    var B = this;
    var C = [];
    var A;
    var E = function(F) {
        C.push(F);
        if (F.children) {
            for (A = 0; A < F.children.length; A++) {
                E(B.getColumn(F.children[A].key));
            }
        }
    };
    E(D);
    return C;
}};
YAHOO.widget.Column = function(B) {
    if (B && (B.constructor == Object)) {
        for (var A in B) {
            if (A) {
                this[A] = B[A];
            }
        }
    }
    if (this.width && !YAHOO.lang.isNumber(this.width)) {
        this.width = null;
    }
};
YAHOO.lang.augmentObject(YAHOO.widget.Column, {_nCount:0,formatCheckbox:function(B, A, C, D) {
    YAHOO.widget.DataTable.formatCheckbox(B, A, C, D);
},formatCurrency:function(B, A, C, D) {
    YAHOO.widget.DataTable.formatCurrency(B, A, C, D);
},formatDate:function(B, A, C, D) {
    YAHOO.widget.DataTable.formatDate(B, A, C, D);
},formatEmail:function(B, A, C, D) {
    YAHOO.widget.DataTable.formatEmail(B, A, C, D);
},formatLink:function(B, A, C, D) {
    YAHOO.widget.DataTable.formatLink(B, A, C, D);
},formatNumber:function(B, A, C, D) {
    YAHOO.widget.DataTable.formatNumber(B, A, C, D);
},formatSelect:function(B, A, C, D) {
    YAHOO.widget.DataTable.formatDropdown(B, A, C, D);
}});
YAHOO.widget.Column.prototype = {_sId:null,_oDefinition:null,_nKeyIndex:null,_nTreeIndex:null,_nColspan:1,_nRowspan:1,_oParent:null,_elTh:null,_elResizer:null,_dd:null,_ddResizer:null,key:null,label:null,abbr:null,children:null,width:null,minWidth:10,hidden:false,selected:false,className:null,formatter:null,editor:null,editorOptions:null,resizeable:false,sortable:false,sortOptions:null,getId:function() {
    return this._sId;
},toString:function() {
    return"Column instance " + this._sId;
},getDefinition:function() {
    var A = this._oDefinition;
    A.abbr = this.abbr;
    A.className = this.className;
    A.editor = this.editor;
    A.editorOptions = this.editorOptions;
    A.formatter = this.formatter;
    A.key = this.key;
    A.label = this.label;
    A.minWidth = this.minWidth;
    A.resizeable = this.resizeable;
    A.sortable = this.sortable;
    A.sortOptions = this.sortOptions;
    A.width = this.width;
    return A;
},getKey:function() {
    return this.key;
},getKeyIndex:function() {
    return this._nKeyIndex;
},getTreeIndex:function() {
    return this._nTreeIndex;
},getParent:function() {
    return this._oParent;
},getColspan:function() {
    return this._nColspan;
},getColSpan:function() {
    return this.getColspan();
},getRowspan:function() {
    return this._nRowspan;
},getThEl:function() {
    return this._elTh;
},getResizerEl:function() {
    return this._elResizer;
},getColEl:function() {
    return this.getThEl();
},getIndex:function() {
    return this.getKeyIndex();
},format:function() {
}};
YAHOO.util.Sort = {compare:function(B, A, C) {
    if ((B === null) || (typeof B == "undefined")) {
        if ((A === null) || (typeof A == "undefined")) {
            return 0;
        } else {
            return 1;
        }
    } else {
        if ((A === null) || (typeof A == "undefined")) {
            return -1;
        }
    }
    if (B.constructor == String) {
        B = B.toLowerCase();
    }
    if (A.constructor == String) {
        A = A.toLowerCase();
    }
    if (B < A) {
        return(C) ? 1 : -1;
    } else {
        if (B > A) {
            return(C) ? -1 : 1;
        } else {
            return 0;
        }
    }
}};
YAHOO.widget.ColumnDD = function(D, A, C, B) {
    if (D && A && C && B) {
        this.datatable = D;
        this.table = D.getTheadEl().parentNode;
        this.column = A;
        this.headCell = C;
        this.pointer = B;
        this.newIndex = null;
        this.init(C);
        this.initFrame();
        this.invalidHandleTypes = {};
        this.setPadding(10, 0, (this.datatable.getTheadEl().offsetHeight + 10), 0);
    } else {
    }
};
if (YAHOO.util.DDProxy) {
    YAHOO.extend(YAHOO.widget.ColumnDD, YAHOO.util.DDProxy, {initConstraints:function() {
        var G = YAHOO.util.Dom.getRegion(this.table),D = this.getEl(),F = YAHOO.util.Dom.getXY(D),C = parseInt(YAHOO.util.Dom.getStyle(D, "width"), 10),A = parseInt(YAHOO.util.Dom.getStyle(D, "height"), 10),E = ((F[0] - G.left) + 15),B = ((G.right - F[0] - C) + 15);
        this.setXConstraint(E, B);
        this.setYConstraint(10, 10);
        YAHOO.util.Event.on(window, "resize", function() {
            this.initConstraints();
        }, this, true);
    },_resizeProxy:function() {
        this.constructor.superclass._resizeProxy.apply(this, arguments);
        var A = this.getDragEl(),B = this.getEl();
        YAHOO.util.Dom.setStyle(this.pointer, "height", (this.table.parentNode.offsetHeight + 10) + "px");
        YAHOO.util.Dom.setStyle(this.pointer, "display", "block");
        var C = YAHOO.util.Dom.getXY(B);
        YAHOO.util.Dom.setXY(this.pointer, [C[0],(C[1] - 5)]);
        YAHOO.util.Dom.setStyle(A, "height", this.datatable.getContainerEl().offsetHeight + "px");
        YAHOO.util.Dom.setStyle(A, "width", (parseInt(YAHOO.util.Dom.getStyle(A, "width"), 10) + 4) + "px");
        YAHOO.util.Dom.setXY(this.dragEl, C);
    },onMouseDown:function() {
        this.initConstraints();
        this.resetConstraints();
    },clickValidator:function(B) {
        if (!this.column.hidden) {
            var A = YAHOO.util.Event.getTarget(B);
            return(this.isValidHandleChild(A) && (this.id == this.handleElId || this.DDM.handleWasClicked(A, this.id)));
        }
    },onDragOver:function(G, A) {
        var E = this.datatable.getColumn(A);
        if (E) {
            var C = YAHOO.util.Event.getPageX(G),H = YAHOO.util.Dom.getX(A),I = H + ((YAHOO.util.Dom.get(A).offsetWidth) / 2),F = this.column.getTreeIndex(),B = E.getTreeIndex(),J = B;
            if (C < I) {
                YAHOO.util.Dom.setX(this.pointer, H);
            } else {
                var D = parseInt(E.getThEl().offsetWidth, 10);
                YAHOO.util.Dom.setX(this.pointer, (H + D));
                J++;
            }
            if (B > F) {
                J--;
            }
            if (J < 0) {
                J = 0;
            } else {
                if (J > this.datatable.getColumnSet().tree[0].length) {
                    J = this.datatable.getColumnSet().tree[0].length;
                }
            }
            this.newIndex = J;
        }
    },onDragDrop:function() {
        if (YAHOO.lang.isNumber(this.newIndex) && (this.newIndex !== this.column.getTreeIndex())) {
            var C = this.datatable;
            C._oChainRender.stop();
            var B = C._oColumnSet.getDefinitions();
            var A = B.splice(this.column.getTreeIndex(), 1)[0];
            B.splice(this.newIndex, 0, A);
            C._initColumnSet(B);
            C._initTheadEls();
            C.render();
            C.fireEvent("columnReorderEvent");
        }
    },endDrag:function() {
        this.newIndex = null;
        YAHOO.util.Dom.setStyle(this.pointer, "display", "none");
    }});
}
YAHOO.util.ColumnResizer = function(E, C, D, A, B) {
    if (E && C && D && A) {
        this.datatable = E;
        this.column = C;
        this.headCell = D;
        this.headCellLiner = D.firstChild;
        this.init(A, A, {dragOnly:true,dragElId:B.id});
        this.initFrame();
    } else {
    }
};
if (YAHOO.util.DD) {
    YAHOO.extend(YAHOO.util.ColumnResizer, YAHOO.util.DDProxy, {resetResizerEl:function() {
        var A = YAHOO.util.Dom.get(this.handleElId).style;
        A.left = "auto";
        A.right = 0;
        A.top = "auto";
        A.bottom = 0;
    },onMouseUp:function(C) {
        this.resetResizerEl();
        var A = this.headCell.firstChild;
        var B = A.offsetWidth - (parseInt(YAHOO.util.Dom.getStyle(A, "paddingLeft"), 10) | 0) - (parseInt(YAHOO.util.Dom.getStyle(A, "paddingRight"), 10) | 0);
        this.datatable.fireEvent("columnResizeEvent", {column:this.column,target:this.headCell,width:B});
    },onMouseDown:function(A) {
        this.startWidth = this.headCell.firstChild.offsetWidth;
        this.startX = YAHOO.util.Event.getXY(A)[0];
        this.nLinerPadding = (parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner, "paddingLeft"), 10) | 0) + (parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner, "paddingRight"), 10) | 0);
    },clickValidator:function(B) {
        if (!this.column.hidden) {
            var A = YAHOO.util.Event.getTarget(B);
            return(this.isValidHandleChild(A) && (this.id == this.handleElId || this.DDM.handleWasClicked(A, this.id)));
        }
    },onDrag:function(C) {
        var D = YAHOO.util.Event.getXY(C)[0];
        if (D > YAHOO.util.Dom.getX(this.headCellLiner)) {
            var A = D - this.startX;
            var B = this.startWidth + A - this.nLinerPadding;
            this.datatable.setColumnWidth(this.column, B);
        }
    }});
}
YAHOO.widget.RecordSet = function(A) {
    this._sId = "yui-rs" + YAHOO.widget.RecordSet._nCount;
    YAHOO.widget.RecordSet._nCount++;
    this._records = [];
    if (A) {
        if (YAHOO.lang.isArray(A)) {
            this.addRecords(A);
        } else {
            if (A.constructor == Object) {
                this.addRecord(A);
            }
        }
    }
    this.createEvent("recordAddEvent");
    this.createEvent("recordsAddEvent");
    this.createEvent("recordSetEvent");
    this.createEvent("recordsSetEvent");
    this.createEvent("recordUpdateEvent");
    this.createEvent("recordDeleteEvent");
    this.createEvent("recordsDeleteEvent");
    this.createEvent("resetEvent");
    this.createEvent("keyUpdateEvent");
    this.createEvent("recordValueUpdateEvent");
};
YAHOO.widget.RecordSet._nCount = 0;
YAHOO.widget.RecordSet.prototype = {_sId:null,_addRecord:function(C, A) {
    var B = new YAHOO.widget.Record(C);
    if (YAHOO.lang.isNumber(A) && (A > -1)) {
        this._records.splice(A, 0, B);
    } else {
        this._records[this._records.length] = B;
    }
    return B;
},_setRecord:function(B, A) {
    if (!YAHOO.lang.isNumber(A) || A < 0) {
        A = this._records.length;
    }
    return(this._records[A] = new YAHOO.widget.Record(B));
},_deleteRecord:function(B, A) {
    if (!YAHOO.lang.isNumber(A) || (A < 0)) {
        A = 1;
    }
    this._records.splice(B, A);
},getId:function() {
    return this._sId;
},toString:function() {
    return"RecordSet instance " + this._sId;
},getLength:function() {
    return this._records.length;
},getRecord:function(A) {
    var B;
    if (A instanceof YAHOO.widget.Record) {
        for (B = 0; B < this._records.length; B++) {
            if (this._records[B] && (this._records[B]._sId === A._sId)) {
                return A;
            }
        }
    } else {
        if (YAHOO.lang.isNumber(A)) {
            if ((A > -1) && (A < this.getLength())) {
                return this._records[A];
            }
        } else {
            if (YAHOO.lang.isString(A)) {
                for (B = 0; B < this._records.length; B++) {
                    if (this._records[B] && (this._records[B]._sId === A)) {
                        return this._records[B];
                    }
                }
            }
        }
    }
    return null;
},getRecords:function(B, A) {
    if (!YAHOO.lang.isNumber(B)) {
        return this._records;
    }
    if (!YAHOO.lang.isNumber(A)) {
        return this._records.slice(B);
    }
    return this._records.slice(B, B + A);
},hasRecords:function(B, A) {
    var D = this.getRecords(B, A);
    for (var C = 0; C < A; ++C) {
        if (typeof D[C] === "undefined") {
            return false;
        }
    }
    return true;
},getRecordIndex:function(B) {
    if (B) {
        for (var A = this._records.length - 1; A > -1; A--) {
            if (this._records[A] && B.getId() === this._records[A].getId()) {
                return A;
            }
        }
    }
    return null;
},addRecord:function(C, A) {
    if (C && (C.constructor == Object)) {
        var B = this._addRecord(C, A);
        this.fireEvent("recordAddEvent", {record:B,data:C});
        return B;
    } else {
        return null;
    }
},addRecords:function(C, B) {
    if (YAHOO.lang.isArray(C)) {
        var F = [];
        for (var D = 0; D < C.length; D++) {
            if (C[D] && (C[D].constructor == Object)) {
                var A = this._addRecord(C[D], B);
                F.push(A);
            }
        }
        this.fireEvent("recordsAddEvent", {records:F,data:C});
        return F;
    } else {
        if (C && (C.constructor == Object)) {
            var E = this._addRecord(C);
            this.fireEvent("recordsAddEvent", {records:[E],data:C});
            return E;
        } else {
            return null;
        }
    }
},setRecord:function(C, A) {
    if (C && (C.constructor == Object)) {
        var B = this._setRecord(C, A);
        this.fireEvent("recordSetEvent", {record:B,data:C});
        return B;
    } else {
        return null;
    }
},setRecords:function(E, D) {
    var H = YAHOO.widget.Record,B = YAHOO.lang.isArray(E) ? E : [E],G = [],F = 0,A = B.length,C = 0;
    D = parseInt(D, 10) | 0;
    for (; F < A; ++F) {
        if (typeof B[F] === "object" && B[F]) {
            G[C++] = this._records[D + F] = new H(B[F]);
        }
    }
    this.fireEvent("recordsSet", {records:G,data:E});
    if (B.length && !G.length) {
    }
    return G.length > 1 ? G : G[0];
},updateRecord:function(A, E) {
    var C = this.getRecord(A);
    if (C && E && (E.constructor == Object)) {
        var D = {};
        for (var B in C._oData) {
            D[B] = C._oData[B];
        }
        C._oData = E;
        this.fireEvent("recordUpdateEvent", {record:C,newData:E,oldData:D});
        return C;
    } else {
        return null;
    }
},updateKey:function(A, B, C) {
    this.updateRecordValue(A, B, C);
},updateRecordValue:function(A, D, G) {
    var C = this.getRecord(A);
    if (C) {
        var F = null;
        var E = C._oData[D];
        if (E && E.constructor == Object) {
            F = {};
            for (var B in E) {
                F[B] = E[B];
            }
        } else {
            F = E;
        }
        C._oData[D] = G;
        this.fireEvent("keyUpdateEvent", {record:C,key:D,newData:G,oldData:F});
        this.fireEvent("recordValueUpdateEvent", {record:C,key:D,newData:G,oldData:F});
    } else {
    }
},replaceRecords:function(A) {
    this.reset();
    return this.addRecords(A);
},sortRecords:function(A, B) {
    return this._records.sort(function(D, C) {
        return A(D, C, B);
    });
},reverseRecords:function() {
    return this._records.reverse();
},deleteRecord:function(A) {
    if (YAHOO.lang.isNumber(A) && (A > -1) && (A < this.getLength())) {
        var B = YAHOO.widget.DataTable._cloneObject(this.getRecord(A).getData());
        this._deleteRecord(A);
        this.fireEvent("recordDeleteEvent", {data:B,index:A});
        return B;
    } else {
        return null;
    }
},deleteRecords:function(C, A) {
    if (!YAHOO.lang.isNumber(A)) {
        A = 1;
    }
    if (YAHOO.lang.isNumber(C) && (C > -1) && (C < this.getLength())) {
        var E = this.getRecords(C, A);
        var B = [];
        for (var D = 0; D < E.length; D++) {
            B[B.length] = YAHOO.widget.DataTable._cloneObject(E[D]);
        }
        this._deleteRecord(C, A);
        this.fireEvent("recordsDeleteEvent", {data:B,index:C});
        return B;
    } else {
        return null;
    }
},reset:function() {
    this._records = [];
    this.fireEvent("resetEvent");
}};
YAHOO.augment(YAHOO.widget.RecordSet, YAHOO.util.EventProvider);
YAHOO.widget.Record = function(A) {
    this._sId = "yui-rec" + YAHOO.widget.Record._nCount;
    YAHOO.widget.Record._nCount++;
    this._oData = {};
    if (A && (A.constructor == Object)) {
        for (var B in A) {
            this._oData[B] = A[B];
        }
    }
};
YAHOO.widget.Record._nCount = 0;
YAHOO.widget.Record.prototype = {_sId:null,_oData:null,getId:function() {
    return this._sId;
},getData:function(A) {
    if (YAHOO.lang.isString(A)) {
        return this._oData[A];
    } else {
        return this._oData;
    }
},setData:function(A, B) {
    this._oData[A] = B;
}};
YAHOO.widget.Paginator = function(D) {
    var H = YAHOO.widget.Paginator.VALUE_UNLIMITED,G = YAHOO.lang,E,A,B,C;
    D = G.isObject(D) ? D : {};
    this.initConfig();
    this.initEvents();
    this.set("rowsPerPage", D.rowsPerPage, true);
    if (G.isNumber(D.totalRecords)) {
        this.set("totalRecords", D.totalRecords, true);
    }
    this.initUIComponents();
    for (E in D) {
        if (G.hasOwnProperty(D, E)) {
            this.set(E, D[E], true);
        }
    }
    A = this.get("initialPage");
    B = this.get("totalRecords");
    C = this.get("rowsPerPage");
    if (A > 1 && C !== H) {
        var F = (A - 1) * C;
        if (B === H || F < B) {
            this.set("recordOffset", F, true);
        }
    }
};
YAHOO.lang.augmentObject(YAHOO.widget.Paginator, {id:0,ID_BASE:"yui-pg",VALUE_UNLIMITED:-1,TEMPLATE_DEFAULT:"{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}",TEMPLATE_ROWS_PER_PAGE:"{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"}, true);
YAHOO.widget.Paginator.prototype = {_containers:[],initConfig:function() {
    var B = YAHOO.widget.Paginator.VALUE_UNLIMITED,A = YAHOO.lang;
    this.setAttributeConfig("rowsPerPage", {value:0,validator:A.isNumber});
    this.setAttributeConfig("containers", {value:null,writeOnce:true,validator:function(E) {
        if (!A.isArray(E)) {
            E = [E];
        }
        for (var D = 0,C = E.length; D < C; ++D) {
            if (A.isString(E[D]) || (A.isObject(E[D]) && E[D].nodeType === 1)) {
                continue;
            }
            return false;
        }
        return true;
    },method:function(C) {
        C = YAHOO.util.Dom.get(C);
        if (!A.isArray(C)) {
            C = [C];
        }
        this._containers = C;
    }});
    this.setAttributeConfig("totalRecords", {value:0,validator:A.isNumber,method:function(C) {
        this._syncRecordOffset(C);
    }});
    this.setAttributeConfig("recordOffset", {value:0,validator:function(D) {
        var C = this.get("totalRecords");
        if (A.isNumber(D)) {
            return C === B || C > D;
        }
        return false;
    }});
    this.setAttributeConfig("initialPage", {value:1,validator:A.isNumber});
    this.setAttributeConfig("template", {value:YAHOO.widget.Paginator.TEMPLATE_DEFAULT,validator:A.isString});
    this.setAttributeConfig("containerClass", {value:"yui-pg-container",validator:A.isString});
    this.setAttributeConfig("alwaysVisible", {value:true,validator:A.isBoolean});
    this.setAttributeConfig("updateOnChange", {value:false,validator:A.isBoolean});
    this.setAttributeConfig("id", {value:YAHOO.widget.Paginator.id++,readOnly:true});
    this.setAttributeConfig("rendered", {value:false,readOnly:true});
},initUIComponents:function() {
    var C = YAHOO.widget.Paginator.ui;
    for (var B in C) {
        var A = C[B];
        if (YAHOO.lang.isObject(A) && YAHOO.lang.isFunction(A.init)) {
            A.init(this);
        }
    }
},initEvents:function() {
    this.createEvent("recordOffsetChange");
    this.createEvent("totalRecordsChange");
    this.createEvent("rowsPerPageChange");
    this.createEvent("alwaysVisibleChange");
    this.createEvent("rendered");
    this.createEvent("changeRequest");
    this.createEvent("beforeDestroy");
    this.subscribe("totalRecordsChange", this.updateVisibility, this, true);
    this.subscribe("alwaysVisibleChange", this.updateVisibility, this, true);
},render:function() {
    if (this.get("rendered")) {
        return;
    }
    var M = this.get("totalRecords");
    if (M !== YAHOO.widget.Paginator.VALUE_UNLIMITED && M < this.get("rowsPerPage") && !this.get("alwaysVisible")) {
        return;
    }
    var F = YAHOO.util.Dom,N = this.get("template"),P = this.get("containerClass");
    N = N.replace(/\{([a-z0-9_ \-]+)\}/gi, '<span class="yui-pg-ui $1"></span>');
    for (var H = 0,J = this._containers.length; H < J; ++H) {
        var L = this._containers[H],G = YAHOO.widget.Paginator.ID_BASE + this.get("id") + "-" + H;
        if (!L) {
            continue;
        }
        L.style.display = "none";
        F.addClass(L, P);
        L.innerHTML = N;
        var E = F.getElementsByClassName("yui-pg-ui", "span", L);
        for (var D = 0,O = E.length; D < O; ++D) {
            var C = E[D],B = C.parentNode,A = C.className.replace(/\s*yui-pg-ui\s+/g, ""),K = YAHOO.widget.Paginator.ui[A];
            if (YAHOO.lang.isFunction(K)) {
                var I = new K(this);
                if (YAHOO.lang.isFunction(I.render)) {
                    B.replaceChild(I.render(G), C);
                }
            }
        }
        L.style.display = "";
    }
    if (this._containers.length) {
        this.setAttributeConfig("rendered", {value:true});
        this.fireEvent("rendered", this.getState());
    }
},destroy:function() {
    this.fireEvent("beforeDestroy");
    for (var B = 0,A = this._containers.length; B < A; ++B) {
        this._containers[B].innerHTML = "";
    }
    this.setAttributeConfig("rendered", {value:false});
},updateVisibility:function(F) {
    var B = this.get("alwaysVisible");
    if (F.type === "alwaysVisibleChange" || !B) {
        var H = this.get("totalRecords"),G = true,D = this.get("rowsPerPage"),E = this.get("rowsPerPageOptions"),C,A;
        if (YAHOO.lang.isArray(E)) {
            for (C = 0,A = E.length; C < A; ++C) {
                D = Math.min(D, E[C]);
            }
        }
        if (H !== YAHOO.widget.Paginator.VALUE_UNLIMITED && H <= D) {
            G = false;
        }
        G = G || B;
        for (C = 0,A = this._containers.length; C < A; ++C) {
            YAHOO.util.Dom.setStyle(this._containers[C], "display", G ? "" : "none");
        }
    }
},getContainerNodes:function() {
    return this._containers;
},getTotalPages:function() {
    var A = this.get("totalRecords");
    var B = this.get("rowsPerPage");
    if (!B) {
        return null;
    }
    if (A === YAHOO.widget.Paginator.VALUE_UNLIMITED) {
        return YAHOO.widget.Paginator.VALUE_UNLIMITED;
    }
    return Math.ceil(A / B);
},hasPage:function(B) {
    if (!YAHOO.lang.isNumber(B) || B < 1) {
        return false;
    }
    var A = this.getTotalPages();
    return(A === YAHOO.widget.Paginator.VALUE_UNLIMITED || A >= B);
},getCurrentPage:function() {
    var A = this.get("rowsPerPage");
    if (!A || !this.get("totalRecords")) {
        return 0;
    }
    return Math.floor(this.get("recordOffset") / A) + 1;
},hasNextPage:function() {
    var A = this.getCurrentPage(),B = this.getTotalPages();
    return A && (B === YAHOO.widget.Paginator.VALUE_UNLIMITED || A < B);
},getNextPage:function() {
    return this.hasNextPage() ? this.getCurrentPage() + 1 : null;
},hasPreviousPage:function() {
    return(this.getCurrentPage() > 1);
},getPreviousPage:function() {
    return(this.hasPreviousPage() ? this.getCurrentPage() - 1 : 1);
},getPageRecords:function(D) {
    if (!YAHOO.lang.isNumber(D)) {
        D = this.getCurrentPage();
    }
    var C = this.get("rowsPerPage"),B = this.get("totalRecords"),E,A;
    if (!D || !C) {
        return null;
    }
    E = (D - 1) * C;
    if (B !== YAHOO.widget.Paginator.VALUE_UNLIMITED) {
        if (E >= B) {
            return null;
        }
        A = Math.min(E + C, B) - 1;
    } else {
        A = E + C - 1;
    }
    return[E,A];
},setPage:function(B, A) {
    if (this.hasPage(B) && B !== this.getCurrentPage()) {
        if (this.get("updateOnChange") || A) {
            this.set("recordOffset", (B - 1) * this.get("rowsPerPage"));
        } else {
            this.fireEvent("changeRequest", this.getState({"page":B}));
        }
    }
},getRowsPerPage:function() {
    return this.get("rowsPerPage");
},setRowsPerPage:function(B, A) {
    if (YAHOO.lang.isNumber(B) && B > 0 && B !== this.get("rowsPerPage")) {
        if (this.get("updateOnChange") || A) {
            this.set("rowsPerPage", B);
        } else {
            this.fireEvent("changeRequest", this.getState({"rowsPerPage":B}));
        }
    }
},getTotalRecords:function() {
    return this.get("totalRecords");
},setTotalRecords:function(B, A) {
    if (YAHOO.lang.isNumber(B) && B >= 0 && B !== this.get("totalRecords")) {
        if (this.get("updateOnChange") || A) {
            this.set("totalRecords", B);
        } else {
            this.fireEvent("changeRequest", this.getState({"totalRecords":B}));
        }
    }
},getStartIndex:function() {
    return this.get("recordOffset");
},setStartIndex:function(B, A) {
    if (YAHOO.lang.isNumber(B) && B >= 0 && B !== this.get("recordOffset")) {
        if (this.get("updateOnChange") || A) {
            this.set("recordOffset", B);
        } else {
            this.fireEvent("changeRequest", this.getState({"recordOffset":B}));
        }
    }
},getState:function(C) {
    var F = YAHOO.widget.Paginator.VALUE_UNLIMITED,A = YAHOO.lang;
    var B = {paginator:this,page:this.getCurrentPage(),totalRecords:this.get("totalRecords"),recordOffset:this.get("recordOffset"),rowsPerPage:this.get("rowsPerPage"),records:this.getPageRecords()};
    if (!C) {
        return B;
    }
    var E = B.recordOffset;
    var D = {paginator:this,before:B,rowsPerPage:C.rowsPerPage || B.rowsPerPage,totalRecords:(A.isNumber(C.totalRecords) ? Math.max(C.totalRecords, F) : B.totalRecords)};
    if (D.totalRecords === 0) {
        E = 0;
        D.page = 0;
    } else {
        if (!A.isNumber(C.recordOffset) && A.isNumber(C.page)) {
            E = (C.page - 1) * D.rowsPerPage;
            if (D.totalRecords === F) {
                D.page = C.page;
            } else {
                D.page = Math.min(C.page, Math.ceil(D.totalRecords / D.rowsPerPage));
                E = Math.min(E, D.totalRecords - 1);
            }
        } else {
            E = Math.min(E, D.totalRecords - 1);
            D.page = Math.floor(E / D.rowsPerPage) + 1;
        }
    }
    D.recordOffset = D.recordOffset || E - (E % D.rowsPerPage);
    D.records = [D.recordOffset,D.recordOffset + D.rowsPerPage - 1];
    if (D.totalRecords !== F && D.recordOffset < D.totalRecords && D.records[1] > D.totalRecords - 1) {
        D.records[1] = D.totalRecords - 1;
    }
    return D;
},_syncRecordOffset:function(A) {
    if (A !== YAHOO.widget.Paginator.VALUE_UNLIMITED) {
        var B = this.get("rowsPerPage");
        if (B && this.get("recordOffset") >= A) {
            this.set("recordOffset", Math.max(0, (A - (A % B || B))));
        }
    }
}};
YAHOO.lang.augmentProto(YAHOO.widget.Paginator, YAHOO.util.AttributeProvider);
(function() {
    YAHOO.widget.Paginator.ui = {};
    var C = YAHOO.widget.Paginator,B = C.ui,A = YAHOO.lang;
    B.FirstPageLink = function(D) {
        this.paginator = D;
        D.createEvent("firstPageLinkLabelChange");
        D.createEvent("firstPageLinkClassChange");
        D.subscribe("recordOffsetChange", this.update, this, true);
        D.subscribe("beforeDestroy", this.destroy, this, true);
        D.subscribe("firstPageLinkLabelChange", this.update, this, true);
        D.subscribe("firstPageLinkClassChange", this.update, this, true);
    };
    B.FirstPageLink.init = function(D) {
        D.setAttributeConfig("firstPageLinkLabel", {value:"&lt;&lt;&nbsp;first",validator:A.isString});
        D.setAttributeConfig("firstPageLinkClass", {value:"yui-pg-first",validator:A.isString});
    };
    B.FirstPageLink.prototype = {current:null,link:null,span:null,render:function(E) {
        var F = this.paginator,G = F.get("firstPageLinkClass"),D = F.get("firstPageLinkLabel");
        this.link = document.createElement("a");
        this.span = document.createElement("span");
        this.link.id = E + "-first-link";
        this.link.href = "#";
        this.link.className = G;
        this.link.innerHTML = D;
        YAHOO.util.Event.on(this.link, "click", this.onClick, this, true);
        this.span.id = E + "-first-span";
        this.span.className = G;
        this.span.innerHTML = D;
        this.current = F.get("recordOffset") < 1 ? this.span : this.link;
        return this.current;
    },update:function(E) {
        if (E && E.prevValue === E.newValue) {
            return;
        }
        var D = this.current ? this.current.parentNode : null;
        if (this.paginator.get("recordOffset") < 1) {
            if (D && this.current === this.link) {
                D.replaceChild(this.span, this.current);
                this.current = this.span;
            }
        } else {
            if (D && this.current === this.span) {
                D.replaceChild(this.link, this.current);
                this.current = this.link;
            }
        }
    },destroy:function() {
        YAHOO.util.Event.purgeElement(this.link);
    },onClick:function(D) {
        YAHOO.util.Event.stopEvent(D);
        this.paginator.setPage(1);
    }};
    B.LastPageLink = function(D) {
        this.paginator = D;
        D.createEvent("lastPageLinkLabelChange");
        D.createEvent("lastPageLinkClassChange");
        D.subscribe("recordOffsetChange", this.update, this, true);
        D.subscribe("totalRecordsChange", this.update, this, true);
        D.subscribe("rowsPerPageChange", this.update, this, true);
        D.subscribe("beforeDestroy", this.destroy, this, true);
        D.subscribe("lastPageLinkLabelChange", this.update, this, true);
        D.subscribe("lastPageLinkClassChange", this.update, this, true);
    };
    B.LastPageLink.init = function(D) {
        D.setAttributeConfig("lastPageLinkLabel", {value:"last&nbsp;&gt;&gt;",validator:A.isString});
        D.setAttributeConfig("lastPageLinkClass", {value:"yui-pg-last",validator:A.isString});
    };
    B.LastPageLink.prototype = {current:null,link:null,span:null,na:null,render:function(E) {
        var G = this.paginator,H = G.get("lastPageLinkClass"),D = G.get("lastPageLinkLabel"),F = G.getTotalPages();
        this.link = document.createElement("a");
        this.span = document.createElement("span");
        this.na = this.span.cloneNode(false);
        this.link.id = E + "-last-link";
        this.link.href = "#";
        this.link.className = H;
        this.link.innerHTML = D;
        YAHOO.util.Event.on(this.link, "click", this.onClick, this, true);
        this.span.id = E + "-last-span";
        this.span.className = H;
        this.span.innerHTML = D;
        this.na.id = E + "-last-na";
        switch (F) {case C.VALUE_UNLIMITED:this.current = this.na;break;case G.getCurrentPage():this.current = this.span;break;default:this.current = this.link;}
        return this.current;
    },update:function(E) {
        if (E && E.prevValue === E.newValue) {
            return;
        }
        var D = this.current ? this.current.parentNode : null,F = this.link;
        if (D) {
            switch (this.paginator.getTotalPages()) {case C.VALUE_UNLIMITED:F = this.na;break;case this.paginator.getCurrentPage():F = this.span;break;}
            if (this.current !== F) {
                D.replaceChild(F, this.current);
                this.current = F;
            }
        }
    },destroy:function() {
        YAHOO.util.Event.purgeElement(this.link);
    },onClick:function(D) {
        YAHOO.util.Event.stopEvent(D);
        this.paginator.setPage(this.paginator.getTotalPages());
    }};
    B.PreviousPageLink = function(D) {
        this.paginator = D;
        D.createEvent("previousPageLinkLabelChange");
        D.createEvent("previousPageLinkClassChange");
        D.subscribe("recordOffsetChange", this.update, this, true);
        D.subscribe("beforeDestroy", this.destroy, this, true);
        D.subscribe("previousPageLinkLabelChange", this.update, this, true);
        D.subscribe("previousPageLinkClassChange", this.update, this, true);
    };
    B.PreviousPageLink.init = function(D) {
        D.setAttributeConfig("previousPageLinkLabel", {value:"&lt;&nbsp;prev",validator:A.isString});
        D.setAttributeConfig("previousPageLinkClass", {value:"yui-pg-previous",validator:A.isString});
    };
    B.PreviousPageLink.prototype = {current:null,link:null,span:null,render:function(E) {
        var F = this.paginator,G = F.get("previousPageLinkClass"),D = F.get("previousPageLinkLabel");
        this.link = document.createElement("a");
        this.span = document.createElement("span");
        this.link.id = E + "-prev-link";
        this.link.href = "#";
        this.link.className = G;
        this.link.innerHTML = D;
        YAHOO.util.Event.on(this.link, "click", this.onClick, this, true);
        this.span.id = E + "-prev-span";
        this.span.className = G;
        this.span.innerHTML = D;
        this.current = F.get("recordOffset") < 1 ? this.span : this.link;
        return this.current;
    },update:function(E) {
        if (E && E.prevValue === E.newValue) {
            return;
        }
        var D = this.current ? this.current.parentNode : null;
        if (this.paginator.get("recordOffset") < 1) {
            if (D && this.current === this.link) {
                D.replaceChild(this.span, this.current);
                this.current = this.span;
            }
        } else {
            if (D && this.current === this.span) {
                D.replaceChild(this.link, this.current);
                this.current = this.link;
            }
        }
    },destroy:function() {
        YAHOO.util.Event.purgeElement(this.link);
    },onClick:function(D) {
        YAHOO.util.Event.stopEvent(D);
        this.paginator.setPage(this.paginator.getPreviousPage());
    }};
    B.NextPageLink = function(D) {
        this.paginator = D;
        D.createEvent("nextPageLinkLabelChange");
        D.createEvent("nextPageLinkClassChange");
        D.subscribe("recordOffsetChange", this.update, this, true);
        D.subscribe("totalRecordsChange", this.update, this, true);
        D.subscribe("rowsPerPageChange", this.update, this, true);
        D.subscribe("beforeDestroy", this.destroy, this, true);
        D.subscribe("nextPageLinkLabelChange", this.update, this, true);
        D.subscribe("nextPageLinkClassChange", this.update, this, true);
    };
    B.NextPageLink.init = function(D) {
        D.setAttributeConfig("nextPageLinkLabel", {value:"next&nbsp;&gt;",validator:A.isString});
        D.setAttributeConfig("nextPageLinkClass", {value:"yui-pg-next",validator:A.isString});
    };
    B.NextPageLink.prototype = {current:null,link:null,span:null,render:function(E) {
        var G = this.paginator,H = G.get("nextPageLinkClass"),D = G.get("nextPageLinkLabel"),F = G.getTotalPages();
        this.link = document.createElement("a");
        this.span = document.createElement("span");
        this.link.id = E + "-next-link";
        this.link.href = "#";
        this.link.className = H;
        this.link.innerHTML = D;
        YAHOO.util.Event.on(this.link, "click", this.onClick, this, true);
        this.span.id = E + "-next-span";
        this.span.className = H;
        this.span.innerHTML = D;
        this.current = G.getCurrentPage() === F ? this.span : this.link;
        return this.current;
    },update:function(F) {
        if (F && F.prevValue === F.newValue) {
            return;
        }
        var E = this.paginator.getTotalPages(),D = this.current ? this.current.parentNode : null;
        if (this.paginator.getCurrentPage() !== E) {
            if (D && this.current === this.span) {
                D.replaceChild(this.link, this.current);
                this.current = this.link;
            }
        } else {
            if (this.current === this.link) {
                if (D) {
                    D.replaceChild(this.span, this.current);
                    this.current = this.span;
                }
            }
        }
    },destroy:function() {
        YAHOO.util.Event.purgeElement(this.link);
    },onClick:function(D) {
        YAHOO.util.Event.stopEvent(D);
        this.paginator.setPage(this.paginator.getNextPage());
    }};
    B.PageLinks = function(D) {
        this.paginator = D;
        D.createEvent("pageLinkClassChange");
        D.createEvent("currentPageClassChange");
        D.createEvent("pageLinksContainerClassChange");
        D.createEvent("pageLinksChange");
        D.subscribe("recordOffsetChange", this.update, this, true);
        D.subscribe("pageLinksChange", this.rebuild, this, true);
        D.subscribe("totalRecordsChange", this.rebuild, this, true);
        D.subscribe("rowsPerPageChange", this.rebuild, this, true);
        D.subscribe("pageLinkClassChange", this.rebuild, this, true);
        D.subscribe("currentPageClassChange", this.rebuild, this, true);
        D.subscribe("beforeDestroy", this.destroy, this, true);
        D.subscribe("pageLinksContainerClassChange", this.rebuild, this, true);
    };
    B.PageLinks.init = function(D) {
        D.setAttributeConfig("pageLinkClass", {value:"yui-pg-page",validator:A.isString});
        D.setAttributeConfig("currentPageClass", {value:"yui-pg-current-page",validator:A.isString});
        D.setAttributeConfig("pageLinksContainerClass", {value:"yui-pg-pages",validator:A.isString});
        D.setAttributeConfig("pageLinks", {value:10,validator:A.isNumber});
        D.setAttributeConfig("pageLabelBuilder", {value:function(E, F) {
            return E;
        },validator:A.isFunction});
    };
    B.PageLinks.calculateRange = function(F, G, E) {
        var J = C.VALUE_UNLIMITED,I,D,H;
        if (!F || E === 0 || G === 0 || (G === J && E === J)) {
            return[0,-1];
        }
        if (G !== J) {
            E = E === J ? G : Math.min(E, G);
        }
        I = Math.max(1, Math.ceil(F - (E / 2)));
        if (G === J) {
            D = I + E - 1;
        } else {
            D = Math.min(G, I + E - 1);
        }
        H = E - (D - I + 1);
        I = Math.max(1, I - H);
        return[I,D];
    };
    B.PageLinks.prototype = {current:0,container:null,render:function(D) {
        var E = this.paginator;
        this.container = document.createElement("span");
        this.container.id = D + "-pages";
        this.container.className = E.get("pageLinksContainerClass");
        YAHOO.util.Event.on(this.container, "click", this.onClick, this, true);
        this.update({newValue:null,rebuild:true});
        return this.container;
    },update:function(K) {
        if (K && K.prevValue === K.newValue) {
            return;
        }
        var F = this.paginator,J = F.getCurrentPage();
        if (this.current !== J || K.rebuild) {
            var M = F.get("pageLabelBuilder"),I = B.PageLinks.calculateRange(J, F.getTotalPages(), F.get("pageLinks")),E = I[0],G = I[1],L = "",D,H;
            D = '<a href="#" class="' + F.get("pageLinkClass") + '" page="';
            for (H = E; H <= G; ++H) {
                if (H === J) {
                    L += '<span class="' + F.get("currentPageClass") + " " + F.get("pageLinkClass") + '">' + M(H, F) + "</span>";
                } else {
                    L += D + H + '">' + M(H, F) + "</a>";
                }
            }
            this.container.innerHTML = L;
        }
    },rebuild:function(D) {
        D.rebuild = true;
        this.update(D);
    },destroy:function() {
        YAHOO.util.Event.purgeElement(this.container, true);
    },onClick:function(E) {
        var D = YAHOO.util.Event.getTarget(E);
        if (D && YAHOO.util.Dom.hasClass(D, this.paginator.get("pageLinkClass"))) {
            YAHOO.util.Event.stopEvent(E);
            this.paginator.setPage(parseInt(D.getAttribute("page"), 10));
        }
    }};
    B.RowsPerPageDropdown = function(D) {
        this.paginator = D;
        D.createEvent("rowsPerPageOptionsChange");
        D.createEvent("rowsPerPageDropdownClassChange");
        D.subscribe("rowsPerPageChange", this.update, this, true);
        D.subscribe("rowsPerPageOptionsChange", this.rebuild, this, true);
        D.subscribe("beforeDestroy", this.destroy, this, true);
        D.subscribe("rowsPerPageDropdownClassChange", this.rebuild, this, true);
    };
    B.RowsPerPageDropdown.init = function(D) {
        D.setAttributeConfig("rowsPerPageOptions", {value:[],validator:A.isArray});
        D.setAttributeConfig("rowsPerPageDropdownClass", {value:"yui-pg-rpp-options",validator:A.isString});
    };
    B.RowsPerPageDropdown.prototype = {select:null,render:function(D) {
        this.select = document.createElement("select");
        this.select.id = D + "-rpp";
        this.select.className = this.paginator.get("rowsPerPageDropdownClass");
        this.select.title = "Rows per page";
        YAHOO.util.Event.on(this.select, "change", this.onChange, this, true);
        this.rebuild();
        return this.select;
    },update:function(H) {
        if (H && H.prevValue === H.newValue) {
            return;
        }
        var G = this.paginator.get("rowsPerPage"),E = this.select.options,F,D;
        for (F = 0,D = E.length; F < D; ++F) {
            if (parseInt(E[F].value, 10) === G) {
                E[F].selected = true;
            }
        }
    },rebuild:function(K) {
        var F = this.paginator,G = this.select,L = F.get("rowsPerPageOptions"),D = document.createElement("option"),I,J;
        while (G.firstChild) {
            G.removeChild(G.firstChild);
        }
        for (I = 0,J = L.length; I < J; ++I) {
            var H = D.cloneNode(false),E = L[I];
            H.value = A.isValue(E.value) ? E.value : E;
            H.innerHTML = A.isValue(E.text) ? E.text : E;
            G.appendChild(H);
        }
        this.update();
    },destroy:function() {
        YAHOO.util.Event.purgeElement(this.select);
    },onChange:function(D) {
        this.paginator.setRowsPerPage(parseInt(this.select.options[this.select.selectedIndex].value, 10));
    }};
    B.CurrentPageReport = function(D) {
        this.paginator = D;
        D.createEvent("pageReportClassChange");
        D.createEvent("pageReportTemplateChange");
        D.subscribe("recordOffsetChange", this.update, this, true);
        D.subscribe("totalRecordsChange", this.update, this, true);
        D.subscribe("rowsPerPageChange", this.update, this, true);
        D.subscribe("pageReportTemplateChange", this.update, this, true);
        D.subscribe("pageReportClassChange", this.update, this, true);
    };
    B.CurrentPageReport.init = function(D) {
        D.setAttributeConfig("pageReportClass", {value:"yui-pg-current",validator:A.isString});
        D.setAttributeConfig("pageReportTemplate", {value:"({currentPage} of {totalPages})",validator:A.isString});
        D.setAttributeConfig("pageReportValueGenerator", {value:function(G) {
            var F = G.getCurrentPage(),E = G.getPageRecords();
            return{"currentPage":E ? F : 0,"totalPages":G.getTotalPages(),"startIndex":E ? E[0] : 0,"endIndex":E ? E[1] : 0,"startRecord":E ? E[0] + 1 : 0,"endRecord":E ? E[1] + 1 : 0,"totalRecords":G.get("totalRecords")};
        },validator:A.isFunction});
    };
    B.CurrentPageReport.sprintf = function(E, D) {
        return E.replace(/{([\w\s\-]+)}/g, function(F, G) {
            return(G in D) ? D[G] : "";
        });
    };
    B.CurrentPageReport.prototype = {span:null,render:function(D) {
        this.span = document.createElement("span");
        this.span.id = D + "-page-report";
        this.span.className = this.paginator.get("pageReportClass");
        this.update();
        return this.span;
    },update:function(D) {
        if (D && D.prevValue === D.newValue) {
            return;
        }
        this.span.innerHTML = B.CurrentPageReport.sprintf(this.paginator.get("pageReportTemplate"), this.paginator.get("pageReportValueGenerator")(this.paginator));
    }};
})();
YAHOO.widget.DataTable = function(A, G, I, C) {
    var E = YAHOO.widget.DataTable,F = YAHOO.util.DataSource;
    this._nIndex = E._nCount;
    this._sId = "yui-dt" + this._nIndex;
    this._oChainRender = new YAHOO.util.Chain();
    this._oChainSync = new YAHOO.util.Chain();
    this._oChainRender.subscribe("end", this._sync, this, true);
    this._initConfigs(C);
    this._initDataSource(I);
    if (!this._oDataSource) {
        return;
    }
    this._initColumnSet(G);
    if (!this._oColumnSet) {
        return;
    }
    this._initRecordSet();
    if (!this._oRecordSet) {
        return;
    }
    this._initNodeTemplates();
    this._initContainerEl(A);
    if (!this._elContainer) {
        return;
    }
    this._initTableEl();
    if (!this._elContainer || !this._elThead || !this._elTbody) {
        return;
    }
    E.superclass.constructor.call(this, this._elContainer, this._oConfigs);
    var D = this.get("sortedBy");
    if (D) {
        if (D.dir == "desc") {
            this._configs.sortedBy.value.dir = E.CLASS_DESC;
        } else {
            if (D.dir == "asc") {
                this._configs.sortedBy.value.dir = E.CLASS_ASC;
            }
        }
    }
    if (this._oConfigs.paginator && !(this._oConfigs.paginator instanceof YAHOO.widget.Paginator)) {
        this.updatePaginator(this._oConfigs.paginator);
    }
    this._initCellEditorEl();
    this._initColumnSort();
    YAHOO.util.Event.addListener(document, "click", this._onDocumentClick, this);
    E._nCount++;
    E._nCurrentCount++;
    var H = {success:this.onDataReturnSetRows,failure:this.onDataReturnSetRows,scope:this,argument:{}};
    if (this.get("initialLoad") === true) {
        this._oDataSource.sendRequest(this.get("initialRequest"), H);
    } else {
        if (this.get("initialLoad") === false) {
            this.showTableMessage(E.MSG_EMPTY, E.CLASS_EMPTY);
            this._oChainRender.add({method:function() {
                if ((this instanceof E) && this._sId && this._bInit) {
                    this._bInit = false;
                    this.fireEvent("initEvent");
                }
            },scope:this});
            this._oChainRender.run();
        } else {
            var B = this.get("initialLoad");
            H.argument = B.argument;
            this._oDataSource.sendRequest(B.request, H);
        }
    }
};
(function() {
    var C = YAHOO.lang,F = YAHOO.util,E = YAHOO.widget,A = YAHOO.env.ua,D = F.Dom,I = F.Event,H = F.DataSource,G = E.DataTable,B = E.Paginator;
    C.augmentObject(G, {CLASS_LINER:"yui-dt-liner",CLASS_LABEL:"yui-dt-label",CLASS_COLTARGET:"yui-dt-coltarget",CLASS_RESIZER:"yui-dt-resizer",CLASS_RESIZERPROXY:"yui-dt-resizerproxy",CLASS_EDITOR:"yui-dt-editor",CLASS_PAGINATOR:"yui-dt-paginator",CLASS_PAGE:"yui-dt-page",CLASS_DEFAULT:"yui-dt-default",CLASS_PREVIOUS:"yui-dt-previous",CLASS_NEXT:"yui-dt-next",CLASS_FIRST:"yui-dt-first",CLASS_LAST:"yui-dt-last",CLASS_EVEN:"yui-dt-even",CLASS_ODD:"yui-dt-odd",CLASS_SELECTED:"yui-dt-selected",CLASS_HIGHLIGHTED:"yui-dt-highlighted",CLASS_HIDDEN:"yui-dt-hidden",CLASS_DISABLED:"yui-dt-disabled",CLASS_MSG:"yui-dt-msg",CLASS_EMPTY:"yui-dt-empty",CLASS_LOADING:"yui-dt-loading",CLASS_ERROR:"yui-dt-error",CLASS_EDITABLE:"yui-dt-editable",CLASS_DRAGGABLE:"yui-dt-draggable",CLASS_RESIZEABLE:"yui-dt-resizeable",CLASS_SCROLLABLE:"yui-dt-scrollable",COLOR_COLUMNFILLER:"#F2F2F2",CLASS_SORTABLE:"yui-dt-sortable",CLASS_ASC:"yui-dt-asc",CLASS_DESC:"yui-dt-desc",CLASS_BUTTON:"yui-dt-button",CLASS_CHECKBOX:"yui-dt-checkbox",CLASS_DROPDOWN:"yui-dt-dropdown",CLASS_RADIO:"yui-dt-radio",MSG_EMPTY:"No matches found.",MSG_LOADING:"Loading data...",MSG_ERROR:"Data error.",_nCount:0,_nCurrentCount:0,_elStylesheet:null,_bStylesheetFallback:(A.ie && (A.ie < 7)) ? true : false,_oStylesheetRules:{},_elColumnDragTarget:null,_elColumnResizerProxy:null,_cloneObject:function(M) {
        if (!C.isValue(M)) {
            return M;
        }
        var O = {};
        if (C.isArray(M)) {
            var N = [];
            for (var L = 0,K = M.length; L < K; L++) {
                N[L] = G._cloneObject(M[L]);
            }
            O = N;
        } else {
            if (M.constructor && (M.constructor == Object)) {
                for (var J in M) {
                    if (C.hasOwnProperty(M, J)) {
                        if (C.isValue(M[J]) && (M[J].constructor == Object) || C.isArray(M[J])) {
                            O[J] = G._cloneObject(M[J]);
                        } else {
                            O[J] = M[J];
                        }
                    }
                }
            } else {
                O = M;
            }
        }
        return O;
    },_initColumnDragTargetEl:function() {
        if (!G._elColumnDragTarget) {
            var J = document.createElement("div");
            J.id = "yui-dt-coltarget";
            J.className = G.CLASS_COLTARGET;
            J.style.display = "none";
            document.body.insertBefore(J, document.body.firstChild);
            G._elColumnDragTarget = J;
        }
        return G._elColumnDragTarget;
    },_initColumnResizerProxyEl:function() {
        if (!G._elColumnResizerProxy) {
            var J = document.createElement("div");
            J.id = "yui-dt-colresizerproxy";
            D.addClass(J, G.CLASS_RESIZERPROXY);
            document.body.insertBefore(J, document.body.firstChild);
            G._elColumnResizerProxy = J;
        }
        return G._elColumnResizerProxy;
    },formatTheadCell:function(J, L, M) {
        var R = L.getKey();
        var Q = C.isValue(L.label) ? L.label : R;
        if (L.sortable) {
            var O = M.getColumnSortDir(L);
            var N = (O === G.CLASS_DESC) ? "descending" : "ascending";
            var K = M.getId() + "-sort" + L.getId() + "-" + N;
            var P = "Click to sort";
            J.innerHTML = '<a href="' + K + '" title="' + P + '" class="' + G.CLASS_SORTABLE + '">' + Q + "</a>";
        } else {
            J.innerHTML = Q;
        }
    },formatButton:function(J, K, L, N) {
        var M = C.isValue(N) ? N : "Click";
        J.innerHTML = '<button type="button" class="' + G.CLASS_BUTTON + '">' + M + "</button>";
    },formatCheckbox:function(J, K, L, N) {
        var M = N;
        M = (M) ? " checked" : "";
        J.innerHTML = '<input type="checkbox"' + M + ' class="' + G.CLASS_CHECKBOX + '">';
    },formatCurrency:function(J, K, L, M) {
        J.innerHTML = F.Number.format(M, {prefix:"$",decimalPlaces:2,decimalSeparator:".",thousandsSeparator:","});
    },formatDate:function(J, K, L, M) {
        J.innerHTML = F.Date.format(M, {format:"MM/DD/YYYY"});
    },formatDropdown:function(L, S, Q, J) {
        var R = (C.isValue(J)) ? J : S.getData(Q.key);
        var T = (C.isArray(Q.dropdownOptions)) ? Q.dropdownOptions : null;
        var K;
        var P = L.getElementsByTagName("select");
        if (P.length === 0) {
            K = document.createElement("select");
            D.addClass(K, G.CLASS_DROPDOWN);
            K = L.appendChild(K);
            I.addListener(K, "change", this._onDropdownChange, this);
        }
        K = P[0];
        if (K) {
            K.innerHTML = "";
            if (T) {
                for (var N = 0; N < T.length; N++) {
                    var O = T[N];
                    var M = document.createElement("option");
                    M.value = (C.isValue(O.value)) ? O.value : O;
                    M.innerHTML = (C.isValue(O.text)) ? O.text : O;
                    M = K.appendChild(M);
                    if (M.value == R) {
                        M.selected = true;
                    }
                }
            } else {
                K.innerHTML = '<option selected value="' + R + '">' + R + "</option>";
            }
        } else {
            L.innerHTML = C.isValue(J) ? J : "";
        }
    },formatEmail:function(J, K, L, M) {
        if (C.isString(M)) {
            J.innerHTML = '<a href="mailto:' + M + '">' + M + "</a>";
        } else {
            J.innerHTML = C.isValue(M) ? M : "";
        }
    },formatLink:function(J, K, L, M) {
        if (C.isString(M)) {
            J.innerHTML = '<a href="' + M + '">' + M + "</a>";
        } else {
            J.innerHTML = C.isValue(M) ? M : "";
        }
    },formatNumber:function(J, K, L, M) {
        if (C.isNumber(M)) {
            J.innerHTML = M;
        } else {
            J.innerHTML = C.isValue(M) ? M : "";
        }
    },formatRadio:function(J, K, L, N) {
        var M = N;
        M = (M) ? " checked" : "";
        J.innerHTML = '<input type="radio"' + M + ' name="col' + L.getId() + '-radio"' + ' class="' + G.CLASS_RADIO + '">';
    },formatText:function(J, K, M, N) {
        var L = (C.isValue(K.getData(M.key))) ? K.getData(M.key) : "";
        J.innerHTML = L.toString().replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");
    },formatTextarea:function(K, L, N, O) {
        var M = (C.isValue(L.getData(N.key))) ? L.getData(N.key) : "";
        var J = "<textarea>" + M + "</textarea>";
        K.innerHTML = J;
    },formatTextbox:function(K, L, N, O) {
        var M = (C.isValue(L.getData(N.key))) ? L.getData(N.key) : "";
        var J = '<input type="text" value="' + M + '">';
        K.innerHTML = J;
    },handleSimplePagination:function(K, J) {
        K.paginator.setTotalRecords(K.totalRecords, true);
        K.paginator.setStartIndex(K.recordOffset, true);
        K.paginator.setRowsPerPage(K.rowsPerPage, true);
        J.render();
    },handleDataSourcePagination:function(K, J) {
        var N = K.records[1] - K.recordOffset;
        var L = J.get("generateRequest");
        var M = L({pagination:K}, J);
        var O = {success:J.onDataReturnSetRows,failure:J.onDataReturnSetRows,argument:{startIndex:K.recordOffset,pagination:K},scope:J};
        J._oDataSource.sendRequest(M, O);
    },editCheckbox:function(S, R) {
        var T = S.cell;
        var X = S.record;
        var P = S.column;
        var J = S.container;
        var M = S.value;
        if (!C.isArray(M)) {
            M = [M];
        }
        if (P.editorOptions && C.isArray(P.editorOptions.checkboxOptions)) {
            var W = P.editorOptions.checkboxOptions;
            var O,U,N,L,K;
            for (L = 0; L < W.length; L++) {
                O = C.isValue(W[L].label) ? W[L].label : W[L];
                U = R.getId() + "-editor-checkbox" + L;
                J.innerHTML += '<input type="checkbox"' + ' name="' + R.getId() + '-editor-checkbox"' + ' value="' + O + '"' + ' id="' + U + '">';
                N = J.appendChild(document.createElement("label"));
                N.htmlFor = U;
                N.innerHTML = O;
            }
            var Q = [];
            var V;
            for (L = 0; L < W.length; L++) {
                V = D.get(R.getId() + "-editor-checkbox" + L);
                Q.push(V);
                for (K = 0; K < M.length; K++) {
                    if (V.value === M[K]) {
                        V.checked = true;
                    }
                }
                if (L === 0) {
                    R._focusEl(V);
                }
            }
            for (L = 0; L < W.length; L++) {
                V = D.get(R.getId() + "-editor-checkbox" + L);
                I.addListener(V, "click", function() {
                    var Z = [];
                    for (var Y = 0; Y < Q.length; Y++) {
                        if (Q[Y].checked) {
                            Z.push(Q[Y].value);
                        }
                    }
                    R._oCellEditor.value = Z;
                    R.fireEvent("editorUpdateEvent", {editor:R._oCellEditor});
                });
            }
        }
    },editDate:function(Q, N) {
        var R = Q.cell;
        var U = Q.record;
        var L = Q.column;
        var J = Q.container;
        var S = Q.value;
        if (!(S instanceof Date)) {
            S = Q.defaultValue || new Date();
        }
        if (YAHOO.widget.Calendar) {
            var M = (S.getMonth() + 1) + "/" + S.getDate() + "/" + S.getFullYear();
            var T = J.appendChild(document.createElement("div"));
            var P = L.getColEl();
            T.id = P + "-dateContainer";
            var K = new YAHOO.widget.Calendar(P + "-date", T.id, {selected:M,pagedate:S});
            K.render();
            T.style.cssFloat = "none";
            if (A.ie) {
                var O = J.appendChild(document.createElement("br"));
                O.style.clear = "both";
            }
            K.selectEvent.subscribe(function(W, V, X) {
                N._oCellEditor.value = new Date(V[0][0][0], V[0][0][1] - 1, V[0][0][2]);
                N.fireEvent("editorUpdateEvent", {editor:N._oCellEditor});
            });
        } else {
        }
    },editDropdown:function(P, O) {
        var Q = P.cell;
        var U = P.record;
        var M = P.column;
        var K = P.container;
        var R = P.value;
        if (!C.isValue(R)) {
            R = P.defaultValue;
        }
        var T = K.appendChild(document.createElement("select"));
        var S = (M.editorOptions && C.isArray(M.editorOptions.dropdownOptions)) ? M.editorOptions.dropdownOptions : [];
        for (var L = 0; L < S.length; L++) {
            var N = S[L];
            var J = document.createElement("option");
            J.value = (C.isValue(N.value)) ? N.value : N;
            J.innerHTML = (C.isValue(N.text)) ? N.text : N;
            J = T.appendChild(J);
            if (R === T.options[L].value) {
                T.options[L].selected = true;
            }
        }
        I.addListener(T, "change", function() {
            O._oCellEditor.value = T[T.selectedIndex].value;
            O.fireEvent("editorUpdateEvent", {editor:O._oCellEditor});
        });
        O._focusEl(T);
    },editRadio:function(Q, O) {
        var R = Q.cell;
        var V = Q.record;
        var N = Q.column;
        var J = Q.container;
        var S = Q.value;
        if (!C.isValue(S)) {
            S = Q.defaultValue;
        }
        if (N.editorOptions && C.isArray(N.editorOptions.radioOptions)) {
            var P = N.editorOptions.radioOptions;
            var K,T,M,L;
            for (L = 0; L < P.length; L++) {
                K = C.isValue(P[L].label) ? P[L].label : P[L];
                T = O.getId() + "-col" + N.getId() + "-radioeditor" + L;
                J.innerHTML += '<input type="radio"' + ' name="' + O.getId() + '-editor-radio"' + ' value="' + K + '"' + ' id="' + T + '">';
                M = J.appendChild(document.createElement("label"));
                M.htmlFor = T;
                M.innerHTML = K;
            }
            for (L = 0; L < P.length; L++) {
                var U = D.get(O.getId() + "-col" + N.getId() + "-radioeditor" + L);
                if (S === U.value) {
                    U.checked = true;
                    O._focusEl(U);
                }
                I.addListener(U, "click", function() {
                    O._oCellEditor.value = this.value;
                    O.fireEvent("editorUpdateEvent", {editor:O._oCellEditor});
                });
            }
        }
    },editTextarea:function(Q, K) {
        var N = Q.cell;
        var L = Q.record;
        var P = Q.column;
        var O = Q.container;
        var M = Q.value;
        if (!C.isValue(M)) {
            M = Q.defaultValue || "";
        }
        var J = O.appendChild(document.createElement("textarea"));
        J.style.width = N.offsetWidth + "px";
        J.style.height = "3em";
        J.value = M;
        I.addListener(J, "keyup", function() {
            K._oCellEditor.value = J.value;
            K.fireEvent("editorUpdateEvent", {editor:K._oCellEditor});
        });
        J.focus();
        J.select();
    },editTextbox:function(P, J) {
        var M = P.cell;
        var K = P.record;
        var O = P.column;
        var N = P.container;
        var L = P.value;
        if (!C.isValue(L)) {
            L = P.defaultValue || "";
        }
        var Q;
        if (A.webkit > 420) {
            Q = N.appendChild(document.createElement("form")).appendChild(document.createElement("input"));
        } else {
            Q = N.appendChild(document.createElement("input"));
        }
        Q.type = "text";
        Q.style.width = M.offsetWidth + "px";
        Q.value = L;
        I.addListener(Q, "keypress", function(R) {
            if ((R.keyCode === 13)) {
                YAHOO.util.Event.preventDefault(R);
                J.saveCellEditor();
            }
        });
        I.addListener(Q, "keyup", function(R) {
            J._oCellEditor.value = Q.value;
            J.fireEvent("editorUpdateEvent", {editor:J._oCellEditor});
        });
        Q.focus();
        Q.select();
    },validateNumber:function(K) {
        var J = K * 1;
        if (C.isNumber(J)) {
            return J;
        } else {
            return null;
        }
    },_generateRequest:function(L, K) {
        var J = L;
        if (L.pagination) {
            if (K._oDataSource.dataType === H.TYPE_XHR) {
                J = "?page=" + L.pagination.page + "&recordOffset=" + L.pagination.recordOffset + "&rowsPerPage=" + L.pagination.rowsPerPage;
            }
        }
        return J;
    }});
    G.Formatter = {button:G.formatButton,checkbox:G.formatCheckbox,currency:G.formatCurrency,"date":G.formatDate,dropdown:G.formatDropdown,email:G.formatEmail,link:G.formatLink,"number":G.formatNumber,radio:G.formatRadio,text:G.formatText,textarea:G.formatTextarea,textbox:G.formatTextbox};
    C.extend(G, F.Element, {initAttributes:function(J) {
        J = J || {};
        G.superclass.initAttributes.call(this, J);
        this.setAttributeConfig("summary", {value:null,validator:C.isString,method:function(K) {
            this._elThead.parentNode.summary = K;
        }});
        this.setAttributeConfig("selectionMode", {value:"standard",validator:C.isString});
        this.setAttributeConfig("initialRequest", {value:null});
        this.setAttributeConfig("initialLoad", {value:true});
        this.setAttributeConfig("generateRequest", {value:G._generateRequest,validator:C.isFunction});
        this.setAttributeConfig("sortedBy", {value:null,validator:function(K) {
            if (K) {
                return((K.constructor == Object) && K.key);
            } else {
                return(K === null);
            }
        },method:function(K) {
            var M = this.get("sortedBy");
            if (M && (M.constructor == Object) && M.key) {
                var O = this._oColumnSet.getColumn(M.key);
                var N = this.getThEl(O);
                D.removeClass(N, G.CLASS_ASC);
                D.removeClass(N, G.CLASS_DESC);
            }
            if (K) {
                var P = (K.column) ? K.column : this._oColumnSet.getColumn(K.key);
                if (P) {
                    if (K.dir && ((K.dir == "asc") || (K.dir == "desc"))) {
                        var Q = (K.dir == "desc") ? G.CLASS_DESC : G.CLASS_ASC;
                        D.addClass(P.getThEl(), Q);
                    } else {
                        var L = K.dir || G.CLASS_ASC;
                        D.addClass(P.getThEl(), L);
                    }
                }
            }
        }});
        this.setAttributeConfig("paginator", {value:{rowsPerPage:500,currentPage:1,startRecordIndex:0,totalRecords:0,totalPages:0,rowsThisPage:0,pageLinks:0,pageLinksStart:1,dropdownOptions:null,containers:[],dropdowns:[],links:[]},validator:function(K) {
            if (typeof K === "object" && K) {
                if (K instanceof B) {
                    return true;
                } else {
                    if (K && (K.constructor == Object)) {
                        if ((K.rowsPerPage !== undefined) && (K.currentPage !== undefined) && (K.startRecordIndex !== undefined) && (K.totalRecords !== undefined) && (K.totalPages !== undefined) && (K.rowsThisPage !== undefined) && (K.pageLinks !== undefined) && (K.pageLinksStart !== undefined) && (K.dropdownOptions !== undefined) && (K.containers !== undefined) && (K.dropdowns !== undefined) && (K.links !== undefined)) {
                            if (C.isNumber(K.rowsPerPage) && C.isNumber(K.currentPage) && C.isNumber(K.startRecordIndex) && C.isNumber(K.totalRecords) && C.isNumber(K.totalPages) && C.isNumber(K.rowsThisPage) && C.isNumber(K.pageLinks) && C.isNumber(K.pageLinksStart) && (C.isArray(K.dropdownOptions) || C.isNull(K.dropdownOptions)) && C.isArray(K.containers) && C.isArray(K.dropdowns) && C.isArray(K.links)) {
                                return true;
                            }
                        }
                    }
                }
            }
            return false;
        },method:function(L) {
            if (L instanceof B) {
                L.subscribe("changeRequest", this.onPaginatorChange, this, true);
                var M = L.getContainerNodes();
                if (!M.length) {
                    var K = document.createElement("div");
                    K.id = this._sId + "-paginator0";
                    this._elContainer.insertBefore(K, this._elContainer.firstChild);
                    var N = document.createElement("div");
                    N.id = this._sId + "-paginator1";
                    this._elContainer.appendChild(N);
                    M = [K,N];
                    D.addClass(M, G.CLASS_PAGINATOR);
                    L.set("containers", M);
                }
            }
        }});
        this.setAttributeConfig("paginated", {value:false,validator:C.isBoolean,method:function(N) {
            var P = this.get("paginated");
            var L,M;
            if (N == P) {
                return;
            }
            var Q = this.get("paginator");
            if (!(Q instanceof B)) {
                Q = Q || {rowsPerPage:500,currentPage:1,startRecordIndex:0,totalRecords:0,totalPages:0,rowsThisPage:0,pageLinks:0,pageLinksStart:1,dropdownOptions:null,containers:[],dropdowns:[],links:[]};
                var O = Q.containers;
                if (N) {
                    if (O.length === 0) {
                        var U = document.createElement("span");
                        U.id = this._sId + "-paginator0";
                        D.addClass(U, G.CLASS_PAGINATOR);
                        U = this._elContainer.insertBefore(U, this._elContainer.firstChild);
                        O.push(U);
                        var S = document.createElement("span");
                        S.id = this._sId + "-paginator1";
                        D.addClass(S, G.CLASS_PAGINATOR);
                        S = this._elContainer.appendChild(S);
                        O.push(S);
                        Q.containers = O;
                        this._configs.paginator.value = Q;
                    } else {
                        for (L = 0; L < O.length; L++) {
                            O[L].style.display = "";
                        }
                    }
                    if (Q.pageLinks > -1) {
                        var T = Q.links;
                        if (T.length === 0) {
                            for (L = 0; L < O.length; L++) {
                                var R = document.createElement("span");
                                R.id = "yui-dt-pagselect" + L;
                                R = O[L].appendChild(R);
                                I.addListener(R, "click", this._onPaginatorLinkClick, this);
                                this._configs.paginator.value.links.push(R);
                            }
                        }
                    }
                    for (L = 0; L < O.length; L++) {
                        var K = document.createElement("select");
                        D.addClass(K, G.CLASS_DROPDOWN);
                        K = O[L].appendChild(K);
                        K.id = "yui-dt-pagselect" + L;
                        I.addListener(K, "change", this._onPaginatorDropdownChange, this);
                        this._configs.paginator.value.dropdowns.push(K);
                        if (!Q.dropdownOptions) {
                            K.style.display = "none";
                        }
                    }
                } else {
                    if (O.length > 0) {
                        for (L = 0; L < O.length; L++) {
                            O[L].style.display = "none";
                        }
                    }
                }
            }
        }});
        this.setAttributeConfig("paginationEventHandler", {value:G.handleSimplePagination,validator:C.isObject});
        this.setAttributeConfig("caption", {value:null,validator:C.isString,method:function(K) {
            if (!this._elCaption) {
                var L = this._elTbodyContainer.getElementsByTagName("table")[0];
                this._elCaption = L.createCaption();
            }
            this._elCaption.innerHTML = K;
        }});
        this.setAttributeConfig("scrollable", {value:false,validator:function(K) {
            return(C.isBoolean(K));
        },method:function(O) {
            var L = this._elTheadContainer.getElementsByTagName("table")[0],K = this._elTbodyContainer.getElementsByTagName("table")[0],N = L.getElementsByTagName("thead")[0],M = K.getElementsByTagName("thead")[0];
            if (O) {
                D.addClass(this._elContainer, G.CLASS_SCROLLABLE);
                if (N) {
                    L.removeChild(N);
                }
                if (M) {
                    K.removeChild(M);
                }
                L.appendChild(this._elThead);
                K.insertBefore(this._elA11yThead, K.firstChild || null);
                if (K.caption) {
                    L.insertBefore(K.caption, L.firstChild);
                }
                K.style.marginTop = "-" + this._elTbody.offsetTop + "px";
                this._syncColWidths();
                this._syncScrollX();
                this._syncScrollY();
            } else {
                if (N) {
                    L.removeChild(N);
                }
                if (M) {
                    K.removeChild(M);
                }
                L.appendChild(this._elA11yThead);
                K.insertBefore(this._elThead, K.firstChild || null);
                K.style.marginTop = "";
                if (L.caption) {
                    K.insertBefore(L.caption, K.firstChild);
                }
                D.removeClass(this._elContainer, G.CLASS_SCROLLABLE);
            }
        }});
        this.setAttributeConfig("width", {value:null,validator:C.isString,method:function(K) {
            if (this.get("scrollable")) {
                this._elTheadContainer.style.width = K;
                this._elTbodyContainer.style.width = K;
                this._syncScrollX();
                this._syncScrollPadding();
                this._forceGeckoRedraw();
            }
        }});
        this.setAttributeConfig("height", {value:null,validator:C.isString,method:function(K) {
            if (this.get("scrollable")) {
                this._elTbodyContainer.style.height = K;
                this._syncScrollY();
                this._syncScrollPadding();
            }
        }});
        this.setAttributeConfig("draggableColumns", {value:false,validator:C.isBoolean,writeOnce:true});
        this.setAttributeConfig("renderLoopSize", {value:0,validator:C.isNumber});
    },_bInit:true,_nIndex:null,_nTrCount:0,_nTdCount:0,_sId:null,_oChainRender:null,_oChainSync:null,_aFallbackColResizer:[],_elContainer:null,_elTheadContainer:null,_elTbodyContainer:null,_elCaption:null,_elThead:null,_elTbody:null,_elMsgTbody:null,_elMsgTbodyRow:null,_elMsgTbodyCell:null,_oDataSource:null,_oColumnSet:null,_oRecordSet:null,_sFirstTrId:null,_sLastTrId:null,_tdElTemplate:null,_trElTemplate:null,_bScrollbarX:null,clearTextSelection:function() {
        var J;
        if (window.getSelection) {
            J = window.getSelection();
        } else {
            if (document.getSelection) {
                J = document.getSelection();
            } else {
                if (document.selection) {
                    J = document.selection;
                }
            }
        }
        if (J) {
            if (J.empty) {
                J.empty();
            } else {
                if (J.removeAllRanges) {
                    J.removeAllRanges();
                } else {
                    if (J.collapse) {
                        J.collapse();
                    }
                }
            }
        }
    },_focusEl:function(J) {
        J = J || this._elTbody;
        setTimeout(function() {
            setTimeout(function() {
                try {
                    J.focus();
                } catch(K) {
                }
            }, 0);
        }, 0);
    },_sync:function() {
        this._syncColWidths();
        this._forceGeckoRedraw();
    },_syncColWidths:function() {
        var Q = this.get("scrollable");
        if (this._elTbody.rows.length > 0) {
            var T = this._oColumnSet.keys,J = this.getFirstTrEl();
            if (T && J && (J.cells.length === T.length)) {
                if (Q) {
                    if (this.get("width")) {
                        this._elTheadContainer.style.width = "";
                        this._elTbodyContainer.style.width = "";
                    }
                    this._elContainer.style.width = "";
                }
                var P,S,M = J.cells.length;
                for (P = 0; P < M; P++) {
                    S = T[P];
                    if (!S.width) {
                        this._setColumnWidth(S, "auto", "visible");
                    }
                }
                for (P = 0; P < M; P++) {
                    S = T[P];
                    var O = 0;
                    var L = "hidden";
                    if (!S.width) {
                        var N = S.getThEl();
                        var R = J.cells[P];
                        if (Q) {
                            var U = (N.offsetWidth > R.offsetWidth) ? N.firstChild : R.firstChild;
                            if (N.offsetWidth !== R.offsetWidth || U.offsetWidth < S.minWidth) {
                                O = Math.max(0, S.minWidth, U.offsetWidth - (parseInt(D.getStyle(U, "paddingLeft"), 10) | 0) - (parseInt(D.getStyle(U, "paddingRight"), 10) | 0));
                            }
                        } else {
                            if (R.offsetWidth < S.minWidth) {
                                L = R.offsetWidth ? "visible" : "hidden";
                                O = Math.max(0, S.minWidth, R.offsetWidth - (parseInt(D.getStyle(R, "paddingLeft"), 10) | 0) - (parseInt(D.getStyle(R, "paddingRight"), 10) | 0));
                            }
                        }
                    } else {
                        O = S.width;
                    }
                    if (S.hidden) {
                        S._nLastWidth = O;
                        this._setColumnWidth(S, "1px", "hidden");
                    } else {
                        if (O) {
                            this._setColumnWidth(S, O + "px", L);
                        }
                    }
                }
                if (Q) {
                    var K = this.get("width");
                    this._elTheadContainer.style.width = K;
                    this._elTbodyContainer.style.width = K;
                }
            }
        }
        this._syncScroll();
    },_syncScroll:function() {
        if (this.get("scrollable")) {
            this._syncScrollX();
            this._syncScrollY();
            this._syncScrollPadding();
            if (A.opera) {
                this._elTheadContainer.scrollLeft = this._elTbodyContainer.scrollLeft;
                if (!this.get("width")) {
                    document.body.style += "";
                }
            }
        }
    },_syncScrollY:function() {
        var L = this._elTbody,N = this._elTbodyContainer,P,J,O,M,K;
        if (!this.get("width")) {
            this._elContainer.style.width = (N.scrollHeight >= N.offsetHeight) ? (L.parentNode.offsetWidth + 19) + "px" : (L.parentNode.offsetWidth + 2) + "px";
        }
    },_syncScrollX:function() {
        var L = this._elTbody,N = this._elTbodyContainer,P,J,O,M,K;
        if (!this.get("height") && (A.ie)) {
            N.style.height = (N.scrollWidth > N.offsetWidth - 2) ? (L.parentNode.offsetHeight + 19) + "px" : L.parentNode.offsetHeight + "px";
        }
        if (this._elTbody.rows.length === 0) {
            this._elMsgTbody.parentNode.style.width = this.getTheadEl().parentNode.offsetWidth + "px";
        } else {
            this._elMsgTbody.parentNode.style.width = "";
        }
    },_syncScrollPadding:function() {
        var L = this._elTbody,N = this._elTbodyContainer,P,J,O,M,K;
        if (N.scrollHeight > N.offsetHeight) {
            P = this._oColumnSet.headers[this._oColumnSet.headers.length - 1];
            J = P.length;
            O = this._sId + "-th";
            for (M = 0; M < J; M++) {
                K = D.get(O + P[M]).firstChild;
                K.parentNode.style.borderRight = "18px solid " + G.COLOR_COLUMNFILLER;
            }
        } else {
            P = this._oColumnSet.headers[this._oColumnSet.headers.length - 1];
            J = P.length;
            O = this._sId + "-th";
            for (M = 0; M < J; M++) {
                K = D.get(O + P[M]).firstChild;
                K.parentNode.style.borderRight = "1px solid " + G.COLOR_COLUMNFILLER;
            }
        }
    },_forceGeckoRedraw:(A.gecko) ? function(K) {
        K = K || this._elContainer;
        var J = K.parentNode;
        var L = K.nextSibling;
        J.insertBefore(J.removeChild(K), L);
    } : function() {
    },_initNodeTemplates:function() {
        var K = document,J = K.createElement("tr"),M = K.createElement("td"),L = K.createElement("div");
        M.appendChild(L);
        this._tdElTemplate = M;
        this._trElTemplate = J;
    },_initContainerEl:function(J) {
        if (this._elContainer) {
            I.purgeElement(this._elContainer, true);
            this._elContainer.innerHTML = "";
        }
        J = D.get(J);
        if (J && J.nodeName && (J.nodeName.toLowerCase() == "div")) {
            I.purgeElement(J, true);
            J.innerHTML = "";
            D.addClass(J, "yui-dt yui-dt-noop");
            this._elTheadContainer = J.appendChild(document.createElement("div"));
            D.addClass(this._elTheadContainer, "yui-dt-hd");
            this._elTheadContainer.style.backgroundColor = G.COLOR_COLUMNFILLER;
            this._elTbodyContainer = J.appendChild(document.createElement("div"));
            D.addClass(this._elTbodyContainer, "yui-dt-bd");
            this._elContainer = J;
        }
    },_initConfigs:function(J) {
        if (J) {
            if (J.constructor != Object) {
                J = null;
            } else {
                if (C.isBoolean(J.paginator)) {
                }
            }
            this._oConfigs = J;
        } else {
            this._oConfigs = {};
        }
    },_initColumnSet:function(L) {
        if (this._oColumnSet) {
            for (var K = 0,J = this._oColumnSet.keys.length; K < J; K++) {
                G._oStylesheetRules[".yui-dt-col-" + this._oColumnSet.keys[K].getId()] = undefined;
            }
            this._oColumnSet = null;
        }
        if (C.isArray(L)) {
            this._oColumnSet = new YAHOO.widget.ColumnSet(L);
        } else {
            if (L instanceof YAHOO.widget.ColumnSet) {
                this._oColumnSet = L;
            }
        }
    },_initDataSource:function(J) {
        this._oDataSource = null;
        if (J && (J instanceof H)) {
            this._oDataSource = J;
        } else {
            var K = null;
            var O = this._elContainer;
            var L;
            if (O.hasChildNodes()) {
                var N = O.childNodes;
                for (L = 0; L < N.length; L++) {
                    if (N[L].nodeName && N[L].nodeName.toLowerCase() == "table") {
                        K = N[L];
                        break;
                    }
                }
                if (K) {
                    var M = [];
                    for (L = 0; L < this._oColumnSet.keys.length; L++) {
                        M.push({key:this._oColumnSet.keys[L].key});
                    }
                    this._oDataSource = new H(K);
                    this._oDataSource.responseType = H.TYPE_HTMLTABLE;
                    this._oDataSource.responseSchema = {fields:M};
                }
            }
        }
    },_initRecordSet:function() {
        if (this._oRecordSet) {
            this._oRecordSet.reset();
        } else {
            this._oRecordSet = new YAHOO.widget.RecordSet();
        }
    },_initTableEl:function() {
        var S;
        if (this._elThead) {
            var N;
            var V = this._oColumnSet.tree[0];
            for (N = 0; N < V.length; N++) {
                if (V[N]._dd) {
                    V[N]._dd = V[N]._dd.unreg();
                }
            }
            var U = this._oColumnSet.keys;
            for (N = 0; N < U.length; N++) {
                if (U[N]._ddResizer) {
                    U[N]._ddResizer = U[N]._ddResizer.unreg();
                }
            }
            S = this._elThead.parentNode;
            I.purgeElement(S, true);
            S.parentNode.removeChild(S);
            this._elThead = null;
        }
        if (this._elTbody) {
            S = this._elTbody.parentNode;
            I.purgeElement(S, true);
            S.parentNode.removeChild(S);
            this._elTbody = null;
        }
        var W = document.createElement("table");
        W.id = this._sId + "-headtable";
        W = this._elTheadContainer.appendChild(W);
        var T = document.createElement("table");
        T.id = this._sId + "-bodytable";
        this._elTbodyContainer.appendChild(T);
        this._initTheadEls();
        this._elTbody = T.appendChild(document.createElement("tbody"));
        this._elTbody.tabIndex = 0;
        D.addClass(this._elTbody, G.CLASS_BODY);
        var Q = document.createElement("tbody");
        D.addClass(Q, G.CLASS_MSG);
        var J = Q.appendChild(document.createElement("tr"));
        D.addClass(J, G.CLASS_FIRST);
        D.addClass(J, G.CLASS_LAST);
        this._elMsgRow = J;
        var R = J.appendChild(document.createElement("td"));
        R.colSpan = this._oColumnSet.keys.length;
        D.addClass(R, G.CLASS_FIRST);
        D.addClass(R, G.CLASS_LAST);
        this._elMsgTd = R;
        this._elMsgTbody = T.appendChild(Q);
        var O = R.appendChild(document.createElement("div"));
        this.showTableMessage(G.MSG_LOADING, G.CLASS_LOADING);
        var L = this._elContainer;
        var M = this._elThead;
        var K = this._elTbody;
        if (A.ie) {
            K.hideFocus = true;
        }
        var P = this._elTbodyContainer;
        I.addListener(L, "focus", this._onTableFocus, this);
        I.addListener(K, "focus", this._onTbodyFocus, this);
        I.addListener(K, "mouseover", this._onTableMouseover, this);
        I.addListener(K, "mouseout", this._onTableMouseout, this);
        I.addListener(K, "mousedown", this._onTableMousedown, this);
        I.addListener(K, "keydown", this._onTbodyKeydown, this);
        I.addListener(K, "keypress", this._onTableKeypress, this);
        I.addListener(K.parentNode, "dblclick", this._onTableDblclick, this);
        I.addListener(K, "click", this._onTbodyClick, this);
        I.addListener(P, "scroll", this._onScroll, this);
    },_initTheadEls:function() {
        var b,Z,X,d,M,Q;
        if (!this._elThead) {
            d = this._elThead = document.createElement("thead");
            M = this._elA11yThead = document.createElement("thead");
            Q = [d,M];
            I.addListener(d, "focus", this._onTheadFocus, this);
            I.addListener(d, "keydown", this._onTheadKeydown, this);
            I.addListener(d, "mouseover", this._onTableMouseover, this);
            I.addListener(d, "mouseout", this._onTableMouseout, this);
            I.addListener(d, "mousedown", this._onTableMousedown, this);
            I.addListener(d, "mouseup", this._onTableMouseup, this);
            I.addListener(d, "click", this._onTheadClick, this);
            I.addListener(d.parentNode, "dblclick", this._onTableDblclick, this);
            this._elTheadContainer.firstChild.appendChild(M);
            this._elTbodyContainer.firstChild.appendChild(d);
        } else {
            d = this._elThead;
            M = this._elA11yThead;
            Q = [d,M];
            for (b = 0; b < Q.length; b++) {
                for (Z = Q[b].rows.length - 1; Z > -1; Z--) {
                    I.purgeElement(Q[b].rows[Z], true);
                    Q[b].removeChild(Q[b].rows[Z]);
                }
            }
        }
        var R,m = this._oColumnSet;
        var L = m.tree;
        var P,T;
        for (X = 0; X < Q.length; X++) {
            for (b = 0; b < L.length; b++) {
                var Y = Q[X].appendChild(document.createElement("tr"));
                T = (X === 1) ? this._sId + "-hdrow" + b + "-a11y" : this._sId + "-hdrow" + b;
                Y.id = T;
                for (Z = 0; Z < L[b].length; Z++) {
                    R = L[b][Z];
                    P = Y.appendChild(document.createElement("th"));
                    if (X === 0) {
                        R._elTh = P;
                    }
                    T = (X === 1) ? this._sId + "-th" + R.getId() + "-a11y" : this._sId + "-th" + R.getId();
                    P.id = T;
                    P.yuiCellIndex = Z;
                    this._initThEl(P, R, b, Z, (X === 1));
                }
                if (X === 0) {
                    if (b === 0) {
                        D.addClass(Y, G.CLASS_FIRST);
                    }
                    if (b === (L.length - 1)) {
                        D.addClass(Y, G.CLASS_LAST);
                    }
                }
            }
            if (X === 0) {
                var V = m.headers[0];
                var N = m.headers[m.headers.length - 1];
                for (b = 0; b < V.length; b++) {
                    D.addClass(D.get(this._sId + "-th" + V[b]), G.CLASS_FIRST);
                }
                for (b = 0; b < N.length; b++) {
                    D.addClass(D.get(this._sId + "-th" + N[b]), G.CLASS_LAST);
                }
                var U = (F.DD) ? true : false;
                var k = false;
                if (this._oConfigs.draggableColumns) {
                    for (b = 0; b < this._oColumnSet.tree[0].length; b++) {
                        R = this._oColumnSet.tree[0][b];
                        if (U) {
                            P = R.getThEl();
                            D.addClass(P, G.CLASS_DRAGGABLE);
                            var S = G._initColumnDragTargetEl();
                            R._dd = new YAHOO.widget.ColumnDD(this, R, P, S);
                        } else {
                            k = true;
                        }
                    }
                }
                for (b = 0; b < this._oColumnSet.keys.length; b++) {
                    R = this._oColumnSet.keys[b];
                    if (R.resizeable) {
                        if (U) {
                            P = R.getThEl();
                            D.addClass(P, G.CLASS_RESIZEABLE);
                            var K = P.firstChild;
                            var J = K.appendChild(document.createElement("div"));
                            J.id = this._sId + "-colresizer" + R.getId();
                            R._elResizer = J;
                            D.addClass(J, G.CLASS_RESIZER);
                            var n = G._initColumnResizerProxyEl();
                            R._ddResizer = new YAHOO.util.ColumnResizer(this, R, P, J.id, n);
                            var a = function(g) {
                                I.stopPropagation(g);
                            };
                            I.addListener(J, "click", a);
                        } else {
                            k = true;
                        }
                    }
                }
                if (k) {
                }
            } else {
            }
        }
        for (var e = 0,c = this._oColumnSet.keys.length; e < c; e++) {
            if (this._oColumnSet.keys[e].hidden) {
                var f = this._oColumnSet.keys[e];
                var W = f.getThEl();
                f._nLastWidth = W.offsetWidth - (parseInt(D.getStyle(W, "paddingLeft"), 10) | 0) - (parseInt(D.getStyle(W, "paddingRight"), 10) | 0);
                this._setColumnWidth(f.getKeyIndex(), "1px");
            }
        }
        if (A.webkit && A.webkit < 420) {
            var O = this;
            setTimeout(function() {
                O._elThead.style.display = "";
            }, 0);
            this._elThead.style.display = "none";
        }
    },_initThEl:function(Q, O, S, K, R) {
        var N = O.getKey();
        var J = O.getId();
        Q.yuiColumnKey = N;
        Q.yuiColumnId = J;
        Q.innerHTML = "";
        Q.rowSpan = O.getRowspan();
        Q.colSpan = O.getColspan();
        var P = Q.appendChild(document.createElement("div"));
        var M = P.appendChild(document.createElement("span"));
        if (R) {
            if (O.abbr) {
                Q.abbr = O.abbr;
            }
            M.innerHTML = C.isValue(O.label) ? O.label : N;
        } else {
            P.id = Q.id + "-liner";
            var L;
            if (C.isString(O.className)) {
                L = [O.className];
            } else {
                if (C.isArray(O.className)) {
                    L = O.className;
                } else {
                    L = [];
                }
            }
            L[L.length] = "yui-dt-col-" + N.replace(/[^\w\-.:]/g, "");
            L[L.length] = "yui-dt-col-" + O.getId();
            L[L.length] = G.CLASS_LINER;
            D.addClass(P, L.join(" "));
            D.addClass(M, G.CLASS_LABEL);
            L = [];
            if (O.resizeable) {
                L[L.length] = G.CLASS_RESIZEABLE;
            }
            if (O.sortable) {
                L[L.length] = G.CLASS_SORTABLE;
            }
            if (O.hidden) {
                L[L.length] = G.CLASS_HIDDEN;
            }
            if (O.selected) {
                L[L.length] = G.CLASS_SELECTED;
            }
            D.addClass(Q, L.join(" "));
            G.formatTheadCell(M, O, this);
        }
    },_initCellEditorEl:function() {
        var J = document.createElement("div");
        J.id = this._sId + "-celleditor";
        J.style.display = "none";
        J.tabIndex = 0;
        D.addClass(J, G.CLASS_EDITOR);
        var L = D.getFirstChild(document.body);
        if (L) {
            J = D.insertBefore(J, L);
        } else {
            J = document.body.appendChild(J);
        }
        var K = {};
        K.container = J;
        K.value = null;
        K.isActive = false;
        this._oCellEditor = K;
    },_initColumnSort:function() {
        this.subscribe("theadCellClickEvent", this.onEventSortColumn);
    },_createTrEl:function(K) {
        var J = this._trElTemplate.cloneNode(true);
        J.id = this._sId + "-bdrow" + this._nTrCount;
        this._nTrCount++;
        return this._updateTrEl(J, K);
    },_updateTrEl:function(K, Y) {
        var V = this._oColumnSet,O,L,N = this.get("sortedBy"),R,Q,T,X;
        if (N) {
            O = N.key;
            L = N.dir;
        }
        K.style.display = "none";
        var J = false;
        while (K.childNodes.length > V.keys.length) {
            K.removeChild(K.firstChild);
            J = true;
        }
        for (R = K.childNodes.length || 0,T = V.keys.length; R < T; ++R) {
            this._addTdEl(K, V.keys[R], R);
            J = true;
        }
        for (R = 0,T = V.keys.length; R < T; ++R) {
            var S = V.keys[R],W = K.childNodes[R],P = W.firstChild,U = "",M = this.get("scrollable") ? "-a11y " : " ";
            for (Q = 0,X = V.headers[R].length; Q < X; ++Q) {
                U += this._sId + "-th" + V.headers[R][Q] + M;
            }
            W.headers = U;
            if (J) {
                D.removeClass(W, G.CLASS_FIRST);
                D.removeClass(W, G.CLASS_LAST);
                if (R === 0) {
                    D.addClass(W, G.CLASS_FIRST);
                } else {
                    if (R === T - 1) {
                        D.addClass(W, G.CLASS_LAST);
                    }
                }
            }
            if (S.key === O) {
                D.replaceClass(W, L === G.CLASS_ASC ? G.CLASS_DESC : G.CLASS_ASC, L);
            } else {
                D.removeClass(W, G.CLASS_ASC);
                D.removeClass(W, G.CLASS_DESC);
            }
            if (S.hidden) {
                D.addClass(W, G.CLASS_HIDDEN);
            } else {
                D.removeClass(W, G.CLASS_HIDDEN);
            }
            if (S.selected) {
                D.addClass(W, G.CLASS_SELECTED);
            } else {
                D.removeClass(W, G.CLASS_SELECTED);
            }
            this.formatCell(P, Y, S);
        }
        K.yuiRecordId = Y.getId();
        K.style.display = "";
        return K;
    },_addTdEl:function(J, M, K) {
        var L = this._tdElTemplate.cloneNode(true),N = L.firstChild;
        K = K || J.cells.length;
        L.id = J.id + "-cell" + this._nTdCount;
        this._nTdCount++;
        L.yuiColumnKey = M.getKey();
        L.yuiColumnId = M.getId();
        L.yuiCellIndex = K;
        var O = J.cells[K] || null;
        return J.insertBefore(L, O);
    },_deleteTrEl:function(J) {
        var K;
        if (!C.isNumber(J)) {
            K = D.get(J).sectionRowIndex;
        } else {
            K = J;
        }
        if (C.isNumber(K) && (K > -2) && (K < this._elTbody.rows.length)) {
            return this._elTbody.removeChild(this.getTrEl(J));
        } else {
            return null;
        }
    },_setFirstRow:function() {
        var J = this.getFirstTrEl();
        if (J) {
            if (this._sFirstTrId) {
                D.removeClass(this._sFirstTrId, G.CLASS_FIRST);
            }
            D.addClass(J, G.CLASS_FIRST);
            this._sFirstTrId = J.id;
        } else {
            this._sFirstTrId = null;
        }
    },_setLastRow:function() {
        var J = this.getLastTrEl();
        if (J) {
            if (this._sLastTrId) {
                D.removeClass(this._sLastTrId, G.CLASS_LAST);
            }
            D.addClass(J, G.CLASS_LAST);
            this._sLastTrId = J.id;
        } else {
            this._sLastTrId = null;
        }
    },_setRowStripes:function(T, L) {
        var M = this._elTbody.rows,Q = 0,S = M.length,P = [],R = 0,N = [],J = 0;
        if ((T !== null) && (T !== undefined)) {
            var O = this.getTrEl(T);
            if (O) {
                Q = O.sectionRowIndex;
                if (C.isNumber(L) && (L > 1)) {
                    S = Q + L;
                }
            }
        }
        for (var K = Q; K < S; K++) {
            if (K % 2) {
                P[R++] = M[K];
            } else {
                N[J++] = M[K];
            }
        }
        if (P.length) {
            D.replaceClass(P, G.CLASS_EVEN, G.CLASS_ODD);
        }
        if (N.length) {
            D.replaceClass(N, G.CLASS_ODD, G.CLASS_EVEN);
        }
    },_onScroll:function(L, K) {
        K._elTheadContainer.scrollLeft = K._elTbodyContainer.scrollLeft;
        if (K._oCellEditor && K._oCellEditor.isActive) {
            K.fireEvent("editorBlurEvent", {editor:K._oCellEditor});
            K.cancelCellEditor();
        }
        var M = I.getTarget(L);
        var J = M.nodeName.toLowerCase();
        K.fireEvent("tableScrollEvent", {event:L,target:M});
    },_onDocumentClick:function(L, K) {
        var M = I.getTarget(L);
        var J = M.nodeName.toLowerCase();
        if (!D.isAncestor(K._elContainer, M)) {
            K.fireEvent("tableBlurEvent");
            if (K._oCellEditor && K._oCellEditor.isActive) {
                if (!D.isAncestor(K._oCellEditor.container, M) && (K._oCellEditor.container.id !== M.id)) {
                    K.fireEvent("editorBlurEvent", {editor:K._oCellEditor});
                }
            }
        }
    },_onTableFocus:function(K, J) {
        J.fireEvent("tableFocusEvent");
    },_onTheadFocus:function(K, J) {
        J.fireEvent("theadFocusEvent");
        J.fireEvent("tableFocusEvent");
    },_onTbodyFocus:function(K, J) {
        J.fireEvent("tbodyFocusEvent");
        J.fireEvent("tableFocusEvent");
    },_onTableMouseover:function(M, K) {
        var N = I.getTarget(M);
        var J = N.nodeName.toLowerCase();
        var L = true;
        while (N && (J != "table")) {
            switch (J) {case"body":return;case"a":break;case"td":L = K.fireEvent("cellMouseoverEvent", {target:N,event:M});break;case"span":if (D.hasClass(N, G.CLASS_LABEL)) {
                L = K.fireEvent("theadLabelMouseoverEvent", {target:N,event:M});
                L = K.fireEvent("headerLabelMouseoverEvent", {target:N,event:M});
            }break;case"th":L = K.fireEvent("theadCellMouseoverEvent", {target:N,event:M});L = K.fireEvent("headerCellMouseoverEvent", {target:N,event:M});break;case"tr":if (N.parentNode.nodeName.toLowerCase() == "thead") {
                L = K.fireEvent("theadRowMouseoverEvent", {target:N,event:M});
                L = K.fireEvent("headerRowMouseoverEvent", {target:N,event:M});
            } else {
                L = K.fireEvent("rowMouseoverEvent", {target:N,event:M});
            }break;default:break;}
            if (L === false) {
                return;
            } else {
                N = N.parentNode;
                if (N) {
                    J = N.nodeName.toLowerCase();
                }
            }
        }
        K.fireEvent("tableMouseoverEvent", {target:(N || K._elContainer),event:M});
    },_onTableMouseout:function(M, K) {
        var N = I.getTarget(M);
        var J = N.nodeName.toLowerCase();
        var L = true;
        while (N && (J != "table")) {
            switch (J) {case"body":return;case"a":break;case"td":L = K.fireEvent("cellMouseoutEvent", {target:N,event:M});break;case"span":if (D.hasClass(N, G.CLASS_LABEL)) {
                L = K.fireEvent("theadLabelMouseoutEvent", {target:N,event:M});
                L = K.fireEvent("headerLabelMouseoutEvent", {target:N,event:M});
            }break;case"th":L = K.fireEvent("theadCellMouseoutEvent", {target:N,event:M});L = K.fireEvent("headerCellMouseoutEvent", {target:N,event:M});break;case"tr":if (N.parentNode.nodeName.toLowerCase() == "thead") {
                L = K.fireEvent("theadRowMouseoutEvent", {target:N,event:M});
                L = K.fireEvent("headerRowMouseoutEvent", {target:N,event:M});
            } else {
                L = K.fireEvent("rowMouseoutEvent", {target:N,event:M});
            }break;default:break;}
            if (L === false) {
                return;
            } else {
                N = N.parentNode;
                if (N) {
                    J = N.nodeName.toLowerCase();
                }
            }
        }
        K.fireEvent("tableMouseoutEvent", {target:(N || K._elContainer),event:M});
    },_onTableMousedown:function(M, K) {
        var N = I.getTarget(M);
        var J = N.nodeName.toLowerCase();
        var L = true;
        while (N && (J != "table")) {
            switch (J) {case"body":return;case"a":break;case"td":L = K.fireEvent("cellMousedownEvent", {target:N,event:M});break;case"span":if (D.hasClass(N, G.CLASS_LABEL)) {
                L = K.fireEvent("theadLabelMousedownEvent", {target:N,event:M});
                L = K.fireEvent("headerLabelMousedownEvent", {target:N,event:M});
            }break;case"th":L = K.fireEvent("theadCellMousedownEvent", {target:N,event:M});L = K.fireEvent("headerCellMousedownEvent", {target:N,event:M});break;case"tr":if (N.parentNode.nodeName.toLowerCase() == "thead") {
                L = K.fireEvent("theadRowMousedownEvent", {target:N,event:M});
                L = K.fireEvent("headerRowMousedownEvent", {target:N,event:M});
            } else {
                L = K.fireEvent("rowMousedownEvent", {target:N,event:M});
            }break;default:break;}
            if (L === false) {
                return;
            } else {
                N = N.parentNode;
                if (N) {
                    J = N.nodeName.toLowerCase();
                }
            }
        }
        K.fireEvent("tableMousedownEvent", {target:(N || K._elContainer),event:M});
    },_onTableDblclick:function(M, K) {
        var N = I.getTarget(M);
        var J = N.nodeName.toLowerCase();
        var L = true;
        while (N && (J != "table")) {
            switch (J) {case"body":return;case"td":L = K.fireEvent("cellDblclickEvent", {target:N,event:M});break;case"span":if (D.hasClass(N, G.CLASS_LABEL)) {
                L = K.fireEvent("theadLabelDblclickEvent", {target:N,event:M});
                L = K.fireEvent("headerLabelDblclickEvent", {target:N,event:M});
            }break;case"th":L = K.fireEvent("theadCellDblclickEvent", {target:N,event:M});L = K.fireEvent("headerCellDblclickEvent", {target:N,event:M});break;case"tr":if (N.parentNode.nodeName.toLowerCase() == "thead") {
                L = K.fireEvent("theadRowDblclickEvent", {target:N,event:M});
                L = K.fireEvent("headerRowDblclickEvent", {target:N,event:M});
            } else {
                L = K.fireEvent("rowDblclickEvent", {target:N,event:M});
            }break;default:break;}
            if (L === false) {
                return;
            } else {
                N = N.parentNode;
                if (N) {
                    J = N.nodeName.toLowerCase();
                }
            }
        }
        K.fireEvent("tableDblclickEvent", {target:(N || K._elContainer),event:M});
    },_onTheadKeydown:function(M, K) {
        if (I.getCharCode(M) === 9) {
            setTimeout(function() {
                if ((K instanceof G) && K._sId) {
                    K._elTbodyContainer.scrollLeft = K._elTheadContainer.scrollLeft;
                }
            }, 0);
        }
        var N = I.getTarget(M);
        var J = N.nodeName.toLowerCase();
        var L = true;
        while (N && (J != "table")) {
            switch (J) {case"body":return;case"input":case"textarea":break;case"thead":L = K.fireEvent("theadKeyEvent", {target:N,event:M});break;default:break;}
            if (L === false) {
                return;
            } else {
                N = N.parentNode;
                if (N) {
                    J = N.nodeName.toLowerCase();
                }
            }
        }
        K.fireEvent("tableKeyEvent", {target:(N || K._elContainer),event:M});
    },_onTbodyKeydown:function(N, L) {
        var K = L.get("selectionMode");
        if (K == "standard") {
            L._handleStandardSelectionByKey(N);
        } else {
            if (K == "single") {
                L._handleSingleSelectionByKey(N);
            } else {
                if (K == "cellblock") {
                    L._handleCellBlockSelectionByKey(N);
                } else {
                    if (K == "cellrange") {
                        L._handleCellRangeSelectionByKey(N);
                    } else {
                        if (K == "singlecell") {
                            L._handleSingleCellSelectionByKey(N);
                        }
                    }
                }
            }
        }
        if (L._oCellEditor && L._oCellEditor.isActive) {
            L.fireEvent("editorBlurEvent", {editor:L._oCellEditor});
        }
        var O = I.getTarget(N);
        var J = O.nodeName.toLowerCase();
        var M = true;
        while (O && (J != "table")) {
            switch (J) {case"body":return;case"tbody":M = L.fireEvent("tbodyKeyEvent", {target:O,event:N});break;default:break;}
            if (M === false) {
                return;
            } else {
                O = O.parentNode;
                if (O) {
                    J = O.nodeName.toLowerCase();
                }
            }
        }
        L.fireEvent("tableKeyEvent", {target:(O || L._elContainer),event:N});
    },_onTableKeypress:function(L, K) {
        if (A.webkit) {
            var J = I.getCharCode(L);
            if (J == 40) {
                I.stopEvent(L);
            } else {
                if (J == 38) {
                    I.stopEvent(L);
                }
            }
        }
    },_onTheadClick:function(M, K) {
        if (K._oCellEditor && K._oCellEditor.isActive) {
            K.fireEvent("editorBlurEvent", {editor:K._oCellEditor});
        }
        var N = I.getTarget(M);
        var J = N.nodeName.toLowerCase();
        var L = true;
        while (N && (J != "table")) {
            switch (J) {case"body":return;case"input":if (N.type.toLowerCase() == "checkbox") {
                L = K.fireEvent("theadCheckboxClickEvent", {target:N,event:M});
            } else {
                if (N.type.toLowerCase() == "radio") {
                    L = K.fireEvent("theadRadioClickEvent", {target:N,event:M});
                }
            }break;case"a":L = K.fireEvent("theadLinkClickEvent", {target:N,event:M});break;case"button":L = K.fireEvent("theadButtonClickEvent", {target:N,event:M});break;case"span":if (D.hasClass(N, G.CLASS_LABEL)) {
                L = K.fireEvent("theadLabelClickEvent", {target:N,event:M});
                L = K.fireEvent("headerLabelClickEvent", {target:N,event:M});
            }break;case"th":L = K.fireEvent("theadCellClickEvent", {target:N,event:M});L = K.fireEvent("headerCellClickEvent", {target:N,event:M});break;case"tr":L = K.fireEvent("theadRowClickEvent", {target:N,event:M});L = K.fireEvent("headerRowClickEvent", {target:N,event:M});break;default:break;}
            if (L === false) {
                return;
            } else {
                N = N.parentNode;
                if (N) {
                    J = N.nodeName.toLowerCase();
                }
            }
        }
        K.fireEvent("tableClickEvent", {target:(N || K._elContainer),event:M});
    },_onTbodyClick:function(M, K) {
        if (K._oCellEditor && K._oCellEditor.isActive) {
            K.fireEvent("editorBlurEvent", {editor:K._oCellEditor});
        }
        var N = I.getTarget(M);
        var J = N.nodeName.toLowerCase();
        var L = true;
        while (N && (J != "table")) {
            switch (J) {case"body":return;case"input":if (N.type.toLowerCase() == "checkbox") {
                L = K.fireEvent("checkboxClickEvent", {target:N,event:M});
            } else {
                if (N.type.toLowerCase() == "radio") {
                    L = K.fireEvent("radioClickEvent", {target:N,event:M});
                }
            }break;case"a":L = K.fireEvent("linkClickEvent", {target:N,event:M});break;case"button":L = K.fireEvent("buttonClickEvent", {target:N,event:M});break;case"td":L = K.fireEvent("cellClickEvent", {target:N,event:M});break;case"tr":L = K.fireEvent("rowClickEvent", {target:N,event:M});break;default:break;}
            if (L === false) {
                return;
            } else {
                N = N.parentNode;
                if (N) {
                    J = N.nodeName.toLowerCase();
                }
            }
        }
        K.fireEvent("tableClickEvent", {target:(N || K._elContainer),event:M});
    },_onDropdownChange:function(K, J) {
        var L = I.getTarget(K);
        J.fireEvent("dropdownChangeEvent", {event:K,target:L});
    },getId:function() {
        return this._sId;
    },toString:function() {
        return"DataTable instance " + this._sId;
    },getDataSource:function() {
        return this._oDataSource;
    },getColumnSet:function() {
        return this._oColumnSet;
    },getRecordSet:function() {
        return this._oRecordSet;
    },getCellEditor:function() {
        return this._oCellEditor;
    },getContainerEl:function() {
        return this._elContainer;
    },getBdContainerEl:function() {
        return this._elTbodyContainer;
    },getTheadEl:function() {
        return this._elThead;
    },getTbodyEl:function() {
        return this._elTbody;
    },getMsgTbodyEl:function() {
        return this._elMsgTbody;
    },getMsgTdEl:function() {
        return this._elMsgTd;
    },getTrEl:function(N) {
        var M = this._elTbody.rows;
        if (N instanceof YAHOO.widget.Record) {
            var L = this.getTrIndex(N);
            if (L !== null) {
                return M[L];
            } else {
                return null;
            }
        } else {
            if (C.isNumber(N) && (N > -1) && (N < M.length)) {
                return M[N];
            } else {
                var J;
                var K = D.get(N);
                if (K && (K.ownerDocument == document)) {
                    if (K.nodeName.toLowerCase() != "tr") {
                        J = D.getAncestorByTagName(K, "tr");
                    } else {
                        J = K;
                    }
                    if (J && (J.parentNode == this._elTbody)) {
                        return J;
                    }
                }
            }
        }
        return null;
    },getFirstTrEl:function() {
        return this._elTbody.rows[0] || null;
    },getLastTrEl:function() {
        var J = this._elTbody.rows;
        if (J.length > 0) {
            return J[J.length - 1] || null;
        }
    },getNextTrEl:function(L) {
        var J = this.getTrIndex(L);
        if (J !== null) {
            var K = this._elTbody.rows;
            if (J < K.length - 1) {
                return K[J + 1];
            }
        }
        return null;
    },getPreviousTrEl:function(L) {
        var J = this.getTrIndex(L);
        if (J !== null) {
            var K = this._elTbody.rows;
            if (J > 0) {
                return K[J - 1];
            }
        }
        return null;
    },getTdLinerEl:function(J) {
        var K = this.getTdEl(J);
        return K.firstChild || null;
    },getTdEl:function(J) {
        var O;
        var M = D.get(J);
        if (M && (M.ownerDocument == document)) {
            if (M.nodeName.toLowerCase() != "td") {
                O = D.getAncestorByTagName(M, "td");
            } else {
                O = M;
            }
            if (O && (O.parentNode.parentNode == this._elTbody)) {
                return O;
            }
        } else {
            if (J) {
                var N,L;
                if (C.isString(J.columnId) && C.isString(J.recordId)) {
                    N = this.getRecord(J.recordId);
                    var P = this.getColumnById(J.columnId);
                    if (P) {
                        L = P.getKeyIndex();
                    }
                }
                if (J.record && J.column && J.column.getKeyIndex) {
                    N = J.record;
                    L = J.column.getKeyIndex();
                }
                var K = this.getTrEl(N);
                if ((L !== null) && K && K.cells && K.cells.length > 0) {
                    return K.cells[L] || null;
                }
            }
        }
        return null;
    },getFirstTdEl:function(K) {
        var J = this.getTrEl(K) || this.getFirstTrEl();
        if (J && (J.cells.length > 0)) {
            return J.cells[0];
        }
        return null;
    },getLastTdEl:function(K) {
        var J = this.getTrEl(K) || this.getLastTrEl();
        if (J && (J.cells.length > 0)) {
            return J.cells[J.cells.length - 1];
        }
        return null;
    },getNextTdEl:function(J) {
        var N = this.getTdEl(J);
        if (N) {
            var L = N.yuiCellIndex;
            var K = this.getTrEl(N);
            if (L < K.cells.length - 1) {
                return K.cells[L + 1];
            } else {
                var M = this.getNextTrEl(K);
                if (M) {
                    return M.cells[0];
                }
            }
        }
        return null;
    },getPreviousTdEl:function(J) {
        var N = this.getTdEl(J);
        if (N) {
            var L = N.yuiCellIndex;
            var K = this.getTrEl(N);
            if (L > 0) {
                return K.cells[L - 1];
            } else {
                var M = this.getPreviousTrEl(K);
                if (M) {
                    return this.getLastTdEl(M);
                }
            }
        }
        return null;
    },getAboveTdEl:function(J) {
        var L = this.getTdEl(J);
        if (L) {
            var K = this.getPreviousTrEl(L);
            if (K) {
                return K.cells[L.yuiCellIndex];
            }
        }
        return null;
    },getBelowTdEl:function(J) {
        var L = this.getTdEl(J);
        if (L) {
            var K = this.getNextTrEl(L);
            if (K) {
                return K.cells[L.yuiCellIndex];
            }
        }
        return null;
    },getThLinerEl:function(K) {
        var J = this.getThEl(K);
        return J.firstChild || null;
    },getThEl:function(M) {
        var J;
        if (M instanceof YAHOO.widget.Column) {
            var L = M;
            J = L.getThEl();
            if (J) {
                return J;
            }
        } else {
            var K = D.get(M);
            if (K && (K.ownerDocument == document)) {
                if (K.nodeName.toLowerCase() != "th") {
                    J = D.getAncestorByTagName(K, "th");
                } else {
                    J = K;
                }
                if (J && (J.parentNode.parentNode == this._elThead)) {
                    return J;
                }
            }
        }
        return null;
    },getTrIndex:function(O) {
        var N;
        if (O instanceof YAHOO.widget.Record) {
            N = this._oRecordSet.getRecordIndex(O);
            if (N === null) {
                return null;
            }
        } else {
            if (C.isNumber(O)) {
                N = O;
            }
        }
        if (C.isNumber(N)) {
            if ((N > -1) && (N < this._oRecordSet.getLength())) {
                var L = this.get("paginator");
                if (L instanceof B || this.get("paginated")) {
                    var M = 0,P = 0;
                    if (L instanceof B) {
                        var K = L.getPageRecords();
                        M = K[0];
                        P = K[1];
                    } else {
                        M = L.startRecordIndex;
                        P = M + L.rowsPerPage - 1;
                    }
                    if ((N >= M) && (N <= P)) {
                        return N - M;
                    } else {
                        return null;
                    }
                } else {
                    return N;
                }
            } else {
                return null;
            }
        } else {
            var J = this.getTrEl(O);
            if (J && (J.ownerDocument == document) && (J.parentNode == this._elTbody)) {
                return J.sectionRowIndex;
            }
        }
        return null;
    },initializeTable:function() {
        this._bInit = true;
        this._oRecordSet.reset();
        this._unselectAllTrEls();
        this._unselectAllTdEls();
        this._aSelections = null;
        this._oAnchorRecord = null;
        this._oAnchorCell = null;
        this.set("sortedBy", null);
    },render:function() {
        this._oChainRender.stop();
        this.showTableMessage(G.MSG_LOADING, G.CLASS_LOADING);
        var S,R,Q,P,U,X;
        var W = this.get("paginator");
        var Z = W instanceof B || this.get("paginated");
        if (Z) {
            if (W instanceof B) {
                X = this._oRecordSet.getRecords(W.getStartIndex(), W.getRowsPerPage());
                W.render();
            } else {
                this.updatePaginator();
                var N = W.rowsPerPage;
                var K = (W.currentPage - 1) * N;
                X = this._oRecordSet.getRecords(K, N);
                this.formatPaginators();
            }
        } else {
            X = this._oRecordSet.getRecords();
        }
        var b = this._elTbody;
        var M = b.rows;
        if (C.isArray(X) && (X.length > 0)) {
            var V = this.getSelectedRows();
            var a = this.getSelectedCells();
            var L = (V.length > 0) || (a.length > 0);
            while (b.hasChildNodes() && (M.length > X.length)) {
                b.removeChild(M[M.length - 1]);
            }
            if (L) {
                this._unselectAllTrEls();
                this._unselectAllTdEls();
            }
            this.hideTableMessage();
            var J = this.get("renderLoopSize");
            var O,T;
            if (M.length > 0) {
                T = M.length;
                this._oChainRender.add({method:function(e) {
                    if ((this instanceof G) && this._sId) {
                        var d = e.nCurrentRow,c = J > 0 ? Math.min(d + J, M.length) : M.length;
                        for (; d < c; ++d) {
                            this._updateTrEl(M[d], X[d]);
                        }
                        if (J > 0) {
                            this._syncColWidths();
                        }
                        e.nCurrentRow = d;
                    }
                },iterations:(J > 0) ? Math.ceil(T / J) : 1,argument:{nCurrentRow:0},scope:this,timeout:(J > 0) ? 0 : -1});
            }
            O = M.length;
            T = X.length;
            var Y = (T - O);
            if (Y > 0) {
                this._oChainRender.add({method:function(e) {
                    if ((this instanceof G) && this._sId) {
                        var d = e.nCurrentRow,c = J > 0 ? Math.min(d + J, T) : T,g = document.createDocumentFragment(),f;
                        for (; d < c; ++d) {
                            f = this._createTrEl(X[d]);
                            f.className = (d % 2) ? G.CLASS_ODD : G.CLASS_EVEN;
                            g.appendChild(f);
                        }
                        this._elTbody.appendChild(g);
                        if (J > 0) {
                            this._syncColWidths();
                        }
                        e.nCurrentRow = d;
                    }
                },iterations:(J > 0) ? Math.ceil(Y / J) : 1,argument:{nCurrentRow:O},scope:this,timeout:(J > 0) ? 0 : -1});
            }
            this._oChainRender.add({method:function(d) {
                if ((this instanceof G) && this._sId) {
                    this._setFirstRow();
                    this._setLastRow();
                    if (L) {
                        for (R = 0; R < M.length; R++) {
                            var f = M[R];
                            var c = this.get("selectionMode");
                            if ((c == "standard") || (c == "single")) {
                                for (Q = 0; Q < V.length; Q++) {
                                    if (V[Q] === f.yuiRecordId) {
                                        D.addClass(f, G.CLASS_SELECTED);
                                        if (R === M.length - 1) {
                                            this._oAnchorRecord = this.getRecord(f.yuiRecordId);
                                        }
                                    }
                                }
                            } else {
                                for (Q = 0; Q < f.cells.length; Q++) {
                                    var e = f.cells[Q];
                                    for (P = 0; P < a.length; P++) {
                                        if ((a[P].recordId === f.yuiRecordId) && (a[P].columnId === e.yuiColumnId)) {
                                            D.addClass(e, G.CLASS_SELECTED);
                                            if (Q === f.cells.length - 1) {
                                                this._oAnchorCell = {record:this.getRecord(f.yuiRecordId),column:this.getColumnById(e.yuiColumnId)};
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if (this._bInit) {
                    this._forceGeckoRedraw();
                    this._oChainRender.add({method:function() {
                        if ((this instanceof G) && this._sId && this._bInit) {
                            this._bInit = false;
                            this.fireEvent("initEvent");
                        }
                    },scope:this});
                    this._oChainRender.run();
                } else {
                    this.fireEvent("renderEvent");
                    this.fireEvent("refreshEvent");
                }
            },scope:this,timeout:(J > 0) ? 0 : -1});
            this._oChainRender.add({method:function() {
                if ((this instanceof G) && this._sId) {
                    this._syncColWidths();
                }
            },scope:this});
            this._oChainRender.run();
        } else {
            while (b.hasChildNodes()) {
                b.removeChild(M[0]);
            }
            this.showTableMessage(G.MSG_EMPTY, G.CLASS_EMPTY);
        }
    },destroy:function() {
        this._oChainRender.stop();
        var L;
        var M = this._oColumnSet.tree[0];
        for (L = 0; L < M.length; L++) {
            if (M[L]._dd) {
                M[L]._dd = M[L]._dd.unreg();
            }
        }
        var K = this._oColumnSet.keys;
        for (L = 0; L < K.length; L++) {
            if (K[L]._ddResizer) {
                K[L]._ddResizer = K[L]._ddResizer.unreg();
            }
        }
        I.purgeElement(this._oCellEditor.container, true);
        document.body.removeChild(this._oCellEditor.container);
        var J = this.toString();
        var N = this._elContainer;
        this._oRecordSet.unsubscribeAll();
        this.unsubscribeAll();
        I.purgeElement(N, true);
        I.removeListener(document, "click", this._onDocumentClick);
        N.innerHTML = "";
        for (var O in this) {
            if (C.hasOwnProperty(this, O)) {
                this[O] = null;
            }
        }
        G._nCurrentCount--;
        if (G._nCurrentCount < 1) {
            if (G._elStylesheet) {
                document.getElementsByTagName("head")[0].removeChild(G._elStylesheet);
                G._elStylesheet = null;
            }
        }
    },showTableMessage:function(K, J) {
        var L = this._elMsgTd;
        L.firstChild.className = (C.isString(J)) ? G.CLASS_LINER + " " + J : G.CLASS_LINER;
        if (C.isString(K)) {
            L.firstChild.innerHTML = K;
        }
        this._elMsgTbody.parentNode.style.width = this.getTheadEl().parentNode.offsetWidth + "px";
        this._elMsgTbody.style.display = "";
        this.fireEvent("tableMsgShowEvent", {html:K,className:J});
    },hideTableMessage:function() {
        if (this._elMsgTbody.style.display != "none") {
            this._elMsgTbody.style.display = "none";
            this._elMsgTbody.parentNode.style.width = "";
            this.fireEvent("tableMsgHideEvent");
        }
    },focus:function() {
        this.focusTbodyEl();
    },focusTheadEl:function() {
        this._focusEl(this._elThead);
    },focusTbodyEl:function() {
        this._focusEl(this._elTbody);
    },getRecordIndex:function(M) {
        var L;
        if (!C.isNumber(M)) {
            if (M instanceof YAHOO.widget.Record) {
                return this._oRecordSet.getRecordIndex(M);
            } else {
                var K = this.getTrEl(M);
                if (K) {
                    L = K.sectionRowIndex;
                }
            }
        } else {
            L = M;
        }
        if (C.isNumber(L)) {
            var J = this.get("paginator");
            if (J instanceof B) {
                return J.get("recordOffset") + L;
            } else {
                if (this.get("paginated")) {
                    return J.startRecordIndex + L;
                } else {
                    return L;
                }
            }
        }
        return null;
    },getRecord:function(L) {
        var K = this._oRecordSet.getRecord(L);
        if (!K) {
            var J = this.getTrEl(L);
            if (J) {
                K = this._oRecordSet.getRecord(J.yuiRecordId);
            }
        }
        if (K instanceof YAHOO.widget.Record) {
            return this._oRecordSet.getRecord(K);
        } else {
            return null;
        }
    },getColumn:function(J) {
        var L = this._oColumnSet.getColumn(J);
        if (!L) {
            var K = this.getTdEl(J);
            if (K) {
                L = this._oColumnSet.getColumnById(K.yuiColumnId);
            } else {
                K = this.getThEl(J);
                if (K) {
                    L = this._oColumnSet.getColumnById(K.yuiColumnId);
                }
            }
        }
        if (!L) {
        }
        return L;
    },getColumnById:function(J) {
        return this._oColumnSet.getColumnById(J);
    },getColumnSortDir:function(L) {
        if (L.sortOptions && L.sortOptions.defaultOrder) {
            if (L.sortOptions.defaultOrder == "asc") {
                L.sortOptions.defaultDir = G.CLASS_ASC;
            } else {
                if (L.sortOptions.defaultOrder == "desc") {
                    L.sortOptions.defaultDir = G.CLASS_DESC;
                }
            }
        }
        var K = (L.sortOptions && L.sortOptions.defaultDir) ? L.sortOptions.defaultDir : G.CLASS_ASC;
        var J = false;
        var M = this.get("sortedBy");
        if (M && (M.key === L.key)) {
            J = true;
            if (M.dir) {
                K = (M.dir == G.CLASS_ASC) ? G.CLASS_DESC : G.CLASS_ASC;
            } else {
                K = (K == G.CLASS_ASC) ? G.CLASS_DESC : G.CLASS_ASC;
            }
        }
        return K;
    },sortColumn:function(O, M) {
        if (O && (O instanceof YAHOO.widget.Column)) {
            if (!O.sortable) {
                D.addClass(this.getThEl(O), G.CLASS_SORTABLE);
            }
            if (M && (M !== G.CLASS_ASC) && (M !== G.CLASS_DESC)) {
                M = null;
            }
            var L = M || this.getColumnSortDir(O);
            var P = this.get("sortedBy") || {};
            var K = (P.key === O.key) ? true : false;
            if (!K || M) {
                var N = (O.sortOptions && C.isFunction(O.sortOptions.sortFunction)) ? O.sortOptions.sortFunction : function(R, Q, T) {
                    var S = YAHOO.util.Sort.compare(R.getData(O.key), Q.getData(O.key), T);
                    if (S === 0) {
                        return YAHOO.util.Sort.compare(R.getId(), Q.getId(), T);
                    } else {
                        return S;
                    }
                };
                this._oRecordSet.sortRecords(N, ((L == G.CLASS_DESC) ? true : false));
            } else {
                this._oRecordSet.reverseRecords();
            }
            this.set("sortedBy", {key:O.key,dir:L,column:O});
            var J = this.get("paginator");
            if (J instanceof B) {
                J.setPage(1, true);
            } else {
                if (this.get("paginated")) {
                    this.updatePaginator({currentPage:1});
                }
            }
            G.formatTheadCell(O.getThEl().firstChild.firstChild, O, this);
            this.render();
            this.fireEvent("columnSortEvent", {column:O,dir:L});
        } else {
        }
    },_setColumnWidth:function(P, K, Q) {
        P = this.getColumn(P);
        if (P) {
            Q = Q || "hidden";
            if (!G._bStylesheetFallback) {
                var U;
                if (!G._elStylesheet) {
                    U = document.createElement("style");
                    U.type = "text/css";
                    G._elStylesheet = document.getElementsByTagName("head").item(0).appendChild(U);
                }
                if (G._elStylesheet) {
                    U = G._elStylesheet;
                    var T = ".yui-dt-col-" + P.getId();
                    var R = G._oStylesheetRules[T];
                    if (!R) {
                        if (U.styleSheet && U.styleSheet.addRule) {
                            U.styleSheet.addRule(T, "overflow:" + Q);
                            U.styleSheet.addRule(T, "width:" + K);
                            R = U.styleSheet.rules[U.styleSheet.rules.length - 1];
                        } else {
                            if (U.sheet && U.sheet.insertRule) {
                                U.sheet.insertRule(T + " {overflow:" + Q + ";width:" + K + ";}", U.sheet.cssRules.length);
                                R = U.sheet.cssRules[U.sheet.cssRules.length - 1];
                            } else {
                                G._bStylesheetFallback = true;
                            }
                        }
                        G._oStylesheetRules[T] = R;
                    } else {
                        R.style.overflow = Q;
                        R.style.width = K;
                    }
                    return;
                }
                G._bStylesheetFallback = true;
            }
            if (G._bStylesheetFallback) {
                if (K == "auto") {
                    K = "";
                }
                var J = this._elTbody ? this._elTbody.rows.length : 0;
                if (!this._aFallbackColResizer[J]) {
                    var O,N,M;
                    var S = ["var colIdx=oColumn.getKeyIndex();","oColumn.getThEl().firstChild.style.width="];
                    for (O = J - 1,N = 2; O >= 0; --O) {
                        S[N++] = "this._elTbody.rows[";
                        S[N++] = O;
                        S[N++] = "].cells[colIdx].firstChild.style.width=";
                        S[N++] = "this._elTbody.rows[";
                        S[N++] = O;
                        S[N++] = "].cells[colIdx].style.width=";
                    }
                    S[N] = "sWidth;";
                    S[N + 1] = "oColumn.getThEl().firstChild.style.overflow=";
                    for (O = J - 1,M = N + 2; O >= 0; --O) {
                        S[M++] = "this._elTbody.rows[";
                        S[M++] = O;
                        S[M++] = "].cells[colIdx].firstChild.style.overflow=";
                        S[M++] = "this._elTbody.rows[";
                        S[M++] = O;
                        S[M++] = "].cells[colIdx].style.overflow=";
                    }
                    S[M] = "sOverflow;";
                    this._aFallbackColResizer[J] = new Function("oColumn", "sWidth", "sOverflow", S.join(""));
                }
                var L = this._aFallbackColResizer[J];
                if (L) {
                    L.call(this, P, K, Q);
                    return;
                }
            }
        } else {
        }
    },setColumnWidth:function(K, J) {
        K = this.getColumn(K);
        if (K) {
            if (C.isNumber(J)) {
                J = (J > K.minWidth) ? J : K.minWidth;
                K.width = J;
                this._setColumnWidth(K, J + "px");
                this._syncScroll();
                this.fireEvent("columnSetWidthEvent", {column:K,width:J});
                return;
            }
        }
    },hideColumn:function(P) {
        P = this.getColumn(P);
        if (P && !P.hidden) {
            if (P.getTreeIndex() !== null) {
                var M = this.getTbodyEl().rows;
                var L = M.length;
                var K = this._oColumnSet.getDescendants(P);
                for (var O = 0; O < K.length; O++) {
                    var Q = K[O];
                    Q.hidden = true;
                    var S = Q.getThEl();
                    var R = S.firstChild;
                    Q._nLastWidth = R.offsetWidth - (parseInt(D.getStyle(R, "paddingLeft"), 10) | 0) - (parseInt(D.getStyle(R, "paddingRight"), 10) | 0);
                    D.addClass(S, G.CLASS_HIDDEN);
                    var J = Q.getKeyIndex();
                    if (J !== null) {
                        for (var N = 0; N < L; N++) {
                            D.addClass(M[N].cells[J], G.CLASS_HIDDEN);
                        }
                        this._setColumnWidth(Q, "1px");
                        if (Q.resizeable) {
                            D.removeClass(Q.getResizerEl(), G.CLASS_RESIZER);
                        }
                        if (Q.sortable) {
                            D.removeClass(Q.getThEl(), G.CLASS_SORTABLE);
                            Q.getThEl().firstChild.firstChild.firstChild.style.display = "none";
                        }
                    } else {
                        S.firstChild.style.width = "1px";
                    }
                    this.fireEvent("columnHideEvent", {column:Q});
                }
            } else {
            }
        }
    },showColumn:function(P) {
        P = this.getColumn(P);
        if (P && P.hidden) {
            if (P.getTreeIndex() !== null) {
                var M = this.getTbodyEl().rows;
                var L = M.length;
                var K = this._oColumnSet.getDescendants(P);
                for (var O = 0; O < K.length; O++) {
                    var Q = K[O];
                    Q.hidden = false;
                    var R = Q.getThEl();
                    D.removeClass(R, G.CLASS_HIDDEN);
                    var J = Q.getKeyIndex();
                    if (J !== null) {
                        for (var N = 0; N < L; N++) {
                            D.removeClass(M[N].cells[J], G.CLASS_HIDDEN);
                        }
                        this.setColumnWidth(Q, (Q._nLastWidth || Q.minWidth), true);
                        if (Q.sortable) {
                            Q.getThEl().firstChild.firstChild.firstChild.style.display = "";
                            D.removeClass(Q.getThEl(), G.CLASS_SORTABLE);
                        }
                        if (Q.resizeable) {
                            Q._ddResizer.resetResizerEl();
                            D.addClass(Q.getResizerEl(), G.CLASS_RESIZER);
                        }
                    } else {
                        R.firstChild.style.width = "";
                    }
                    Q._nLastWidth = null;
                    this.fireEvent("columnShowEvent", {column:Q});
                }
            } else {
            }
        }
    },removeColumn:function(L) {
        var K = L.getTreeIndex();
        if (K !== null) {
            this._oChainRender.stop();
            var J = this._oColumnSet.getDefinitions();
            L = J.splice(K, 1)[0];
            this._initColumnSet(J);
            this._initTheadEls();
            this.render();
            this.fireEvent("columnRemoveEvent", {column:L});
            return L;
        }
    },insertColumn:function(M, J) {
        if (M instanceof YAHOO.widget.Column) {
            M = M.getDefinition();
        } else {
            if (M.constructor !== Object) {
                return;
            }
        }
        var K = this._oColumnSet;
        if (!C.isValue(J) || !C.isNumber(J)) {
            J = K.tree[0].length;
        }
        this._oChainRender.stop();
        var L = this._oColumnSet.getDefinitions();
        L.splice(J, 0, M);
        this._initColumnSet(L);
        this._initTheadEls();
        this.render();
        this.fireEvent("columnInsertEvent", {column:M,index:J});
    },selectColumn:function(L) {
        L = this.getColumn(L);
        if (L && !L.selected) {
            if (L.getKeyIndex() !== null) {
                L.selected = true;
                var M = L.getThEl();
                D.addClass(M, G.CLASS_SELECTED);
                var K = this.getTbodyEl().rows;
                var J = this._oChainRender;
                J.add({method:function(N) {
                    if ((this instanceof G) && this._sId && K[N.rowIndex] && K[N.rowIndex].cells[N.cellIndex]) {
                        D.addClass(K[N.rowIndex].cells[N.cellIndex], G.CLASS_SELECTED);
                    }
                    N.rowIndex++;
                },scope:this,iterations:K.length,argument:{rowIndex:0,cellIndex:L.getKeyIndex()}});
                J.run();
                this.fireEvent("columnSelectEvent", {column:L});
            } else {
            }
        }
    },unselectColumn:function(L) {
        L = this.getColumn(L);
        if (L && L.selected) {
            if (L.getKeyIndex() !== null) {
                L.selected = false;
                var M = L.getThEl();
                D.removeClass(M, G.CLASS_SELECTED);
                var K = this.getTbodyEl().rows;
                var J = this._oChainRender;
                J.add({method:function(N) {
                    if ((this instanceof G) && this._sId && K[N.rowIndex] && K[N.rowIndex].cells[N.cellIndex]) {
                        D.removeClass(K[N.rowIndex].cells[N.cellIndex], G.CLASS_SELECTED);
                    }
                    N.rowIndex++;
                },scope:this,iterations:K.length,argument:{rowIndex:0,cellIndex:L.getKeyIndex()}});
                J.run();
                this.fireEvent("columnUnselectEvent", {column:L});
            } else {
            }
        }
    },getSelectedColumns:function(N) {
        var K = [];
        var L = this._oColumnSet.keys;
        for (var M = 0,J = L.length; M < J; M++) {
            if (L[M].selected) {
                K[K.length] = L[M];
            }
        }
        return K;
    },highlightColumn:function(J) {
        var M = this.getColumn(J);
        if (M && (M.getKeyIndex() !== null)) {
            var N = M.getThEl();
            D.addClass(N, G.CLASS_HIGHLIGHTED);
            var L = this.getTbodyEl().rows;
            var K = this._oChainRender;
            K.add({method:function(O) {
                if ((this instanceof G) && this._sId && L[O.rowIndex] && L[O.rowIndex].cells[O.cellIndex]) {
                    D.addClass(L[O.rowIndex].cells[O.cellIndex], G.CLASS_HIGHLIGHTED);
                }
                O.rowIndex++;
            },scope:this,iterations:L.length,argument:{rowIndex:0,cellIndex:M.getKeyIndex()}});
            K.run();
            this.fireEvent("columnHighlightEvent", {column:M});
        } else {
        }
    },unhighlightColumn:function(J) {
        var M = this.getColumn(J);
        if (M && (M.getKeyIndex() !== null)) {
            var N = M.getThEl();
            D.removeClass(N, G.CLASS_HIGHLIGHTED);
            var L = this.getTbodyEl().rows;
            var K = this._oChainRender;
            K.add({method:function(O) {
                if ((this instanceof G) && this._sId && L[O.rowIndex] && L[O.rowIndex].cells[O.cellIndex]) {
                    D.removeClass(L[O.rowIndex].cells[O.cellIndex], G.CLASS_HIGHLIGHTED);
                }
                O.rowIndex++;
            },scope:this,iterations:L.length,argument:{rowIndex:0,cellIndex:M.getKeyIndex()}});
            K.run();
            this.fireEvent("columnUnhighlightEvent", {column:M});
        } else {
        }
    },_addTrEl:function(K, J) {
        var L = this._createTrEl(K);
        if (L) {
            if (J >= 0 && J < this._elTbody.rows.length) {
                this._elTbody.insertBefore(L, this._elTbody.rows[J]);
                if (!J) {
                    this._setFirstRow();
                }
            } else {
                this._elTbody.appendChild(L);
                this._setLastRow();
                J = this._elTbody.rows.length - 1;
            }
            this._setRowStripes(J);
        }
        return L;
    },addRow:function(P, L) {
        if (P && (P.constructor == Object)) {
            var N = this._oRecordSet.addRecord(P, L);
            if (N) {
                var J;
                var K = this.get("paginator");
                if (K instanceof B || this.get("paginated")) {
                    J = this.getRecordIndex(N);
                    var M;
                    if (K instanceof B) {
                        var O = K.get("totalRecords");
                        if (O !== B.VALUE_UNLIMITED) {
                            K.set("totalRecords", O + 1);
                        }
                        M = (K.getPageRecords())[1];
                    } else {
                        M = K.startRecordIndex + K.rowsPerPage - 1;
                        this.updatePaginator();
                    }
                    if (J <= M) {
                        this.render();
                    }
                    this.fireEvent("rowAddEvent", {record:N});
                    return;
                } else {
                    J = this.getTrIndex(N);
                    if (C.isNumber(J)) {
                        this._oChainRender.add({method:function(Q) {
                            if ((this instanceof G) && this._sId) {
                                var R = this._addTrEl(N, J);
                                if (R) {
                                    this.hideTableMessage();
                                    this.fireEvent("rowAddEvent", {record:N});
                                }
                            }
                        },scope:this,timeout:(this.get("renderLoopSize") > 0) ? 0 : -1});
                        this._oChainRender.run();
                        return;
                    }
                }
            }
        }
    },addRows:function(L, N) {
        if (C.isArray(L)) {
            var O = this._oRecordSet.addRecords(L, N);
            if (O) {
                var S = this.getRecordIndex(O[0]);
                var R = this.get("paginator");
                if (R instanceof B || this.get("paginated")) {
                    var Q;
                    if (R instanceof B) {
                        var P = R.get("totalRecords");
                        if (P !== B.VALUE_UNLIMITED) {
                            R.set("totalRecords", P + O.length);
                        }
                        Q = (R.getPageRecords())[1];
                    } else {
                        Q = R.startRecordIndex + R.rowsPerPage - 1;
                        this.updatePaginator();
                    }
                    if (S <= Q) {
                        this.render();
                    }
                    this.fireEvent("rowsAddEvent", {records:O});
                    return;
                } else {
                    var M = this.get("renderLoopSize");
                    var K = S + L.length;
                    var J = (K - S);
                    this._oChainRender.add({method:function(W) {
                        if ((this instanceof G) && this._sId) {
                            var V = W.nCurrentRow,U = W.nCurrentRecord,T = M > 0 ? Math.min(V + M, K) : K;
                            for (; V < T; ++V,++U) {
                                this._addTrEl(O[U], V);
                            }
                            W.nCurrentRow = V;
                            W.nCurrentRecord = U;
                        }
                    },iterations:(M > 0) ? Math.ceil(K / M) : 1,argument:{nCurrentRow:S,nCurrentRecord:0},scope:this,timeout:(M > 0) ? 0 : -1});
                    this._oChainRender.add({method:function() {
                        this.fireEvent("rowsAddEvent", {records:O});
                    },scope:this,timeout:-1});
                    this._oChainRender.run();
                    this.hideTableMessage();
                    return;
                }
            }
        }
    },updateRow:function(O, P) {
        var J,N,M,K;
        if ((O instanceof YAHOO.widget.Record) || (C.isNumber(O))) {
            J = this._oRecordSet.getRecord(O);
            K = this.getTrEl(J);
        } else {
            K = this.getTrEl(O);
            if (K) {
                J = this.getRecord(K);
            }
        }
        if (J) {
            var L = J.getData();
            N = YAHOO.widget.DataTable._cloneObject(L);
            M = this._oRecordSet.updateRecord(J, P);
        } else {
            return;
        }
        if (K) {
            this._oChainRender.add({method:function() {
                if ((this instanceof G) && this._sId) {
                    this._updateTrEl(K, M);
                    this.fireEvent("rowUpdateEvent", {record:M,oldData:N});
                }
            },scope:this,timeout:(this.get("renderLoopSize") > 0) ? 0 : -1});
            this._oChainRender.run();
        } else {
            this.fireEvent("rowUpdateEvent", {record:M,oldData:N});
        }
    },deleteRow:function(U) {
        var V;
        if ((U instanceof YAHOO.widget.Record) || (C.isNumber(U))) {
            V = this._oRecordSet.getRecord(U);
        } else {
            var K = this.getTrEl(U);
            if (K) {
                V = this.getRecord(K);
            }
        }
        if (V) {
            var R = V.getId();
            var T = this._aSelections || [];
            for (var O = T.length - 1; O > -1; O--) {
                if ((C.isNumber(T[O]) && (T[O] === R)) || ((T[O].constructor == Object) && (T[O].recordId === R))) {
                    T.splice(O, 1);
                }
            }
            var J = this.getRecordIndex(V);
            var M = this.getTrIndex(V);
            var L = this._oRecordSet.deleteRecord(J);
            if (L) {
                var S = this.get("paginator");
                if (S instanceof B || this.get("paginated")) {
                    var Q;
                    if (S instanceof B) {
                        Q = (S.getPageRecords()) ? (S.getPageRecords())[1] : null;
                        var P = S.get("totalRecords");
                        if (P !== B.VALUE_UNLIMITED) {
                            var N = (P - 1 > 0) ? P - 1 : 0;
                            S.set("totalRecords", N);
                        }
                    } else {
                        Q = S.startRecordIndex + S.rowsPerPage - 1;
                        this.updatePaginator();
                    }
                    if ((Q === null) || (J <= Q)) {
                        this.render();
                    }
                } else {
                    if (C.isNumber(M)) {
                        this._oChainRender.add({method:function() {
                            if ((this instanceof G) && this._sId) {
                                var W = (M == this.getLastTrEl().sectionRowIndex);
                                this._deleteTrEl(M);
                                if (this._elTbody.rows.length === 0) {
                                    this.showTableMessage(G.MSG_EMPTY, G.CLASS_EMPTY);
                                } else {
                                    if (M === 0) {
                                        this._setFirstRow();
                                    }
                                    if (W) {
                                        this._setLastRow();
                                    }
                                    if (M != this._elTbody.rows.length) {
                                        this._setRowStripes(M);
                                    }
                                }
                            }
                        },scope:this,timeout:(this.get("renderLoopSize") > 0) ? 0 : -1});
                    }
                }
                this._oChainRender.add({method:function() {
                    this.fireEvent("rowDeleteEvent", {recordIndex:J,oldData:L,trElIndex:M});
                },scope:this,timeout:(this.get("renderLoopSize") > 0) ? 0 : -1});
                this._oChainRender.run();
                return;
            }
        }
        return null;
    },deleteRows:function(P, Q) {
        var a;
        if ((P instanceof YAHOO.widget.Record) || (C.isNumber(P))) {
            a = this._oRecordSet.getRecord(P);
        } else {
            var J = this.getTrEl(P);
            if (J) {
                a = this.getRecord(J);
            }
        }
        if (a) {
            var R = a.getId();
            var O = this._aSelections || [];
            for (var W = O.length - 1; W > -1; W--) {
                if ((C.isNumber(O[W]) && (O[W] === R)) || ((O[W].constructor == Object) && (O[W].recordId === R))) {
                    O.splice(W, 1);
                }
            }
            var N = this.getRecordIndex(a);
            var M = this.getTrIndex(N);
            var U = N + 1;
            var b = N;
            if (Q && C.isNumber(Q)) {
                U = (Q > 0) ? N + Q - 1 : N;
                b = (Q > 0) ? N : N + Q + 1;
                Q = (Q > 0) ? Q : Q * -1;
            } else {
                Q = 1;
            }
            var L = this._oRecordSet.deleteRecords(b, Q);
            if (L) {
                var Y = this.get("paginator");
                if (Y instanceof B || this.get("paginated")) {
                    var V;
                    if (Y instanceof B) {
                        V = (Y.getPageRecords()) ? (Y.getPageRecords())[1] : null;
                        var T = Y.get("totalRecords");
                        if (T !== B.VALUE_UNLIMITED) {
                            var S = (T - Q > 0) ? T - Q : 0;
                            Y.set("totalRecords", S);
                        }
                    } else {
                        V = Y.startRecordIndex + Y.rowsPerPage - 1;
                        this.updatePaginator();
                    }
                    if ((V === null) || (b <= V)) {
                        this.render();
                    }
                } else {
                    if (C.isNumber(M)) {
                        var K = this.get("renderLoopSize");
                        var X = b;
                        var Z = Q;
                        this._oChainRender.add({method:function(e) {
                            if ((this instanceof G) && this._sId) {
                                var d = e.nCurrentRow,c = (K > 0) ? (Math.max(d - K, X) - 1) : X - 1;
                                for (; d > c; --d) {
                                    this._deleteTrEl(d);
                                }
                                e.nCurrentRow = d;
                            }
                        },iterations:(K > 0) ? Math.ceil(Q / K) : 1,argument:{nCurrentRow:U},scope:this,timeout:(K > 0) ? 0 : -1});
                        this._oChainRender.add({method:function() {
                            if (this._elTbody.rows.length === 0) {
                                this.showTableMessage(G.MSG_EMPTY, G.CLASS_EMPTY);
                            } else {
                                this._setFirstRow();
                                this._setLastRow();
                                this._setRowStripes();
                            }
                        },scope:this,timeout:-1});
                    }
                }
                this._oChainRender.add({method:function() {
                    this.fireEvent("rowsDeleteEvent", {recordIndex:Q,oldData:L,count:M});
                },scope:this,timeout:(this.get("renderLoopSize") > 0) ? 0 : -1});
                this._oChainRender.run();
                return;
            }
        }
        return null;
    },formatCell:function(M, K, O) {
        if (!(K instanceof YAHOO.widget.Record)) {
            K = this.getRecord(M);
        }
        if (!(O instanceof YAHOO.widget.Column)) {
            O = this._oColumnSet.getColumn(M.parentNode.yuiColumnKey);
        }
        if (K && O) {
            var L = O.key;
            var P = K.getData(L);
            var N;
            if (C.isString(O.className)) {
                N = [O.className];
            } else {
                if (C.isArray(O.className)) {
                    N = O.className;
                } else {
                    N = [];
                }
            }
            N[N.length] = "yui-dt-col-" + L.replace(/[^\w\-.:]/g, "");
            N[N.length] = "yui-dt-col-" + O.getId();
            N[N.length] = G.CLASS_LINER;
            if (O.sortable) {
                N[N.length] = G.CLASS_SORTABLE;
            }
            if (O.resizeable) {
                N[N.length] = G.CLASS_RESIZEABLE;
            }
            if (O.editor) {
                N[N.length] = G.CLASS_EDITABLE;
            }
            M.className = "";
            D.addClass(M, N.join(" "));
            var J = typeof O.formatter === "function" ? O.formatter : G.Formatter[O.formatter + ""];
            if (J) {
                J.call(this, M, K, O, P);
            } else {
                M.innerHTML = P === undefined || P === null || (typeof P === "number" && isNaN(P)) ? "" : P.toString();
            }
            this.fireEvent("cellFormatEvent", {record:K,column:O,key:L,el:M});
        } else {
        }
    },onPaginatorChange:function(J) {
        var K = this.get("paginationEventHandler");
        K(J, this);
    },_aSelections:null,_oAnchorRecord:null,_oAnchorCell:null,_unselectAllTrEls:function() {
        var J = D.getElementsByClassName(G.CLASS_SELECTED, "tr", this._elTbody);
        D.removeClass(J, G.CLASS_SELECTED);
    },_getSelectionTrigger:function() {
        var M = this.get("selectionMode");
        var L = {};
        var P,J,K,O,N;
        if ((M == "cellblock") || (M == "cellrange") || (M == "singlecell")) {
            P = this.getLastSelectedCell();
            if (!P) {
                return null;
            } else {
                J = this.getRecord(P.recordId);
                K = this.getRecordIndex(J);
                O = this.getTrEl(J);
                N = this.getTrIndex(O);
                if (N === null) {
                    return null;
                } else {
                    L.record = J;
                    L.recordIndex = K;
                    L.el = this.getTdEl(P);
                    L.trIndex = N;
                    L.column = this.getColumnById(P.columnId);
                    L.colKeyIndex = L.column.getKeyIndex();
                    L.cell = P;
                    return L;
                }
            }
        } else {
            J = this.getLastSelectedRecord();
            if (!J) {
                return null;
            } else {
                J = this.getRecord(J);
                K = this.getRecordIndex(J);
                O = this.getTrEl(J);
                N = this.getTrIndex(O);
                if (N === null) {
                    return null;
                } else {
                    L.record = J;
                    L.recordIndex = K;
                    L.el = O;
                    L.trIndex = N;
                    return L;
                }
            }
        }
    },_getSelectionAnchor:function(L) {
        var K = this.get("selectionMode");
        var M = {};
        var N,P,J;
        if ((K == "cellblock") || (K == "cellrange") || (K == "singlecell")) {
            var O = this._oAnchorCell;
            if (!O) {
                if (L) {
                    O = this._oAnchorCell = L.cell;
                } else {
                    return null;
                }
            }
            N = this._oAnchorCell.record;
            P = this._oRecordSet.getRecordIndex(N);
            J = this.getTrIndex(N);
            if (J === null) {
                if (P < this.getRecordIndex(this.getFirstTrEl())) {
                    J = 0;
                } else {
                    J = this.getRecordIndex(this.getLastTrEl());
                }
            }
            M.record = N;
            M.recordIndex = P;
            M.trIndex = J;
            M.column = this._oAnchorCell.column;
            M.colKeyIndex = M.column.getKeyIndex();
            M.cell = O;
            return M;
        } else {
            N = this._oAnchorRecord;
            if (!N) {
                if (L) {
                    N = this._oAnchorRecord = L.record;
                } else {
                    return null;
                }
            }
            P = this.getRecordIndex(N);
            J = this.getTrIndex(N);
            if (J === null) {
                if (P < this.getRecordIndex(this.getFirstTrEl())) {
                    J = 0;
                } else {
                    J = this.getRecordIndex(this.getLastTrEl());
                }
            }
            M.record = N;
            M.recordIndex = P;
            M.trIndex = J;
            return M;
        }
    },_handleStandardSelectionByMouse:function(K) {
        var J = K.target;
        var M = this.getTrEl(J);
        if (M) {
            var P = K.event;
            var S = P.shiftKey;
            var O = P.ctrlKey || ((navigator.userAgent.toLowerCase().indexOf("mac") != -1) && P.metaKey);
            var R = this.getRecord(M);
            var L = this._oRecordSet.getRecordIndex(R);
            var Q = this._getSelectionAnchor();
            var N;
            if (S && O) {
                if (Q) {
                    if (this.isSelected(Q.record)) {
                        if (Q.recordIndex < L) {
                            for (N = Q.recordIndex + 1; N <= L; N++) {
                                if (!this.isSelected(N)) {
                                    this.selectRow(N);
                                }
                            }
                        } else {
                            for (N = Q.recordIndex - 1; N >= L; N--) {
                                if (!this.isSelected(N)) {
                                    this.selectRow(N);
                                }
                            }
                        }
                    } else {
                        if (Q.recordIndex < L) {
                            for (N = Q.recordIndex + 1; N <= L - 1; N++) {
                                if (this.isSelected(N)) {
                                    this.unselectRow(N);
                                }
                            }
                        } else {
                            for (N = L + 1; N <= Q.recordIndex - 1; N++) {
                                if (this.isSelected(N)) {
                                    this.unselectRow(N);
                                }
                            }
                        }
                        this.selectRow(R);
                    }
                } else {
                    this._oAnchorRecord = R;
                    if (this.isSelected(R)) {
                        this.unselectRow(R);
                    } else {
                        this.selectRow(R);
                    }
                }
            } else {
                if (S) {
                    this.unselectAllRows();
                    if (Q) {
                        if (Q.recordIndex < L) {
                            for (N = Q.recordIndex; N <= L; N++) {
                                this.selectRow(N);
                            }
                        } else {
                            for (N = Q.recordIndex; N >= L; N--) {
                                this.selectRow(N);
                            }
                        }
                    } else {
                        this._oAnchorRecord = R;
                        this.selectRow(R);
                    }
                } else {
                    if (O) {
                        this._oAnchorRecord = R;
                        if (this.isSelected(R)) {
                            this.unselectRow(R);
                        } else {
                            this.selectRow(R);
                        }
                    } else {
                        this._handleSingleSelectionByMouse(K);
                        return;
                    }
                }
            }
        }
    },_handleStandardSelectionByKey:function(N) {
        var J = I.getCharCode(N);
        if ((J == 38) || (J == 40)) {
            var L = N.shiftKey;
            var K = this._getSelectionTrigger();
            if (!K) {
                return null;
            }
            I.stopEvent(N);
            var M = this._getSelectionAnchor(K);
            if (L) {
                if ((J == 40) && (M.recordIndex <= K.trIndex)) {
                    this.selectRow(this.getNextTrEl(K.el));
                } else {
                    if ((J == 38) && (M.recordIndex >= K.trIndex)) {
                        this.selectRow(this.getPreviousTrEl(K.el));
                    } else {
                        this.unselectRow(K.el);
                    }
                }
            } else {
                this._handleSingleSelectionByKey(N);
            }
        }
    },_handleSingleSelectionByMouse:function(L) {
        var M = L.target;
        var K = this.getTrEl(M);
        if (K) {
            var J = this.getRecord(K);
            this._oAnchorRecord = J;
            this.unselectAllRows();
            this.selectRow(J);
        }
    },_handleSingleSelectionByKey:function(M) {
        var J = I.getCharCode(M);
        if ((J == 38) || (J == 40)) {
            var K = this._getSelectionTrigger();
            if (!K) {
                return null;
            }
            I.stopEvent(M);
            var L;
            if (J == 38) {
                L = this.getPreviousTrEl(K.el);
                if (L === null) {
                    L = this.getFirstTrEl();
                }
            } else {
                if (J == 40) {
                    L = this.getNextTrEl(K.el);
                    if (L === null) {
                        L = this.getLastTrEl();
                    }
                }
            }
            this.unselectAllRows();
            this.selectRow(L);
            this._oAnchorRecord = this.getRecord(L);
        }
    },_handleCellBlockSelectionByMouse:function(Z) {
        var a = Z.target;
        var K = this.getTdEl(a);
        if (K) {
            var Y = Z.event;
            var P = Y.shiftKey;
            var L = Y.ctrlKey || ((navigator.userAgent.toLowerCase().indexOf("mac") != -1) && Y.metaKey);
            var R = this.getTrEl(K);
            var Q = this.getTrIndex(R);
            var U = this.getColumn(K);
            var V = U.getKeyIndex();
            var T = this.getRecord(R);
            var c = this._oRecordSet.getRecordIndex(T);
            var O = {record:T,column:U};
            var S = this._getSelectionAnchor();
            var N = this.getTbodyEl().rows;
            var M,J,b,X,W;
            if (P && L) {
                if (S) {
                    if (this.isSelected(S.cell)) {
                        if (S.recordIndex === c) {
                            if (S.colKeyIndex < V) {
                                for (X = S.colKeyIndex + 1; X <= V; X++) {
                                    this.selectCell(R.cells[X]);
                                }
                            } else {
                                if (V < S.colKeyIndex) {
                                    for (X = V; X < S.colKeyIndex; X++) {
                                        this.selectCell(R.cells[X]);
                                    }
                                }
                            }
                        } else {
                            if (S.recordIndex < c) {
                                M = Math.min(S.colKeyIndex, V);
                                J = Math.max(S.colKeyIndex, V);
                                for (X = S.trIndex; X <= Q; X++) {
                                    for (W = M; W <= J; W++) {
                                        this.selectCell(N[X].cells[W]);
                                    }
                                }
                            } else {
                                M = Math.min(S.trIndex, V);
                                J = Math.max(S.trIndex, V);
                                for (X = S.trIndex; X >= Q; X--) {
                                    for (W = J; W >= M; W--) {
                                        this.selectCell(N[X].cells[W]);
                                    }
                                }
                            }
                        }
                    } else {
                        if (S.recordIndex === c) {
                            if (S.colKeyIndex < V) {
                                for (X = S.colKeyIndex + 1; X < V; X++) {
                                    this.unselectCell(R.cells[X]);
                                }
                            } else {
                                if (V < S.colKeyIndex) {
                                    for (X = V + 1; X < S.colKeyIndex; X++) {
                                        this.unselectCell(R.cells[X]);
                                    }
                                }
                            }
                        }
                        if (S.recordIndex < c) {
                            for (X = S.trIndex; X <= Q; X++) {
                                b = N[X];
                                for (W = 0; W < b.cells.length; W++) {
                                    if (b.sectionRowIndex === S.trIndex) {
                                        if (W > S.colKeyIndex) {
                                            this.unselectCell(b.cells[W]);
                                        }
                                    } else {
                                        if (b.sectionRowIndex === Q) {
                                            if (W < V) {
                                                this.unselectCell(b.cells[W]);
                                            }
                                        } else {
                                            this.unselectCell(b.cells[W]);
                                        }
                                    }
                                }
                            }
                        } else {
                            for (X = Q; X <= S.trIndex; X++) {
                                b = N[X];
                                for (W = 0; W < b.cells.length; W++) {
                                    if (b.sectionRowIndex == Q) {
                                        if (W > V) {
                                            this.unselectCell(b.cells[W]);
                                        }
                                    } else {
                                        if (b.sectionRowIndex == S.trIndex) {
                                            if (W < S.colKeyIndex) {
                                                this.unselectCell(b.cells[W]);
                                            }
                                        } else {
                                            this.unselectCell(b.cells[W]);
                                        }
                                    }
                                }
                            }
                        }
                        this.selectCell(K);
                    }
                } else {
                    this._oAnchorCell = O;
                    if (this.isSelected(O)) {
                        this.unselectCell(O);
                    } else {
                        this.selectCell(O);
                    }
                }
            } else {
                if (P) {
                    this.unselectAllCells();
                    if (S) {
                        if (S.recordIndex === c) {
                            if (S.colKeyIndex < V) {
                                for (X = S.colKeyIndex; X <= V; X++) {
                                    this.selectCell(R.cells[X]);
                                }
                            } else {
                                if (V < S.colKeyIndex) {
                                    for (X = V; X <= S.colKeyIndex; X++) {
                                        this.selectCell(R.cells[X]);
                                    }
                                }
                            }
                        } else {
                            if (S.recordIndex < c) {
                                M = Math.min(S.colKeyIndex, V);
                                J = Math.max(S.colKeyIndex, V);
                                for (X = S.trIndex; X <= Q; X++) {
                                    for (W = M; W <= J; W++) {
                                        this.selectCell(N[X].cells[W]);
                                    }
                                }
                            } else {
                                M = Math.min(S.colKeyIndex, V);
                                J = Math.max(S.colKeyIndex, V);
                                for (X = Q; X <= S.trIndex; X++) {
                                    for (W = M; W <= J; W++) {
                                        this.selectCell(N[X].cells[W]);
                                    }
                                }
                            }
                        }
                    } else {
                        this._oAnchorCell = O;
                        this.selectCell(O);
                    }
                } else {
                    if (L) {
                        this._oAnchorCell = O;
                        if (this.isSelected(O)) {
                            this.unselectCell(O);
                        } else {
                            this.selectCell(O);
                        }
                    } else {
                        this._handleSingleCellSelectionByMouse(Z);
                    }
                }
            }
        }
    },_handleCellBlockSelectionByKey:function(O) {
        var J = I.getCharCode(O);
        var T = O.shiftKey;
        if ((J == 9) || !T) {
            this._handleSingleCellSelectionByKey(O);
            return;
        }
        if ((J > 36) && (J < 41)) {
            var U = this._getSelectionTrigger();
            if (!U) {
                return null;
            }
            I.stopEvent(O);
            var R = this._getSelectionAnchor(U);
            var K,S,L,Q,M;
            var P = this.getTbodyEl().rows;
            var N = U.el.parentNode;
            if (J == 40) {
                if (R.recordIndex <= U.recordIndex) {
                    M = this.getNextTrEl(U.el);
                    if (M) {
                        S = R.colKeyIndex;
                        L = U.colKeyIndex;
                        if (S > L) {
                            for (K = S; K >= L; K--) {
                                Q = M.cells[K];
                                this.selectCell(Q);
                            }
                        } else {
                            for (K = S; K <= L; K++) {
                                Q = M.cells[K];
                                this.selectCell(Q);
                            }
                        }
                    }
                } else {
                    S = Math.min(R.colKeyIndex, U.colKeyIndex);
                    L = Math.max(R.colKeyIndex, U.colKeyIndex);
                    for (K = S; K <= L; K++) {
                        this.unselectCell(N.cells[K]);
                    }
                }
            } else {
                if (J == 38) {
                    if (R.recordIndex >= U.recordIndex) {
                        M = this.getPreviousTrEl(U.el);
                        if (M) {
                            S = R.colKeyIndex;
                            L = U.colKeyIndex;
                            if (S > L) {
                                for (K = S; K >= L; K--) {
                                    Q = M.cells[K];
                                    this.selectCell(Q);
                                }
                            } else {
                                for (K = S; K <= L; K++) {
                                    Q = M.cells[K];
                                    this.selectCell(Q);
                                }
                            }
                        }
                    } else {
                        S = Math.min(R.colKeyIndex, U.colKeyIndex);
                        L = Math.max(R.colKeyIndex, U.colKeyIndex);
                        for (K = S; K <= L; K++) {
                            this.unselectCell(N.cells[K]);
                        }
                    }
                } else {
                    if (J == 39) {
                        if (R.colKeyIndex <= U.colKeyIndex) {
                            if (U.colKeyIndex < N.cells.length - 1) {
                                S = R.trIndex;
                                L = U.trIndex;
                                if (S > L) {
                                    for (K = S; K >= L; K--) {
                                        Q = P[K].cells[U.colKeyIndex + 1];
                                        this.selectCell(Q);
                                    }
                                } else {
                                    for (K = S; K <= L; K++) {
                                        Q = P[K].cells[U.colKeyIndex + 1];
                                        this.selectCell(Q);
                                    }
                                }
                            }
                        } else {
                            S = Math.min(R.trIndex, U.trIndex);
                            L = Math.max(R.trIndex, U.trIndex);
                            for (K = S; K <= L; K++) {
                                this.unselectCell(P[K].cells[U.colKeyIndex]);
                            }
                        }
                    } else {
                        if (J == 37) {
                            if (R.colKeyIndex >= U.colKeyIndex) {
                                if (U.colKeyIndex > 0) {
                                    S = R.trIndex;
                                    L = U.trIndex;
                                    if (S > L) {
                                        for (K = S; K >= L; K--) {
                                            Q = P[K].cells[U.colKeyIndex - 1];
                                            this.selectCell(Q);
                                        }
                                    } else {
                                        for (K = S; K <= L; K++) {
                                            Q = P[K].cells[U.colKeyIndex - 1];
                                            this.selectCell(Q);
                                        }
                                    }
                                }
                            } else {
                                S = Math.min(R.trIndex, U.trIndex);
                                L = Math.max(R.trIndex, U.trIndex);
                                for (K = S; K <= L; K++) {
                                    this.unselectCell(P[K].cells[U.colKeyIndex]);
                                }
                            }
                        }
                    }
                }
            }
        }
    },_handleCellRangeSelectionByMouse:function(X) {
        var Y = X.target;
        var J = this.getTdEl(Y);
        if (J) {
            var W = X.event;
            var N = W.shiftKey;
            var K = W.ctrlKey || ((navigator.userAgent.toLowerCase().indexOf("mac") != -1) && W.metaKey);
            var P = this.getTrEl(J);
            var O = this.getTrIndex(P);
            var S = this.getColumn(J);
            var T = S.getKeyIndex();
            var R = this.getRecord(P);
            var a = this._oRecordSet.getRecordIndex(R);
            var M = {record:R,column:S};
            var Q = this._getSelectionAnchor();
            var L = this.getTbodyEl().rows;
            var Z,V,U;
            if (N && K) {
                if (Q) {
                    if (this.isSelected(Q.cell)) {
                        if (Q.recordIndex === a) {
                            if (Q.colKeyIndex < T) {
                                for (V = Q.colKeyIndex + 1; V <= T; V++) {
                                    this.selectCell(P.cells[V]);
                                }
                            } else {
                                if (T < Q.colKeyIndex) {
                                    for (V = T; V < Q.colKeyIndex; V++) {
                                        this.selectCell(P.cells[V]);
                                    }
                                }
                            }
                        } else {
                            if (Q.recordIndex < a) {
                                for (V = Q.colKeyIndex + 1; V < P.cells.length; V++) {
                                    this.selectCell(P.cells[V]);
                                }
                                for (V = Q.trIndex + 1; V < O; V++) {
                                    for (U = 0; U < L[V].cells.length; U++) {
                                        this.selectCell(L[V].cells[U]);
                                    }
                                }
                                for (V = 0; V <= T; V++) {
                                    this.selectCell(P.cells[V]);
                                }
                            } else {
                                for (V = T; V < P.cells.length; V++) {
                                    this.selectCell(P.cells[V]);
                                }
                                for (V = O + 1; V < Q.trIndex; V++) {
                                    for (U = 0; U < L[V].cells.length; U++) {
                                        this.selectCell(L[V].cells[U]);
                                    }
                                }
                                for (V = 0; V < Q.colKeyIndex; V++) {
                                    this.selectCell(P.cells[V]);
                                }
                            }
                        }
                    } else {
                        if (Q.recordIndex === a) {
                            if (Q.colKeyIndex < T) {
                                for (V = Q.colKeyIndex + 1; V < T; V++) {
                                    this.unselectCell(P.cells[V]);
                                }
                            } else {
                                if (T < Q.colKeyIndex) {
                                    for (V = T + 1; V < Q.colKeyIndex; V++) {
                                        this.unselectCell(P.cells[V]);
                                    }
                                }
                            }
                        }
                        if (Q.recordIndex < a) {
                            for (V = Q.trIndex; V <= O; V++) {
                                Z = L[V];
                                for (U = 0; U < Z.cells.length; U++) {
                                    if (Z.sectionRowIndex === Q.trIndex) {
                                        if (U > Q.colKeyIndex) {
                                            this.unselectCell(Z.cells[U]);
                                        }
                                    } else {
                                        if (Z.sectionRowIndex === O) {
                                            if (U < T) {
                                                this.unselectCell(Z.cells[U]);
                                            }
                                        } else {
                                            this.unselectCell(Z.cells[U]);
                                        }
                                    }
                                }
                            }
                        } else {
                            for (V = O; V <= Q.trIndex; V++) {
                                Z = L[V];
                                for (U = 0; U < Z.cells.length; U++) {
                                    if (Z.sectionRowIndex == O) {
                                        if (U > T) {
                                            this.unselectCell(Z.cells[U]);
                                        }
                                    } else {
                                        if (Z.sectionRowIndex == Q.trIndex) {
                                            if (U < Q.colKeyIndex) {
                                                this.unselectCell(Z.cells[U]);
                                            }
                                        } else {
                                            this.unselectCell(Z.cells[U]);
                                        }
                                    }
                                }
                            }
                        }
                        this.selectCell(J);
                    }
                } else {
                    this._oAnchorCell = M;
                    if (this.isSelected(M)) {
                        this.unselectCell(M);
                    } else {
                        this.selectCell(M);
                    }
                }
            } else {
                if (N) {
                    this.unselectAllCells();
                    if (Q) {
                        if (Q.recordIndex === a) {
                            if (Q.colKeyIndex < T) {
                                for (V = Q.colKeyIndex; V <= T; V++) {
                                    this.selectCell(P.cells[V]);
                                }
                            } else {
                                if (T < Q.colKeyIndex) {
                                    for (V = T; V <= Q.colKeyIndex; V++) {
                                        this.selectCell(P.cells[V]);
                                    }
                                }
                            }
                        } else {
                            if (Q.recordIndex < a) {
                                for (V = Q.trIndex; V <= O; V++) {
                                    Z = L[V];
                                    for (U = 0; U < Z.cells.length; U++) {
                                        if (Z.sectionRowIndex == Q.trIndex) {
                                            if (U >= Q.colKeyIndex) {
                                                this.selectCell(Z.cells[U]);
                                            }
                                        } else {
                                            if (Z.sectionRowIndex == O) {
                                                if (U <= T) {
                                                    this.selectCell(Z.cells[U]);
                                                }
                                            } else {
                                                this.selectCell(Z.cells[U]);
                                            }
                                        }
                                    }
                                }
                            } else {
                                for (V = O; V <= Q.trIndex; V++) {
                                    Z = L[V];
                                    for (U = 0; U < Z.cells.length; U++) {
                                        if (Z.sectionRowIndex == O) {
                                            if (U >= T) {
                                                this.selectCell(Z.cells[U]);
                                            }
                                        } else {
                                            if (Z.sectionRowIndex == Q.trIndex) {
                                                if (U <= Q.colKeyIndex) {
                                                    this.selectCell(Z.cells[U]);
                                                }
                                            } else {
                                                this.selectCell(Z.cells[U]);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    } else {
                        this._oAnchorCell = M;
                        this.selectCell(M);
                    }
                } else {
                    if (K) {
                        this._oAnchorCell = M;
                        if (this.isSelected(M)) {
                            this.unselectCell(M);
                        } else {
                            this.selectCell(M);
                        }
                    } else {
                        this._handleSingleCellSelectionByMouse(X);
                    }
                }
            }
        }
    },_handleCellRangeSelectionByKey:function(N) {
        var J = I.getCharCode(N);
        var R = N.shiftKey;
        if ((J == 9) || !R) {
            this._handleSingleCellSelectionByKey(N);
            return;
        }
        if ((J > 36) && (J < 41)) {
            var S = this._getSelectionTrigger();
            if (!S) {
                return null;
            }
            I.stopEvent(N);
            var Q = this._getSelectionAnchor(S);
            var K,L,P;
            var O = this.getTbodyEl().rows;
            var M = S.el.parentNode;
            if (J == 40) {
                L = this.getNextTrEl(S.el);
                if (Q.recordIndex <= S.recordIndex) {
                    for (K = S.colKeyIndex + 1; K < M.cells.length; K++) {
                        P = M.cells[K];
                        this.selectCell(P);
                    }
                    if (L) {
                        for (K = 0; K <= S.colKeyIndex; K++) {
                            P = L.cells[K];
                            this.selectCell(P);
                        }
                    }
                } else {
                    for (K = S.colKeyIndex; K < M.cells.length; K++) {
                        this.unselectCell(M.cells[K]);
                    }
                    if (L) {
                        for (K = 0; K < S.colKeyIndex; K++) {
                            this.unselectCell(L.cells[K]);
                        }
                    }
                }
            } else {
                if (J == 38) {
                    L = this.getPreviousTrEl(S.el);
                    if (Q.recordIndex >= S.recordIndex) {
                        for (K = S.colKeyIndex - 1; K > -1; K--) {
                            P = M.cells[K];
                            this.selectCell(P);
                        }
                        if (L) {
                            for (K = M.cells.length - 1; K >= S.colKeyIndex; K--) {
                                P = L.cells[K];
                                this.selectCell(P);
                            }
                        }
                    } else {
                        for (K = S.colKeyIndex; K > -1; K--) {
                            this.unselectCell(M.cells[K]);
                        }
                        if (L) {
                            for (K = M.cells.length - 1; K > S.colKeyIndex; K--) {
                                this.unselectCell(L.cells[K]);
                            }
                        }
                    }
                } else {
                    if (J == 39) {
                        L = this.getNextTrEl(S.el);
                        if (Q.recordIndex < S.recordIndex) {
                            if (S.colKeyIndex < M.cells.length - 1) {
                                P = M.cells[S.colKeyIndex + 1];
                                this.selectCell(P);
                            } else {
                                if (L) {
                                    P = L.cells[0];
                                    this.selectCell(P);
                                }
                            }
                        } else {
                            if (Q.recordIndex > S.recordIndex) {
                                this.unselectCell(M.cells[S.colKeyIndex]);
                                if (S.colKeyIndex < M.cells.length - 1) {
                                } else {
                                }
                            } else {
                                if (Q.colKeyIndex <= S.colKeyIndex) {
                                    if (S.colKeyIndex < M.cells.length - 1) {
                                        P = M.cells[S.colKeyIndex + 1];
                                        this.selectCell(P);
                                    } else {
                                        if (S.trIndex < O.length - 1) {
                                            P = L.cells[0];
                                            this.selectCell(P);
                                        }
                                    }
                                } else {
                                    this.unselectCell(M.cells[S.colKeyIndex]);
                                }
                            }
                        }
                    } else {
                        if (J == 37) {
                            L = this.getPreviousTrEl(S.el);
                            if (Q.recordIndex < S.recordIndex) {
                                this.unselectCell(M.cells[S.colKeyIndex]);
                                if (S.colKeyIndex > 0) {
                                } else {
                                }
                            } else {
                                if (Q.recordIndex > S.recordIndex) {
                                    if (S.colKeyIndex > 0) {
                                        P = M.cells[S.colKeyIndex - 1];
                                        this.selectCell(P);
                                    } else {
                                        if (S.trIndex > 0) {
                                            P = L.cells[L.cells.length - 1];
                                            this.selectCell(P);
                                        }
                                    }
                                } else {
                                    if (Q.colKeyIndex >= S.colKeyIndex) {
                                        if (S.colKeyIndex > 0) {
                                            P = M.cells[S.colKeyIndex - 1];
                                            this.selectCell(P);
                                        } else {
                                            if (S.trIndex > 0) {
                                                P = L.cells[L.cells.length - 1];
                                                this.selectCell(P);
                                            }
                                        }
                                    } else {
                                        this.unselectCell(M.cells[S.colKeyIndex]);
                                        if (S.colKeyIndex > 0) {
                                        } else {
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    },_handleSingleCellSelectionByMouse:function(O) {
        var P = O.target;
        var L = this.getTdEl(P);
        if (L) {
            var K = this.getTrEl(L);
            var J = this.getRecord(K);
            var N = this.getColumn(L);
            var M = {record:J,column:N};
            this._oAnchorCell = M;
            this.unselectAllCells();
            this.selectCell(M);
        }
    },_handleSingleCellSelectionByKey:function(N) {
        var J = I.getCharCode(N);
        if ((J == 9) || ((J > 36) && (J < 41))) {
            var L = N.shiftKey;
            var K = this._getSelectionTrigger();
            if (!K) {
                return null;
            }
            var M;
            if (J == 40) {
                M = this.getBelowTdEl(K.el);
                if (M === null) {
                    M = K.el;
                }
            } else {
                if (J == 38) {
                    M = this.getAboveTdEl(K.el);
                    if (M === null) {
                        M = K.el;
                    }
                } else {
                    if ((J == 39) || (!L && (J == 9))) {
                        M = this.getNextTdEl(K.el);
                        if (M === null) {
                            return;
                        }
                    } else {
                        if ((J == 37) || (L && (J == 9))) {
                            M = this.getPreviousTdEl(K.el);
                            if (M === null) {
                                return;
                            }
                        }
                    }
                }
            }
            I.stopEvent(N);
            this.unselectAllCells();
            this.selectCell(M);
            this._oAnchorCell = {record:this.getRecord(M),column:this.getColumn(M)};
        }
    },getSelectedTrEls:function() {
        return D.getElementsByClassName(G.CLASS_SELECTED, "tr", this._elTbody);
    },selectRow:function(P) {
        var O,J;
        if (P instanceof YAHOO.widget.Record) {
            O = this._oRecordSet.getRecord(P);
            J = this.getTrEl(O);
        } else {
            if (C.isNumber(P)) {
                O = this.getRecord(P);
                J = this.getTrEl(O);
            } else {
                J = this.getTrEl(P);
                O = this.getRecord(J);
            }
        }
        if (O) {
            var N = this._aSelections || [];
            var M = O.getId();
            var L = -1;
            if (N.indexOf) {
                L = N.indexOf(M);
            } else {
                for (var K = N.length - 1; K > -1; K--) {
                    if (N[K] === M) {
                        L = K;
                        break;
                    }
                }
            }
            if (L > -1) {
                N.splice(L, 1);
            }
            N.push(M);
            this._aSelections = N;
            if (!this._oAnchorRecord) {
                this._oAnchorRecord = O;
            }
            if (J) {
                D.addClass(J, G.CLASS_SELECTED);
            }
            this.fireEvent("rowSelectEvent", {record:O,el:J});
        } else {
        }
    },unselectRow:function(Q) {
        var J = this.getTrEl(Q);
        var P;
        if (Q instanceof YAHOO.widget.Record) {
            P = this._oRecordSet.getRecord(Q);
        } else {
            if (C.isNumber(Q)) {
                P = this.getRecord(Q);
            } else {
                P = this.getRecord(J);
            }
        }
        if (P) {
            var O = this._aSelections || [];
            var M = P.getId();
            var L = -1;
            var N = false;
            if (O.indexOf) {
                L = O.indexOf(M);
            } else {
                for (var K = O.length - 1; K > -1; K--) {
                    if (O[K] === M) {
                        L = K;
                        break;
                    }
                }
            }
            if (L > -1) {
                O.splice(L, 1);
            }
            if (N) {
                this._aSelections = O;
                D.removeClass(J, G.CLASS_SELECTED);
                this.fireEvent("rowUnselectEvent", {record:P,el:J});
                return;
            }
            D.removeClass(J, G.CLASS_SELECTED);
            this.fireEvent("rowUnselectEvent", {record:P,el:J});
        }
    },unselectAllRows:function() {
        var K = this._aSelections || [];
        for (var J = K.length - 1; J > -1; J--) {
            if (C.isString(K[J])) {
                K.splice(J, 1);
            }
        }
        this._aSelections = K;
        this._unselectAllTrEls();
        this.fireEvent("unselectAllRowsEvent");
    },_unselectAllTdEls:function() {
        var J = D.getElementsByClassName(G.CLASS_SELECTED, "td", this._elTbody);
        D.removeClass(J, G.CLASS_SELECTED);
    },getSelectedTdEls:function() {
        return D.getElementsByClassName(G.CLASS_SELECTED, "td", this._elTbody);
    },selectCell:function(J) {
        var P = this.getTdEl(J);
        if (P) {
            var O = this.getRecord(P);
            var N = P.yuiColumnId;
            if (O && N) {
                var M = this._aSelections || [];
                var L = O.getId();
                for (var K = M.length - 1; K > -1; K--) {
                    if ((M[K].recordId === L) && (M[K].columnId === N)) {
                        M.splice(K, 1);
                        break;
                    }
                }
                M.push({recordId:L,columnId:N});
                this._aSelections = M;
                if (!this._oAnchorCell) {
                    this._oAnchorCell = {record:O,column:this.getColumnById(N)};
                }
                D.addClass(P, G.CLASS_SELECTED);
                this.fireEvent("cellSelectEvent", {record:O,column:this.getColumnById(N),key:P.yuiColumnKey,el:P});
                return;
            }
        }
    },unselectCell:function(J) {
        var O = this.getTdEl(J);
        if (O) {
            var N = this.getRecord(O);
            var M = O.yuiColumnId;
            if (N && M) {
                var L = this._aSelections || [];
                var P = N.getId();
                for (var K = L.length - 1; K > -1; K--) {
                    if ((L[K].recordId === P) && (L[K].columnId === M)) {
                        L.splice(K, 1);
                        this._aSelections = L;
                        D.removeClass(O, G.CLASS_SELECTED);
                        this.fireEvent("cellUnselectEvent", {record:N,column:this.getColumnById(M),key:O.yuiColumnKey,el:O});
                        return;
                    }
                }
            }
        }
    },unselectAllCells:function() {
        var K = this._aSelections || [];
        for (var J = K.length - 1; J > -1; J--) {
            if (K[J].constructor == Object) {
                K.splice(J, 1);
            }
        }
        this._aSelections = K;
        this._unselectAllTdEls();
        this.fireEvent("unselectAllCellsEvent");
    },isSelected:function(O) {
        if (O && (O.ownerDocument == document)) {
            return(D.hasClass(this.getTdEl(O), G.CLASS_SELECTED) || D.hasClass(this.getTrEl(O), G.CLASS_SELECTED));
        } else {
            var N,K,J;
            var M = this._aSelections;
            if (M && M.length > 0) {
                if (O instanceof YAHOO.widget.Record) {
                    N = O;
                } else {
                    if (C.isNumber(O)) {
                        N = this.getRecord(O);
                    }
                }
                if (N) {
                    K = N.getId();
                    if (M.indexOf) {
                        if (M.indexOf(K) > -1) {
                            return true;
                        }
                    } else {
                        for (J = M.length - 1; J > -1; J--) {
                            if (M[J] === K) {
                                return true;
                            }
                        }
                    }
                } else {
                    if (O.record && O.column) {
                        K = O.record.getId();
                        var L = O.column.getId();
                        for (J = M.length - 1; J > -1; J--) {
                            if ((M[J].recordId === K) && (M[J].columnId === L)) {
                                return true;
                            }
                        }
                    }
                }
            }
        }
        return false;
    },getSelectedRows:function() {
        var J = [];
        var L = this._aSelections || [];
        for (var K = 0; K < L.length; K++) {
            if (C.isString(L[K])) {
                J.push(L[K]);
            }
        }
        return J;
    },getSelectedCells:function() {
        var K = [];
        var L = this._aSelections || [];
        for (var J = 0; J < L.length; J++) {
            if (L[J] && (L[J].constructor == Object)) {
                K.push(L[J]);
            }
        }
        return K;
    },getLastSelectedRecord:function() {
        var K = this._aSelections;
        if (K && K.length > 0) {
            for (var J = K.length - 1; J > -1; J--) {
                if (C.isString(K[J])) {
                    return K[J];
                }
            }
        }
    },getLastSelectedCell:function() {
        var K = this._aSelections;
        if (K && K.length > 0) {
            for (var J = K.length - 1; J > -1; J--) {
                if (K[J].recordId && K[J].columnId) {
                    return K[J];
                }
            }
        }
    },highlightRow:function(L) {
        var J = this.getTrEl(L);
        if (J) {
            var K = this.getRecord(J);
            D.addClass(J, G.CLASS_HIGHLIGHTED);
            this.fireEvent("rowHighlightEvent", {record:K,el:J});
            return;
        }
    },unhighlightRow:function(L) {
        var J = this.getTrEl(L);
        if (J) {
            var K = this.getRecord(J);
            D.removeClass(J, G.CLASS_HIGHLIGHTED);
            this.fireEvent("rowUnhighlightEvent", {record:K,el:J});
            return;
        }
    },highlightCell:function(J) {
        var M = this.getTdEl(J);
        if (M) {
            var L = this.getRecord(M);
            var K = M.yuiColumnId;
            D.addClass(M, G.CLASS_HIGHLIGHTED);
            this.fireEvent("cellHighlightEvent", {record:L,column:this.getColumnById(K),key:M.yuiColumnKey,el:M});
            return;
        }
    },unhighlightCell:function(J) {
        var L = this.getTdEl(J);
        if (L) {
            var K = this.getRecord(L);
            D.removeClass(L, G.CLASS_HIGHLIGHTED);
            this.fireEvent("cellUnhighlightEvent", {record:K,column:this.getColumnById(L.yuiColumnId),key:L.yuiColumnKey,el:L});
            return;
        }
    },showCellEditor:function(N, L, P) {
        N = D.get(N);
        if (N && (N.ownerDocument === document)) {
            if (!L || !(L instanceof YAHOO.widget.Record)) {
                L = this.getRecord(N);
            }
            if (!P || !(P instanceof YAHOO.widget.Column)) {
                P = this.getColumn(N);
            }
            if (L && P) {
                var M = this._oCellEditor;
                if (M.isActive) {
                    this.cancelCellEditor();
                }
                if (!P.editor) {
                    return;
                }
                M.cell = N;
                M.record = L;
                M.column = P;
                M.validator = (P.editorOptions && C.isFunction(P.editorOptions.validator)) ? P.editorOptions.validator : null;
                M.value = L.getData(P.key);
                M.defaultValue = null;
                var O = M.container;
                var J = D.getX(N);
                var Q = D.getY(N);
                if (isNaN(J) || isNaN(Q)) {
                    J = N.offsetLeft + D.getX(this._elTbody.parentNode) - this._elTbody.scrollLeft;
                    Q = N.offsetTop + D.getY(this._elTbody.parentNode) - this._elTbody.scrollTop + this._elThead.offsetHeight;
                }
                O.style.left = J + "px";
                O.style.top = Q + "px";
                this.doBeforeShowCellEditor(this._oCellEditor);
                O.style.display = "";
                I.addListener(O, "keydown", function(S, R) {
                    if ((S.keyCode == 27)) {
                        R.cancelCellEditor();
                        R.focusTbodyEl();
                    } else {
                        R.fireEvent("editorKeydownEvent", {editor:R._oCellEditor,event:S});
                    }
                }, this);
                var K;
                if (C.isString(P.editor)) {
                    switch (P.editor) {case"checkbox":K = G.editCheckbox;break;case"date":K = G.editDate;break;case"dropdown":K = G.editDropdown;break;case"radio":K = G.editRadio;break;case"textarea":K = G.editTextarea;break;case"textbox":K = G.editTextbox;break;default:K = null;}
                } else {
                    if (C.isFunction(P.editor)) {
                        K = P.editor;
                    }
                }
                if (K) {
                    K(this._oCellEditor, this);
                    if (!P.editorOptions || !P.editorOptions.disableBtns) {
                        this.showCellEditorBtns(O);
                    }
                    M.isActive = true;
                    this.fireEvent("editorShowEvent", {editor:M});
                    return;
                }
            }
        }
    },doBeforeShowCellEditor:function(J) {
    },showCellEditorBtns:function(L) {
        var M = L.appendChild(document.createElement("div"));
        D.addClass(M, G.CLASS_BUTTON);
        var K = M.appendChild(document.createElement("button"));
        D.addClass(K, G.CLASS_DEFAULT);
        K.innerHTML = "OK";
        I.addListener(K, "click", function(O, N) {
            N.onEventSaveCellEditor(O, N);
            N.focusTbodyEl();
        }, this, true);
        var J = M.appendChild(document.createElement("button"));
        J.innerHTML = "Cancel";
        I.addListener(J, "click", function(O, N) {
            N.onEventCancelCellEditor(O, N);
            N.focusTbodyEl();
        }, this, true);
    },resetCellEditor:function() {
        var J = this._oCellEditor.container;
        J.style.display = "none";
        I.purgeElement(J, true);
        J.innerHTML = "";
        this._oCellEditor.value = null;
        this._oCellEditor.isActive = false;
    },saveCellEditor:function() {
        if (this._oCellEditor.isActive) {
            var J = this._oCellEditor.value;
            var K = YAHOO.widget.DataTable._cloneObject(this._oCellEditor.record.getData(this._oCellEditor.column.key));
            if (this._oCellEditor.validator) {
                J = this._oCellEditor.value = this._oCellEditor.validator.call(this, J, K, this._oCellEditor);
                if (J === null) {
                    this.resetCellEditor();
                    this.fireEvent("editorRevertEvent", {editor:this._oCellEditor,oldData:K,newData:J});
                    return;
                }
            }
            this._oRecordSet.updateRecordValue(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);
            this.formatCell(this._oCellEditor.cell.firstChild);
            this._oChainRender.add({method:function() {
                this._syncColWidths();
            },scope:this});
            this._oChainRender.run();
            this.resetCellEditor();
            this.fireEvent("editorSaveEvent", {editor:this._oCellEditor,oldData:K,newData:J});
        } else {
        }
    },cancelCellEditor:function() {
        if (this._oCellEditor.isActive) {
            this.resetCellEditor();
            this.fireEvent("editorCancelEvent", {editor:this._oCellEditor});
        } else {
        }
    },doBeforeLoadData:function(J, K, L) {
        return true;
    },onEventSortColumn:function(L) {
        var J = L.event;
        var N = L.target;
        var K = this.getThEl(N) || this.getTdEl(N);
        if (K && K.yuiColumnKey) {
            var M = this.getColumn(K.yuiColumnKey);
            if (M.sortable) {
                I.stopEvent(J);
                this.sortColumn(M);
            }
        } else {
        }
    },onEventSelectColumn:function(J) {
        this.selectColumn(J.target);
    },onEventHighlightColumn:function(J) {
        if (!D.isAncestor(J.target, I.getRelatedTarget(J.event))) {
            this.highlightColumn(J.target);
        }
    },onEventUnhighlightColumn:function(J) {
        if (!D.isAncestor(J.target, I.getRelatedTarget(J.event))) {
            this.unhighlightColumn(J.target);
        }
    },onEventSelectRow:function(K) {
        var J = this.get("selectionMode");
        if (J == "single") {
            this._handleSingleSelectionByMouse(K);
        } else {
            this._handleStandardSelectionByMouse(K);
        }
    },onEventSelectCell:function(K) {
        var J = this.get("selectionMode");
        if (J == "cellblock") {
            this._handleCellBlockSelectionByMouse(K);
        } else {
            if (J == "cellrange") {
                this._handleCellRangeSelectionByMouse(K);
            } else {
                this._handleSingleCellSelectionByMouse(K);
            }
        }
    },onEventHighlightRow:function(J) {
        if (!D.isAncestor(J.target, I.getRelatedTarget(J.event))) {
            this.highlightRow(J.target);
        }
    },onEventUnhighlightRow:function(J) {
        if (!D.isAncestor(J.target, I.getRelatedTarget(J.event))) {
            this.unhighlightRow(J.target);
        }
    },onEventHighlightCell:function(J) {
        if (!D.isAncestor(J.target, I.getRelatedTarget(J.event))) {
            this.highlightCell(J.target);
        }
    },onEventUnhighlightCell:function(J) {
        if (!D.isAncestor(J.target, I.getRelatedTarget(J.event))) {
            this.unhighlightCell(J.target);
        }
    },onEventFormatCell:function(J) {
        var M = J.target;
        var K = this.getTdEl(M);
        if (K && K.yuiColumnKey) {
            var L = this.getColumn(K.yuiColumnKey);
            this.formatCell(K.firstChild, this.getRecord(K), L);
        } else {
        }
    },onEventShowCellEditor:function(J) {
        var L = J.target;
        var K = this.getTdEl(L);
        if (K) {
            this.showCellEditor(K);
        } else {
        }
    },onEventSaveCellEditor:function(J) {
        this.saveCellEditor();
    },onEventCancelCellEditor:function(J) {
        this.cancelCellEditor();
    },onDataReturnInitializeTable:function(J, K, L) {
        this.initializeTable();
        this.onDataReturnSetRows(J, K, L);
    },onDataReturnAppendRows:function(L, M, N) {
        this.fireEvent("dataReturnEvent", {request:L,response:M,payload:N});
        var K = this.doBeforeLoadData(L, M, N);
        if (K && M && !M.error && C.isArray(M.results)) {
            this.addRows(M.results);
            this._handleDataReturnPayload(L, M, this._mergeResponseMeta(N, M.meta));
            var J = this.get("paginator");
            if (J && J instanceof B && J.get("totalRecords") < this._oRecordSet.getLength()) {
                J.set("totalRecords", this._oRecordSet.getLength());
            }
        } else {
            if (K && M.error) {
                this.showTableMessage(G.MSG_ERROR, G.CLASS_ERROR);
            }
        }
    },onDataReturnInsertRows:function(L, M, O) {
        this.fireEvent("dataReturnEvent", {request:L,response:M,payload:O});
        var K = this.doBeforeLoadData(L, M, O);
        if (K && M && !M.error && C.isArray(M.results)) {
            var N = this._mergeResponseMeta({recordInsertIndex:(O ? O.insertIndex || 0 : 0)}, O, M.meta);
            this.addRows(M.results, N.insertIndex);
            this._handleDataReturnPayload(L, M, N);
            var J = this.get("paginator");
            if (J && J instanceof B && J.get("totalRecords") < this._oRecordSet.getLength()) {
                J.set("totalRecords", this._oRecordSet.getLength());
            }
        } else {
            if (K && M.error) {
                this.showTableMessage(G.MSG_ERROR, G.CLASS_ERROR);
            }
        }
    },onDataReturnSetRows:function(M, L, O) {
        this.fireEvent("dataReturnEvent", {request:M,response:L,payload:O});
        var K = this.doBeforeLoadData(M, L, O);
        if (K && L && !L.error && C.isArray(L.results)) {
            var J = this.get("paginator");
            if (!(J instanceof B)) {
                J = null;
            }
            var N = this._mergeResponseMeta({recordStartIndex:O ? O.startIndex : null}, O, L.meta);
            if (!C.isNumber(N.recordStartIndex)) {
                N.recordStartIndex = J && N.pagination ? N.pagination.recordOffset || 0 : 0;
            }
            this._oRecordSet.setRecords(L.results, N.recordStartIndex);
            this._handleDataReturnPayload(M, L, N);
            if (J && J.get("totalRecords") < this._oRecordSet.getLength()) {
                J.set("totalRecords", this._oRecordSet.getLength());
            }
            this.render();
        } else {
            if (K && L.error) {
                this.showTableMessage(G.MSG_ERROR, G.CLASS_ERROR);
            }
        }
    },_mergeResponseMeta:function() {
        var O = {},K = arguments,N = 0,J = K.length,L,P;
        for (; N < J; ++N) {
            P = K[N];
            if (C.isObject(P)) {
                for (L in P) {
                    if (C.hasOwnProperty(P, L)) {
                        if (L.indexOf("pagination") === 0 && L.charAt(10)) {
                            if (!O.pagination) {
                                O.pagination = {};
                            }
                            O.pagination[L.substr(10, 1).toLowerCase() + L.substr(11)] = P[L];
                        } else {
                            if (/^sort(Key|Dir)/.test(L)) {
                                if (!O.sorting) {
                                    var M = this.get("sortedBy");
                                    O.sorting = M ? {key:M.key} : {};
                                }
                                O.sorting[RegExp.$1.toLowerCase()] = P[L];
                            } else {
                                O[L] = P[L];
                            }
                        }
                    }
                }
            }
        }
        return O;
    },_handleDataReturnPayload:function(L, K, M) {
        if (M) {
            var J = this.get("paginator");
            if (J instanceof B) {
                if (!C.isUndefined(M.totalRecords)) {
                    J.set("totalRecords", parseInt(M.totalRecords, 10) | 0);
                }
                if (C.isObject(M.pagination)) {
                    J.set("rowsPerPage", M.pagination.rowsPerPage);
                    J.set("recordOffset", M.pagination.recordOffset);
                }
            }
            if (M.sorting) {
                this.set("sortedBy", M.sorting);
            }
        }
    },getBody:function() {
        return this.getTbodyEl();
    },getCell:function(J) {
        return this.getTdEl(J);
    },getRow:function(J) {
        return this.getTrEl(J);
    },refreshView:function() {
        this.render();
    },select:function(K) {
        if (!C.isArray(K)) {
            K = [K];
        }
        for (var J = 0; J < K.length; J++) {
            this.selectRow(K[J]);
        }
    },updatePaginator:function(K) {
        var M = this.get("paginator");
        var J = M.currentPage;
        for (var L in K) {
            if (C.hasOwnProperty(M, L)) {
                M[L] = K[L];
            }
        }
        M.totalRecords = this._oRecordSet.getLength();
        M.rowsThisPage = Math.min(M.rowsPerPage, M.totalRecords);
        M.totalPages = Math.ceil(M.totalRecords / M.rowsThisPage);
        if (isNaN(M.totalPages)) {
            M.totalPages = 0;
        }
        if (M.currentPage > M.totalPages) {
            if (M.totalPages < 1) {
                M.currentPage = 1;
            } else {
                M.currentPage = M.totalPages;
            }
        }
        if (M.currentPage !== J) {
            M.startRecordIndex = (M.currentPage - 1) * M.rowsPerPage;
        }
        this.set("paginator", M);
        return this.get("paginator");
    },showPage:function(K) {
        var J = this.get("paginator");
        if (!C.isNumber(K) || (K < 1)) {
            if (J instanceof B) {
                if (!J.hasPage(K)) {
                    K = 1;
                }
            } else {
                if (K > J.totalPages) {
                    K = 1;
                }
            }
        }
        if (J instanceof B) {
            J.setPage(K);
        } else {
            this.updatePaginator({currentPage:K});
            this.render();
        }
    },formatPaginators:function() {
        var K = this.get("paginator");
        if (K instanceof B) {
            K.update();
            return;
        }
        var J;
        var L = false;
        if (K.pageLinks > -1) {
            for (J = 0; J < K.links.length; J++) {
                this.formatPaginatorLinks(K.links[J], K.currentPage, K.pageLinksStart, K.pageLinks, K.totalPages);
            }
        }
        for (J = 0; J < K.dropdowns.length; J++) {
            if (K.dropdownOptions) {
                L = true;
                this.formatPaginatorDropdown(K.dropdowns[J], K.dropdownOptions);
            } else {
                K.dropdowns[J].style.display = "none";
            }
        }
        if (L && A.opera) {
            document.body.style += "";
        }
    },formatPaginatorDropdown:function(O, N) {
        if (O && (O.ownerDocument == document)) {
            while (O.firstChild) {
                O.removeChild(O.firstChild);
            }
            for (var L = 0; L < N.length; L++) {
                var P = N[L];
                var J = document.createElement("option");
                J.value = (C.isValue(P.value)) ? P.value : P;
                J.innerHTML = (C.isValue(P.text)) ? P.text : P;
                J = O.appendChild(J);
            }
            var K = O.options;
            if (K.length) {
                for (var M = K.length - 1; M > -1; M--) {
                    if ((this.get("paginator").rowsPerPage + "") === K[M].value) {
                        K[M].selected = true;
                    }
                }
            }
            O.style.display = "";
            return;
        }
    },formatPaginatorLinks:function(N, J, W, M, T) {
        if (N && (N.ownerDocument == document) && C.isNumber(J) && C.isNumber(W) && C.isNumber(T)) {
            var P = (J == 1) ? true : false;
            var K = (J == T) ? true : false;
            var R = (P) ? ' <span class="' + G.CLASS_DISABLED + " " + G.CLASS_FIRST + '">&lt;&lt;</span> ' : ' <a href="#" class="' + G.CLASS_FIRST + '">&lt;&lt;</a> ';
            var U = (P) ? ' <span class="' + G.CLASS_DISABLED + " " + G.CLASS_PREVIOUS + '">&lt;</span> ' : ' <a href="#" class="' + G.CLASS_PREVIOUS + '">&lt;</a> ';
            var X = (K) ? ' <span class="' + G.CLASS_DISABLED + " " + G.CLASS_NEXT + '">&gt;</span> ' : ' <a href="#" class="' + G.CLASS_NEXT + '">&gt;</a> ';
            var L = (K) ? ' <span class="' + G.CLASS_DISABLED + " " + G.CLASS_LAST + '">&gt;&gt;</span> ' : ' <a href="#" class="' + G.CLASS_LAST + '">&gt;&gt;</a> ';
            var Q = R + U;
            var Y = T;
            var S = 1;
            var V = T;
            if (M > 0) {
                Y = (W + M < T) ? W + M - 1 : T;
                S = (J - Math.floor(Y / 2) > 0) ? J - Math.floor(Y / 2) : 1;
                V = (J + Math.floor(Y / 2) <= T) ? J + Math.floor(Y / 2) : T;
                if (S === 1) {
                    V = Y;
                } else {
                    if (V === T) {
                        S = T - Y + 1;
                    }
                }
                if (V - S === Y) {
                    V--;
                }
            }
            for (var O = S; O <= V; O++) {
                if (O != J) {
                    Q += ' <a href="#" class="' + G.CLASS_PAGE + '">' + O + "</a> ";
                } else {
                    Q += ' <span class="' + G.CLASS_SELECTED + '">' + O + "</span>";
                }
            }
            Q += X + L;
            N.innerHTML = Q;
            return;
        }
    },_onPaginatorLinkClick:function(L, K) {
        var M = I.getTarget(L);
        var J = M.nodeName.toLowerCase();
        if (K._oCellEditor && K._oCellEditor.isActive) {
            K.fireEvent("editorBlurEvent", {editor:K._oCellEditor});
        }
        while (M && (J != "table")) {
            switch (J) {case"body":return;case"a":I.stopEvent(L);switch (M.className) {case G.CLASS_PAGE:K.showPage(parseInt(M.innerHTML, 10));return;case G.CLASS_FIRST:K.showPage(1);return;case G.CLASS_LAST:K.showPage(K.get("paginator").totalPages);
                return;case G.CLASS_PREVIOUS:K.showPage(K.get("paginator").currentPage - 1);return;case G.CLASS_NEXT:K.showPage(K.get("paginator").currentPage + 1);return;}break;default:return;}
            M = M.parentNode;
            if (M) {
                J = M.nodeName.toLowerCase();
            } else {
                return;
            }
        }
    },_onPaginatorDropdownChange:function(N, K) {
        var O = I.getTarget(N);
        var M = O[O.selectedIndex].value;
        var J = C.isValue(parseInt(M, 10)) ? parseInt(M, 10) : null;
        if (J !== null) {
            var L = (K.get("paginator").currentPage - 1) * J;
            K.updatePaginator({rowsPerPage:J,startRecordIndex:L});
            K.render();
        } else {
        }
    },onEventEditCell:function(J) {
        this.onEventShowCellEditor(J);
    },onDataReturnReplaceRows:function(J, K) {
        this.onDataReturnInitializeTable(J, K);
    }});
    G.prototype.onDataReturnSetRecords = G.prototype.onDataReturnSetRows;
})();
YAHOO.register("datatable", YAHOO.widget.DataTable, {version:"2.5.2",build:"1076"});