www.gusucode.com > 一款小巧的ajax框架:Rialto框架源码程序 > 一款小巧的ajax框架:Rialto框架/rialtoEngine/rialtoEngine/javascript/rialto.js

    /* ************************************************************************************************
Copyright (c) 2005-2006, IGR
All Rights Reserved.
Licensed under the Apache License version 2.0 or above.
For more information on licensing, see:
http://www.apache.org/licenses/ 
Objet type Single file Rialto.js
VERSION:1.0
DATE:24/07/2008
************************************************************************************************/

var rialto = {skin:{}, utils:{event:{}}, widget:{}, widgetBehavior:{}, lang:{}, io:{}};
var ria = rialto;
if (document.location.protocol == "file:") {
    rialtoConfig.isFilePath = true;
    rialtoConfig.pathRialtoE = rialtoConfig.localPath;
} else {
    if (document.location.protocol == "http:" || document.location.protocol == "https:") {
        rialtoConfig.isFilePath = false;
        rialtoConfig.pathRialtoE = rialtoConfig.serverPath;
    }
}
rialtoConfig.pathName = document.location.pathname;
rialto.deprecated = function (objectName, oldMethod, newMethod) {
    console.log(objectName + "." + oldMethod + " deprecated; use " + objectName + "." + newMethod);
};
traceExec = function (mssg, trace) {
    if (trace == rialto.config.traceLevel) {
        console.log("Message from traceExec (level " + trace + ") :" + mssg);
    }
};
rialto.config = rialtoConfig;
rialto.config.userAgentIsFirefox = navigator.userAgent.indexOf("Firefox") != -1;
rialto.config.userAgentIsIE = navigator.userAgent.indexOf("MSIE") != -1;
rialtoConfig.userAgentIsGecko = (navigator.userAgent.indexOf("Gecko") != -1);
rialto.config.buildImageURL = function (imageName) {
    return rialto.config.pathRialtoE + imageName;
};
loadLayout = function (lName, vJS) {
    rialto.deprecated("", "loadLayout", "rialto.loadObject");
    rialto.loadObject(lName, vJS);
};
rialto.loadObject = function (lName, vJS, url) {
    if (url) {
        var ajaxReq = new rialto.io.AjaxRequest({url:url, method:"post", withWaitWindow:false, onSuccess:rialto.callBackOnloadObject, onFailure:null});
        ajaxReq.load("name=" + lName);
    } else {
        var objLayout;
        if (lName) {
            objLayout = eval("new " + lName + "();");
        }
        if (vJS) {
            vJS = objLayout;
        } else {
            return objLayout;
        }
    }
};
rialto.callBackOnloadObject = function (request) {
    var resp = request.responseText;
    var ind = resp.indexOf("<script>");
    if (ind != -1) {
        resp = resp.substr(ind + 8);
        resp = resp.substr(0, resp.indexOf("</script>"));
    }
    eval(resp);
    var ind = resp.indexOf("=function()");
    var name = resp.substr(0, ind);
    loadLayout(name);
};
rialto._onload = function () {
    if (rialto.loaded) {
        return;
    }
    rialto.loaded = true;
    rialto.session.oParameters = rialto.url.getObjectParameter();
    rialto.skin.initSkin();
    initDebug();
    if (rialto.config.isDebug) {
        console.info("CONSOLE READY FOR DEBUG");
    }
    rialto._boot();
    rialto.onload();
};
rialto._onresize = function () {
    document.body.over = document.body.style.overflow;
    document.body.style.overflow = "hidden";
    rialto.clientWidth = document.body.clientWidth;
    rialto.clientHeight = document.body.clientHeight;
    document.body.resize = true;
    document.body.resizeChilds();
    document.body.resize = false;
    document.body.style.overflow = document.body.over;
};
rialto._onunload = function () {
    rialto.session.removeAll();
};
rialto._beforeunload = function () {
    var mssg = rialto.onunload();
    if (mssg != "") {
        return mssg;
    }
};
rialto.onload = function () {
};
rialto.onunload = function () {
    return "";
};
rialto._boot = function () {
    rialto.I18N.setLanguage(rialto.config.language);
    rialto.clientWidth = document.body.offsetWidth;
    rialto.clientHeight = document.body.offsetHeight;
    document.onclick = function () {
        if (objMenuCont.prototype.menuActif) {
            objMenuCont.prototype.menuActif.masqueMenu();
        }
    };
    document.oncontextmenu = function () {
        if (objMenuCont.prototype.menuActif) {
            objMenuCont.prototype.menuActif.masqueMenu();
        }
        return false;
    };
    document.body.arrChild = new Array();
    document.body.oRia = document.body;
    document.body.id = "body";
    document.body.isContainer = true;
    document.body.record = rialto.widget.AbstractContainer.prototype.record;
    document.body.getHtmlCont = function () {
        return this;
    };
    document.body.removeAllChild = rialto.widget.AbstractContainer.prototype.removeAllChild;
    document.body.updateToContent = function () {
    };
    document.body.resizeChilds = rialto.widget.AbstractContainer.prototype.resizeChilds;
    document.body.removeBody = function () {
        this.oRia = null;
        this.onselectstart = null;
        this.onclick = null;
        this.oncontextmenu = null;
        this.record = null;
        this.removeAllChild = null;
        this.updateToContent = null;
        this.resizeChilds = null;
        rialto.session.objects["body"] = null;
    };
    rialto.session.reccord(document.body, "body");
};


rialto.session = {objects:{}, reccord:function (obj, id) {
    this.objects[id] = obj;
}, remove:function (id) {
    var obj = this.objects[id];
    if (obj) {
        this.objects[id] = null;
    }
    this.cleanObj(obj);
}, removeAll:function () {
    for (var obj in this.objects) {
        if (this.objects[obj] && this.objects[obj].remove) {
            try {
                this.objects[obj].remove();
            }
            catch (e) {
            }
        }
    }
    document.body.removeBody();
    if (document.removeEventListener) {
        document.removeEventListener("mousemove", rialto.widgetBehavior.DragAndDropMouseMoveHandler, false);
        document.removeEventListener("mouseup", rialto.widgetBehavior.DragAndDropMouseUpHandler, false);
        document.removeEventListener("mousedown", rialto.widgetBehavior.StopSelectDef, false);
        document.removeEventListener("mousedown", rialto.widgetBehavior.DragAndDropMouseDownHandler, false);
    }
    window.onbeforeunload = null;
    ria.utils.event.unregisterAllEvents();
    _rum = null;
    _r = null;
    _ru = null;
    _riu = null;
    _ria = null;
    ria = null;
    child = null;
    newPos = null;
    rialtoConfig = null;
    _DDMgr = null;
    rialto = null;
}, getComponentById:function (id) {
    return this.objects[id];
}, getComponentByName:function (name) {
    for (var obj in this.objects) {
        if (this.objects[obj] && this.objects[obj].name == name) {
            return this.objects[obj];
        }
    }
    return null;
}, getComponentByType:function (type) {
    var arr = new Array;
    for (var obj in this.objects) {
        if (this.objects[obj] && this.objects[obj].type == type) {
            arr.push(this.objects[obj]);
        }
    }
    return arr;
}, _hideGrid:function (obj) {
    if (rialtoConfig.userAgentIsGecko && !this.arrGrid) {
        this.objOnGrid = obj;
        this.arrGrid = this.getComponentByType("grid");
        for (var i = 0; i < this.arrGrid.length; i++) {
            if (this.arrGrid[i].visible) {
                this.arrGrid[i].artificialHide = true;
            }
        }
    }
}, _showGrid:function (obj) {
    if (rialtoConfig.userAgentIsGecko && obj == this.objOnGrid) {
        for (var i = 0; i < this.arrGrid.length; i++) {
            if (this.arrGrid[i].artificialHide) {
                this.arrGrid[i].artificialHide = false;
            }
        }
        this.objOnGrid = null;
        this.arrGrid = null;
    }
}, cleanDiv:function (obj, bInclude) {
    var arrDiv = obj.getElementsByTagName("DIV");
    for (var i = 0; i < arrDiv.length; i++) {
        this.cleanOneDiv(arrDiv[i]);
    }
    var arrImg = obj.getElementsByTagName("IMG");
    for (var i = 0; i < arrImg.length; i++) {
        this.cleanDiv(arrImg[i]);
    }
    if (bInclude) {
        this.cleanOneDiv(obj);
    }
}, cleanOneDiv:function (oHtml) {
    for (var prop in oHtml) {
        if (typeof oHtml[prop] == "object" || typeof oHtml[prop] == "function") {
            try {
                oHtml[prop] = null;
            }
            catch (e) {
                console.error("try to set " + prop + " to null:" + e.message);
            }
        }
    }
}, cleanObj:function (obj) {
    for (var prop in obj) {
        try {
            obj[prop] = null;
            delete (obj[prop]);
        }
        catch (e) {
            console.error(e.message);
        }
    }
}, oParameters:{}};
rialto.session.record = rialto.session.reccord;


rialto.I18N = {rialtoLanguage:rialto.config.language, lanInvalidCode:{en:"Invalid code", fr:"Code inexistant", de:"ung?ltiger Code"}, lanCloseWindow:{en:"Close the window", fr:"Fermer la fen?tre", de:"Fenster schliessen"}, lanCloseTab:{en:"Close actual tab", fr:"Fermer l'onglet courant", de:"Aktuellen Reiter schliessen"}, lanCloseFrame:{en:"Close the frame", fr:"Fermer le cadre", de:"Schliessen"}, lanOpenFrame:{en:"Open the frame", fr:"Ouvrir le cadre", de:"?ffnen"}, lanCalendarMonths:{en:new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"), fr:new Array("Janvier", "Fevrier", "Mars", "Avril ", "Mai", "Juin", "Juillet", "Ao?t", "Septembre", "Octobre", "Novembre", "D?cembre"), de:new Array("Januar", "Februar", "M?rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember")}, lanCalendarDays:{en:new Array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"), fr:new Array("Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"), de:new Array("Mo", "Di", "Mi", "Do", "Fr", "Sa", "So")}, lanCalendarShortMonths:{en:new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"), fr:new Array("Janv", "Fev", "Mar", "Avr", "Mai", "Jui", "Jui", "Aou", "Sep", "Oct", "Nov", "D?c"), de:new Array("Jan", "Feb", "M?r", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez")}, lanCalendarLongDays:{en:new Array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"), fr:new Array("Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche")}, lanCalenderButton:{en:"Open calendar", fr:"Afficher le calendrier", de:"Kalender ?ffnen"}, lanPreviousYear:{en:"previous Year", fr:"ann?e precedente", de:"Voriges Jahr"}, lanPreviousMonth:{en:"previous Month", fr:"mois precedent", de:"Vorige Monat"}, lanNextYear:{en:"Next Year", fr:"ann?e suivante", de:"N?chstes Jahr"}, lanNextMonth:{en:"Next Month", fr:"mois prochain", de:"N?chstes Monat"}, lanFindButton:{en:"Find", fr:"Rechercher", de:"Finden"}, lanHelpButton:{en:"Help", fr:"Aide", de:"Hilfe"}, lanCodeHeader:{en:"Code", fr:"Code", de:"Code"}, lanLabelHeader:{en:"Label", fr:"Libell?", de:"Bezeichnung"}, lanPrintTableHeadline:{en:"TABLE OF RESULTS", fr:"TABLEAU DE RESULTAT", de:"ERGEBNISTABELLE"}, lanGridSwitchButton:{en:"Change view", fr:"Changer le type d'affichage", de:"Ansicht wechseln"}, lanGridButtonFirst:{en:" First", fr:" Premier", de:" Zum Anfang"}, lanGridButtonPrevious:{en:" Previous", fr:" Pr?c?dent", de:" Vorherige"}, lanGridButtonNext:{en:" Next", fr:" Suivant", de:" Weitere"}, lanGridButtonLast:{en:" Last", fr:" Dernier", de:" Zum Ende"}, lanWaitWindowDefaultText:{en:"WAIT PLEASE", fr:"VEUILLEZ PATIENTER", de:"BITTE WARTEN"}, lanCancelButton:{en:"CANCEL", fr:"ANNULER", de:"ABBRUCH"}, lanCloseButtonText:{en:"Close", fr:"Fermer", de:"Schliessen"}, lanSelectButtonText:{en:"Select", fr:"Selectionner", de:""}, lanPrintButtonText:{en:"Print", fr:"Imprimmer", de:"Druck"}, lanOpenButtonText:{en:"Open", fr:"Ouvrir", de:"?ffnen"}, lanBrookenImageAlert:{en:"ERROR WHILE LOADING FOLLOWING IMAGE:", fr:"Une erreur est survenue au chargement de l'image", de:"Fehler beim Laden des folgenden Bildes:"}, lanAnotherTab:{en:"choose another tab", fr:"choisissez un autre onglet", de:""}, lanCodeFind:{en:"code/label wanted", fr:"code/label d?sir?", de:"Code/Bezeichnung"}, lanNoCodeFind:{en:"No code match", fr:"Aucun code ne correspond", de:""}, addKey:function (key, objLanguage) {
    this[key] = objLanguage;
}, getLabel:function (key) {
    if (this[key][this.rialtoLanguage]) {
        return this[key][this.rialtoLanguage];
    } else {
        return this[key]["en"];
    }
}, setLanguage:function (lang) {
    this.rialtoLanguage = lang;
}};


rialto.array = {copy:function (arr) {
    var copArr = new Array;
    copArr = (copArr.concat(arr));
    return copArr;
}, add:function (arr, obj) {
    if (rialto.array.indexOf(arr, obj) == -1) {
        arr.push(obj);
    }
}, remove:function (arr, obj) {
    if (arr) {
        if (arr.length > 0 && arr[arr.length - 1] == obj) {
            arr.pop();
        } else {
            var pos = rialto.array.indexOf(arr, obj);
            if (pos != -1) {
                arr.splice(pos, 1)[0];
            }
        }
        return arr.length;
    }
}, indexOf:function (arr, obj) {
    var i = 0;
    for (i = 0; i < arr.length; i++) {
        if (arr[i] == obj) {
            return i;
        }
    }
    return -1;
}, insert:function (arr, ind, obj) {
    arr.splice(ind, 0, obj);
}, sort:function (arr, col) {
    arr.sort(function (a, b) {
        return (a < b) ? -1 : 1;
    });
}, arrayToString:function (arr) {
    var str = "[";
    for (var i = 0; i < arr.length; i++) {
        var item = arr[i];
        if (rialto.lang.isArray(item)) {
            str += this.arrayToString(item) + ",";
        } else {
            if (item == "true" || item == "false" || rialto.lang.isNumber(item)) {
                str += item + ",";
            } else {
                str += "'" + rialto.string.replace(item, "'", "\\'") + "',";
            }
        }
    }
    if (str != "[") {
        str = str.substr(0, str.length - 1);
    }
    str += "]";
    return str;
}};


rialto.date = {_longmonth:rialto.I18N.getLabel("lanCalendarMonths"), _shortMonth:rialto.I18N.getLabel("lanCalendarShortMonths"), today:function () {
    return new Date();
}, getWeekNumber:function (date) {
    var jour = date.getDate();
    var mois = date.getMonth() + 1;
    var annee = date.getFullYear();
    var a = Math.floor((14 - (mois)) / 12);
    var y = annee + 4800 - a;
    var m = (mois) + (12 * a) - 3;
    var jd = jour + Math.floor(((153 * m) + 2) / 5) + (365 * y) + Math.floor(y / 4) - Math.floor(y / 100) + Math.floor(y / 400) - 32045;
    var d4 = (jd + 31741 - (jd % 7)) % 146097 % 36524 % 1461;
    var L = Math.floor(d4 / 1460);
    var d1 = ((d4 - L) % 365) + L;
    numSem = Math.floor(d1 / 7) + 1;
    return numSem;
}, getBornes:function (weekNumber) {
    var sem53 = false;
    var dateJour = this.today();
    var datePremJanv = new Date(dateJour.getFullYear(), 0, 1);
    var jourSem1 = datePremJanv.getDay() - 1;
    if (jourSem1 < 0) {
        jourSem1 = 6;
    }
    if (jourSem1 > 3) {
        sem53 = true;
        numSem += 1;
    }
    if (numSem == 1 && !sem53) {
        var date1 = datePremJanv;
        var date2 = new Date(datePremJanv.getFullYear(), 0, 1 + 6 - jourSem1);
    } else {
        if (numSem == 53 && sem53) {
            var date1 = new Date(datePremJanv.getFullYear() - 1, 11, 31 - jourSem1 + 1);
            var date2 = new Date(datePremJanv.getFullYear(), 0, 1 + 6 - jourSem1);
        } else {
            var jour = 1 + (numSem - 1) * 7;
            var date = new Date(dateJour.getFullYear(), 0, jour);
            var date1 = new Date(date.getFullYear(), date.getMonth(), date.getDate() - jourSem1);
            var date2 = new Date(date.getFullYear(), date.getMonth(), date.getDate() - jourSem1 + 6);
        }
    }
    return [date1, date2];
}, _parseFormat:function (format) {
    if (!format) {
        format = rialto.config.datePattern;
    }
    ob = {yyyy:-1, yy:-1, MMMM:-1, MMM:-1, MM:-1, dd:-1};
    ob.yyyy = format.indexOf("yyyy");
    if (ob.yyyy == -1) {
        ob.yy = format.indexOf("yy");
    }
    ob.MMMM = format.indexOf("MMMM");
    if (ob.MMMM == -1) {
        ob.MMM = format.indexOf("MMM");
    }
    if (ob.MMMM == -1 && ob.MMM == -1) {
        ob.MM = format.indexOf("MM");
    }
    ob.dd = format.indexOf("dd");
    return ob;
}, parseDate:function (strDate, format) {
    if (!format) {
        format = rialto.config.datePattern;
    }
    var obf = this._parseFormat(format);
    var date = this.today();
    if (obf.yyyy != -1) {
        date.setYear(strDate.substr(obf.yyyy, 4));
    }
    if (obf.yy != -1) {
        date.setYear(strDate.substr(obf.yy, 2));
    }
    var m = null;
    if (obf.MMMM != -1) {
        var m = rialto.array.indexOf(this._shortMonth, strDate.substr(obf.MMMM, 3));
    } else {
        if (obf.MMM != -1) {
            var m = rialto.array.indexOf(this._shortMonth, strDate.substr(obf.MMM, 3));
        } else {
            if (obf.MM != -1) {
                var m = parseInt(strDate.substr(obf.MM, 2), 10) - 1;
            }
        }
    }
    if (m != null && rialto.lang.isNumber(m) && m >= 0 && m <= 11) {
        date.setMonth(m);
    }
    if (obf.dd != -1) {
        var d = parseInt(strDate.substr(obf.dd, 2), 10);
        if (rialto.lang.isNumber(d) && d >= 1 && d <= 31) {
            date.setDate(d);
        }
    }
    return date;
}, formatDate:function (date, format) {
    if (!format) {
        format = rialto.config.datePattern;
    }
    var obf = this._parseFormat(format);
    var strDate = format;
    if (obf.yyyy != -1) {
        strDate = rialto.string.replace(strDate, "yyyy", date.getFullYear());
    } else {
        if (obf.yy != -1) {
            var y = date.getFullYear() + "";
            y = y.substr(2, 2);
            strDate = rialto.string.replace(strDate, "yy", y);
        }
    }
    if (obf.MMMM != -1) {
        var m = date.getMonth(m);
        m = this._longmonth[m];
        strDate = rialto.string.replace(strDate, "MMMM", m);
    } else {
        if (obf.MMM != -1) {
            var m = date.getMonth(m);
            m = this._shortMonth[m];
            strDate = rialto.string.replace(strDate, "MMM", m);
        } else {
            if (obf.MM != -1) {
                var m = date.getMonth() + 1;
                if (m < 10) {
                    (m = "0" + m);
                }
                strDate = rialto.string.replace(strDate, "MM", m);
            }
        }
    }
    if (obf.dd != -1) {
        var d = date.getDate();
        if (d < 10) {
            (d = "0" + d);
        }
        strDate = rialto.string.replace(strDate, "dd", d);
    }
    return strDate;
}, getDDMMYYYY:function (date) {
    var jour = date.getDate();
    if (jour < 10) {
        (jour = "0" + jour);
    }
    var mois = date.getMonth() + 1;
    if (mois < 10) {
        (mois = "0" + mois);
    }
    var annee = date.getFullYear();
    return jour + "/" + mois + "/" + annee;
}, getYYYYMMDD:function (date) {
    var jour = date.getDate();
    if (jour < 10) {
        (jour = "0" + jour);
    }
    var mois = date.getMonth() + 1;
    if (mois < 10) {
        (mois = "0" + mois);
    }
    var annee = date.getFullYear();
    return annee + "" + mois + "" + jour;
}, getLibJour:function (date) {
    return rialto.I18N.getLabel("lanCalendarDays")[date.getDay()];
}, DDMMYYYYfromYYYYMMDD:function (wdate) {
    jour = wdate.substr(6, 2);
    mois = wdate.substr(4, 2);
    annee = wdate.substr(0, 4);
    if (jour.length == 1) {
        jour = "0" + jour;
    }
    if (mois.length == 1) {
        mois = "0" + mois;
    }
    return jour + "/" + mois + "/" + annee;
}, YYYYMMDDfromDDMMYYYY:function (wdate) {
    jour = wdate.substr(0, 2);
    mois = wdate.substr(3, 2);
    if (jour.length == 1) {
        jour = "0" + jour;
    }
    if (mois.length == 1) {
        mois = "0" + mois;
    }
    annee = wdate.substr(6, 4);
    return annee + "" + mois + "" + jour;
}, setDateFromYYYYMMDD:function (wdate) {
    jour = wdate.substr(6, 2);
    mois = wdate.substr(4, 2);
    annee = wdate.substr(0, 4);
    return new Date(annee, parseInt(mois, 10) - 1, jour);
}, equals:function (date1, date2) {
    return (this.getYYYYMMDD(date1) == this.getYYYYMMDD(date2));
}, isDate:function (sDate, format) {
    if (!format) {
        format = rialto.config.datePattern;
    }
    var date = this.today();
    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();
    var st;
    var obf = this._parseFormat(format);
    if (obf.MM != -1) {
        st = sDate.substr(obf.MM, 2);
        if (st.length != 2) {
            return false;
        }
        var m = parseInt(st, 10) - 1;
    }
    if (obf.dd != -1) {
        st = sDate.substr(obf.dd, 2);
        if (st.length != 2) {
            return false;
        }
        var d = parseInt(st, 10);
    }
    if (obf.yyyy != -1) {
        st = sDate.substr(obf.yyyy, 4);
        if (st.length != 4) {
            return false;
        }
    }
    var feb = 28;
    if (this.isBissextile(y)) {
        feb = 29;
    }
    var nbJours = new Array(31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    return (m >= 0 && m <= 11 && d >= 1 && d <= nbJours[m]);
}, isBissextile:function (an) {
    return (((an % 4 == 0) && (an % 100 != 0 || an % 400 == 0)) ? true : false);
}, add:function (field, date, delta) {
    var newDate = null;
    switch (field) {
      case "year":
        newDate = new Date(parseInt(date.getFullYear()) + 1, date.getMonth(), date.getDate());
        break;
      case "month":
        newDate = new Date(date.getFullYear(), date.getMonth() + delta, date.getDate());
        break;
      case "day":
        newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate() + delta);
        break;
    }
    return newDate;
}};


rialto.Dom = {isInDomTree:function (node) {
    while (node) {
        if (node == document.body) {
            return true;
        }
        node = node.parentNode;
    }
    return false;
}, isDescendantOf:function (nd1, nd2, orSelf) {
    if (orSelf && (nd1 == nd2)) {
        return true;
    }
    var n1 = nd1, n2 = nd2;
    n1 = n1.parentNode;
    while (n1) {
        if (n1 == n2) {
            return true;
        }
        n1 = n1.parentNode;
    }
    return false;
}, isCoveredBy:function (nd1, nd2) {
    var n1 = nd1, n2 = nd2;
    if (n1.parentNode == n2.parentNode) {
        var styleN1 = _rum.$getStyle(n1, "z-index");
        var styleN2 = _rum.$getStyle(n2, "z-index");
        if (styleN1 && styleN2) {
            return (styleN1 > styleN2);
        } else {
            if (styleN1) {
                return true;
            } else {
                if (styleN2) {
                    return false;
                } else {
                    n1 = n1.nextSibling;
                    while (n1) {
                        if (n1 == n2) {
                            return true;
                        }
                        n1 = n1.nextSibling;
                    }
                    return false;
                }
            }
        }
    } else {
        var childN1AscList = {};
        var n1p = n1.parentNode;
        var pn1p = n1;
        while (n1p) {
            if (!n1p.id) {
                n1p.id = "domElt_" + rialto.Dom.nbInstances++;
            }
            childN1AscList[n1p.id] = pn1p;
            pn1p = n1p;
            n1p = n1p.parentNode;
        }
        var pn2p = n2p;
        var n2p = n2.parentNode;
        while (n2p) {
            if (n2p.id && childN1AscList[n2p.id]) {
                var siblAscN1 = childN1AscList[n2p.id].nextSibling;
                while (siblAscN1) {
                    if (siblAscN1 == pn2p) {
                        return true;
                    }
                    siblAscN1 = siblAscN1.nextSibling;
                }
                return false;
            } else {
                pn2p = n2p;
                n2p = n2p.parentNode;
            }
        }
    }
}};
rialto.Dom.nbInstances = 0;


rialto.lang = {link:function (obj, method) {
    return function () {
        return method.apply(obj, arguments);
    };
}, addMethods:function (proto, methodList) {
    for (var m in methodList) {
        proto[m] = methodList[m];
    }
    return proto;
}, extendObject:function (proto, methodList) {
    this.addMethods(proto.prototype, methodList);
}, extend:function (proto, methodList) {
    this.extendObject(proto, methodList);
}, isFunction:function (ob) {
    return (ob instanceof Function || typeof ob == "function");
}, isString:function (ob, bNotEmpty) {
    if (bNotEmpty) {
        return ((ob instanceof String || typeof ob == "string") && ob != "");
    } else {
        return (ob instanceof String || typeof ob == "string");
    }
}, isStringIn:function (ob, arr) {
    if (this.isString(ob)) {
        return rialto.array.indexOf(arr, ob) != -1;
    }
}, isArray:function (ob) {
    return (ob instanceof Array || typeof ob == "array");
}, isDate:function (ob) {
    return (ob instanceof Date);
}, isBoolean:function (ob) {
    return (ob instanceof Boolean || typeof ob == "boolean");
}, isNumber:function (ob) {
    var firstTest = (ob instanceof Number || typeof ob == "number");
    if (!firstTest) {
        var stI = "" + ob;
        if (stI.length == 0) {
            return false;
        }
        for (var i = 0; i < stI.length; i++) {
            var ch = stI.charAt(i);
            if ("0123456789.-%".indexOf(ch) == -1) {
                return false;
            }
        }
        return true;
    } else {
        return true;
    }
}};


rialto.string = {trim:function (str) {
    return str.replace(/^\s*(\b.*\b|)\s*$/, "$1");
}, replace:function (str, strFind, strRemp) {
    var tab = str.split(strFind);
    return tab.join(strRemp);
}, formatHTTP:function (str) {
    if (rialto.lang.isString(str)) {
        return escape(str);
    }
}};


rialto.widget.AbstractComponent = function (objPar) {
    this.bRiaComp = true;
    if (objPar != null) {
        this.type = "AbstractComponent";
        this.name = "rialto_" + this.type;
        this.dataname = "rialto_" + this.type;
        this.position = "absolute";
        this.top = 0;
        this.left = 0;
        this.width = "100%";
        this.height = "100%";
        this.visible = true;
        this.enable = true;
        this.enable = true;
        this.draggable = false;
        this.resizable = false;
        this.autoResizableH = false;
        this.autoResizableW = false;
        this.bWithoutRecordInSession = false;
        this.classname = "";
        this.arrEvent = new Array;
        if (objPar.id) {
            this.id = objPar.id;
        }
        if (objPar.bWithoutRecordInSession) {
            this.bWithoutRecordInSession = objPar.bWithoutRecordInSession;
        }
        if (objPar.type) {
            this.type = objPar.type;
            this.name = "rialto_" + this.type;
            this.dataname = "rialto_" + this.type;
        }
        if (objPar.name) {
            this.name = objPar.name;
            this.dataname = this.name;
        }
        if (objPar.dataname) {
            this.dataname = objPar.dataname;
        }
        if (objPar.classname) {
            this.classname = objPar.classname;
        }
        if (rialto.lang.isNumber(objPar.top)) {
            this.top = objPar.top;
        }
        if (rialto.lang.isNumber(objPar.left)) {
            this.left = objPar.left;
        }
        if (rialto.lang.isNumber(objPar.width)) {
            this.width = objPar.width;
        }
        if (rialto.lang.isNumber(objPar.height)) {
            this.height = objPar.height;
        }
        if (rialto.lang.isStringIn(objPar.position, ["static", "absolute", "relative"])) {
            this.position = objPar.position;
        }
        if (rialto.lang.isBoolean(objPar.enable)) {
            this.enable = objPar.enable;
        }
        if (rialto.lang.isBoolean(objPar.draggable)) {
            this.draggable = objPar.draggable;
        }
        if (rialto.lang.isBoolean(objPar.resizable)) {
            this.resizable = objPar.resizable;
        }
        if (rialto.lang.isBoolean(objPar.autoResizableH)) {
            this.autoResizableH = objPar.autoResizableH;
        }
        if (rialto.lang.isBoolean(objPar.autoResizableW)) {
            this.autoResizableW = objPar.autoResizableW;
        }
        if (rialto.lang.isString(objPar.classname)) {
            this.setStyleName(objPar.classname);
        }
        if (!this.id) {
            this.id = this.name + "_" + this.type + "_" + (rialto.widget.AbstractComponent.prototype.nbreInstance++);
        }
        if (!this.bWithoutRecordInSession) {
            rialto.session.reccord(this, this.id);
        }
        this.divExt = document.createElement("DIV");
        this.divExt.id = this.id + "_divExt";
        this.divExt.oRia = this;
    }
};
rialto.widget.AbstractComponent.prototype.nbreInstance = 0;
rialto.widget.AbstractComponent.prototype.getAjaxArea = function () {
    return this.divExt;
};
rialto.widget.AbstractComponent.prototype.getAjaxIndicator = function () {
    return this.ajaxi;
};
rialto.widget.AbstractComponent.prototype.setAjaxIndicator = function (path) {
    if (!this.ajaxi) {
        this.ajaxi = new rialto.widget.Image(path, 0, 0, this.getAjaxArea());
    } else {
        this.ajaxi.setImageReference(path);
    }
};
rialto.widget.AbstractComponent.prototype.startAjaxIndicator = function (top, left) {
    if (!this.ajaxi) {
        this.ajaxi = new rialto.widget.Image("default_ajax_i", top, left, this.getAjaxArea(), "", "", {bWithoutRecordInSession:true});
    } else {
        this.ajaxi.setTop(top);
        this.ajaxi.setLeft(left);
        this.ajaxi.setVisible(true);
    }
};
rialto.widget.AbstractComponent.prototype.stopAjaxIndicator = function () {
    if (this.ajaxi) {
        this.ajaxi.setVisible(false);
    }
};
rialto.widget.AbstractComponent.prototype.getId = function () {
    return this.id;
};
rialto.widget.AbstractComponent.prototype.setName = function (name) {
    this.name = name;
};
rialto.widget.AbstractComponent.prototype.setDataName = function (name) {
    this.dataname = name;
};
rialto.widget.AbstractComponent.prototype.getDataName = function () {
    return this.dataname;
};
rialto.widget.AbstractComponent.prototype.setFormatter = function (formatter) {
    this.formatter = formatter;
};
rialto.widget.AbstractComponent.prototype.getFormater = function () {
    return this.formater;
};
rialto.widget.AbstractComponent.prototype.getType = function () {
    return this.type;
};
rialto.widget.AbstractComponent.prototype.setProperty = function (key, value) {
    this[key] = value;
};
rialto.widget.AbstractComponent.prototype.getProperty = function (key) {
    return this[key];
};
rialto.widget.AbstractComponent.prototype.setVisible = function (visible) {
    var oHtml = this.getHtmlExt();
    if (visible) {
        oHtml.style.display = "block";
    } else {
        oHtml.style.display = "none";
    }
    this.visible = visible;
};
rialto.widget.AbstractComponent.prototype.isVisible = function () {
    return this.visible;
};
rialto.widget.AbstractComponent.prototype.setEnable = function (enable) {
    this.enable = enable;
};
rialto.widget.AbstractComponent.prototype.isEnable = function () {
    return this.enable;
};
rialto.widget.AbstractComponent.prototype.getHtmlExt = function () {
    return this.divExt;
};
rialto.widget.AbstractComponent.prototype.getHtmlImp = function () {
    return this.divExt;
};
rialto.widget.AbstractComponent.prototype.getHtmlDD = function () {
    return this.divExt;
};
rialto.widget.AbstractComponent.prototype.getHtmlRZ = function () {
    return this.divExt;
};
rialto.widget.AbstractComponent.prototype.setDraggable = function (draggable) {
    if (this.draggable == draggable) {
        return;
    }
    var oldState = this.draggable;
    this.draggable = draggable;
    var objDD = this.getHtmlDD();
    objDD.dragAndDrop = this.draggable;
    if (this.draggable) {
        this.initDD();
    } else {
        rialto.widgetBehavior.desaffect(this, "DragAndDrop");
    }
};
rialto.widget.AbstractComponent.prototype.setResizable = function (resizable) {
};
rialto.widget.AbstractComponent.prototype.isAttached = function () {
    return (this.rialtoParent != null);
};
rialto.widget.AbstractComponent.prototype.isAttachedInDomTree = function () {
    return rialto.Dom.isInDomTree(this.getHtmlExt());
};
rialto.widget.AbstractComponent.prototype.getRialtoParent = function () {
    return this.parent;
};
rialto.widget.AbstractComponent.prototype.getDOMParent = function () {
    return this.domParent;
};
rialto.widget.AbstractComponent.prototype.setFormParent = function (form) {
    if (form.addElement) {
        form.addElement(this);
    }
};
rialto.widget.AbstractComponent.prototype.placeIn = function (parent) {
    rialto.deprecated((this.name ? this.name : "AbstractComponent"), "placeIn", "attach()");
    this.attach(parent);
};
rialto.widget.AbstractComponent.prototype.attach = function (parent) {
    if (!parent || parent == this.rialtoParent) {
        return;
    }
    if (this.isAttached()) {
        this.detach();
    }
    if (parent.add) {
        parent.add(this, true);
    } else {
        parent.appendChild(this.getHtmlExt());
        this.addInRialtoContainer(parent);
    }
    this.afterAttach();
    this.onattach();
};
rialto.widget.AbstractComponent.prototype.detach = function () {
    if (this.rialtoParent && this.rialtoParent.erase) {
        this.rialtoParent.erase(this);
    }
    var oHtml = this.getHtmlExt();
    if (this.domParent) {
        this.domParent.removeChild(oHtml);
        this.domParent = null;
    } else {
        if (this.isAttachedInDomTree(oHtml)) {
            oHtml.parentNode.removeChild(oHtml);
        }
    }
    this.ondetach();
};
rialto.widget.AbstractComponent.prototype.addInRialtoContainer = function (objHTML) {
    if (this.bWithoutRecordInSession) {
        return;
    }
    if (!objHTML) {
        return;
    }
    if (objHTML.oRia) {
        if (objHTML.oRia.isContainer) {
            objHTML.oRia.record(this);
        } else {
            this.addInRialtoContainer(objHTML.parentNode);
        }
    } else {
        this.addInRialtoContainer(objHTML.parentNode);
    }
};
rialto.widget.AbstractComponent.prototype.afterAttach = function () {
    var oHtml = this.getHtmlExt();
    this.domParent = oHtml.parentNode;
    this.adaptToContext();
    if (!this.alreadyAttach) {
        this.initDD();
    }
    this.alreadyAttach = true;
};
rialto.widget.AbstractComponent.prototype.replaceInOriginalParent = function () {
    if (!rialto.session.objects) {
        rialto.session.objects = new Array;
    }
    var zInd = -1;
    if (rialto.session.objects["uicInTop"]) {
        var elt = rialto.session.objects["uicInTop"].uic;
        if (rialto.session.objects["uicInTop"].parent) {
            rialto.session.objects["uicInTop"].parent.appendChild(elt);
        }
        zInd = elt.style.zIndex = rialto.session.objects["uicInTop"].zIndex;
        rialto.session.objects["uicInTop"] = null;
    }
    return zInd;
};
rialto.widget.AbstractComponent.prototype.placeInTop = function () {
    var zInd = this.replaceInOriginalParent();
    if (!rialto.session.objects) {
        rialto.session.objects = new Array;
    }
    var elt = this.getHtmlExt();
    rialto.session.objects["uicInTop"] = {uic:(this.getHtmlExt() || this), parent:this.getDOMParent(), zIndex:elt.style.zIndex};
    elt.style.zIndex = Math.max(zInd, 1000002);
    window.document.body.appendChild(elt);
};
rialto.widget.AbstractComponent.prototype.remove = function (bFromContainer) {
    this.release();
    if (this.ajaxi) {
        this.ajaxi.remove();
    }
    this.removeAllEvent();
    this.detach();
    if (this.isDraggable()) {
        rialto.widgetBehavior.desaffect(this, "DragAndDrop");
    }
    this.onremove();
    this.divExt.oRia = null;
    rialto.session.remove(this.id);
};
rialto.widget.AbstractComponent.prototype.adaptToContext = function () {
};
rialto.widget.AbstractComponent.prototype.adaptAfterSizeChange = function () {
    this.adaptToContext();
};
rialto.widget.AbstractComponent.prototype.adaptAfterContainerChange = function () {
};
rialto.widget.AbstractComponent.prototype.release = function () {
};
rialto.widget.AbstractComponent.prototype.setStyleName = function (classname) {
    this.classname = classname;
};
rialto.widget.AbstractComponent.prototype.getStyleName = function () {
    return this.classname;
};
rialto.widget.AbstractComponent.prototype.getCssRuleName = function (ruleName) {
    return this.classname != "" ? ruleName + " " + this.classname + ruleName : ruleName;
};
rialto.widget.AbstractComponent.prototype.setStyle = function (obStyle) {
    var oHtml = this.getHtmlExt();
    for (prop in obStyle) {
        oHtml.style[prop] = obStyle[prop];
    }
};
rialto.widget.AbstractComponent.prototype.getStyle = function (obStyle) {
    var oHtml = this.getHtmlExt();
    try {
        if (rialto.lang.isString(obStyle)) {
            obStyle = getComputStyle(oHtml, obStyle);
        } else {
            for (prop in obStyle) {
                obStyle[prop] = getComputStyle(oHtml, prop);
            }
        }
    }
    catch (erreur) {
        console.error(e.message);
    }
    return obStyle;
};
rialto.widget.AbstractComponent.prototype.setWidth = function (width) {
    var oHtml = this.getHtmlExt();
    if ((width == null) && (this.width != null)) {
        oHtml.style.width = this.width;
    } else {
        if (typeof width != "undefined") {
            this.width = width;
            oHtml.style.width = this.width;
        }
    }
    if (this.updateWidth) {
        this.updateWidth();
    }
};
rialto.widget.AbstractComponent.prototype.getWidth = function () {
    return parseInt(this.width);
};
rialto.widget.AbstractComponent.prototype.getOffsetWidth = function () {
    return ria.utils.measures.$getWidth(this.getHtmlExt());
};
rialto.widget.AbstractComponent.prototype.modWidth = function (deltaWidth) {
    var oHtml = this.getHtmlExt();
    var newWidth = Math.max(0, parseInt(oHtml.style.width) + parseInt(deltaWidth));
    this.setWidth(newWidth);
    if (this.adaptAfterSizeChange) {
        this.adaptAfterSizeChange();
    }
};
rialto.widget.AbstractComponent.prototype.setHeight = function (height) {
    var oHtml = this.getHtmlExt();
    if ((height == null) && (this.height != null)) {
        oHtml.style.height = this.height;
    } else {
        if (typeof height != "undefined") {
            this.height = height;
            oHtml.style.height = this.height;
        }
    }
    if (this.updateHeight) {
        this.updateHeight();
    }
};
rialto.widget.AbstractComponent.prototype.getHeight = function () {
    return parseInt(this.height);
};
rialto.widget.AbstractComponent.prototype.getOffsetHeight = function () {
    return ria.utils.measures.$getHeight(this.getHtmlExt());
};
rialto.widget.AbstractComponent.prototype.modHeight = function (deltaHeight) {
    var oHtml = this.getHtmlExt();
    var newHeight = Math.max(0, parseInt(oHtml.style.height) + parseInt(deltaHeight));
    this.setHeight(newHeight);
    if (this.adaptAfterSizeChange) {
        this.adaptAfterSizeChange();
    }
};
rialto.widget.AbstractComponent.prototype.setSize = function (objSize) {
    try {
        this.setWidth(objSize.width);
        this.setHeight(objSize.height);
    }
    catch (e) {
    }
};
rialto.widget.AbstractComponent.prototype.getSize = function () {
    return {height:this.getHeight(), width:this.getWidth()};
};
rialto.widget.AbstractComponent.prototype.isAutoResizableW = function () {
    return this.autoResizableW;
};
rialto.widget.AbstractComponent.prototype.setAutoResizableW = function (autoSW) {
    this.autoResizableW = autoSW;
};
rialto.widget.AbstractComponent.prototype.isAutoResizableH = function () {
    return this.autoResizableH;
};
rialto.widget.AbstractComponent.prototype.setAutoResizableH = function (autoSH) {
    this.autoResizableH = autoSH;
};
rialto.widget.AbstractComponent.prototype.moveTo = function (top, left) {
    this.setTop(top);
    this.setLeft(left);
};
rialto.widget.AbstractComponent.prototype.moveBy = function (deltaTop, deltaLeft) {
    this.setTop(parseInt(this.top) + deltaTop);
    this.setLeft(parseInt(this.left) + deltaLeft);
};
rialto.widget.AbstractComponent.prototype.setLeft = function (left) {
    var oHtml = this.getHtmlExt();
    if ((left == null) && (this.left != null)) {
        oHtml.style.left = this.left;
    } else {
        if (typeof left != "undefined") {
            this.left = left;
            oHtml.style.left = this.left;
        }
    }
};
rialto.widget.AbstractComponent.prototype.setTop = function (top) {
    var oHtml = this.getHtmlExt();
    if ((top == null) && (this.top != null)) {
        oHtml.style.top = this.top;
    } else {
        if (typeof top != "undefined") {
            this.top = top;
            oHtml.style.top = this.top;
        }
    }
};
rialto.widget.AbstractComponent.prototype.setPosition = function (position) {
    this.position = position;
    var oHtml = this.getHtmlExt();
    oHtml.style.position = this.position;
};
rialto.widget.AbstractComponent.prototype.isDraggable = function () {
    return this.draggable;
};
rialto.widget.AbstractComponent.prototype.initDD = function () {
    if (this.isDraggable()) {
        var oHtml = this.getHtmlExt();
        var objDD = this.getHtmlDD();
        rialto.widgetBehavior.affect(this, "DragAndDrop", {oHtmlToMove:oHtml, oHtmlEvtTarget:objDD, isWithLimitsDisplayed:false});
        this.afterDD = function (deltop, delLeft) {
            this.moveBy(deltop, delLeft);
            this.ondrop(deltop, delLeft);
        };
    }
};
rialto.widget.AbstractComponent.prototype.ondrop = function (deltop, delLeft) {
};
rialto.widget.AbstractComponent.prototype.initRZ = function () {
};
rialto.widget.AbstractComponent.prototype.addEvent = function (oHtml, event, method) {
    var event = ria.utils.event.genericAddEvent(oHtml, event, method, this);
    this.arrEvent.push(event);
};
rialto.widget.AbstractComponent.prototype.removeAllEvent = function () {
    for (var i = 0; i < this.arrEvent.length; i++) {
        ria.utils.event.genericRemoveEvent(this.arrEvent[i]);
    }
    this.arrEvent = new Array;
};
rialto.widget.AbstractComponent.prototype.onclick = function (e) {
};
rialto.widget.AbstractComponent.prototype.ondblclick = function (e) {
};
rialto.widget.AbstractComponent.prototype.onmouseover = function (e) {
};
rialto.widget.AbstractComponent.prototype.onmouseout = function (e) {
};
rialto.widget.AbstractComponent.prototype.onblur = function (e) {
};
rialto.widget.AbstractComponent.prototype.onfocus = function (e) {
};
rialto.widget.AbstractComponent.prototype.onmousemove = function (e) {
};
rialto.widget.AbstractComponent.prototype.onmousedown = function (e) {
};
rialto.widget.AbstractComponent.prototype.onmouseup = function (e) {
};
rialto.widget.AbstractComponent.prototype.onattach = function (e) {
};
rialto.widget.AbstractComponent.prototype.ondetach = function (e) {
};
rialto.widget.AbstractComponent.prototype.onremove = function (e) {
};
rialto.widget.AbstractComponent.prototype.getNewParentHeight = function () {
    var obj = this.getHtmlExt();
    var heightCalc = ria.utils.measures.$getHeight(obj.parentNode, true);
    return heightCalc;
};
rialto.widget.AbstractComponent.prototype.getNewParentWidth = function () {
    var obj = this.getHtmlExt();
    var widthCalc = ria.utils.measures.$getWidth(obj.parentNode, true);
    return widthCalc;
};
rialto.widget.AbstractComponent.prototype.resizeFatherAndBrother = function () {
    if (this.rialtoParent.resizeContenu) {
        this.rialtoParent.resizeContenu();
    }
    for (var i = 0; i < this.rialtoParent.arrChild.length; i++) {
        if (this.rialtoParent.arrChild[i].autoResizableH) {
            this.rialtoParent.arrChild[i].updateHeight();
        }
    }
};


rialto.widget.AbstractContainer = function (objPar) {
    this.base = rialto.widget.AbstractComponent;
    this.base(objPar);
    this.arrChild = new Array;
    this.isContainer = true;
    if (this.height == "100%") {
        this.autoResizableH = true;
    }
    if (this.width == "100%") {
        this.autoResizableW = true;
    }
};
rialto.widget.AbstractContainer.prototype = new rialto.widget.AbstractComponent;
rialto.widget.AbstractContainer.prototype.add = function (elt, callByElt) {
    if (!elt) {
        return;
    }
    var comp, oHtml;
    if (elt.bRiaComp) {
        comp = elt;
        oHtml = elt.getHtmlExt();
    } else {
        if (elt.oRia) {
            comp = elt.oRia;
            oHtml = elt;
        } else {
            comp = oHtml = elt;
        }
    }
    this.getHtmlCont().appendChild(oHtml);
    this.record(comp);
    if (!callByElt && comp.afterAttach) {
        comp.afterAttach();
    }
};
rialto.widget.AbstractContainer.prototype.record = function (oRia) {
    this.arrChild.push(oRia);
    oRia.rialtoParent = this;
};
rialto.widget.AbstractContainer.prototype.erase = function (oRia) {
    rialto.array.remove(this.arrChild, oRia);
    oRia.rialtoParent = null;
};
rialto.widget.AbstractContainer.prototype.baseRemove = rialto.widget.AbstractComponent.prototype.remove;
rialto.widget.AbstractContainer.prototype.remove = function (bFromContainer) {
    if (this.removeAllChild) {
        this.removeAllChild();
    }
    this.baseRemove(bFromContainer);
};
rialto.widget.AbstractContainer.prototype.removeChild = function (child) {
    if (this.isChild(child)) {
        if (child.remove) {
            child.remove(true);
        } else {
            try {
                this.getHtmlCont().removeChild(child);
            }
            catch (e) {
            }
            this.erase(child);
        }
    }
};
rialto.widget.AbstractContainer.prototype.removeAllChild = function (child) {
    for (var i = this.arrChild.length - 1; i >= 0; i--) {
        this.removeChild(this.arrChild[i]);
    }
    this.arrChild = new Array;
    this.getHtmlCont().innerHTML = "";
};
rialto.widget.AbstractContainer.prototype.isChild = function (child) {
    return (rialto.array.indexOf(this.arrChild, child) != -1);
};
rialto.widget.AbstractContainer.prototype.hasChild = function () {
    return (this.arrChild.length > 0);
};
rialto.widget.AbstractContainer.prototype.getChilds = function () {
    return this.arrChild;
};
rialto.widget.AbstractContainer.prototype.getChildByName = function (name) {
    var arrC = new Array;
    for (var i = 0; i < this.arrChild.length; i++) {
        if (this.arrChild[i].name == name) {
            arrC.push(this.arrChild[i]);
        }
    }
    return arrC;
};
rialto.widget.AbstractContainer.prototype.getChildByID = function (id) {
    for (var i = 0; i < this.arrChild.length; i++) {
        if (this.arrChild[i].id == id) {
            return this.arrChild[i];
        }
    }
    return null;
};
rialto.widget.AbstractContainer.prototype.baseSetVisible = rialto.widget.AbstractComponent.prototype.setVisible;
rialto.widget.AbstractContainer.prototype.setVisible = function (visible) {
    this.baseSetVisible(visible);
    if (visible) {
        if (this.updateSize) {
            this.updateSize();
        }
        this.$$activeContent();
    }
};
rialto.widget.AbstractContainer.prototype.updateToContent = function () {
};
rialto.widget.AbstractContainer.prototype.$$activeContent = function () {
    if (!this.arrChild) {
        return;
    }
    for (var i = 0; i < this.arrChild.length; i++) {
        child = this.arrChild[i];
        if (this.arrChild[i].adaptAfterContainerChange) {
            this.arrChild[i].adaptAfterContainerChange();
        }
    }
};
rialto.widget.AbstractContainer.prototype.adaptAfterContainerChange = function () {
    this.$$activeContent();
};
rialto.widget.AbstractContainer.prototype.getHtmlCont = function () {
    return this.divExt;
};
rialto.widget.AbstractContainer.prototype.getContentHeight = function () {
    return ria.utils.measures.$getHeight(this.getHtmlCont(), true);
};
rialto.widget.AbstractContainer.prototype.getContentWidth = function () {
    return ria.utils.measures.$getWidth(this.getHtmlCont(), true);
};
rialto.widget.AbstractContainer.prototype.adaptToContext = function () {
    this.updateSize();
};
rialto.widget.AbstractContainer.prototype.updateSize = function () {
    if (this.visible) {
        var htmlExt = this.getHtmlExt();
        this.updateHeight();
        this.updateWidth();
        this.oldHeight = htmlExt.offsetHeight;
        this.oldWidth = htmlExt.offsetWidth;
    }
};
rialto.widget.AbstractContainer.prototype.old_updateWidth = function () {
    if (this.visible) {
        var htmlExt = this.getHtmlExt();
        var htmlCont = this.getHtmlCont();
        htmlExt.style.overflow = "hidden";
        htmlCont.style.overflow = "hidden";
        if (this.autoResizableW) {
            ria.utils.measures.$setWidthWithAllAvailable(this.divExt);
        } else {
            this.divExt.style.width = this.width;
        }
        ria.utils.measures.$setWidthWithAllAvailable(this.getHtmlCont());
        this.resizeChilds(true, false);
        htmlCont.style.overflow = "";
        htmlExt.style.overflow = "";
    }
};
rialto.widget.AbstractContainer.prototype.updateWidth = function () {
    if (this.visible) {
        var htmlExt = this.getHtmlExt();
        var htmlCont = this.getHtmlCont();
        var svg_overflow_ext = htmlExt.style.overflow;
        var svg_overflow_cont = htmlCont.style.overflow;
        var svg_widthCont = htmlCont.style.width;
        htmlExt.style.overflow = "hidden";
        htmlCont.style.overflow = "hidden";
        if (this.autoResizableW) {
            ria.utils.measures.$setWidthWithAllAvailable(htmlExt);
        } else {
            htmlExt.style.width = this.width;
        }
        if (htmlCont != htmlExt) {
            ria.utils.measures.$setWidthWithAllAvailable(htmlCont);
        }
        if (htmlCont.style.width != svg_widthCont) {
            this.resizeChilds(true, false);
        }
        htmlCont.style.overflow = svg_overflow_cont;
        htmlExt.style.overflow = svg_overflow_ext;
    }
};
rialto.widget.AbstractContainer.prototype.old_updateHeight = function () {
    if (this.visible) {
        var htmlExt = this.getHtmlExt();
        var htmlCont = this.getHtmlCont();
        htmlExt.style.overflow = "hidden";
        htmlCont.style.overflow = "hidden";
        if (this.autoResizableH) {
            ria.utils.measures.$setHeightWithAllAvailable(this.divExt);
        } else {
            this.divExt.style.height = this.height;
        }
        ria.utils.measures.$setHeightWithAllAvailable(this.getHtmlCont());
        this.resizeChilds(false, true);
        htmlCont.style.overflow = "";
        htmlExt.style.overflow = "";
    }
};
rialto.widget.AbstractContainer.prototype.updateHeight = function () {
    if (this.visible) {
        var htmlExt = this.getHtmlExt();
        var htmlCont = this.getHtmlCont();
        var svg_overflow_ext = htmlExt.style.overflow;
        var svg_overflow_cont = htmlCont.style.overflow;
        var svg_heightCont = htmlCont.style.height;
        htmlExt.style.overflow = "hidden";
        htmlCont.style.overflow = "hidden";
        if (this.autoResizableH) {
            ria.utils.measures.$setHeightWithAllAvailable(this.divExt);
        } else {
            this.divExt.style.height = this.height;
        }
        if (htmlCont != htmlExt) {
            ria.utils.measures.$setHeightWithAllAvailable(this.getHtmlCont());
        }
        if (htmlCont.style.height != svg_heightCont) {
            this.resizeChilds(false, true);
        }
        htmlCont.style.overflow = svg_overflow_cont;
        htmlExt.style.overflow = svg_overflow_ext;
    }
};
rialto.widget.AbstractContainer.prototype.resizeChilds = function (autoW, autoH, newSize) {
    for (var i = 0; i < this.arrChild.length; i++) {
        if (!autoW && !autoH) {
            if (this.arrChild[i].updateSize) {
                this.arrChild[i].updateSize();
            }
        } else {
            if (autoW && this.arrChild[i].updateWidth) {
                this.arrChild[i].updateWidth(newSize);
            }
            if (autoH && this.arrChild[i].updateHeight) {
                this.arrChild[i].updateHeight(newSize);
            }
        }
    }
};


rialto.widget.Text = function (name, top, left, width, datatype, parent, objPar) {
    if (!objPar) {
        var objPar = {};
    }
    objPar.name = name;
    objPar.type = "text";
    objPar.left = left;
    objPar.top = top;
    objPar.width = width;
    this.base = rialto.widget.AbstractComponent;
    this.base(objPar);
    if (rialto.lang.isStringIn(datatype, ["T", "P", "A", "N", "D", "H", "Hi", "F"])) {
        this.datatype = datatype;
    } else {
        this.datatype = "A";
    }
    if (this.datatype == "P") {
        this.inputType = "password";
    } else {
        if (this.datatype == "Hi") {
            this.inputType = "hidden";
        } else {
            if (this.datatype == "F") {
                this.inputType = "file";
            } else {
                this.inputType = "text";
            }
        }
    }
    this.autoUp = false;
    this.isRequired = false;
    this.disable = false;
    this.nbchar = 50;
    this.rows = 5;
    this.initValue = null;
    this.wvalue = "";
    this.accessKey = "";
    this.alt = null;
    this.tabIndex = rialto.widget.Form.prototype.tabIndex++;
    if (rialto.lang.isNumber(objPar.nbchar)) {
        this.nbchar = objPar.nbchar;
    }
    if (rialto.lang.isBoolean(objPar.autoUp)) {
        this.autoUp = objPar.autoUp;
    }
    if (rialto.lang.isBoolean(objPar.disable)) {
        this.disable = objPar.disable;
    }
    if (rialto.lang.isBoolean(objPar.isRequired)) {
        this.isRequired = objPar.isRequired;
    }
    if (rialto.lang.isNumber(objPar.rows)) {
        this.rows = objPar.rows;
    }
    if (rialto.lang.isString(objPar.initValue)) {
        this.initValue = objPar.initValue;
    }
    if (rialto.lang.isString(objPar.accessKey, true)) {
        this.accessKey = objPar.accessKey;
    }
    if (rialto.lang.isString(objPar.alt, true)) {
        this.alt = objPar.alt;
    }
    if (rialto.lang.isNumber(objPar.tabIndex)) {
        this.tabIndex = objPar.tabIndex;
    }
    objPar = null;
    var oThis = this;
    this.divExt.id = this.id + "_DivExt";
    this.divExt.style.position = this.position;
    this.divExt.style.left = this.left;
    this.divExt.style.top = this.top;
    this.divExt.style.width = this.width;
    this.divExt.style.height = 20;
    this.divExt.className = this.getCssRuleName("text_global");
    this.champsAs = document.createElement("DIV");
    this.champsAs.innerHTML = "*";
    this.champsAs.style.display = "none";
    this.champsAs.className = this.getCssRuleName("text_requiredDiv");
    if (this.datatype == "T") {
        this.champs = document.createElement("TEXTAREA");
    } else {
        this.champs = document.createElement("INPUT");
        this.champs.setAttribute("type", this.inputType);
    }
    this.champs.name = this.dataname;
    this.champs.style.position = "absolute";
    if (this.datatype == "T") {
        this.divExt.style.height = "auto";
        this.champs.setAttribute("rows", this.rows);
    }
    this.champs.accessKey = this.accessKey;
    this.champs.className = this.getCssRuleName("text_" + this.datatype);
    if (this.initValue) {
        this.setValue(this.initValue);
    }
    if (this.datatype == "D") {
        this.formatter = new rialto.utils.Formatter({type:"date"});
    } else {
        if (this.datatype == "H") {
            this.formatter = new rialto.utils.Formatter({type:"hour"});
        } else {
            if (this.datatype == "N") {
                this.formatter = new rialto.utils.Formatter({type:"number"});
            }
        }
    }
    if (this.datatype == "D") {
        this.autoUp = false;
        this.width = 115;
        this.divExt.style.width = 115;
        this.champs.size = 10;
        this.hlpimg = new rialto.widget.Image("text_date_helpbuton", 0, -2, this.divExt, rialto.I18N.getLabel("lanCalenderButton"), "text_date_helpbutonover", {boolFloatRight:true, bWithoutRecordInSession:true});
        this.hlpimg.onclick = function (e) {
            if (!e) {
                e = window.event;
            }
            oThis.openCalendar(e);
        };
    } else {
        if (this.datatype == "H") {
            this.autoUp = false;
        } else {
            if (this.datatype == "Hi") {
                this.divExt.style.display = "none";
            }
        }
    }
    if (this.disable) {
        this.setEnable(false);
    }
    if (this.isRequired) {
        this.champsAs.style.display = "block";
    }
    if (this.datatype != "Hi") {
        if (this.datatype != "T") {
            this.keypresshandler = new ria.utils.event.keyPressHandler(this.champs);
            this.keypresshandler.onkeyPress = function () {
                return oThis.checkKeyPress();
            };
        }
        this.addEvent(this.champs, "onfocus", this._focus);
        this.addEvent(this.champs, "onblur", this._blur);
        this.addEvent(this.champs, "onclick", this.setFocus);
    }
    this.divExt.appendChild(this.champs);
    this.divExt.appendChild(this.champsAs);
    if (parent) {
        this.attach(parent);
    }
};
rialto.widget.Text.prototype = new rialto.widget.AbstractComponent;
rialto.widget.Text.prototype.adaptToContext = function () {
    if (this.datatype == "D") {
        var width = this.width - this.hlpimg.getOffsetWidth();
        this.champs.style.width = width;
    } else {
        this.champs.style.width = this.width;
    }
    if (this.datatype == "T") {
        this.divExt.style.height = this.champs.offsetHeight;
    }
};
rialto.widget.Text.prototype.updateWidth = function () {
    this.adaptToContext();
};
rialto.widget.Text.prototype.setToolTip = function () {
    if (this.alt) {
        this.champs.title = this.alt;
    } else {
        if (this.datatype != "P") {
            this.champs.title = this.champs.value;
        }
    }
};
rialto.widget.Text.prototype.release = function () {
    if (this.datatype == "D") {
        this.hlpimg.remove();
        if (this.calendar) {
            this.calendar.onclick = null;
            this.calendar.remove();
        }
    }
    if (this.keypresshandler) {
        this.keypresshandler.remove();
    }
    if (this.formatter) {
        delete (this.formatter);
    }
};
rialto.widget.Text.prototype.setStyle = function (obStyle) {
    for (prop in obStyle) {
        try {
            this.champs.style[prop] = obStyle[prop];
        }
        catch (erreur) {
        }
    }
};
rialto.widget.Text.prototype.removeStyle = function (obStyle) {
    for (prop in obStyle) {
        try {
            this.champs.style[prop] = null;
        }
        catch (erreur) {
        }
    }
};
rialto.widget.Text.prototype.openCalendar = function (e) {
    var othis = this;
    if (!this.calendar) {
        this.calendar = new rialto.widget.Calendar({popUpMode:true});
        this.calendar.onclick = function (date) {
            othis.setValue(othis.formatter.format(this.currentDate));
            othis.setFocus();
        };
    }
    var top = compOffsetTop(this.divExt) + 27;
    var left = compOffsetLeft(this.divExt) - 90;
    if (left < 0) {
        left = 0;
    }
    this.calendar.displayCalendar(top, left);
};
rialto.widget.Text.prototype.checkKeyPress = function (evt) {
    var boolCancel = false;
    boolReplaceKey = false;
    var keyCode = this.keypresshandler.getKeyCode();
    var key = this.keypresshandler.getKey();
    if (keyCode == 13 && this.datatype != "T") {
        this.champs.blur();
        return this.blurOK;
    }
    if (this.autoUp == true) {
        var newKey = key.toUpperCase();
        if (newKey != key) {
            boolReplaceKey = true;
            key = newKey;
        }
    }
    if (this.datatype == "N") {
        boolCancel = "0123456789E.".indexOf(key) == -1;
    }
    if (this.datatype == "D") {
        boolCancel = "0123456789/".indexOf(key) == -1;
    }
    if (this.datatype == "H") {
        if ("0123456789:".indexOf(key) == -1) {
            boolCancel = true;
        }
    }
    if (boolCancel) {
        return false;
    } else {
        if (boolReplaceKey) {
            this.keypresshandler.setKey(key);
            return true;
        } else {
            return true;
        }
    }
};
rialto.widget.Text.prototype.displayMessage = function (str, boolSetFoc) {
    var oThis = this;
    var info = new rialto.widget.Alert(str);
    if (boolSetFoc) {
        info.onclose = function () {
            oThis.setValue(oThis.valueBeforeFocus);
            oThis.champs.focus();
        };
        info = null;
    }
};
rialto.widget.Text.prototype._focus = function () {
    this.valueBeforeFocus = this.champs.value;
    if (this.champs.value != "") {
        if (this.formatter) {
            this.setValue(this.formatter.applyMask(this.champs.value));
        }
    }
    this.blurOK = true;
    this.wchanged = false;
    this.champs.select();
    this.onfocus();
};
rialto.widget.Text.prototype._blur = function () {
    if (!this.blurOK) {
        return;
    }
    if (this.champs.value != "") {
        this.blurOK = true;
        if (this.formatter && this.formatter.validate) {
            this.blurOK = this.formatter.validate(this.champs.value, true);
        }
        if (!this.blurOK) {
            if (this.datatype == "N") {
                this.displayMessage("Number is not correct, format must be: " + this.formatter.maskPattern, true);
            }
            if (this.datatype == "D") {
                this.displayMessage("Date is not correct, format must be: " + this.formatter.maskPattern, true);
            }
            if (this.datatype == "H") {
                this.displayMessage("Hour is not correct, format must be:" + this.formatter.maskPattern, true);
            }
        } else {
            if (this.formatter) {
                this.setValue(this.formatter.retrieveMask(this.champs.value));
            }
            this.setToolTip();
            var newVal = this.getValue();
            this.wchanged = (this.wvalue != newVal);
            this.wvalue = newVal;
            if (this.wchanged && this.blurOK) {
                this.blurOK = this.onblur();
            }
            this.removeAsRequired();
        }
    } else {
        this.blurOK = this.onblur();
        if (this.isRequired) {
            this.showAsRequired();
            this.blurOK = false;
        }
    }
};
rialto.widget.Text.prototype.setFocus = function () {
    this.champs.focus();
};
rialto.widget.Text.prototype.getValue = function () {
    return this.champs.value;
};
rialto.widget.Text.prototype.getData = function () {
    if (this.formatter) {
        return this.formatter.parse(this.champs.value);
    } else {
        return this.champs.value;
    }
};
rialto.widget.Text.prototype.setData = function (data) {
    if (this.formatter) {
        data = this.formatter.format(data);
    }
    this.setValue(data);
};
rialto.widget.Text.prototype.setPattern = function (pattern) {
    if (this.formatter) {
        this.formatter.setPattern(pattern);
    }
};
rialto.widget.Text.prototype.setFormatter = function (formatter) {
    this.formatter = formatter;
};
rialto.widget.Text.prototype.setValue = function (text) {
    this.champs.value = text;
    this.wvalue = text;
    this.setToolTip();
};
rialto.widget.Text.prototype.setEnable = function (enable) {
    if (enable) {
        this.champs.disabled = false;
        this.champs.className = this.getCssRuleName("text_" + this.datatype);
        if (this.datatype == "D") {
            this.hlpimg.setEnable(true);
        }
    } else {
        this.champs.disabled = true;
        this.champs.className += " " + this.getCssRuleName("text_desable");
        if (this.datatype == "D") {
            this.hlpimg.setEnable(false);
        }
    }
    this.enable = enable;
};
rialto.widget.Text.prototype.hasChanged = function () {
    return this.wchanged;
};
rialto.widget.Text.prototype.showAsRequired = function () {
    this.champs.className += " " + this.getCssRuleName("text_required");
};
rialto.widget.Text.prototype.removeAsRequired = function () {
    this.champs.className = this.getCssRuleName("text_" + this.datatype);
    if (!this.enable) {
        this.setEnable(false);
    }
};
rialto.widget.Text.prototype.onblur = function () {
    return true;
};


rialto.widget.Label = function (name, top, left, parent, text, className, objPar) {
    if (!objPar) {
        var objPar = {};
    }
    objPar.name = name;
    objPar.type = "label";
    objPar.left = left;
    objPar.top = top;
    this.base = rialto.widget.AbstractComponent;
    this.base(objPar);
    this.text = text;
    this.objStyle = null;
    this.alt = text;
    if (className != "" && className != null) {
        this.className = className;
    } else {
        this.className = "libNormal";
    }
    if (rialto.lang.isString(objPar.alt, true)) {
        this.alt = objPar.alt;
    }
    objPar = null;
    var oThis = this;
    this.setTextWidth();
    this.divExt.id = this.id + "_DivGen";
    this.divExt.style.position = this.position;
    this.divExt.style.left = this.left;
    this.divExt.style.top = this.top;
    this.divExt.style.width = this.width + "px";
    this.divExt.className = this.className;
    this.divExt.style.overflow = "hidden";
    this.divExt.title = this.alt;
    this.divExt.innerHTML = this.text;
    if (parent) {
        this.attach(parent);
    }
};
rialto.widget.Label.prototype = new rialto.widget.AbstractComponent;
rialto.widget.Label.prototype.setTextWidth = function (wText) {
    if (this.domParent) {
        var over = this.domParent.style.overflow;
        this.domParent.style.overflow = "hidden";
    }
    var text = wText ? wText : this.text;
    this.width = ria.utils.measures.getTextSize(text, this.className, this.objStyle);
    this.divExt.style.width = this.width + "px";
    if (this.domParent) {
        this.domParent.style.overflow = over;
    }
};
rialto.widget.Label.prototype.setText = function (text) {
    if (this.alt == this.text) {
        this.alt = text;
    }
    this.text = text;
    this.divExt.innerHTML = this.text;
    this.divExt.title = this.alt;
    this.setTextWidth();
};
rialto.widget.Label.prototype.getText = function () {
    return this.text;
};
rialto.widget.Label.prototype.setStyle = function (obStyle) {
    var oHtml = this.getHtmlExt();
    for (prop in obStyle) {
        oHtml.style[prop] = obStyle[prop];
    }
    this.objStyle = obStyle;
    this.setTextWidth();
};
rialto.widget.Label.prototype.setClassName = function (classname) {
    this.classname = classname;
    this.setTextWidth();
};
rialto.widget.Label.prototype.setEnable = function (enable) {
    if (enable) {
        this.divExt.className = this.className;
    } else {
        this.divExt.className += " label_disable";
    }
    this.enable = enable;
};


rialto.widget.Button = function (top, left, text, alt, parent, objPar) {
    if (!objPar) {
        var objPar = {};
    }
    objPar.name = "button";
    objPar.type = "button";
    objPar.top = top;
    objPar.left = left;
    this.base = rialto.widget.AbstractComponent;
    this.base(objPar);
    this.text = text;
    this.enable = true;
    this.alt = alt ? alt : text;
    this.widthMin = 88;
    this.width = 88;
    this.adaptToText = true;
    if (rialto.lang.isBoolean(objPar.enable)) {
        this.enable = objPar.enable;
    }
    if (rialto.lang.isBoolean(objPar.adaptToText)) {
        this.adaptToText = objPar.adaptToText;
    }
    if (rialto.lang.isNumber(objPar.widthMin)) {
        this.widthMin = objPar.widthMin;
    }
    if (rialto.lang.isNumber(objPar.width)) {
        this.width = objPar.width;
    }
    objPar = null;
    this.divExt.style.top = this.top;
    this.divExt.style.left = this.left;
    this.divExt.style.position = this.position;
    this.divExt.style.width = this.width;
    this.divExt.title = this.alt;
    this.divExt.className = this.getCssRuleName("button_divExt");
    this.imgG = document.createElement("DIV");
    this.imgG.className = this.getCssRuleName("button_leftEdgeOff");
    this.divCenter = document.createElement("DIV");
    this.divCenter.className = this.getCssRuleName("button_centerOff");
    this._divTitle = document.createElement("DIV");
    this._divTitle.className = this.getCssRuleName("button_textOff");
    this._divTitle.innerHTML = this.text;
    this._divTitleShadow = document.createElement("DIV");
    this._divTitleShadow.className = this.getCssRuleName("button_shadowText");
    this._divTitleShadow.innerHTML = this.text;
    this.imgD = document.createElement("DIV");
    this.imgD.className = this.getCssRuleName("button_rightEdgeOff");
    this.divExt.appendChild(this.imgG);
    this.divExt.appendChild(this.divCenter);
    this.divCenter.appendChild(this._divTitleShadow);
    this.divCenter.appendChild(this._divTitle);
    this.divExt.appendChild(this.imgD);
    var oThis = this;
    this.addEvent(this.divExt, "onmouseout", this._onmouseout);
    this.addEvent(this.divExt, "onmouseover", this._onmouseover);
    this.addEvent(this.divExt, "onclick", this._onclick);
    if (!this.enable) {
        this.setEnable(this.enable);
    }
    if (parent) {
        this.attach(parent);
    }
};
rialto.widget.Button.prototype = new rialto.widget.AbstractComponent;
rialto.widget.Button.prototype._onmouseout = function (e) {
    if (this.enable) {
        if (!e) {
            e = window.event;
        }
        var srcElmt = ria.utils.event.srcTarget(e);
        this.switchImage("Off");
        srcElmt.style.cursor = "default";
        this.onmouseout(e);
    }
};
rialto.widget.Button.prototype._onmouseover = function (e) {
    if (this.enable) {
        if (!e) {
            e = window.event;
        }
        var srcElmt = ria.utils.event.srcTarget(e);
        this.switchImage("On");
        srcElmt.style.cursor = "pointer";
        this.onmouseover(e);
    }
};
rialto.widget.Button.prototype._onclick = function (e) {
    if (this.enable) {
        if (!e) {
            e = window.event;
        }
        this.onclick(e);
        stopEvent(e);
    }
};
rialto.widget.Button.prototype.isAdaptToText = function () {
    return this.adaptToText;
};
rialto.widget.Button.prototype.setAdaptToText = function (adaptToText) {
    this.adaptToText = adaptToText;
};
rialto.widget.Button.prototype.getWidthMin = function () {
    return this.widthMin;
};
rialto.widget.Button.prototype.setWidthMin = function (widthMin) {
    this.widthMin = widthMin;
    if (this.adaptToText && widthMin > this.width) {
        this.adaptToContext();
    }
};
rialto.widget.Button.prototype.setTitle = function (text) {
    rialto.deprecated("Button", "setTitle", "setText()");
    this.setText(text);
};
rialto.widget.Button.prototype.setText = function (text) {
    if (this.alt == this.text) {
        this.alt = text;
    }
    this.text = text;
    this._divTitleShadow.innerHTML = text;
    this._divTitle.innerHTML = text;
    this.adaptToContext();
};
rialto.widget.Button.prototype.getText = function (text) {
    return this.text;
};
rialto.widget.Button.prototype.adaptAfterSizeChange = function () {
    this.adaptToContext();
};
rialto.widget.Button.prototype.adaptToContext = function () {
    var $imageSize = getComputStyle(this.imgG, "width") + getComputStyle(this.imgD, "width");
    if (this.adaptToText) {
        this.width = Math.max(ria.utils.measures.getTextSize(this.text, this.getCssRuleName("button_textOff")) + $imageSize, this.widthMin);
    }
    this.divExt.style.width = this.width;
    this.divCenter.style.width = this.width - $imageSize;
};
rialto.widget.Button.prototype.switchImage = function (status) {
    this.imgG.className = this.getCssRuleName("button_leftEdge" + status);
    this.divCenter.className = this.getCssRuleName("button_center" + status);
    this._divTitle.className = this.getCssRuleName("button_text" + status);
    this.imgD.className = this.getCssRuleName("button_rightEdge" + status);
};
rialto.widget.Button.prototype.release = function () {
    this.imgG = null;
    this.divCenter = null;
    this._divTitle = null;
    this._divTitleShadow = null;
    this.imgD = null;
};
rialto.widget.Button.prototype.setEnable = function (enable) {
    if (enable) {
        this._divTitleShadow.style.display = "block";
        this.switchImage("Off");
    } else {
        this._divTitleShadow.style.display = "none";
        this.switchImage("Disa");
    }
    this.enable = enable;
};


rialto.widget.Radio = function (name, top, left, parent, group, text, checked, labelClassname, objPar) {
    if (!objPar) {
        var objPar = {};
    }
    objPar.name = name;
    objPar.type = "radio";
    objPar.left = left;
    objPar.top = top;
    this.base = rialto.widget.AbstractComponent;
    this.base(objPar);
    this.labelClassname = "libNormal";
    this.checked = false;
    this.tabindex = rialto.widget.Form.prototype.tabIndex++;
    this.group = group;
    this.text = text;
    this.alt = text;
    if (rialto.lang.isString(labelClassname)) {
        this.labelClassname = labelClassname;
    }
    if (rialto.lang.isBoolean(checked)) {
        this.checked = checked;
    }
    if (rialto.lang.isString(objPar.alt, true)) {
        this.alt = objPar.alt;
    }
    objPar = null;
    this.divExt.id = this.id + "_divExt";
    this.divExt.style.position = this.position;
    this.divExt.style.left = this.left;
    this.divExt.style.top = this.top;
    this.divExt.style.height = 20;
    var wInnerHTML = "";
    wInnerHTML = "<input type=\"radio\" id=\"" + this.id + "\" name=\"" + this.group + "\" value=\"" + this.dataname + "\"  />";
    this.divExt.innerHTML = wInnerHTML;
    this.radio = this.divExt.firstChild;
    this.radio.tabIndex = this.tabindex;
    this.radio.title = this.alt;
    this.lib = new rialto.widget.Label("LIB1", 2, 20, this.divExt, this.text, this.labelClassname, {position:"absolute", bWithoutRecordInSession:true});
    this.divExt.style.width = parseInt(this.lib.getWidth()) + 20;
    this.addEvent(this.radio, "onclick", this._onclick);
    if (parent) {
        this.attach(parent);
    }
};
rialto.widget.Radio.prototype = new rialto.widget.AbstractComponent;
rialto.widget.Radio.prototype._onclick = function (e) {
    if (this.enable) {
        if (!e) {
            e = window.event;
        }
        this.onclick(e);
    }
};
rialto.widget.Radio.prototype.adaptToContext = function () {
    this.radio.checked = this.checked;
};
rialto.widget.Radio.prototype.isCheck = function () {
    return this.radio.checked;
};
rialto.widget.Radio.prototype.setCheck = function (check, boolC) {
    this.radio.checked = check;
    this.checked = check;
    if (boolC) {
        this.onclick();
    }
};
rialto.widget.Radio.prototype.release = function () {
    this.lib.remove();
};
rialto.widget.Radio.prototype.setEnable = function (enable) {
    this.radio.disabled = !enable;
    this.enable = enable;
};


rialto.widget.Checkbox = function (name, top, left, parent, text, checked, labelClassname, objPar) {
    if (!objPar) {
        var objPar = {};
    }
    objPar.name = name;
    objPar.type = "checkbox";
    objPar.left = left;
    objPar.top = top;
    this.base = rialto.widget.AbstractComponent;
    this.base(objPar);
    this.labelClassname = "libelle1";
    this.checked = false;
    this.tabIndex = rialto.widget.Form.prototype.tabIndex++;
    this.text = text;
    this.alt = text;
    if (rialto.lang.isString(labelClassname)) {
        this.labelClassname = labelClassname;
    }
    if (rialto.lang.isBoolean(checked)) {
        this.checked = checked;
    }
    if (rialto.lang.isString(objPar.alt, true)) {
        this.alt = objPar.alt;
    }
    objPar = null;
    var oThis = this;
    this.divExt.id = this.id + "_divExt";
    this.divExt.style.position = this.position;
    this.divExt.style.left = this.left;
    this.divExt.style.top = this.top;
    this.divExt.style.height = 20;
    this.checkbox = document.createElement("INPUT");
    this.checkbox.type = "checkbox";
    this.checkbox.id = this.id + "_Check";
    this.checkbox.name = this.dataname;
    this.checkbox.tabIndex = this.tabIndex;
    this.checkbox.title = this.alt;
    this.divExt.appendChild(this.checkbox);
    this.addEvent(this.checkbox, "click", this._click);
    this.lib = new rialto.widget.Label("LIB1", 3, 20, this.divExt, this.text, this.labelClassname, {position:"absolute", bWithoutRecordInSession:true});
    this.divExt.style.width = parseInt(this.lib.getWidth()) + 20;
    if (parent) {
        this.attach(parent);
    }
};
rialto.widget.Checkbox.prototype = new rialto.widget.AbstractComponent;
rialto.widget.Checkbox.prototype._click = function (e) {
    this.checked = this.checkbox.checked;
    this.checkbox.value = this.checkbox.checked;
    this.onclick(e);
};
rialto.widget.Checkbox.prototype.adaptToContext = function () {
    this.setCheck(this.checked, false);
};
rialto.widget.Checkbox.prototype.setEnable = function (enable) {
    if (enable) {
        this.checkbox.disabled = false;
    } else {
        this.checkbox.disabled = true;
    }
    this.enable = enable;
};
rialto.widget.Checkbox.prototype.setCheck = function (check, boolC) {
    this.checkbox.checked = check;
    this.checked = check;
    this.checkbox.value = check;
    if (boolC) {
        this.onclick();
    }
};
rialto.widget.Checkbox.prototype.isCheck = function () {
    return this.checkbox.checked;
};
rialto.widget.Checkbox.prototype.getValue = function () {
    return this.isCheck();
};
rialto.widget.Checkbox.prototype.release = function () {
    this.lib.remove();
};


rialto.widget.Combo = function (tabData, name, top, left, width, parent, objPar) {
    if (!objPar) {
        var objPar = {};
    }
    objPar.name = name;
    objPar.type = "combo";
    objPar.left = left;
    objPar.top = top;
    objPar.width = width;
    this.base = rialto.widget.AbstractComponent;
    this.base(objPar);
    this.enable = true;
    this.writable = true;
    this.suggest = true;
    this.asynchSuggest = false;
    this.isRequired = false;
    this.timeForSuggest = 1500;
    this.urlForSuggest = null;
    this.nbCharForSuggest = 3;
    this.open = false;
    this.heightItem = 23;
    this.wvalue = "";
    this.alt = null;
    if (rialto.lang.isBoolean(objPar.suggest)) {
        this.suggest = objPar.suggest;
    }
    if (rialto.lang.isBoolean(objPar.asynchSuggest)) {
        this.asynchSuggest = objPar.asynchSuggest;
    }
    if (rialto.lang.isNumber(objPar.timeForSuggest)) {
        this.timeForSuggest = objPar.timeForSuggest;
    }
    if (rialto.lang.isString(objPar.urlForSuggest, true)) {
        this.urlForSuggest = objPar.urlForSuggest;
    }
    if (rialto.lang.isNumber(objPar.nbCharForSuggest)) {
        this.nbCharForSuggest = objPar.nbCharForSuggest;
    }
    if (rialto.lang.isBoolean(objPar.enable)) {
        this.enable = objPar.enable;
    }
    if (rialto.lang.isNumber(objPar.heightItem)) {
        this.heightItem = objPar.heightItem;
    }
    if (rialto.lang.isBoolean(objPar.isRequired)) {
        this.isRequired = objPar.isRequired;
    }
    if (rialto.lang.isBoolean(objPar.writable)) {
        this.writable = objPar.writable;
    }
    if (rialto.lang.isString(objPar.alt, true)) {
        this.alt = objPar.alt;
    }
    objPar = null;
    this.currentIndex = -1;
    var oThis = this;
    this.divExt.id = this.id + "_divExt";
    this.divExt.style.position = this.position;
    this.divExt.style.width = this.width;
    this.divExt.style.left = this.left;
    this.divExt.style.top = this.top;
    this.divExt.style.height = 20;
    this.textValue = new rialto.widget.Text(this.name, 0, 0, "", "Hi", this.divExt, {bWithoutRecordInSession:true});
    this.text = new rialto.widget.Text(this.name + "_text", 0, 0, parseInt(this.width) - 14, "A", this.divExt, {classname:"combo_", alt:this.alt, autoUp:false, position:"absolute", isRequired:this.isRequired, bWithoutRecordInSession:true});
    if (this.isRequired) {
        this.divExt.appendChild(this.text.champsAs);
        this.text.champsAs.style.display = "block";
    }
    this.keypresshandler = this.text.keypresshandler;
    if (this.suggest) {
        this.keypresshandler.setOnkeyUp();
        this.keypresshandler.onkeyPress = function () {
            return oThis.checkKeyPress();
        };
    } else {
        if (!this.writable) {
            this.keypresshandler.onkeyPress = function () {
                return false;
            };
        }
    }
    this.img = new rialto.widget.Image("combo_downArrow", 0, 0, this.divExt, rialto.I18N.getLabel("lanOpenButtonText"), "", {bWithoutRecordInSession:true, boolFloatRight:true});
    this.img.onclick = function () {
        if (oThis.enable) {
            if (oThis.initListItem.length != oThis.currentListItem.length) {
                oThis.currentListItem = new Array;
                for (i = 0; i < oThis.initListItem.length; i++) {
                    oThis.currentListItem.push(oThis.initListItem[i]);
                }
            }
            oThis.setOpen(!oThis.open);
        }
    };
    var obj = {name:"MENU-COMBO", posFixe:true, width:parseInt(this.divExt.style.width), className:"combo_list", bWithoutRecordInSession:true};
    this.opslist = new rialto.widget.simpleMenu(obj);
    this.opslist.onClose = function () {
        oThis.setOpen(false);
    };
    this.opslist.onclick = function (item) {
        oThis.selInd(item.index, true);
    };
    this.opslist.onOver = function (item) {
        if (oThis.lastOver && oThis.lastOver != item) {
            oThis.lastOver.out();
        }
        oThis.lastOver = item;
        oThis.currentIndex = item.index;
    };
    if (parent) {
        this.attach(parent);
    }
    if (!this.enable) {
        this.setEnable(false);
    }
    this.setData(tabData);
};
rialto.widget.Combo.prototype = new rialto.widget.AbstractComponent;
rialto.widget.Combo.prototype.adaptToContext = function () {
    var imgSize = this.img.getOffsetWidth();
    if (!isNaN(imgSize)) {
        this.text.setWidth(parseInt(this.width) - this.img.getOffsetWidth());
        this.imgHasBeenSet = true;
    }
};
rialto.widget.Combo.prototype.updateSize = function () {
    if (!this.imgHasBeenSet) {
        this.adaptToContext();
    }
};
rialto.widget.Combo.prototype.release = function () {
    this.img.remove();
    this.text.remove();
    this.textValue.remove();
    this.opslist.remove();
};
rialto.widget.Combo.prototype.clearData = function () {
    this.setValue("");
    this.tabData = new Array();
    this.initListItem = new Array();
    this.currentListItem = new Array();
};
rialto.widget.Combo.prototype.setData = function (tabData) {
    this.clearData();
    if (tabData) {
        this.tabData = tabData;
    }
    for (i = 0; i < this.tabData.length; i++) {
        var item = new rialto.widget.ComboItem(this.tabData[i][0], this.tabData[i][1]);
        this.initListItem.push(item);
        this.currentListItem.push(item);
    }
};
rialto.widget.Combo.prototype.checkKeyPress = function (evt) {
    var keyCode = this.keypresshandler.getKeyCode();
    var key = this.keypresshandler.getKey();
    if (this.keypresshandler.isUpArrowKey() || this.keypresshandler.isDownArrowKey() || this.keypresshandler.isEnterKey()) {
        if (this.keypresshandler.isUpArrowKey() || this.keypresshandler.isDownArrowKey()) {
            if (!this.open) {
                this.prepareList(this.getValue());
                this.setOpen(true);
            }
            if (this.keypresshandler.isUpArrowKey()) {
                if (this.currentIndex > 0) {
                    this.currentIndex -= 1;
                } else {
                    this.currentIndex = 0;
                }
            } else {
                if (this.currentIndex < this.currentListItem.length - 1) {
                    this.currentIndex += 1;
                }
            }
            if (this.lastOver) {
                this.lastOver.out();
            }
            this.lastOver = this.opslist.tabItem[this.currentIndex];
            this.lastOver.over();
        } else {
            if (this.currentIndex >= 0) {
                this.opslist.onclick(this.lastOver);
            }
        }
        return false;
    } else {
        if (this.asynchSuggest && this.urlForSuggest) {
            if (this.getValue().length >= this.nbCharForSuggest) {
                if (this.timeOut) {
                    window.clearTimeout(this.timeOut);
                    if (this.remote) {
                        this.remote.xhttpr.abort();
                    }
                }
                this.timeOut = window.setTimeout("rialto.session.objects['" + this.id + "'].callAsynchSuggest()", this.timeForSuggest);
            }
            return true;
        } else {
            this.prepareList();
            if (this.currentListItem.length > 0) {
                this.setOpen(true);
            } else {
                this.setOpen(false);
                if (!this.writable) {
                    this.setValue(this.wvalue);
                    this.prepareList();
                    this.setOpen(true);
                    return false;
                }
            }
            this.wvalue = this.getValue();
            return true;
        }
    }
};
rialto.widget.Combo.prototype.callAsynchSuggest = function () {
    this.remote = new rialto.io.AjaxRequest({url:this.urlForSuggest, callBackObjectOnSuccess:this, withWaitWindow:false, onSuccess:this.refreshListData});
    this.img.setImageReference("default_ajax_i");
    this.remote.load("name=" + this.name + "&text=" + this.getValue());
};
rialto.widget.Combo.prototype.refreshListData = function (request) {
    this.img.setImageReference("combo_downArrow");
    var data = eval("(" + request.responseText + ")");
    this.tabData = data;
    this.initListItem = new Array();
    this.currentListItem = new Array();
    for (i = 0; i < this.tabData.length; i++) {
        var item = new rialto.widget.ComboItem(this.tabData[i][0], this.tabData[i][1]);
        this.initListItem.push(item);
        this.currentListItem.push(item);
    }
    this.prepareList();
    if (this.currentListItem.length > 0) {
        this.setOpen(true);
    } else {
        this.setOpen(false);
    }
};
rialto.widget.Combo.prototype.setOpen = function (open) {
    if (open) {
        this.displayList(this.currentListItem);
    }
    if (open == this.open) {
        return;
    }
    this.open = open;
    if (open) {
        this.img.setImageReference("combo_upArrow");
        this.opslist.setPosTop(compOffsetTop(this.divExt) + 22);
        this.opslist.setPosLeft(compOffsetLeft(this.divExt) + 2);
        this.opslist.affichezoneMenu(null, 22);
    } else {
        this.img.setImageReference("combo_DownArrow");
        this.currentIndex = -1;
        if (this.opslist.open) {
            this.opslist.fermezoneMenu();
        }
    }
};
rialto.widget.Combo.prototype.prepareList = function () {
    if (this.suggest) {
        this.currentListItem = new Array;
        strSaisi = this.getValue().toLowerCase();
        for (i = 0; i < this.initListItem.length; i++) {
            if (this.initListItem[i].text.toLowerCase().indexOf(strSaisi) == 0) {
                this.currentListItem.push(this.initListItem[i]);
            }
        }
    }
};
rialto.widget.Combo.prototype.displayList = function (arr) {
    this.opslist.clear();
    this.lastOver = null;
    this.currentIndex = -1;
    for (var i = 0; i < arr.length; i++) {
        var obj = {text:"" + arr[i].text, height:this.heightItem, bNotOut:true, clOver:"combo_itemMenuOn", clOut:"combo_itemMenuOff"};
        var item = this.opslist.addItem(obj);
        item.val = arr[i].value;
        item.index = i;
        if (arr[i].style) {
            item.setStyle(arr[i].style);
        }
    }
};
rialto.widget.Combo.prototype.addItem = function (valeur, text, objStyle) {
    var combItem = new rialto.widget.ComboItem(valeur, text, objStyle);
    this.initListItem.push(combItem);
    this.currentListItem.push(combItem);
};
rialto.widget.Combo.prototype.getItem = function (index) {
    if (index >= 0 && index < this.initListItem.length) {
        return this.initListItem[index];
    }
    return null;
};
rialto.widget.Combo.prototype.selLast = function (execAppliCode) {
    var indLast = this.initListItem.length - 1;
    this.selInd(indLast, execAppliCode);
};
rialto.widget.Combo.prototype.selInd = function (ind, execAppliCode) {
    if (ind >= 0 && ind < this.currentListItem.length) {
        this.removeStyle(this.currStyle);
        this.text.champs.className = "combo_text_A";
        if (this.opslist.open) {
            this.setOpen(false);
        }
        var item = this.currentListItem[ind];
        if (item.style) {
            this.setStyle(item.style);
        }
        var text = item.text;
        var value = item.value;
        this.text.setValue(text);
        this.wvalue = text;
        this.textValue.setValue(value);
        if (this.isRequired) {
            this.text.removeAsRequired();
        }
    }
    if (execAppliCode) {
        this.onclick(value, text);
    }
};
rialto.widget.Combo.prototype.selFirst = function (execAppliCode) {
    this.selInd(0, execAppliCode);
};
rialto.widget.Combo.prototype.selWithValue = function (value, execAppliCode) {
    var ind = this.indexOf(value);
    if (ind != -1) {
        this.selInd(ind, execAppliCode);
    }
};
rialto.widget.Combo.prototype.selWithText = function (text, execAppliCode) {
    var ind = this.indexOfText(text);
    if (ind != -1) {
        this.selInd(ind, execAppliCode);
    }
};
rialto.widget.Combo.prototype.setValue = function (value) {
    this.text.setValue(value);
    this.textValue.setValue(value);
    this.wvalue = value;
};
rialto.widget.Combo.prototype.indexOf = function (value) {
    for (i = 0; i < this.initListItem.length; i++) {
        if (this.initListItem[i].value == value) {
            return i;
        }
    }
    return -1;
};
rialto.widget.Combo.prototype.indexOfText = function (text) {
    for (i = 0; i < this.initListItem.length; i++) {
        if (this.initListItem[i].text == text) {
            return i;
        }
    }
    return -1;
};
rialto.widget.Combo.prototype.setEnable = function (enable) {
    this.text.setEnable(enable);
    this.enable = enable;
};
rialto.widget.Combo.prototype.setFocus = function () {
    this.text.setFocus();
};
rialto.widget.Combo.prototype.getSelValue = function () {
    return this.textValue.getValue();
};
rialto.widget.Combo.prototype.getSelText = function () {
    return this.text.getValue();
};
rialto.widget.Combo.prototype.getText = function (ind) {
    if (ind >= 0 && ind < this.initListItem.length) {
        return this.initListItem[ind].text;
    } else {
        return null;
    }
};
rialto.widget.Combo.prototype.getValue = function (ind) {
    if (ind) {
        if (ind >= 0 && ind < this.initListItem.length) {
            return this.initListItem[ind].text;
        } else {
            return null;
        }
    } else {
        return this.text.getValue();
    }
};
rialto.widget.Combo.prototype.setStyle = function (objStyle) {
    this.text.setStyle(objStyle);
    this.currStyle = objStyle;
};
rialto.widget.Combo.prototype.removeStyle = function () {
    if (this.currStyle) {
        this.text.removeStyle(this.currStyle);
        this.currStyle = null;
    }
};
rialto.widget.Combo.prototype.onclick = function (value, text) {
};
rialto.widget.ComboItem = function (value, text, objStyle) {
    this.text = text;
    this.value = value;
    this.style = objStyle;
};
rialto.widget.ComboItem.prototype.setStyle = function (objStyle) {
    this.style = objStyle;
};


rialto.widget.CodeLabel = function (codeName, top, left, width, parent, objPar) {
    if (!objPar) {
        var objPar = {};
    }
    objPar.type = "codelib";
    objPar.name = codeName;
    objPar.left = left;
    objPar.top = top;
    objPar.width = width;
    this.base = rialto.widget.AbstractComponent;
    this.base(objPar);
    this.withLabel = true;
    this.url = null;
    this.submitOnload = true;
    this.arrPermValue = new Array;
    this.isRequired = false;
    this.codeWidth = 40;
    this.alwaysRefresh = false;
    this.dataLoadOnce = false;
    if (objPar.arrValue) {
        this.arrPermValue = objPar.arrValue;
    }
    if (rialto.lang.isBoolean(objPar.withLabel)) {
        this.withLabel = objPar.withLabel;
    }
    if (objPar.url) {
        this.url = objPar.url;
    }
    if (rialto.lang.isBoolean(objPar.submitOnload)) {
        this.submitOnload = objPar.submitOnload;
    }
    if (rialto.lang.isBoolean(objPar.alwaysRefresh)) {
        this.alwaysRefresh = objPar.alwaysRefresh;
    }
    if (rialto.lang.isNumber(objPar.codeWidth)) {
        this.codeWidth = objPar.codeWidth != 0 ? objPar.codeWidth : 40;
    }
    if (!this.withLabel) {
        this.codeWidth = this.width - 25;
    }
    if (rialto.lang.isBoolean(objPar.isRequired)) {
        this.isRequired = objPar.isRequired;
    }
    objPar = null;
    this.base = null;
    var oThis = this;
    this.divExt.className = this.getCssRuleName("codeLabel_divExt");
    this.divExt.style.width = this.width;
    this.divExt.style.top = this.top;
    this.divExt.style.left = this.left;
    this.code = new rialto.widget.Text(this.name, 0, 0, this.codeWidth, "A", this.divExt, {classname:"codeLabel_code_", isRequired:this.isRequired, autoUp:false, position:"absolute", bWithoutRecordInSession:true});
    this.img = new rialto.widget.Image("codeLabel_helpbuton", this.codeWidth, -2, this.divExt, rialto.I18N.getLabel("lanHelpButton"), "codeLabel_helpbutonover", {position:"absolute", bWithoutRecordInSession:true});
    if (this.withLabel) {
        this.label = new rialto.widget.Text("LIB" + this.name, 0, this.codeWidth + 25, this.width - (this.codeWidth + 27), "A", this.divExt, {classname:"codeLabel_label_", disable:true, position:"absolute", bWithoutRecordInSession:true});
    }
    this.img.onclick = function () {
        oThis.searchWindow.setCodeObject(oThis, oThis.submitOnload);
        oThis.searchWindow.setVisible(true);
    };
    if (this.url) {
        this.remote = new rialto.io.AjaxRequest({url:this.url, method:"get", callBackObjectOnSuccess:this, withWaitWindow:true, onSuccess:this.refreshPermissiveValue});
    }
    this.code.onblur = function () {
        if (oThis.code.getValue() != "") {
            if (this.wchanged) {
                oThis.checkValue();
            }
        } else {
            if (oThis.withLabel) {
                oThis.label.setValue("");
            }
        }
    };
    this.attach(parent);
};
rialto.widget.codeLabel = rialto.widget.CodeLabel;
rialto.widget.CodeLabel.prototype = new rialto.widget.AbstractComponent;
rialto.widget.CodeLabel.prototype.adaptToContext = function () {
    var sizeImg = this.img.getOffsetWidth();
    if (this.withLabel) {
        this.label.setLeft(this.codeWidth + sizeImg);
        this.label.setWidth(this.width - (this.codeWidth + sizeImg));
    } else {
        this.codeWidth = this.width - sizeImg;
        this.code.setWidth(this.codeWidth);
    }
    this.img.setLeft(this.codeWidth);
};
rialto.widget.CodeLabel.prototype.release = function () {
    this.code.remove();
    this.img.remove();
    if (this.withLabel) {
        this.label.remove();
    }
};
rialto.widget.CodeLabel.prototype.checkValue = function () {
    if ((this.url && this.alwaysRefresh) || (this.url && !this.dataLoadOnce)) {
        var pars = this.name + "=" + this.getValue();
        this.remote.load(pars);
    } else {
        this.checkInPermissiveValue();
    }
};
rialto.widget.CodeLabel.prototype.setSearchWindow = function (object) {
    this.searchWindow = object;
};
rialto.widget.CodeLabel.prototype.setdefaultSearchWindow = function (object) {
    rialto.widget.CodeLabel.prototype.searchWindow = object;
};
rialto.widget.CodeLabel.prototype.checkInPermissiveValue = function () {
    if (this.getValue() == "") {
        if (this.withLabel) {
            this.label.setValue("");
            return;
        }
    }
    var ind = this.indexOf(this.getValue());
    if (ind != -1) {
        if (this.withLabel) {
            this.label.setValue(this.arrPermValue[ind][1]);
        }
        this.code.removeAsRequired();
    } else {
        if (this.withLabel) {
            this.label.setValue("?");
        }
        info = new rialto.widget.Alert(rialto.I18N.getLabel("lanInvalidCode"));
        this.code.showAsRequired();
        this.code.setFocus();
    }
};
rialto.widget.CodeLabel.prototype.indexOf = function (obj) {
    for (var i = 0; i < this.arrPermValue.length; i++) {
        if (this.arrPermValue[i][0] == obj) {
            return i;
        }
    }
    return -1;
};
rialto.widget.CodeLabel.prototype.setPermissiveValue = function (arrPermValue) {
    this.arrPermValue = arrPermValue;
};
rialto.widget.CodeLabel.prototype.getValue = function () {
    return this.code.getValue();
};
rialto.widget.CodeLabel.prototype.isLabelNotEmpty = function () {
    if (this.withLabel) {
        return (this.label.getValue() != "");
    }
    return false;
};
rialto.widget.CodeLabel.prototype.setValue = function (code, libelle) {
    this.code.setValue(code);
    if (this.withLabel) {
        this.label.setValue(libelle);
    }
    if (code != "") {
        this.code.removeAsRequired();
    }
};
rialto.widget.CodeLabel.prototype.refreshPermissiveValue = function (request) {
    var res = eval(request.responseText);
    this.setPermissiveValue(res);
    this.checkInPermissiveValue();
    this.dataLoadOnce = true;
};
rialto.widget.CodeLabel.prototype.setEnable = function (enable) {
    if (enable) {
        if (this.withLabel) {
            this.label.champs.className = "codeLabel_label";
        }
    }
    if (this.withLabel) {
        this.label.setEnable(enable);
    }
    this.code.setEnable(enable);
    this.img.setEnable(enable);
    this.enable = enable;
};
rialto.widget.searchWindow = function () {
};
rialto.widget.searchWindow.prototype = {setVisible:function (visible) {
    this.fen.setVisible(visible);
}, setCodeObject:function (refParent, submitOnload) {
    rialto.session.reccord(this, this.id);
    var oThis = this;
    this.refParent = refParent;
    this.fen = new rialto.widget.PopUp("fen", 50, 200, 420, 410, "", rialto.I18N.getLabel("lanHelpButton"), "transparent");
    this.fen.setVisible(false);
    this.CADRE1 = new rialto.widget.Frame({name:"CADRE1", top:10, left:10, width:375, height:45, title:rialto.I18N.getLabel("lanCodeFind"), dynamic:false, open:true, parent:this.fen});
    var url = this.refParent.url;
    var obj = {boolWithFenWait:true, callBackObjectOnSuccess:this, onSuccess:this.refreshData};
    this.FORM1 = new rialto.widget.Form("FORM1", url, this.CADRE1, obj);
    var oParent = this.FORM1;
    this.CODE = new rialto.widget.Text(refParent.name, 10, 5, 260, "A", oParent, {position:"absolute"});
    this.BRECH = new rialto.widget.Button(11, 270, rialto.I18N.getLabel("lanFindButton"), rialto.I18N.getLabel("lanFindButton"), oParent);
    this.BRECH.onclick = function () {
        if ((oThis.refParent.url && oThis.refParent.alwaysRefresh) || (oThis.refParent.url && !oThis.refParent.dataLoadOnce)) {
            oThis.FORM1.submitForm();
        } else {
            oThis.arrPermValue = oThis.refParent.arrPermValue;
            oThis.checkInPermissiveValue();
        }
    };
    tabEntete = [rialto.I18N.getLabel("lanCodeHeader"), rialto.I18N.getLabel("lanLabelHeader")];
    tabTypeCol = [["string", 85], ["string", 205]];
    this.tableauRes = new rialto.widget.Grid({TabEntete:tabEntete, name:"TabRvMvt", top:65, left:10, height:310, bNavig:false, rang:12, tabTypeCol:tabTypeCol, objPar:{autoWidth:true}, parent:this.fen});
    this.tableauRes.onclick = function (indLigne, indCell) {
        oThis.code = this.tabData[indLigne][0];
        oThis.lib = this.tabData[indLigne][1];
    };
    this.tableauRes.ondbleclick = function (indLigne, indCell) {
        var code = this.tabData[indLigne][0];
        var lib = this.tabData[indLigne][1];
        oThis.refParent.setValue(code, lib);
        oThis.fen.closeWindow();
    };
    this.BENTR = new rialto.widget.Button(385, 170, rialto.I18N.getLabel("lanSelectButtonText"), rialto.I18N.getLabel("lanSelectButtonText"), this.fen);
    this.BENTR.onclick = function () {
        oThis.refParent.setValue(oThis.code, oThis.lib);
        oThis.fen.closeWindow();
    };
    if (submitOnload) {
        this.BRECH.onclick();
    }
}, checkInPermissiveValue:function () {
    var text = this.CODE.getValue();
    var arr = new Array;
    if (text == "") {
        arr = this.refParent.arrPermValue;
    } else {
        for (var i = 0; i < this.refParent.arrPermValue.length; i++) {
            for (var j = 0; j < this.refParent.arrPermValue[i].length; j++) {
                if (this.refParent.arrPermValue[i][j].indexOf(text) != -1) {
                    arr.push(this.refParent.arrPermValue[i]);
                    j = this.refParent.arrPermValue[i].length;
                }
            }
        }
    }
    if (arr.length == 0) {
        info = new rialto.widget.Alert(rialto.I18N.getLabel("lanNoCodeFind"));
    }
    this.tableauRes.fillGrid(arr);
}, refreshData:function (request) {
    var res = eval(request.responseText);
    this.arrPermValue = res;
    this.tableauRes.fillGrid(this.arrPermValue);
    this.refParent.arrPermValue = this.arrPermValue;
    this.refParent.dataLoadOnce = true;
}};
rialto.widget.CodeLabel.prototype.searchWindow = new rialto.widget.searchWindow();


rialto.widget.Calendar = function (objPar) {
    if (!objPar) {
        var objPar = {};
    }
    objPar.type = "calendar";
    this.base = rialto.widget.AbstractComponent;
    this.base(objPar);
    this.dateMin = null;
    this.dateMax = null;
    this.pattern = rialto.config.datePattern;
    this.popUpMode = false;
    this.hasSetfrenchCloseDay = false;
    this.arrDay = new Array(31);
    this.currentDate = rialto.date.today();
    if (rialto.lang.isDate(objPar.dateMin)) {
        this.dateMin = objPar.dateMin;
    }
    if (rialto.lang.isDate(objPar.dateMax)) {
        this.dateMax = objPar.dateMax;
        if (this.dateMin && this.dateMax < this.dateMin) {
            var d = this.dateMin;
            this.dateMin = this.dateMax;
            this.dateMax = d;
        }
    }
    if (rialto.lang.isDate(objPar.currentDate)) {
        this.currentDate = objPar.currentDate;
    }
    if (rialto.lang.isBoolean(objPar.popUpMode)) {
        this.popUpMode = objPar.popUpMode;
    }
    if (objPar.pattern) {
        this.pattern = objPar.pattern;
    }
    this._SpecialDate = new Array;
    this._initHolidays = {1:{1:true}, 2:{}, 3:{}, 4:{}, 5:{1:true, 8:true}, 6:{}, 7:{14:true}, 8:{15:true}, 9:{}, 10:{}, 11:{1:true}, 12:{25:true}};
    this._Holidays = this._initHolidays;
    this.setCurrent();
    this.createCalendar(objPar.parent);
    objPar = null;
};
rialto.widget.Calendar.prototype = new rialto.widget.AbstractComponent;
rialto.widget.Calendar.prototype._Month = rialto.I18N.getLabel("lanCalendarMonths");
rialto.widget.Calendar.prototype._Day = rialto.I18N.getLabel("lanCalendarDays");
rialto.widget.Calendar.prototype._LastDayInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
rialto.widget.Calendar.prototype.isDate = function (wDate) {
    return (wDate instanceof Date);
};
rialto.widget.Calendar.prototype.isHolidays = function (d, m) {
    return this._Holidays[m][d];
};
rialto.widget.Calendar.prototype.addHoliday = function (d, m) {
    this._Holidays[m][d] = true;
};
rialto.widget.Calendar.prototype.removeHoliday = function (d, m) {
    this._Holidays[m][d] = false;
};
rialto.widget.Calendar.prototype.isWeekEnd = function (jwe) {
    return ((jwe == 5) || (jwe == 6));
};
rialto.widget.Calendar.prototype.isToday = function (day) {
    var date1 = new Date(this.currentYear, this.currentMonth, day);
    return rialto.date.equals(date1, rialto.date.today());
};
rialto.widget.Calendar.prototype.isDisable = function (day) {
    var dTest = new Date(this.currentYear, this.currentMonth, day);
    if (rialto.lang.isDate(this.dateMin) && dTest < this.dateMin) {
        return true;
    }
    if (rialto.lang.isDate(this.dateMax) && dTest > this.dateMax) {
        return true;
    }
    return false;
};
rialto.widget.Calendar.prototype.setDateMin = function (nDateMin) {
    if (rialto.lang.isDate(nDateMin)) {
        this.dateMin = nDateMin;
    } else {
        this.dateMin = null;
    }
};
rialto.widget.Calendar.prototype.setDateMax = function (nDateMax) {
    if (rialto.lang.isDate(nDateMax)) {
        this.dateMax = nDateMax;
        if (this.dateMin && this.dateMax < this.dateMin) {
            var d = this.dateMin;
            this.dateMin = this.dateMax;
            this.dateMax = d;
        }
    } else {
        this.dateMax = null;
    }
};
rialto.widget.Calendar.prototype.isPaques = function (pan) {
    this._Holidays = this._initHolidays;
    this.hasSetfrenchCloseDay = true;
    var mois;
    var b = pan - 1900;
    var c = pan % 19;
    var d = Math.floor((7 * c + 1) / 19);
    var e = (11 * c + 4 - d) % 29;
    var f = Math.floor(b / 4);
    var g = (b + f + 31 - e) % 7;
    var date = 25 - e - g;
    if (date > 0) {
        mois = 4;
    } else {
        date = 31 + date;
        mois = 3;
    }
    this._Holidays[mois][date] = true;
    date += 1;
    if ((date > 31) && (mois = 3)) {
        date = 1;
        mois += 1;
    }
    this._Holidays[mois][date] = true;
    date += 38;
    while (date > 31) {
        var tt = 0;
        date -= this._LastDayInMonth[mois - 1 + tt];
        tt++;
        mois += 1;
    }
    this._Holidays[mois][date] = true;
    date += 10;
    while (date > 31) {
        var tt = 0;
        date -= this._LastDayInMonth[mois - 1 + tt];
        mois += 1;
    }
    this._Holidays[mois][date] = true;
};
rialto.widget.Calendar.prototype.setCurrent = function () {
    this.currentDay = this.currentDate.getDate();
    this.currentMonth = this.currentDate.getMonth();
    this.currentYear = this.currentDate.getFullYear();
};
rialto.widget.Calendar.prototype.setSpecialDate = function (date, color, text) {
    this._SpecialDate.push([date, color, text]);
};
rialto.widget.Calendar.prototype.removeSpecialDate = function () {
    this._SpecialDate = new Array;
};
rialto.widget.Calendar.prototype.isInSpecialDate = function (date) {
    for (var i = 0; i < this._SpecialDate.length; i++) {
        if (rialto.lang.isDate(this._SpecialDate[i][0])) {
            if (rialto.date.equals(this._SpecialDate[i][0], date)) {
                return i;
            }
        } else {
            var inter = this._SpecialDate[i][0];
            if (date >= inter[0] && date <= inter[1]) {
                return i;
            }
        }
    }
    return -1;
};
rialto.widget.Calendar.prototype.setMonthYear = function (m, a) {
    if (m > 11) {
        m = 0;
        a++;
    }
    if (m < 0) {
        m = 11;
        a--;
    }
    this.currentMonth = m;
    if (a != this.currentYear) {
        this.currentYear = a;
        this.hasSetfrenchCloseDay = false;
    }
    this.draw();
};
rialto.widget.Calendar.prototype.displayCalendar = function (top, left) {
    this.setCurrent();
    this.draw();
    if (this.popUpMode) {
        this.liste.setPosTop(top);
        this.liste.setPosLeft(left);
        this.liste.affichezoneMenu();
    }
};
rialto.widget.Calendar.prototype.createCalendar = function (parent) {
    var oThis = this;
    this.divExt.id = "divExt" + this.name;
    this.divExt.style.position = "absolute";
    this.divExt.style.width = "200px";
    this.divExt.style.height = "135px";
    this.divExt.onclick = function (e) {
        if (!e) {
            e = window.event;
        }
        stopEvent(e);
    };
    var oParent = this.divExt;
    var divDeco = new rialto.widget.decoration("popup", oParent);
    this.header = document.createElement("DIV");
    this.header.style.width = "100%";
    this.header.style.height = "30px";
    this.header.style.position = "absolute";
    this.header.style.top = 0;
    this.header.style.left = 0;
    this.divExt.appendChild(this.header);
    oParent = this.header;
    this.btnPreviousYear = new rialto.widget.Image("btonFirstDoctOff", 5, 5, oParent, rialto.I18N.getLabel("lanPreviousYear"), "btonFirstDoctOn", {position:"absolute", bWithoutRecordInSession:true});
    this.btnPreviousYear.onclick = function () {
        oThis.setMonthYear(oThis.currentMonth, oThis.currentYear - 1);
    };
    this.btnPreviousMonth = new rialto.widget.Image("tab_leftArrowOff", 25, 5, oParent, rialto.I18N.getLabel("lanPreviousMonth"), "tab_leftArrowOn", {position:"absolute", bWithoutRecordInSession:true});
    this.btnPreviousMonth.onclick = function () {
        oThis.setMonthYear(oThis.currentMonth - 1, oThis.currentYear);
    };
    this.currentMonthYear = document.createElement("DIV");
    this.currentMonthYear.className = this.getCssRuleName("calendar_current_month");
    this.header.appendChild(this.currentMonthYear);
    this.btnNextMonth = new rialto.widget.Image("tab_rightArrowOff", 143, 5, oParent, rialto.I18N.getLabel("lanNextMonth"), "tab_rightArrowOn", {position:"absolute", bWithoutRecordInSession:true});
    this.btnNextMonth.onclick = function () {
        oThis.setMonthYear(oThis.currentMonth + 1, oThis.currentYear);
    };
    this.btnNextYear = new rialto.widget.Image("btonLastDoctOff", 160, 5, oParent, rialto.I18N.getLabel("lanNextYear"), "btonLastDoctOn", {position:"absolute", bWithoutRecordInSession:true});
    this.btnNextYear.onclick = function () {
        oThis.setMonthYear(oThis.currentMonth, oThis.currentYear + 1);
    };
    if (this.popUpMode) {
        this.btnClose = new rialto.widget.Image("btonFenFermOff", 175, 5, oParent, rialto.I18N.getLabel("lanCloseButtonText"), "btonFenFermOn", {bWithoutRecordInSession:true});
        this.btnClose.onclick = function () {
            oThis.closeCalendar();
        };
    }
    for (var j = 0; j < 7; j++) {
        var LibelleCelluleCalendar = document.createElement("DIV");
        LibelleCelluleCalendar.id = "calendar_day_of_week";
        LibelleCelluleCalendar.className = this.getCssRuleName("calendar_day_of_week");
        LibelleCelluleCalendar.style.left = (5 + (j * 25)) + "px";
        this.header.appendChild(LibelleCelluleCalendar);
        LibelleCelluleCalendar.innerHTML = this._Day[j];
    }
    this.zoneCalendar = document.createElement("DIV");
    this.zoneCalendar.style.width = "100%";
    this.zoneCalendar.style.position = "absolute";
    this.zoneCalendar.style.top = 50;
    this.zoneCalendar.style.left = 0;
    this.divExt.appendChild(this.zoneCalendar);
    if (this.popUpMode) {
        var obj = {name:"MENU-CALENDAR", posFixe:true, bWithoutRecordInSession:true};
        this.liste = new rialto.widget.simpleMenu(obj);
        this.liste.add(this.divExt);
    } else {
        if (parent) {
            this.divExt.style.top = this.top;
            this.divExt.style.left = this.left;
            this.attach(parent);
            this.draw();
        }
    }
};
rialto.widget.Calendar.prototype.afterOnClick = function (day, oHtml) {
    this.currentDate = new Date(this.currentYear, this.currentMonth, day);
    var clickDay = day < 10 ? "0" + day : day;
    var clickMonth = this.currentMonth + 1 < 10 ? "0" + (this.currentMonth + 1) : this.currentMonth + 1;
    var clickYear = this.currentYear;
    if (this.clickDiv) {
        this.setSytleOfOneDay(this.clickDiv);
    }
    if (oHtml) {
        this.setSytleOfOneDay(oHtml);
    }
    var strDate = rialto.date.formatDate(this.currentDate, this.pattern);
    this.onclick(strDate);
    if (this.popUpMode) {
        this.closeCalendar();
    }
};
rialto.widget.Calendar.prototype.onclick = function (strDate) {
};
rialto.widget.Calendar.prototype.closeCalendar = function () {
    if (this.popUpMode) {
        this.liste.fermezoneMenu();
    }
};
rialto.widget.Calendar.prototype.clearCalendarArea = function () {
    for (i = 0; i < this.arrDay.length; i++) {
        if (this.arrDay[i]) {
            this.arrDay[i].onclick = null;
            this.arrDay[i] = null;
        }
    }
    this.arrDay = new Array;
    this.zoneCalendar.innerHTML = "";
};
rialto.widget.Calendar.prototype.fillCalendar = function () {
    rialto.deprecated("Calendar", "fillCalendar", "draw()");
    this.draw();
};
rialto.widget.Calendar.prototype.draw = function () {
    var oThis = this;
    this.clearCalendarArea();
    var text = this._Month[this.currentMonth] + " " + this.currentYear;
    this.currentMonthYear.innerHTML = text;
    this.firstDay = new Date(this.currentYear, this.currentMonth).getDay() - 1;
    if (this.firstDay < 0) {
        this.firstDay = 6;
    }
    if (rialto.date.isBissextile(this.currentYear)) {
        this._LastDayInMonth[1] = 29;
    } else {
        this._LastDayInMonth[1] = 28;
    }
    if (!this.hasSetfrenchCloseDay) {
        this.isPaques(this.currentYear);
    }
    var nbCol = Math.ceil((this.firstDay + this._LastDayInMonth[this.currentMonth]) / 7);
    if (nbCol > 5) {
        this.divExt.style.height = 150;
    } else {
        this.divExt.style.height = 135;
    }
    var oThis = this;
    for (var s = 0; s < nbCol; s++) {
        for (var j = 0; j < 7; j++) {
            var day = 7 * s + j - this.firstDay + 1;
            var oneDay = document.createElement("DIV");
            oneDay.style.left = (5 + (j * 25)) + "px";
            oneDay.style.top = (s * 15) + "px";
            oneDay.jw = j;
            oneDay.jM = day;
            this.setSytleOfOneDay(oneDay);
            this.zoneCalendar.appendChild(oneDay);
            if (day > 0 && day <= this._LastDayInMonth[this.currentMonth]) {
                oneDay.innerHTML = day;
                this.arrDay[day] = oneDay;
                oneDay.onclick = function () {
                    oThis.afterOnClick(this.jM, this);
                };
                if (day == this._LastDayInMonth[this.currentMonth]) {
                    break;
                }
            }
        }
    }
};
rialto.widget.Calendar.prototype.setSytleOfOneDay = function (oneDay) {
    var day = oneDay.jM;
    var s = oneDay.style;
    oneDay.className = this.getCssRuleName("calendar_default_day");
    if (day > 0) {
        if (this.isDisable(day)) {
            oneDay.className += " " + this.getCssRuleName("calendar_disable_day");
        } else {
            var date1 = new Date(this.currentYear, this.currentMonth, day);
            if (this.isWeekEnd(oneDay.jw)) {
                oneDay.className += " " + this.getCssRuleName("calendar_weekend_day");
            }
            if (this.isHolidays(day, this.currentMonth + 1)) {
                oneDay.className += " " + this.getCssRuleName("calendar_holidays_day");
            }
            if (this.isToday(day)) {
                oneDay.className += " " + this.getCssRuleName("calendar_today_day");
            }
            if (rialto.date.equals(date1, this.currentDate)) {
                this.clickDiv = oneDay;
                oneDay.className += " " + this.getCssRuleName("calendar_select_day");
            }
            var ind = this.isInSpecialDate(date1);
            if (ind != -1) {
                s.backgroundColor = this._SpecialDate[ind][1];
                oneDay.title = this._SpecialDate[ind][2];
            }
        }
    }
};
rialto.widget.Calendar.prototype.release = function () {
    this.divExt.onclick = null;
    this.clearCalendarArea();
    this.btnPreviousYear.remove();
    this.btnPreviousMonth.remove();
    this.btnNextMonth.remove();
    this.btnNextYear.remove();
    if (this.popUpMode) {
        this.liste.remove();
        this.btnClose.remove();
    }
};


rialto.widget.Grid = function (objPar) {
    if (!objPar) {
        return;
    }
    this.base = rialto.widget.AbstractComponent;
    objPar.type = "grid";
    this.base(objPar);
    this.WIDTHSEP = 3;
    this.navigation = false;
    this.tabData = new Array();
    this.arrHeader = new Array();
    if (rialto.lang.isArray(objPar.arrHeader)) {
        this.arrHeader = objPar.arrHeader;
    } else {
        if (objPar.TabEntete) {
            rialto.deprecated("GRID", "objPar.TabEntete and tabTypeCol", "objPar.arrHeader");
            for (var i = 0; i < objPar.TabEntete.length; i++) {
                var type = "string";
                var width = 100;
                var val = null;
                if (objPar.tabTypeCol) {
                    var type = objPar.tabTypeCol[i][0];
                    var width = objPar.tabTypeCol[i][1];
                    if (objPar.tabTypeCol[i].length == 3) {
                        var val = objPar.tabTypeCol[i][2];
                    }
                }
                this.arrHeader.push({title:objPar.TabEntete[i], type:type, width:width, values:val});
            }
        }
    }
    this.tabEntete = objPar.TabEntete;
    this.nbRow = this.arrHeader.length;
    this.nbLine = 0;
    this.row = 15;
    this.cellActive = false;
    this.sortable = true;
    this.multiSelect = false;
    this.lineHeight = 16;
    this.boolPrint = true;
    this.switchable = true;
    this.clickable = true;
    this.printTitle = rialto.I18N.getLabel("lanPrintTableHeadline");
    this.writable = false;
    this.withContextualMenu = false;
    this.widthLastCell = 20;
    this.initWidthLastCell = 20;
    this.indLineClic = -1;
    this.indCellClic = -1;
    this.asynchLoad = false;
    this.debInd = 0;
    this.finInd = 0;
    this.setUp(objPar);
    this.idInt = 0;
    this.mapArray = new Array;
    this.width = ((this.nbRow) * parseInt(this.WIDTHSEP)) + 36 + this.widthLastCell;
    for (var i = 0; i < this.nbRow; i++) {
        this.width += this.arrHeader[i].width;
        this.arrHeader[i].visible = true;
    }
    this.widthMin = this.width;
    this.widthMax = this.width;
    this.initWithCol = new Array();
    for (var i = 0; i < this.nbRow; i++) {
        this.initWithCol[i] = this.arrHeader[i].width;
    }
    var line, cell;
    var oThis = this;
    this.divExt.id = this.id + "_divExt";
    this.divExt.style.top = this.top;
    this.divExt.style.left = this.left;
    this.divExt.style.width = this.width + "px";
    this.divExt.style.position = this.position;
    if (this.switchable || this.navigation) {
        this.Div_nav = document.createElement("DIV");
        this.Div_nav.id = this.id + "_Div_nav";
        this.Div_nav.className = this.getCssRuleName("grid_navigationArea");
        this.Div_nav.style.display = "none";
        this.arrG = new rialto.widget.Image(this.getCssRuleName("grid_leftEdgeRoundDashBoard"), 0, 1, this.Div_nav, "", "", {position:"absolute"});
        this.arrD = new rialto.widget.Image(this.getCssRuleName("grid_rightEdgeRoundDashBoard"), 255, 1, this.Div_nav, "", "", {position:"absolute"});
        this.Div_navBoutTexte = document.createElement("DIV");
        this.Div_navBoutTexte.id = this.id + "_Div_nav";
        this.Div_navBoutTexte.className = this.getCssRuleName("grid_navigationTextArea");
        this.Div_nav.appendChild(this.Div_navBoutTexte);
        var Parent = this.Div_navBoutTexte;
        this.bouFirst = new rialto.widget.Image("btonFirstDoctOff", 0, 5, Parent, this.row + rialto.I18N.getLabel("lanGridButtonFirst"), "btonFirstDoctOn", {position:"absolute"});
        this.bouFirst.onclick = function () {
            oThis.firstN();
        };
        this.bouFirst.setVisible(false);
        this.boutPrevious = new rialto.widget.Image("btonPrevDoctOff", 20, 5, Parent, this.row + rialto.I18N.getLabel("lanGridButtonPrevious"), "btonPrevDoctOn", {position:"absolute"});
        this.boutPrevious.onclick = function () {
            oThis.previousN();
        };
        this.boutPrevious.setVisible(false);
        this.Div_text = document.createElement("DIV");
        this.Div_text.className = this.getCssRuleName("grid_divText");
        this.Div_text.id = this.id + "_Div_text";
        this.Div_navBoutTexte.appendChild(this.Div_text);
        this.boutNext = new rialto.widget.Image("btonNextDoctOff", 190, 5, Parent, this.row + rialto.I18N.getLabel("lanGridButtonNext"), "btonNextDoctOn", {position:"absolute"});
        this.boutNext.onclick = function () {
            oThis.nextN();
        };
        this.boutNext.setVisible(false);
        this.boutLast = new rialto.widget.Image("btonLastDoctOff", 210, 5, Parent, this.row + rialto.I18N.getLabel("lanGridButtonLast"), "btonLastDoctOn", {position:"absolute"});
        this.boutLast.onclick = function () {
            oThis.lastN();
        };
        this.boutLast.setVisible(false);
        if (this.navigation) {
            this.Div_nav.style.display = "block";
        }
        this.divExt.appendChild(this.Div_nav);
    }
    this.divHeader = document.createElement("DIV");
    this.divHeader.className = this.getCssRuleName("grid_header");
    this.divHeader.style.width = "100%";
    this.divHeader.position = "relative";
    this.divExt.appendChild(this.divHeader);
    this.divData = document.createElement("DIV");
    this.divData.className = this.getCssRuleName("grid_data");
    this.divData.style.width = "100%";
    this.divData.style.fontSize = "0";
    this.divData.style.overflow = "auto";
    this.divData.position = "relative";
    this.arrowUp = document.createElement("DIV");
    this.arrowUp.className = this.getCssRuleName("grid_arrowUp");
    this.arrowDown = document.createElement("DIV");
    this.arrowDown.className = this.getCssRuleName("grid_arrowDown");
    this.divCoche = document.createElement("DIV");
    this.divCoche.className = this.getCssRuleName("grid_imgSel");
    this.cellSep = document.createElement("DIV");
    this.cellSep.className = this.getCssRuleName("grid_cellSep");
    var line = document.createElement("DIV");
    line.style.height = "100%";
    var cell = document.createElement("DIV");
    cell.className = this.getCssRuleName("grid_header_left_img");
    line.appendChild(cell);
    this.oRia = this;
    this.heightVisibleCol = function () {
        var temp = Math.min(parseInt(this.oRia.getRealHeight()), parseInt(this.oRia.divExt.offsetHeight) - (this.oRia.navigation ? getComputStyle(this.oRia.Div_nav, "height") : 0));
        return temp;
    };
    for (var j = 0; j < this.nbRow; j++) {
        cell = document.createElement("DIV");
        cell.id = this.id + "_CellEntete_" + j;
        cell.className = this.getCssRuleName("grid_header_cell");
        cell.style.width = this.arrHeader[j].width + "px";
        cell.ind = j;
        var div = document.createElement("DIV");
        div.className = this.getCssRuleName("grid_header_cell_text");
        div.appendChild(document.createTextNode(this.arrHeader[j].title));
        div.title = this.arrHeader[j].title;
        div.ind = j;
        cell.appendChild(div);
        line.appendChild(cell);
        if (this.sortable) {
            cell.onclick = function () {
                oThis.sortColumn(this.ind);
                if (oThis.asynchLoad) {
                    oThis.startAjaxIndicator("50%", "50%");
                    oThis.setAjaxIndicator("big_ajax_i");
                    window.setTimeout("rialto.session.objects['" + oThis.id + "'].refreshGrid();rialto.session.objects['" + oThis.id + "'].stopAjaxIndicator()", 300);
                } else {
                    oThis.refreshGrid();
                }
            };
        }
        var cellSep = this.cellSep.cloneNode(true);
        line.appendChild(cellSep);
        cellSep.oRia = this;
        rialto.widgetBehavior.affect(cellSep, "DragAndDrop", {ghost:{aspect:"rect", asChild:false, top:0, height:"this.oRia.heightVisibleCol()"}, bSelectMark:false, isWithLimitsDisplayed:false, movingLimits:{orientation:"h", rectLim:{left:"parseInt(this.previousSibling.firstChild.offsetLeft)" + " + 12 + parseInt(this.previousSibling.offsetLeft)", right:"parseInt(this.parentNode.offsetWidth)-20"}}});
        cellSep.synchroDDMup = function (mod, posI) {
            if (!oThis.isAddingLine) {
                var c = this.previousSibling;
                c.style.width = Math.max(10, parseInt(c.style.width) + mod.left);
                oThis.reDimColTabData(c.ind, mod.left);
            }
        };
    }
    this.DerCell = document.createElement("DIV");
    this.DerCell.id = this.id + "_Cell" + j;
    this.DerCell.className = this.getCssRuleName("grid_header_cell");
    this.DerCell.style.width = this.widthLastCell;
    line.appendChild(this.DerCell);
    var cell = document.createElement("DIV");
    cell.className = this.getCssRuleName("grid_header_right_img");
    cell.type = "cell";
    line.appendChild(cell);
    this.divHeader.appendChild(line);
    if (this.switchable) {
        var ind = this.divHeader.childNodes[0].childNodes.length - 1;
        this.divHeader.childNodes[0].childNodes[ind].style.display = "none";
        this.DerCell.style.width = parseInt(this.DerCell.style.width) + 8;
        this.imgBascule = new rialto.widget.Image(rialtoConfig.buildImageURL("images/imgTableau/bt_bascul_off.gif"), 8, 0, this.DerCell, rialto.I18N.getLabel("lanGridSwitchButton"), rialtoConfig.buildImageURL("images/imgTableau/bt_bascul_on.gif"), {position:"absolute"});
        this.imgBascule.onclick = function () {
            oThis.switchDisplayMode();
        };
    }
    this.divExt.appendChild(this.divData);
    if (objPar.parent) {
        this.attach(objPar.parent);
    }
    if (this.withContextualMenu) {
        this.menuContex = new objMenuCont("men1", 220);
        this.menuContex.createMenu(this.divExt);
        this.menuContex.add(rialto.I18N.getLabel("lanSelectButtonText"), false, false, false, rialtoConfig.buildImageURL("images/Entoure.gif"));
        this.menuContex.addSeparation();
        this.menuContex.add(rialto.I18N.getLabel("lanGridSwitchButton"), this.switchable, false, false, rialtoConfig.buildImageURL("images/imgTableau/bt_bascul_off.gif"));
        if (this.boolPrint) {
            this.menuContex.add(rialto.I18N.getLabel("lanPrintButtonText"), true, false, false, rialtoConfig.buildImageURL("images/imTreeview/icone_compte_rendu.gif"));
        }
        this.menuContex.addSeparation();
        for (var j = 0; j < this.nbRow; j++) {
            this.menuContex.add(this.arrHeader[j].title, true, false, false, rialtoConfig.buildImageURL("images/check.png"));
        }
        this.divExt.oncontextmenu = function (e) {
            oThis.menuContex.srcEvent = null;
            oThis.menuContex.inactiveItem(0);
            oThis.menuContex.afficheMenu(e);
        };
        this.menuContex.itemClickApplicatif = function (ind) {
            if (ind == 0) {
                if (oThis.menuContex.srcEvent != null) {
                    oThis.menuContex.srcEvent.onclick();
                }
                return true;
            }
            if (ind == 1) {
                oThis.switchDisplayMode();
                return true;
            }
            if (ind == 2 && oThis.boolPrint) {
                oThis.print();
                return true;
            }
            if (ind > 2 || (ind == 2 && !oThis.boolPrint)) {
                var del = 2;
                if (oThis.boolPrint) {
                    del = 3;
                }
                var i = ind - del;
                var visible = oThis.arrHeader[i].visible;
                oThis.setColumnVisible(!visible, i);
            }
        };
    }
};
rialto.widget.Grid.prototype = new rialto.widget.AbstractComponent;
rialto.widget.Grid.prototype.baseSetVisible = rialto.widget.AbstractComponent.prototype.setVisible;
rialto.widget.Grid.prototype.setVisible = function (visible) {
    this.baseSetVisible(visible);
    this.updateSize();
};
rialto.widget.Grid.prototype.setUp = function (objPar) {
    if (rialto.lang.isBoolean(objPar.bNavig)) {
        rialto.deprecated("GRID", "objPar.bNavig", "objPar.navigationMode");
        this.setNavigationMode(objPar.bNavig);
    }
    if (rialto.lang.isBoolean(objPar.navigationMode)) {
        this.setNavigationMode(objPar.navigationMode);
    }
    if (rialto.lang.isBoolean(objPar.cellActive)) {
        this.cellActive = objPar.cellActive;
    }
    if (rialto.lang.isBoolean(objPar.sortable)) {
        this.sortable = objPar.sortable;
    }
    if (rialto.lang.isBoolean(objPar.multiSelect)) {
        this.setMultiSelect(objPar.multiSelect);
    }
    if (rialto.lang.isNumber(objPar.lineHeight)) {
        this.lineHeight = objPar.lineHeight;
    }
    if (rialto.lang.isNumber(objPar.row)) {
        this.setRow(objPar.row);
    }
    if (rialto.lang.isNumber(objPar.rang)) {
        rialto.deprecated("GRID", "objPar.rang", "objPar.row");
        this.setRow(objPar.rang);
    }
    if (rialto.lang.isNumber(objPar.widthLastCell)) {
        this.widthLastCell = objPar.widthLastCell;
    }
    if (rialto.lang.isBoolean(objPar.actifClic)) {
        rialto.deprecated("GRID", "objPar.actifClic", "objPar.clickable");
        this.setClickable(objPar.actifClic);
    }
    if (rialto.lang.isBoolean(objPar.clickable)) {
        this.setClickable(objPar.clickable);
    }
    if (rialto.lang.isBoolean(objPar.boolPrint)) {
        this.boolPrint = objPar.boolPrint;
    }
    if (rialto.lang.isBoolean(objPar.asynchLoad)) {
        this.asynchLoad = objPar.asynchLoad;
    }
    if (rialto.lang.isBoolean(objPar.switchable)) {
        this.switchable = objPar.switchable;
    }
    if (rialto.lang.isString(objPar.printTitle)) {
        this.printTitle = objPar.printTitle;
    }
    if (rialto.lang.isBoolean(objPar.autoResizeContenu)) {
        this.autoResizeContenu = objPar.autoResizeContenu;
    }
    if (rialto.lang.isBoolean(objPar.autoResizeParent)) {
        this.autoResizeParent = objPar.autoResizeParent;
        this.autoResizableH = this.autoResizeParent;
    }
    if (rialto.lang.isBoolean(objPar.writable)) {
        this.setWritable(objPar.writable);
    }
    if (rialto.lang.isBoolean(objPar.withContextualMenu)) {
        this.withContextualMenu = objPar.withContextualMenu;
    }
};
rialto.widget.Grid.prototype.setRow = function (row) {
    if (rialto.lang.isNumber(row)) {
        this.row = row;
    }
};
rialto.widget.Grid.prototype.getRow = function () {
    return this.row;
};
rialto.widget.Grid.prototype.getWritable = function () {
    return this.writable;
};
rialto.widget.Grid.prototype.setWritable = function (writable, arrW) {
    this.writable = writable;
    if (arrW) {
        this.writableCell = arrW;
    }
    this.lineHeight = Math.max(20, parseInt(this.lineHeight));
};
rialto.widget.Grid.prototype.getClickable = function () {
    return this.clickable;
};
rialto.widget.Grid.prototype.setClickable = function (clickable, arrW) {
    this.clickable = clickable;
};
rialto.widget.Grid.prototype.getMultiSelect = function () {
    return this.multiSelect;
};
rialto.widget.Grid.prototype.setMultiSelect = function (multiSelect, arrW) {
    this.multiSelect = multiSelect;
};
rialto.widget.Grid.prototype.setNavigationMode = function (navigation) {
    if (rialto.lang.isBoolean(navigation)) {
        this.navigation = navigation;
    }
};
rialto.widget.Grid.prototype.isNavigationMode = function () {
    return this.navigation;
};
rialto.widget.Grid.prototype._cellHeaderClick = function (e) {
    var srcCell = ria.utils.event.srcTarget(e);
    this.sortColumn(srcCell.ind);
    this.refreshGrid();
};
rialto.widget.Grid.prototype.onmouseover = function () {
};
rialto.widget.Grid.prototype.onmouseout = function () {
};
rialto.widget.Grid.prototype.getTabData = function () {
    return this.tabData;
};
rialto.widget.Grid.prototype.print = function () {
    var widthGlobal = document.body.clientWidth;
    var heightGlobal = document.body.clientHeight;
    this.fenImp = window.open(rialtoConfig.pathRialtoE + "printTab.html", "IMPRESSION", "height=" + heightGlobal + ",width=" + widthGlobal + ",top=0,left=0,scrollbars,resizable,toolbar,menubar");
    this.rempFenImp();
};
rialto.widget.Grid.prototype.rempFenImp = function () {
    if (this.fenImp.rempPage) {
        var obj = this.getInfoPrint();
        this.fenImp.rempPage(obj);
    } else {
        window.setTimeout("rialto.session.objects[\"" + this.id + "\"].rempFenImp()", 50);
    }
};
rialto.widget.Grid.prototype.getInfoPrint = function () {
    var obj = new Object;
    obj.strEntete = new String;
    var tabHead = new Array;
    for (var i = 0; i < this.nbRow; i++) {
        tabHead.push(this.arrHeader[i].title);
    }
    obj.strEntete = tabHead.join("$");
    obj.tabEntete = tabHead;
    obj.strEntete = rialto.string.formatHTTP(obj.strEntete);
    obj.titre = this.printTitle;
    obj.NBCOL = this.nbRow;
    obj.nbLine = this.nbLine;
    obj.tabData = this.tabData;
    return obj;
};
rialto.widget.Grid.prototype.setWidth = function () {
    return;
};
rialto.widget.Grid.prototype.adaptToContext = function () {
    this.updateSize();
};
rialto.widget.Grid.prototype.adaptAfterContainerChange = function () {
    this.adaptToContext();
};
rialto.widget.Grid.prototype.setColumnVisible = function (visible, indexColumn) {
    var display = visible ? "block" : "none";
    var del = 0;
    if (this.boolPrint) {
        del = 1;
    }
    this.arrHeader[indexColumn].visible = visible;
    if (this.withContextualMenu) {
        var img = visible ? "images/check.png" : "images/cross.png";
        this.menuContex.changeImg(indexColumn + 2 + del, rialtoConfig.buildImageURL(img));
    }
    var celE = document.getElementById(this.id + "_CellEntete_" + indexColumn);
    celE.style.display = display;
    celE.nextSibling.style.display = display;
    if (visible) {
        if (this.arrHeader[indexColumn].width == 0) {
            var modDim = this.initWithCol[indexColumn];
        } else {
            return;
        }
    } else {
        var modDim = -this.arrHeader[indexColumn].width;
    }
    this.reDimColTabData(indexColumn, modDim);
    for (var i = this.debInd; i < this.finInd; i++) {
        var cell = this.getHtmlCellFromIndex(i, indexColumn);
        cell.style.display = display;
        cell.nextSibling.style.display = display;
    }
};
rialto.widget.Grid.prototype.reDimColTabData = function (indCol, delta) {
    this.arrHeader[indCol].width += delta;
    var nW = parseInt(this.divExt.style.width) + delta;
    this.divExt.style.width = nW + "px";
    for (var i = this.debInd; i < this.finInd; i++) {
        var line = this.getHtmlLineFromIndex(i);
        line.style.width = parseInt(line.style.width) + delta;
        var cell = this.getHtmlCellFromIndex(i, indCol);
        cell.style.width = parseInt(cell.style.width) + delta;
    }
    if (this.autoResizableW) {
        if (delta < 0) {
            if (nW > this.widthMax) {
                this.widthLastCell = 20;
                this.width = nW;
            } else {
                if (this.width <= this.widthMax) {
                    this.widthLastCell -= delta;
                } else {
                    this.width = this.widthMax;
                    this.widthLastCell += (this.widthMax - nW);
                }
            }
        } else {
            if (this.width <= this.widthMax) {
                var lastCellMarge = this.widthLastCell - 20;
                var deltaL = this.widthLastCell - delta;
                this.widthLastCell = Math.max(20, deltaL);
                if (delta > lastCellMarge) {
                    var delta = delta - lastCellMarge;
                    this.width = parseInt(this.width) + delta;
                }
            } else {
                this.widthLastCell = 20;
                this.width = nW;
            }
        }
        this._applyDeltaWidth();
    } else {
        this.widthLastCell = 20;
        this.width = nW;
    }
    if (this.navigation) {
        ria.utils.measures.$centerW(this.Div_nav);
    }
};
rialto.widget.Grid.prototype.initSize = function (delta) {
    if (this.autoResizableW) {
        this.updateWidth();
    } else {
        this.divExt.style.width = this.width;
    }
    if (this.autoResizableH) {
        this.updateHeight();
    } else {
        this.divExt.style.height = this.height;
        ria.utils.measures.$setHeightWithAllAvailable(this.divData);
    }
    if (this.navigation) {
        ria.utils.measures.$centerW(this.Div_nav);
    }
};
rialto.widget.Grid.prototype.updateSize = function (delta) {
    if (this.visible) {
        this.updateHeight();
        this.updateWidth();
        this.oldHeight = this.divExt.offsetHeight;
        this.oldWidth = this.divExt.offsetWidth;
    }
};
rialto.widget.Grid.prototype.updateHeight = function () {
    if (this.visible) {
        if (this.autoResizableH) {
            this.divExt.style.overflow = "hidden";
            ria.utils.measures.$setHeightWithAllAvailable(this.divExt);
            ria.utils.measures.$setHeightWithAllAvailable(this.divData);
            this.row = Math.floor(parseInt(this.divData.style.height) / this.lineHeight);
            if (this.navigation && this.tabData.length > 0) {
                this.debInd = 0;
                this.finInd = Math.min(this.debInd + this.row, this.nbLine);
                this.refreshGrid();
            }
            this.divExt.style.overflow = "";
        } else {
            if (!this.autoResizeContenu) {
                this.divExt.style.height = this.height;
                ria.utils.measures.$setHeightWithAllAvailable(this.divData);
            } else {
                this.resizeContenu();
            }
        }
    }
};
rialto.widget.Grid.prototype.updateWidth = function () {
    if (this.autoResizableW) {
        this.divExt.style.overflow = "hidden";
        this.widthMax = ria.utils.measures.$setWidthWithAllAvailable(this.divExt);
        var delta = this.widthMax - this.width;
        if (delta > 0) {
            this.width += delta;
            this.widthLastCell += delta;
        } else {
            if (this.widthMax > this.widthMin) {
                this.width += delta;
                this.widthLastCell += delta;
            } else {
                this.width = this.widthMin;
                this.widthLastCell = 20;
            }
        }
        if (delta != 0) {
            this._applyDeltaWidth();
        }
        this.divExt.style.overflow = "";
    } else {
        this.divExt.style.width = this.width;
    }
    if (this.navigation) {
        ria.utils.measures.$centerW(this.Div_nav);
    }
};
rialto.widget.Grid.prototype._applyDeltaWidth = function () {
    this.divExt.style.width = this.width;
    _rum.$setWidthConformW3C(this.divExt);
    this.divHeader.childNodes[0].style.width = this.width - 20;
    this.DerCell.style.width = this.widthLastCell;
    if (this.imgBascule) {
        this.imgBascule.setLeft(this.widthLastCell - 20);
    }
    for (var i = 0; i < this.divData.childNodes.length; i++) {
        var line = this.divData.childNodes[i];
        line.style.width = this.width - 20 + "px";
        ind = this.divData.childNodes[i].childNodes.length - 2;
        derCol = this.divData.childNodes[i].childNodes[ind];
        derCol.style.width = this.widthLastCell;
    }
};
rialto.widget.Grid.prototype.resizeContenu = function () {
    if (this.autoResizeContenu) {
        var tailleR = this.getRealHeight();
        if (tailleR < parseInt(this.height)) {
            var tailleNavig = 0;
            if (this.navigation) {
                tailleNavig = this.Div_nav.offsetHeight;
            }
            this.divExt.style.height = tailleR + tailleNavig;
        } else {
            this.divExt.style.height = this.height;
        }
        ria.utils.measures.$setHeightWithAllAvailable(this.divData);
        this.resizeFatherAndBrother();
    }
};
rialto.widget.Grid.prototype.getRealHeight = function () {
    return (this.lineHeight * this.nbLine) + this.divHeader.offsetHeight;
};
rialto.widget.Grid.prototype.switchDisplayMode = function () {
    if (this.switchable) {
        if (this.navigation) {
            this.Div_nav.style.display = "none";
        } else {
            this.Div_nav.style.display = "block";
            ria.utils.measures.$centerW(this.Div_nav);
        }
        this.updateHeight();
        this.navigation = !this.navigation;
        if (this.tabData.length > 0) {
            this.debInd = 0;
            if (!this.navigation) {
                this.finInd = this.nbLine;
            } else {
                this.finInd = Math.min(this.row, this.nbLine);
            }
            this.refreshGrid();
        }
    }
};
rialto.widget.Grid.prototype.setText = function (text) {
    this.Div_text.innerHTML = text;
};
rialto.widget.Grid.prototype.getLineIndex = function (node) {
    var indL = -1;
    tab = node.id.split("_");
    if (this.isCell(node)) {
        var idInt = tab[tab.length - 2];
        indL = this.mapArray[idInt];
    } else {
        if (this.isLine(node)) {
            var idInt = tab[tab.length - 1];
            indL = this.mapArray[idInt];
        }
    }
    return indL;
};
rialto.widget.Grid.prototype.getCellIndex = function (node) {
    tab = node.id.split("_");
    if (this.isCell(node)) {
        return tab[tab.length - 1];
    }
    return -1;
};
rialto.widget.Grid.prototype.getColumnIndex = function (name) {
    for (var i = 0; i < this.nbRow; i++) {
        if (this.arrHeader[i].title == name) {
            return i;
        }
    }
    return -1;
};
rialto.widget.Grid.prototype.getHtmlLineFromIndex = function (indL) {
    var node = null;
    var idInt = rialto.array.indexOf(this.mapArray, indL);
    if (idInt != -1) {
        node = document.getElementById(this.id + "_LineTab_" + idInt);
    }
    return node;
};
rialto.widget.Grid.prototype.getHtmlCellFromIndex = function (indL, indC) {
    var node = null;
    var idInt = rialto.array.indexOf(this.mapArray, indL);
    if (idInt != -1) {
        node = document.getElementById(this.id + "_CellTab_" + idInt + "_" + indC);
    }
    return node;
};
rialto.widget.Grid.prototype.isLine = function (node) {
    return (node.id.indexOf(this.id + "_LineTab_") != -1);
};
rialto.widget.Grid.prototype.isCell = function (node) {
    return (node.id.indexOf(this.id + "_CellTab_") != -1);
};
rialto.widget.Grid.prototype.deleteLines = function (titre, withoutRestoreIndex) {
    if (!withoutRestoreIndex) {
        this.debInd = 0;
        this.finInd = 0;
        this.indLineClic = -1;
        this.idInt = 0;
    }
    var dataLines = this.divData.childNodes;
    while (dataLines.length > 0) {
        this.deleteJSRef(dataLines[0]);
        this.divData.removeChild(dataLines[0]);
    }
    if (this.navigation) {
        this.setText(titre);
        this.bouFirst.setVisible(false);
        this.boutPrevious.setVisible(false);
        this.boutNext.setVisible(false);
        this.boutLast.setVisible(false);
    }
};
rialto.widget.Grid.prototype.deleteData = function () {
    this.deleteLines();
    this.tabData = new Array;
    this.mapArray = new Array;
};
rialto.widget.Grid.prototype.deleteJSRef = function (dataLine) {
    if (dataLine.img) {
        dataLine.img.onclick = null;
        dataLine.img = null;
    }
    dataLine.onmouseout = null;
    dataLine.onmouseover = null;
    for (var colIdx = 0; colIdx < dataLine.childNodes.length; colIdx++) {
        var dataItem = dataLine.childNodes[colIdx];
        dataItem.onclick = null;
        dataItem.oncontextmenu = null;
        dataItem.ondblclick = null;
        dataItem.onmouseout = null;
        dataItem.onmouseover = null;
        dataItem.onkeypress = null;
    }
};
rialto.widget.Grid.prototype.deleteOneLine = function (indL) {
    if (indL == this.indLineClic) {
        this.deselNode(indL);
    } else {
        if (this.indLineClic > indL) {
            this.indLineClic -= 1;
        }
    }
    this.tabData.splice(indL, 1);
    this.nbLine -= 1;
    var line = this.getHtmlLineFromIndex(indL);
    if (line) {
        if (this.navigation) {
            if (this.finInd == (this.nbLine + 1)) {
                this.finInd -= 1;
            }
            this.refreshGrid();
        } else {
            this.finInd -= 1;
            this.deleteJSRef(line);
            this.divData.removeChild(line);
            var idInt = rialto.array.indexOf(this.mapArray, indL);
            if (idInt != -1) {
                this.mapArray[idInt] = null;
            }
            this.refreshMapArray(indL, -1);
        }
    }
};
rialto.widget.Grid.prototype.initTab = function () {
    this.deleteLines();
    this.tabData = new Array;
};
rialto.widget.Grid.prototype.findLine = function (col, valCol) {
    var ret = -1;
    var trouve = false;
    var i = 0;
    var val;
    while (i < this.nbLine && !trouve) {
        val = this.tabData[i][col];
        if (val == valCol) {
            ret = i;
            trouve = true;
        } else {
            i++;
        }
    }
    return ret;
};
rialto.widget.Grid.prototype.fillGridWithData = function (TabData, ind, boolOrder) {
    var tabForm = new Array;
    for (var i = 0; i < this.nbRow; i++) {
        tabForm[i] = this._getCellFormatter(null, i);
    }
    var tabValue = new Array;
    for (var i = 0; i < TabData.length; i++) {
        var ar = new Array;
        for (var j = 0; j < TabData[i].length; j++) {
            var val = TabData[i][j];
            if (tabForm[j]) {
                val = tabForm[j].format(val);
            }
            ar.push(val);
        }
        tabValue.push(ar);
    }
    this.fillGrid(tabValue, ind, boolOrder);
};
rialto.widget.Grid.prototype.fillGrid = function (TabData, ind, boolOrder) {
    this.nbLine = TabData.length;
    if (this.nbLine >= 100 && this.switchable && !this.navigation) {
        this.switchDisplayMode();
    }
    this.tabData = new Array();
    this.tabData = (this.tabData.concat(TabData));
    this.deleteLines();
    this.indLineClic = -1;
    this.oldColCLic = null;
    for (var i = 0; i < this.nbLine; i++) {
        this.initLine(i);
    }
    this.debInd = 0;
    if (!this.navigation) {
        this.finInd = this.nbLine;
    } else {
        this.finInd = Math.min(this.row, this.nbLine);
    }
    if (this.sortable) {
        if (!ind) {
            ind = 0;
        }
        this.sortColumn(ind, boolOrder);
    }
    if (this.asynchLoad) {
        this.startAjaxIndicator("50%", "50%");
        this.setAjaxIndicator("big_ajax_i");
        window.setTimeout("rialto.session.objects['" + this.id + "'].refreshGrid();rialto.session.objects['" + this.id + "'].stopAjaxIndicator();rialto.session.objects['" + this.id + "'].onfill();", 300);
    } else {
        this.refreshGrid();
    }
    if (this.autoResizeContenu) {
        this.resizeContenu();
    }
};
rialto.widget.Grid.prototype.initLine = function (ind) {
    this.tabData[ind].sel = false;
    this.tabData[ind].sTexte = null;
    var cellProp = new Array;
    for (var j = 0; j < this.nbRow + 1; j++) {
        cellProp[j] = {sel:false, objPar:null, obStyle:null, tabValue:null};
        if (typeof this.tabData[ind][j] == "object") {
            var obj = this.tabData[ind][j];
            cellProp[j].tabValue = obj.authValue;
            this.tabData[ind][j] = obj.value;
        }
    }
    this.tabData[ind].cellProp = cellProp;
};
rialto.widget.Grid.prototype.refreshGrid = function () {
    var debInd = this.debInd;
    var finInd = this.finInd;
    var indLineClic = this.indLineClic;
    this.deleteLines();
    this.debInd = debInd;
    this.finInd = finInd;
    this.indLineClic = indLineClic;
    this.idInt = 0;
    this.mapArray = new Array;
    if (this.navigation) {
        this.majZoneNavigation();
    }
    var tabINNERHTML = new Array();
    for (var i = this.debInd; i < this.finInd; i++) {
        tabINNERHTML.push(this.addLineWithINNER(i));
    }
    this.divData.innerHTML = tabINNERHTML.join("");
    this.updateLineCell();
};
rialto.widget.Grid.prototype.onfill = function () {
};
rialto.widget.Grid.prototype.addLineWithINNER = function (i) {
    var idL = this.id + "_LineTab_" + this.idInt;
    var prefIdC = this.id + "_CellTab_" + this.idInt + "_";
    this.mapArray[this.idInt++] = i;
    var tabTemp = new Array();
    if (i % 2 == 1) {
        var type = "1";
    } else {
        var type = "2";
    }
    tabTemp.push("<DIV ID=\"" + idL + "\" style=\"width:" + (this.width - 20) + "px;height:" + this.lineHeight + "px;\" class=\"" + this.getCssRuleName("grid_line" + type) + "\">");
    tabTemp.push("<DIV type=\"cell\" class=\"" + this.getCssRuleName("grid_cellDecL" + type) + "\"></DIV>");
    for (var j = 0; j < this.nbRow; j++) {
        idC = prefIdC + j;
        tabTemp.push("<DIV ID=\"" + idC + "\" style=\"width:" + this.arrHeader[j].width + "px;\" class=\"" + this.getCssRuleName("grid_cellData") + "\"><DIV title=\"" + this.tabData[i][j] + "\" class=\"" + this.getCssRuleName("grid_textData_" + this.arrHeader[j].type) + "\">" + this.tabData[i][j] + "</DIV></DIV>");
        tabTemp.push("<DIV class=\"" + this.getCssRuleName("grid_cellSep") + "\"></DIV>");
    }
    idC = this.id + "_CellTab_" + i + "_" + this.nbRow;
    tabTemp.push("<DIV  ID=\"" + idC + "\" class=\"" + this.getCssRuleName("grid_cellData") + "\" style=\"width:" + this.widthLastCell + "px;\"></DIV>");
    tabTemp.push("<DIV type=\"cell\" class=\"" + this.getCssRuleName("grid_cellDecR") + "" + type + "\"></DIV>");
    tabTemp.push("</DIV>");
    return tabTemp.join("");
};
rialto.widget.Grid.prototype.updateLineCell = function () {
    for (var i = 0; i < this.divData.childNodes.length; i++) {
        var line = this.divData.childNodes[i];
        this.updateOneLineCell(line);
    }
    for (var j = 0; j < this.nbRow; j++) {
        if (!this.arrHeader[j].visible) {
            this.setColumnVisible(false, j);
        }
    }
};
rialto.widget.Grid.prototype.updateOneLineCell = function (line) {
    var oThis = this;
    var indL = this.getLineIndex(line);
    line.sel = false;
    if (this.tabData[indL].sel) {
        this.selNode(indL, 0);
    }
    if (!this.cellActive) {
        line.onmouseout = function () {
            oThis.afterMouseout(this);
        };
        line.onmouseover = function () {
            oThis.afterMouseover(this);
        };
    }
    for (var j = 1; j < line.childNodes.length; j += 2) {
        var cell = line.childNodes[j];
        var indC = this.getCellIndex(cell);
        cell.sel = false;
        if (this.tabData[indL].cellProp[indC].objPar != null) {
            this.addObjectInCell(indL, indC, this.tabData[indL].cellProp[indC].objPar);
        }
        if (this.tabData[indL].cellProp[indC].sel) {
            this.selNode(indL, indC);
        }
        if (this.tabData[indL].cellProp[indC].obStyle != null) {
            var obStyle = this.tabData[indL].cellProp[indC].obStyle;
            this.setStyle(indL, indC, obStyle);
        }
        if (this.clickable) {
            cell.onclick = function () {
                oThis.afterOnClick(oThis.getLineIndex(this), oThis.getCellIndex(this), true);
            };
            if (this.withContextualMenu) {
                cell.oncontextmenu = function (e) {
                    var e = e ? e : window.event;
                    oThis.oncontextmenu(this, e);
                };
            }
            cell.ondblclick = function () {
                oThis.afterOnDbleClick(oThis.getLineIndex(this), oThis.getCellIndex(this), true);
            };
        }
        if (this.cellActive) {
            cell.onmouseout = function () {
                oThis.afterMouseout(this);
            };
            cell.onmouseover = function () {
                oThis.afterMouseover(this);
            };
        }
    }
};
rialto.widget.Grid.prototype.addOneLine = function (tabLine, hidden) {
    if (!this.tabData) {
        this.tabData = new Array;
    }
    var i = this.tabData.push(tabLine) - 1;
    this.nbLine += 1;
    this.initLine(i);
    if (this.navigation) {
        if (this.finInd == (this.nbLine - 1) || this.nbLine == 1) {
            this.lastN();
        } else {
            this.majZoneNavigation();
        }
    } else {
        this.finInd += 1;
        if (this.asynchLoad) {
            window.setTimeout("rialto.session.objects['" + this.id + "'].asynchCreateLine(" + i + "," + hidden + ")", 10 * this.finInd);
        } else {
            this.asynchCreateLine(i, hidden);
        }
    }
    return i;
};
rialto.widget.Grid.prototype.asynchCreateLine = function (i, hidden) {
    this.isAddingLine = true;
    var tabLine = this.tabData[i];
    var divLine = this.createOneLine(tabLine, i);
    if (hidden) {
        divLine.style.display = "none";
    }
    this.divData.appendChild(divLine);
    this.isAddingLine = false;
};
rialto.widget.Grid.prototype.insertOneLineBefore = function (tabLine, indexPreviousLine, hidden) {
    if (!this.tabData) {
        this.tabData = new Array;
    }
    if (indexPreviousLine >= this.tabData.length) {
        this.addOneLine(tabLine);
    } else {
        rialto.array.insert(this.tabData, indexPreviousLine, tabLine);
        if (this.indLineClic >= indexPreviousLine) {
            this.indLineClic += 1;
        }
        this.nbLine += 1;
        this.initLine(indexPreviousLine);
        if (this.navigation) {
            if (indexPreviousLine >= this.debInd && indexPreviousLine <= this.finInd) {
                this.refreshGrid();
            } else {
                if (indexPreviousLine < this.debInd) {
                    this.debInd += 1;
                    this.finInd += 1;
                }
                this.majZoneNavigation();
            }
        } else {
            this.finInd += 1;
            this.refreshMapArray(indexPreviousLine, 1);
            var divLine = this.createOneLine(tabLine, indexPreviousLine);
            if (hidden) {
                divLine.style.display = "none";
            }
            this.divData.insertBefore(divLine, this.divData.childNodes[indexPreviousLine]);
        }
    }
    return indexPreviousLine;
};
rialto.widget.Grid.prototype.refreshMapArray = function (fromIndex, shift) {
    for (var i = 0; i < this.mapArray.length; i++) {
        if (rialto.lang.isNumber(this.mapArray[i]) && this.mapArray[i] >= fromIndex) {
            this.mapArray[i] += shift;
        }
    }
};
rialto.widget.Grid.prototype.createOneLine = function (tabLine, indexLine) {
    var oThis = this;
    var idL = this.id + "_LineTab_" + this.idInt;
    var prefIdC = this.id + "_CellTab_" + this.idInt + "_";
    this.mapArray[this.idInt++] = indexLine;
    if (indexLine % 2 == 1) {
        var type = "1";
    } else {
        var type = "2";
    }
    var divLigne = document.createElement("DIV");
    divLigne.id = idL;
    divLigne.className = this.getCssRuleName("grid_line" + type);
    divLigne.style.height = this.lineHeight + "px";
    divLigne.style.width = this.width - 20 + "px";
    var divCellDec = document.createElement("DIV");
    divCellDec.className = this.getCssRuleName("grid_cellDecL" + type);
    divLigne.appendChild(divCellDec);
    for (var j = 0; j < this.nbRow; j++) {
        var type = this.arrHeader[j].type;
        var display = this.arrHeader[j].visible ? "block" : "none";
        var divCell = document.createElement("DIV");
        divCell.id = prefIdC + j;
        divCell.style.display = display;
        divCell.className = this.getCssRuleName("grid_cellData");
        divCell.style.width = this.arrHeader[j].width + "px";
        divCell.sel = false;
        var divText = document.createElement("DIV");
        divText.className = this.getCssRuleName("grid_textData_" + type);
        divText.title = this.tabData[indexLine][j];
        divText.appendChild(document.createTextNode(this.tabData[indexLine][j]));
        divCell.appendChild(divText);
        divLigne.appendChild(divCell);
        var divCellSep = document.createElement("DIV");
        divCellSep.className = this.getCssRuleName("grid_cellSep");
        divCellSep.style.display = display;
        divLigne.appendChild(divCellSep);
    }
    var divCell = document.createElement("DIV");
    divCell.id = prefIdC + this.nbRow;
    divCell.className = this.getCssRuleName("grid_cellData");
    divCell.style.width = this.widthLastCell + "px";
    divLigne.appendChild(divCell);
    divCellDec = document.createElement("DIV");
    divCellDec.className = this.getCssRuleName("grid_cellDecR" + type);
    divLigne.appendChild(divCellDec);
    this.updateOneLineCell(divLigne);
    return divLigne;
};
rialto.widget.Grid.prototype.majZoneNavigation = function () {
    if (this.row < this.nbLine) {
        var text = (this.debInd + 1) + "-" + (this.finInd) + " (total:" + (this.nbLine) + ")";
        if (!this.bouFirst.visible) {
            this.bouFirst.setVisible(true);
            this.boutPrevious.setVisible(true);
            this.boutNext.setVisible(true);
            this.boutLast.setVisible(true);
        }
        this.bouFirst.setText(this.row + rialto.I18N.getLabel("lanGridButtonFirst"));
        this.boutPrevious.setText(this.row + rialto.I18N.getLabel("lanGridButtonPrevious"));
        this.boutNext.setText(this.row + rialto.I18N.getLabel("lanGridButtonNext"));
        this.boutLast.setText(this.row + rialto.I18N.getLabel("lanGridButtonLast"));
    } else {
        var text = "1-" + this.nbLine;
        if (this.bouFirst.visible) {
            this.bouFirst.setVisible(false);
            this.boutPrevious.setVisible(false);
            this.boutNext.setVisible(false);
            this.boutLast.setVisible(false);
        }
    }
    this.setText(text);
};
rialto.widget.Grid.prototype.setCellText = function (indL, indC, text) {
    this.tabData[indL][indC] = text;
    var cell = this.getHtmlCellFromIndex(indL, indC);
    if (cell) {
        var i = 0;
        var divText = cell.childNodes[0];
        while (divText.className.indexOf("grid_textData_" + this.arrHeader[indC].type) == -1 && i < cell.childNodes.length) {
            i += 1;
            divText = cell.childNodes[i];
        }
        divText.innerHTML = text;
    }
};
rialto.widget.Grid.prototype.setCellToolTipText = function (indL, indC, text) {
    var cell = this.getHtmlCellFromIndex(indL, indC);
    if (cell) {
        var i = 0;
        var divText = cell.childNodes[0];
        while (divText.className.indexOf("grid_textData_" + this.arrHeader[indC].type) == -1 && i < cell.childNodes.length) {
            i += 1;
            divText = cell.childNodes[i];
        }
        divText.title = text;
    }
};
rialto.widget.Grid.prototype.getCellText = function (indL, indC) {
    return this.tabData[indL][indC];
};
rialto.widget.Grid.prototype.getCellData = function (indL, indC) {
    var text = this.getCellText(indL, indC);
    var formatter = this._getCellFormatter(indL, indC);
    if (formatter) {
        text = formatter.parse(text);
    }
    return text;
};
rialto.widget.Grid.prototype.setCellData = function (indL, indC, data) {
    var text = data;
    var formatter = this._getCellFormatter(indL, indC);
    if (formatter) {
        text = formatter.format(data);
    }
    this.setCellText(indL, indC, text);
};
rialto.widget.Grid.prototype.setStyle = function (indL, indC, obStyle) {
    if (indC != -1) {
        if (obStyle) {
            if (this.tabData[indL].cellProp[indC].obStyle != null) {
                oldObStyle = this.tabData[indL].cellProp[indC].obStyle;
                for (prop in oldObStyle) {
                    if (obStyle[prop] == null) {
                        obStyle[prop] = oldObStyle[prop];
                    }
                }
            }
            this.tabData[indL].cellProp[indC].obStyle = obStyle;
        } else {
            var obStyle = this.tabData[indL].cellProp[indC].obStyle;
        }
        var cell = this.getHtmlCellFromIndex(indL, indC);
        if (cell) {
            for (prop in obStyle) {
                try {
                    cell.style[prop] = obStyle[prop];
                }
                catch (erreur) {
                }
            }
        }
    } else {
        for (var j = 0; j < (this.nbRow + 1); j++) {
            this.setStyle(indL, j, obStyle);
        }
    }
};
rialto.widget.Grid.prototype.disableLine = function (indL, indC) {
    if (indC != -1) {
        var cell = this.getHtmlCellFromIndex(indL, indC);
        if (cell) {
            cell.onclick = function () {
            };
            cell.ondblclick = function () {
            };
            cell.onmouseover = function (e) {
                if (!e) {
                    e = window.event;
                }
                stopEvent(e);
            };
            cell.onmouseout = function (e) {
                if (!e) {
                    e = window.event;
                }
                stopEvent(e);
            };
        }
    } else {
        var line = this.getHtmlLineFromIndex(indL);
        if (line) {
            for (var j = 0; j < this.nbRow; j++) {
                var cell = document.getElementById(this.id + "_CellTab_" + indL + "_" + j);
                cell.onclick = function () {
                };
                cell.ondblclick = function () {
                };
            }
            line.onmouseover = function () {
            };
            line.onmouseout = function () {
            };
        }
    }
};
rialto.widget.Grid.prototype.addObjectInCell = function (indL, indC, objPar) {
    this.tabData[indL].cellProp[indC].objPar = objPar;
    var cell = this.getHtmlCellFromIndex(indL, indC);
    if (cell) {
        if (objPar.attach) {
            objPar.attach(cell);
        } else {
            cell.appendChild(objPar);
        }
    }
};
rialto.widget.Grid.prototype.removeObjectFromCell = function (indL, indC, objPar) {
    this.tabData[indL].cellProp[indC].objPar = null;
    var cell = this.getHtmlCellFromIndex(indL, indC);
    if (objPar.remove) {
        objPar.remove();
    } else {
        if (cell) {
            cell.removeChild(objPar);
        }
    }
};
rialto.widget.Grid.prototype.release = function () {
    if (this.text) {
        this.text.remove();
        this.text = null;
    }
    if (this.keypresshandler) {
        this.keypresshandler.remove();
        this.keypresshandler = null;
    }
    var titleLine = this.divHeader.childNodes[0];
    for (var colIdx = 0; colIdx < titleLine.childNodes.length; colIdx++) {
        var titleItem = titleLine.childNodes[colIdx];
        if (titleItem.dragAndDrop) {
            rialto.widgetBehavior.desaffect(titleItem, "DragAndDrop");
        }
        titleItem.onclick = null;
        titleItem = null;
    }
    this.deleteLines();
    if (this.Div_nav) {
        this.arrG.remove();
        this.arrD.remove();
        this.bouFirst.remove();
        this.boutPrevious.remove();
        this.boutNext.remove();
        this.boutLast.remove();
    }
    if (this.imgBascule) {
        this.imgBascule.remove();
    }
    if (this.withContextualMenu) {
        this.menuContex.remove();
        this.menuContex.itemClickApplicatif = null;
        this.menuContex = null;
        this.divExt.oncontextmenu = null;
    }
};
rialto.widget.Grid.prototype.nextN = function () {
    if (this.debInd + this.row < this.nbLine) {
        this.debInd += this.row;
        if (this.debInd + this.row <= this.nbLine) {
            this.finInd = this.debInd + this.row;
        } else {
            this.finInd = this.nbLine;
        }
        this.refreshGrid();
    }
};
rialto.widget.Grid.prototype.previousN = function () {
    if (this.debInd >= this.row) {
        this.finInd = this.debInd;
        this.debInd -= this.row;
        this.refreshGrid();
    }
};
rialto.widget.Grid.prototype.firstN = function () {
    this.debInd = 0;
    if (this.nbLine < this.row) {
        this.finInd = this.nbLine;
    } else {
        this.finInd = this.row;
    }
    this.refreshGrid();
};
rialto.widget.Grid.prototype.lastN = function () {
    if (this.nbLine >= this.row) {
        var reste = this.nbLine % this.row;
        if (reste != 0) {
            this.debInd = this.nbLine - reste;
        } else {
            this.debInd = this.nbLine - this.row;
        }
        this.finInd = this.nbLine;
        this.refreshGrid();
    }
};
rialto.widget.Grid.prototype.triColonne = function (ind, boolOrder) {
    rialto.deprecated("GRID", "triColonne", "sortColumn");
    this.sortColumn(ind, boolOrder);
};
rialto.widget.Grid.prototype.getSortColumn = function (ind, boolOrder) {
    var ind = -1;
    if (this.oldColCLic) {
        ind = this.oldColCLic.ind;
    }
    return ind;
};
rialto.widget.Grid.prototype.sortColumn = function (ind, boolOrder) {
    if (this.oldColCLic != null) {
        if (this.oldColCLic.ind == ind && boolOrder == null) {
            boolOrder = !this.oldColCLic.boolOrder;
        }
        var cell = document.getElementById(this.id + "_CellEntete_" + this.oldColCLic.ind);
        cell.removeChild(this.currentArrow);
    }
    var cell = document.getElementById(this.id + "_CellEntete_" + ind);
    var type = this.arrHeader[ind].type;
    this.tabData.sort(compareTwoColumns(ind, boolOrder, type));
    if (boolOrder) {
        this.currentArrow = this.arrowUp;
    } else {
        this.currentArrow = this.arrowDown;
    }
    cell.appendChild(this.currentArrow);
    this.oldColCLic = {ind:ind, boolOrder:boolOrder};
};
function compareTwoColumns(nCol, bDescending, sType) {
    var c = nCol;
    if (bDescending) {
        var triDesc = 1;
    } else {
        var triDesc = -1;
    }
    if (sType == "number") {
        return function (n1, n2) {
            return (parseInt(n1[c]) - parseInt(n2[c])) * triDesc;
        };
    }
    if (sType == "date") {
        return function (n1, n2) {
            var tab = n1[c].split("/");
            var date1 = new Date(tab[2], tab[1], tab[0]);
            tab = n2[c].split("/");
            var date2 = new Date(tab[2], tab[1], tab[0]);
            if (date1 >= date2) {
                return -1 * triDesc;
            }
            if (date2 > date1) {
                return 1 * triDesc;
            }
            return 0;
        };
    }
    if (sType == "string") {
        return function (n1, n2) {
            if (n1[c] >= n2[c]) {
                return -1 * triDesc;
            }
            if (n1[c] < n2[c]) {
                return 1 * triDesc;
            }
            return 0;
        };
    } else {
        return function (n1, n2) {
            if (n1[c] >= n2[c]) {
                return -1 * triDesc;
            }
            if (n1[c] < n2[c]) {
                return 1 * triDesc;
            }
            return 0;
        };
    }
}
rialto.widget.Grid.prototype.afterMouseover = function (node) {
    if (!node.sel) {
        node.className += " " + this.getCssRuleName("grid_line_over");
        this.onmouseover(node);
    }
};
rialto.widget.Grid.prototype.afterMouseout = function (node) {
    if (!node.sel) {
        node.className = this.getInitClassName(node);
        if (this.isCell(node)) {
            var indL = this.getLineIndex(node);
            var indC = this.getCellIndex(node);
            if (this.tabData[indL].cellProp[indC].obStyle != null) {
                this.setStyle(indL, indC);
            }
        }
        this.onmouseout(node);
    }
};
rialto.widget.Grid.prototype.oncontextmenu = function (node, e) {
    this.menuContex.srcEvent = node;
    this.menuContex.activeItem(0);
    this.menuContex.afficheMenu(e);
};
rialto.widget.Grid.prototype.afterOnDbleClick = function (indLine, indCell) {
    if (this.multiSelect) {
        if (this.tabData[indLine].sel == false && this.tabData[indLine][indCell] == false) {
            this.selNode(indLine, indCell);
        }
    } else {
        if (this.indLineClic != -1 && (this.indLineClic != indLine || (this.indLineClic == indLine && this.indCellClic != indCell))) {
            this.deselNode(this.indLineClic, this.indCellClic);
            this.selNode(indLine, indCell);
        }
    }
    if (this.writable) {
        if (this.writableCell) {
            if (rialto.array.indexOf(this.writableCell, indCell) == -1) {
                return;
            }
        }
        var oThis = this;
        var node = this.getHtmlCellFromIndex(indLine, indCell);
        if (this.text) {
            this.text.remove();
            this.text = null;
        }
        if (this.keypresshandler) {
            this.keypresshandler.remove();
            this.keypresshandler = null;
        }
        this.text = this.getTextField(indLine, indCell);
        this.keypresshandler = new ria.utils.event.keyPressHandler(node);
        this.keypresshandler.setOnkeyDown();
        this.keypresshandler.setAscii([9]);
        this.keypresshandler.onkeyPress = function () {
            var keyCode = this.getKeyCode();
            if (keyCode == 9 || keyCode == 13 || keyCode == 27 || keyCode == 38 || keyCode == 40) {
                bDecalLine = false;
                bDecalCell = false;
                iDecal = 0;
                bReset = false;
                switch (keyCode) {
                  case 9:
                    iDecal = this.isShiftKey() ? -1 : 1;
                    bDecalCell = true;
                    break;
                  case 13:
                    break;
                  case 27:
                    bReset = true;
                    break;
                  case 38:
                    bDecalLine = true;
                    iDecal = -1;
                    break;
                  case 40:
                    bDecalLine = true;
                    iDecal = 1;
                    break;
                }
                oThis.afterCellEdit(bDecalLine, bDecalCell, iDecal, bReset);
                return false;
            } else {
                return true;
            }
        };
    }
    this.ondbleclick(indLine, indCell);
};
rialto.widget.Grid.prototype._getCellFormatter = function (indLine, indCell) {
    var formatter = null;
    if (this.formatter) {
        formatter = this.formatter;
    } else {
        var typeG = this.arrHeader[indCell].type;
        var formatter = new rialto.utils.Formatter({type:typeG});
        var p = this.arrHeader[indCell].pattern;
        if (p) {
            formatter.setPattern(p);
        }
        var p = this.arrHeader[indCell].maskPattern;
        if (p) {
            formatter.setMaskPattern(p);
        }
    }
    return formatter;
};
rialto.widget.Grid.prototype.getTextField = function (indLine, indCell) {
    var oThis = this;
    var node = this.getHtmlCellFromIndex(indLine, indCell);
    var text = null;
    var f = this._getCellFormatter(indLine, indCell);
    if (this.tabData[indLine].cellProp[indCell].tabValue || this.arrHeader[indCell].values) {
        var arr = this.tabData[indLine].cellProp[indCell].tabValue ? this.tabData[indLine].cellProp[indCell].tabValue : this.arrHeader[indCell].values;
        text = new rialto.widget.Combo(arr, "gridCombo", 0, 0, node.offsetWidth - 4, node, {suggest:false});
        text.setFormatter(f);
        text.selWithText(this.tabData[indLine][indCell]);
        text.setFocus();
    } else {
        if (this.arrHeader[indCell].type == "boolean") {
            text = new rialto.widget.Checkbox("gridCh", 0, 0, node, "", false);
            text.setFormatter(f);
            text.setWidth("100%");
            text.setStyle({backgroundColor:"white"});
            text.setCheck(f.parse(this.tabData[indLine][indCell]));
            text.onclick = function (e) {
                oThis.afterCellEdit(false, false, 0, false);
            };
        } else {
            if (this.arrHeader[indCell].type == "date") {
                var type = "D";
            } else {
                if (this.arrHeader[indCell].type == "number") {
                    var type = "N";
                } else {
                    if (this.arrHeader[indCell].type == "hour") {
                        var type = "H";
                    } else {
                        var type = "A";
                    }
                }
            }
            text = new rialto.widget.Text("Gridtext", 0, 0, node.offsetWidth - 4, type, node);
            text.setFormatter(f);
            text.setValue(this.tabData[indLine][indCell]);
            text.setFocus();
        }
    }
    text.indL = indLine;
    text.indC = indCell;
    return text;
};
rialto.widget.Grid.prototype.afterCellEdit = function (bDecalLine, bDecalCell, iDecal, bReset) {
    if (this.text._blur) {
        this.text.champs.blur();
        if (!this.text.blurOK) {
            return false;
        }
    }
    var indLine = this.text.indL;
    var indCell = this.text.indC;
    var oldVal = this.getCellText(indLine, indCell);
    var newVal;
    if (this.text.type == "checkbox") {
        newVal = this.text.formatter.format(this.text.isCheck());
    } else {
        newVal = this.text.getValue();
    }
    var bResetA = !this.onCellEdit(indLine, indCell, oldVal, newVal);
    if (!bReset && !bResetA) {
        this.setCellText(indLine, indCell, newVal);
        this.onCellWrite(indLine, indCell, newVal);
    }
    this.text.remove();
    this.text = null;
    var nouvCell = indCell;
    var nouvLine = indLine;
    var bOpenNextCell = false;
    if (bDecalCell) {
        bOpenNextCell = true;
        nouvCell = parseInt(indCell) + iDecal;
        if (nouvCell >= this.nbRow) {
            nouvCell = 0;
        } else {
            if (nouvCell < 0) {
                nouvCell = this.nbRow - 1;
            }
        }
    }
    if (bDecalLine) {
        bOpenNextCell = true;
        nouvLine = parseInt(indLine) + iDecal;
        if (nouvLine >= this.divData.childNodes.length) {
            nouvLine = 0;
        } else {
            if (nouvLine < 0) {
                nouvLine = this.divData.childNodes.length - 1;
            }
        }
    }
    if (bOpenNextCell) {
        this.afterOnDbleClick(nouvLine, nouvCell);
    }
};
rialto.widget.Grid.prototype.afterOnClick = function (indLine, indCell, boolAction) {
    if (this.text && (indLine != this.text.indL || indCell != this.text.indC)) {
        this.afterCellEdit(false, false, 0, false);
    }
    if (this.cellActive) {
        var node = this.getHtmlCellFromIndex(indLine, indCell);
    } else {
        var node = this.getHtmlLineFromIndex(indLine);
    }
    if (this.multiSelect) {
        if (node.sel) {
            this.deselNode(indLine, indCell);
            if (boolAction) {
                this.onunclick(indLine, indCell);
            }
        } else {
            this.selNode(indLine, indCell);
            if (boolAction) {
                this.onclick(indLine, indCell);
            }
        }
    } else {
        if (this.indLineClic != -1) {
            if ((!this.cellActive && this.indLineClic != indLine) || (this.cellActive && (this.indLineClic != indLine || (this.indLineClic == indLine && this.indCellClic != indCell)))) {
                this.deselNode(this.indLineClic, this.indCellClic);
                this.selNode(indLine, indCell);
                if (boolAction) {
                    this.onclick(indLine, indCell);
                }
            }
        } else {
            this.selNode(indLine, indCell);
            if (boolAction) {
                this.onclick(indLine, indCell);
            }
        }
    }
};
rialto.widget.Grid.prototype.selNode = function (indLine, indCell) {
    if (this.cellActive) {
        var node = this.getHtmlCellFromIndex(indLine, indCell);
    } else {
        var node = this.getHtmlLineFromIndex(indLine);
    }
    node.sel = true;
    if (this.isLine(node)) {
        var cellCoche = node.childNodes[1];
        this.tabData[indLine].sel = true;
    } else {
        var cellCoche = node;
        this.tabData[indLine].cellProp[indCell].sel = true;
    }
    var divCoche = this.divCoche.cloneNode(true);
    cellCoche.insertBefore(divCoche, cellCoche.firstChild);
    node.className = this.getInitClassName(node);
    node.className += " " + this.getCssRuleName("grid_line_sel");
    this.indLineClic = indLine;
    this.indCellClic = indCell;
};
rialto.widget.Grid.prototype.getInitClassName = function (node) {
    var tab = node.className.split(" ");
    return this.getCssRuleName(tab[0]);
};
rialto.widget.Grid.prototype.deselNode = function (indLine, indCell) {
    if (this.cellActive) {
        var node = this.getHtmlCellFromIndex(indLine, indCell);
    } else {
        var node = this.getHtmlLineFromIndex(indLine);
    }
    if (node) {
        node.sel = false;
        node.className = this.getInitClassName(node);
        if (this.isLine(node)) {
            var cellCoche = node.childNodes[1];
            for (var j = 0; j < this.nbRow; j++) {
                objS = this.tabData[indLine].cellProp[j].obStyle;
                if (objS != null) {
                    this.setStyle(indLine, j);
                }
            }
        } else {
            var cellCoche = node;
            objS = this.tabData[indLine].cellProp[indCell].obStyle;
            if (objS != null) {
                this.setStyle(indLine, indCell);
            }
        }
        if (cellCoche.childNodes.length > 0) {
            cellCoche.removeChild(cellCoche.firstChild);
        }
    }
    if (!this.cellActive) {
        this.tabData[indLine].sel = false;
    } else {
        this.tabData[indLine].cellProp[indCell].sel = false;
    }
    this.indLineClic = -1;
    this.indCellClic = -1;
};
rialto.widget.Grid.prototype.getIndLinesClic = function () {
    var arr = new Array;
    for (var i = 0; i < this.tabData.length; i++) {
        if (this.tabData[i].sel) {
            arr.push(i);
        }
    }
    return arr;
};
rialto.widget.Grid.prototype.getIndCellsClic = function () {
    var arr = new Array;
    for (var i = 0; i < this.tabData.length; i++) {
        for (var j = 0; j < this.tabData[i].length; j++) {
            if (this.tabData[i].cellProp[j].sel) {
                arr.push([i, j]);
            }
        }
    }
    return arr;
};
rialto.widget.Grid.prototype.getIndLineClic = function () {
    return this.indLineClic;
};
rialto.widget.Grid.prototype.getIndCellClic = function () {
    return this.indCellClic;
};
rialto.widget.Grid.prototype.unselectLine = function () {
    if (this.indLineClic != -1) {
        this.deselNode(this.indLineClic, this.indCellClic);
    }
};
rialto.widget.Grid.prototype.clickLine = function (indLine, indCell) {
    this.afterOnClick(indLine, indCell, true);
    this.divData.scrollTop = indLine * this.lineHeight;
};
rialto.widget.Grid.prototype.clickNext = function () {
    ind = parseInt(this.indLineClic) + 1;
    if (this.navigation) {
        if (ind >= this.finInd) {
            this.nextN();
        }
    } else {
        if (ind > this.nbLine - 1) {
            ind = 0;
        }
    }
    this.afterOnClick(ind, this.indCellClic, true);
};
rialto.widget.Grid.prototype.clickPrevious = function () {
    ind = parseInt(this.indLineClic) - 1;
    if (this.navigation) {
        if (ind < this.debInd) {
            this.previousN();
        }
    } else {
        if (ind < 0) {
            ind = this.nbLine - 1;
        }
    }
    this.afterOnClick(ind, this.indCellClic, true);
};
rialto.widget.Grid.prototype.clickLast = function () {
    if (this.navigation) {
        this.lastN();
    }
    this.afterOnClick(parseInt(this.nbLine) - 1, this.indCellClic, true);
};
rialto.widget.Grid.prototype.clickFirst = function () {
    if (this.navigation) {
        this.firstN();
    }
    this.afterOnClick(0, this.indCellClic, true);
};
rialto.widget.Grid.prototype.ondbleclick = function (indLine, indCell) {
};
rialto.widget.Grid.prototype.onclick = function (indLine, indCell) {
};
rialto.widget.Grid.prototype.onCellEdit = function (indLine, indCell, oldVal, newVal) {
    return true;
};
rialto.widget.Grid.prototype.onCellWrite = function (indLine, indCell, newVal) {
};
rialto.widget.Grid.prototype.onunclick = function (indLine, indCell) {
};


rialto.widget.GridTree = function (objPar) {
    objPar.type = "Gridtreeview";
    objPar.switchable = false;
    objPar.sortable = false;
    objPar.lineHeight = 23;
    objPar.bNavig = false;
    this.titleFirstCol = "";
    this.widthFirstCol = 220;
    if (rialto.lang.isNumber(objPar.widthFirstCol)) {
        this.widthFirstCol = objPar.widthFirstCol;
    }
    if (rialto.lang.isString(objPar.titleFirstCol)) {
        this.titleFirstCol = objPar.titleFirstCol;
    }
    this.childLines = new Array;
    if (objPar.TabEntete) {
        objPar.arrHeader = new Array;
        rialto.deprecated("GRIDTREE", "objPar.TabEntete and tabTypeCol", "objPar.arrHeader");
        for (var i = 0; i < objPar.TabEntete.length; i++) {
            var type = "string";
            var width = 100;
            var val = null;
            if (objPar.tabTypeCol) {
                var type = objPar.tabTypeCol[i][0];
                var width = objPar.tabTypeCol[i][1];
                if (objPar.tabTypeCol[i].length == 3) {
                    var val = objPar.tabTypeCol[i][2];
                }
            }
            objPar.arrHeader.push({title:objPar.TabEntete[i], type:type, width:width, values:val});
        }
    }
    rialto.array.insert(objPar.arrHeader, 0, {title:this.titleFirstCol, width:this.widthFirstCol, type:"string"});
    this.base = rialto.widget.Grid;
    this.base(objPar);
    this.type = "Gridtree";
    var oThis = this;
};
rialto.widget.GridTree.prototype = new rialto.widget.Grid;
rialto.widget.GridTree.prototype.getInfoPrint = function () {
    var obj = new Object;
    obj.strEntete = new String;
    var tabHead = new Array;
    for (var i = 0; i < this.nbRow; i++) {
        tabHead.push(this.arrHeader[i].title);
    }
    obj.tabEntete = tabHead;
    obj.strEntete = rialto.string.formatHTTP(obj.strEntete);
    obj.titre = this.titrePrint;
    obj.NBCOL = this.nbRow;
    obj.NbreLig = this.NbreLig;
    obj.tabData = new Array;
    for (var i = 0; i < this.tabData.length; i++) {
        var li = this.getHtmlLineFromIndex(i).oRia;
        if (li.text != "Loading...") {
            var ind = obj.tabData.push(rialto.array.copy(this.tabData[i])) - 1;
            obj.tabData[ind][0] = li.text;
        }
    }
    return obj;
};
rialto.widget.GridTree.prototype.addNodeLine = function (objPar) {
    objPar.parent = this;
    var lineNode = new rialto.widget.LineNode(objPar);
    return lineNode;
};
rialto.widget.GridTree.prototype.fillGrid = function (arrData) {
    var arrLineNodes = new Array();
    for (var i = 0; i < arrData.length; i++) {
        var wText = arrData[i][0];
        var wTabData = new Array;
        for (var j = 1; j < arrData[i].length; j++) {
            wTabData.push(arrData[i][j]);
        }
        var objPar = {text:wText, reload:true, icon:"", parentLine:null, tabData:wTabData};
        var lineNode = this.addNodeLine(objPar);
        arrLineNodes.push(lineNode);
    }
    return arrLineNodes;
};
rialto.widget.GridTree.prototype.baseDeleteOneLine = rialto.widget.Grid.prototype.deleteOneLine;
rialto.widget.GridTree.prototype.deleteOneLine = function (indL) {
    var dataLine = this.getHtmlLineFromIndex(indL);
    if (dataLine.oRia) {
        dataLine.oRia.remove(true);
    }
    this.baseDeleteOneLine(indL);
};
rialto.widget.GridTree.prototype.baseDeleteLines = rialto.widget.Grid.prototype.deleteLines;
rialto.widget.GridTree.prototype.deleteLines = function () {
    this.baseDeleteLines();
    this.childLines = new Array;
};
rialto.widget.GridTree.prototype.onrefreshline = function (line) {
};
rialto.widget.LineNode = function (objPar) {
    this.grid = objPar.parent;
    this.text = "node";
    this.open = true;
    this.reload = false;
    this.url = "";
    this.parentLine = null;
    this.tabData = null;
    this.iconParent = rialtoConfig.buildImageURL("images/imTreeview/pict_synthetik_off.gif");
    this.iconChild = rialtoConfig.buildImageURL("images/imTreeview/puce.gif");
    this.initIcon = null;
    this.name = "Linenode";
    this.typeInfo = "";
    this.type = "Linenode";
    if (rialto.lang.isString(objPar.icon, true)) {
        this.initIcon = rialtoConfig.buildImageURL(objPar.icon);
        this.iconParent = this.iconChild = this.initIcon;
    }
    if (rialto.lang.isString(objPar.name)) {
        this.name = objPar.name;
    }
    if (rialto.lang.isString(objPar.text)) {
        this.text = objPar.text;
    }
    if (rialto.lang.isArray(objPar.tabData)) {
        this.tabData = objPar.tabData;
    }
    if (rialto.lang.isBoolean(objPar.open)) {
        this.open = objPar.open;
    }
    if (objPar.parentLine) {
        this.parentLine = objPar.parentLine;
    }
    if (rialto.lang.isString(objPar.url, true)) {
        this.open = false;
        this.url = objPar.url;
        this.reload = true;
    }
    if (rialto.lang.isString(objPar.typeInfo)) {
        this.typeInfo = objPar.typeInfo;
    }
    this.childLines = new Array;
    if (!this.tabData) {
        this.tabData = new Array;
        for (var i = 0; i < this.grid.nbRow - 1; i++) {
            this.tabData.push("");
        }
    }
    rialto.array.insert(this.tabData, 0, "");
    if (this.parentLine) {
        var indL = this.parentLine.addLine(this);
    } else {
        this.depth = 1;
        var indL = this.grid.addOneLine(this.tabData);
        this.root = true;
        this.grid.childLines.push(this);
    }
    this.htmlGridLine = this.grid.getHtmlLineFromIndex(indL);
    this.htmlGridLine.oRia = this;
    var parent = this.htmlGridLine.childNodes[1];
    parent.style.overflow = "hidden";
    parent.ondblclick = function (e) {
        if (!e) {
            e = window.event;
        }
        if (this.onclick) {
            this.onclick(e);
        }
        oThis.toogle();
    };
    var shift = this.depth * 20;
    this.img1 = document.createElement("DIV");
    this.img1.className = "treenode_img";
    this.img1.style.top = 0;
    this.img1.style.left = shift;
    this.img1.style.backgroundImage = "url('" + rialtoConfig.buildImageURL("images/imTreeview/icT/plus.gif") + "')";
    this.img1.style.visibility = "hidden";
    parent.appendChild(this.img1);
    this.img2 = document.createElement("DIV");
    this.img2.className = "treenode_img";
    this.img2.style.top = 0;
    this.img2.style.left = shift + 20;
    this.img2.style.backgroundImage = "url('" + this.iconChild + "')";
    parent.appendChild(this.img2);
    this.divText = document.createElement("DIV");
    this.divText.className = "treenode_divText";
    this.divText.style.left = shift + 40;
    this.divText.appendChild(document.createTextNode(this.text));
    this.divText.title = this.text;
    parent.appendChild(this.divText);
    var oThis = this;
    this.img1.onclick = function (e) {
        if (!e) {
            e = window.event;
        }
        oThis.toogle();
        stopEvent(e);
    };
    this.divText.onclick = function () {
        oThis.onclick();
    };
    if (this.reload) {
        this.lineReload = new rialto.widget.LineNode({open:false, text:"Loading...", icon:"images/imTreeview/find.small.gif", parentLine:this, parent:this.grid});
    }
    if (objPar.objStyle) {
        this.grid.setStyle(this.getHtmlInd(), -1, objPar.objStyle);
    }
    objPar = null;
};
rialto.widget.LineNode.prototype.onclick = function () {
};
rialto.widget.LineNode.prototype.reloadNode = function (url) {
    this.remote = new rialto.io.AjaxRequest({url:url, callBackObjectOnSuccess:this, onSuccess:this.refreshReloadNode});
    this.remote.load("NODE=" + this.name);
    if (!this.open) {
        this.toggle();
    }
};
rialto.widget.LineNode.prototype.refreshReloadNode = function (request) {
    try {
        this.reload = false;
        this.lineReload.remove();
        var colNode = eval("(" + request.responseText + ")");
        for (var i = 0; i < colNode.arrNode.length; i++) {
            var obj = colNode.arrNode[i].objPar;
            obj.parentLine = this;
            obj.parent = this.grid;
            var node = new rialto.widget.LineNode(obj);
        }
        this.grid.onrefreshline(this);
    }
    catch (e) {
        alert(e.message);
    }
};
rialto.widget.LineNode.prototype.setIcon = function () {
    var src;
    if (this.hasChild()) {
        this.img1.style.visibility = "visible";
        this.img2.style.backgroundImage = "url('" + this.iconParent + "')";
        if (this.open) {
            src = rialtoConfig.buildImageURL("images/imTreeview/icT/minus.gif");
        } else {
            src = rialtoConfig.buildImageURL("images/imTreeview/icT/plus.gif");
        }
        this.img1.style.backgroundImage = "url('" + src + "')";
    } else {
        this.img1.style.visibility = "hidden";
        this.img2.style.backgroundImage = "url('" + this.iconChild + "')";
    }
};
rialto.widget.LineNode.prototype.toogle = function (line) {
    if (this.hasChild()) {
        this.open = !this.open;
        this.displayChilds(this.open);
        this.setIcon();
        if (this.reload) {
            this.reloadNode(this.url);
        }
    }
};
rialto.widget.LineNode.prototype.displayChilds = function (isVisible) {
    for (var i = 0; i < this.childLines.length; i++) {
        var lineNode = this.childLines[i];
        var htmlLine = lineNode.htmlGridLine;
        if (isVisible && this.open) {
            htmlLine.style.display = "block";
        } else {
            htmlLine.style.display = "none";
        }
        lineNode.displayChilds(isVisible);
    }
};
rialto.widget.LineNode.prototype.setText = function (sText) {
    this.text = sText;
    this.divText.removeChild(this.divText.firstChild);
    this.divText.appendChild(document.createTextNode(this.text));
};
rialto.widget.LineNode.prototype.isGridLastLine = function () {
    var status = false;
    var testLine = this;
    var lastLine = this.grid.divData.lastChild;
    while (testLine && !status) {
        if (testLine.htmlGridLine == lastLine) {
            status = true;
        }
        testLine = testLine.last();
    }
    return status;
};
rialto.widget.LineNode.prototype.addLine = function (line) {
    var hidden = false;
    if (!this.open || this.isFatherClose()) {
        hidden = true;
    }
    if (this.isGridLastLine()) {
        var indL = this.grid.addOneLine(line.tabData, hidden);
    } else {
        if (this.hasChild()) {
            var nextInd = this.grid.getLineIndex(this.last().htmlGridLine.nextSibling);
        } else {
            var nextInd = this.grid.getLineIndex(this.htmlGridLine.nextSibling);
        }
        var indL = this.grid.insertOneLineBefore(line.tabData, nextInd, hidden);
    }
    this.childLines.push(line);
    this.afterAdd(line);
    return indL;
};
rialto.widget.LineNode.prototype.isFatherClose = function () {
    var close = false;
    var father = this.parentLine;
    while (father && !close) {
        close = !father.open;
        father = father.parentLine;
    }
    return close;
};
rialto.widget.LineNode.prototype.insertLine = function (line) {
};
rialto.widget.LineNode.prototype.afterAdd = function (line) {
    this.setIcon();
    line.depth = this.depth + 1;
};
rialto.widget.LineNode.prototype.remove = function (becauseHtmlLineRemove) {
    this.img1.onclick = null;
    this.divText.onclick = null;
    this.htmlGridLine.oRia = null;
    if (!becauseHtmlLineRemove) {
        this.grid.deleteOneLine(this.grid.getLineIndex(this.htmlGridLine));
    }
    if (!this.root) {
        rialto.array.remove(this.parentLine.childLines, this);
    }
    while (this.hasChild()) {
        this.last().remove();
    }
};
rialto.widget.LineNode.prototype.hasChild = function () {
    if (this.childLines.length == 0) {
        return false;
    } else {
        return true;
    }
};
rialto.widget.LineNode.prototype.isLast = function () {
    if (!this.root) {
        return (this.parentLine.childLines[this.parentLine.childLines.length - 1] == this);
    } else {
        return true;
    }
};
rialto.widget.LineNode.prototype.getIndex = function () {
    return rialto.array.indexOf(this.parentLine.childLines, this);
};
rialto.widget.LineNode.prototype.isChild = function (line) {
    return rialto.array.indexOf(this.childLines, line) != -1;
};
rialto.widget.LineNode.prototype.isFirst = function () {
    if (!this.root) {
        return (this.parentLine.childLines[0] == this);
    } else {
        return true;
    }
};
rialto.widget.LineNode.prototype.first = function () {
    if (this.hasChild()) {
        return (this.childLines[0]);
    } else {
        return null;
    }
};
rialto.widget.LineNode.prototype.last = function () {
    if (this.hasChild()) {
        return (this.childLines[this.childLines.length - 1]);
    } else {
        return null;
    }
};
rialto.widget.LineNode.prototype.next = function () {
    if (!this.root) {
        var index = this.getIndex();
        if (index < this.parentLine.childLines.length - 1) {
            return this.parentLine.childLines[index + 1];
        } else {
            return null;
        }
    } else {
        return null;
    }
};
rialto.widget.LineNode.prototype.previous = function () {
    if (!this.root) {
        var index = this.getIndex();
        if (index > 0) {
            return this.parentLine.childLines[index - 1];
        } else {
            return null;
        }
    } else {
        return null;
    }
};
rialto.widget.LineNode.prototype.getHtmlInd = function () {
    return this.grid.getLineIndex(this.htmlGridLine);
};


rialto.widget.Image = function (srcOut, left, top, parent, text, srcOver, objPar) {
    if (arguments.length == 0) {
        return;
    }
    if (!objPar) {
        var objPar = {};
    }
    this.base = rialto.widget.AbstractComponent;
    objPar.type = "image" + srcOut;
    objPar.name = "image" + srcOut;
    objPar.left = left;
    objPar.top = top;
    this.base(objPar);
    this.srcOut = srcOut;
    if (srcOver && srcOver != "") {
        this.srcOVer = srcOver;
    }
    this.alt = text;
    this.display = "block";
    this.enable = true;
    this.withLimits = false;
    this.srcDisabled = srcOut;
    this.boolFloatRight = false;
    this.boolFloatLeft = false;
    this.onclick = null;
    this.onerror = function () {
        console.error("ERROR WHILE LOADING FOLLOWING IMAGE:" + srcOut);
    };
    this.setUp(objPar);
    objPar = null;
    this.divExt.style.position = this.position;
    this.divExt.style.display = this.display;
    this.divExt.style.left = this.left;
    this.divExt.style.top = this.top;
    this.divExt.style.width = "auto";
    this.divExt.style.height = "auto";
    if (this.boolFloatLeft) {
        this.divExt.style[ATTRFLOAT] = "left";
    }
    if (this.boolFloatRight) {
        this.divExt.style[ATTRFLOAT] = "right";
    }
    if (this.alt != null) {
        this.divExt.title = this.alt;
    }
    this._imgDiv = document.createElement("DIV");
    this._imgImg = document.createElement("IMG");
    this.addEvent(this.divExt, "onmouseout", this._onmouseout);
    this.addEvent(this.divExt, "onmouseover", this._onmouseover);
    this.addEvent(this.divExt, "onmousemove", this._onmousemove);
    this.addEvent(this.divExt, "onclick", this._onclick);
    this.addEvent(this.divExt, "ondblclick", this._ondblclick);
    this.$$loadImage();
    this.divExt.appendChild(this._imgDiv);
    this.divExt.appendChild(this._imgImg);
    this._img.onerror = this.onerror;
    if (parent != null) {
        this.attach(parent);
    }
};
rialto.widget.Image.prototype = new rialto.widget.AbstractComponent;
rialto.widget.Image.prototype.adaptToContext = function () {
    if (this.position == "relative" && !(this.boolFloatRight || this.boolFloatLeft)) {
        this.divExt.style.width = this._img.offsetWidth;
    }
};
rialto.widget.Image.prototype.setUp = function (objPar) {
    if (objPar.srcDisabled != null) {
        this.srcDisabled = objPar.srcDisabled;
    }
    if (rialto.lang.isBoolean(objPar.boolFloatRight)) {
        this.boolFloatRight = objPar.boolFloatRight;
    }
    if (rialto.lang.isBoolean(objPar.boolFloatLeft)) {
        this.boolFloatLeft = objPar.boolFloatLeft;
    }
    if (rialto.lang.isFunction(objPar.onerror)) {
        this.onerror = objPar.onerror;
    }
    if (this.boolFloatLeft || this.boolFloatRight) {
        this.position = "relative";
    }
};
rialto.widget.Image.prototype.onerror = function (e) {
    this.onerror();
};
rialto.widget.Image.prototype._onmouseout = function (e) {
    if (this.enable) {
        if (!e) {
            e = window.event;
        }
        this.divExt.style.cursor = "default";
        this.$$loadImage();
        this.onmouseout(e);
    }
};
rialto.widget.Image.prototype._onmouseover = function (e) {
    if (!e) {
        e = window.event;
    }
    if (this.checkLimits(e)) {
        if (this.enable) {
            if (this.onclick) {
                this.divExt.style.cursor = "pointer";
            } else {
                this.divExt.style.cursor = "default";
            }
            if (this.srcOVer) {
                this.$$loadImage(altImg = true);
            }
        } else {
            this.divExt.style.cursor = "default";
        }
        this.onmouseover(e);
    }
    ria.utils.event.stopEvent(e);
};
rialto.widget.Image.prototype._onmousemove = function (e) {
    if (this.withLimits) {
        if (!e) {
            e = window.event;
        }
        if (this.checkLimits(e)) {
            this._onmouseover(e);
        } else {
            this._onmouseout(e);
        }
    }
};
rialto.widget.Image.prototype._onclick = function (e) {
    if (!e) {
        e = window.event;
    }
    if (this.checkLimits(e) && !this.draggable) {
        if (this.enable && this.onclick) {
            this.onclick(e);
            ria.utils.event.stopEvent(e);
        }
    }
};
rialto.widget.Image.prototype._ondblclick = function (e) {
    if (!e) {
        e = window.event;
    }
    if (this.checkLimits(e)) {
        if (this.enable) {
            this.ondblclick(e);
            ria.utils.event.stopEvent(e);
        }
    }
};
rialto.widget.Image.prototype.getHtmlDD = function () {
    return this._img;
};
rialto.widget.Image.prototype.$$loadImage = function (bAlt) {
    var wsrcOut;
    if (!this.enable) {
        if (this.srcDisabled) {
            wsrcOut = this.srcDisabled;
        } else {
            return;
        }
    } else {
        if (!bAlt) {
            wsrcOut = this.srcOut;
        } else {
            wsrcOut = this.srcOVer;
        }
    }
    if (wsrcOut.indexOf(".") != -1) {
        this._imgDiv.style.display = "none";
        this._imgImg.style.display = "block";
        this._imgImg.src = wsrcOut;
        this._img = this._imgImg;
    } else {
        this._imgImg.style.display = "none";
        this._imgDiv.style.display = "block";
        this._imgDiv.className = wsrcOut;
        this._img = this._imgDiv;
    }
};
rialto.widget.Image.prototype.$changeImages = function (srcOut, imageOver, srcDisabled) {
    if (srcOut != null) {
        this.srcOut = srcOut;
    }
    if (imageOver != null) {
        this.srcOVer = imageOver;
    }
    if (srcDisabled != null) {
        this.srcDisabled = srcDisabled;
    }
    this.$$loadImage();
};
rialto.widget.Image.prototype.setLimits = function (x, y, delX, delY) {
    this.x = x;
    this.y = y;
    this.delX = delX;
    this.delY = delY;
    this.withLimits = true;
};
rialto.widget.Image.prototype.checkLimits = function (e) {
    if (this.withLimits) {
        var evX = ria.utils.event.xEvent(e);
        var evY = ria.utils.event.yEvent(e);
        return ((evX >= this.x && evX <= (this.x + this.delX)) && (evY >= this.y && evY <= (this.y + this.delY)));
    } else {
        return true;
    }
};
rialto.widget.Image.prototype.setImageReference = function (srcOut, imageOver) {
    this.$changeImages(srcOut, imageOver);
};
rialto.widget.Image.prototype.setImages = function (imageOut, imageOver, imageDisabled) {
    rialto.deprecated("IMAGE", "setImages", "setSrcs");
    this.setSrcs(imageOut, imageOver, imageDisabled);
};
rialto.widget.Image.prototype.setSrcs = function (srcOut, srcOver, srcDisabled) {
    this.$changeImages(srcOut, srcOver, srcDisabled);
};
rialto.widget.Image.prototype.setSrcOut = function (srcOut) {
    this.$changeImages(srcOut);
};
rialto.widget.Image.prototype.setSrcOver = function (srcOver) {
    this.$changeImages(null, srcOver);
};
rialto.widget.Image.prototype.setSrcDisabled = function (srcDisabled) {
    this.$changeImages(null, null, srcDisabled);
};
rialto.widget.Image.prototype.getSrcOut = function () {
    return this.srcOut;
};
rialto.widget.Image.prototype.getSrcOver = function () {
    return this.srcOver;
};
rialto.widget.Image.prototype.getSrcDisabled = function () {
    return this.srcDisabled;
};
rialto.widget.Image.prototype.setAlt = function (alt) {
    rialto.deprecated("IMAGE", "setAlt", "setText");
    this.setText(alt);
};
rialto.widget.Image.prototype.setText = function (text) {
    this.alt = text;
    this._img.title = text;
};
rialto.widget.Image.prototype.setVisible = function (visible) {
    var oHtml = this.getHtmlExt();
    if (visible) {
        oHtml.style.display = "block";
        this._img.style.display = this.display;
    } else {
        oHtml.style.display = "none";
    }
    this.visible = visible;
};
rialto.widget.Image.prototype.setEnable = function (enable) {
    this.enable = enable;
    this.$changeImages(null, null, this.srcDisabled);
};
rialto.widget.Image.prototype.flash = function (ms) {
    if (!ms) {
        var ms = 500;
    }
    this.isOver = !this.isOver;
    this.$$loadImage(this.isOver);
    this.tFlash = window.setTimeout("rialto.session.objects[\"" + this.id + "\"].flash(" + ms + ")", ms);
};
rialto.widget.Image.prototype.stopFlash = function () {
    this.srcOut2 = this.srcOut;
    this.setImageReference(this.srcOut);
    if (this.tFlash) {
        window.clearTimeout(this.tFlash);
    }
};


objMenuCont.prototype.nbreInstance = 0;
function objMenuCont(name, width, objPar) {
    this.name = name;
    this.id = name + "_" + (objMenuCont.prototype.nbreInstance++);
    if (rialto.lang.isNumber(width)) {
        this.width = width;
    } else {
        this.width = "100%";
    }
    rialto.session.reccord(this, this.id);
    this.avecImage = false;
    this.position = "absolute";
    this.posFixe = false;
    this.posTop = 0;
    this.posLeft = 0;
    this.className = null;
    if (objPar != null) {
        if (rialto.lang.isBoolean(objPar.avecImage)) {
            this.avecImage = objPar.avecImage;
        }
        if (rialto.lang.isStringIn(objPar.position, ["static", "absolute", "relative"])) {
            this.position = objPar.position;
        }
        if (rialto.lang.isBoolean(objPar.posFixe)) {
            this.posFixe = objPar.posFixe;
        }
        if (rialto.lang.isNumber(objPar.posTop)) {
            this.posTop = objPar.posTop;
        }
        if (rialto.lang.isNumber(objPar.posLeft)) {
            this.posLeft = objPar.posLeft;
        }
        if (rialto.lang.isString(objPar.className, true)) {
            this.className = objPar.className;
        }
    }
}
objMenuCont.prototype.createMenu = function (parent) {
    this.divExt = document.createElement("DIV");
    this.divExt.style.width = this.width;
    this.divExt.className = "divMenu";
    this.divExt.style.position = this.position;
    this.divExt.style.overflow = "hidden";
    this.divExt.id = this.name;
    this.divExt.style.display = "none";
    this.divExt.style.zIndex = 10002;
    if (this.posFixe) {
        this.divExt.style.top = this.posTop;
        this.divExt.style.left = this.posLeft;
        this.divExt.className = "divMenuFixe";
    }
    if (this.className) {
        this.divExt.className = this.className;
    }
    this.tabItem = new Array();
    parent.appendChild(this.divExt);
    this.dansBody = false;
    this.divCoche = document.createElement("DIV");
    this.divCoche.className = "coche";
    this.divCoche.style.left = "5px";
    var coche = document.createElement("IMG");
    coche.src = rialtoConfig.buildImageURL("images/imgTableau/coche.gif");
    coche.style.display = "inline";
    this.divCoche.appendChild(coche);
};
objMenuCont.prototype.add = function (titre, actif, boolAvecCoche, boolCoche, img) {
    var oThis = this;
    var item = new objItemMenu(this.width, titre, actif, boolAvecCoche, img);
    var ind = this.tabItem.push(item) - 1;
    item.ind = ind;
    item.divExt.onclick = function (e) {
        if (this.oRia.actif) {
            this.className = "divItemOff";
            oThis.itemClick(this.oRia.ind);
            stopEvent(e);
        }
    };
    if (boolCoche) {
        item.divImg.appendChild(this.divCoche);
    }
    this.divExt.appendChild(item.divExt);
};
objMenuCont.prototype.itemClick = function (ind) {
    var item = this.tabItem[ind];
    if (item.boolAvecCoche) {
        item.divImg.appendChild(this.divCoche);
    }
    this.masqueMenu();
    this.itemClickApplicatif(ind);
};
objMenuCont.prototype.itemClickApplicatif = function (ind) {
};
objMenuCont.prototype.activeItem = function (ind) {
    var item = this.tabItem[ind];
    item.actif = true;
    item.divExt.className = "divItemOff";
};
objMenuCont.prototype.inactiveItem = function (ind) {
    var item = this.tabItem[ind];
    item.actif = false;
    item.divExt.className = "divItemInactif";
};
objMenuCont.prototype.addSeparation = function () {
    var sep = document.createElement("HR");
    this.divExt.appendChild(sep);
};
objMenuCont.prototype.afficheMenu = function (e) {
    this.divExt.style.visibility = "hidden";
    this.divExt.style.display = "block";
    if (objMenuCont.prototype.menuActif) {
        objMenuCont.prototype.menuActif.masqueMenu();
    }
    objMenuCont.prototype.menuActif = this;
    if (!this.posFixe) {
        if (!e) {
            var e = window.event;
        }
        if (this.dansBody == false) {
            document.body.appendChild(this.divExt);
            this.dansBody = true;
        }
        _ru.$placeInViewPort(this.divExt, e);
        stopEvent(e);
    }
    this.divExt.style.visibility = "visible";
};
objMenuCont.prototype.masqueMenu = function (e) {
    objMenuCont.prototype.menuActif = null;
    if (!e) {
        var e = window.event;
    }
    this.divExt.style.display = "none";
};
objMenuCont.prototype.changeTitre = function (ind, titre) {
    var item = this.tabItem[ind];
    item.changeTitre(titre);
};
objMenuCont.prototype.changeImg = function (ind, img) {
    var item = this.tabItem[ind];
    item.changeImg(img);
};
objMenuCont.prototype.remove = function () {
    if (this.divExt && this.divExt.childNodes) {
        for (var idx = 0; idx < this.divExt.childNodes.length; idx++) {
            var divExt = this.divExt.childNodes[idx];
            if (divExt.oRia) {
                divExt.oRia.remove();
            }
        }
    }
    this.divExt.parentNode.removeChild(this.divExt);
    rialto.session.objects[this.id] = null;
};
function objItemMenu(width, titre, actif, boolAvecCoche, img) {
    var oThis = this;
    this.actif = actif;
    this.titre = titre;
    this.srcImg = img;
    if (boolAvecCoche) {
        this.boolAvecCoche = true;
    } else {
        this.boolAvecCoche = false;
    }
    this.divExt = document.createElement("DIV");
    this.divExt.style.width = width;
    this.divExt.style.height = "20px";
    if (this.actif) {
        this.divExt.className = "divItemOff";
    } else {
        this.divExt.className = "divItemInactif";
    }
    this.divImg = document.createElement("DIV");
    this.divImg.style.width = "25px";
    this.divImg.style.height = "20px";
    this.divImg.className = "imgItem";
    if (this.srcImg && !this.boolAvecCoche) {
        this.img = document.createElement("IMG");
        this.img.style.display = "inline";
        this.img.src = this.srcImg;
        this.divImg.appendChild(this.img);
    }
    this.divExt.appendChild(this.divImg);
    this.divTxt = document.createElement("DIV");
    this.divTxt.style.height = "20px";
    this.divTxt.style.width = width - 27;
    this.divTxt.style.display = "inline";
    this.divTxt.className = "textItem";
    this.divTxt.appendChild(document.createTextNode(this.titre));
    this.divExt.appendChild(this.divTxt);
    this.divExt.oRia = this;
    this.divExt.onmouseover = function () {
        if (oThis.actif) {
            this.className += " divItemOn";
        } else {
            this.className += " divItemInactifOn";
        }
    };
    this.divExt.onmouseout = function () {
        if (oThis.actif) {
            this.className = "divItemOff";
        } else {
            this.className = "divItemInactif";
        }
    };
}
objItemMenu.prototype.changeTitre = function (titre) {
    var text = document.createTextNode(titre);
    this.divTxt.replaceChild(text, this.divTxt.firstChild);
};
objItemMenu.prototype.changeImg = function (img) {
    this.srcImg = img;
    this.img.src = this.srcImg;
};
objItemMenu.prototype.remove = function () {
    this.divExt.oRia = null;
    this.divExt.onmouseover = null;
    this.divExt.onmouseout = null;
    this.divExt.onclick = null;
};


rialto.widget.simpleMenu = function (objPar) {
    if (!objPar) {
        var objPar = {};
    }
    objPar.name = "menu";
    objPar.height = 0;
    if (!objPar.width) {
        objPar.width = 200;
    }
    this.base = rialto.widget.AbstractComponent;
    this.base(objPar);
    this.posFixe = false;
    this.posTop = 0;
    this.posLeft = 0;
    this.avecCoche = false;
    this.setUp(objPar);
    var oThis = this;
    this.tabItem = new Array;
    this.arrChildMenu = new Array;
    this.mask = document.createElement("DIV");
    this.mask.style.display = "none";
    this.mask.className = "ecranMasque_transparent";
    document.body.appendChild(this.mask);
    this.addEvent(this.mask, "onclick", this.fermezoneMenu);
    this.addEvent(this.mask, "oncontextmenu", this.fermezoneMenu);
    this.divExt = document.createElement("DIV");
    this.divExt.className = this.className;
    this.mask.appendChild(this.divExt);
    this.divExt.style.width = this.width;
    this.divExt.style.position = "absolute";
    this.open = false;
    this.divExt.style.visibility = "hidden";
    this.isMenufils = false;
    var objPar = null;
};
rialto.widget.simpleMenu.prototype = new rialto.widget.AbstractComponent;
rialto.widget.simpleMenu.prototype.nbreInstance = 0;
rialto.widget.simpleMenu.prototype.setUp = function (objPar) {
    if (objPar.name) {
        this.name = objPar.name;
    }
    if (rialto.lang.isNumber(objPar.width)) {
        this.width = objPar.width;
    }
    if (rialto.lang.isBoolean(objPar.posFixe)) {
        this.posFixe = objPar.posFixe;
    }
    if (rialto.lang.isNumber(objPar.posTop)) {
        this.posTop = objPar.posTop;
    }
    if (rialto.lang.isNumber(objPar.posLeft)) {
        this.posLeft = objPar.posLeft;
    }
    if (rialto.lang.isString(objPar.className, true)) {
        this.className = objPar.className;
    }
    if (rialto.lang.isBoolean(objPar.avecCoche)) {
        this.avecCoche = objPar.avecCoche;
    }
};
rialto.widget.simpleMenu.prototype.release = function () {
    for (var i = 0; i < this.tabItem.length; i++) {
        this.tabItem[i].remove();
    }
    this.mask.parentNode.removeChild(this.mask);
};
rialto.widget.simpleMenu.prototype.setPosLeft = function (left) {
    this.posLeft = left;
    this.divExt.style.left = this.posLeft;
};
rialto.widget.simpleMenu.prototype.setPosTop = function (top) {
    this.posTop = top;
    this.divExt.style.top = this.posTop;
};
rialto.widget.simpleMenu.prototype.setWidth = function (width) {
    this.width = width;
    this.divExt.style.width = width;
    for (var i = 0; i < this.tabItem.length; i++) {
        this.tabItem[i].setWidth(this.width);
    }
};
rialto.widget.simpleMenu.prototype.setClassName = function (classname) {
    this.divExt.className = classname;
};
rialto.widget.simpleMenu.prototype.clear = function () {
    for (var i = 0; i < this.tabItem.length; i++) {
        this.tabItem[i].remove();
    }
    this.divExt.innerHTML = "";
    this.tabItem = new Array;
    for (var i = 0; i < this.arrChildMenu.length; i++) {
        this.mask.removeChild(this.arrChildMenu[i].divExt);
    }
    this.arrChildMenu = new Array;
};
rialto.widget.simpleMenu.prototype.add = function (obj) {
    this.divExt.appendChild(obj);
};
rialto.widget.simpleMenu.prototype.addItem = function (objPar) {
    var oThis = this;
    objPar.width = this.width;
    var item = new rialto.widget.simpleMenuItem(objPar);
    var ind = this.tabItem.push(item);
    item.parMenu = this;
    item.ind = ind - 1;
    this.add(item.divExt);
    if (item.menuFils) {
        this.addMenuFils(item.menuFils);
    }
    return item;
};
rialto.widget.simpleMenu.prototype.addMenuFils = function (objMenuFils) {
    objMenuFils.isMenufils = true;
    objMenuFils.menuPere = this;
    this.arrChildMenu.push(objMenuFils);
    this.arrChildMenu = this.arrChildMenu.concat(objMenuFils.arrChildMenu);
    objMenuFils.posFixe = true;
    this.mask.appendChild(objMenuFils.divExt);
    for (var i = 0; i < objMenuFils.arrChildMenu.length; i++) {
        this.mask.appendChild(objMenuFils.arrChildMenu[i].divExt);
    }
    if (objMenuFils.mask) {
        document.body.removeChild(objMenuFils.mask);
        objMenuFils.mask = null;
    }
};
rialto.widget.simpleMenu.prototype.addSeparation = function () {
    var oThis = this;
    divExt = document.createElement("DIV");
    divExt.style.position = "relative";
    divExt.style.width = this.width;
    divExt.style.height = 10;
    divExt.innerHTML = "<HR/>";
    divExt.onmouseover = function (e) {
        if (!e) {
            var e = window.event;
        }
        if (oThis.menuFilsActif) {
            oThis.menuFilsActif.fermezoneMenu();
            oThis.menuFilsActif = "";
        }
        stopEvent(e);
    };
    this.add(divExt);
};
rialto.widget.simpleMenu.prototype.fermezoneMenu = function () {
    for (var i = 0; i < this.arrChildMenu.length; i++) {
        this.arrChildMenu[i].fermezoneMenu();
    }
    this.divExt.style.visibility = "hidden";
    this.divExt.style.height = "";
    if (this.divExt.saveWidth != undefined) {
        this.divExt.style.width = this.divExt.saveWidth;
    }
    if (!this.isMenufils) {
        this.mask.style.display = "none";
    }
    this.open = false;
    this.onClose();
};
rialto.widget.simpleMenu.prototype.affichezoneMenu = function (e, shift) {
    if (!this.isMenufils) {
        this.mask.style.display = "block";
    }
    this.mask.scrollLeft = document.body.scrollLeft;
    this.mask.scrollTop = document.body.scrollTop;
    var base = this.posFixe ? {top:this.posTop, left:this.posLeft} : e;
    var heightAvailable = _ru.$placeInViewPort(this.divExt, base, shift);
    if (this.posFixe) {
        this.divExt.style.left = this.posLeft;
    }
    if (heightAvailable > 0) {
        this.divExt.style.overflow = "auto";
        this.divExt.style.height = heightAvailable;
    }
    this.open = true;
    if (this.isMenufils) {
        this.menuPere.menuFilsActif = this;
    }
    this.divExt.style.visibility = "visible";
};
rialto.widget.simpleMenu.prototype.clickItem = function (item) {
    if (this.avecCoche) {
        item.imgG.style.background = "url(images/imgTableau/coche.gif)";
    }
    this.onclick(item);
};
rialto.widget.simpleMenu.prototype.onOverItem = function (item) {
    if (this.menuFilsActif) {
        this.menuFilsActif.fermezoneMenu();
        this.menuFilsActif = "";
    }
    this.onOver(item);
};
rialto.widget.simpleMenu.prototype.onClose = function () {
};
rialto.widget.simpleMenu.prototype.onOver = function (item) {
};
rialto.widget.simpleMenu.prototype.onOut = function (item) {
};
rialto.widget.simpleMenu.prototype.onclick = function (item) {
};
rialto.widget.simpleMenuItem = function (objPar) {
    this.text = "";
    this.srcG = "";
    this.srcD = "";
    this.clOver = "itemMenuOn";
    this.clOut = "itemMenuOff";
    this.enable = true;
    this.width = 100;
    this.height = 23;
    this.boolcoche = false;
    this.bNotOut = false;
    this.menuFils = "";
    if (objPar) {
        if (rialto.lang.isString(objPar.text)) {
            this.text = objPar.text;
        }
        if (objPar.srcG) {
            this.srcG = objPar.srcG;
        }
        if (objPar.srcD) {
            this.srcD = objPar.srcD;
        }
        if (objPar.clOver) {
            this.clOver = objPar.clOver;
        }
        if (objPar.clOut) {
            this.clOut = objPar.clOut;
        }
        if (rialto.lang.isBoolean(objPar.enable)) {
            this.enable = objPar.enable;
        }
        if (rialto.lang.isNumber(objPar.width)) {
            this.width = objPar.width;
        }
        if (rialto.lang.isNumber(objPar.height) && objPar.height > 0) {
            this.height = objPar.height;
        }
        if (rialto.lang.isBoolean(objPar.boolcoche)) {
            this.boolcoche = objPar.boolcoche;
        }
        if (rialto.lang.isBoolean(objPar.bNotOut)) {
            this.bNotOut = objPar.bNotOut;
        }
        if (objPar.menuFils) {
            this.menuFils = objPar.menuFils;
            this.menuFils.item = this;
            this.srcD = rialtoConfig.buildImageURL("images/fleches/flecheD23-19.gif");
        }
    }
    var oThis = this;
    this.divExt = document.createElement("DIV");
    this.divExt.className = this.clOut;
    this.divExt.style.position = "relative";
    this.divExt.style.width = this.width;
    this.divExt.style.height = this.height;
    this.decal = 0;
    if (this.srcG || this.boolcoche) {
        this.decal = 19;
        this.imgG = document.createElement("DIV");
        this.imgG.className = "imgItemMenu";
        this.imgG.style.background = "url(" + this.srcG + ")";
        this.divExt.appendChild(this.imgG);
    }
    this.divText = document.createElement("DIV");
    this.divText.className = "itemText";
    this.divText.style[ATTRFLOAT] = "left";
    this.divText.appendChild(document.createTextNode(this.text));
    this.divText.title = this.text;
    this.divExt.appendChild(this.divText);
    if (this.srcD) {
        this.decal += 19;
        this.imgD = document.createElement("DIV");
        this.imgD.style.background = "url(" + this.srcD + ")";
        this.imgD.className = "imgItemMenu";
        this.divExt.appendChild(this.imgD);
    }
    this.divText.style.width = this.width - this.decal;
    this.divExt.onmouseover = function (e) {
        if (!e) {
            var e = window.event;
        }
        oThis.over(e);
    };
    if (!this.bNotOut) {
        this.divExt.onmouseout = function (e) {
            if (!e) {
                var e = window.event;
            }
            oThis.out(e);
        };
    }
    this.divExt.onclick = function (e) {
        this.className = oThis.clOut;
        if (!e) {
            var e = window.event;
        }
        oThis.parMenu.clickItem(oThis);
    };
};
rialto.widget.simpleMenuItem.prototype.remove = function () {
    this.divExt.parentNode.removeChild(this.divExt);
    this.divExt.onmouseover = null;
    this.divExt.onmouseout = null;
    this.divExt.onclick = null;
};
rialto.widget.simpleMenuItem.prototype.setWidth = function (width) {
    this.width = width;
    this.divExt.style.width = this.width;
    this.divText.style.width = this.width - this.decal;
};
rialto.widget.simpleMenuItem.prototype.over = function (e) {
    this.divExt.className = this.clOver;
    this.parMenu.onOverItem(this);
    if (this.menuFils) {
        this.menuFils.setPosTop(compOffsetTop(this.imgD) + 2);
        this.menuFils.setPosLeft(compOffsetLeft(this.imgD) + 10);
        this.menuFils.affichezoneMenu(e);
    }
};
rialto.widget.simpleMenuItem.prototype.out = function (e) {
    this.divExt.className = this.clOut;
    this.parMenu.onOut(this);
};
rialto.widget.simpleMenuItem.prototype.changeTitre = function (titre) {
    this.text = titre;
    this.divText.innerHTML = this.text;
};
rialto.widget.simpleMenuItem.prototype.setStyle = function (obStyle) {
    for (prop in obStyle) {
        try {
            this.divText.style[prop] = obStyle[prop];
        }
        catch (erreur) {
        }
    }
    this.obStyle = obStyle;
};
rialto.widget.simpleMenuItem.prototype.setClassName = function (css) {
    this.clOut = css;
    this.divExt.className = this.clOut;
};
rialto.widget.SimpleMenu = rialto.widget.simpleMenu;


rialto.widget.Tree = function (objPar) {
    objPar.type = "treeview";
    this.base = rialto.widget.AbstractContainer;
    this.base(objPar);
    var oThis = this;
    this.rootNode = null;
    this.rootOpen = true;
    this.boolSelActive = true;
    this.withRoot = true;
    this.withT = true;
    this.draggableNode = false;
    this.targetNode = true;
    this.refTree = this;
    this.setUp(objPar);
    this.divExt.style.top = this.top;
    this.divExt.style.left = this.left;
    this.divDD = document.createElement("DIV");
    this.divDD.className = this.getCssRuleName("tree_divDD");
    this.divExt.style.className = this.getCssRuleName("tree_divExt");
    this.divExt.style.position = this.position;
    this.divExt.style.overflow = "auto";
    this.divExt.id = this.name;
    if (objPar.rootNode) {
        this.addRoot(objPar.rootNode);
    }
    if (objPar.parent) {
        this.attach(objPar.parent);
    }
};
rialto.widget.Tree.prototype = new rialto.widget.AbstractContainer;
rialto.widget.Tree.prototype.setUp = function (objPar) {
    if (rialto.lang.isBoolean(objPar.boolSelActive)) {
        this.boolSelActive = objPar.boolSelActive;
    }
    if (rialto.lang.isBoolean(objPar.withT)) {
        this.withT = objPar.withT;
    }
    if (rialto.lang.isBoolean(objPar.rootOpen)) {
        this.rootOpen = objPar.rootOpen;
    }
    if (rialto.lang.isBoolean(objPar.withRoot)) {
        this.withRoot = objPar.withRoot;
    }
    if (rialto.lang.isBoolean(objPar.autoResizableH)) {
        this.autoResizableH = objPar.autoResizableH;
    }
    if (rialto.lang.isBoolean(objPar.autoResizableW)) {
        this.autoResizableW = objPar.autoResizableW;
    }
    if (rialto.lang.isBoolean(objPar.draggableNode)) {
        this.draggableNode = objPar.draggableNode;
    }
    if (rialto.lang.isBoolean(objPar.targetNode)) {
        this.targetNode = objPar.targetNode;
    }
};
rialto.widget.Tree.prototype.adaptToContext = function (parent) {
    this.updateSize();
};
rialto.widget.Tree.prototype.addRoot = function (rootNode) {
    rialto.deprecated("TREE", "addRoot", "setRoot");
    this.setRoot(rootNode);
};
rialto.widget.Tree.prototype.getRoot = function () {
    return this.rootNode;
};
rialto.widget.Tree.prototype.setRoot = function (rootNode) {
    var oThis = this;
    this.rootNode = rootNode;
    this.divExt.appendChild(this.rootNode.divExt);
    this.rootNode.root = true;
    this.rootNode.divText.style.top = "5px";
    this.rootNode.img1.style.diplay = "none";
    this.rootNode.img2.style.left = "0px";
    this.rootNode.divText.style.left = "24px";
    this.rootNode.divCont.style.left = "0";
    this.rootNode.divContent.style.display = "block";
    this.rootNode.open = true;
    if (!this.withRoot) {
        this.rootNode.divExt.removeChild(this.rootNode.divHeader);
    } else {
        this.rootNode.img1.style.display = "none";
        this.rootNode.divT.style.display = "none";
        this.rootNode.img2.onclick = function (e) {
            oThis.rootNode.toggle();
        };
    }
    this.record(this.rootNode);
    this.rootNode.afterAttach();
};
rialto.widget.Tree.prototype.adaptToContext = function () {
    this.initSize();
};
rialto.widget.Tree.prototype.initSize = function () {
    if (this.autoResizableW) {
        this.updateWidth();
    } else {
        this.divExt.style.width = this.width;
    }
    if (this.autoResizableH) {
        this.updateHeight();
    } else {
        this.divExt.style.height = this.height;
    }
};
rialto.widget.Tree.prototype.updateSize = function () {
    if (this.visible) {
        this.updateHeight();
        this.updateWidth();
        this.oldHeight = this.divExt.offsetHeight;
        this.oldWidth = this.divExt.offsetWidth;
    }
};
rialto.widget.Tree.prototype.updateWidth = function () {
    if (this.visible) {
        if (this.autoResizableW) {
            this.divExt.style.overflow = "hidden";
            ria.utils.measures.$setWidthWithAllAvailable(this.divExt);
            if (this.rootNode) {
                this.rootNode.updateWidth();
            }
            this.divExt.style.overflow = "auto";
        }
    }
};
rialto.widget.Tree.prototype.updateHeight = function () {
    if (this.visible) {
        if (this.autoResizableH) {
            this.divExt.style.overflow = "hidden";
            this.height = ria.utils.measures.$setHeightWithAllAvailable(this.divExt);
            if (this.rootNode) {
                this.rootNode.updateHeight();
            }
            this.divExt.style.overflow = "auto";
        }
    }
};
rialto.widget.Tree.prototype.exist = function (node, nodeId, compt) {
    var stat = {trouve:false, nd:null, nbC:compt};
    if (!compt) {
        compt = 0;
    }
    if (node.id == nodeId) {
        stat = {trouve:true, nd:node, nbC:compt};
    } else {
        var i = 0;
        while (i < node.arrChild.length && !stat.trouve) {
            compt++;
            stat = this.exist(node.arrChild[i], nodeId, compt);
            i++;
        }
    }
    return stat;
};
rialto.widget.Tree.prototype.getCount = function (node, curNode) {
    stat = {trouve:false};
    if (!curNode) {
        this.count = 0;
        curNode = this.rootNode;
    }
    if (node == curNode) {
        stat = {trouve:true, nbC:this.count};
    } else {
        var i = 0;
        while (i < curNode.arrChild.length && !stat.trouve) {
            this.count++;
            stat = this.getCount(node, curNode.arrChild[i]);
            i++;
        }
    }
    return stat;
};
rialto.widget.Tree.prototype.findValue = function (node, val) {
    stat = {trouve:false, nd:null};
    if (node.info == val) {
        stat = {trouve:true, nd:node};
    } else {
        var i = 0;
        while (i < node.arrChild.length && !stat.trouve) {
            stat = this.findValue(node.arrChild[i], val);
            i++;
        }
    }
    return stat;
};
rialto.widget.Tree.prototype.addNode = function (node, nodeIdParent) {
    if (!nodeIdParent) {
        this.add(node);
    } else {
        if (nodeIdParent == this.id) {
            this.add(node);
        } else {
            var resRech = this.exist(this.rootNode, nodeIdParent);
            if (resRech.trouve) {
                resRech.nd.add(node);
            }
        }
    }
};
rialto.widget.Tree.prototype.add = function (node) {
    if (!this.rootNode) {
        this.setRoot(node);
    } else {
        this.rootNode.add(node);
    }
};
rialto.widget.Tree.prototype.createAndAddNode = function (nodeId, objPar) {
    var node = new rialto.widget.TreeNode(objPar);
    this.addNode(node, nodeId);
    return node;
};
rialto.widget.Tree.prototype.onclick = function (node) {
};
rialto.widget.TreeNode = function (objPar) {
    objPar.type = "treenode";
    this.base = rialto.widget.AbstractContainer;
    this.base(objPar);
    var oThis = this;
    this.arrChild = new Array();
    this.info = "node";
    this.text = "node";
    this.icon = rialtoConfig.buildImageURL("images/imTreeview/pict_synthetik_off.gif");
    this.icon2 = this.icon;
    this.open = true;
    this.reload = false;
    this.url = "";
    this.srcPlus = rialtoConfig.buildImageURL("images/imTreeview/icT/L.gif");
    this.srcMoins = rialtoConfig.buildImageURL("images/imTreeview/icT/L.gif");
    this.draggable = true;
    this.target = true;
    this.tooltip = "";
    this.setUp(objPar);
    this.divExt.className = this.getCssRuleName("treenode_divExt");
    this.divExt.style.width = "100%";
    this.divExt.oRia = this;
    this.divHeader = document.createElement("DIV");
    this.divHeader.className = this.getCssRuleName("treenode_divHeader");
    this.divContent = document.createElement("DIV");
    this.divContent.className = this.getCssRuleName("treenode_divContent");
    if (rialto.config.userAgentIsIE) {
        this.divContent.style.height = "0px";
    }
    this.img1 = document.createElement("DIV");
    this.img1.className = this.getCssRuleName("treenode_img");
    this.divHeader.appendChild(this.img1);
    this.img2 = document.createElement("DIV");
    this.img2.style.backgroundImage = "url('" + this.icon + "')";
    this.img2.className = this.getCssRuleName("treenode_img");
    this.img2.style.left = 19;
    this.divHeader.appendChild(this.img2);
    this.divText = document.createElement("DIV");
    this.divText.className = this.getCssRuleName("treenode_divText");
    this.divText.style.left = 38;
    this.divText.appendChild(document.createTextNode(this.text));
    this.divText.title = this.tooltip;
    this.divHeader.appendChild(this.divText);
    this.divT = document.createElement("DIV");
    this.divT.style.display = "none";
    this.divT.style.position = "absolute";
    this.divT.style.width = "19px";
    this.divT.style.height = "100%";
    this.divT.style.background = "url('" + rialtoConfig.buildImageURL("images/imTreeview/icT/I.gif") + "') repeat";
    this.divContent.appendChild(this.divT);
    this.divCont = document.createElement("DIV");
    this.divCont.style.left = "19px";
    this.divCont.style.position = "relative";
    this.divCont.style.overflow = "hidden";
    this.divContent.appendChild(this.divCont);
    this.divContent.style.display = "none";
    this.divExt.appendChild(this.divHeader);
    this.divExt.appendChild(this.divContent);
    if (this.reload) {
        this.noeudReload = new rialto.widget.TreeNode({draggable:false, target:false, text:"Loading...", icon:"images/imTreeview/find.small.gif"});
        this.add(this.noeudReload);
        this.noeudReload.removeAllEvent();
    }
    this.addEvent(this.img1, "onclick", this.toggle);
    this.addEvent(this.img2, "onclick", this.click);
    this.addEvent(this.divText, "onclick", this.click);
};
rialto.widget.TreeNode.prototype = new rialto.widget.AbstractContainer;
rialto.widget.TreeNode.prototype.setUp = function (objPar) {
    if (objPar.typeInfo != null) {
        rialto.deprecated("TREENODE", "objPar.typeInfo", "objPar.info");
        this.setInfo(objPar.typeInfo);
    }
    if (objPar.info != null) {
        this.setInfo(objPar.info);
    }
    if (rialto.lang.isString(objPar.text)) {
        this.text = objPar.text;
        this.tooltip = this.text;
    }
    if (rialto.lang.isString(objPar.icon, true)) {
        this.icon = rialtoConfig.buildImageURL(objPar.icon);
        this.icon2 = this.icon;
    }
    if (rialto.lang.isString(objPar.icon2, true)) {
        this.icon2 = rialtoConfig.buildImageURL(objPar.icon2);
    }
    if (objPar.onclick) {
        this._onclick = objPar.onclick;
    }
    if (rialto.lang.isBoolean(objPar.open)) {
        this.open = objPar.open;
    }
    if (rialto.lang.isBoolean(objPar.reload)) {
        this.reload = objPar.reload;
    }
    if (rialto.lang.isBoolean(objPar.draggable)) {
        this.draggable = objPar.draggable;
    }
    if (rialto.lang.isBoolean(objPar.target)) {
        this.target = objPar.target;
    }
    if (rialto.lang.isString(objPar.url, true)) {
        this.url = objPar.url;
    }
    if (rialto.lang.isString(objPar.tooltip, true)) {
        this.tooltip = objPar.tooltip;
    }
};
rialto.widget.TreeNode.prototype.setTooltip = function (tooltip) {
    this.tooltip = tooltip;
    if (this.divText) {
        this.divText.title = this.tooltip;
    }
};
rialto.widget.TreeNode.prototype.setInfo = function (info) {
    if (rialto.lang.isString(info)) {
        this.info = info;
    }
};
rialto.widget.TreeNode.prototype.getInfo = function () {
    return this.info;
};
rialto.widget.TreeNode.prototype.setDraggable = function (draggable) {
    this.draggable = draggable;
};
rialto.widget.TreeNode.prototype.getDraggable = function () {
    return this.draggable;
};
rialto.widget.TreeNode.prototype.release = function () {
};
rialto.widget.TreeNode.prototype.getHtmlCont = function () {
    return this.divCont;
};
rialto.widget.TreeNode.prototype.addBehavior = function () {
    var oThis = this;
    this.divText.oRia = this;
    this.bMiss = false;
    this.bTarg = false;
    if (!this.bDD) {
        if (this.draggable && this.refTree.draggableNode) {
            this.addDDBehavior();
            this.bMiss = true;
        }
        if (this.target && this.refTree.targetNode) {
            this.addTargetBehavior();
            this.bTarg = true;
        }
    }
    this.bDD = true;
};
rialto.widget.TreeNode.prototype.addDDBehavior = function () {
    rialto.widgetBehavior.affect(this.divText, "Missile", {bMUpAction:false, bRectLim:false, ghost:{bIcone:true, aspect:"icon"}, domainTargets:"tree.node", targetChoice:"firstIsBetter"});
    var oThis = this;
    this.divText.afterClic = function (e) {
        oThis.click();
    };
};
rialto.widget.TreeNode.prototype.addTargetBehavior = function () {
    var oThis = this;
    rialto.widgetBehavior.affect(this.divText, "Target", {missileAsOnePixel:true, domain:"tree.node"});
    this.divText.oRia = this;
    this.divText.DDOuter = function (missile) {
        oThis.refTree.divDD.style.display = "none";
        oThis.divText.style.backgroundColor = "";
    };
    this.divText.DDHover = function (missile) {
        var top = missile.top;
        if (top > 5 && top < 18) {
            this.insert = "add";
            oThis.refTree.divDD.style.display = "none";
            oThis.divText.style.backgroundColor = "#99CCFF";
        } else {
            oThis.divText.style.backgroundColor = "";
            if (top < 5) {
                this.insert = "before";
                oThis.refTree.divDD.style.top = -3;
            } else {
                this.insert = "after";
                oThis.refTree.divDD.style.top = 20;
            }
            oThis.refTree.divDD.style.display = "block";
            oThis.divExt.appendChild(oThis.refTree.divDD);
        }
    };
    this.divText.receiveAfterDrop = function (missile) {
        oThis.refTree.divDD.style.display = "none";
        if (rialto.config.userAgentIsIE) {
            var bBugIe = false;
            var nextNode = missile.oHtml.oRia.next();
            if (nextNode && nextNode.hasChild()) {
                bBugIe = true;
            }
        }
        var oMissile = missile.oHtml.oRia;
        var dropOk = oThis.beforeDropIn(oMissile);
        if (dropOk) {
            var oldParentNode = oMissile.rialtoParent;
            var resRech = oThis.refTree.exist(oMissile, oThis.id);
            if (!resRech.trouve) {
                if (this.oRia != oMissile) {
                    if (this.insert == "add") {
                        oThis.addNode(oMissile);
                    } else {
                        if (this.insert == "before") {
                            oThis.insertBefore(oMissile);
                        } else {
                            oThis.insertAfter(oMissile);
                        }
                    }
                    if (rialto.config.userAgentIsIE && bBugIe) {
                        window.setTimeout("rialto.session.objects['" + nextNode.id + "'].setVisible(false);rialto.session.objects['" + nextNode.id + "'].setVisible(true)", 100);
                    }
                    oThis.onDropIn(oMissile, oldParentNode);
                }
            }
        }
    };
};
rialto.widget.TreeNode.prototype.removeBehavior = function () {
    if (this.bMiss) {
        rialto.widgetBehavior.desaffect(this.divText, "Missile");
    }
    if (this.bTarg) {
        rialto.widgetBehavior.desaffect(this.divText, "Target");
    }
    this.bMiss = false;
    this.bTarg = false;
    this.bDD = false;
};
rialto.widget.TreeNode.prototype.reloadNode = function (url) {
    var i = url.indexOf("?");
    if (i == -1) {
        url += "?TREEID=" + this.refTree.id + "&NODEID=" + this.id;
    } else {
        url += "&TREEID=" + this.refTree.id + "&NODEID=" + this.id;
    }
    this.remote = new rialto.io.AjaxRequest({url:url, callBackObjectOnSuccess:this, withWaitWindow:false, onSuccess:this.refreshReloadNode});
    this.remote.load("");
    if (!this.open) {
        this.toggle();
    }
};
rialto.widget.TreeNode.prototype.refreshReloadNode = function (request) {
    try {
        this.reload = false;
        this.noeudReload.remove();
        var colNode = eval("(" + request.responseText + ")");
        for (var i = 0; i < colNode.arrNode.length; i++) {
            var node = new rialto.widget.TreeNode(colNode.arrNode[i].objPar);
            this.addNode(node);
        }
    }
    catch (e) {
        alert(e.message);
    }
};
rialto.widget.TreeNode.prototype.click = function (e) {
    this.selNode();
    if (rialto.lang.isString(this._onclick)) {
        eval(this._onclick);
    } else {
        this._onclick();
    }
    var stopClick;
    stopClick = this.onclick();
    if (!stopClick) {
        this.refTree.onclick(this);
    }
};
rialto.widget.TreeNode.prototype.toggle = function () {
    var oThis = this;
    if (this.hasChild()) {
        if (this.open) {
            this.divContent.style.display = "none";
            this.open = false;
        } else {
            this.divContent.style.display = "block";
            this.open = true;
            if (this.reload) {
                if (this.url) {
                    this.reloadNode(this.url);
                }
            }
        }
        this.changeIcone();
    }
};
rialto.widget.TreeNode.prototype.setText = function (sText) {
    this.text = sText;
    this.divText.removeChild(this.divText.firstChild);
    this.divText.appendChild(document.createTextNode(this.text));
};
rialto.widget.TreeNode.prototype.selNode = function () {
    if (this.refTree.boolSelActive) {
        if (this.refTree.currentSelNode != null && this.refTree.currentSelNode != this) {
            this.refTree.currentSelNode.deSelNode();
        }
        this.refTree.currentSelNode = this;
        if (this.hasChild()) {
            this.divText.className += " " + this.getCssRuleName("treenode_nodeSel");
        } else {
            this.divText.className += " " + this.getCssRuleName("treenode_textSel");
        }
    }
};
rialto.widget.TreeNode.prototype.deSelNode = function () {
    if (this.refTree.boolSelActive) {
        this.divText.className = this.getCssRuleName("treenode_divText");
        if (this.refTree.currentSelNode != null && this.refTree.currentSelNode == this) {
            this.refTree.currentSelNode = null;
        }
    }
};
rialto.widget.TreeNode.prototype.existChild = function (nodeID) {
    for (var i = 0; i < this.arrChild.length; i++) {
        if (this.arrChild[i].id == nodeID) {
            return i;
        }
    }
    return -1;
};
rialto.widget.TreeNode.prototype.baseRemove = rialto.widget.AbstractComponent.prototype.remove;
rialto.widget.TreeNode.prototype.remove = function (bFromContainer) {
    if (this == this.refTree.currentSelNode) {
        this.refTree.currentSelNode = null;
    }
    this.removeBehavior();
    this.baseRemove(bFromContainer);
    if (this.rialtoParent) {
        if (this.rialtoParent.hasChild()) {
            var lastNode = this.rialtoParent.last();
            lastNode.changeIcone();
        } else {
            this.rialtoParent.changeIcone();
        }
    }
};
rialto.widget.TreeNode.prototype.removeNode = function (id, bjustHTML) {
    rialto.deprecated("TREENODE", "removeNode", "removeChild");
    var node = this.getChildByID(id);
    if (node != null) {
        this.removeChild(node);
    }
};
rialto.widget.TreeNode.prototype.adaptToContext = function () {
    if (this.refTree != this.rialtoParent.refTree) {
        this.setRefTree(this.rialtoParent.refTree);
    }
    if (this.refTree) {
        this.changeIcone();
    }
};
rialto.widget.TreeNode.prototype.setRefTree = function (refTree) {
    if (this.bDD) {
        this.removeBehavior();
    }
    this.refTree = refTree;
    this.addBehavior();
    this.changeIcone();
    for (var i = 0; i < this.arrChild.length; i++) {
        var node = this.arrChild[i];
        node.setRefTree(refTree);
    }
};
rialto.widget.TreeNode.prototype.baseDetach = rialto.widget.AbstractComponent.prototype.detach;
rialto.widget.TreeNode.prototype.detach = function () {
    if (this.rialtoParent && this.rialtoParent.changeIcone) {
        var isLast = this.isLast();
        var isTheLast = (this.rialtoParent.arrChild.length == 1);
        var rp = this.rialtoParent;
        this.baseDetach();
        if (isTheLast) {
            rp.changeIcone();
        } else {
            if (isLast) {
                rp.last().changeIcone();
            }
        }
    } else {
        this.baseDetach();
    }
};
rialto.widget.TreeNode.prototype.attach = function (node) {
    node.add(this);
};
rialto.widget.TreeNode.prototype.addNode = function (node, omit_alreadyAdd_check) {
    rialto.deprecated("TREENODE", "addNode", "add");
    this.add(node, omit_alreadyAdd_check);
};
rialto.widget.TreeNode.prototype.add = function (node, omit_alreadyAdd_check) {
    if (node.isAttached()) {
        if (!omit_alreadyAdd_check && node.rialtoParent == this) {
            return;
        }
        node.detach();
    }
    this.record(node);
    this.divCont.appendChild(node.divExt);
    if (this.open) {
        this.divContent.style.display = "block";
    } else {
        this.divContent.style.display = "none";
    }
    node.afterAttach();
    if (this.refTree) {
        if (this.hasChild() && this.arrChild.length > 1) {
            this.last().previous().changeIcone();
        } else {
            this.changeIcone();
        }
    }
};
rialto.widget.TreeNode.prototype.insertBefore = function (node) {
    if (node.isAttached()) {
        node.detach();
    }
    node.rialtoParent = this.rialtoParent;
    ind = this.getIndex();
    if (ind != -1) {
        rialto.array.insert(this.rialtoParent.arrChild, ind, node);
        this.rialtoParent.divCont.insertBefore(node.divExt, this.divExt);
    }
    node.afterAttach();
};
rialto.widget.TreeNode.prototype.insertAfter = function (node) {
    if (this.isLast()) {
        this.rialtoParent.add(node, true);
    } else {
        var nodeP = this.next();
        if (nodeP != node) {
            nodeP.insertBefore(node);
        }
    }
};
rialto.widget.TreeNode.prototype.changeIcone = function () {
    this.divT.style.display = "none";
    if (!this.refTree.withT) {
        if (this.hasChild()) {
            this.srcPlus = rialtoConfig.buildImageURL("images/imTreeview/icT/plus.gif");
            this.srcMoins = rialtoConfig.buildImageURL("images/imTreeview/icT/minus.gif");
        }
    } else {
        if (this.isLast() || (this.isLast() && this.isFirst())) {
            if (this.hasChild()) {
                this.srcPlus = rialtoConfig.buildImageURL("images/imTreeview/icT/Lplus.gif");
                this.srcMoins = rialtoConfig.buildImageURL("images/imTreeview/icT/Lminus.gif");
            } else {
                this.srcPlus = rialtoConfig.buildImageURL("images/imTreeview/icT/L.gif");
                this.srcMoins = rialtoConfig.buildImageURL("images/imTreeview/icT/L.gif");
            }
        } else {
            if (this.hasChild()) {
                this.srcPlus = rialtoConfig.buildImageURL("images/imTreeview/icT/Tplus.gif");
                this.srcMoins = rialtoConfig.buildImageURL("images/imTreeview/icT/Tminus.gif");
                this.divT.style.display = "block";
            } else {
                this.srcPlus = rialtoConfig.buildImageURL("images/imTreeview/icT/T.gif");
                this.srcMoins = rialtoConfig.buildImageURL("images/imTreeview/icT/T.gif");
            }
        }
    }
    if (this.open) {
        this.img1.style.background = "url('" + this.srcMoins + "')";
        this.img2.style.background = "url('" + this.icon2 + "')";
    } else {
        this.img1.style.background = "url('" + this.srcPlus + "')";
        this.img2.style.background = "url('" + this.icon + "')";
    }
    if (!this.refTree.withT) {
        if (this.hasChild()) {
            this.img1.style.visibility = "visible";
        } else {
            this.img1.style.visibility = "hidden";
        }
    } else {
        this.img1.style.visibility = "visible";
    }
};
rialto.widget.TreeNode.prototype.isLast = function () {
    if (!this.root) {
        return (this.rialtoParent.arrChild[this.rialtoParent.arrChild.length - 1] == this);
    } else {
        return true;
    }
};
rialto.widget.TreeNode.prototype.getIndex = function () {
    return rialto.array.indexOf(this.rialtoParent.arrChild, this);
};
rialto.widget.TreeNode.prototype.getIndexInTree = function () {
    ob = this.refTree.getCount(this);
    return ob.nbC;
};
rialto.widget.TreeNode.prototype.isFirst = function () {
    if (!this.root) {
        return (this.rialtoParent.arrChild[0] == this);
    } else {
        return true;
    }
};
rialto.widget.TreeNode.prototype.first = function () {
    if (this.hasChild()) {
        return (this.arrChild[0]);
    } else {
        return null;
    }
};
rialto.widget.TreeNode.prototype.last = function () {
    if (this.hasChild()) {
        return (this.arrChild[this.arrChild.length - 1]);
    } else {
        return null;
    }
};
rialto.widget.TreeNode.prototype.next = function () {
    if (!this.root) {
        var index = this.getIndex();
        if (index < this.rialtoParent.arrChild.length - 1) {
            return this.rialtoParent.arrChild[index + 1];
        } else {
            return null;
        }
    } else {
        return null;
    }
};
rialto.widget.TreeNode.prototype.previous = function () {
    if (!this.root) {
        var index = this.getIndex();
        if (index > 0) {
            return this.rialtoParent.arrChild[index - 1];
        } else {
            return null;
        }
    } else {
        return null;
    }
};
rialto.widget.TreeNode.prototype.setStyle = function (obStyle) {
    for (prop in obStyle) {
        try {
            this.divText.style[prop] = obStyle[prop];
        }
        catch (erreur) {
        }
    }
};
rialto.widget.TreeNode.prototype.updateSize = function () {
};
rialto.widget.TreeNode.prototype.updateHeight = function () {
};
rialto.widget.TreeNode.prototype.updateWidth = function () {
};
rialto.widget.TreeNode.prototype.onclick = function () {
};
rialto.widget.TreeNode.prototype.onclickActionCommuneBefClic = function () {
};
rialto.widget.TreeNode.prototype.beforeDropIn = function (node) {
    return true;
};
rialto.widget.TreeNode.prototype.onDropIn = function (node, oldParentNode) {
};
rialto.widget.TreeNode.prototype._onclick = function () {
    if (!this.open) {
        this.toggle();
    }
};
rialto.widget.TreeNode.prototype.isDraggable = function () {
    return false;
};


rialto.widget.objFenData = function (width, height, divData, titre) {
    var oThis = this;
    var widthGlobal = document.body.clientWidth;
    var heightGlobal = document.body.clientHeight;
    var top = (heightGlobal / 2) - 120;
    var left = (widthGlobal / 2) - 100;
    this.fen = new rialto.widget.PopUp("fen", top, left, width, height, "", titre, "transparent");
    this.divData = divData;
    this.divData.className = "libNormal";
    this.divData.style.width = width - 25;
    this.divData.style.height = height - 35;
    this.divData.style.border = "1px outset white";
    this.divData.style.position = "absolute";
    this.divData.style.overflow = "auto";
    this.divData.style.top = 5;
    this.fen.add(this.divData);
    this.fen.onClose = function () {
        oThis.onclose();
    };
    var wBtn = parseInt(width) / 2 - 50;
    var hBtn = height - 25;
    this.BQUIT = new rialto.widget.Button(hBtn, wBtn, rialto.I18N.getLabel("lanCloseButtonText"), rialto.I18N.getLabel("lanCloseWindow"));
    this.BQUIT.onclick = function () {
        oThis.onclose();
        this.fen.closeWindow();
    };
    this.BQUIT.fen = this.fen;
    this.fen.add(this.BQUIT);
};
rialto.widget.objFenData.prototype.onclose = function () {
};
rialto.widget.Alert = function (mess) {
    this.message = mess;
    var oThis = this;
    var widthGlobal = document.body.clientWidth;
    var heightGlobal = document.body.clientHeight;
    var top = (heightGlobal / 2) - 120;
    var left = (widthGlobal / 2) - 100;
    this.width = ria.utils.measures.getTextSize(mess) + 40;
    if (this.width < 200) {
        this.width = 200;
    }
    this.fen = new rialto.widget.PopUp("fen", top, left, this.width, 50, this.message, "Information", "inherit");
    var wBtn = parseInt(this.width) / 2 - 57;
    var hBtn = 25;
    this.BQUIT = new rialto.widget.Button(hBtn, wBtn, rialto.I18N.getLabel("lanCloseButtonText"), rialto.I18N.getLabel("lanCloseWindow"));
    this.BQUIT.onclick = function () {
        oThis.onclose();
        oThis.fen.closeWindow();
    };
    this.BQUIT.fen = this.fen;
    this.fen.add(this.BQUIT.getHtmlExt());
};
rialto.widget.Alert.prototype.onclose = function () {
};
rialto.widget.Alert.prototype.getHtmlExt = function () {
    return this.fen.getHtmlExt();
};
rialto.widget.Alert.prototype.placeIn = function (par) {
    this.fen.placeIn(par);
};
rialto.widget.Alert.prototype.isContainer = false;
rialto.widget.Alert.prototype.setTop = function (top) {
    this.fen.setTop(top);
    this.top = top;
};
rialto.widget.Alert.prototype.setLeft = function (left) {
    this.fen.setLeft(left);
    this.left = left;
};
rialto.widget.Alert.prototype.setMessage = function (mess) {
    this.message = mess;
    var fenCont = this.fen.divCont;
    fenCont.removeChild(fenCont.firstChild);
    fenCont.appendChild(document.createTextNode(this.message));
};
rialto.widget.Alert.prototype.addText = function (text) {
    var width = getTailleTexte(text) + 40;
    if (this.width < width) {
        this.fen.modWidth(width - this.width);
        this.width = width;
        var wBtn = parseInt(this.width) / 2 - 57;
        this.BQUIT.setLeft(wBtn);
    }
    var div = document.createElement("DIV");
    div.style.position = "relative";
    div.appendChild(document.createTextNode(text));
    this.fen.add(div);
    this.fen.modHeight(20);
    this.BQUIT.moveBy(20, 0);
};
rialto.widget.Alert.prototype.remove = function () {
    this.fen.remove();
    this.BQUIT.remove();
};
rialto.widget.WaitWindow = function (objPar) {
    this.canBeCancel = true;
    this.text = rialto.I18N.getLabel("lanWaitWindowDefaultText");
    if (objPar) {
        if (rialto.lang.isBoolean(objPar.canBeCancel)) {
            this.canBeCancel = objPar.canBeCancel;
        }
        if (rialto.lang.isString(objPar.text)) {
            this.text = objPar.text;
        }
    }
    var widthGlobal = document.body.clientWidth;
    var heightGlobal = document.body.clientHeight;
    var top = (heightGlobal / 2) - 60;
    var left = (widthGlobal / 2) - 100;
    this.fen = new rialto.widget.PopUp("fen", top, left, 200, 100, "", " ", "inherit", {withCloseButon:false});
    var label = new rialto.widget.Label("label0", 5, 55, this.fen, this.text, "libelle2");
    var img = document.createElement("IMG");
    img.src = rialtoConfig.buildImageURL("images/sablier.gif");
    img.style.position = "absolute";
    img.style.height = "35px";
    img.style.width = "27px";
    img.style.left = "75px";
    img.style.top = "22px";
    this.fen.add(img);
    if (this.canBeCancel) {
        var oThis = this;
        this.BANN = new rialto.widget.Button(60, 50, rialto.I18N.getLabel("lanCancelButton"));
        this.BANN.onclick = function () {
            oThis.closeWindow();
            oThis.onclick();
        };
        this.fen.add(this.BANN);
    }
};
rialto.widget.WaitWindow.prototype.closeFen = function () {
    rialto.deprecated("rialto.widget.WaitWindow", "closeFen", "closeWindow");
};
rialto.widget.WaitWindow.prototype.closeWindow = function () {
    this.fen.closeWindow();
};
rialto.widget.WaitWindow.prototype.setVisible = function (visible) {
    this.fen.setVisible(visible);
};
rialto.widget.WaitWindow.prototype.onclick = function () {
    return true;
};


rialto.widget.TabFolder = function (objPar) {
    this.base = rialto.widget.AbstractContainer;
    objPar.type = "tabFolder";
    this.base(objPar);
    this.widthItem = 100;
    this.autoResizeTab = false;
    this.isClosable = true;
    this.draggableItem = true;
    this.orientation = "t";
    var oThis = this;
    this.setUp(objPar);
    this.divExt.style.top = this.top;
    this.divExt.style.left = this.left;
    this.divExt.style.width = this.width;
    this.divExt.style.height = this.height;
    this.divExt.style.position = this.position;
    this.divExt.style.overflow = "hidden";
    var oThis = this;
    this.divTab = document.createElement("DIV");
    this.divTab.className = this.getCssRuleName("tab_tabitem_" + this.orientation);
    this.divTab.style.overflow = "hidden";
    this.divCont = document.createElement("DIV");
    this.divCont.className = this.getCssRuleName("tab_cont");
    if (this.orientation == "t") {
        this.divTab.style.width = "100%";
        this.divCont.style.position = "relative";
    }
    if (this.orientation == "b") {
        this.divTab.style.width = "100%";
        this.divTab.style.position = "absolute";
        this.divCont.style.left = 0;
        this.divCont.style.top = 0;
    }
    if (this.orientation == "l") {
        this.divTab.style.height = "100%";
        this.divCont.style.top = 0;
        this.divCont.style.position = "absolute";
    }
    if (this.orientation == "r") {
        this.divTab.style.height = "100%";
        this.divTab.style.position = "absolute";
        this.divCont.style.left = "0";
        this.divCont.style.top = 0;
    }
    this.divExt.appendChild(this.divTab);
    this.divExt.appendChild(this.divCont);
    this.arrTabItem = new Array();
    this.visibleArea = new Object;
    this.visibleArea.indDeb = 0;
    this.visibleArea.indFin = 0;
    this.visibleArea.tailleFen = 0;
    this.swapInProgress = false;
    this.divImg = document.createElement("DIV");
    this.divImg.className = this.getCssRuleName("tab_imgArea_" + this.orientation);
    this.divImg.style.display = "none";
    this.divTab.appendChild(this.divImg);
    var ob = {position:"relative", boolFloatRight:true, bWithoutRecordInSession:true};
    if (this.isClosable) {
        this.btnClose = new rialto.widget.Image("tab_crossCloseOff", -2, 3, this.divImg, rialto.I18N.getLabel("lanCloseTab"), "tab_crossCloseOn", ob);
        this.btnClose.onclick = function () {
            oThis.removeTabItem(oThis.indActiveTab);
        };
    }
    if (!this.autoResizeTab) {
        var ob = {position:"absolute", boolFloatRight:true, bWithoutRecordInSession:true};
        this.MC = new rialto.widget.Image("tab_listOff", -8, 3, this.divImg, rialto.I18N.getLabel("lanAnotherTab"), "tab_listOn", ob);
        this.MC.setVisible(false);
        this.MC.onclick = function (e) {
            var ev = e || window.event;
            oThis.displayMenu(ev);
        };
        ob = {position:"relative", boolFloatRight:true, srcDisabled:"tab_rightArrowGroundlessOff", bWithoutRecordInSession:true};
        this.next = new rialto.widget.Image("tab_rightArrowOff", -11, 3, this.divImg, rialto.I18N.getLabel("lanGridButtonNext"), "tab_rightArrowOn", ob);
        this.next.setVisible(false);
        this.next.onclick = function () {
            if (!oThis.swapInProgress) {
                oThis.moveOneTab(1);
            }
        };
        ob = {position:"relative", boolFloatRight:true, srcDisabled:"tab_leftArrowGroundlessOff", bWithoutRecordInSession:true};
        this.previous = new rialto.widget.Image("tab_leftArrowOff", -14, 3, this.divImg, rialto.I18N.getLabel("lanGridButtonPrevious"), "tab_leftArrowOn", ob);
        this.previous.setVisible(false);
        this.previous.onclick = function () {
            if (!oThis.swapInProgress) {
                oThis.moveOneTab(-1);
            }
        };
    }
    if (objPar.parent) {
        this.attach(objPar.parent);
    }
};
rialto.widget.TabFolder.prototype = new rialto.widget.AbstractContainer;
rialto.widget.TabFolder.prototype.setUp = function (objPar) {
    if (objPar.autoRedimTab != null) {
        rialto.deprecated("TABFOLDER", "objPar.autoRedimTab", "objPar.autoResizeTab");
        objPar.autoResizeTab = objPar.autoRedimTab;
    }
    if (rialto.lang.isBoolean(objPar.autoResizeTab)) {
        this.autoResizeTab = objPar.autoResizeTab;
    }
    if (rialto.lang.isBoolean(objPar.isClosable)) {
        this.isClosable = objPar.isClosable;
    }
    if (rialto.lang.isBoolean(objPar.draggableItem)) {
        this.draggableItem = objPar.draggableItem;
    }
    if (objPar.widthTabName != null) {
        rialto.deprecated("TABFOLDER", "objPar.widthTabName", "objPar.widthItem");
        objPar.widthItem = objPar.widthTabName;
    }
    if (rialto.lang.isNumber(objPar.widthItem)) {
        this.widthItem = objPar.widthItem;
    }
    if (rialto.lang.isStringIn(objPar.orientation, ["t", "l", "r", "b"])) {
        this.orientation = objPar.orientation;
        if (rialto.lang.isStringIn(this.orientation, ["r", "l"])) {
            this.draggableItem = false;
            this.autoResizeTab = true;
            this.isClosable = false;
        }
    }
};
rialto.widget.TabFolder.prototype.release = function (e, shift) {
    if (this.btnClose) {
        this.btnClose.remove();
    }
    if (this.MC) {
        this.MC.remove();
    }
    if (this.next) {
        this.next.remove();
    }
    if (this.previous) {
        this.previous.remove();
    }
    if (this.liste) {
        this.liste.remove();
    }
    if (this.divTirette) {
        rialto.widgetBehavior.desaffect(this.divTirette, "DragAndDrop");
    }
};
rialto.widget.TabFolder.prototype.getHtmlCont = function () {
    return this.divCont;
};
rialto.widget.TabFolder.prototype.adaptAfterSizeChange = function () {
    this.updateSize();
};
rialto.widget.TabFolder.prototype.adaptToContext = function () {
    if (this.orientation == "r" || this.orientation == "l") {
        this.$tabSize = getComputStyle(this.divTab, "width");
    } else {
        this.$tabSize = getComputStyle(this.divTab, "height");
    }
    if (this.orientation == "l") {
        this.divCont.style.left = this.$tabSize;
    }
    this.updateSize();
    if (this.orientation == "r") {
        this.divTab.style.left = this.divCont.offsetWidth;
    }
    if (this.orientation == "b") {
        this.divTab.style.top = this.divCont.offsetHeight;
    }
};
rialto.widget.TabFolder.prototype.updateWidth = function () {
    if (this.visible == true) {
        this.divCont.style.overflow = "hidden";
        if (this.autoResizableW) {
            ria.utils.measures.$setWidthWithAllAvailable(this.divExt);
        } else {
            this.divExt.style.width = this.width;
        }
        var delta = 0;
        if (this.orientation == "r") {
            delta = this.$tabSize;
        }
        ria.utils.measures.$setWidthWithAllAvailable(this.divCont, delta);
        this.resizeChilds(true, false);
        this.redimtabTitle();
    }
};
rialto.widget.TabFolder.prototype.updateHeight = function () {
    if (this.visible == true) {
        this.divCont.style.overflow = "hidden";
        if (this.autoResizableW) {
            ria.utils.measures.$setHeightWithAllAvailable(this.divExt);
        } else {
            this.divExt.style.height = this.height;
        }
        var delta = 0;
        if (this.orientation == "b") {
            delta = this.$tabSize;
        }
        ria.utils.measures.$setHeightWithAllAvailable(this.divCont, delta);
        this.resizeChilds(false, true);
        this.divCont.style.overflow = "auto";
    }
};
rialto.widget.TabFolder.prototype.moveOneTab = function (nbreTab) {
    if (nbreTab > 0) {
        this.ongAaug = this.arrTabItem[this.visibleArea.indFin + 1];
        this.ongAdim = this.arrTabItem[this.visibleArea.indDeb];
        indongADim = this.visibleArea.indDeb;
    } else {
        this.ongAaug = this.arrTabItem[this.visibleArea.indDeb - 1];
        this.ongAdim = this.arrTabItem[this.visibleArea.indFin];
        indongADim = this.visibleArea.indFin;
    }
    this.visibleArea.indDeb += nbreTab;
    this.visibleArea.indFin += nbreTab;
    this.ongAaug.setWidth(0);
    this.ongAaug.displayTitle();
    if (this.indActiveTab == indongADim) {
        this.activeTab(indongADim + nbreTab);
    }
    this.majImages();
    this.swapEffect();
};
rialto.widget.TabFolder.prototype.swapEffect = function (oldDelai) {
    this.swapInProgress = true;
    if (!oldDelai) {
        delai = 100;
    } else {
        delai = oldDelai / 10;
    }
    if (parseInt(this.ongAdim.tabTitle.style.width) > 20) {
        this.ongAdim.changeTitleWidth(-20);
        this.ongAaug.changeTitleWidth(+20);
        this.time = window.setTimeout("rialto.session.objects['" + this.id + "'].swapEffect(" + delai + ");", delai);
    } else {
        this.ongAdim.setWidth(this.widthItem);
        this.ongAdim.setVisible(false);
        this.ongAaug.setWidth(this.widthItem);
        this.swapInProgress = false;
    }
};
rialto.widget.TabFolder.prototype.activeTabByName = function (tab) {
    var indTab = rialto.array.indexOf(this.arrTabItem, tab);
    if (indTab != -1) {
        this.activeTab(indTab);
    }
};
rialto.widget.TabFolder.prototype.activeTab = function (nOnglet) {
    if (this.arrTabItem.length < nOnglet) {
        console.error("ther is no" + nOnglet);
    } else {
        var onglet = this.arrTabItem[nOnglet];
        if (onglet.enable) {
            if (!this.autoResizeTab) {
                this.setTabVisible(nOnglet);
            }
            onglet.enableTabItem();
            this.indActiveTab = nOnglet;
        }
    }
};
rialto.widget.TabFolder.prototype.replaceAfterDD = function (tab, place, sens) {
    if (place == this.arrTabItem.length - 1) {
        this.divTab.appendChild(tab.tabTitle);
    } else {
        if (sens) {
            placeInser = place + 1;
        } else {
            placeInser = place;
        }
        this.divTab.insertBefore(tab.tabTitle, this.arrTabItem[placeInser].tabTitle);
    }
    var oldPlace = rialto.array.indexOf(this.arrTabItem, tab);
    this.arrTabItem.splice(oldPlace, 1);
    rialto.array.insert(this.arrTabItem, place, tab);
    this.activeTab(place);
};
rialto.widget.TabFolder.prototype.addTabItem = function (titre, enable) {
    var onglet = new rialto.widget.TabItem(titre, this, enable);
    if (this.isClosable) {
        if (this.arrTabItem.length == 0) {
            this.divImg.style.display = "block";
        }
    }
    var ind = this.arrTabItem.push(onglet);
    this.divTab.appendChild(onglet.tabTitle);
    onglet.attach(this.divCont);
    this.redimtabTitle(true);
    if (this.autoResizeTab) {
        onglet.setVisible(true);
        this.majImages();
    }
    var oThis = this;
    if (this.draggableItem) {
        rialto.widgetBehavior.affect(onglet.tabTitle, "DragAndDrop", {oHtmlEvtTarget:onglet.div, ghost:{aspect:"rect"}, bSelectMark:false, bMUpAction:false, isWithLimitsDisplayed:false, movingLimits:{orientation:"h"}});
        onglet.tabTitle.afterDD = function (dTop, dLeft) {
            var indInit = rialto.array.indexOf(oThis.arrTabItem, onglet);
            var decal = parseInt(dLeft / (this.offsetWidth));
            var nvPlace = indInit + decal;
            if (nvPlace > oThis.visibleArea.indFin) {
                nvPlace = oThis.visibleArea.indFin;
            } else {
                if (nvPlace < 0) {
                    nvPlace = 0;
                }
            }
            oThis.replaceAfterDD(onglet, nvPlace, (decal > 0));
        };
        onglet.tabTitle.afterClic = function () {
            oThis.activeTab(rialto.array.indexOf(oThis.arrTabItem, onglet));
        };
    } else {
        onglet.tabTitle.onclick = function () {
            oThis.activeTab(rialto.array.indexOf(oThis.arrTabItem, onglet));
        };
    }
    this.activeTab(ind - 1);
    return onglet;
};
rialto.widget.TabFolder.prototype.isVisible = function (nOnglet) {
    return (nOnglet >= this.visibleArea.indDeb && nOnglet <= this.visibleArea.indFin);
};
rialto.widget.TabFolder.prototype.setTabVisible = function (nOnglet) {
    if (!this.isVisible(nOnglet)) {
        if (nOnglet < this.visibleArea.indDeb) {
            this.visibleArea.indDeb = nOnglet;
            this.visibleArea.indFin = this.visibleArea.indDeb + this.visibleArea.tailleFen - 1;
        } else {
            this.visibleArea.indFin = nOnglet;
            this.visibleArea.indDeb = this.visibleArea.indFin - this.visibleArea.tailleFen + 1;
        }
        this.majZoneVisible();
    }
};
rialto.widget.TabFolder.prototype.decalvisibleArea = function (nbreTab) {
    this.visibleArea.indDeb += nbreTab;
    this.visibleArea.indFin = this.visibleArea.indDeb + this.visibleArea.tailleFen - 1;
    this.majZoneVisible();
    if (!this.isVisible(this.indActiveTab)) {
        this.activeTab(this.visibleArea.indDeb);
    }
};
rialto.widget.TabFolder.prototype.majZoneVisible = function (nOnglet) {
    for (var i = 0; i < this.arrTabItem.length; i++) {
        if (i < this.visibleArea.indDeb || i > this.visibleArea.indFin) {
            this.arrTabItem[i].setVisible(false);
        } else {
            var onglet = this.arrTabItem[i];
            if (i == this.indActiveTab) {
                onglet.setVisible(true);
            } else {
                onglet.displayTitle();
            }
        }
    }
    this.majImages();
};
rialto.widget.TabFolder.prototype.removeTabItem = function (nOnglet) {
    onglet = this.arrTabItem[nOnglet];
    onglet.onClose();
    rialto.array.remove(this.arrTabItem, onglet);
    onglet.remove();
    if (nOnglet == this.indActiveTab) {
        if (this.arrTabItem.length > 0) {
            this.activeTab(this.arrTabItem.length - 1);
        }
    } else {
        if (nOnglet < this.indActiveTab) {
            this.indActiveTab -= 1;
        }
    }
    this.redimtabTitle();
    if (this.isClosable) {
        if (this.arrTabItem.length == 0) {
            this.divImg.style.display = "none";
        }
    }
};
rialto.widget.TabFolder.prototype.redimtabTitle = function (bDisplayEnd) {
    var tailleTot = (this.arrTabItem.length) * this.widthItem;
    var sizeImgArea = this.divImg.offsetWidth;
    if (this.autoResizeTab) {
        if (this.orientation == "t" || this.orientation == "b") {
            if (tailleTot > this.divTab.offsetWidth - sizeImgArea) {
                taille = Math.floor((this.divTab.offsetWidth - sizeImgArea) / this.arrTabItem.length);
                for (i = 0; i < this.arrTabItem.length; i++) {
                    this.arrTabItem[i].setWidth(Math.max(0, taille));
                }
            }
        } else {
            if (tailleTot > this.divTab.offsetHeight - sizeImgArea) {
                taille = Math.floor((this.divTab.offsetHeight - sizeImgArea) / this.arrTabItem.length);
                for (i = 0; i < this.arrTabItem.length; i++) {
                    this.arrTabItem[i].setHeight(Math.max(0, taille));
                }
            }
        }
        this.visibleArea.tailleFen = this.arrTabItem.length;
        this.visibleArea.indDeb = 0;
        this.visibleArea.indFin = this.arrTabItem.length - 1;
    } else {
        if (tailleTot > this.divTab.offsetWidth - sizeImgArea) {
            this.visibleArea.tailleFen = parseInt((this.divTab.offsetWidth - sizeImgArea) / this.widthItem);
        } else {
            this.visibleArea.tailleFen = this.arrTabItem.length;
        }
        if (bDisplayEnd) {
            this.visibleArea.indFin = this.arrTabItem.length - 1;
            this.visibleArea.indDeb = this.visibleArea.indFin - this.visibleArea.tailleFen + 1;
        } else {
            this.visibleArea.indDeb = 0;
            this.visibleArea.indFin = this.visibleArea.indDeb + this.visibleArea.tailleFen - 1;
            this.setTabVisible(this.indActiveTab);
        }
        this.majZoneVisible();
    }
};
rialto.widget.TabFolder.prototype.displayMenu = function (e, shift) {
    var oThis = this;
    var width = 0;
    if (this.divTirette) {
        rialto.widgetBehavior.desaffect(this.divTirette, "DragAndDrop");
    }
    if (this.liste) {
        this.liste.remove();
    }
    var ob = {name:"MENU-ONGLET", className:"tab_list", bWithoutRecordInSession:true};
    this.liste = new rialto.widget.simpleMenu(ob);
    var divVisible = document.createElement("DIV");
    divVisible.className = this.getCssRuleName("tab_list_visibleArea");
    divVisible.style.height = parseInt(this.visibleArea.tailleFen) * 22;
    divVisible.style.top = this.visibleArea.indDeb * 23;
    this.divTirette = document.createElement("DIV");
    this.divTirette.className = this.getCssRuleName("tab_tirette");
    divVisible.appendChild(this.divTirette);
    this.divTirette.style.top = ((this.visibleArea.tailleFen * 22) / 2) - 15;
    this.liste.add(divVisible);
    this.liste.onclick = function (item) {
        oThis.activeTab(item.ind);
    };
    this.liste.onOver = function (item) {
        oThis.divTirette.ind = item.ind;
    };
    for (var i = 0; i < this.arrTabItem.length; i++) {
        var objStyle = new Object;
        var css = null;
        width = Math.max(width, ria.utils.measures.getTextSize(this.arrTabItem[i].title, this.getCssRuleName("tab_list_item_hilite")));
        var obj = {text:this.arrTabItem[i].title, heigth:22, clOver:this.getCssRuleName("tab_list_item_hilite"), clOut:this.getCssRuleName("tab_list_item")};
        if (this.isVisible(i)) {
            css = this.getCssRuleName("tab_list_item_visible");
        }
        if (i == this.indActiveTab) {
            css = this.getCssRuleName("tab_list_item_enable");
        }
        if (!this.arrTabItem[i].enable) {
            css = this.getCssRuleName("tab_list_item_disable");
        }
        var item = this.liste.addItem(obj);
        if (css) {
            item.setClassName(css);
        }
    }
    width += 20;
    this.liste.setWidth(width + this.divTirette.offsetWidth);
    divVisible.style.width = parseInt(width);
    this.divTirette.style.left = parseInt(width);
    rialto.widgetBehavior.affect(this.divTirette, "DragAndDrop", {oHtmlToMove:divVisible, bSelectMark:false, isWithLimitsDisplayed:false, movingLimits:{orientation:"v"}, magneticsGrid:{heightRow:23}});
    this.divTirette.afterDD = function (dTop, dLeft) {
        var decal = parseInt(dTop / 22);
        oThis.decalvisibleArea(decal);
        oThis.liste.fermezoneMenu();
    };
    this.divTirette.afterClic = function () {
        oThis.liste.fermezoneMenu();
        oThis.activeTab(this.ind);
    };
    var ev = e || window.event;
    this.liste.affichezoneMenu(ev, shift);
};
rialto.widget.TabFolder.prototype.majImages = function () {
    if (!this.autoResizeTab) {
        if (this.visibleArea.tailleFen == this.arrTabItem.length) {
            if (!this.isClosable) {
                this.divImg.style.display = "none";
            } else {
                this.previous.setVisible(false);
                this.next.setVisible(false);
                this.MC.setVisible(false);
                this.divImg.style.width = 17;
            }
        } else {
            if (!this.isClosable) {
                this.divImg.style.width = 60;
                this.divImg.style.display = "block";
            } else {
                this.divImg.style.width = 70;
            }
            this.previous.setVisible(true);
            this.next.setVisible(true);
            this.MC.setVisible(true);
            if (this.visibleArea.indDeb == 0) {
                this.previous.setEnable(false);
            } else {
                this.previous.setEnable(true);
            }
            if (this.visibleArea.indFin == this.arrTabItem.length - 1) {
                this.next.setEnable(false);
            } else {
                this.next.setEnable(true);
            }
        }
    } else {
        if (!this.isClosable) {
            this.divImg.style.display = "none";
        } else {
            this.divImg.style.width = 17;
        }
    }
};
rialto.widget.TabItem = function (title, parentTabFolder, enable) {
    var objParam = new Object;
    this.base = rialto.widget.AbstractContainer;
    objParam.type = "tabitem";
    this.base(objParam);
    this.enable = enable != null ? enable : true;
    this.autoResizableH = true;
    this.autoResizableW = true;
    this.parentTabFolder = parentTabFolder;
    this.orientation = this.parentTabFolder.orientation;
    this.title = title;
    this.tabTitle = document.createElement("DIV");
    this.tabTitle.title = title;
    this.tabTitle.id = "DIV_ONGLET";
    this.tabTitle.className = this.getCssRuleName("DivOn_" + this.orientation);
    this.img1 = document.createElement("DIV");
    this.img1.className = this.getCssRuleName("leftEdgeTabOn_" + this.orientation);
    this.textDiv = document.createElement("DIV");
    this.textDiv.className = this.getCssRuleName("tabTitleTextOn_" + this.orientation);
    this.textDiv.innerHTML = this.title;
    this.img2 = document.createElement("DIV");
    this.img2.className = this.getCssRuleName("rightEdgeTabOn_" + this.orientation);
    this.tabTitle.appendChild(this.img1);
    this.tabTitle.appendChild(this.textDiv);
    this.tabTitle.appendChild(this.img2);
    if (this.orientation == "t" || this.orientation == "b") {
        this.tabTitle.style.width = this.parentTabFolder.widthItem + "px";
        this.tabTitle.style.height = "100%";
    } else {
        this.tabTitle.style.height = this.parentTabFolder.widthItem + "px";
        this.tabTitle.style.width = "100%";
    }
    this.divCont = document.createElement("DIV");
    this.divCont.style.position = "absolute";
    this.divCont.className = this.getCssRuleName("tabitem_divCont");
    this.setVisible(false);
    this.divCont.oRia = this;
    this.setEnable(this.enable);
    objParam = null;
};
rialto.widget.TabItem.prototype = new rialto.widget.AbstractContainer;
rialto.widget.TabItem.prototype.adaptToContext = function () {
    if (this.orientation == "r" || this.orientation == "l") {
        this.$imageSize = getComputStyle(this.img1, "height") + getComputStyle(this.img2, "height");
        this.textDiv.style.height = this.parentTabFolder.widthItem - this.$imageSize;
    } else {
        this.$imageSize = getComputStyle(this.img1, "width") + getComputStyle(this.img2, "width");
        this.textDiv.style.width = this.parentTabFolder.widthItem - this.$imageSize;
    }
    this.updateSize();
};
rialto.widget.TabItem.prototype.setEnable = function (enable) {
    if (enable) {
        if (this.parentTabFolder.currentActiveTab == this) {
            this.img1.className = this.getCssRuleName("leftEdgeTabOn_" + this.orientation);
            this.textDiv.className = this.getCssRuleName("tabTitleTextOn_" + this.orientation);
            this.img2.className = this.getCssRuleName("rightEdgeTabOn_" + this.orientation);
            this.tabTitle.className = this.getCssRuleName("tabTitleDivOff_" + this.orientation);
        } else {
            this.tabTitle.className = this.getCssRuleName("tabTitleDivOff_" + this.orientation);
            this.img1.className = this.getCssRuleName("leftEdgeTabOff_" + this.orientation);
            this.textDiv.className = this.getCssRuleName("tabTitleTextOff_" + this.orientation);
            this.img2.className = this.getCssRuleName("rightEdgeTabOff_" + this.orientation);
        }
    } else {
        this.tabTitle.className = this.getCssRuleName("tabTitleDivDisa_" + this.orientation);
        this.img1.className = this.getCssRuleName("leftEdgeTabDisa_" + this.orientation);
        this.textDiv.className = this.getCssRuleName("tabTitleTextDisa_" + this.orientation);
        this.img2.className = this.getCssRuleName("rightEdgeTabDisa_" + this.orientation);
    }
    this.enable = enable;
};
rialto.widget.TabItem.prototype.setVisible = function (visible) {
    if (this.visible == visible) {
        return;
    }
    this.visible = visible;
    if (visible) {
        this.tabTitle.style.display = "block";
        if (this == this.parentTabFolder.currentActiveTab) {
            this.divCont.style.display = "block";
            this.updateSize();
        }
    } else {
        this.tabTitle.style.display = "none";
        this.divCont.style.display = "none";
    }
};
rialto.widget.TabItem.prototype.displayTitle = function () {
    this.tabTitle.style.display = "block";
    this.visible = true;
};
rialto.widget.TabItem.prototype.changeWidth = function (delta) {
    rialto.deprecated("TABITEM", "changeWidth", "changeTitleWidth");
    this.changeTitleWidth(delta);
};
rialto.widget.TabItem.prototype.changeTitleWidth = function (delta) {
    if (delta == 0) {
        this.tabTitle.style.width = 0;
    } else {
        this.tabTitle.style.width = Math.max(0, parseInt(this.tabTitle.style.width) + delta);
    }
};
rialto.widget.TabItem.prototype.setWidth = function (width) {
    this.tabTitle.style.width = Math.max(0, width);
    this.textDiv.style.width = Math.max(0, width - this.$imageSize);
};
rialto.widget.TabItem.prototype.setHeight = function (height) {
    this.tabTitle.style.height = Math.max(0, height);
    this.textDiv.style.height = Math.max(0, height - this.$imageSize);
};
rialto.widget.TabItem.prototype.updateWidth = function () {
    if (this.visible) {
        this.divCont.style.overflow = "hidden";
        ria.utils.measures.$setWidthWithAllAvailable(this.divCont);
        this.resizeChilds(true, false);
        this.divCont.style.overflow = "auto";
    }
};
rialto.widget.TabItem.prototype.updateHeight = function () {
    if (this.visible) {
        this.divCont.style.overflow = "hidden";
        ria.utils.measures.$setHeightWithAllAvailable(this.divCont);
        this.resizeChilds(false, true);
        this.divCont.style.overflow = "auto";
    }
};
rialto.widget.TabItem.prototype.getHtmlExt = function () {
    return this.divCont;
};
rialto.widget.TabItem.prototype.getHtmlCont = function () {
    return this.divCont;
};
rialto.widget.TabItem.prototype.onClose = function () {
};
rialto.widget.TabItem.prototype.activeOnglet = function () {
    rialto.deprecated("TABITEM", "activeOnglet", "enableTabItem");
    this.enableTabItem();
};
rialto.widget.TabItem.prototype.enableTabItem = function () {
    if (this.enable) {
        if (this.parentTabFolder.currentActiveTab != this) {
            if (this.parentTabFolder.currentActiveTab) {
                var oldOng = this.parentTabFolder.currentActiveTab;
                oldOng.disableTabItem();
            }
            this.parentTabFolder.currentActiveTab = this;
            this.img1.className = this.getCssRuleName("leftEdgeTabOn_" + this.orientation);
            this.textDiv.className = this.getCssRuleName("tabTitleTextOn_" + this.orientation);
            this.img2.className = this.getCssRuleName("rightEdgeTabOn_" + this.orientation);
            this.tabTitle.className = this.getCssRuleName("tabTitleDivOff_" + this.orientation);
            this.divCont.style.display = "block";
            this.updateSize();
            this.onEnableTab();
        }
    }
};
rialto.widget.TabItem.prototype.desactiveOnglet = function () {
    rialto.deprecated("TABITEM", "desactiveOnglet", "disableTabItem");
    this.disableTabItem();
};
rialto.widget.TabItem.prototype.disableTabItem = function () {
    this.divCont.style.display = "none";
    this.img1.className = this.getCssRuleName("leftEdgeTabOff_" + this.orientation);
    this.textDiv.className = this.getCssRuleName("tabTitleTextOff_" + this.orientation);
    this.img2.className = this.getCssRuleName("rightEdgeTabOff_" + this.orientation);
    this.tabTitle.className = this.getCssRuleName("tabTitleDivOff_" + this.orientation);
    if (this.parentTabFolder.currentActiveTab == this) {
        this.parentTabFolder.currentActiveTab = null;
    }
    this.onDisableTab();
};
rialto.widget.TabItem.prototype.release = function () {
    rialto.array.remove(this.parentTabFolder.arrTabItem, this);
    if (this.parentTabFolder.currentActiveTab == this) {
        this.parentTabFolder.currentActiveTab = null;
    }
    this.tabTitle.parentNode.removeChild(this.tabTitle);
    if (this.tabTitle.dragAnDrop) {
        rialto.widgetBehavior.desaffect(this.tabTitle, "DragAndDrop");
    }
};
rialto.widget.TabItem.prototype.setTitle = function (newtitle) {
    this.title = newtitle;
    this.textDiv.innerHTML = this.title;
};
rialto.widget.TabItem.prototype.onresize = function () {
};
rialto.widget.TabItem.prototype.onEnableTab = function () {
};
rialto.widget.TabItem.prototype.onDisableTab = function () {
};


rialto.widget.SimpleWindow = function (objPar) {
    this.base = rialto.widget.AbstractContainer;
    objPar.type = "SimpleWindow";
    this.base(objPar);
    this.icone = rialtoConfig.buildImageURL("images/imgFenSimple/picto-gr_default.gif");
    this.title = "Window";
    this.autoResizableH = true;
    this.autoResizableW = true;
    this.withCloseButon = true;
    this.overOpenWindow = true;
    this.setUp(objPar);
    this.divExt.style.top = this.top;
    this.divExt.style.left = this.left;
    this.divExt.style.position = this.position;
    this.divExt.style.overflow = "hidden";
    if (objPar.parent) {
        this.attach(objPar.parent);
    }
    objPar = null;
};
rialto.widget.SimpleWindow.prototype = new rialto.widget.AbstractContainer;
rialto.widget.SimpleWindow.prototype.arrOpenWidow = new Array();
rialto.widget.SimpleWindow.prototype.openWindow = null;
rialto.widget.SimpleWindow.prototype.setUp = function (objPar) {
    if (objPar.title != null) {
        this.setTitle(objPar.title);
    }
    if (rialto.lang.isString(objPar.icone)) {
        this.icone = rialtoConfig.buildImageURL(objPar.icone);
    }
    if (rialto.lang.isBoolean(objPar.withCloseButon)) {
        this.withCloseButon = objPar.withCloseButon;
    }
    if (rialto.lang.isBoolean(objPar.autoResizableH)) {
        this.autoResizableH = objPar.autoResizableH;
    }
    if (rialto.lang.isBoolean(objPar.autoResizableH)) {
        this.autoResizableH = objPar.autoResizableH;
    }
    if (rialto.lang.isBoolean(objPar.overOpenWindow)) {
        this.overOpenWindow = objPar.overOpenWindow;
    }
};
rialto.widget.SimpleWindow.prototype.adaptToContext = function (parent) {
    var oThis = this;
    var oParent = this.divExt;
    this.deco = new rialto.widget.decoration("simplewindow", oParent);
    this.DivIcone = this.deco.DivIconG;
    this.icoFen = new rialto.widget.Image(this.icone, 0, -5, this.DivIcone, "", "", {bWithoutRecordInSession:true, boolFloatLeft:true});
    this.divTitle = this.deco.DivTitle;
    this.divTitle.className = this.getCssRuleName("simpleWindow_title");
    this.divTitle.appendChild(document.createTextNode(this.title));
    this.divCont = document.createElement("DIV");
    this.divExt.appendChild(this.divCont);
    this.divCont.className = this.getCssRuleName("simpleWindow_divCont");
    if (this.withCloseButon) {
        this.btnClose = new rialto.widget.Image("btonFenFermOff", 0, -5, this.deco.DivIconD, rialto.I18N.getLabel("lanCloseWindow"), "btonFenFermOn", {bWithoutRecordInSession:true, boolFloatRight:true});
        this.btnClose.onclick = function () {
            oThis.closeWindow();
        };
    }
    if (this.overOpenWindow) {
        rialto.widget.SimpleWindow.prototype.arrOpenWidow.push(this);
        this.setEnable(true);
    } else {
        this.initSize();
    }
};
rialto.widget.SimpleWindow.prototype.release = function () {
    if (this.withCloseButon) {
        this.btnClose.remove();
    }
    if (this.overOpenWindow) {
        if (rialto.widget.SimpleWindow.prototype.openWindow == this) {
            rialto.widget.SimpleWindow.prototype.openWindow = null;
        }
        rialto.array.remove(rialto.widget.SimpleWindow.prototype.arrOpenWidow, this);
        if (rialto.widget.SimpleWindow.prototype.arrOpenWidow.length > 0) {
            rialto.widget.SimpleWindow.prototype.arrOpenWidow[rialto.widget.SimpleWindow.prototype.arrOpenWidow.length - 1].activeFen();
        }
    }
};
rialto.widget.SimpleWindow.prototype.getHtmlCont = function () {
    return this.divCont;
};
rialto.widget.SimpleWindow.prototype.initSize = function () {
    if (this.autoResizableW) {
        this.updateWidth();
    } else {
        this.divExt.style.width = this.width;
        ria.utils.measures.$setWidthWithAllAvailable(this.divCont, 15);
    }
    if (this.autoResizableH) {
        this.updateHeight();
    } else {
        this.divExt.style.height = this.height;
        ria.utils.measures.$setHeightWithAllAvailable(this.divCont, 15);
    }
};
rialto.widget.SimpleWindow.prototype.updateSize = function () {
    if (this.visible) {
        this.updateHeight();
        this.updateWidth();
        this.oldHeight = this.divExt.offsetHeight;
        this.oldWidth = this.divExt.offsetWidth;
    }
};
rialto.widget.SimpleWindow.prototype.updateWidth = function () {
    if (this.visible) {
        if (this.autoResizableW) {
            this.divCont.style.overflow = "hidden";
            ria.utils.measures.$setWidthWithAllAvailable(this.divExt);
            ria.utils.measures.$setWidthWithAllAvailable(this.divCont, 15);
            this.resizeChilds(true, false);
            this.divCont.style.overflow = "auto";
        }
    }
};
rialto.widget.SimpleWindow.prototype.updateHeight = function () {
    if (this.visible) {
        if (this.autoResizableH) {
            this.divCont.style.overflow = "hidden";
            ria.utils.measures.$setHeightWithAllAvailable(this.divExt);
            ria.utils.measures.$setHeightWithAllAvailable(this.divCont, 10);
            this.resizeChilds(false, true);
            this.divCont.style.overflow = "auto";
        }
    }
};
rialto.widget.SimpleWindow.prototype.closeWindow = function () {
    if (rialto.widget.SimpleWindow.prototype.openWindow == this) {
        rialto.widget.SimpleWindow.prototype.openWindow = null;
    }
    this.onClose();
    this.remove();
};
rialto.widget.SimpleWindow.prototype.activeFen = function () {
    rialto.deprecated("SIMPLEWINDOW", "activeFen", "setEnable(true)");
    this.setEnable(true);
};
rialto.widget.SimpleWindow.prototype.setEnable = function (enable) {
    if (this.overOpenWindow) {
        if (enable) {
            if (rialto.widget.SimpleWindow.prototype.openWindow != this) {
                if (rialto.widget.SimpleWindow.prototype.openWindow) {
                    rialto.widget.SimpleWindow.prototype.openWindow.setVisible(false);
                }
                this.setVisible(true);
                this.onfocus();
            }
        } else {
            if (rialto.widget.SimpleWindow.prototype.openWindow == this) {
                this.setVisible(false);
                if (rialto.widget.SimpleWindow.prototype.arrOpenWidow.length > 1) {
                    var i = rialto.widget.SimpleWindow.prototype.arrOpenWidow.length - 1;
                    var last = rialto.widget.SimpleWindow.prototype.arrOpenWidow[i];
                    if (last == this) {
                        last = rialto.widget.SimpleWindow.prototype.arrOpenWidow[i - 1];
                    }
                    last.setVisible(true);
                }
            }
        }
    }
};
rialto.widget.SimpleWindow.prototype.setVisible = function (visible) {
    var oHtml = this.getHtmlExt();
    this.visible = visible;
    if (visible) {
        rialto.widget.SimpleWindow.prototype.openWindow = this;
        oHtml.style.display = "block";
        this.updateSize();
    } else {
        rialto.widget.SimpleWindow.prototype.openWindow = null;
        oHtml.style.display = "none";
        this.onblur();
    }
};
rialto.widget.SimpleWindow.prototype.setTitle = function (newtitle) {
    this.title = newtitle;
    if (this.divTitle) {
        this.divTitle.replaceChild(document.createTextNode(newtitle), this.divTitle.firstChild);
        this.onSetTitle(newtitle);
    }
};
rialto.widget.SimpleWindow.prototype.getTitle = function () {
    return this.title = newtitle;
};
rialto.widget.SimpleWindow.prototype.onSetTitle = function (newtitle) {
};
rialto.widget.SimpleWindow.prototype.onClose = function () {
};


rialto.widget.Frame = function (objPar) {
    this.base = rialto.widget.AbstractContainer;
    objPar.type = "frame";
    this.base(objPar);
    this.title = "Frame";
    this.printTitle = this.title;
    this.dynamic = false;
    this.open = true;
    this.boolPrint = false;
    this.boolMaxi = false;
    this.autoResizeContenu = false;
    this.autoResizeParent = false;
    if ((rialto.lang.isBoolean(objPar.dynamic)) || (objPar.dynamic == "buttonLess")) {
        this.dynamic = objPar.dynamic;
    }
    if (rialto.lang.isBoolean(objPar.open)) {
        this.open = objPar.open;
    }
    if (rialto.lang.isString(objPar.title)) {
        this.title = objPar.title;
        this.printTitle = this.title;
    }
    if (rialto.lang.isString(objPar.printTitle)) {
        this.printTitle = objPar.printTitle;
    }
    if (rialto.lang.isBoolean(objPar.autoResizeContenu)) {
        this.autoResizeContenu = objPar.autoResizeContenu;
    }
    if (rialto.lang.isBoolean(objPar.boolPrint)) {
        this.boolPrint = objPar.boolPrint;
    }
    if (rialto.lang.isBoolean(objPar.boolMaxi)) {
        this.boolMaxi = objPar.boolMaxi;
    }
    if (rialto.lang.isBoolean(objPar.autoResizableH)) {
        this.autoResizableH = objPar.autoResizableH;
    }
    if (rialto.lang.isBoolean(objPar.autoResizableW)) {
        this.autoResizableW = objPar.autoResizableW;
    }
    var oThis = this;
    this.divExt.style.top = this.top;
    this.divExt.style.left = this.left;
    this.divExt.style.width = this.width;
    this.divExt.style.height = this.height;
    this.divExt.style.position = this.position;
    this.divExt.id = this.name;
    this.cadre = document.createElement("DIV");
    this.cadre.name = this.name;
    this.cadre.style.position = "relative";
    this.cadre.style.overflow = "auto";
    if (objPar.parent) {
        this.attach(objPar.parent);
    }
};
rialto.widget.Frame.prototype = new rialto.widget.AbstractContainer;
rialto.widget.Frame.prototype.adaptAfterContainerChange = function () {
    this.updateSize();
};
rialto.widget.Frame.prototype.adaptAfterSizeChange = function () {
    ria.utils.measures.$setSizeWithAllAvailable(this.cadre);
    this.oldHeight = this.divExt.offsetHeight;
    this.oldWidth = this.divExt.offsetWidth;
    this.resizeChilds();
};
rialto.widget.Frame.prototype.release = function () {
    if (this.toolBar) {
        this.toolBar.remove();
    } else {
        this.labelTitle.remove();
    }
};
rialto.widget.Frame.prototype.adaptToContext = function () {
    var oThis = this;
    if (this.dynamic) {
        this.cadre.className = this.getCssRuleName("frame_content_dynamic");
        this.toolBar = new rialto.widget.ToolBar({autoResizableW:false, height:"25px", position:"relative", width:"100%", parent:this.divExt, bWithoutRecordInSession:true});
        this.toolBar.ondblclick = function () {
            oThis.setOpen(!oThis.open);
        };
        this.labelTitle = new rialto.widget.Label("", 3, 10, this.toolBar, this.title, "frame_titlecbig", {bWithoutRecordInSession:true});
        var ob = {position:"relative", boolFloatRight:true, bWithoutRecordInSession:true};
        if (this.dynamic != "buttonLess") {
            if (this.open == false) {
                this.cadre.style.display = "none";
                this.divExt.style.height = 25;
                this.BTN = new rialto.widget.Image("moreButtonOff", 0, 2, this.toolBar, rialto.I18N.getLabel("lanOpenFrame"), "moreButtonOn", ob);
            } else {
                this.cadre.style.display = "block";
                this.BTN = new rialto.widget.Image("lessButtonOff", 0, 2, this.toolBar, rialto.I18N.getLabel("lanCloseFrame"), "lessButtonOn", ob);
            }
            this.BTN.onclick = function () {
                oThis.setOpen(!oThis.open);
            };
            if (this.boolMaxi) {
                this.bMAX = new rialto.widget.Image("maxButtonOff", -5, 2, this.toolBar, "Maximise/minimise the frame", "maxButtonOn", ob);
                this.max = false;
                this.bMAX.onclick = function () {
                    oThis.maximize();
                };
            }
            if (this.boolPrint) {
                var bPrint = new rialto.widget.Image("printButtonOff", -10, 2, this.toolBar, "Print the content", "printButtonOn", ob);
                bPrint.onclick = function () {
                    oThis.print();
                };
            }
        }
    } else {
        this.cadre.className = this.getCssRuleName("frame_content_simple");
        this.labelTitle = new rialto.widget.Label("", -8, 5, this.divExt, this.title, "frame_titlecsmall", {position:"absolute", bWithoutRecordInSession:true});
    }
    this.divExt.appendChild(this.cadre);
    this.updateSize();
};
rialto.widget.Frame.prototype.getHtmlDD = function () {
    if (this.dynamic) {
        return this.toolBar.divExt;
    } else {
        return this.divExt;
    }
};
rialto.widget.Frame.prototype.getHtmlRZ = function () {
    return this.cadre;
};
rialto.widget.Frame.prototype.getHtmlImp = function () {
    return this.cadre;
};
rialto.widget.Frame.prototype.getHtmlCont = function () {
    return this.cadre;
};
rialto.widget.Frame.prototype.addButton = function (objImage) {
    this.toolBar.add(objImage);
};
rialto.widget.Frame.prototype.setPrinterObject = function (objJS) {
    this.printer = objJS;
};
rialto.widget.Frame.prototype.print = function () {
    if (this.printer != null) {
        this.printer.print();
    } else {
        if (this.cadre.childNodes.length == 1) {
            if (this.cadre.childNodes[0].oRia) {
                if (this.cadre.childNodes[0].oRia.print) {
                    this.filsAImprimer = this.cadre.childNodes[0].oRia;
                }
            }
        }
    }
    if (this.filsAImprimer) {
        this.filsAImprimer.printTitle = this.printTitle;
        this.filsAImprimer.print();
    } else {
        var widthGlobal = document.body.clientWidth;
        var heightGlobal = document.body.clientHeight;
        this.fenImp = window.open(rialtoConfig.pathRialtoE + "printTab.html", "IMPRESSION", "height=" + heightGlobal + ",width=" + widthGlobal + ",top=0,left=0,scrollbars,resizable,toolbar,menubar");
        var obj = this.getHtmlImp();
        this.inner = obj.innerHTML;
        this.rempFenImp();
    }
};
rialto.widget.Frame.prototype.rempFenImp = function () {
    var obj = {titre:this.printTitle, divInner:this.inner};
    if (this.fenImp.rempPage) {
        this.fenImp.rempPage(obj);
    } else {
        window.setTimeout("rialto.session.objects[\"" + this.id + "\"].rempFenImp()", 50);
    }
};
rialto.widget.Frame.prototype.maximize = function () {
    if (!this.open) {
        this.setOpen(true);
    }
    if (this.max == false) {
        this.bMAX.setImageReference("minButtonOff", "minButtonOn");
        this.BTN.setVisible(false);
        this.divExt.style.top = 0;
        this.divExt.style.left = 0;
        this.divExt.style.width = "100%";
        this.divExt.style.height = "100%";
        this.divExt.style.position = "absolute";
        ria.utils.measures.$setSizeWithAllAvailable(this.divExt);
    } else {
        this.bMAX.setImageReference("maxButtonOff", "maxButtonOn");
        this.BTN.setVisible(true);
        this.divExt.style.top = this.top;
        this.divExt.style.left = this.left;
        this.divExt.style.width = this.width;
        this.divExt.style.height = this.height;
        this.divExt.style.position = this.position;
    }
    this.max = !this.max;
    this.initSize(delta);
};
rialto.widget.Frame.prototype.updateSize = function () {
    if (this.visible) {
        this.updateHeight();
        this.updateWidth();
        this.oldHeight = this.divExt.offsetHeight;
        this.oldWidth = this.divExt.offsetWidth;
    }
};
rialto.widget.Frame.prototype.updateWidth = function () {
    if (this.visible) {
        if (this.autoResizableW) {
            this.divExt.style.overflow = "hidden";
            this.cadre.style.overflow = "hidden";
            this.width = ria.utils.measures.$setWidthWithAllAvailable(this.divExt);
            if (this.toolBar) {
                this.toolBar.updateWidth();
            }
            ria.utils.measures.$setWidthWithAllAvailable(this.cadre);
            if (this.open == true) {
                this.resizeChilds(true, false);
            }
            this.cadre.style.overflow = "auto";
            this.divExt.style.overflow = "";
        } else {
            this.divExt.style.width = this.width;
            if (this.toolBar) {
                this.toolBar.updateWidth();
            }
            ria.utils.measures.$setWidthWithAllAvailable(this.cadre);
        }
    }
};
rialto.widget.Frame.prototype.updateHeight = function () {
    if (this.visible) {
        if (this.open == true) {
            this.cadre.style.overflow = "hidden";
            this.divExt.style.overflow = "hidden";
            if (this.autoResizableH) {
                this.height = ria.utils.measures.$setHeightWithAllAvailable(this.divExt);
                ria.utils.measures.$setHeightWithAllAvailable(this.cadre);
            } else {
                if (!this.autoResizeContenu) {
                    this.divExt.style.height = this.height;
                    ria.utils.measures.$setHeightWithAllAvailable(this.cadre);
                } else {
                    this.resizeContenu();
                }
            }
            this.resizeChilds(false, true);
            this.cadre.style.overflow = "auto";
            this.divExt.style.overflow = "";
        }
    }
};
rialto.widget.Frame.prototype.resizeContenu = function () {
    if (this.autoResizeContenu) {
        if (this.cadre.childNodes.length > 0) {
            var taillelim = 0;
            for (var i = 0; i < this.cadre.childNodes.length; i++) {
                var fils = this.cadre.childNodes[i];
                var tailleLimFils = _rum.$getTop(fils) + fils.offsetHeight;
                if (tailleLimFils > taillelim) {
                    taillelim = tailleLimFils;
                }
            }
            if (taillelim < parseInt(this.height) - this.cadre.offsetTop) {
                this.cadre.style.height = taillelim;
                this.divExt.style.height = this.cadre.offsetHeight + this.cadre.offsetTop + "px";
            } else {
                this.divExt.style.height = this.height;
                if (this.dynamic == true) {
                    this.cadre.style.height = Math.max(0, this.divExt.offsetHeight - this.cadre.offsetTop) + "px";
                } else {
                    this.cadre.style.height = "100%";
                }
            }
            this.resizeFatherAndBrother();
        }
    }
};
rialto.widget.Frame.prototype.getContenuHeight = function () {
    rialto.deprecated("Frame", "getContenuHeight", "getContentHeight()");
    return this.getContentHeight();
};
rialto.widget.Frame.prototype.setDisplay = function (open) {
    rialto.deprecated("Frame", "setDisplay", "setOpen()");
    this.setOpen(open);
};
rialto.widget.Frame.prototype.isOpen = function () {
    return this.open;
};
rialto.widget.Frame.prototype.setOpen = function (open) {
    if (open) {
        this.updateSize();
        this.cadre.style.display = "block";
        this.BTN.setImageReference("lessButtonOff", "lessButtonOn");
        this.BTN.alt = "Close the frame";
    } else {
        this.cadre.style.display = "none";
        this.divExt.style.height = 25;
        this.BTN.setImageReference("moreButtonOff", "moreButtonOn");
        this.BTN.alt = "Open the frame";
    }
    this.open = open;
    if (this.rialtoParent) {
        this.rialtoParent.resizeChilds(false, true);
    }
    this.onOpen(this.open);
};
rialto.widget.Frame.prototype.setTitle = function (newTitle) {
    this.labelTitle.setText(newTitle);
};
rialto.widget.Frame.prototype.getTitle = function () {
    return this.labelTitle.getText();
};
rialto.widget.Frame.prototype.onOpen = function (open) {
};


rialto.widget.Form = function (formName, url, parent, objPar) {
    if (!objPar) {
        var objPar = {};
    }
    objPar.type = "form";
    objPar.name = formName;
    this.base = rialto.widget.AbstractContainer;
    this.base(objPar);
    this.action = url;
    this.url = url;
    this.autoSubmit = true;
    this.imgBtonSubmit = null;
    this.idCont = null;
    this.withWaitWindow = true;
    this.boolAsynch = true;
    this.method = "get";
    this.boolIframe = false;
    this.canBeCancel = true;
    this.parameters = {};
    this.childElements = new Array;
    this.setUp(objPar);
    var oThis = this;
    this.divExt.style.top = this.top;
    this.divExt.style.left = this.left;
    this.divExt.style.height = this.height;
    this.divExt.style.width = this.width;
    this.divExt.style.position = this.position;
    this.formulaire = document.createElement("FORM");
    this.formulaire.style.position = "absolute";
    this.formulaire.method = this.method;
    this.divExt.appendChild(this.formulaire);
    if (this.autoSubmit) {
        this.keypresshandler = new ria.utils.event.keyPressHandler(this.formulaire);
        this.keypresshandler.onkeyPress = function () {
            if (this.isEnterKey()) {
                oThis.submitForm();
                return false;
            }
            return true;
        };
    }
    if (this.imgBtonSubmit) {
        this.imgBtonSubmit.oRia = this;
        this.affComportBtonSubmit();
    }
    if (parent) {
        this.attach(parent);
    }
    objPar = null;
};
rialto.widget.Form.prototype = new rialto.widget.AbstractContainer;
rialto.widget.Form.prototype.tabIndex = 1;
rialto.widget.Form.prototype.nbReq = 0;
rialto.widget.Form.prototype.baseRecord = rialto.widget.AbstractContainer.prototype.record;
rialto.widget.Form.prototype.record = function (oRia) {
    this.baseRecord(oRia);
};
rialto.widget.Form.prototype.baseErase = rialto.widget.AbstractContainer.prototype.erase;
rialto.widget.Form.prototype.erase = function (oRia) {
    this.removeElement(oRia);
    this.baseErase(oRia);
};
rialto.widget.Form.prototype.addElement = function (oRia) {
    this.childElements.push(oRia);
};
rialto.widget.Form.prototype.setElements = function (arrRia) {
    this.childElements = arrRia;
};
rialto.widget.Form.prototype.getElements = function () {
    return this.childElements;
};
rialto.widget.Form.prototype.removeElement = function (oRia) {
    rialto.array.remove(this.childElements, oRia);
};
rialto.widget.Form.prototype.isElement = function (oRia) {
    return (rialto.array.indexOf(this.childElements, oRia) != -1);
};
rialto.widget.Form.prototype.setUp = function (objPar) {
    if (objPar) {
        if (objPar.imgBtonSubmit) {
            this.imgBtonSubmit = objPar.imgBtonSubmit;
        }
        if (rialto.lang.isBoolean(objPar.autoSubmit)) {
            this.autoSubmit = objPar.autoSubmit;
        }
        if (rialto.lang.isStringIn(objPar.method, ["post", "get"])) {
            this.method = objPar.method;
        }
        if (rialto.lang.isBoolean(objPar.boolWithFenWait)) {
            rialto.deprecated("FORM", "objPar.boolWithFenWait", "objPar.withWaitWindow");
            this.withWaitWindow = objPar.boolWithFenWait;
        }
        if (rialto.lang.isBoolean(objPar.withWaitWindow)) {
            this.withWaitWindow = objPar.withWaitWindow;
        }
        if (rialto.lang.isBoolean(objPar.boolAsynch)) {
            this.boolAsynch = objPar.boolAsynch;
        }
        if (objPar.idCont) {
            this.idCont = objPar.idCont;
            var primCar = this.url.indexOf("?") != -1 ? "&" : "?";
            this.url += primCar + "FENID=" + objPar.idCont;
        }
        if (rialto.lang.isBoolean(objPar.canBeCancel)) {
            this.canBeCancel = objPar.canBeCancel;
        }
        if (rialto.lang.isBoolean(objPar.boolIframe)) {
            this.boolIframe = objPar.boolIframe;
        }
        if (objPar.onSuccess) {
            this.onSuccess = objPar.onSuccess;
        }
        if (objPar.callBackObjectOnSuccess) {
            this.callBackObjectOnSuccess = objPar.callBackObjectOnSuccess;
        }
        if (objPar.parameters) {
            this.parameters = objPar.parameters;
        }
    }
};
rialto.widget.Form.prototype.release = function (imgBtonSubmit) {
    if (this.keypresshandler) {
        this.keypresshandler.remove();
    }
    if (this.imgBtonSubmit && this.imgBtonSubmit.remove) {
        this.imgBtonSubmit.onclick = null;
        if (this.imgBtonSubmit.rialtoParent && !(this.imgBtonSubmit.rialtoParent == this)) {
            this.imgBtonSubmit.remove();
        }
    }
};
rialto.widget.Form.prototype.addBtonSubmit = function (imgBtonSubmit) {
    this.imgBtonSubmit = imgBtonSubmit;
    this.imgBtonSubmit.oRiaForm = this;
    this.imgBtonSubmit.onclick = function () {
        this.oRiaForm.submitForm();
    };
};
rialto.widget.Form.prototype.getHtmlCont = function () {
    return this.formulaire;
};
rialto.widget.Form.prototype.buildQueryString = function () {
    var qs = "";
    for (param in this.parameters) {
        qs += "&" + param + "=" + escape(this.parameters[param]);
    }
    for (var e = 0; e < this.formulaire.elements.length; e++) {
        var elmt = this.formulaire.elements[e];
        if (elmt.name != "") {
            if (elmt.type == "radio" && elmt.checked == true) {
                qs += "&" + elmt.name + "=" + escape(elmt.value);
            } else {
                if (elmt.type != "radio") {
                    qs += "&" + elmt.name + "=" + escape(elmt.value);
                }
            }
        }
    }
    for (var i = 0; i < this.childElements.length; i++) {
        var elmt = this.childElements[i];
        if (!elmt.bRiaComp) {
            qs += "&" + elmt.name + "=" + escape(elmt.value);
        } else {
            var name = elmt.dataname ? elmt.dataname : elmt.name;
            if (elmt.type == "radio" && elmt.isCheck()) {
                qs += "&" + elmt.group + "=" + name;
            } else {
                if (elmt.type == "checkbox") {
                    qs += "&" + name + "=" + elmt.isCheck();
                } else {
                    if (elmt.type == "combo") {
                        qs += "&" + name + "=" + escape(elmt.getSelValue());
                        qs += "&" + name + "_text=" + escape(elmt.getSelText());
                    } else {
                        if (elmt.getValue && elmt.getData) {
                            qs += "&" + name + "=" + escape(elmt.getValue());
                            qs += "&" + name + "_data=" + escape(elmt.getData());
                        } else {
                            if (elmt.getValue) {
                                qs += "&" + name + "=" + escape(elmt.getValue());
                            }
                        }
                    }
                }
            }
        }
    }
    if (qs != "") {
        qs = qs.substring(1);
    }
    return qs;
};
rialto.widget.Form.prototype.resetForm = function () {
    for (var i = 0; i < this.childElements.length; i++) {
        var elmt = this.childElements[i];
        if (!elmt.bRiaComp) {
            elmt.value = "";
        } else {
            if (elmt.setCheck) {
                elmt.setCheck(false);
            } else {
                if (elmt.setValue) {
                    elmt.setValue("");
                }
            }
        }
    }
    this.formulaire.reset();
};
rialto.widget.Form.prototype.submitForm = function () {
    if (this.onSubmitForm()) {
        if (this.boolAsynch) {
            if (!this.boolIframe) {
                if (!this.remote) {
                    this.remote = new rialto.io.AjaxRequest({url:this.url, method:this.method, callBackObjectOnSuccess:this.callBackObjectOnSuccess, withWaitWindow:this.withWaitWindow, canBeCancel:this.canBeCancel, onSuccess:this.onSuccess});
                }
                this.remote.load(this.buildQueryString());
            } else {
                var idExtReq = ++rialto.widget.Form.prototype.nbReq;
                if (!this.iframe) {
                    this.iframe = new objFrame("ifr", 0, 0, 0, 0);
                    this.iframe.create(document.body);
                }
                var primCar = this.url.indexOf("?") != -1 ? "&" : "?";
                this.lastURL = this.url + primCar + this.buildQueryString();
                this.iframe.load(this.lastURL);
                if (this.boolWithFenWait) {
                    this.fen = new rialto.widget.WaitWindow({text:"LOADING", canBeCancel:true});
                }
            }
        } else {
            this.formulaire.action = this.action;
            this.formulaire.submit();
        }
        this.afterSubmitForm();
    }
};
rialto.widget.Form.prototype.onSubmitForm = function () {
    return true;
};
rialto.widget.Form.prototype.afterSubmitForm = function () {
    return true;
};
rialto.widget.Form.prototype.addParameter = function (tab) {
    this.parameters[tab[0]] = tab[1];
};
rialto.widget.Form.prototype.setURL = function (url) {
    this.url = url;
    if (this.idCont) {
        var primCar = this.url.indexOf("?") != -1 ? "&" : "?";
        this.url += primCar + "FENID=" + this.idCont;
    }
};
rialto.widget.Form.prototype.getURL = function () {
    return this.url;
};


rialto.widget.Splitter = function (objPar) {
    this.base = rialto.widget.AbstractContainer;
    objPar.type = "splitter";
    this.base(objPar);
    this.prop = 0.5;
    this.orientation = "h";
    this.autoResizableH = true;
    this.autoResizableW = true;
    this.style = "normal";
    this.withImg = false;
    this.overflow = "hidden";
    this.reverseClose = false;
    this.minProp = 0;
    this.maxProp = 1;
    this.cursorSize = 4;
    this.setUp(objPar);
    this.$$createSpliter(objPar.parent);
};
rialto.widget.Splitter.prototype = new rialto.widget.AbstractContainer;
rialto.widget.Splitter.prototype.setUp = function (objPar) {
    if (rialto.lang.isNumber(objPar.prop) && objPar.prop >= 0 && objPar.prop <= 1) {
        this.prop = objPar.prop;
    }
    if (rialto.lang.isStringIn(objPar.orientation, ["v", "h"])) {
        this.orientation = objPar.orientation;
    }
    if (rialto.lang.isBoolean(objPar.autoResizableH)) {
        this.autoResizableH = objPar.autoResizableH;
    }
    if (rialto.lang.isBoolean(objPar.autoResizableW)) {
        this.autoResizableW = objPar.autoResizableW;
    }
    if (rialto.lang.isStringIn(objPar.style, ["normal", "3D"])) {
        this.style = objPar.style;
    }
    if (rialto.lang.isStringIn(objPar.overflow, ["auto", "hidden"])) {
        this.overflow = objPar.overflow;
    }
    if (objPar.limSup != null) {
        rialto.deprecated("SPLITTER", "objPar.limSup", "objPar.maxProp");
        objPar.maxProp = objPar.limSup;
    }
    if (objPar.limInf != null) {
        rialto.deprecated("SPLITTER", "objPar.limInf", "objPar.minProp");
        objPar.minProp = objPar.limInf;
    }
    if (rialto.lang.isNumber(objPar.minProp) && objPar.minProp >= 0 && objPar.minProp <= 1) {
        this.minProp = objPar.minProp;
    }
    if (rialto.lang.isNumber(objPar.maxProp) && objPar.maxProp >= 0 && objPar.maxProp <= 1) {
        this.maxProp = objPar.maxProp;
    }
    if (rialto.lang.isBoolean(objPar.reverseClose)) {
        this.reverseClose = objPar.reverseClose;
    }
    if (rialto.lang.isBoolean(objPar.withImg)) {
        this.withImg = objPar.withImg;
    }
    if (objPar.taileCurs != null) {
        rialto.deprecated("SPLITTER", "objPar.taileCurs", "objPar.cursorSize");
        objPar.cursorSize = objPar.taileCurs;
    }
    if (rialto.lang.isNumber(objPar.cursorSize)) {
        this.cursorSize = objPar.cursorSize;
    }
};
rialto.widget.Splitter.prototype.$$createSpliter = function (parent) {
    var oThis = this;
    this.divExt.style.top = this.top;
    this.divExt.style.left = this.left;
    this.divExt.style.width = this.width;
    this.divExt.style.height = this.height;
    this.divExt.style.position = this.position;
    this.divExt.style.overflow = "hidden";
    this.divExt.id = "splitter";
    this.div1 = document.createElement("DIV");
    this.div1.className = this.getCssRuleName("spliter_div1");
    this.div1.style.position = "absolute";
    this.div1.style.overflow = this.overflow;
    this.divExt.appendChild(this.div1);
    this.div1.oRia = this;
    this.div2 = document.createElement("DIV");
    this.div2.className = this.getCssRuleName("spliter_div2");
    this.div2.style.position = "absolute";
    this.div2.style.overflow = this.overflow;
    this.divExt.appendChild(this.div2);
    this.div2.oRia = this;
    this.divCursor = document.createElement("DIV");
    this.divCursor.style.position = "absolute";
    this.divCursor.style.fontSize = 0;
    this.divExt.appendChild(this.divCursor);
    this.cursor = document.createElement("DIV");
    this.cursor.style.position = "absolute";
    this.cursor.style.fontSize = 0;
    if (this.withImg) {
        this.img = document.createElement("DIV");
        this.img.className = this.getCssRuleName("spliter_img_" + this.orientation);
        this.cursor.appendChild(this.img);
        this.divCursor.className = this.getCssRuleName("spliter_divcursor_img");
        this.cursor.className = this.getCssRuleName("spliter_cursor_img");
    } else {
        this.img = this.cursor;
        this.divCursor.className = this.getCssRuleName("spliter_divcursor_" + this.style);
        this.cursor.className = this.getCssRuleName("spliter_cursor_" + this.style);
    }
    this.divCursor.appendChild(this.cursor);
    this.addEvent(this.cursor, "onmouseout", this._onmouseout);
    this.addEvent(this.cursor, "onmouseover", this._onmouseover);
    if (parent) {
        this.attach(parent);
    }
};
rialto.widget.Splitter.prototype._onmouseout = function (e) {
    this.cursor.style.cursor = "default";
    if (this.withImg) {
        this.img.className = this.getCssRuleName("spliter_img_" + this.orientation);
    } else {
        this.cursor.className = this.getCssRuleName("spliter_cursor_" + this.style);
    }
};
rialto.widget.Splitter.prototype._onmouseover = function (e) {
    this.cursor.style.cursor = "pointer";
    if (this.withImg) {
        this.img.className = this.getCssRuleName("spliter_img_" + this.orientation + "_on");
    } else {
        this.cursor.className = this.getCssRuleName("spliter_cursor_over");
    }
};
rialto.widget.Splitter.prototype.removeAllContents = function (divSplit) {
    rialto.deprecated("SPLITTER", "removeAllContents", "removeAllChild");
    if (!divsplit) {
        this.removeAllChild();
    } else {
        this.removeAllChild((divSplit == this.div1), (divSplit == this.div2));
    }
};
rialto.widget.Splitter.prototype.removeDiv1Contents = function () {
    rialto.deprecated("SPLITTER", "removeDiv2Contents", "removeDiv1Child");
    this.removeDiv1Child();
};
rialto.widget.Splitter.prototype.removeDiv2Contents = function () {
    rialto.deprecated("SPLITTER", "removeDiv2Contents", "removeDiv2Child");
    this.removeDiv2Child();
};
rialto.widget.Splitter.prototype.removeAllChild = function (bDiv1, bDiv2) {
    if (arguments.length == 0) {
        var bdDiv1 = true;
        var bdDiv2 = true;
    }
    for (var i = this.arrChild.length - 1; i >= 0; i--) {
        var child = this.arrChild[i];
        if (bdDiv1 && child.domParent && child.domParent == this.div1) {
            if (child.remove) {
                child.remove(true);
            }
        } else {
            if (bdDiv1 && child.parentNode && child.parentNode == this.div1) {
                this.div1.removeChild(child);
                this.erase(child);
            }
        }
        if (bdDiv2 && child.domParent && child.domParent == this.div2) {
            if (child.remove) {
                child.remove(true);
            }
        } else {
            if (bdDiv2 && child.parentNode && child.parentNode == this.div2) {
                this.div2.removeChild(child);
                this.erase(child);
            }
        }
    }
    if (bdDiv1) {
        this.div1.innerHTML = "";
    }
    if (bdDiv2) {
        this.div2.innerHTML = "";
    }
};
rialto.widget.Splitter.prototype.removeDiv1Child = function () {
    this.removeAllChild(true);
};
rialto.widget.Splitter.prototype.removeDiv2Child = function () {
    this.removeAllChild(false, true);
};
rialto.widget.Splitter.prototype.release = function () {
    rialto.widgetBehavior.desaffect(this, "DragAndDrop");
};
rialto.widget.Splitter.prototype.masqueContenuDiv2 = function () {
    var nd = this.div2.firstChild;
    var ndSuiv = null;
    while (nd) {
        ndSuiv = nd.nextSibling;
        if (nd.oRia && nd.oRia.setVisible) {
            nd.oRia.setVisible(false);
        } else {
            nd.parentNode.removeChild(nd);
        }
        nd = ndSuiv;
    }
};
rialto.widget.Splitter.prototype.getHtmlDD = function () {
    return this.img;
};
rialto.widget.Splitter.prototype.adaptToContext = function () {
    var oThis = this;
    if (this.orientation == "v") {
        this.divCursor.style.width = "100%";
        this.divCursor.style.height = this.cursorSize;
        ria.utils.measures.$setHeightConformW3C(this.divCursor);
        this.cursor.style.height = this.cursorSize;
        this.cursor.style.left = "40%";
        this.cursor.style.width = "20%";
        this.div1.style.width = "100%";
        this.div2.style.width = "100%";
    } else {
        this.divCursor.style.height = "100%";
        this.divCursor.style.width = this.cursorSize;
        ria.utils.measures.$setWidthConformW3C(this.divCursor);
        this.cursor.style.top = "40%";
        this.cursor.style.width = this.cursorSize;
        this.cursor.style.height = "20%";
        this.div1.style.height = "100%";
        this.div2.style.height = "100%";
    }
    if (this.style == "3D") {
        var deco = new rialto.widget.decoration("splitter", this.div1);
        deco = new rialto.widget.decoration("splitter", this.div2);
    }
    rialto.widgetBehavior.affect(this, "DragAndDrop", {oHtmlToMove:this.divCursor, oHtmlEvtTarget:this.img, ghost:{aspect:"rect", asChild:true}, bSelectMark:false, isWithLimitsDisplayed:false, movingLimits:{orientation:oThis.orientation}});
    this.afterDD = function () {
        this.div1.style.overflow = "hidden";
        this.div2.style.overflow = "hidden";
        if (this.orientation == "v") {
            prop = parseInt(this.divCursor.style.top) / (this.divExt.offsetHeight - parseInt(this.divCursor.style.height));
        } else {
            prop = parseInt(this.divCursor.style.left) / (this.divExt.offsetWidth - parseInt(this.divCursor.style.width));
        }
        this.fixeProp(prop, false);
        this.div1.style.overflow = this.overflow;
        this.div2.style.overflow = this.overflow;
    };
    this.afterClic = function () {
        if (this.reduce) {
            this.reduce = false;
            this.fixeProp(this.oldProp, false);
        } else {
            this.oldProp = this.prop;
            this.reduce = true;
            if (this.reverseClose) {
                this.fixeProp(1, false);
            } else {
                this.fixeProp(0, false);
            }
        }
    };
    this.initSize();
};
rialto.widget.Splitter.prototype.adaptAfterContainerChange = function () {
    this.fixeProp();
};
rialto.widget.Splitter.prototype.adaptAfterSizeChange = function () {
    this.fixeProp();
};
rialto.widget.Splitter.prototype.initSize = function () {
    if (this.autoResizableW) {
        this.updateWidth();
    } else {
        this.divExt.style.width = this.width;
    }
    if (this.autoResizableH) {
        this.updateHeight();
    } else {
        this.divExt.style.height = this.height;
    }
    this.fixeProp();
};
rialto.widget.Splitter.prototype.updateSize = function () {
    this.updateHeight();
    this.updateWidth();
    this.oldHeightDiv1 = this.div1.offsetHeight;
    this.oldWidthDiv1 = this.div1.offsetWidth;
    this.oldHeightDiv2 = this.div2.offsetHeight;
    this.oldWidthDiv2 = this.div2.offsetWidth;
};
rialto.widget.Splitter.prototype.updateWidth = function () {
    if (this.autoResizableW) {
        rialto.session._hideGrid(this);
        this.div1.style.overflow = "hidden";
        this.div2.style.overflow = "hidden";
        ria.utils.measures.$setWidthWithAllAvailable(this.divExt);
        this.fixeProp(this.prop, true);
        this.resizeChilds(true, false);
        this.div1.style.overflow = this.overflow;
        this.div2.style.overflow = this.overflow;
        rialto.session._showGrid(this);
    } else {
        this.fixeProp(this.prop);
    }
};
rialto.widget.Splitter.prototype.updateHeight = function () {
    if (this.autoResizableH) {
        rialto.session._hideGrid(this);
        this.div1.style.overflow = "hidden";
        this.div2.style.overflow = "hidden";
        ria.utils.measures.$setHeightWithAllAvailable(this.divExt);
        this.fixeProp(this.prop, true);
        this.resizeChilds(false, true);
        this.div1.style.overflow = this.overflow;
        this.div2.style.overflow = this.overflow;
        rialto.session._showGrid(this);
    } else {
        this.fixeProp(this.prop);
    }
};
rialto.widget.Splitter.prototype.fixeProp = function (prop, boolMajT) {
    var oldProp = this.prop;
    if (prop != null) {
        this.prop = prop;
    }
    if (this.prop < this.minProp) {
        this.prop = this.minProp;
    } else {
        if (this.prop > this.maxProp) {
            this.prop = this.maxProp;
        }
    }
    if (this.orientation == "v") {
        var tailleDispo = this.divExt.offsetHeight - this.divCursor.offsetHeight;
        var tailleDiv1 = Math.floor(this.prop * (tailleDispo));
        var tailleDiv2 = tailleDispo - tailleDiv1;
        this.div1.style.height = tailleDiv1;
        this.divCursor.style.top = parseInt(this.div1.style.height);
        this.div2.style.top = parseInt(this.divCursor.style.top) + this.divCursor.offsetHeight;
        this.div2.style.height = tailleDiv2;
    } else {
        var tailleDispo = this.divExt.offsetWidth - this.divCursor.offsetWidth;
        var tailleDiv1 = Math.floor(this.prop * (tailleDispo));
        var tailleDiv2 = tailleDispo - tailleDiv1;
        this.div1.style.width = tailleDiv1;
        this.divCursor.style.left = parseInt(this.div1.style.width);
        this.div2.style.left = parseInt(this.divCursor.style.left) + this.divCursor.offsetWidth;
        this.div2.style.width = tailleDiv2;
    }
    this.onresizeDiv1(this.currHeightDiv1, this.currWidthDiv1, this.div1.offsetHeight, this.div1.offsetWidth);
    this.onresizeDiv2(this.currHeightDiv2, this.currWidthDiv2, this.div2.offsetHeight, this.div2.offsetWidth);
    this.currHeightDiv1 = this.div1.offsetHeight;
    this.currWidthDiv1 = this.div1.offsetWidth;
    this.currHeightDiv2 = this.div2.offsetHeight;
    this.currWidthDiv2 = this.div2.offsetWidth;
    if (!boolMajT) {
        this.resizeChilds();
    }
};
rialto.widget.Splitter.prototype.onresizeDiv1 = function (oldH, oldW, newH, newW) {
};
rialto.widget.Splitter.prototype.onresizeDiv2 = function (oldH, oldW, newH, newW) {
};


rialto.widget.ToolBar = function (objPar) {
    this.base = rialto.widget.AbstractContainer;
    objPar.type = "toolbar";
    this.base(objPar);
    var oThis = this;
    this.divExt.style.top = this.top;
    this.divExt.style.left = this.left;
    this.divExt.style.width = this.width;
    this.divExt.style.position = this.position;
    this.divExt.className = "toolBarDiv";
    this.imgG = document.createElement("DIV");
    this.imgG.className = "leftEdgeToolbar";
    this.imgD = document.createElement("DIV");
    this.imgD.className = "rightEdgeToolbar";
    this.divExt.appendChild(this.imgG);
    this.divExt.appendChild(this.imgD);
    if (objPar.parent) {
        this.attach(objPar.parent);
    }
    this.addEvent(this.divExt, "ondblclick", this._ondblclick);
    this.addEvent(this.divExt, "onclick", this._onclick);
};
rialto.widget.ToolBar.prototype = new rialto.widget.AbstractContainer;
rialto.widget.ToolBar.prototype.updateHeight = function () {
};
rialto.widget.ToolBar.prototype._ondblclick = function (e) {
    this.ondblclick(e);
};
rialto.widget.ToolBar.prototype._onclick = function (e) {
    this.onclick(e);
};
rialto.widget.ToolBar.prototype.updateSize = function () {
    if (this.visible) {
        this.updateWidth();
        this.oldWidth = this.divExt.offsetWidth;
    }
};
rialto.widget.ToolBar.prototype.updateWidth = function () {
    if (this.visible) {
        this.divExt.style.overflow = "hidden";
        if (this.autoResizableW) {
            ria.utils.measures.$setWidthWithAllAvailable(this.divExt);
        } else {
            this.divExt.style.width = this.width;
        }
        this.divExt.style.overflow = "";
    }
};
rialto.widget.ToolBar.prototype.addText = function (top, left, text, classname) {
    var textWidth = ria.utils.measures.getTextSize(text, "libelle1");
    var div = document.createElement("DIV");
    div.className = "libelle1";
    div.style.top = 2;
    div.style[ATTRFLOAT] = "left";
    div.style.position = "relative";
    div.style.width = textWidth;
    div.innerHTML = text;
    this.divExt.appendChild(div);
    return div;
};
rialto.widget.ToolBar.prototype.addSpace = function () {
    var div = document.createElement("DIV");
    div.style.width = 20;
    div.style.height = "100%";
    div.style[ATTRFLOAT] = "left";
    div.style.position = "relative";
    this.divExt.appendChild(div);
};
rialto.widget.ToolBar.prototype.addSeparation = function () {
    var div = document.createElement("DIV");
    div.className = "cellSep";
    div.style[ATTRFLOAT] = "left";
    div.style.position = "relative";
    this.divExt.appendChild(div);
};
rialto.widget.ToolBar.prototype.addMenu = function (title, menu) {
    var oThis = this;
    div = this.addText("", "", title);
    div.onmouseover = function () {
        this.style.height = parseInt(this.offsetHeight) - 2;
        this.style.border = "1px solid cyan";
    };
    div.onmouseout = function () {
        this.style.border = null;
        this.style.height = parseInt(this.offsetHeight) + 2;
    };
    div.onclick = function () {
        menu.setPosTop(compOffsetTop(oThis.divExt) + 22);
        menu.setPosLeft(compOffsetLeft(oThis.divExt) + 2);
        menu.affichezoneMenu(evt = null, heightCombo = 22);
    };
    this.addSpace();
};
rialto.widget.ToolBar.prototype.addButton = function (obj) {
    ob = {position:"relative", boolFloatLeft:true};
    var but = new rialto.widget.Image("printButtonOff", 0, 2, this, "Print the content", "printButtonOn", ob);
    this.addSpace();
    return but;
};
rialto.widget.ToolBar.prototype.release = function () {
    var childDivs = this.divExt.childNodes;
    for (var lnIdx = 0; lnIdx < childDivs.length; lnIdx++) {
        var childDiv = childDivs[lnIdx];
        childDiv.onmouseover = null;
        childDiv.onmouseout = null;
        childDiv.onclick = null;
    }
};


rialto.widget.PopUp = function (name, top, left, width, height, content, title, background, objPar) {
    if (!objPar) {
        var objPar = {};
    }
    objPar.name = name;
    objPar.top = top;
    objPar.left = left;
    objPar.width = width;
    objPar.height = height;
    objPar.title = title;
    objPar.background = background;
    objPar.content = content;
    this.base = rialto.widget.AbstractContainer;
    objPar.type = "PopUp";
    this.base(objPar);
    this.title = "Window";
    this.background = "transparent";
    this.withCloseButon = true;
    this.visible = true;
    this.content = content;
    this.setUp(objPar);
    this.mask = document.getElementById("popupMask");
    if (!this.mask) {
        this.mask = document.createElement("DIV");
        this.mask.id = "popupMask";
        this.mask.className = "ecranMasque_transparent";
        document.body.appendChild(this.mask);
    }
    rialto.widget.PopUp.prototype.pileWindow.push(this);
    this.updatePile();
    this.setMaskClassName();
    var divStyle = this.divExt.style;
    divStyle.top = this.top;
    divStyle.left = this.left;
    divStyle.width = this.width;
    divStyle.height = parseInt(this.height) + 45;
    divStyle.position = this.position;
    this.attach(this.mask);
    this.divCont = document.createElement("DIV");
    this.divExt.appendChild(this.divCont);
    this.divCont.className = this.getCssRuleName("popup_divCont");
    var left = getComputStyle(this.divCont, "left");
    divStyle = this.divCont.style;
    divStyle.width = this.width - left * 2;
    divStyle.height = this.height;
    if (this.content) {
        this.divCont.appendChild(document.createTextNode(this.content));
    }
    this.insideMask = document.createElement("DIV");
    this.insideMask.className = "ecranMasque_transparent";
    this.insideMask.style.zIndex = 0;
    this.insideMask.style.display = "none";
    this.divExt.appendChild(this.insideMask);
    objPar = null;
};
rialto.widget.PopUp.prototype = new rialto.widget.AbstractContainer;
rialto.widget.PopUp.prototype.setMaskClassName = function () {
    if (this.background != "inherit" && this.mask.className != "ecranMasque_" + this.background) {
        this.mask.className = "ecranMasque_" + this.background;
    }
};
rialto.widget.PopUp.prototype.setUp = function (objPar) {
    if (objPar.background != null) {
        this.setBackground(objPar.background);
    }
    if (objPar.title != null) {
        this.setTitle(objPar.title);
    }
    if (rialto.lang.isBoolean(objPar.withCloseButon)) {
        this.withCloseButon = objPar.withCloseButon;
    }
    if (rialto.lang.isBoolean(objPar.visible)) {
        this.visible = objPar.visible;
    }
    if (rialto.lang.isString(objPar.content, true)) {
        this.content = objPar.content;
    }
};
rialto.widget.PopUp.prototype.setBackground = function (background) {
    if (rialto.lang.isStringIn(background, ["gray", "Gris", "transparent", "inherit"])) {
        this.background = background == "Gris" ? "gray" : background;
    }
};
rialto.widget.PopUp.prototype.getBackground = function () {
    return this.background;
};
rialto.widget.PopUp.prototype.adaptToContext = function (parent) {
    var oThis = this;
    var oParent = this.divExt;
    this.deco = new rialto.widget.decoration("popup", oParent);
    this.divTitle = this.deco.DivTitle;
    this.divTitle.className = this.getCssRuleName("popup_title");
    this.divTitle.appendChild(document.createTextNode(this.title));
    this.divIcon = this.deco.DivIconD;
    this.holdImg = document.createElement("DIV");
    this.holdImg.className = this.getCssRuleName("popup_dropimg");
    this.divExt.appendChild(this.holdImg);
    ria.utils.measures.$centerW(this.holdImg);
    if (this.withCloseButon) {
        this.btnClose = new rialto.widget.Image("btonFenFermOff", 0, 0, this.divIcon, rialto.I18N.getLabel("lanCloseWindow"), "btonFenFermOn", {bWithoutRecordInSession:true, boolFloatRight:true});
        this.btnClose.onclick = function () {
            oThis.closeWindow();
        };
    }
    rialto.widgetBehavior.affect(this.holdImg, "DragAndDrop", {oHtmlToMove:this.divExt, oHtmlEvtTarget:this.deco.tDecor.tirette, ghost:{aspect:"frame"}, bRectLim:false, bSelectMark:false});
};
rialto.widget.PopUp.prototype.pileWindow = new Array;
rialto.widget.PopUp.prototype.updatePile = function () {
    var almostOnevisible = false;
    for (var i = 0; i < rialto.widget.PopUp.prototype.pileWindow.length; i++) {
        var pop = rialto.widget.PopUp.prototype.pileWindow[i];
        if (pop.isVisible()) {
            almostOnevisible = true;
            if (i != rialto.widget.PopUp.prototype.pileWindow.length - 1 && pop.isEnable()) {
                pop.setEnable(false, true);
            }
        }
    }
    if (!almostOnevisible) {
        this.mask.style.display = "none";
    } else {
        this.mask.style.display = "block";
    }
};
rialto.widget.PopUp.prototype.release = function () {
    this.removeFromPile();
    var pop = this.getLastEnableInPile();
    if (pop) {
        pop.setEnable(true);
    }
    this.updatePile();
    if (this.withCloseButon) {
        this.btnClose.remove();
    }
    rialto.widgetBehavior.desaffect(this.holdImg, "DragAndDrop");
};
rialto.widget.PopUp.prototype.getHtmlCont = function () {
    return this.divCont;
};
rialto.widget.PopUp.prototype.closeWindow = function () {
    this.onClose();
    this.remove();
};
rialto.widget.PopUp.prototype.removeFromPile = function () {
    rialto.array.remove(rialto.widget.PopUp.prototype.pileWindow, this);
};
rialto.widget.PopUp.prototype.setAsLastInPile = function () {
    this.removeFromPile();
    rialto.widget.PopUp.prototype.pileWindow.push(this);
};
rialto.widget.PopUp.prototype.getLastEnableInPile = function () {
    for (var i = rialto.widget.PopUp.prototype.pileWindow.length - 1; i >= 0; i--) {
        var pop = rialto.widget.PopUp.prototype.pileWindow[i];
        if (pop.isVisible()) {
            return pop;
        }
    }
    return null;
};
rialto.widget.PopUp.prototype.setEnable = function (enable, fromUpdatePile) {
    if (enable) {
        this.insideMask.style.display = "none";
        this.setMaskClassName();
        this.setAsLastInPile();
    } else {
        this.insideMask.style.display = "block";
        if (!fromUpdatePile) {
            var pop = this.getLastEnableInPile();
            if (pop) {
                pop.setEnable(true);
            }
        }
    }
    this.enable = enable;
};
rialto.widget.PopUp.prototype.setVisible = function (visible) {
    if (visible) {
        this.setEnable(true);
        this.mask.style.display = "block";
        this.divExt.style.display = "block";
    } else {
        this.mask.className = "ecranMasque_transparent";
        this.visible = false;
        var pop = this.getLastEnableInPile();
        if (pop) {
            pop.setEnable(true);
        }
        this.divExt.style.display = "none";
    }
    this.visible = visible;
    this.updatePile();
};
rialto.widget.PopUp.prototype.setTitle = function (newtitle) {
    this.title = newtitle;
    if (this.divTitle) {
        this.divTitle.replaceChild(document.createTextNode(newtitle), this.divTitle.firstChild);
        this.onSetTitle(newtitle);
    }
};
rialto.widget.PopUp.prototype.getTitle = function () {
    return this.title = newtitle;
};
rialto.widget.PopUp.prototype.updateSize = function () {
};
rialto.widget.PopUp.prototype.updateHeight = function () {
    this.height = parseInt(this.height) + 45;
    this.divExt.style.height = this.height;
    ria.utils.measures.$setHeightWithAllAvailable(this.divCont);
};
rialto.widget.PopUp.prototype.updateWidth = function () {
    ria.utils.measures.$setWidthWithAllAvailable(this.divCont);
    ria.utils.measures.$centerW(this.holdImg);
};
rialto.widget.PopUp.prototype.onSetTitle = function (newtitle) {
};
rialto.widget.PopUp.prototype.onClose = function () {
};


if (!rialto.widgetBehavior) {
    rialto.widgetBehavior = {};
}
rialto.widgetBehavior.createBehavior = function (behavior, baseFunction, extendedBehavior) {
    rialto.widgetBehavior[behavior] = function (setup) {
        if (!rialto.widgetBehavior.$$coreAffect.apply(this, [behavior, setup])) {
            return;
        }
        baseFunction.apply(this, [setup]);
        if (baseFunction.prototype) {
            for (var proto in baseFunction.prototype) {
                if (typeof baseFunction.prototype[proto] == "function") {
                    this[proto] = baseFunction.prototype[proto];
                }
            }
        }
    };
    if (baseFunction.prototype) {
        rialto.widgetBehavior[behavior].prototype = {};
    }
    for (var proto in baseFunction.prototype) {
        if (typeof baseFunction.prototype[proto] != "function") {
            rialto.widgetBehavior[behavior].prototype[proto] = baseFunction.prototype[proto];
        }
    }
    if (extendedBehavior) {
        rialto.widgetBehavior[behavior].superClass = rialto.widgetBehavior[extendedBehavior];
    }
};
rialto.widgetBehavior.$$coreAffect = function (behavior, setup) {
    if (!this.withBehavior) {
        this.withBehavior = {};
    }
    if (typeof this.withBehavior[behavior] != "undefined") {
        return false;
    } else {
        if (rialto.widgetBehavior[behavior].superClass) {
            this.base = rialto.widgetBehavior[behavior].superClass;
            this.base(setup);
        }
        this.withBehavior[behavior] = true;
        return true;
    }
};
rialto.widgetBehavior.affect = function (widget, behavior, setup) {
    if (!setup) {
        setup = {};
    }
    if ((!widget.withBehavior) || widget.withBehavior[behavior] == undefined) {
        widget[behavior] = rialto.widgetBehavior[behavior];
        widget[behavior](setup);
    } else {
        rialto.widgetBehavior.modify(widget, behavior, setup);
    }
};
rialto.widgetBehavior.desaffect = function (widget, behavior) {
    var objRefDD = {behavior:"", movinglimits:"", nextCibling:"", oCiu:"", refObjSpecs:"", specs:"", withBehavior:"", DragAndDrop:"", addEventListener:"", extendToMissile:"", loadLimitsDyn:"", synchro:"", synchroDDMup:"", afterDD:"", afterClic:"", loadSpecs:""};
    var objRefRS = {behavior:"", limitReDim:"", oCiu:"", refObjSpecsRS:"", specsRS:"", withBehavior:"", ReSize:"", addEventListener:"", loadLimitsDynRS:"", synchroRS:"", afterRS:"", afterClic:"", loadSpecsRS:""};
    var objRefMI = {onmousedown:"", onmousemove:"", onmouseup:"", dragAndDrop:"", behavior:"", movinglimits:"", nextCibling:"", oCiu:"", refObjSpecs:"", specs:"", withBehavior:"", Missile:"", addEventListener:"", base:"", extendToMissile:"", loadLimitsDyn:"", synchro:"", synchroDDMup:"", afterDD:"", afterClic:"", loadSpecs:""};
    var objRefTA = {oHtml:"", oRia:"", specsTarg:"", withBehavior:"", receiveAfterDrop:"", DDHover:"", DDOuter:"", onmouseover:"", onmouseout:"", Target:"", addEventListener:"", removeWitnessOfDragHover:"", witnessOfDragHover:""};
    var oHtml;
    switch (behavior) {
      case "DragAndDrop":
        oHtml = widget.specs.oHtmlEvtTarget[0];
        oHtml.style.cursor = "pointer";
        var objRef = objRefDD;
        break;
      case "Missile":
        oHtml = widget.specs.oHtmlEvtTarget[0];
        oHtml.style.cursor = "pointer";
        var objRef = objRefMI;
        break;
      case "Target":
        oHtml = widget.oHtml;
        _DDMgr.removeTarget(widget);
        var objRef = objRefTA;
        break;
      case "ReSize":
        oHtml = widget.specsRS.cibleEvt[0];
        var objRef = objRefRS;
        break;
    }
    if (widget.withBehavior) {
        widget.withBehavior[behavior] = undefined;
    }
    for (var prop in objRef) {
        try {
            oHtml[prop] = null;
        }
        catch (e) {
        }
    }
};
rialto.widgetBehavior.modify = function (widget, behavior, setup) {
    console.info("a implementer : doit realiser une modification de comportement");
    if (!setup) {
        setup = {};
    }
    if ((!widget.withBehavior) || widget.withBehavior[behavior] == undefined) {
        alert("the widget " + widget.id + " hasn't " + behavior + " behavior : it cannot be modfied");
    } else {
    }
};


var ENREG_DD = 99;
var oDeplact = null;
var _ECN_ICONE_DD_DEF = "icone_DD_def";
rialto.widgetBehavior.DD_SENSITIVEEDGEWIDTH_DEFAULT = 0;
var WICHMOUSEBUTTONFORDD_DEFAULT = "left";
var WICHMOUSEBUTTONFORDD_AUTHORIZEDVALUES = "left#right#both#";
rialto.widgetBehavior.DDStdtLoadLimitsMoving = function () {
    if (this.movingLimits.bRectLim) {
        this.movingLimits.rectLim.bottom = eval(this.movingLimits.rectLim.bottomSpecs);
        this.movingLimits.rectLim.right = eval(this.movingLimits.rectLim.rightSpecs);
        this.movingLimits.rectLim.top = eval(this.movingLimits.rectLim.topSpecs);
        this.movingLimits.rectLim.left = eval(this.movingLimits.rectLim.leftSpecs);
    }
    if (this.specs.ghost) {
        this.specs.ghost.top = eval(this.specs.ghost.topSpec);
        this.specs.ghost.height = eval(this.specs.ghost.heightSpec);
    }
};
rialto.widgetBehavior.DDStdtLoadParameters = function (specs) {
    if (!specs) {
        specs = new Object;
    }
    this.specs = new Object;
    if (!specs.oHtmlEvtTarget) {
        this.specs.oHtmlEvtTarget = new Array;
        this.specs.oHtmlEvtTarget[0] = this;
    } else {
        if (!(specs.oHtmlEvtTarget instanceof Array)) {
            var woHtmlEvtTarget = specs.oHtmlEvtTarget;
            this.specs.oHtmlEvtTarget = new Array;
            this.specs.oHtmlEvtTarget[0] = woHtmlEvtTarget;
        } else {
            if (specs.oHtmlEvtTarget instanceof Array) {
                this.specs.oHtmlEvtTarget = specs.oHtmlEvtTarget;
            } else {
            }
        }
    }
    this.specs.oHtmlToMove = specs.oHtmlToMove ? specs.oHtmlToMove : this;
    this.specs.dragMood = (specs.dragMood != null) ? specs.dragMood : specs.ghost ? "ghostMove" : "directMove";
    this.specs.bSelectMark = (specs.bSelectMark != null) ? specs.bSelectMark : true;
    this.specs.bDynamicsMovingLimits = (specs.bDynamicsMovingLimits != null) ? specs.bDynamicsMovingLimits : true;
    this.specs.ghost = new Object;
    if (this.specs.dragMood == "ghostMove") {
        if (specs.ghost) {
            traceExec("avant this.specs.oHtmlToMove" + _rum.$getHeight(this.specs.oHtmlToMove), 2);
            this.specs.ghost.height = specs.ghost.height ? specs.ghost.height : null;
            this.specs.ghost.top = specs.ghost.top ? specs.ghost.top : 0;
            this.specs.ghost.asChild = specs.ghost.asChild ? specs.ghost.asChild : false;
            this.specs.ghost.aspect = specs.ghost.aspect || "cadre";
            if ((this.specs.ghost.aspect != "frame") && (this.specs.ghost.aspect != "rect")) {
                this.specs.ghost.bIcone = true;
                if (this.specs.ghost.aspect == "icon") {
                    this.specs.ghost.aspect = _ECN_ICONE_DD_DEF;
                }
            }
            if (specs.ghost.bOnePixel) {
                this.specs.ghost.bOnePixel = specs.ghost.bOnePixel;
            } else {
                this.specs.ghost.bOnePixel = this.specs.ghost.bIcone ? true : false;
            }
        } else {
            this.specs.ghost.aspect = "frame";
            this.specs.ghost.top = 0;
            this.specs.ghost.height = "_rum.$getHeight(this.specs.oHtmlToMove)";
            this.specs.ghost.bOnePixel = false;
        }
    } else {
        this.specs.ghost = false;
        this.specs.bSelectMark = false;
    }
    if (this.specs.bDynamicsMovingLimits) {
        this.specs.ghost.heightSpec = this.specs.ghost.height;
        this.specs.ghost.topSpec = this.specs.ghost.top;
    } else {
        this.specs.ghost.height = eval(this.specs.ghost.height);
        this.specs.ghost.top = eval(this.specs.ghost.top);
    }
    this.specs.bMUpAction = (specs.bMUpAction != null) ? specs.bMUpAction : true;
    this.specs.posRelI = new Object;
    if (specs.posRelI) {
        this.specs.posRelI.top = specs.posRelI.top;
        this.specs.posRelI.left = specs.posRelI.left;
    }
    this.specs.modCurs = new Object;
    if (specs.modCursor) {
        this.specs.modCurs.avantDD = (specs.modCursor.avantDD != "undefined") ? specs.modCursor.avantDD : true;
        this.specs.modCurs.auClic = (specs.modCursor.auClic != "undefined") ? specs.modCursor.auClic : true;
    } else {
        this.specs.modCurs.avantDD = true;
        this.specs.modCurs.auClic = true;
    }
    if (specs.magneticsGrid) {
        this.specs.magneticsGrid = new Object;
        this.specs.magneticsGrid.widthCol = specs.magneticsGrid.widthCol || 10;
        this.specs.magneticsGrid.heightRow = specs.magneticsGrid.heightRow || 10;
        this.specs.magneticsGrid.limitsDisplayed = specs.magneticsGrid.limitsDisplayed ? specs.magneticsGrid.limitsDisplayed.toUpperCase() : "2D";
    }
    this.complementProp = specs.complementProp;
    if (!specs.movingLimits) {
        specs.movingLimits = {};
    }
    this.movingLimits = new Object;
    this.movingLimits.bCircular = specs.movingLimits.bCircular || false;
    this.movingLimits.orientation = specs.movingLimits.orientation ? specs.movingLimits.orientation : "2D";
    traceExec("specs.bRectLim avant affact de this.movingLimits.bRectLim = " + specs.bRectLim, 73);
    this.movingLimits.bRectLim = (specs.bRectLim != null) ? specs.bRectLim : true;
    this.movingLimits.rectLim = new Object;
    var flagModSpecsMovingLimitsRectLim = false;
    if (!specs.movingLimits.rectLim) {
        specs.movingLimits.rectLim = {};
        flagModSpecsMovingLimitsRectLim = true;
    } else {
        for (var i in specs.movingLimits.rectLim) {
        }
        this.movingLimits.bRectLim = true;
    }
    this.movingLimits.oHtmlRef = specs.movingLimits.oHtmlRef || this.specs.oHtmlToMove.parentNode;
    if (this.movingLimits.bRectLim) {
        this.movingLimits.isWithLimitsDisplayed = true;
    } else {
        this.movingLimits.isWithLimitsDisplayed = false;
    }
    if (specs.magneticsGrid) {
        this.movingLimits.isWithLimitsDisplayed = true;
        this.specs.magneticsGrid.bDisplayed = true;
        this.movingLimits.limitsDisplayed = this.specs.magneticsGrid.limitsDisplayed;
    }
    if (specs.isWithLimitsDisplayed != undefined) {
        this.movingLimits.isWithLimitsDisplayed = specs.isWithLimitsDisplayed;
    }
    if (!this.specs.bDynamicsMovingLimits) {
        this.movingLimits.rectLim.right = eval(specs.movingLimits.rectLim.right) || _rum.$getWidth(this.movingLimits.oHtmlRef, borderLess = true);
        this.movingLimits.rectLim.left = eval(specs.movingLimits.rectLim.left) || 0;
        traceExec("this.movingLimits.rectLim.left= " + this.movingLimits.rectLim.left, 77);
    } else {
        this.movingLimits.rectLim.rightSpecs = specs.movingLimits.rectLim.right || "_rum.$getWidth ( this.movingLimits.oHtmlRef,borderLess=true)";
    }
    if (!this.specs.bDynamicsMovingLimits) {
        this.movingLimits.rectLim.bottom = eval(specs.movingLimits.rectLim.bottom) || _rum.$getHeight(this.movingLimits.oHtmlRef, borderLess = true);
        this.movingLimits.rectLim.top = eval(specs.movingLimits.rectLim.top) || 0;
    } else {
        this.movingLimits.rectLim.bottomSpecs = specs.movingLimits.rectLim.bottom || "_rum.$getHeight(this.movingLimits.oHtmlRef,borderLess=true)";
        this.movingLimits.rectLim.leftSpecs = specs.movingLimits.rectLim.left || 0;
        this.movingLimits.rectLim.topSpecs = specs.movingLimits.rectLim.top || 0;
        traceExec("this.movingLimits.rectLim.leftSpecs= " + this.movingLimits.rectLim.leftSpecs, 77);
    }
    this.isWithMovingInfo = (specs.isWithMovingInfo != undefined) ? specs.isWithMovingInfo : false;
    this.isWithMovingInParentInfo = (specs.isWithMovingInParentInfo != undefined) ? specs.isWithMovingInParentInfo : false;
    if (specs.isWithMovingInParentInfo != undefined) {
        this.isWithMovingInfo = true;
    }
    if (this.movingLimits) {
        if (this.movingLimits.rectLim) {
        }
    }
    if (this.movingLimits.orientation == "h") {
        this.movingLimits.rectLim.topSpecs = this.movingLimits.rectLim.top = (specs.posRelI ? eval(specs.posRelI.top) : 0);
        this.movingLimits.rectLim.bottomSpecs = this.movingLimits.rectLim.bottom = _rum.$getHeight(this.specs.oHtmlToMove) + this.movingLimits.rectLim.top;
    } else {
        if (this.movingLimits.orientation == "v") {
            this.movingLimits.rectLim.leftSpecs = this.movingLimits.rectLim.left = (specs.posRelI ? eval(specs.posRelI.left) : 0);
            this.movingLimits.rectLim.rightSpecs = this.movingLimits.rectLim.right = _rum.$getWidth(this.specs.oHtmlToMove);
            +this.movingLimits.rectLim.left;
        }
    }
    this.specs.sensitiveEdgeWidth = specs.sensitiveEdgeWidth || rialto.widgetBehavior.DD_SENSITIVEEDGEWIDTH_DEFAULT;
    if (this.specs.posRelI.top != null) {
        this.specs.oHtmlToMove.style.top = this.specs.posRelI.top;
    }
    if (this.specs.posRelI.left != null) {
        this.specs.oHtmlToMove.style.left = this.specs.posRelI.left;
    }
    this.specs.whichMouseButtonForDD = specs.whichMouseButtonForDD || WICHMOUSEBUTTONFORDD_DEFAULT;
    if (WICHMOUSEBUTTONFORDD_AUTHORIZEDVALUES.indexOf(this.specs.whichMouseButtonForDD + "#") == -1) {
        this.specs.whichMouseButtonForDD = WICHMOUSEBUTTONFORDD_DEFAULT;
    }
    if (flagModSpecsMovingLimitsRectLim) {
        specs.movingLimits.rectLim = null;
    }
};
rialto.widgetBehavior.constructorDragAndDrop = function (specs) {
    if (!this.oCiu) {
        this.oCiu = new Array();
    }
    this.oCiu["DragAndDrop"] = this;
    if (!this.oCiu["DragAndDrop"].loadSpecs) {
        this.oCiu["DragAndDrop"].loadSpecs = rialto.widgetBehavior.DDStdtLoadParameters;
    }
    if (specs && specs.refCache) {
        if (rialtoSpecsDD != null) {
            this.oCiu["DragAndDrop"].specs = {};
            for (var prop in rialtoSpecsDD) {
                this.oCiu["DragAndDrop"].specs[prop] = rialtoSpecsDD[prop];
            }
            this.oCiu["DragAndDrop"].specs.oHtmlEvtTarget[0] = this;
            this.oCiu["DragAndDrop"].specs.oHtmlToMove = this;
            this.oCiu["DragAndDrop"].movingLimits = rialtoSpecsDDMovingLimits;
        } else {
            this.oCiu["DragAndDrop"].loadSpecs(specs);
            rialtoSpecsDD = this.oCiu["DragAndDrop"].specs;
            rialtoSpecsDDMovingLimits = this.oCiu["DragAndDrop"].movingLimits;
            testFL.i++;
        }
    } else {
        this.oCiu["DragAndDrop"].loadSpecs(specs);
    }
    if (this.oCiu["DragAndDrop"].specs.bDynamicsMovingLimits) {
        if (!this.oCiu["DragAndDrop"].loadLimitsDyn) {
            this.oCiu["DragAndDrop"].loadLimitsDyn = rialto.widgetBehavior.DDStdtLoadLimitsMoving;
        }
        this.oCiu["DragAndDrop"].loadLimitsDyn();
    }
    var oCiu = this.oCiu["DragAndDrop"];
    for (var i = 0; i < oCiu.specs.oHtmlEvtTarget.length; i++) {
        oCiu.specs.oHtmlEvtTarget[i].dragAndDrop = true;
        oCiu.specs.oHtmlEvtTarget[i].refObjSpecs = this;
        if (!oCiu.specs.oHtmlEvtTarget[i].behavior) {
            oCiu.specs.oHtmlEvtTarget[i].behavior = {};
        }
        if (!oCiu.specs.oHtmlEvtTarget[i].behavior["DD"]) {
            oCiu.specs.oHtmlEvtTarget[i].behavior["DD"] = {};
        }
        oCiu.specs.oHtmlEvtTarget[i].behavior["DD"].running = false;
    }
    if (typeof document.addEventListener == "undefined") {
        if (rialto.widgetBehavior.DragAndDrop_attachEventToDocument) {
            if (!document.rialtoEnregtDragAndDrop) {
                document.rialtoEnregtDragAndDrop = true;
                document.body.addHandler = ria.utils.event.addHandler;
                document.body.methodMouseDown = rialto.widgetBehavior.DragAndDropMouseDownHandler;
                document.body.addHandler(document.body, "onmousedown", "methodMouseDown");
                document.body.methodMouseMove = rialto.widgetBehavior.DragAndDropMouseMoveHandler;
                document.body.addHandler(document.body, "onmousemove", "methodMouseMove");
                document.body.methodMouseUp = rialto.widgetBehavior.DragAndDropMouseUpHandler;
                document.body.addHandler(document.body, "onmouseup", "methodMouseUp");
            }
        } else {
            var tOCible = oCiu.specs.oHtmlEvtTarget;
            for (var i = 0; i < tOCible.length; i++) {
                tOCible[i].addHandler = ria.utils.event.addHandler;
                tOCible[i].methodMouseDown = rialto.widgetBehavior.DragAndDropMouseDownHandler;
                tOCible[i].addHandler(tOCible[i], "onmousedown", "methodMouseDown");
                tOCible[i].methodMouseMove = rialto.widgetBehavior.DragAndDropMouseMoveHandler;
                tOCible[i].addHandler(tOCible[i], "onmousemove", "methodMouseMove");
                tOCible[i].methodMouseUp = rialto.widgetBehavior.DragAndDropMouseUpHandler;
                tOCible[i].addHandler(tOCible[i], "onmouseup", "methodMouseUp");
            }
        }
    } else {
        if (!document.rialtoEnregtDragAndDrop) {
            document.rialtoEnregtDragAndDrop = true;
            document.addEventListener("mousemove", rialto.widgetBehavior.DragAndDropMouseMoveHandler, false);
            document.addEventListener("mouseup", rialto.widgetBehavior.DragAndDropMouseUpHandler, false);
            document.addEventListener("mousedown", rialto.widgetBehavior.DragAndDropMouseDownHandler, false);
        }
    }
    if (this.specs.ghost) {
        var ghostFrame = rialto.session.objects ? rialto.session.objects["singleGhostFrame"] : null;
        if (ghostFrame == null) {
            rialto.session.objects["singleGhostFrame"] = ghostFrame = document.createElement("DIV");
            ghostFrame.id = "singleGhostFrame";
            ghostFrame.className = "ghostDD_" + this.specs.ghost.aspect;
            rialto.effect.opacity(ghostFrame, rialto.widgetBehavior.DragAndDrop_defaults.ghost_opacity);
            if (this.specs.ghost.asChild) {
                this.specs.oHtmlToMove.parentNode.appendChild(ghostFrame);
            } else {
                document.body.appendChild(ghostFrame);
            }
        }
    }
    this.extendToMissile = function (specs) {
        this.$$bh_Missile = Missile;
        this.$$bh_Missile(specs);
    };
};
rialto.widgetBehavior.createBehavior("DragAndDrop", rialto.widgetBehavior.constructorDragAndDrop);
rialto.widgetBehavior.DDtargetOrTargetChild = function (oHtml) {
    var div = oHtml;
    while (div && !div.dragAndDrop) {
        div = div.parentNode;
    }
    if (div && div.dragAndDrop) {
        return div;
    } else {
        return null;
    }
};
rialto.widgetBehavior.DDmodCursor = function (oHtml, direction, orientation, cible) {
    if (cible) {
        oHtml.style.cursor = "move";
        return;
    }
    if (direction == "") {
    } else {
        if (orientation == "v") {
            oHtml.style.cursor = direction + "-resize";
        } else {
            if (orientation == "h") {
                oHtml.style.cursor = direction + "-resize";
            } else {
                oHtml.style.cursor = "move";
            }
        }
    }
};
rialto.widgetBehavior.StopSelectDef = function (e) {
    ria.utils.event.stopDefault(e);
};
rialto.widgetBehavior.Missile = function (specs) {
    var domain = specs.domainTargets;
    var targets = specs.targets;
    var domainUnauthorizedTarget = specs.unauthorizedTargets;
    this.specs.targetChoice = specs.targetChoice || "";
    this.specs.circularDropAuthorized = specs.circularDropAuthorized || false;
    this.specs.dropTargets = true;
    this.specs.domain = domain;
    this.specs.targets = targets;
    if (targets != undefined) {
        if (!this.specs.domain) {
            alert("missile constructeur avec cible mais sans domain defini");
            this.specs.domain = "__domProv" + rialto.widgetBehavior.Missile.prototype.idDomainProv++;
            alert("domain construit = " + this.specs.domain);
        }
        for (var i = 0; i < targets.length; i++) {
            rialto.widgetBehavior.affect(targets[i], "Target", {domain:this.specs.domain});
        }
    }
    if (typeof domainUnauthorizedTarget == "string") {
        this.specs.domainUnauthorizedTarget = domainUnauthorizedTarget;
    } else {
        if (domainUnauthorizedTarget instanceof Array) {
            this.specs.domainUnauthorizedTarget = "__domProv" + Missile.prototype.idDomainProv++;
            var c;
            for (var i = 0; i < domainUnauthorizedTarget.length; i++) {
                c = domainUnauthorizedTarget[i];
                rialto.widgetBehavior.affect(c, "Target", {domain:this.specs.domainUnauthorizedTarget});
            }
        }
    }
};
rialto.widgetBehavior.Missile.prototype.idDomainProv = 0;
rialto.widgetBehavior.createBehavior("Missile", rialto.widgetBehavior.Missile, "DragAndDrop");
rialto.widgetBehavior.baseTarget = function (specs) {
    if (specs == undefined) {
        specs = {};
    }
    var oHtml = specs.oHtml;
    var domain = specs.domain;
    this.oHtml = oHtml || this;
    this.oHtml.oRia = this;
    this.oHtml.onmouseover = function (e) {
        traceExec(e, 9);
    };
    if (!this.oHtml.id || ((typeof this.oHtml.id) == "undefined")) {
        this.oHtml.id = rialto.widgetBehavior.baseTarget.prototype.nbInstances++;
    }
    this.id = this.oHtml.id;
    this.domain = domain || "undef";
    var oSpecs;
    if (!specs) {
        oSpecs = new Object;
    } else {
        oSpecs = specs;
    }
    this.specsTarg = new Object;
    this.specsTarg.missileAsOnePixel = (oSpecs.missileAsOnePixel != undefined) ? oSpecs.missileAsOnePixel : true;
    this.specsTarg.intersectMode = (oSpecs.intersectMode != undefined) ? oSpecs.intersectMode : false;
    if (this.specsTarg.intersectMode) {
        this.specsTarg.missileAsOnePixel = false;
    }
    this.specsTarg.borderIsTarget = (oSpecs.borderIsTarget != undefined) ? oSpecs.borderIsTarget : true;
    this.specsTarg.bSyndicToAllEvent = (oSpecs.bSyndicToAllEvent != undefined) ? oSpecs.bSyndicToAllEvent : true;
    this.witnessOfDragHover = rialto.widgetBehavior.baseTarget.witnessOfDragHover;
    this.removeWitnessOfDragHover = rialto.widgetBehavior.baseTarget.removeWitnessOfDragHover;
    if (rialto.widgetBehavior.DragAndDrop_withMouseOverMood) {
        this.onmouseover = function (e) {
            if (!_DDMgr) {
                return;
            }
            if (!_DDMgr.currDrag) {
                return;
            }
            if (!_DDMgr.flyOverOneTarget(this)) {
                _DDMgr.flyOverOneTarget(this, unauthorized = true);
            }
            stopEvent(e);
        };
    }
    _DDMgr.addTarget(this.oHtml, this.domain);
};
rialto.widgetBehavior.baseTarget.prototype.nbInstances = 0;
rialto.widgetBehavior.baseTarget.witnessOfDragHover = function (display, isTargetsUnAuthorized) {
    if (this.witnessDragHover) {
        return;
    }
    var iTopLeftBoundDivToMoveInVP = _rum.$divInternalTopLeftInViewPort(this.oHtml);
    var iTopBoundDivToMoveInVP = iTopLeftBoundDivToMoveInVP.top;
    var iLeftBoundDivToMoveInVP = iTopLeftBoundDivToMoveInVP.left;
    this.witnessDragHover = document.createElement("DIV");
    this.ws = this.witnessDragHover.style;
    if (isTargetsUnAuthorized) {
        this.witnessDragHover.className = "dashed line redBorder";
    } else {
        this.witnessDragHover.className = "dashed line greenBorder";
    }
    document.body.appendChild(this.witnessDragHover);
    if (this.oHtml.nodeName == "BODY") {
        _rum.$setSizeConformW3C(this.witnessDragHover, document.body);
        this.ws.top = this.ws.left = 0;
    } else {
        if (this.specsTarg.borderIsTarget) {
            this.ws.width = _rum.$getWidth(this.oHtml, borderLess = false);
            this.ws.height = _rum.$getHeight(this.oHtml, borderLess = false);
            _rum.$setSizeConformW3C(this.witnessDragHover);
            this.ws.top = iTopBoundDivToMoveInVP - _rum.$$getBorderTopWidth(this.oHtml) - _rum.$$getBorderTopWidth(this.witnessDragHover);
            this.ws.left = iLeftBoundDivToMoveInVP - _rum.$$getBorderLeftWidth(this.oHtml) - _rum.$$getBorderLeftWidth(this.witnessDragHover);
        } else {
            this.ws.width = _rum.$getWidth(this.oHtml, borderLess = true);
            this.ws.height = _rum.$getHeight(this.oHtml, borderLess = true);
            this.ws.top = iTopBoundDivToMoveInVP - _rum.$$getBorderTopWidth(this.witnessDragHover);
            this.ws.left = iLeftBoundDivToMoveInVP - _rum.$$getBorderLeftWidth(this.witnessDragHover);
        }
    }
    if (display) {
        this.witnessDragHover.style.display = "block";
    } else {
        this.witnessDragHover.style.display = "none";
    }
};
rialto.widgetBehavior.baseTarget.removeWitnessOfDragHover = function () {
    document.body.removeChild(this.witnessDragHover);
    this.witnessDragHover = null;
};
rialto.widgetBehavior.baseTarget.prototype.DDHover = function (missile, isTargetsUnAuthorized) {
    traceExec("hover------ this.id= " + this.id, 78);
    this.witnessOfDragHover(display = true, isTargetsUnAuthorized);
};
rialto.widgetBehavior.baseTarget.prototype.DDOuter = function (missile) {
    traceExec("outer------ this.id= " + this.id, 78);
    this.removeWitnessOfDragHover();
};
rialto.widgetBehavior.createBehavior("Target", rialto.widgetBehavior.baseTarget);


rialto.widgetBehavior.DragAndDrop_withMouseOverMood = false;
rialto.widgetBehavior.DragAndDrop_attachEventToDocument = false;
if (rialto.widgetBehavior.DragAndDrop_withMouseOverMood) {
    rialto.widgetBehavior.DragAndDrop_attachEventToDocument = true;
}
rialto.widgetBehavior.DragAndDrop_cstes = {zIndexMovingOHtml:1000000, zIndexInfoFrame:1000001};
rialto.widgetBehavior.DragAndDrop_defaults = {ghost_opacity:0.5, markSelect_opacity:0.5};
rialto.widgetBehavior.DragAndDropMouseDownHandler = function (e) {
    if (!e) {
        var e = window.event;
    }
    var oSourceEvt = e.target ? e.target : e.srcElement;
    var cibl = rialto.widgetBehavior.DDtargetOrTargetChild(oSourceEvt);
    if (!cibl) {
        return;
    } else {
        oSourceEvt = cibl;
    }
    var oHtml = oSourceEvt;
    if (oHtml.widgetLink) {
        traceExec("****************DragAndDropMouseDownHandler" + oHtml.widgetLink.componentName, 1);
    }
    var oSpecs = oHtml.refObjSpecs;
    switch (oSpecs.specs.whichMouseButtonForDD) {
      case "left":
        if (!ria.utils.event.isLeftClick(e)) {
            return true;
        }
        break;
      case "right":
        if (!ria.utils.event.isRightClick(e)) {
            return true;
        }
        break;
      case "both":
        if ((!ria.utils.event.isLeftClick(e)) && (!ria.utils.event.isRightClick(e))) {
            return true;
        }
        break;
      default:
        break;
    }
    var direction = DirDeplact(oHtml, e, _rum.$getHeight(oHtml), _rum.$getWidth(oHtml), oSpecs.specs.sensitiveEdgeWidth, true, oSpecs.movingLimits.orientation);
    if (!direction) {
        return;
    }
    if ((oHtml.behavior["RS"]) && (oHtml.behavior["RS"].isRunning)) {
        return;
    } else {
        oHtml.behavior["DD"].isRunning = true;
    }
    if (oSpecs.specs.bDynamicsMovingLimits) {
        oSpecs.loadLimitsDyn();
    }
    var oHtmlToMove = oSpecs.specs.oHtmlToMove;
    var oHtmlParentRef = oHtmlToMove.parentNode;
    var boundOHtmlRef = oSpecs.movingLimits.oHtmlRef;
    if (oSpecs.specs.bSelectMark) {
        var maskSelect = document.createElement("DIV");
        traceExec("****************CREATION D'UN MASQUE", 1);
        maskSelect.id = "maskSelectDD_unique";
        maskSelect.className = "maskSelectDD";
        maskSelect.style.top = -_rum.$$getBorderTopWidth(oHtmlToMove);
        maskSelect.style.left = -_rum.$$getBorderLeftWidth(oHtmlToMove);
        maskSelect.style.width = oHtmlToMove.offsetWidth;
        maskSelect.style.height = oHtmlToMove.offsetHeight;
        rialto.effect.opacity(maskSelect, 0.5);
        oHtmlToMove.appendChild(maskSelect);
    }
    var parentOHtmlToMove;
    var nextSiblOHtmlToMove;
    var isMovingOHtmlInDoct = true;
    var topLeftDivToMoveInVP = _rum.$divTopLeftInViewPort(oHtmlToMove);
    var topDivToMoveInVP = topLeftDivToMoveInVP.top;
    var leftDivToMoveInVP = topLeftDivToMoveInVP.left;
    var topLeftEvtInVP = _rum.$eventTopLeftInViewPort(e);
    var topEvtInVP = topLeftEvtInVP.top;
    var leftEvtInVP = topLeftEvtInVP.left;
    shiftTopForIcon = 0;
    shiftLeftForIcon = 0;
    if ((oSpecs.specs.ghost.bIcone) && (!oSpecs.specs.magneticsGrid)) {
        shiftTopForIcon = (oSpecs.movingLimits.orientation == "h") ? 0 : topEvtInVP - topDivToMoveInVP;
        shiftLeftForIcon = (oSpecs.movingLimits.orientation == "v") ? 0 : leftEvtInVP - leftDivToMoveInVP;
        topDivToMoveInVP = topEvtInVP;
        leftDivToMoveInVP = leftEvtInVP;
    }
    var iTopLeftBoundDivToMoveInVP = _rum.$divInternalTopLeftInViewPort(boundOHtmlRef);
    var iTopBoundDivToMoveInVP = iTopLeftBoundDivToMoveInVP.top;
    var iLeftBoundDivToMoveInVP = iTopLeftBoundDivToMoveInVP.left;
    var iTopLeftParDivToMoveInVP = _rum.$divInternalTopLeftInViewPort(oHtmlParentRef);
    var iTopParDivToMoveInVP = iTopLeftParDivToMoveInVP.top;
    var iLeftParDivToMoveInVP = iTopLeftParDivToMoveInVP.left;
    var deltaTopCursOHtmlToMove = topEvtInVP - topDivToMoveInVP;
    var deltaLeftCursOHtmlToMove = leftEvtInVP - leftDivToMoveInVP;
    topMovingDiv = topDivToMoveInVP;
    leftMovingDiv = leftDivToMoveInVP;
    var isMovingOHtmlRelPos = false;
    var initTopInRel;
    var initLeftInRel;
    var topInNaturalFlow, leftInNaturalFlow;
    if (oSpecs.specs.ghost && !oSpecs.specs.ghost.asChild) {
        var ghostFrame = document.getElementById("singleGhostFrame");
        if (ghostFrame == null) {
            ghostFrame = document.createElement("DIV");
            ghostFrame.id = "singleGhostFrame";
        }
        ghostFrame.style.width = "";
        ghostFrame.style.height = "";
        ghostFrame.className = "ghostDD_" + oSpecs.specs.ghost.aspect;
        document.body.appendChild(ghostFrame);
        ghostFrame.style.top = topMovingDiv;
        ghostFrame.style.left = leftMovingDiv;
        if (!oSpecs.specs.ghost.bIcone) {
            _rum.$setSizeConformW3C(ghostFrame, oHtmlToMove);
            if (oSpecs.specs.ghost.height) {
                ghostFrame.style.height = eval(oSpecs.specs.ghost.height);
            }
        }
        if (oSpecs.specs.ghost.top) {
            ghostFrame.style.top = eval(oSpecs.specs.ghost.top);
        }
        ghostFrame.style.display = "block";
        var movingOHtml = ghostFrame;
        movingOHtml.refObjSpecs = oSpecs;
    } else {
        if (oSpecs.specs.ghost && oSpecs.specs.ghost.asChild) {
            var ghostFrame = document.getElementById("singleGhostFrame");
            if (ghostFrame == null) {
                ghostFrame = document.createElement("DIV");
                ghostFrame.id = "singleGhostFrame";
            }
            ghostFrame.style.top = _rum.$offsetTop(oHtmlToMove);
            ghostFrame.style.left = _rum.$offsetLeft(oHtmlToMove);
            ghostFrame.style.width = "";
            ghostFrame.style.height = "";
            ghostFrame.className = "ghostDD_" + oSpecs.specs.ghost.aspect;
            oHtmlToMove.parentNode.appendChild(ghostFrame);
            if (!oSpecs.specs.ghost.bIcone) {
                _rum.$setSizeConformW3C(ghostFrame, oHtmlToMove);
                if (oSpecs.specs.ghost.height) {
                    ghostFrame.style.height = eval(oSpecs.specs.ghost.height);
                }
            }
            ghostFrame.style.zIndex = rialto.widgetBehavior.DragAndDrop_cstes.zIndexMovingOHtml;
            ghostFrame.style.display = "block";
            var movingOHtml = ghostFrame;
            movingOHtml.refObjSpecs = oSpecs;
            isMovingOHtmlInDoct = false;
            isMovingOHtmlRelPos = (movingOHtml.style.position == "relative");
            initTopInRel = parseInt(_rum.$getStyle(movingOHtml, "top"));
            initLeftInRel = parseInt(_rum.$getStyle(movingOHtml, "left"));
            topInNaturalFlow = _rum.$offsetTop(movingOHtml) - initTopInRel;
            leftInNaturalFlow = _rum.$offsetLeft(movingOHtml) - initLeftInRel;
            topMovingDiv = (movingOHtml.style.position == "relative") ? initTopInRel : _rum.$offsetTop(movingOHtml);
            leftMovingDiv = (movingOHtml.style.position == "relative") ? initLeftInRel : _rum.$offsetLeft(movingOHtml);
        } else {
            var movingOHtml, top, left;
            movingOHtml = oHtmlToMove;
            isMovingOHtmlInDoct = false;
            isMovingOHtmlRelPos = (movingOHtml.style.position == "relative");
            initTopInRel = parseInt(_rum.$getStyle(movingOHtml, "top"));
            initLeftInRel = parseInt(_rum.$getStyle(movingOHtml, "left"));
            topInNaturalFlow = _rum.$offsetTop(movingOHtml) - initTopInRel;
            leftInNaturalFlow = _rum.$offsetLeft(movingOHtml) - initLeftInRel;
            topMovingDiv = (movingOHtml.style.position == "relative") ? initTopInRel : _rum.$offsetTop(movingOHtml);
            leftMovingDiv = (movingOHtml.style.position == "relative") ? initLeftInRel : _rum.$offsetLeft(movingOHtml);
        }
    }
    var shiftRelToAbsTop = (isMovingOHtmlInDoct) ? 0 : iTopLeftParDivToMoveInVP.top;
    var shiftRelToAbsLeft = (isMovingOHtmlInDoct) ? 0 : iTopLeftParDivToMoveInVP.left;
    var shiftAbsToRelTop = (isMovingOHtmlInDoct) ? -iTopLeftParDivToMoveInVP.top : 0;
    var shiftAbsToRelLeft = (isMovingOHtmlInDoct) ? -iTopLeftParDivToMoveInVP.left : 0;
    if (oSpecs.movingLimits.bRectLim) {
        var dLimLeft = dLimTop = dLimRight = dLimBottom = 0;
        if (oSpecs.movingLimits.orientation == "h") {
            dLimTop = iTopParDivToMoveInVP - iTopBoundDivToMoveInVP + _rum.$offsetTop(oHtmlToMove);
            dLimBottom = dLimTop + oHtmlToMove.offsetHeight;
        } else {
            dLimTop = oSpecs.movingLimits.rectLim.top;
            dLimBottom = oSpecs.movingLimits.rectLim.bottom;
        }
        if (oSpecs.movingLimits.orientation == "v") {
            dLimLeft = _rum.$offsetLeft(oHtmlToMove) + iLeftParDivToMoveInVP - iLeftBoundDivToMoveInVP;
            dLimRight = dLimLeft + oHtmlToMove.offsetWidth;
        } else {
            dLimLeft = oSpecs.movingLimits.rectLim.left;
            dLimRight = oSpecs.movingLimits.rectLim.right;
        }
        var gheight = (dLimBottom - dLimTop);
        var gwidth = (dLimRight - dLimLeft);
        if (oSpecs.specs.magneticsGrid) {
            oSpecs.specs.magneticsGrid.nbHorizontalLines = parseInt((gheight - parseInt(oHtmlToMove.offsetHeight)) / oSpecs.specs.magneticsGrid.heightRow) + 1;
            oSpecs.specs.magneticsGrid.nbVerticalLines = parseInt((gwidth - parseInt(oHtmlToMove.offsetWidth)) / oSpecs.specs.magneticsGrid.widthCol) + 1;
        }
    }
    if (oSpecs.movingLimits.isWithLimitsDisplayed) {
        var limRect = document.createElement("DIV");
        limRect.style.width = gwidth;
        limRect.style.height = gheight;
        limRect.className = "line dashed greenBorder";
        document.body.appendChild(limRect);
        _rum.$setWidthConformW3C(limRect);
        var revisedHeight = _rum.$setHeightConformW3C(limRect);
        var IEBorder = revisedHeight - gheight;
        var gridEdgeWidth = _rum.$$getBorderTopWidth(limRect);
        limRect.style.top = iTopBoundDivToMoveInVP - gridEdgeWidth + dLimTop;
        limRect.style.left = iLeftBoundDivToMoveInVP - gridEdgeWidth + dLimLeft;
        if (oSpecs.specs.magneticsGrid && oSpecs.specs.magneticsGrid.bDisplayed) {
            if ((oSpecs.specs.magneticsGrid.limitsDisplayed == "2D") || (oSpecs.specs.magneticsGrid.limitsDisplayed == "H")) {
                gtop = -gridEdgeWidth;
                for (var i = 0; i < oSpecs.specs.magneticsGrid.nbHorizontalLines; i++) {
                    line = document.createElement("DIV");
                    line.className = "line horizontal aquamarineBorder";
                    line.style.top = gtop;
                    line.style.left = 0;
                    line.style.width = parseInt(limRect.style.width) - (IEBorder);
                    line.style.height = 0;
                    line.style.clip = "rect(0," + parseInt(line.style.width) + "px," + gridEdgeWidth + ",0)";
                    gtop = gtop + oSpecs.specs.magneticsGrid.heightRow;
                    limRect.appendChild(line);
                }
            }
            if ((oSpecs.specs.magneticsGrid.limitsDisplayed == "2D") || (oSpecs.specs.magneticsGrid.limitsDisplayed == "V")) {
                gleft = -gridEdgeWidth;
                for (var i = 0; i < oSpecs.specs.magneticsGrid.nbVerticalLines; i++) {
                    lineV = document.createElement("DIV");
                    lineV.className = "line vertical aquamarineBorder";
                    lineV.style.left = gleft;
                    lineV.style.top = 0;
                    lineV.style.height = parseInt(limRect.style.height) - (IEBorder);
                    lineV.style.clip = "rect(0," + gridEdgeWidth + "," + +parseInt(lineV.style.height) + "px" + ",0)";
                    gleft = gleft + oSpecs.specs.magneticsGrid.widthCol;
                    limRect.appendChild(lineV);
                }
            }
        }
    }
    if (oSpecs.isWithMovingInfo) {
        var infoFrame = document.createElement("DIV");
        infoFrame.className = "DDinfoFrame";
        infoFrame.topShift = 10;
        infoFrame.leftShift = 20;
        infoFrame.topShiftI = topEvtInVP;
        infoFrame.leftShiftI = leftEvtInVP;
        infoFrame.style.top = infoFrame.topShiftI + infoFrame.topShift;
        infoFrame.style.left = infoFrame.leftShiftI + infoFrame.leftShift;
        infoFrame.style.filter = "alpha(opacity:50)";
        infoFrame.style.opacity = 0.5;
        infoFrame.style.zIndex = rialto.widgetBehavior.DragAndDrop_cstes.zIndexInfoFrame;
        infoFrame.isWithMovingInParentInfo = oSpecs.isWithMovingInParentInfo;
        if (oSpecs.isWithMovingInParentInfo) {
            infoFrame.innerHTML = (parseInt(movingOHtml.style.top) + shiftAbsToRelTop) + "," + (parseInt(movingOHtml.style.left) + shiftAbsToRelLeft);
        } else {
            infoFrame.innerHTML = (parseInt(movingOHtml.style.top) + shiftRelToAbsTop) + "," + (parseInt(movingOHtml.style.left) + shiftRelToAbsLeft);
        }
        document.body.appendChild(infoFrame);
    }
    traceExec("isMovingOHtmlRelPos\t: " + isMovingOHtmlRelPos + " initTopInRel\t\t\t: " + initTopInRel + " initLeftInRel\t\t\t: " + initLeftInRel, 2);
    var dTopParentToBoundRef, dLeftParentToBoundRef;
    if (oHtmlParentRef == boundOHtmlRef) {
        dTopParentToBoundRef = 0;
        dLeftParentToBoundRef = 0;
    } else {
        dTopParentToBoundRef = iTopLeftBoundDivToMoveInVP.top - iTopLeftParDivToMoveInVP.top;
        dLeftParentToBoundRef = iTopLeftBoundDivToMoveInVP.left - iTopLeftParDivToMoveInVP.left;
    }
    top = parseInt(movingOHtml.style.top);
    left = parseInt(movingOHtml.style.left);
    _DDMgr.initDrag({oThis:oSpecs, oSource:oHtml, ghost:oSpecs.specs.ghost, maskSelect:(oSpecs.specs.bSelectMark ? maskSelect : null), movingOHtml:movingOHtml, oHtmlToMove:oHtmlToMove, bMUpAction:oSpecs.specs.bMUpAction, isMovingOHtmlRelPos:isMovingOHtmlRelPos, topInNaturalFlow:topInNaturalFlow, leftInNaturalFlow:leftInNaturalFlow, isMovingOHtmlInDoct:isMovingOHtmlInDoct, initialTop:initTopInRel, initialLeft:initLeftInRel, topDivToMoveInVP:topDivToMoveInVP, leftDivToMoveInVP:leftDivToMoveInVP, topEvtInVP:topEvtInVP, leftEvtInVP:leftEvtInVP, iTopBoundDivToMoveInVP:iTopBoundDivToMoveInVP, iLeftBoundDivToMoveInVP:iLeftBoundDivToMoveInVP, shiftAbsToRelTop:shiftAbsToRelTop, shiftAbsToRelLeft:shiftAbsToRelLeft, shiftRelToAbsTop:shiftRelToAbsTop, shiftRelToAbsLeft:shiftRelToAbsLeft, deltaTopCursOHtmlToMove:deltaTopCursOHtmlToMove, deltaLeftCursOHtmlToMove:deltaLeftCursOHtmlToMove, eventTopLeftInDiv:{top:deltaTopCursOHtmlToMove, left:deltaLeftCursOHtmlToMove}, topMovingDiv:topMovingDiv, leftMovingDiv:leftMovingDiv, totDeltaMoveTop:0, totDeltaMoveLeft:0, dTopParentToBoundRef:dTopParentToBoundRef, dLeftParentToBoundRef:dLeftParentToBoundRef, prevTop:top, prevLeft:left, mvtEffectif:false, cibleOk:false, svgZIndex:movingOHtml.style.zIndex || 0, oHtmlParentRef:oHtmlParentRef, boundOHtmlRef:boundOHtmlRef, oHtmlLimitsRect:limRect, oHtmlInfoFrame:infoFrame});
    _DDMgr.currDrag.movingOHtml.style.zIndex = rialto.widgetBehavior.DragAndDrop_cstes.zIndexMovingOHtml;
    if (this.setCapture) {
        if (!rialto.widgetBehavior.DragAndDrop_attachEventToDocument) {
            this.setCapture();
        }
        if ((!oSpecs.specs.modCurs.avantDD) && (oSpecs.specs.modCurs.auClic)) {
            rialto.widgetBehavior.DDmodCursor(oHtml, direction, oSpecs.movingLimits.orientation, false);
        }
    } else {
        if ((!oSpecs.specs.modCurs.avantDD) && (oSpecs.specs.modCurs.auClic)) {
            if (oSpecs.specs.ghost) {
                rialto.widgetBehavior.DDmodCursor(objetEnDeplact, direction, oSpecs.movingLimits.orientation, true);
            } else {
                rialto.widgetBehavior.DDmodCursor(oHtml, direction, oSpecs.movingLimits.orientation, true);
            }
        }
    }
    var oThis = _DDMgr.currDrag.oThis;
    if (oThis.afterMD) {
        oThis.afterMD();
    }
    if (typeof document.addEventListener != "undefined") {
        document.addEventListener("mousedown", rialto.widgetBehavior.StopSelectDef, false);
    }
    stopEvent(e);
};
rialto.widgetBehavior.DragAndDropMouseMoveHandler = function (e) {
    if (!e) {
        var e = window.event;
    }
    var oHtml = e.target ? e.target : e.srcElement;
    if (!_DDMgr.currDrag) {
        if (!oHtml.dragAndDrop) {
            return;
        }
        var oSpecs = oHtml.refObjSpecs;
        if (oSpecs && oSpecs.specs.modCurs.avantDD) {
            var direction = DirDeplact(oHtml, e, _rum.$getHeight(oHtml), _rum.$getWidth(oHtml), oSpecs.specs.sensitiveEdgeWidth, true, oSpecs.movingLimits.orientation);
            rialto.widgetBehavior.DDmodCursor(oHtml, direction, oSpecs.movingLimits.orientation, false);
        }
    } else {
        if (e.clientX >= 0 && e.clientY >= 0) {
            var oMovingStyle = _DDMgr.currDrag.movingOHtml.style;
            _DDMgr.currDrag.mvtEffectif = true;
            var nvEventTopLeft = _rum.$eventTopLeftInViewPort(e);
            var totDeltaMoveTop = nvEventTopLeft.top - _DDMgr.currDrag.topEvtInVP;
            var totDeltaMoveLeft = nvEventTopLeft.left - _DDMgr.currDrag.leftEvtInVP;
            newPos = {};
            newPos.top = _DDMgr.currDrag.topMovingDiv + totDeltaMoveTop;
            newPos.left = _DDMgr.currDrag.leftMovingDiv + totDeltaMoveLeft;
            var oWithSpecs = _DDMgr.currDrag.oThis;
            var dTopLeft = rialto.widgetBehavior.$$DDMM_AbsToRel();
            if (oWithSpecs.movingLimits.bRectLim) {
                rialto.widgetBehavior.$$DDMM_applyConstraintsLimits(oWithSpecs, newPos, dTopLeft.top, dTopLeft.left);
            }
            if (oWithSpecs.specs.magneticsGrid) {
                rialto.widgetBehavior.$$DDMM_applyConstraintsMagneticsGrid(oWithSpecs, newPos, dTopLeft.top, dTopLeft.left);
            }
            oMovingStyle.left = newPos.left;
            oMovingStyle.top = newPos.top;
            traceExec("apply newPos.top= " + newPos.top + "newPos.left= " + newPos.left, 73);
            if ((oWithSpecs.specs.dropTargets) && (!oWithSpecs.specs.cibleOk)) {
                if (!rialto.widgetBehavior.DragAndDrop_withMouseOverMood || !oWithSpecs.specs.ghost.bIcone) {
                    rialto.widgetBehavior.$$DDMM_applyConstraintTargets(oWithSpecs);
                    rialto.widgetBehavior.DDmodCursor(_DDMgr.currDrag.movingOHtml, oWithSpecs.movingLimits.orientation, _DDMgr.currDrag.orientation, _DDMgr.currDrag.cibleOk);
                }
            }
            _DDMgr.currDrag.totDeltaMoveTop = newPos.top - _DDMgr.currDrag.topMovingDiv;
            _DDMgr.currDrag.totDeltaMoveLeft = newPos.left - _DDMgr.currDrag.leftMovingDiv;
            if (_DDMgr.currDrag.oHtmlInfoFrame) {
                rialto.widgetBehavior.$$DDMM_displayInfos(oMovingStyle, e, nvEventTopLeft);
            }
            if (oWithSpecs.synchro) {
                rialto.widgetBehavior.$$DDMM_CallBackSynchro(oWithSpecs);
            }
        }
    }
};
rialto.widgetBehavior.$$DDMM_AbsToRel = function () {
    var dTop, dLeft;
    if (_DDMgr.currDrag.isMovingOHtmlInDoct) {
        dTop = _DDMgr.currDrag.iTopBoundDivToMoveInVP;
        dLeft = _DDMgr.currDrag.iLeftBoundDivToMoveInVP;
    } else {
        dTop = _DDMgr.currDrag.dTopParentToBoundRef;
        dLeft = _DDMgr.currDrag.dLeftParentToBoundRef;
        if (_DDMgr.currDrag.isMovingOHtmlRelPos) {
            dTop -= _DDMgr.currDrag.topInNaturalFlow;
            dLeft -= _DDMgr.currDrag.leftInNaturalFlow;
        }
    }
    return {top:dTop, left:dLeft};
};
rialto.widgetBehavior.$$DDMM_applyConstraintsMagneticsGrid = function (oSpecs, newPos, dTop, dLeft) {
    var nvTop = newPos.top;
    var nvLeft = newPos.left;
    var dLimLeft = dLimTop = 0;
    if (oSpecs.movingLimits.rectLim) {
        dLimLeft = oSpecs.movingLimits.rectLim.left;
        dLimTop = oSpecs.movingLimits.rectLim.top;
    }
    if (oSpecs.movingLimits.orientation != "v") {
        var nInterv = Math.round((nvLeft - dLeft - dLimLeft) / oSpecs.specs.magneticsGrid.widthCol);
        nInterv = Math.min((oSpecs.specs.magneticsGrid.nbVerticalLines - 1), nInterv);
        nvLeft = (nInterv) * oSpecs.specs.magneticsGrid.widthCol + dLeft + dLimLeft;
    }
    if (oSpecs.movingLimits.orientation != "h") {
        var nInterv = Math.round((nvTop - dTop - dLimTop) / oSpecs.specs.magneticsGrid.heightRow);
        nInterv = Math.min((oSpecs.specs.magneticsGrid.nbHorizontalLines - 1), nInterv);
        nvTop = (nInterv) * oSpecs.specs.magneticsGrid.heightRow + dTop + dLimTop;
    }
    newPos.top = nvTop;
    newPos.left = nvLeft;
};
rialto.widgetBehavior.$$DDMM_displayInfos = function (oMovingStyle, e, nvEventTopLeft) {
    if (_DDMgr.currDrag.oHtmlInfoFrame.isWithMovingInParentInfo) {
        var topLeft = (parseInt(oMovingStyle.top) + _DDMgr.currDrag.shiftAbsToRelTop) + "," + (parseInt(oMovingStyle.left) + _DDMgr.currDrag.shiftAbsToRelLeft);
    } else {
        var topLeft = (parseInt(oMovingStyle.top) + _DDMgr.currDrag.shiftRelToAbsTop) + "," + (parseInt(oMovingStyle.left) + _DDMgr.currDrag.shiftRelToAbsLeft);
    }
    _DDMgr.currDrag.oHtmlInfoFrame.innerHTML = topLeft + " ( " + _DDMgr.currDrag.totDeltaMoveTop + "," + _DDMgr.currDrag.totDeltaMoveLeft + ")";
    _DDMgr.currDrag.oHtmlInfoFrame.style.top = nvEventTopLeft.top + _DDMgr.currDrag.oHtmlInfoFrame.topShift;
    _DDMgr.currDrag.oHtmlInfoFrame.style.left = nvEventTopLeft.left + _DDMgr.currDrag.oHtmlInfoFrame.leftShift;
};
rialto.widgetBehavior.$$DDMM_applyConstraintsLimits = function (oWithSpecs, newPos, dTop, dLeft) {
    var oHtmlToMove = _DDMgr.currDrag.oHtmlToMove;
    var posMovingOHtml = _DDMgr.currDrag.movingOHtml.style;
    var nvTop = newPos.top;
    var nvLeft = newPos.left;
    if (oWithSpecs.movingLimits.orientation == "v") {
        nvLeft = _DDMgr.currDrag.leftMovingDiv;
    } else {
        if (oWithSpecs.movingLimits.orientation == "h") {
            nvTop = _DDMgr.currDrag.topMovingDiv;
        }
    }
    if ((oWithSpecs.movingLimits.orientation == "v") || (oWithSpecs.movingLimits.orientation == "2D")) {
        if ((parseInt(nvTop) - dTop) < parseInt(oWithSpecs.movingLimits.rectLim.top)) {
            nvTop = oWithSpecs.movingLimits.bCircular ? (oWithSpecs.movingLimits.rectLim.bottom - parseInt(posMovingOHtml.height)) : oWithSpecs.movingLimits.rectLim.top;
            nvTop = parseInt(nvTop) + dTop;
        } else {
            if ((parseInt(nvTop) - dTop + parseInt(oHtmlToMove.offsetHeight)) > parseInt(oWithSpecs.movingLimits.rectLim.bottom)) {
                if (parseInt(oHtmlToMove.offsetHeight) > (oWithSpecs.movingLimits.rectLim.bottom - oWithSpecs.movingLimits.rectLim.top)) {
                    nvTop = Math.max(0, parseInt(nvTop));
                } else {
                    if ((parseInt(posMovingOHtml.top) - (parseInt(nvTop) + dTop)) > 0) {
                        nvTop = parseInt(nvTop) - dTop;
                    } else {
                        nvTop = oWithSpecs.movingLimits.bCircular ? oWithSpecs.movingLimits.rectLim.top : (oWithSpecs.movingLimits.rectLim.bottom - parseInt(oHtmlToMove.offsetHeight));
                    }
                }
                nvTop = parseInt(nvTop) + dTop;
            }
        }
    }
    if ((oWithSpecs.movingLimits.orientation == "h") || (oWithSpecs.movingLimits.orientation == "2D")) {
        if ((parseInt(nvLeft) - dLeft) < parseInt(oWithSpecs.movingLimits.rectLim.left)) {
            nvLeft = oWithSpecs.movingLimits.bCircular ? (parseInt(oWithSpecs.movingLimits.rectLim.right) - parseInt(posMovingOHtml.width)) : parseInt(oWithSpecs.movingLimits.rectLim.left);
            nvLeft = parseInt(nvLeft) + dLeft;
        } else {
            if (((parseInt(nvLeft) - dLeft) + parseInt(oHtmlToMove.offsetWidth)) > parseInt(oWithSpecs.movingLimits.rectLim.right)) {
                if (parseInt(oHtmlToMove.offsetWidth) > (oWithSpecs.movingLimits.rectLim.right - oWithSpecs.movingLimits.rectLim.left)) {
                    nvLeft = Math.max(0, parseInt(nvLeft));
                } else {
                    if ((parseInt(posMovingOHtml.left) - (parseInt(nvLeft) + dLeft)) > 0) {
                        nvLeft = parseInt(nvLeft) - dLeft;
                    } else {
                        nvLeft = oWithSpecs.movingLimits.bCircular ? parseInt(oWithSpecs.movingLimits.rectLim.left) : (parseInt(oWithSpecs.movingLimits.rectLim.right) - parseInt(oHtmlToMove.offsetWidth));
                    }
                }
                nvLeft = parseInt(nvLeft) + dLeft;
            }
        }
    }
    newPos.top = nvTop;
    newPos.left = nvLeft;
};
rialto.widgetBehavior.$$DDMM_applyConstraintTargets = function (oWithSpecs) {
    if (!_DDMgr.flyOverTarget()) {
        _DDMgr.flyOverTarget(unauthorized = true);
    }
};
rialto.widgetBehavior.$$DDMM_CallBackSynchro = function (oWithSpecs) {
    var oMovingStyle = _DDMgr.currDrag.movingOHtml.style;
    var deltaTop = parseInt(oMovingStyle.top) - parseInt(_DDMgr.currDrag.prevTop);
    var deltaLeft = parseInt(oMovingStyle.left) - parseInt(_DDMgr.currDrag.prevLeft);
    _DDMgr.currDrag.prevTop = parseInt(oMovingStyle.top);
    _DDMgr.currDrag.prevLeft = parseInt(oMovingStyle.left);
    oWithSpecs.synchro({top:_DDMgr.currDrag.totDeltaMoveTop, left:_DDMgr.currDrag.totDeltaMoveLeft}, {top:deltaTop, left:deltaLeft}, {});
};
rialto.widgetBehavior.DragAndDropMouseUpHandler = function (e) {
    if (!e) {
        var e = window.event;
    }
    if (_DDMgr.currDrag && _DDMgr.currDrag.movingOHtml) {
        if (this.releaseCapture) {
            if ((!_DDMgr.currDrag.oThis.specs.modCurs.avantDD) && (_DDMgr.currDrag.oThis.specs.modCurs.auClic)) {
                this.style.cursor = "default";
            }
            if (!rialto.widgetBehavior.DragAndDrop_attachEventToDocument) {
                this.releaseCapture();
            }
        } else {
            if (typeof document.addEventListener != "undefined") {
                document.removeEventListener("mousedown", rialto.widgetBehavior.StopSelectDef, false);
            }
            if (_DDMgr.currDrag.ghost) {
                _DDMgr.currDrag.movingOHtml.style.cursor = "default";
            } else {
                _DDMgr.currDrag.oSource.style.cursor = "default";
            }
        }
        var oHtml = _DDMgr.currDrag.movingOHtml;
        _DDMgr.currDrag.oSource.behavior["DD"].isRunning = false;
        var oThis = _DDMgr.currDrag.oThis;
        if (_DDMgr.currDrag.bMUpAction) {
            if ((!oThis.specs.dropTargets) || (_DDMgr.currDrag.cibleOk)) {
                if (_DDMgr.currDrag.oHtmlToMove != _DDMgr.currDrag.movingOHtml) {
                    if (_DDMgr.currDrag.mvtEffectif) {
                        _DDMgr.currDrag.oHtmlToMove.style.top = _rum.$offsetTop(_DDMgr.currDrag.oHtmlToMove) + _DDMgr.currDrag.totDeltaMoveTop + shiftTopForIcon;
                        _DDMgr.currDrag.oHtmlToMove.style.left = _rum.$offsetLeft(_DDMgr.currDrag.oHtmlToMove) + _DDMgr.currDrag.totDeltaMoveLeft + shiftLeftForIcon;
                    }
                } else {
                    _DDMgr.currDrag.oHtmlToMove.style.zIndex = _DDMgr.currDrag.svgZIndex;
                }
                if (oThis.synchroDDMup) {
                    oThis.synchroDDMup({top:_DDMgr.currDrag.totDeltaMoveTop, left:_DDMgr.currDrag.totDeltaMoveLeft}, {});
                }
            } else {
                if (_DDMgr.currDrag.oHtmlToMove == _DDMgr.currDrag.movingOHtml) {
                    _DDMgr.currDrag.movingOHtml.style.top = _DDMgr.currDrag.initialTop;
                    _DDMgr.currDrag.movingOHtml.style.left = _DDMgr.currDrag.initialLeft;
                }
            }
        }
        if (_DDMgr.currDrag.ghost) {
            _DDMgr.currDrag.movingOHtml.style.display = "none";
        }
        if (_DDMgr.currDrag.oThis.movingLimits.isWithLimitsDisplayed) {
            document.body.removeChild(_DDMgr.currDrag.oHtmlLimitsRect);
            _DDMgr.currDrag.oHtmlLimitsRect = null;
        }
        if (_DDMgr.currDrag.oHtmlInfoFrame) {
            document.body.removeChild(_DDMgr.currDrag.oHtmlInfoFrame);
            _DDMgr.currDrag.oHtmlInfoFrame = null;
        }
        if (_DDMgr.currDrag.maskSelect) {
            var mask = _DDMgr.currDrag.maskSelect;
            mask.parentNode.removeChild(mask);
            mask = null;
        }
        _DDMgr.$$RemoveTargetInfo();
        if (_DDMgr.currDrag.mvtEffectif) {
            if (oThis.afterDD) {
                oThis.afterDD(_DDMgr.currDrag.totDeltaMoveTop, _DDMgr.currDrag.totDeltaMoveLeft, (_DDMgr.currDrag.cibleOk ? {oCible:_DDMgr.currDrag.target, topInCible:_DDMgr.currDrag.topInTarget, leftInCible:_DDMgr.currDrag.leftInTarget} : null));
            }
            _DDMgr.drop();
        } else {
            if (oThis.afterClic) {
                oThis.afterClic(e);
            }
        }
        _DDMgr.currDrag = null;
        stopEvent(e);
    }
};


function DDManager() {
    if (instanceUnique = eval(recupSingletonCD())) {
        return instanceUnique;
    }
    this.tMissiles = new Array;
    this.tTargets = new Array;
    this.tTargets["undef"] = new Object;
    this.lastUnderTarget = null;
    this.missInFlight = {tMiss:new Array, top:null, left:null};
    this.currDrag = null;
    this.id = "ID_InstanceUniqueDDManager";
}
DDManager.prototype.addTarget = function (oTarget, domain, domainInvalidTarget, idRegistTarg) {
    var uriDom = domain || "undef";
    if (uriDom.substr(0, 5) != "undef") {
        uriDom = "undef." + uriDom;
    }
    if (this.tTargets[uriDom] == undefined) {
        this.tTargets[uriDom] = new Object;
    }
    var id = (idRegistTarg == undefined) ? oTarget.id : idRegistTarg;
    this.tTargets[uriDom][id] = oTarget;
};
DDManager.prototype.removeTarget = function (oTarget) {
    var uriDom = oTarget.domain;
    if (uriDom.substr(0, 5) != "undef") {
        uriDom = "undef." + uriDom;
    }
    if (this.tTargets[uriDom][oTarget.id]) {
        this.tTargets[uriDom][oTarget.id] = null;
    }
};
DDManager.prototype.$$AddTargetInfo = function () {
    if (this.tTargets) {
        for (var sUri in this.tTargets) {
            for (var i in this.tTargets[sUri]) {
                oTarg = this.tTargets[sUri][i];
                if (oTarg) {
                    targHtml = oTarg.oHtml;
                    borderExclude = !oTarg.specsTarg.borderIsTarget;
                    var targetPosInVP = borderExclude ? _rum.$divInternalTopLeftInViewPort(targHtml) : _rum.$posInViewPort(targHtml);
                    oTarg.topInVP = targetPosInVP.top;
                    oTarg.LeftInVP = targetPosInVP.left;
                    oTarg.widthTarget = _rum.$getWidth(targHtml, bBorderLess = borderExclude);
                    oTarg.heightTarget = _rum.$getHeight(targHtml, bBorderLess = borderExclude);
                }
            }
        }
    }
};
DDManager.prototype.$$RemoveTargetInfo = function () {
    if (this.tTargets) {
        for (var sUri in this.tTargets) {
            for (var i in this.tTargets[sUri]) {
                oTarg = this.tTargets[sUri][i];
                if (oTarg) {
                    oTarg.topInVP = null;
                    oTarg.LeftInVP = null;
                    oTarg.widthTarget = null;
                    oTarg.heightTarget = null;
                }
            }
        }
    }
};
DDManager.prototype.initDrag = function (oDrag) {
    this.currDrag = oDrag;
    var specsODrag = oDrag.oThis.specs;
    this.sUri = "undef";
    if (specsODrag.domain) {
        this.sUri = this.sUri + "." + oDrag.oThis.specs.domain;
    }
    this.tUri = this.sUri.split(".");
    this.sNaUri = "undef";
    if (specsODrag.domainUnauthorizedTarget) {
        this.sNaUri = this.sNaUri + "." + oDrag.oThis.specs.domainUnauthorizedTarget;
    }
    this.tNaUri = this.sNaUri.split(".");
    this.lastGoodTargets = null;
    this.lastGoodTargets = new Array;
};
DDManager.prototype.flyOverTarget = function (isTargetsUnAuthorized) {
    var goodTarg = null;
    var oDrag = this.currDrag;
    var specsODrag = oDrag.oThis.specs;
    var sUri = ((isTargetsUnAuthorized == undefined) || (!isTargetsUnAuthorized)) ? this.sUri : this.sNaUri;
    var tUri = ((isTargetsUnAuthorized == undefined) || (!isTargetsUnAuthorized)) ? this.tUri : this.tNaUri;
    traceExec("isTargetsUnAuthorized = " + isTargetsUnAuthorized + " tUri= " + tUri + "length= " + tUri.length, 9);
    for (var n = tUri.length; n > 0; n--) {
        var targHtml, missHtml;
        if (this.tTargets[sUri]) {
            missHtml = oDrag.movingOHtml;
            var topMissile = _rum.$posInViewPort(missHtml).top;
            var leftMissile = _rum.$posInViewPort(missHtml).left;
            var oTargMiss, oTarg, targHtml, topTarget, leftTarget, widthTarget, heightTarget;
            var widthMissile, heightMissile;
            var j = 0;
            for (var i in this.tTargets[sUri]) {
                j++;
                if (this.tTargets[sUri][i] && this.tTargets[sUri][i].oHtml.style.display != "none") {
                    oTarg = this.tTargets[sUri][i];
                    targHtml = oTarg.oHtml;
                    if (specsODrag.circularDropAuthorized || !rialto.Dom.isDescendantOf(targHtml, oDrag.oHtmlToMove, true)) {
                        if (oTarg.specsTarg.missileAsOnePixel) {
                            widthMissile = 1;
                            heightMissile = 1;
                        } else {
                            widthMissile = oDrag.oHtmlToMove.offsetWidth;
                            heightMissile = oDrag.oHtmlToMove.offsetHeight;
                        }
                        borderExclude = !oTarg.specsTarg.borderIsTarget;
                        if (oTarg.topInVP == "undefined" || oTarg.topInVP == null) {
                            var targetPosInVP = borderExclude ? _rum.$divInternalTopLeftInViewPort(targHtml) : _rum.$posInViewPort(targHtml);
                            oTarg.topInVP = targetPosInVP.top;
                            oTarg.LeftInVP = targetPosInVP.left;
                            oTarg.widthTarget = _rum.$getWidth(targHtml, bBorderLess = borderExclude);
                            oTarg.heightTarget = _rum.$getHeight(targHtml, bBorderLess = borderExclude);
                        }
                        topTarget = oTarg.topInVP;
                        leftTarget = oTarg.LeftInVP;
                        widthTarget = oTarg.widthTarget;
                        heightTarget = oTarg.heightTarget;
                        if (oTarg.specsTarg.intersectMode) {
                            rightMissile = leftMissile + widthMissile;
                            bottomMissile = topMissile + heightMissile;
                            rightTarget = leftTarget + widthTarget;
                            bottomTarget = topTarget + heightTarget;
                            bTargetIsWider = (widthTarget >= widthMissile);
                            bTargetIsHigher = (heightTarget >= heightMissile);
                            bOKWithTargetWider = (bTargetIsWider && (((leftTarget <= leftMissile) && (leftMissile <= rightTarget)) || ((leftTarget <= rightMissile) && (rightMissile <= rightTarget))) && ((bTargetIsHigher && (((topTarget <= topMissile) && (topMissile <= bottomTarget)) || ((topTarget <= bottomMissile) && (bottomMissile <= bottomTarget)))) || (!bTargetIsHigher && (((topMissile <= topTarget) && (topTarget <= bottomMissile)) || ((topMissile <= bottomTarget) && (bottomTarget <= bottomMissile))))));
                            bOKWithMissileWider = (!bTargetIsWider && (((leftMissile <= leftTarget) && (leftTarget <= rightMissile)) || ((leftMissile <= rightTarget) && (rightTarget <= rightMissile))) && ((bTargetIsHigher && (((topTarget <= topMissile) && (topMissile <= bottomTarget)) || ((topTarget <= bottomMissile) && (bottomMissile <= bottomTarget)))) || (!bTargetIsHigher && (((topMissile <= topTarget) && (topTarget <= bottomMissile)) || ((topMissile <= bottomTarget) && (bottomTarget <= bottomMissile))))));
                        }
                        if ((oTarg.specsTarg.intersectMode && (bOKWithTargetWider || bOKWithMissileWider)) || ((leftMissile >= leftTarget) && (topMissile >= topTarget) && ((leftMissile + widthMissile) <= (leftTarget + widthTarget)) && ((topMissile + heightMissile) <= (topTarget + heightTarget)))) {
                            this.lastGoodTargets.push(goodTarg);
                            if (goodTarg) {
                                if (DDManager.isTargetHover(oTarg, goodTarg)) {
                                    goodTarg = oTarg;
                                    var shiftTop = borderExclude ? 0 : _rum.$$getBorderTopWidth(targHtml);
                                    var shiftLeft = borderExclude ? 0 : _rum.$$getBorderLeftWidth(targHtml);
                                    goodTarg.topInTarget = topMissile - topTarget - shiftTop;
                                    goodTarg.leftInTarget = leftMissile - leftTarget - shiftLeft;
                                } else {
                                }
                            } else {
                                goodTarg = oTarg;
                                var shiftTop = borderExclude ? 0 : _rum.$$getBorderTopWidth(targHtml);
                                var shiftLeft = borderExclude ? 0 : _rum.$$getBorderLeftWidth(targHtml);
                                goodTarg.topInTarget = topMissile - topTarget - shiftTop;
                                goodTarg.leftInTarget = leftMissile - leftTarget - shiftLeft;
                            }
                            if (specsODrag.targetChoice == "firstIsBetter") {
                                break;
                            }
                        }
                    }
                }
            }
        }
        if (goodTarg) {
            break;
        }
        sUri = tUri.slice(0, n - 1).join(".");
    }
    if (this.lastUnderTarget && this.lastUnderTarget.DDOuter) {
        if (!goodTarg || (goodTarg != this.lastUnderTarget)) {
            this.lastUnderTarget.DDOuter({oHtml:this.currDrag.oHtmlToMove, topAbs:topMissile, leftAbs:leftMissile});
        }
    }
    if (goodTarg && goodTarg.DDHover && ((goodTarg != this.lastUnderTarget) || (goodTarg.specsTarg.bSyndicToAllEvent))) {
        goodTarg.DDHover({oHtml:this.currDrag.oHtmlToMove, top:goodTarg.topInTarget, left:goodTarg.leftInTarget}, isTargetsUnAuthorized);
    }
    this.lastUnderTarget = goodTarg;
    this.currDrag.cibleOk = (goodTarg != null) && (!isTargetsUnAuthorized);
    return goodTarg;
};
DDManager.prototype.flyOverOneTarget = function (oTarg, isTargetsUnAuthorized) {
    var goodTarg = null;
    var oDrag = _DDMgr.currDrag;
    var specsODrag = oDrag.oThis.specs;
    var sUri = "undef";
    if (((typeof isTargetsUnAuthorized) == "undefined") || (!isTargetsUnAuthorized)) {
        if (oDrag.oThis.specs.domain) {
            sUri = sUri + "." + oDrag.oThis.specs.domain;
        }
    } else {
        if (oDrag.oThis.specs.domainUnauthorizedTarget) {
            sUri = sUri + "." + oDrag.oThis.specs.domainUnauthorizedTarget;
        }
    }
    var uriDom = oTarg.domain || "undef";
    if (uriDom.substr(0, 5) != "undef") {
        uriDom = "undef." + uriDom;
    }
    var isPrefix = (sUri.indexOf(uriDom) == 0);
    if (isPrefix) {
        borderExclude = !oTarg.specsTarg.borderIsTarget;
        var targHtml, missHtml;
        targHtml = oTarg.oHtml;
        var targetPosInVP = borderExclude ? _rum.$divInternalTopLeftInViewPort(targHtml) : _rum.$posInViewPort(targHtml);
        topTarget = targetPosInVP.top;
        leftTarget = targetPosInVP.left;
        missHtml = oDrag.movingOHtml;
        var topMissile = _rum.$posInViewPort(missHtml).top;
        var leftMissile = _rum.$posInViewPort(missHtml).left;
        goodTarg = oTarg;
        var shiftTop = borderExclude ? 0 : _rum.$$getBorderTopWidth(targHtml);
        var shiftLeft = borderExclude ? 0 : _rum.$$getBorderLeftWidth(targHtml);
        goodTarg.topInTarget = topMissile - topTarget - shiftTop;
        goodTarg.leftInTarget = leftMissile - leftTarget - shiftLeft;
    }
    if (this.lastUnderTarget && this.lastUnderTarget.DDOuter) {
        if (!goodTarg || (goodTarg != this.lastUnderTarget)) {
            this.lastUnderTarget.DDOuter({oHtml:_DDMgr.currDrag.oHtmlToMove, topAbs:topMissile, leftAbs:leftMissile});
        }
    }
    this.lastUnderTarget = goodTarg;
    if (goodTarg && goodTarg.DDHover) {
        goodTarg.DDHover({oHtml:_DDMgr.currDrag.oHtmlToMove, top:goodTarg.topInTarget, left:goodTarg.leftInTarget}, isTargetsUnAuthorized);
    }
    _DDMgr.currDrag.cibleOk = (goodTarg != null) && (!isTargetsUnAuthorized);
    return goodTarg;
};
DDManager.isTargetHover = function (n1, n2) {
    if (rialto.Dom.isDescendantOf(n1, n2)) {
        return true;
    } else {
        return rialto.Dom.isCoveredBy(n2, n1);
    }
};
DDManager.prototype.drop = function () {
    if (this.lastUnderTarget) {
        if (this.lastUnderTarget.DDOuter) {
            this.lastUnderTarget.DDOuter({oHtml:_DDMgr.currDrag.oHtmlToMove, topAbs:_DDMgr.currDrag.topObjEnDeplact, leftAbs:_DDMgr.currDrag.leftObjEnDeplact});
        }
        if (_DDMgr.currDrag.cibleOk) {
            if (this.lastUnderTarget.receiveAfterDrop) {
                this.lastUnderTarget.receiveAfterDrop({oHtml:_DDMgr.currDrag.oHtmlToMove, oRia:_DDMgr.currDrag.oHtmlToMove.oRia, top:_DDMgr.lastUnderTarget.topInTarget, left:_DDMgr.lastUnderTarget.leftInTarget, pathMissile:_DDMgr.currDrag.oThis.specs.domain});
            } else {
                _DDMgr.currDrag.oHtmlToMove.style.position = "absolute";
                _DDMgr.currDrag.oHtmlToMove.style.top = _DDMgr.lastUnderTarget.topInTarget;
                _DDMgr.currDrag.oHtmlToMove.style.left = _DDMgr.lastUnderTarget.leftInTarget;
                this.lastUnderTarget.appendChild(_DDMgr.currDrag.oHtmlToMove);
            }
        }
        this.lastUnderTarget = null;
    }
};
_DDMgr = new DDManager();


var ENREG_RS = 99;
var oReSize = null;
var defMargeSensibleDD = 3;
rialto.widgetBehavior.RS_SENSITIVEEDGEWIDTH_DEFAULT = 3;
rialto.widgetBehavior.RSLoadLimitsDyn = function (oBase) {
    if (this.limitReDim.bRectLim) {
        this.limitReDim.rectLim.bottom = eval(this.limitReDim.rectLim.bottomSpecs);
        this.limitReDim.rectLim.right = eval(this.limitReDim.rectLim.rightSpecs);
    } else {
        this.limitReDim.rectLim.bottom = pixHeight(oBase);
        this.limitReDim.rectLim.right = pixWidth(oBase);
    }
    if (this.limitReDim.bLimMax) {
        this.limitReDim.widthMax = eval(this.limitReDim.widthMaxSpecs);
        this.limitReDim.heightMax = eval(this.limitReDim.heightMaxSpecs);
    } else {
        this.limitReDim.widthMax = (this.limitReDim.rectLim.right - this.limitReDim.rectLim.left + 1);
        this.limitReDim.heightMax = (this.limitReDim.rectLim.bottom - this.limitReDim.rectLim.top + 1);
    }
    traceExec("RSLoadLimitsDyn id= " + this.id + " this.limitReDim.rectLim.top = " + this.limitReDim.rectLim.top, 60);
    traceExec("RSLoadLimitsDyn this.limitReDim.rectLim.left = " + this.limitReDim.rectLim.left, 58);
    traceExec("RSLoadLimitsDyn this.limitReDim.rectLim.bottom = " + this.limitReDim.rectLim.bottom, 60);
    traceExec("RSLoadLimitsDyn this.limitReDim.rectLim.right = " + this.limitReDim.rectLim.right, 58);
    traceExec("RSLoadLimitsDyn this.limitReDim.rectLim.widthMax = " + this.limitReDim.widthMax, 58);
    traceExec("RSLoadLimitsDyn this.limitReDim.rectLim.heightMax = " + this.limitReDim.heightMax, 60);
};
rialto.widgetBehavior.RSLoadSpecs = function (specs) {
    traceExec("RSLoadSpecs entree", 76);
    this.specsRS = new Object;
    if (!specs) {
        specs = new Object;
    }
    var orientation = specs.orientation || "2D";
    if (!specs.cibleEvt) {
        this.specsRS.cibleEvt = new Array;
        this.specsRS.cibleEvt[0] = {oHtml:this, mode:"mono"};
        this.specsRS.cibleEvt[0].dir = orientation;
        this.specsRS.orientation = orientation;
    } else {
        if (!(specs.cibleEvt instanceof Array)) {
            var wCibleEvt = specs.cibleEvt;
            this.specsRS.cibleEvt = new Array;
            this.specsRS.cibleEvt[0] = new Object;
            this.specsRS.cibleEvt[0].oHtml = wCibleEvt.oHtml;
            this.specsRS.cibleEvt[0].mode = wCibleEvt.mode || "mono";
            this.specsRS.cibleEvt[0].dir = (this.specsRS.cibleEvt[0].mode == "mono") ? orientation : wCibleEvt.dir;
            this.specsRS.orientation = this.specsRS.cibleEvt[0].dir;
        } else {
            if (specs.cibleEvt instanceof Array) {
                this.specsRS.cibleEvt = specs.cibleEvt;
            } else {
                traceExec("pb def cible DD", 30);
            }
        }
    }
    this.specsRS.sensitiveEdgeWidth = specs.sensitiveEdgeWidth || rialto.widgetBehavior.RS_SENSITIVEEDGEWIDTH_DEFAULT;
    this.specsRS.objetADeformer = specs.objetADeformer ? specs.objetADeformer : this;
    this.specsRS.fantome = new Object;
    if (specs.fantome) {
        this.specsRS.fantome.aspect = specs.fantome.aspect || "cadre";
    } else {
        this.specsRS.fantome = null;
    }
    this.specsRS.modCurs = new Object;
    if (specs.modCursor) {
        this.specsRS.modCurs.avantDD = (specs.modCursor.avantDD != "undefined") ? specs.modCursor.avantDD : true;
        this.specsRS.modCurs.auClic = (specs.modCursor.auClic != "undefined") ? specs.modCursor.auClic : true;
    } else {
        this.specsRS.modCurs.avantDD = true;
        this.specsRS.modCurs.auClic = true;
    }
    if (specs.grilleMagnetic) {
        this.specsRS.magnet = new Object;
        this.specsRS.magnet.widthCol = specs.grilleMagnetic.widthCol || 10;
        this.specsRS.magnet.heightRow = specs.grilleMagnetic.heightRow || 10;
    }
    this.limitReDim = new Object;
    this.limitReDim.symetrie = specs.symetrie || false;
    if (this.limitReDim.symetrie) {
        this.limitReDim.centrage = true;
    }
    this.limitReDim.bRectLim = (specs.bRectLim != null) ? specs.bRectLim : true;
    this.limitReDim.bLimMax = (specs.bRectLim != null) ? specs.bLimMax : false;
    this.limitReDim.rectLim = new Object;
    var flagModSpecsRectLim = false;
    if (!specs.rectLim) {
        specs.rectLim = new Object;
        flagModSpecsRectLim = true;
    } else {
        this.limitReDim.bRectLim = true;
    }
    this.limitReDim.rectLim.left = specs.rectLim.left || 0;
    this.limitReDim.rectLim.top = specs.rectLim.top;
    this.specsRS.majDyn = (specs.majDyn != null) ? specs.majDyn : true;
    if (!this.specsRS.majDyn) {
        this.limitReDim.rectLim.right = specs.rectLim.right || pixWidth(this.specsRS.objetADeformer.parentNode);
        this.limitReDim.rectLim.bottom = specs.rectLim.bottom || pixHeight(this.specsRS.objetADeformer.parentNode);
    } else {
        this.limitReDim.rectLim.rightSpecs = specs.rectLim.right || pixWidth(this.specsRS.objetADeformer.parentNode);
        this.limitReDim.rectLim.bottomSpecs = specs.rectLim.bottom || pixHeight(this.specsRS.objetADeformer.parentNode);
        this.limitReDim.widthMaxSpecs = specs.rectLim.widthMax;
        this.limitReDim.heightMaxSpecs = specs.rectLim.heightMax;
    }
    if (!specs.limitReDim) {
        specs.limitReDim = new Object;
    }
    this.limitReDim.heightMin = specs.limitReDim.heightMin || 20;
    this.limitReDim.heightMax = specs.limitReDim.heightMax || (this.limitReDim.bottom - this.limitReDim.top + 1);
    traceExec("** RSLoadSpecs specs.limitReDim.widthMin    = " + specs.limitReDim.widthMin, 76);
    this.limitReDim.widthMin = specs.limitReDim.widthMin || 20;
    traceExec("** RSLoadSpecs this.limitReDim.rectLim.widthMin    = " + this.limitReDim.widthMin, 76);
    this.limitReDim.widthMax = specs.limitReDim.widthMax || (this.limitReDim.right - this.limitReDim.left + 1);
    traceExec("RSLoadSpecs this.limitReDim.rectLim.top    = " + this.limitReDim.rectLim.top, 76);
    traceExec("RSLoadSpecs this.limitReDim.rectLim.left   = " + this.limitReDim.rectLim.left, 76);
    traceExec("RSLoadSpecs this.limitReDim.rectLim.bottom = " + this.limitReDim.rectLim.bottom, 76);
    traceExec("RSLoadSpecs this.limitReDim.rectLim.right  = " + this.limitReDim.rectLim.right, 76);
    traceExec("RSLoadSpecs this.limitReDim.rectLim.bottomSpecs = " + this.limitReDim.rectLim.bottomSpecs, 76);
    traceExec("RSLoadSpecs this.limitReDim.rectLim.rightSpecs  = " + this.limitReDim.rectLim.rightSpecs, 76);
    traceExec("RSLoadSpecs this.limitReDim.rectLim.heightMin   = " + this.limitReDim.heightMin, 76);
    traceExec("RSLoadSpecs this.limitReDim.rectLim.heightMax   = " + this.limitReDim.heightMax, 76);
    traceExec("RSLoadSpecs this.limitReDim.rectLim.widthMin    = " + this.limitReDim.widthMin, 76);
    traceExec("RSLoadSpecs this.limitReDim.rectLim.widthMax    = " + this.limitReDim.widthMax, 76);
    traceExec("RSLoadSpecs fin", 58);
    if (flagModSpecsRectLim) {
        specs.rectLim = null;
    }
};
rialto.widgetBehavior.constructorReSize = function (specs) {
    if (!this.oCiu) {
        this.oCiu = new Array();
    }
    this.oCiu["ReSize"] = this;
    this.oCiu["ReSize"].lockReSize = false;
    if (!this.oCiu["ReSize"].loadSpecsRS) {
        this.oCiu["ReSize"].loadSpecsRS = rialto.widgetBehavior.RSLoadSpecs;
    }
    this.oCiu["ReSize"].loadSpecsRS(specs);
    if (this.oCiu["ReSize"].specsRS.majDyn) {
        if (!this.oCiu["ReSize"].loadLimitsDynRS) {
            this.oCiu["ReSize"].loadLimitsDynRS = rialto.widgetBehavior.RSLoadLimitsDyn;
        }
        this.oCiu["ReSize"].loadLimitsDynRS(this.oCiu["ReSize"].specsRS.objetADeformer.parentNode);
    }
    var oCiu = this.oCiu["ReSize"];
    var oHtmlCible;
    for (var i = 0; i < oCiu.specsRS.cibleEvt.length; i++) {
        oHtmlCible = oCiu.specsRS.cibleEvt[i].oHtml;
        oHtmlCible.reSize = true;
        oHtmlCible.refObjSpecsRS = this;
        oHtmlCible.modeRS = oCiu.specsRS.cibleEvt[i].mode;
        oHtmlCible.dirRS = oCiu.specsRS.cibleEvt[i].dir;
        if (!oHtmlCible.behavior) {
            oHtmlCible.behavior = {};
        }
        if (!oHtmlCible.behavior["RS"]) {
            oHtmlCible.behavior["RS"] = {};
        }
        oHtmlCible.behavior["RS"].running = false;
    }
    if (typeof document.addEventListener == "undefined") {
        for (var i = 0; i < oCiu.specsRS.cibleEvt.length; i++) {
            oHtmlCible = oCiu.specsRS.cibleEvt[i].oHtml;
            oHtmlCible.addHandler = addHandler;
            oHtmlCible.methodRSMouseDown = rialto.widgetBehavior.ReSizeMouseDownHandler;
            oHtmlCible.methodRSMouseMove = rialto.widgetBehavior.ReSizeMouseMoveHandler;
            oHtmlCible.methodRSMouseUp = rialto.widgetBehavior.ReSizeMouseUpHandler;
            oHtmlCible.addHandler(oHtmlCible, "onmousedown", "methodRSMouseDown");
            oHtmlCible.addHandler(oHtmlCible, "onmousemove", "methodRSMouseMove");
            oHtmlCible.addHandler(oHtmlCible, "onmouseup", "methodRSMouseUp");
        }
    } else {
        if (!document.enregtReSize) {
            document.enregtReSize = true;
            document.addEventListener("mousemove", rialto.widgetBehavior.ReSizeMouseMoveHandler, false);
            document.addEventListener("mouseup", rialto.widgetBehavior.ReSizeMouseUpHandler, false);
            document.addEventListener("mousedown", rialto.widgetBehavior.ReSizeMouseDownHandler, false);
            document.addEventListener("mousedown", StopSelectDef, false);
        }
    }
};
rialto.widgetBehavior.createBehavior("ReSize", rialto.widgetBehavior.constructorReSize);
StopSelectDef = function (e) {
    ria.utils.event.stopDefault(e);
};


rialto.widgetBehavior.ReSizeMouseDownHandler = function (e) {
    if (!e) {
        var e = window.event;
    }
    var oSourceEvt = e.target ? e.target : e.srcElement;
    var oHtml = oSourceEvt;
    if (!oHtml.reSize) {
        return;
    }
    var direction;
    if (oHtml.modeRS != "mono") {
        direction = oHtml.dirRS;
    } else {
        direction = DirDeplact(oHtml, e, pixHeight(oHtml), pixWidth(oHtml), oHtml.refObjSpecsRS.specsRS.sensitiveEdgeWidth, marginLess = false);
    }
    if (!direction) {
        traceExec("position invalide par rapport au RS", 58);
        oHtml.style.cursor = "default";
        return;
    } else {
        oHtml.style.cursor = direction + "-resize";
    }
    if ((oHtml.behavior["DD"]) && (oHtml.behavior["DD"].isRunning)) {
        return;
    } else {
        oHtml.behavior["RS"].isRunning = true;
    }
    traceExec("position valide par rapport au RS", 58);
    var oSpecs = oHtml.refObjSpecsRS;
    if (oSpecs.specsRS.majDyn) {
        oSpecs.loadLimitsDynRS(oSpecs.specsRS.objetADeformer.parentNode);
    }
    var objetADeformer = oSpecs.specsRS.objetADeformer;
    traceExec(";;;Md objetADeformer.style.height= " + parseInt(objetADeformer.style.height), 60);
    if (oSpecs.specsRS.fantome) {
        var cadreFantome = document.getElementById("cadreFantomeUnique");
        if (cadreFantome == null) {
            cadreFantome = document.createElement("DIV");
            cadreFantome.id = "cadreFantomeUnique";
            cadreFantome.className = "fantomeRS_" + oSpecs.specsRS.fantome.aspect;
            objetADeformer.parentNode.appendChild(cadreFantome);
        } else {
            if (cadreFantome.parentNode != objetADeformer) {
                cadreFantome.parentNode.removeChild(cadreFantome);
                cadreFantome = document.createElement("DIV");
                cadreFantome.id = "cadreFantomeUnique";
                cadreFantome.className = "fantomeRS_" + oSpecs.specsRS.fantome.aspect;
                objetADeformer.parentNode.appendChild(cadreFantome);
            }
        }
        cadreFantome.style.zIndex = 100000;
        cadreFantome.style.top = pixTop(objetADeformer);
        cadreFantome.style.left = pixLeft(objetADeformer);
        cadreFantome.style.width = pixWidth(objetADeformer);
        var bWidth = 0;
        if (window.getComputedStyle) {
            var topWidthBord = getComputStyle(cadreFantome, "borderTopWidth", "0");
            var bottomWidthBord = getComputStyle(cadreFantome, "borderBottomWidth", "0");
            if (topWidthBord || bottomWidthBord) {
                bWidth = topWidthBord + bottomWidthBord;
                cadreFantome.style.width = parseInt(cadreFantome.style.width) - bWidth;
            }
        }
        traceExec("!!! objetADeformer.id= " + objetADeformer.id, 60);
        cadreFantome.style.height = pixHeight(objetADeformer);
        traceExec("RS -1- Md cadreFantome.style.height = pixHeight(objetADeformer)= " + pixHeight(objetADeformer), 75);
        traceExec("!!! Md cadreFantome.style.height= " + cadreFantome.style.height, 60);
        var bHeight = 0;
        if (window.getComputedStyle) {
            bHeight = topWidthBord + bottomWidthBord;
            cadreFantome.style.height = parseInt(cadreFantome.style.height) - bHeight;
        }
        cadreFantome.style.visibility = "visible";
        var objetEnDeformation = cadreFantome;
        objetEnDeformation.refObjSpecs = oSpecs;
    } else {
        var objetEnDeformation = objetADeformer;
    }
    var top = pixTop(objetEnDeformation);
    var left = pixLeft(objetEnDeformation);
    var width = pixWidth(objetEnDeformation);
    var height = pixHeight(objetEnDeformation);
    traceExec("++++Md  height obj en def= " + height, 58);
    var topLeftEvtInVP = _rum.$eventTopLeftInViewPort(e);
    var topEvtInVP = topLeftEvtInVP.top;
    var leftEvtInVP = topLeftEvtInVP.left;
    oReSize = {oThis:oSpecs, oSource:oHtml, fantome:oSpecs.specsRS.fantome, objetEnDeformation:objetEnDeformation, objetADeformer:objetADeformer, limitReDim:oSpecs.limitReDim, direction:direction, clientXI:e.clientX, clientYI:e.clientY, topI:top, leftI:left, widthI:width, wBordGD:bWidth, wBordHB:bHeight, heightI:height, magnet:oSpecs.specsRS.magnet, mvtEffectif:false, topEvtInVP:topEvtInVP, leftEvtInVP:leftEvtInVP};
    oReSize.prevTop = parseInt(oReSize.objetEnDeformation.style.top);
    oReSize.prevLeft = parseInt(oReSize.objetEnDeformation.style.left);
    oReSize.prevWidth = parseInt(oReSize.objetEnDeformation.style.width);
    oReSize.prevHeight = parseInt(oReSize.objetEnDeformation.style.height);
    traceExec("RS -0- objetEnDeformation.style.height= " + objetEnDeformation.style.height, 75);
    traceExec("RS -0- heightI = pixHeight(objetEnDeformation)= " + oReSize.heightI, 75);
    traceExec("RS -0- objetADeformer.style.height= " + objetADeformer.style.height, 75);
    traceExec("Md oReSize.objetEnDeformation.style.height= " + parseInt(oReSize.objetEnDeformation.style.height), 62);
    traceExec("Md oReSize.objetADeformer.style.height=     " + pixHeight(oReSize.objetADeformer), 62);
    if (this.setCapture) {
        this.setCapture();
        stopEvent(e);
        if ((!oSpecs.specsRS.modCurs.avantDD) && (oSpecs.specsRS.modCurs.auClic)) {
            rialto.widgetBehavior.DDmodCursor(oHtml, direction, oSpecs.limitDeplact.orientation);
        }
    } else {
        if ((!oSpecs.specsRS.modCurs.avantDD) && (oSpecs.specsRS.modCurs.auClic)) {
            if (oSpecs.specsRS.fantome) {
                rialto.widgetBehavior.DDmodCursor(objetEnDeplact, direction, oSpecs.limitDeplact.orientation);
            } else {
                rialto.widgetBehavior.DDmodCursor(oHtml, direction, oSpecs.limitDeplact.orientation);
            }
        }
    }
};
rialto.widgetBehavior.ReSizeMouseMoveHandler = function (e) {
    if (!e) {
        var e = window.event;
    }
    var oHtml = e.target ? e.target : e.srcElement;
    if (!oReSize) {
        if (oHtml.reSize) {
            var direction;
            if (oHtml.modeRS != "mono") {
                direction = oHtml.dirRS;
            } else {
                traceExec("MM oHtml.margeSensible= " + oHtml.margeSensible + " defMargeSensibleDD= " + defMargeSensibleDD + " oHtml.refObjSpecsRS.sensitiveEdgeWidth= " + oHtml.refObjSpecsRS.specsRS.sensitiveEdgeWidth, 74);
                traceExec("RS MM b", 74);
                direction = DirDeplact(oHtml, e, pixHeight(oHtml), pixWidth(oHtml), oHtml.refObjSpecsRS.specsRS.sensitiveEdgeWidth, marginExcluded = false);
                traceExec("RS MM e", 74);
            }
            if (direction == "") {
                traceExec("RS mm ap DirDeplact dir=" + direction + " curs def restor?", 74);
            } else {
                oHtml.style.cursor = direction + "-resize";
                traceExec("RS mm ap DirDeplact dir=" + direction + " curs ad hoc", 74);
            }
        }
    } else {
        if (e.clientX >= 0 && e.clientY >= 0) {
            oReSize.mvtEffectif = true;
            var nvTop = parseInt(oReSize.objetEnDeformation.style.top);
            var nvLeft = parseInt(oReSize.objetEnDeformation.style.left);
            var nvWidth = parseInt(oReSize.objetEnDeformation.style.width);
            var nvHeight = pixHeight(oReSize.objetEnDeformation);
            traceExec("Mm (oReSize.objetEnDeformation.id= " + oReSize.objetEnDeformation.id, 60);
            traceExec("Mm dim ss mvt height= " + nvHeight, 60);
            var nvEventTopLeft = _rum.$eventTopLeftInViewPort(e);
            var totDeltaMoveY = nvEventTopLeft.top - oReSize.topEvtInVP;
            var totDeltaMoveX = nvEventTopLeft.left - oReSize.leftEvtInVP;
            var direction = oReSize.direction;
            if (oReSize.limitReDim.dbleSymetrie) {
            } else {
                if (!oReSize.limitReDim.symetrie) {
                    if (direction.indexOf("e") != -1) {
                        nvWidth = oReSize.widthI + totDeltaMoveX;
                    } else {
                        if (direction.indexOf("w") != -1) {
                            nvLeft = oReSize.leftI + totDeltaMoveX;
                            nvWidth = oReSize.widthI - totDeltaMoveX;
                        }
                    }
                    if (direction.indexOf("s") != -1) {
                        nvHeight = oReSize.heightI + totDeltaMoveY;
                    } else {
                        if (direction.indexOf("n") != -1) {
                            nvTop = oReSize.topI + totDeltaMoveY;
                            nvHeight = oReSize.heightI - totDeltaMoveY;
                        }
                    }
                } else {
                    var diff;
                    if (direction.indexOf("n") != -1) {
                        nvTop = oReSize.topI + totDeltaMoveY;
                        nvHeight = oReSize.heightI - 2 * totDeltaMoveY;
                        if (oReSize.limitReDim.symetrie == "radiale") {
                            diff = (e.clientY - oReSize.clientYI);
                            nvLeft = oReSize.leftI + diff;
                            nvWidth = oReSize.widthI - 2 * diff;
                        }
                    } else {
                        if (direction.indexOf("s") != -1) {
                            nvTop = oReSize.topI - totDeltaMoveY;
                            nvHeight = oReSize.heightI + 2 * totDeltaMoveY;
                            if (oReSize.limitReDim.symetrie == "radiale") {
                                diff = totDeltaMoveY;
                                nvLeft = oReSize.leftI - diff;
                                nvWidth = oReSize.widthI + 2 * diff;
                            }
                        }
                    }
                    if (direction.indexOf("w") != -1) {
                        nvLeft = oReSize.leftI + totDeltaMoveX;
                        nvWidth = oReSize.widthI - 2 * totDeltaMoveX;
                        if (oReSize.limitReDim.symetrie == "radiale") {
                            diff = totDeltaMoveX;
                            nvTop = oReSize.topI + diff;
                            nvHeight = oReSize.heightI - 2 * diff;
                        }
                    } else {
                        if (direction.indexOf("e") != -1) {
                            nvLeft = oReSize.leftI - totDeltaMoveX;
                            nvWidth = oReSize.widthI + 2 * totDeltaMoveX;
                            if (oReSize.limitReDim.symetrie == "radiale") {
                                diff = totDeltaMoveX;
                                nvTop = oReSize.topI - diff;
                                nvHeight = oReSize.heightI + 2 * diff;
                            }
                        }
                    }
                }
            }
            traceExec("Mm av contraintes nvHeight = " + nvHeight + " nvWidth= " + nvWidth + " nvLeft= " + nvLeft, 58);
            if (oReSize.limitReDim.bRectLim) {
                var rectLim = oReSize.limitReDim.rectLim;
                var lim = oReSize.limitReDim;
                traceExec("Mm rectLim left = " + rectLim.left + " right= " + rectLim.right + " lim.widthMax= " + lim.widthMax + " lim.widthMin= " + lim.widthMin, 58);
                if (!lim.symetrie) {
                    if (nvWidth > lim.widthMax) {
                        nvWidth = lim.widthMax;
                        if (direction == "w") {
                            nvLeft = (oReSize.leftI + oReSize.widthI - 1) - lim.widthMax + 1;
                        }
                        traceExec("contrainte 1");
                    }
                    if ((rectLim.left != undefined) && (nvLeft < rectLim.left)) {
                        nvWidth = nvWidth - (rectLim.left - nvLeft);
                        nvLeft = rectLim.left;
                        traceExec("contrainte 2");
                    } else {
                        if ((rectLim.right != undefined) && ((nvWidth + nvLeft - 1) > rectLim.right)) {
                            nvWidth = rectLim.right - oReSize.leftI + 1;
                            traceExec("contrainte 3");
                        } else {
                            if (nvWidth < lim.widthMin) {
                                nvWidth = lim.widthMin;
                                traceExec("contrainte 4 nvWidth = " + nvWidth + " lim.widthMin= " + lim.widthMin, 58);
                                if (direction.indexOf("w") != -1) {
                                    nvLeft = (oReSize.leftI + oReSize.widthI - 1) - lim.widthMin + 1;
                                }
                            }
                        }
                    }
                    if (nvHeight > lim.heightMax) {
                        traceExec("Mm (nvHeight > lim.heightMax) nvHeight= " + nvHeight + " lim.heightMax= " + lim.heightMax, 60);
                        nvHeight = lim.heightMax;
                        if (direction.indexOf("n") != -1) {
                            nvTop = (oReSize.topI + oReSize.heightI - 1) - lim.heightMax + 1;
                        }
                        traceExec("contrainte 5");
                    }
                    if ((rectLim.top != undefined) && (nvTop < rectLim.top)) {
                        traceExec("Mm (nvTop < rectLim.top) nvHeight= " + nvHeight + " rectLim.top= " + rectLim.top + " nvTop= " + nvTop, 60);
                        nvHeight = nvHeight - (rectLim.top - nvTop);
                        nvTop = rectLim.top;
                        traceExec("contrainte 6");
                    } else {
                        if ((rectLim.bottom != undefined) && ((nvHeight + nvTop - 1) > rectLim.bottom)) {
                            traceExec("Mm (nvHeight + nvTop - 1) > rectLim.bottom) nvHeight= " + nvHeight + " rectLim.bottom= " + rectLim.bottom + " TopI= " + oReSize.topI, 60);
                            nvHeight = rectLim.bottom - oReSize.topI + 1;
                            traceExec("contrainte 7");
                        } else {
                            if (nvHeight < lim.heightMin) {
                                traceExec("Mm (nvHeight < lim.heightMin) nvHeight= " + nvHeight + " lim.heightMin= " + lim.heightMin, 60);
                                nvHeight = lim.heightMin;
                                if (direction.indexOf("n") != -1) {
                                    nvTop = (oReSize.topI + oReSize.heightI - 1) - lim.heightMin + 1;
                                }
                                traceExec("contrainte 8");
                            }
                        }
                    }
                } else {
                    if (nvWidth > lim.widthMax) {
                        nvWidth = lim.widthMax;
                        nvLeft = oReSize.leftI - ((lim.widthMax - oReSize.widthI) / 2) + 1;
                    }
                    if ((rectLim.left != undefined) && (nvLeft < rectLim.left)) {
                        nvWidth = nvWidth - 2 * (rectLim.left - nvLeft);
                        nvLeft = rectLim.left;
                    }
                    if ((rectLim.right != undefined) && ((nvWidth + nvLeft - 1) > rectLim.right)) {
                        var tropW = (nvWidth + nvLeft - 1) - rectLim.right;
                        nvWidth = nvWidth - 2 * tropW;
                        nvLeft = nvLeft + tropW - 1;
                    }
                    if (nvWidth < lim.widthMin) {
                        var manqueW = lim.widthMin - nvWidth;
                        nvWidth = nvWidth + manqueW;
                        nvLeft = nvLeft - 0.5 * manqueW;
                    }
                    if (nvHeight > lim.heightMax) {
                        nvHeight = lim.heightMax;
                        nvTop = oReSize.topI - ((lim.heightMax - oReSize.heightI) / 2) + 1;
                        traceExec("Mm sym contrainte 1");
                    }
                    if ((rectLim.top != undefined) && (nvTop < rectLim.top)) {
                        traceExec("Mm sym ctr 2 nvHeight= " + nvHeight + " rectLim.top= " + rectLim.top + "  nvTop= " + nvTop, 60);
                        nvHeight = nvHeight - 2 * (rectLim.top - nvTop);
                        nvTop = rectLim.top;
                        traceExec("Mm sym contrainte 2", 60);
                    }
                    if ((rectLim.bottom != undefined) && ((nvHeight + nvTop - 1) > rectLim.bottom)) {
                        var tropH = (nvHeight + nvTop - 1) - rectLim.bottom;
                        nvHeight = nvHeight - 2 * tropH;
                        nvTop = nvTop + tropH - 1;
                        traceExec("Mm sym contrainte 3");
                    }
                    if (nvHeight < lim.heightMin) {
                        var manqueH = lim.heightMin - nvHeight;
                        nvHeight = nvHeight + manqueH;
                        nvTop = nvTop - 0.5 * manqueH;
                        traceExec("Mm sym contrainte 4");
                    }
                }
                traceExec("Mm ap nvHeight= contraintes" + nvHeight, 60);
            }
            if (oReSize.magnet) {
                if (!oReSize.limitReDim.symetrie) {
                    if (direction.indexOf("n") != -1) {
                        var nvTopGrille = Math.round(nvTop / oReSize.magnet.heightRow) * oReSize.magnet.heightRow;
                        var diffMagn = nvTop - nvTopGrille;
                        nvTop = nvTopGrille;
                        nvHeight = nvHeight + diffMagn;
                    }
                    if (direction.indexOf("w") != -1) {
                        var nvLeftGrille = Math.round(parseInt(nvLeft) / oReSize.magnet.widthCol) * oReSize.magnet.widthCol;
                        diffMagn = nvLeft - nvLeftGrille;
                        nvLeft = nvLeftGrille;
                        nvWidth = nvWidth + diffMagn;
                    }
                    if (direction.indexOf("s") != -1) {
                        var nvHeightGrille = Math.round(parseInt(nvHeight) / oReSize.magnet.heightRow) * oReSize.magnet.heightRow;
                        diffMagn = nvHeight - nvHeightGrille;
                        nvHeight = nvHeightGrille;
                    }
                    if (direction.indexOf("e") != -1) {
                        nvWidth = Math.round(parseInt(nvWidth) / oReSize.magnet.widthCol) * oReSize.magnet.widthCol;
                    }
                } else {
                    alert("deformation symetrique + grille magnetique non encore impl?ment?e");
                }
            }
            oReSize.objetEnDeformation.style.top = nvTop;
            oReSize.objetEnDeformation.style.left = nvLeft;
            oReSize.objetEnDeformation.style.width = nvWidth;
            oReSize.objetEnDeformation.style.height = nvHeight;
            if (oReSize.oThis.synchroRS) {
                rialto.widgetBehavior.$$RSMM_CallBackSynchro();
            }
        }
    }
    stopEvent(e);
};
rialto.widgetBehavior.$$RSMM_CallBackSynchro = function () {
    var deltaTop = parseInt(oReSize.objetEnDeformation.style.top) - oReSize.prevTop;
    var deltaLeft = parseInt(oReSize.objetEnDeformation.style.left) - oReSize.prevLeft;
    var deltaWidth = parseInt(oReSize.objetEnDeformation.style.width) - oReSize.prevWidth;
    var deltaHeight = pixHeight(oReSize.objetEnDeformation) - oReSize.prevHeight;
    oReSize.prevTop = parseInt(oReSize.objetEnDeformation.style.top);
    oReSize.prevLeft = parseInt(oReSize.objetEnDeformation.style.left);
    oReSize.prevWidth = parseInt(oReSize.objetEnDeformation.style.width);
    oReSize.prevHeight = parseInt(oReSize.objetEnDeformation.style.height);
    if (oReSize.oThis.synchroRS) {
        oReSize.oThis.synchroRS({top:deltaTop, left:deltaLeft, width:deltaWidth, height:deltaHeight});
    }
};
rialto.widgetBehavior.ReSizeMouseUpHandler = function (e) {
    if (!e) {
        var e = window.event;
    }
    if (oReSize && oReSize.objetEnDeformation) {
        if (this.releaseCapture) {
            this.releaseCapture();
        } else {
            if (oReSize.fantome) {
                oReSize.objetEnDeformation.style.cursor = "default";
            } else {
                oReSize.oSource.style.cursor = "default";
            }
        }
        oReSize.oSource.behavior["RS"].isRunning = false;
        var oThis = oReSize.oThis;
        if (oThis.afterRS) {
            if (oReSize.objetADeformer != oReSize.objetEnDeformation) {
                var deltaTop = parseInt(oReSize.objetEnDeformation.style.top) - parseInt(oReSize.objetADeformer.style.top);
                var deltaLeft = parseInt(oReSize.objetEnDeformation.style.left) - parseInt(oReSize.objetADeformer.style.left);
                var deltaWidth = parseInt(oReSize.objetEnDeformation.style.width) - parseInt(oReSize.objetADeformer.style.width) + oReSize.wBordGD;
                traceExec("oReSize.objetEnDeformation.style.height= " + parseInt(oReSize.objetEnDeformation.style.height), 60);
                traceExec("oReSize.objetADeformer.style.height=     " + pixHeight(oReSize.objetADeformer), 60);
                var deltaHeight = parseInt(oReSize.objetEnDeformation.style.height) - pixHeight(oReSize.objetADeformer) + oReSize.wBordHB;
                traceExec("RS -3- Mup  afterRs existe deltaHeight = parseInt(oReSize.objetEnDeformation.style.height)- pixHeight(oReSize.objetADeformer) + oReSize.wBordHB= " + deltaHeight, 75);
                traceExec("______deltaHeight= " + deltaHeight, 62);
            } else {
                var deltaTop = parseInt(oReSize.objetEnDeformation.style.top) - parseInt(oReSize.topI);
                var deltaLeft = parseInt(oReSize.objetEnDeformation.style.left) - parseInt(oReSize.leftI);
                var deltaWidth = parseInt(oReSize.objetEnDeformation.style.width) - parseInt(oReSize.widthI);
                var deltaHeight = parseInt(oReSize.objetEnDeformation.style.height) - parseInt(oReSize.heightI);
                traceExec("RS -4- Mup pas de afterRs deltaHeight = parseInt(oReSize.objetEnDeformation.style.height)- parseInt(oReSize.heightI)= " + deltaHeight, 75);
            }
        }
        if (oReSize.objetADeformer != oReSize.objetEnDeformation) {
            oReSize.objetADeformer.style.top = oReSize.objetEnDeformation.style.top;
            oReSize.objetADeformer.style.left = oReSize.objetEnDeformation.style.left;
            oReSize.objetADeformer.style.width = parseInt(oReSize.objetEnDeformation.style.width) + oReSize.wBordGD;
            oReSize.objetADeformer.style.height = parseInt(oReSize.objetEnDeformation.style.height) + oReSize.wBordHB;
            traceExec("RS -5- Mup oReSize.objetADeformer.id= " + oReSize.objetADeformer.id + " oReSize.objetADeformer.style.height = parseInt(oReSize.objetEnDeformation.style.height) + oReSize.wBordHB=" + oReSize.objetADeformer.style.height, 1);
        }
        if (oReSize.fantome) {
            oReSize.objetEnDeformation.style.visibility = "hidden";
        }
        if (oReSize.mvtEffectif) {
            if (oThis.afterRS) {
                oThis.afterRS({top:deltaTop, left:deltaLeft, width:deltaWidth, height:deltaHeight});
            }
        } else {
            if (oThis.afterClic) {
                oThis.afterClic(e);
            }
        }
        oReSize = null;
        stopEvent(e);
    }
};
rialto.widgetBehavior.ReSize.modCurseur = function (oHtml, direction, orientation) {
    if (direction == "") {
        oHtml.style.cursor = "default";
    } else {
        if (orientation == "v") {
            oHtml.style.cursor = direction + "-resize";
        } else {
            if (orientation == "h") {
                oHtml.style.cursor = direction + "-resize";
            } else {
                oHtml.style.cursor = "move";
            }
        }
    }
};


objFrame.prototype.nbreInstance = 0;
function objFrame(name, top, left, width, height, bAffiche) {
    this.name = name;
    this.id = name + "_" + (objFrame.prototype.nbreInstance++);
    if (!bAffiche) {
        this.top = 0;
        this.left = 0;
        this.width = 0;
        this.height = 0;
        this.visibility = "hidden";
    } else {
        this.visibility = "visible";
        this.top = top;
        this.left = left;
        this.width = width;
        this.height = height;
    }
}
objFrame.prototype.create = function (parent) {
    rialto.session.reccord(this, this.id);
    var oThis = this;
    this.frame = document.createElement("iframe");
    this.frame.style.position = "absolute";
    this.frame.style.visibility = this.visibility;
    this.frame.style.top = this.top;
    this.frame.style.left = this.left;
    this.frame.style.width = this.width;
    this.frame.style.border = "0px solid black";
    this.frame.style.backgroundColor = "white";
    this.frame.style.height = this.height;
    this.frame.id = this.id + "IFRAME";
    this.frame.name = this.id + "IFRAME";
    this.frame.src = "";
    this.frame.oRia = this;
    if (parent) {
        this.placeIn(parent);
    } else {
        document.body.appendChild(this.frame);
    }
};
objFrame.prototype.masque = function () {
    this.frame.style.width = 0;
    this.frame.style.height = 0;
};
objFrame.prototype.placeIn = function (parent) {
    if (parent.add) {
        parent.add(this.frame);
    } else {
        parent.appendChild(this.frame);
    }
    this.parent = this.frame.parentNode;
};
objFrame.prototype.remplit = function (inner) {
    fr = document.getElementById(this.id + "IFRAME");
    fr.contentWindow.document.write(inner);
};
objFrame.prototype.reload = function (inner) {
    fr = document.getElementById(this.id + "IFRAME");
    fr.contentWindow.document.location.reload();
};
objFrame.prototype.load = function (url) {
    if (url != null) {
        this.url = String(url);
        this.IFrameDoc = this.frame.contentWindow.document;
        this.IFrameDoc.location.replace(this.url);
    }
};
objFrame.prototype.masque = function () {
    this.frame.style.visibility = "hidden";
};
objFrame.prototype.affiche = function () {
    this.frame.style.visibility = "visible";
};
objFrame.prototype.trace = function () {
};
objFrame.prototype.getObjHtml = function () {
    return this.frame;
};
objFrame.prototype.delFrame = function (parent) {
    this.parent.removeChild(this.frame);
};


rialto.io = {};
rialto.io.AjaxRequest = function (objPar) {
    this.withWaitWindow = true;
    this.callBackObjectOnSuccess = null;
    this.callBackObjectOnFailure = null;
    this.canBeCancel = true;
    this.asynchronous = true;
    this.method = "get";
    this.onSuccess = this.reportSuccess;
    this.onFailure = this.reportError;
    this.contentType = "application/x-www-form-urlencoded";
    this.setUp(objPar);
    this.xhttpr = null;
    if (window.ActiveXObject) {
        try {
            this.xhttpr = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            this.xhttpr = new ActiveXObject("Microsoft.XMLHTTP");
        }
    } else {
        if (window.XMLHttpRequest) {
            this.xhttpr = new XMLHttpRequest();
        } else {
            this.xhttpr = false;
        }
    }
    this.status = ["Uninitialized", "Loading", "Loaded", "Interactive", "Complete"];
};
rialto.io.AjaxRequest.prototype = {setUp:function (objPar) {
    if (objPar != null) {
        if (objPar.url) {
            this.url = objPar.url;
        }
        if (objPar.callBackObjectOnSuccess) {
            this.callBackObjectOnSuccess = objPar.callBackObjectOnSuccess;
        }
        if (objPar.callBackObjectOnFailure) {
            this.callBackObjectOnFailure = objPar.callBackObjectOnFailure;
        }
        if (rialto.lang.isBoolean(objPar.canBeCancel)) {
            this.canBeCancel = objPar.canBeCancel;
        }
        if (rialto.lang.isBoolean(objPar.withWaitWindow)) {
            this.withWaitWindow = objPar.withWaitWindow;
        }
        if (rialto.lang.isStringIn(objPar.method, ["post", "get"])) {
            this.method = objPar.method;
        }
        if (rialto.lang.isString(objPar.contentType, true)) {
            this.contentType = objPar.contentType;
        }
        if (objPar.onSuccess) {
            if (this.callBackObjectOnSuccess) {
                this.onSuccess = rialto.lang.link(this.callBackObjectOnSuccess, objPar.onSuccess);
            } else {
                this.onSuccess = objPar.onSuccess;
            }
        }
        if (objPar.onFailure) {
            if (this.callBackObjectOnFailure) {
                this.onFailure = rialto.lang.link(this.callBackObjectOnFailure, objPar.onFailure);
            } else {
                this.onFailure = objPar.onFailure;
            }
        }
    }
    if (this.withWaitWindow) {
        this.onLoading = rialto.lang.link(this, this.displayWaitWindow);
    }
}, load:function (parameters) {
    this.parameters = parameters;
    var url = this.url;
    try {
        if (this.method == "get" && this.parameters.length > 0) {
            url += (url.match(/\?/) ? "&" : "?") + this.parameters;
        }
        this.xhttpr.open(this.method, url, this.asynchronous);
        this.xhttpr.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
        if (this.method == "post") {
            this.xhttpr.setRequestHeader("Content-Type", this.contentType);
        }
        if (this.asynchronous) {
            this.xhttpr.onreadystatechange = rialto.lang.link(this, this.respondToReadyState);
        }
        this.xhttpr.send(this.method == "post" ? this.parameters : null);
    }
    catch (e) {
        alert(e + "\n (url :" + url + ")");
    }
}, responseIsSuccess:function () {
    return (this.xhttpr.status == undefined || this.xhttpr.status == 0 || (this.xhttpr.status >= 200 && this.xhttpr.status < 300));
}, responseIsFailure:function () {
    return !this.responseIsSuccess();
}, respondToReadyState:function () {
    var readyState = this.xhttpr.readyState;
    var status = this.status[readyState];
    switch (status) {
      case "Complete":
        if (this.withWaitWindow && this.waitWindow) {
            this.waitWindow.setVisible(false);
        }
        try {
            this["on" + (this.responseIsSuccess() ? "Success" : "Failure")](this.xhttpr);
        }
        catch (e) {
        }
        break;
      default:
        try {
            this["on" + status](this.xhttpr);
        }
        catch (e) {
        }
        break;
    }
}, abort:function () {
    if (this.canBeCancel) {
        this.xhttpr.abort();
    }
}, displayWaitWindow:function () {
    if (this.waitWindow) {
        this.waitWindow.setVisible(true);
    } else {
        var oThis = this;
        this.waitWindow = new rialto.widget.WaitWindow({text:"LOADING", canBeCancel:this.canBeCancel});
        if (this.canBeCancel) {
            this.waitWindow.onclick = function () {
                oThis.abort();
                this.setVisible(false);
            };
        }
    }
}, setWaitWindow:function (waitWindow) {
    if (waitWindow && (waitWindow.setVisible && waitWindow.onclick)) {
        this.waitWindow = waitWindow;
    }
}, reportSuccess:function (request) {
    var div = document.createElement("DIV");
    div.innerHTML = request.responseText;
    var fen = new rialto.widget.objFenData(600, 400, div, "Response");
}, reportError:function (request) {
    var div = document.createElement("DIV");
    div.innerHTML = request.responseText;
    var fen = new rialto.widget.objFenData(600, 400, div, "Sorry. There was an error.");
}};


ATTRFLOAT = (!window.getComputedStyle) ? "styleFloat" : "cssFloat";
if (!rialto.effect) {
    rialto.effect = {};
}
rialto.effect.opacity = function (oHtml, level) {
    oHtml.style.filter = "alpha(opacity:" + (level * 100) + ")";
    oHtml.style.opacity = level;
};


function initDebug() {
    if (rialto.config.isDebug) {
        if (!(rialto.config.userAgentIsFirefox && ("console" in window) && ("firebug" in console))) {
            window.console = {log:function () {
                logFormatted(arguments, "");
            }, debug:function () {
                logFormatted(arguments, "debug");
            }, info:function () {
                logFormatted(arguments, "info");
            }, warn:function () {
                logFormatted(arguments, "warning");
            }, error:function () {
                logFormatted(arguments, "error");
            }, assert:function (truth, message) {
                if (!truth) {
                    var args = [];
                    for (var i = 1; i < arguments.length; ++i) {
                        args.push(arguments[i]);
                    }
                    logFormatted(args.length ? args : ["Assertion Failure"], "error");
                    throw message ? message : "Assertion Failure";
                }
            }, dir:function (object) {
                var html = [];
                var pairs = [];
                for (var name in object) {
                    try {
                        pairs.push([name, object[name]]);
                    }
                    catch (exc) {
                    }
                }
                pairs.sort(function (a, b) {
                    return a[0] < b[0] ? -1 : 1;
                });
                html.push("<table>");
                for (var i = 0; i < pairs.length; ++i) {
                    var name = pairs[i][0], value = pairs[i][1];
                    html.push("<tr>", "<td class=\"propertyNameCell\"><span class=\"propertyName\">", escapeHTML(name), "</span></td>", "<td><span class=\"propertyValue\">");
                    appendObject(value, html);
                    html.push("</span></td></tr>");
                }
                html.push("</table>");
                logRow(html, "dir");
            }, dirxml:function (node) {
                var html = [];
                appendNode(node, html);
                logRow(html, "dirxml");
            }, group:function () {
                logRow(arguments, "group", pushGroup);
            }, groupEnd:function () {
                logRow(arguments, "", popGroup);
            }, time:function (name) {
                timeMap[name] = (new Date()).getTime();
            }, timeEnd:function (name) {
                if (name in timeMap) {
                    var delta = (new Date()).getTime() - timeMap[name];
                    logFormatted([name + ":", delta + "ms"]);
                    delete timeMap[name];
                }
            }, count:function () {
                this.warn(["count() not supported."]);
            }, trace:function () {
                this.warn(["trace() not supported."]);
            }, profile:function () {
                this.warn(["profile() not supported."]);
            }, profileEnd:function () {
            }, clear:function () {
                consoleBody.innerHTML = "";
            }, open:function () {
                toggleConsole(true);
            }, close:function () {
                if (frameVisible) {
                    toggleConsole();
                }
            }};
            var consoleFrame = null;
            var consoleBody = null;
            var commandLine = null;
            var frameVisible = true;
            var messageQueue = [];
            var groupStack = [];
            var timeMap = {};
            var clPrefix = ">>> ";
            var isFirefox = navigator.userAgent.indexOf("Firefox") != -1;
            var isIE = navigator.userAgent.indexOf("MSIE") != -1;
            var isOpera = navigator.userAgent.indexOf("Opera") != -1;
            var isSafari = navigator.userAgent.indexOf("AppleWebKit") != -1;
            var fr;
            function toggleConsole(forceOpen) {
                frameVisible = forceOpen || !frameVisible;
                if (consoleFrame) {
                    if (fr && fr.setVisible) {
                        fr.setVisible(frameVisible);
                    }
                } else {
                    waitForBody();
                }
            }
            function focusCommandLine() {
                toggleConsole(true);
                if (commandLine) {
                    commandLine.focus();
                }
            }
            function waitForBody() {
                if (document.body) {
                    createFrame();
                } else {
                    setTimeout(waitForBody, 200);
                }
            }
            function createFrame() {
                if (consoleFrame) {
                    return;
                }
                consoleFrame = document.createElement("DIV");
                consoleFrame.style.position = "absolute";
                consoleFrame.style.width = "100%";
                consoleFrame.style.left = "0";
                consoleFrame.style.bottom = "0";
                consoleFrame.style.height = "200px";
                consoleFrame.innerHTML = "" + "<div id=\"toolbar\" class=\"toolbar\">" + "<a href=\"#\" onclick=\"parent.console.clear();return false;\">Clear</a>" + "<span class=\"toolbarRight\">" + "<a href=\"#\" onclick=\"parent.console.close()\">Close</a>" + "</span>" + "</div>" + "<div id=\"log\"></div>" + "<input type=\"text\" id=\"commandLine\" onclick=\"this.focus();\"/>";
                var widthGlobal = document.body.clientWidth;
                var heightGlobal = document.body.clientHeight;
                var top = heightGlobal - 230;
                var left = widthGlobal - 400;
                fr = new rialto.widget.Frame({name:"Dashboard", top:top, left:left, width:400, height:230, title:"DEBUG:Type F12 to hide or show the console", dynamic:true, draggable:true, parent:document.body});
                fr.placeInTop();
                fr.add(consoleFrame);
                commandLine = document.getElementById("commandLine");
                commandLine.setAttribute("autocomplete", "off");
                addEvent(commandLine, "keydown", onCommandLineKeyDown);
                addEvent(document, isIE || isSafari ? "keydown" : "keypress", onKeyDown);
                consoleBody = document.getElementById("log");
                layout();
                flush();
            }
            function evalCommandLine() {
                var text = commandLine.value;
                commandLine.value = "";
                logRow([clPrefix, text], "command");
                var value;
                try {
                    value = eval(text);
                }
                catch (exc) {
                }
                console.log(value);
            }
            function layout() {
                var toolbar = document.getElementById("toolbar");
                var height = consoleFrame.offsetHeight - (toolbar.offsetHeight + commandLine.offsetHeight);
                consoleBody.style.top = toolbar.offsetHeight + "px";
                consoleBody.style.height = height + "px";
                commandLine.style.top = (consoleFrame.offsetHeight - commandLine.offsetHeight) + "px";
            }
            function logRow(message, className, handler) {
                if (consoleBody) {
                    writeMessage(message, className, handler);
                } else {
                    messageQueue.push([message, className, handler]);
                    waitForBody();
                }
            }
            function flush() {
                var queue = messageQueue;
                messageQueue = [];
                for (var i = 0; i < queue.length; ++i) {
                    writeMessage(queue[i][0], queue[i][1], queue[i][2]);
                }
            }
            function writeMessage(message, className, handler) {
                var isScrolledToBottom = consoleBody.scrollTop + consoleBody.offsetHeight >= consoleBody.scrollHeight;
                if (!handler) {
                    handler = writeRow;
                }
                handler(message, className);
                if (isScrolledToBottom) {
                    consoleBody.scrollTop = consoleBody.scrollHeight - consoleBody.offsetHeight;
                }
            }
            function appendRow(row) {
                var container = groupStack.length ? groupStack[groupStack.length - 1] : consoleBody;
                container.appendChild(row);
            }
            function writeRow(message, className) {
                var row = consoleBody.ownerDocument.createElement("div");
                row.className = "logRow" + (className ? " logRow-" + className : "");
                row.innerHTML = message.join("");
                appendRow(row);
            }
            function pushGroup(message, className) {
                logFormatted(message, className);
                var groupRow = consoleBody.ownerDocument.createElement("div");
                groupRow.className = "logGroup";
                var groupRowBox = consoleBody.ownerDocument.createElement("div");
                groupRowBox.className = "logGroupBox";
                groupRow.appendChild(groupRowBox);
                appendRow(groupRowBox);
                groupStack.push(groupRowBox);
            }
            function popGroup() {
                groupStack.pop();
            }
            function logFormatted(objects, className) {
                var html = [];
                var format = objects[0];
                var objIndex = 0;
                if (typeof (format) != "string") {
                    format = "";
                    objIndex = -1;
                }
                var parts = parseFormat(format);
                for (var i = 0; i < parts.length; ++i) {
                    var part = parts[i];
                    if (part && typeof (part) == "object") {
                        var object = objects[++objIndex];
                        part.appender(object, html);
                    } else {
                        appendText(part, html);
                    }
                }
                for (var i = objIndex + 1; i < objects.length; ++i) {
                    appendText(" ", html);
                    var object = objects[i];
                    if (typeof (object) == "string") {
                        appendText(object, html);
                    } else {
                        appendObject(object, html);
                    }
                }
                logRow(html, className);
            }
            function parseFormat(format) {
                var parts = [];
                var reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/;
                var appenderMap = {s:appendText, d:appendInteger, i:appendInteger, f:appendFloat};
                for (var m = reg.exec(format); m; m = reg.exec(format)) {
                    var type = m[8] ? m[8] : m[5];
                    var appender = type in appenderMap ? appenderMap[type] : appendObject;
                    var precision = m[3] ? parseInt(m[3]) : (m[4] == "." ? -1 : 0);
                    parts.push(format.substr(0, m[0][0] == "%" ? m.index : m.index + 1));
                    parts.push({appender:appender, precision:precision});
                    format = format.substr(m.index + m[0].length);
                }
                parts.push(format);
                return parts;
            }
            function escapeHTML(value) {
                function replaceChars(ch) {
                    switch (ch) {
                      case "<":
                        return "&lt;";
                      case ">":
                        return "&gt;";
                      case "&":
                        return "&amp;";
                      case "'":
                        return "&#39;";
                      case "\"":
                        return "&quot;";
                    }
                    return "?";
                }
                return String(value).replace(/[<>&"']/g, replaceChars);
            }
            function objectToString(object) {
                try {
                    return object + "";
                }
                catch (exc) {
                    return null;
                }
            }
            function appendText(object, html) {
                html.push(escapeHTML(objectToString(object)));
            }
            function appendNull(object, html) {
                html.push("<span class=\"objectBox-null\">", escapeHTML(objectToString(object)), "</span>");
            }
            function appendString(object, html) {
                html.push("<span class=\"objectBox-string\">&quot;", escapeHTML(objectToString(object)), "&quot;</span>");
            }
            function appendInteger(object, html) {
                html.push("<span class=\"objectBox-number\">", escapeHTML(objectToString(object)), "</span>");
            }
            function appendFloat(object, html) {
                html.push("<span class=\"objectBox-number\">", escapeHTML(objectToString(object)), "</span>");
            }
            function appendFunction(object, html) {
                var reName = /function ?(.*?)\(/;
                var m = reName.exec(objectToString(object));
                var name = m ? m[1] : "function";
                html.push("<span class=\"objectBox-function\">", escapeHTML(name), "()</span>");
            }
            function appendObject(object, html) {
                try {
                    if (object == undefined) {
                        appendNull("undefined", html);
                    } else {
                        if (object == null) {
                            appendNull("null", html);
                        } else {
                            if (typeof object == "string") {
                                appendString(object, html);
                            } else {
                                if (typeof object == "number") {
                                    appendInteger(object, html);
                                } else {
                                    if (typeof object == "function") {
                                        appendFunction(object, html);
                                    } else {
                                        if (object.nodeType == 1) {
                                            appendSelector(object, html);
                                        } else {
                                            if (typeof object == "object") {
                                                appendObjectFormatted(object, html);
                                            } else {
                                                appendText(object, html);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                catch (exc) {
                }
            }
            function appendObjectFormatted(object, html) {
                var text = objectToString(object);
                var reObject = /\[object (.*?)\]/;
                var m = reObject.exec(text);
                html.push("<span class=\"objectBox-object\">", m ? m[1] : text, "</span>");
            }
            function appendSelector(object, html) {
                html.push("<span class=\"objectBox-selector\">");
                html.push("<span class=\"selectorTag\">", escapeHTML(object.nodeName.toLowerCase()), "</span>");
                if (object.id) {
                    html.push("<span class=\"selectorId\">#", escapeHTML(object.id), "</span>");
                }
                if (object.className) {
                    html.push("<span class=\"selectorClass\">.", escapeHTML(object.className), "</span>");
                }
                html.push("</span>");
            }
            function appendNode(node, html) {
                if (node.nodeType == 1) {
                    html.push("<div class=\"objectBox-element\">", "&lt;<span class=\"nodeTag\">", node.nodeName.toLowerCase(), "</span>");
                    for (var i = 0; i < node.attributes.length; ++i) {
                        var attr = node.attributes[i];
                        if (!attr.specified) {
                            continue;
                        }
                        html.push("&nbsp;<span class=\"nodeName\">", attr.nodeName.toLowerCase(), "</span>=&quot;<span class=\"nodeValue\">", escapeHTML(attr.nodeValue), "</span>&quot;");
                    }
                    if (node.firstChild) {
                        html.push("&gt;</div><div class=\"nodeChildren\">");
                        for (var child = node.firstChild; child; child = child.nextSibling) {
                            appendNode(child, html);
                        }
                        html.push("</div><div class=\"objectBox-element\">&lt;/<span class=\"nodeTag\">", node.nodeName.toLowerCase(), "&gt;</span></div>");
                    } else {
                        html.push("/&gt;</div>");
                    }
                } else {
                    if (node.nodeType == 3) {
                        html.push("<div class=\"nodeText\">", escapeHTML(node.nodeValue), "</div>");
                    }
                }
            }
            function addEvent(object, name, handler) {
                if (document.all) {
                    object.attachEvent("on" + name, handler);
                } else {
                    object.addEventListener(name, handler, false);
                }
            }
            function removeEvent(object, name, handler) {
                if (document.all) {
                    object.detachEvent("on" + name, handler);
                } else {
                    object.removeEventListener(name, handler, false);
                }
            }
            function cancelEvent(event) {
                if (document.all) {
                    event.cancelBubble = true;
                } else {
                    event.stopPropagation();
                }
            }
            function onError(msg, href, lineNo) {
                var html = [];
                var lastSlash = href.lastIndexOf("/");
                var fileName = lastSlash == -1 ? href : href.substr(lastSlash + 1);
                html.push("<span class=\"errorMessage\">", msg, "</span>", "<div class=\"objectBox-sourceLink\">", fileName, " (line ", lineNo, ")</div>");
                logRow(html, "error");
            }
            function onKeyDown(event) {
                if (event.keyCode == 123) {
                    toggleConsole();
                } else {
                    if ((event.keyCode == 108 || event.keyCode == 76) && event.shiftKey && (event.metaKey || event.ctrlKey)) {
                        focusCommandLine();
                    } else {
                        return;
                    }
                }
                cancelEvent(event);
            }
            function onCommandLineKeyDown(event) {
                if (event.keyCode == 13) {
                    evalCommandLine();
                } else {
                    if (event.keyCode == 27) {
                        commandLine.value = "";
                    }
                }
            }
        }
    } else {
        var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
        window.console = {};
        for (var i = 0; i < names.length; ++i) {
            window.console[names[i]] = function () {
            };
        }
    }
}


ria.utils.event.xEvent = function (e) {
    var eX;
    if (e.offsetX != undefined) {
        eX = e.offsetX;
    } else {
        eX = e.layerX;
    }
    return eX;
};
ria.utils.event.yEvent = function (e) {
    var eY;
    if (e.offsetY != undefined) {
        eY = e.offsetY;
    } else {
        eY = e.layerY;
    }
    return eY;
};
ria.utils.event.srcTarget = function (e) {
    if (e.srcElement) {
        return e.srcElement;
    } else {
        if (e.target) {
            return e.target;
        } else {
            return null;
        }
    }
};
ria.utils.event.isRightClick = function (e) {
    var rightClick;
    if (e.which) {
        rightClick = (e.which == 3);
    } else {
        if (e.button) {
            rightClick = (e.button == 2);
        }
    }
    if (rightClick) {
        return true;
    }
};
ria.utils.event.isLeftClick = function (e) {
    var leftClick;
    if (e.which) {
        leftClick = (e.which == 1);
    } else {
        if (e.button) {
            leftClick = ((e.button == 1) || (e.button == 0));
        }
    }
    if (leftClick) {
        return true;
    }
};
ria.utils.event.convertMethod = function (handler, bindingObject) {
    return function (e) {
        return handler.call(bindingObject, e || window.event);
    };
};
ria.utils.event.__eventHandlers = [];
ria.utils.event.genericAddEvent = function (oHtml, eventName, handler, bindingObject) {
    if (eventName.substr(0, 2) == "on") {
        var ieevent = eventName;
        var ffevent = eventName.substr(2);
    } else {
        var ieevent = "on" + eventName;
        var ffevent = eventName;
    }
    var handlerF = handler;
    if (bindingObject) {
        handlerF = ria.utils.event.convertMethod(handler, bindingObject);
    }
    if (oHtml.attachEvent) {
        oHtml.attachEvent(ieevent, handlerF);
    } else {
        oHtml.addEventListener(ffevent, handlerF, false);
    }
    var event = {oHtml:oHtml, name:eventName, handler:handlerF};
    ria.utils.event.__eventHandlers.push(event);
    return event;
};
ria.utils.event.genericRemoveEvent = function (event) {
    var handlerF = event.handler;
    var e = event.name;
    if (e.substr(0, 2) == "on") {
        var ieevent = e;
        var ffevent = e.substr(2);
    } else {
        var ieevent = "on" + e;
        var ffevent = e;
    }
    var oHtml = event.oHtml;
    if (oHtml.detachEvent) {
        oHtml.detachEvent(ieevent, handlerF);
    } else {
        oHtml.removeEventListener(ffevent, handlerF, false);
    }
    rialto.array.remove(ria.utils.event.__eventHandlers, event);
};
ria.utils.event.unregisterAllEvents = function () {
    while (ria.utils.event.__eventHandlers.length > 0) {
        ria.utils.event.genericRemoveEvent(ria.utils.event.__eventHandlers[0]);
    }
};
stopEvent = ria.utils.event.stopEvent = function (e) {
    if (!e) {
        var e = window.event;
    }
    if (e.stopPropagation) {
        e.stopPropagation();
    } else {
        e.cancelBubble = true;
    }
    if (e.preventDefault) {
        e.preventDefault();
    } else {
        e.returnValue = false;
    }
};
stopDefault = ria.utils.event.stopDefault = function (e) {
    if (!e) {
        var e = window.event;
    }
    if (e.preventDefault) {
        e.preventDefault();
    } else {
        e.returnValue = false;
    }
};
propageEvent = ria.utils.event.propageEvent = function (e) {
    if (!e) {
        var e = window.event;
    }
    if (!e.stopPropagation) {
        e.cancelBubble = false;
    }
    if (e.preventDefault) {
        e.preventDefault();
    } else {
        e.returnValue = false;
    }
};
addHandler = ria.utils.event.addHandler = function (oHtml, typeEvt, handler, oThis) {
    if (!oHtml.tHandler) {
        oHtml.tHandler = new Array();
    }
    if (!oHtml.tHandler[typeEvt]) {
        oHtml.tHandler[typeEvt] = new Array();
    }
    oHtml.tHandler[typeEvt][oHtml.tHandler[typeEvt].length] = {fct:handler, oThis:oThis};
    var fct = "{";
    for (var i = 0; i < oHtml.tHandler[typeEvt].length; i++) {
        if (oHtml.tHandler[typeEvt][i].oThis) {
            fct += oHtml.tHandler[typeEvt][i].fct + "(e,this);";
        } else {
            fct += "this." + oHtml.tHandler[typeEvt][i].fct + "(e);";
        }
    }
    fct += "}";
    oHtml[typeEvt] = new Function("e", fct);
};
DirDeplact = ria.utils.event.DirDeplact = function (oHtml, e, height, width, margeSens, exclusionMarge, specOrientation) {
    var limOrientation = specOrientation || oHtml.dirRS;
    margeSens = margeSens || 0;
    var dir = "";
    var xy = _rum.$eventTopLeftInDiv(e);
    var xPRC = xy.left;
    var yPRC = xy.top;
    if (exclusionMarge) {
        if ((margeSens != 0) && ((xPRC < margeSens) || (xPRC > (width - margeSens)) || (yPRC < margeSens) || (yPRC > (height - margeSens)))) {
            dir = "";
        } else {
            if (limOrientation == "h") {
                dir = "w";
            } else {
                if (limOrientation == "v") {
                    dir = "n";
                } else {
                    dir = "x";
                }
            }
        }
    } else {
        if (limOrientation != "h") {
            if (yPRC < margeSens) {
                dir = "n";
            } else {
                if (yPRC > (height - margeSens)) {
                    dir = "s";
                }
            }
        }
        if (limOrientation != "v") {
            if (xPRC < margeSens) {
                dir += "w";
            } else {
                if (xPRC > (width - margeSens)) {
                    dir += "e";
                }
            }
        }
        traceExec("(width - margeSens) = " + (width - margeSens), 58);
    }
    return dir;
};


ria.utils.event.keyPressHandler = function (oHtml) {
    this.oHtml = oHtml;
    this.event = ria.utils.event.genericAddEvent(oHtml, "keypress", this._onkeyPress, this);
    this._asciinotok = new Array;
};
ria.utils.event.keyPressHandler.prototype = {_asciiok:[8, 9, 16, 17, 18, 36, 37, 39, 46, 92, 93, 112, 111, 112, 113, 114, 115, 116, 118, 119, 120, 121, 122, 123, 124], _onkeyPress:function (e) {
    if (!e) {
        var e = window.event;
    }
    this.e = e;
    this.keyCode = e.keyCode ? e.keyCode : e.charCode ? e.charCode : e.which ? e.which : void 0;
    if (!this.isKeyCodeIn(this._asciinotok) && this.isKeyCodeIn(this._asciiok) && this.isNoCharCode()) {
        return true;
    }
    if (this.keyCode) {
        this.key = String.fromCharCode(this.keyCode);
    }
    if (this.isCtrlKey() && (this.key == "a" || this.key == "c" || this.key == "x" || this.key == "v")) {
        return true;
    }
    var returnVal = this.onkeyPress();
    if (!returnVal) {
        this.cancelKeyPress();
    }
    return returnVal;
}, onkeyPress:function () {
}, setAscii:function (arr) {
    this._asciinotok = arr;
}, setOnkeyDown:function () {
    if (this.event) {
        ria.utils.event.genericRemoveEvent(this.event);
    }
    this.event = ria.utils.event.genericAddEvent(this.oHtml, "keydown", this._onkeyPress, this);
}, setOnkeyUp:function () {
    if (this.event) {
        ria.utils.event.genericRemoveEvent(this.event);
    }
    this.event = ria.utils.event.genericAddEvent(this.oHtml, "keyup", this._onkeyPress, this);
}, setOnkeyUp:function () {
    if (this.event) {
        ria.utils.event.genericRemoveEvent(this.event);
    }
    this.event = ria.utils.event.genericAddEvent(this.oHtml, "keyup", this._onkeyPress, this);
}, setOnkeyPress:function () {
    if (this.event) {
        ria.utils.event.genericRemoveEvent(this.event);
    }
    this.event = ria.utils.event.genericAddEvent(this.oHtml, "keypress", this._onkeyPress, this);
}, getKeyCode:function () {
    return this.keyCode;
}, getKey:function () {
    return this.key;
}, setKey:function (key) {
    this.key = key;
    try {
        this.e.keyCode = key.charCodeAt();
    }
    catch (e) {
        this.cancelKeyPress();
        var oldSelectionStart = this.oHtml.selectionStart;
        var oldSelectionEnd = this.oHtml.selectionEnd;
        this.oHtml.value = this.oHtml.value.substring(0, oldSelectionStart) + key + this.oHtml.value.substring(oldSelectionEnd);
        this.oHtml.setSelectionRange(oldSelectionStart + key.length, oldSelectionStart + key.length);
    }
}, isKeyCodeIn:function (arrKeyCode) {
    return (rialto.array.indexOf(arrKeyCode, this.keyCode) != -1);
}, isKeyCode:function (keyCode) {
    return (this.keyCode == keyCode);
}, isKey:function (key) {
    return (this.key == key);
}, isShiftKey:function () {
    return this.e.shiftKey;
}, isAltKey:function () {
    return this.e.altKey;
}, isCtrlKey:function () {
    return this.e.ctrlKey;
}, isDelKey:function () {
    return (this.isKeyCode(8) && this.isNoCharCode());
}, isTabKey:function () {
    return (this.isKeyCode(9));
}, isSupKey:function () {
    return (this.isKeyCode(46) && this.isNoCharCode());
}, isUpArrowKey:function () {
    return (this.isKeyCode(38));
}, isDownArrowKey:function () {
    return (this.isKeyCode(40));
}, isLeftArrowKey:function () {
    return (this.isKeyCode(37));
}, isRightArrowKey:function () {
    return (this.isKeyCode(39));
}, isEnterKey:function () {
    return (this.isKeyCode(13));
}, isNoCharCode:function () {
    return (this.e.charCode == null || this.e.charCode == 0);
}, cancelKeyPress:function () {
    if (this.e.preventDefault) {
        this.e.preventDefault();
    }
}, whatWillBeValueWithThisKey:function () {
    value = this.oHtml.value;
    var oldSelectionStart = this.oHtml.selectionStart;
    var oldSelectionEnd = this.oHtml.selectionEnd;
    if (this.isDelKey() || this.isSupKey()) {
        value = value.substring(0, oldSelectionStart) + value.substring(oldSelectionEnd);
    } else {
        value = value.substring(0, oldSelectionStart) + this.key + value.substring(oldSelectionEnd);
    }
    return value;
}, remove:function () {
    ria.utils.event.genericRemoveEvent(this.event);
}};


$$fx = window.getComputedStyle ? true : false;
if ((typeof ria) == "undefined") {
    ria = rialto;
}
if ((typeof ria.utils) == "undefined") {
    ria.utils = {};
}
ria.utils.measures = {};
ria.utils.measures.getTextSize = function (wText, className, objStyle) {
    var $doc = document;
    var parentW = window.parent;
    if (parentW && parentW.document) {
        $doc = parentW.document;
    }
    var div = $doc.createElement("DIV");
    div.innerHTML = wText;
    div.className = className;
    var wSpace = false;
    if (objStyle) {
        for (prop in objStyle) {
            div.style[prop] = objStyle[prop];
        }
        if (prop == "whiteSpace") {
            wSpace = true;
        }
    }
    div.style.position = "absolute";
    div.style.visibility = "hidden";
    div.style.width = "auto";
    if (!wSpace) {
        div.style.whiteSpace = "nowrap";
    }
    $doc.body.appendChild(div);
    width = div.offsetWidth;
    $doc.body.removeChild(div);
    div = null;
    return width;
};
ria.utils.measures.$setSizeWithAllAvailable = function (oHtml) {
    ria.utils.measures.$setHeightWithAllAvailable(oHtml);
    ria.utils.measures.$setWidthWithAllAvailable(oHtml);
};
ria.utils.measures.$setHeightWithAllAvailable = function (oHtml, delta) {
    if (!delta) {
        var delta = 0;
    }
    var borH = _rum.$$getBorderTopWidth(oHtml) + _rum.$$getBorderBottomWidth(oHtml);
    var heightCalc = _rum.$$getHeightInDoct(oHtml.parentNode, true) - delta - _rum.$getTop(oHtml) - borH;
    oHtml.style.height = Math.max(0, heightCalc);
    _rum.$setHeightConformW3C(oHtml);
    return heightCalc;
};
ria.utils.measures.$setWidthWithAllAvailable = function (oHtml, delta) {
    if (!delta) {
        var delta = 0;
    }
    var borW = _rum.$$getBorderLeftWidth(oHtml) + _rum.$$getBorderRightWidth(oHtml);
    var widthCalc = _rum.$$getWidthInDoct(oHtml.parentNode, true) - delta - _rum.$getLeft(oHtml) - borW;
    oHtml.style.width = Math.max(0, widthCalc);
    _rum.$setWidthConformW3C(oHtml);
    return widthCalc;
};
ria.utils.measures.$getTop = function (oHtml) {
    if (oHtml.offsetTop != null) {
        var wT = oHtml.offsetTop;
    } else {
        var wT = parseInt(oHtml.style.top);
    }
    if (window.getComputedStyle) {
        var h = oHtml;
        while (h.parentNode) {
            if (h.parentNode.style && h.parentNode.style.overflow) {
                wT += _rum.$$getBorderTopWidth(h.parentNode);
            }
            if (h.parentNode.style && rialto.lang.isStringIn(h.parentNode.style.position, ["absolute", "relative"])) {
                break;
            }
            h = h.parentNode;
        }
    }
    if (isNaN(wT)) {
        wT = 0;
    }
    return wT;
};
ria.utils.measures.$getLeft = function (oHtml) {
    if (oHtml.offsetLeft != null) {
        var wL = oHtml.offsetLeft;
    } else {
        var wL = parseInt(oHtml.style.left);
    }
    if (window.getComputedStyle) {
        var h = oHtml;
        while (h.parentNode) {
            if (h.parentNode.style && h.parentNode.style.overflow) {
                wL += _rum.$$getBorderLeftWidth(h.parentNode);
            }
            if (h.parentNode.style && rialto.lang.isStringIn(h.parentNode.style.position, ["absolute", "relative"])) {
                break;
            }
            h = h.parentNode;
        }
    }
    if (isNaN(wL)) {
        wL = 0;
    }
    return wL;
};
ria.utils.measures.$getHeight = function (oHtml, bBorderLess, bNotAlreadyInDoct) {
    if (bNotAlreadyInDoct) {
        alert("not yet implemented");
    } else {
        return ria.utils.measures.$$getHeightInDoct(oHtml, bBorderLess);
    }
};
ria.utils.measures.$$getHeightInDoct = function (oHtml, bBorderLess) {
    var wH;
    if (oHtml.nodeName == "BODY") {
        wH = document.body.clientHeight;
    } else {
        wH = oHtml.offsetHeight;
        if (wH == null || wH == 0) {
            wH = parseInt(oHtml.style.height);
            if (isNaN(wH)) {
                return 0;
            }
            if (bBorderLess) {
                if (window.getComputedStyle) {
                    wH = wH;
                } else {
                    wH = wH - ria.utils.measures.$$getBorderTopWidth(oHtml) - ria.utils.measures.$$getBorderBottomWidth(oHtml);
                }
            } else {
                if (window.getComputedStyle) {
                    wH = wH + ria.utils.measures.$$getBorderTopWidth(oHtml) + ria.utils.measures.$$getBorderBottomWidth(oHtml);
                } else {
                    wH = wH;
                }
            }
        } else {
            if (bBorderLess) {
                wH = wH - ria.utils.measures.$$getBorderTopWidth(oHtml) - ria.utils.measures.$$getBorderBottomWidth(oHtml);
            }
        }
    }
    return wH;
};
ria.utils.measures.$$getBorderTopWidth = function (oHtml) {
    if (!oHtml) {
        return 0;
    }
    if ((oHtml.nodeName == "BODY") || (oHtml.nodeName == "#document")) {
        return 0;
    }
    var topEdge = 0;
    if (!window.getComputedStyle) {
        if (((oHtml.style.borderTopStyle != "none") && (oHtml.style.borderTopStyle != "")) || (oHtml.currentStyle && (oHtml.currentStyle.borderTopStyle != "none") && (oHtml.currentStyle.borderTopStyle != ""))) {
            topEdge = parseInt(oHtml.style.borderTopWidth) || parseInt(oHtml.currentStyle.borderTopWidth);
        }
    } else {
        if ((window.getComputedStyle(oHtml, null).getPropertyValue("border-top-style") != "none") && (window.getComputedStyle(oHtml, null).getPropertyValue("border-top-style") != "")) {
            if (window.getComputedStyle(oHtml, null).getPropertyValue("border-top-width")) {
                topEdge = parseInt(window.getComputedStyle(oHtml, null).getPropertyValue("border-top-width"));
            }
        }
    }
    return topEdge;
};
ria.utils.measures.$$getBorderBottomWidth = function (oHtml) {
    if (!oHtml) {
        return 0;
    }
    if ((oHtml.nodeName == "BODY") || (oHtml.nodeName == "#document")) {
        return 0;
    }
    var bottomEdge = 0;
    if (!window.getComputedStyle) {
        if (((oHtml.style.borderBottomStyle != "none") && (oHtml.style.borderBottomStyle != "")) || (oHtml.currentStyle && (oHtml.currentStyle.borderBottomStyle != "none") && (oHtml.currentStyle.borderBottomStyle != ""))) {
            bottomEdge = parseInt(oHtml.style.borderBottomWidth) || parseInt(oHtml.currentStyle.borderBottomWidth);
        }
    } else {
        if ((window.getComputedStyle(oHtml, null).getPropertyValue("border-bottom-style") != "none") && (window.getComputedStyle(oHtml, null).getPropertyValue("border-bottom-style") != "")) {
            if (window.getComputedStyle(oHtml, null).getPropertyValue("border-bottom-width")) {
                bottomEdge = parseInt(window.getComputedStyle(oHtml, null).getPropertyValue("border-bottom-width"));
            }
        }
    }
    return bottomEdge;
};
ria.utils.measures.$$getBorderRightWidth = function (oHtml) {
    if (!oHtml) {
        return 0;
    }
    if ((oHtml.nodeName == "BODY") || (oHtml.nodeName == "#document")) {
        return 0;
    }
    var rightEdge = 0;
    if (!window.getComputedStyle) {
        if (((oHtml.style.borderRightStyle != "none") && (oHtml.style.borderRightStyle != "")) || (oHtml.currentStyle && (oHtml.currentStyle.borderRightStyle != "none") && (oHtml.currentStyle.borderRightStyle != ""))) {
            rightEdge = parseInt(oHtml.style.borderRightWidth) || parseInt(oHtml.currentStyle.borderRightWidth);
        }
    } else {
        if ((window.getComputedStyle(oHtml, null).getPropertyValue("border-right-style") != "none") && (window.getComputedStyle(oHtml, null).getPropertyValue("border-right-style") != "")) {
            if (window.getComputedStyle(oHtml, null).getPropertyValue("border-right-width")) {
                rightEdge = parseInt(window.getComputedStyle(oHtml, null).getPropertyValue("border-right-width"));
            }
        }
    }
    return rightEdge;
};
ria.utils.measures.$$getBorderLeftWidth = function (oHtml) {
    if (!oHtml) {
        return 0;
    }
    if ((oHtml.nodeName == "BODY") || (oHtml.nodeName == "#document")) {
        return 0;
    }
    var leftEdge = 0;
    if (!window.getComputedStyle) {
        if (((oHtml.style.borderLeftStyle != "none") && (oHtml.style.borderLeftStyle != "")) || (oHtml.currentStyle && (oHtml.currentStyle.borderLeftStyle != "none") && (oHtml.currentStyle.borderLeftStyle != ""))) {
            leftEdge = parseInt(oHtml.style.borderLeftWidth) || parseInt(oHtml.currentStyle.borderLeftWidth);
        }
    } else {
        if ((window.getComputedStyle(oHtml, null).getPropertyValue("border-left-style") != "none") && (window.getComputedStyle(oHtml, null).getPropertyValue("border-left-style") != "")) {
            if (window.getComputedStyle(oHtml, null).getPropertyValue("border-left-width")) {
                leftEdge = parseInt(window.getComputedStyle(oHtml, null).getPropertyValue("border-left-width"));
            }
        }
    }
    return leftEdge;
};
ria.utils.measures.$setHeightConformW3C = function (oHtml, oHtmlRef) {
    if (oHtmlRef) {
        if (window.getComputedStyle) {
            oHtml.style.height = _rum.$getHeight(oHtmlRef) - _rum.$$getBorderTopWidth(oHtml) - _rum.$$getBorderBottomWidth(oHtml);
        } else {
            oHtml.style.height = _rum.$getHeight(oHtmlRef);
        }
    } else {
        if (!window.getComputedStyle) {
            oHtml.style.height = _rum.$getHeight(oHtml) + ria.utils.measures.$$getBorderTopWidth(oHtml) + ria.utils.measures.$$getBorderBottomWidth(oHtml);
        }
    }
    return (parseInt(oHtml.style.height));
};
ria.utils.measures.$setWidthConformW3C = function (oHtml, oHtmlRef) {
    if (oHtmlRef) {
        if (window.getComputedStyle) {
            oHtml.style.width = _rum.$getWidth(oHtmlRef) - _rum.$$getBorderLeftWidth(oHtml) - _rum.$$getBorderRightWidth(oHtml);
        } else {
            oHtml.style.width = _rum.$getWidth(oHtmlRef);
        }
    } else {
        if (!window.getComputedStyle) {
            oHtml.style.width = _rum.$getWidth(oHtml) + ria.utils.measures.$$getBorderLeftWidth(oHtml) + ria.utils.measures.$$getBorderRightWidth(oHtml);
        }
    }
    return (parseInt(oHtml.style.width));
};
ria.utils.measures.$setSizeConformW3C = function (oHtml, oHtmlRef) {
    ria.utils.measures.$setHeightConformW3C(oHtml, oHtmlRef);
    ria.utils.measures.$setWidthConformW3C(oHtml, oHtmlRef);
};
ria.utils.measures.$getWidth = function (oHtml, bBorderLess, bNotAlreadyInDoct) {
    if (bNotAlreadyInDoct) {
        alert("not yet implemented, impossible with IE ?");
    } else {
        return ria.utils.measures.$$getWidthInDoct(oHtml, bBorderLess);
    }
};
ria.utils.measures.$$getWidthInDoct = function (oHtml, bBorderLess) {
    var wW;
    if (oHtml.nodeName == "BODY") {
        wW = document.body.clientWidth;
        if (rialto.config.userAgentIsIE && document.body.resize && document.body.over != "hidden") {
            wW -= 17;
        }
    } else {
        wW = oHtml.offsetWidth;
        if (wW == null || wW == 0) {
            wW = parseInt(oHtml.style.width);
            if (isNaN(wW)) {
                return 0;
            }
            if (bBorderLess) {
                if (window.getComputedStyle) {
                    wW = wW;
                } else {
                    wW = wW - ria.utils.measures.$$getBorderRightWidth(oHtml) - ria.utils.measures.$$getBorderLeftWidth(oHtml);
                }
            } else {
                if (window.getComputedStyle) {
                    wW = wW + ria.utils.measures.$$getBorderRightWidth(oHtml) + ria.utils.measures.$$getBorderLeftWidth(oHtml);
                } else {
                    wW = wW;
                }
            }
        } else {
            if (bBorderLess) {
                wW = wW - ria.utils.measures.$$getBorderRightWidth(oHtml) - ria.utils.measures.$$getBorderLeftWidth(oHtml);
            }
        }
    }
    return wW;
};
ria.utils.measures.$getStyle = function (oHtml, style) {
    var s;
    if (window.getComputedStyle) {
        s = window.getComputedStyle(oHtml, null)[style];
    } else {
        s = oHtml.style[style] || oHtml.currentStyle[style];
    }
    return s;
};
ria.utils.measures.$centerW = function (oHtml) {
    Pw = oHtml.parentNode.offsetWidth / 2;
    Ow = oHtml.offsetWidth / 2;
    oHtml.style.left = (Pw - Ow) + "px";
};
ria.utils.measures.$divInternalTopLeftInViewPort = ria.utils.measures.$internalPosInViewPort = function (oHtml) {
    var topLeftExtern = ria.utils.measures.$posInViewPort(oHtml);
    return {top:(topLeftExtern.top + _rum.$$getBorderTopWidth(oHtml)), left:(topLeftExtern.left + _rum.$$getBorderLeftWidth(oHtml))};
};
ria.utils.measures.$offsetTop = function (oHtml) {
    var wOffset;
    if (rialtoConfig.userAgentIsGecko && (oHtml.parentNode.nodeName != "BODY") && (oHtml.parentNode.nodeName != "#document")) {
        var parentEdgeWidth;
        if ((window.getComputedStyle(oHtml.parentNode, null).getPropertyValue("overflow") == "hidden") && ((parentEdgeWidth = ria.utils.measures.$$getBorderLeftWidth(oHtml.parentNode)) > 0)) {
            wOffset = oHtml.offsetTop + parentEdgeWidth;
        } else {
            wOffset = oHtml.offsetTop;
        }
    } else {
        wOffset = oHtml.offsetTop;
    }
    return wOffset;
};
ria.utils.measures.$offsetLeft = function (oHtml) {
    var wOffset;
    if (rialtoConfig.userAgentIsGecko && (oHtml.parentNode.nodeName != "BODY") && (oHtml.parentNode.nodeName != "#document")) {
        var parentEdgeWidth;
        if ((window.getComputedStyle(oHtml.parentNode, null).getPropertyValue("overflow") == "hidden") && ((parentEdgeWidth = ria.utils.measures.$$getBorderLeftWidth(oHtml.parentNode)) > 0)) {
            wOffset = oHtml.offsetLeft + parentEdgeWidth;
        } else {
            wOffset = oHtml.offsetLeft;
        }
    } else {
        wOffset = oHtml.offsetLeft;
    }
    return wOffset;
};
ria.utils.measures.$divTopLeftInViewPort = ria.utils.measures.$posInViewPort = function (oHtml) {
    traceExec("---- $divTopLeftInViewPort begin", 77);
    var x = y = 0;
    while (oHtml && (oHtml.nodeName != "BODY") && (oHtml.nodeName != "#document")) {
        x = x + ria.utils.measures.$offsetLeft(oHtml) + ria.utils.measures.$$getBorderLeftWidth(oHtml.parentNode) - oHtml.scrollLeft;
        y = y + ria.utils.measures.$offsetTop(oHtml) + ria.utils.measures.$$getBorderTopWidth(oHtml.parentNode) - oHtml.scrollTop;
        oHtml = oHtml.offsetParent;
    }
    return {left:x, top:y};
};
ria.utils.measures.$divTopLeftInDiv = function (oHtml) {
    var x = y = 0;
    x = ria.utils.measures.$offsetLeft(oHtml) + ria.utils.measures.$$getBorderLeftWidth(oHtml.parentNode);
    y = ria.utils.measures.$offsetTop(oHtml) + ria.utils.measures.$$getBorderTopWidth(oHtml.parentNode);
    return {left:x, top:y};
};
ria.utils.measures.$eventTopLeftInViewPort = function (e) {
    if (!e) {
        var e = window.event;
    }
    return {top:e.clientY, left:e.clientX};
};
ria.utils.measures.$eventTopLeftInDiv = ria.utils.measures.$offsetPosInDiv = function (e) {
    var oHtmlSource = (e.target ? e.target : e.srcElement);
    var left;
    if (e.offsetX != undefined) {
        left = e.offsetX + ria.utils.measures.$$getBorderLeftWidth(oHtmlSource);
    } else {
        left = e.layerX;
    }
    var top;
    if (e.offsetY != undefined) {
        top = e.offsetY + ria.utils.measures.$$getBorderTopWidth(oHtmlSource);
    } else {
        top = e.layerY;
    }
    return {top:top, left:left};
};
ria.utils.$placeInViewPort = function (oHtml, basePointSpecs, shift) {
    var top = (basePointSpecs.top != undefined) ? basePointSpecs.top : basePointSpecs.clientY;
    var left = (basePointSpecs.left != undefined) ? basePointSpecs.left : basePointSpecs.clientX;
    var heightAvailable = -1;
    var rightSpace = document.body.clientWidth - left;
    var bottomSpace = document.body.clientHeight - top;
    if (rightSpace < oHtml.offsetWidth) {
        oHtml.style.left = document.body.scrollLeft + left - oHtml.offsetWidth;
    } else {
        oHtml.style.left = document.body.scrollLeft + left;
    }
    if (oHtml.offsetHeight > bottomSpace) {
        if (oHtml.offsetHeight < (top - 3 - (shift || 0))) {
            oHtml.style.top = document.body.scrollTop + top - oHtml.offsetHeight - 3 - (shift || 0);
        } else {
            if (top > bottomSpace) {
                heightAvailable = top - 9 - (shift || 0);
                oHtml.style.top = document.body.scrollTop + 3;
            } else {
                heightAvailable = bottomSpace - 3;
                oHtml.style.top = document.body.scrollTop + top;
            }
        }
    } else {
        oHtml.style.top = document.body.scrollTop + top;
    }
    return heightAvailable;
};
_r = ria;
_ru = ria.utils;
_rum = ria.utils.measures;


function positionneSelonEvent(eltApos, e) {
    var droite = document.body.clientWidth - e.clientX;
    var bas = document.body.clientHeight - e.clientY;
    if (droite < eltApos.offsetWidth) {
        eltApos.style.left = document.body.scrollLeft + e.clientX - eltApos.offsetWidth;
    } else {
        eltApos.style.left = document.body.scrollLeft + e.clientX;
    }
    if (bas < eltApos.offsetHeight) {
        eltApos.style.top = document.body.scrollTop + e.clientY - eltApos.offsetHeight;
    } else {
        eltApos.style.top = document.body.scrollTop + e.clientY;
    }
}
function positionneSelonPosFournie(eltApos, top, left, height) {
    var heightAvailable = -1;
    var droite = document.body.clientWidth - left;
    var bas = document.body.clientHeight - top;
    if (droite < eltApos.offsetWidth) {
        eltApos.style.left = document.body.scrollLeft + left - eltApos.offsetWidth;
    } else {
        eltApos.style.left = document.body.scrollLeft + left;
    }
    traceExec("top= " + top + " bas= " + bas + " eltApos.offsetHeight= " + eltApos.offsetHeight, 1);
    if (eltApos.offsetHeight > bas) {
        if (eltApos.offsetHeight < top) {
            eltApos.style.top = document.body.scrollTop + top - eltApos.offsetHeight - 3 - (height || 0);
        } else {
            if (top > bas) {
                heightAvailable = top - 9 - (height || 0);
                eltApos.style.top = 3;
            } else {
                heightAvailable = bas - 3;
                eltApos.style.top = document.body.scrollTop + top;
            }
        }
    } else {
        eltApos.style.top = document.body.scrollTop + top;
    }
    return heightAvailable;
}
pixWidth = function (oHtml, sansBordure) {
    if (oHtml.pixWidth) {
        return oHtml.pixWidth();
    }
    var prc = 1;
    var nd = oHtml;
    var percent = true;
    var nivRemontee = 0;
    do {
        if (nd.nodeName == "BODY") {
            return (prc * parseInt(document.body.clientWidth));
        }
        var ndstyle = nd.currentStyle ? nd.currentStyle : nd.style;
        var taille = ndstyle.width;
        if (taille == "auto") {
            i = 1;
            taille = 100;
        } else {
            i = ndstyle.width.indexOf("%");
        }
        if (i == -1) {
            percent = false;
        } else {
            prc = prc * parseInt(taille) / 100;
            nivRemontee += 1;
        }
    } while (percent && (nd = nd.parentNode));
    if ((nivRemontee > 0) && (ndstyle.borderStyle != "none") && (ndstyle.borderStyle != "")) {
        tailleBord = parseInt(ndstyle.borderWidth);
    } else {
        tailleBord = 0;
    }
    if (sansBordure) {
        if (parseInt(oHtml.style.borderWidth)) {
            tailleBord += parseInt(oHtml.style.borderWidth);
        }
    }
    return (prc * (parseInt(taille) - tailleBord * 2));
};
pixHeight = function (oHtml, sansBordure) {
    traceExec("pixHeight entree sansBordure= " + sansBordure, 20);
    if (sansBordure && (!window.getComputedStyle)) {
        sansBordure = true;
    } else {
        sansBordure = false;
    }
    traceExec("pixHeightsansBordure= " + sansBordure, 20);
    var taille, tailleBord = 0;
    var prc = 1;
    if (!oHtml) {
        alert("ds pixHeight argt  oHtml undef");
    }
    if (oHtml.pixHeight) {
        traceExec("pixHeight utilisation de la fct surcharg?e pour oHtml.id= " + oHtml.id, 20);
        taille = oHtml.pixHeight();
    } else {
        var nd = oHtml;
        var percent = true;
        var nivRemontee = 0;
        do {
            if (nd.nodeName == "BODY") {
                taille = document.body.clientHeight;
                percent = false;
                traceExec("pixHeight  body sortie", 1);
            } else {
                traceExec("pixHeight nd.id=" + nd.id + " taille= " + getComputStyleStr(nd, "height"), 20);
                var taille = getComputStyleStr(nd, "height");
                if (taille == "auto") {
                    i = 1;
                    taille = 100;
                } else {
                    i = taille.indexOf("%");
                }
                if (i == -1) {
                    percent = false;
                } else {
                    prc = prc * parseInt(taille) / 100;
                    nivRemontee += 1;
                    traceExec("nivRemontee = " + nivRemontee, 20);
                }
                if (sansBordure) {
                    tailleBord += getBorderWidth(nd);
                }
            }
        } while (percent && (nd = nd.parentNode));
    }
    traceExec("pixHeight nivRemontee= " + nivRemontee + " prc= " + prc + " taille= " + taille + " tailleBord= " + tailleBord, 20);
    traceExec("pixHeight sortie", 20);
    return (prc * (parseInt(taille) - tailleBord * 2));
};
compOffsetParent = function (oHtml) {
    var offsetTop = 0;
    while (oHtml) {
        offsetTop += oHtml.offsetTop;
        oHtml = oHtml.offsetParent;
    }
    return offsetTop;
};
compOffsetTop = function (oHtml) {
    var offsetTop = 0;
    var scrollTop = 0;
    var h = oHtml;
    while (h) {
        offsetTop += h.offsetTop;
        h = h.offsetParent;
    }
    h = oHtml;
    while (h && h.scrollTop != null) {
        scrollTop += h.scrollTop;
        h = h.parentNode;
    }
    return offsetTop - scrollTop;
};
compOffsetLeft = function (oHtml) {
    var offsetLeft = 0;
    var scrollLeft = 0;
    var h = oHtml;
    while (h) {
        offsetLeft += h.offsetLeft;
        h = h.offsetParent;
    }
    h = oHtml;
    while (h != document.body) {
        scrollLeft += h.scrollLeft;
        h = h.parentNode;
    }
    return offsetLeft - scrollLeft;
};
compOffsetHeight = function (oHtml) {
    var offsetHeight = 0;
    while (oHtml) {
        offsetHeight += oHtml.offsetHeight;
        oHtml = oHtml.offsetParent;
    }
    return offsetHeight;
};
pixTop = function (oHtml) {
    var prc = 1;
    var nd = oHtml;
    var percent = true;
    var i;
    i = nd.style.top.indexOf("%");
    if (i == -1) {
        percent = false;
    } else {
        prc = prc * parseInt(nd.style.top) / 100;
    }
    return ((prc == 1) ? (parseInt(nd.style.top) || 0) : (prc * pixHeight(nd)));
};
pixLeft = function (oHtml) {
    var prc = 1;
    var nd = oHtml;
    var percent = true;
    i = nd.style.left.indexOf("%");
    if (i == -1) {
        percent = false;
    } else {
        prc = prc * parseInt(nd.style.left) / 100;
    }
    return ((prc == 1) ? (parseInt(nd.style.left) || 0) : (prc * pixWidth(nd)));
};
nvPixLeft = function (oHtml) {
    var prc;
    i = oHtml.style.left.indexOf("%");
    if (i == -1) {
        prc = 1;
    } else {
        prc = parseInt(oHtml.style.left) / 100;
    }
    return ((prc == 1) ? (parseInt(oHtml.style.left) || 0) : (prc * pixWidth(oHtml.parentNode)));
};
oldpixTop = function (oHtml) {
    var prc = 1;
    var nd = oHtml;
    var percent = true;
    var i;
    do {
        i = nd.style.top.indexOf("%");
        if (i == -1) {
            percent = false;
        } else {
            prc = prc * parseInt(nd.style.top) / 100;
        }
    } while (percent && (nd = nd.parentNode));
    return ((prc == 1) ? (parseInt(nd.style.top) || 0) : (prc * parseInt(nd.style.height)));
};
oldpixLeft = function (oHtml) {
    var prc = 1;
    var nd = oHtml;
    var percent = true;
    do {
        i = nd.style.left.indexOf("%");
        if (i == -1) {
            percent = false;
        } else {
            prc = prc * parseInt(nd.style.left) / 100;
        }
    } while (percent && (nd = nd.parentNode));
    return ((prc == 1) ? (parseInt(nd.style.left) || 0) : (prc * parseInt(nd.style.width)));
};


function SingletonCD(contexte) {
    if (contexte) {
        if (this.constructor.prototype.nbInstances == undefined) {
            this.constructor.prototype.nbInstances = new Array;
        }
        if (this.constructor.prototype.nbInstances[contexte] == undefined) {
            this.constructor.prototype.nbInstances[contexte] = 0;
        }
        if (this.constructor.prototype.nbInstances[contexte] != 0) {
            return rialto.session.objects.singletonCDs[contexte];
        } else {
            this.constructor.prototype.nbInstances[contexte]++;
            if (rialto.session.objects == undefined) {
                rialto.session.objects = new Object;
            }
            if (rialto.session.objects.singletonCDs == undefined) {
                rialto.session.objects.singletonCDs = new Array;
            }
            if (rialto.session.objects.singletonCDs[contexte] == undefined) {
                rialto.session.objects.singletonCDs[contexte] = new Object;
            }
            rialto.session.objects.singletonCDs[contexte] = this;
            return null;
        }
    } else {
        if (this.constructor.prototype.nbInstances == undefined) {
            this.constructor.prototype.nbInstances = 0;
        }
        if (this.constructor.prototype.nbInstances != 0) {
            return rialto.session.objects[this];
        } else {
            this.constructor.prototype.nbInstances++;
            if (rialto.sessionw.objects == undefined) {
                rialto.session.objects = new Array;
            }
            rialto.session.objects[this] = this;
            return null;
        }
    }
}
function recupSingletonCD(ctxt) {
    return "this.recupInst = SingletonCD;  this.recupInst('" + ctxt + "'); ";
}
function recupSingleton() {
    return "this.recupInst = SingletonCD;  this.recupInst(); ";
}
function classTestCD(ctxt) {
    alert("ctxt= " + ctxt);
    if (instanceUnique = eval(recupSingletonCD(ctxt))) {
        return instanceUnique;
    }
    alert("creation de l' unique objet, instance de classTestCD dans le contexte " + ctxt);
    this.id = "ID_InstanceUniqueClassTestCD_" + ctxt;
}
function classTestCD2(ctxt) {
    this.recupInst = SingletonCD;
    if (instDejaCree = this.recupInst(ctxt)) {
        return instDejaCree;
    }
    alert("creation de l' unique objet, instance de classTestCD2 dans le contexte " + ctxt);
    this.id = "ID_instanceUniqueClassTestCD2_" + ctxt;
}
classTestCD.prototype = new classTestCD3;
function classTestCD3() {
    this.attr1 = "essai derivation";
}


function getComputStyleIf(oHtml, dim, def) {
    if (!oHtml || (!window.getComputedStyle && !oHtml.currentStyle) || (getComputStyleStr(oHtml, "display") == "none")) {
        return 0;
    } else {
        return getComputStyle(oHtml, dim, def);
    }
}
function getComputStyle(oHtml, dim, def) {
    if (def) {
        return (window.getComputedStyle) ? parseInt(window.getComputedStyle(oHtml, null)[dim] || def) : parseInt(oHtml.currentStyle[dim] || def);
    } else {
        return (window.getComputedStyle) ? parseInt(window.getComputedStyle(oHtml, null)[dim]) : parseInt(oHtml.currentStyle[dim]);
    }
}
function getComputStyleStr(oHtml, dim, def) {
    if (def) {
        return (window.getComputedStyle ? window.getComputedStyle(oHtml, null)[dim] || def : oHtml.currentStyle[dim] || def);
    } else {
        return (window.getComputedStyle ? window.getComputedStyle(oHtml, null)[dim] : oHtml.currentStyle[dim]);
    }
}
getBorderStyle = function (oHtml) {
    var bBorder;
    if (!window.getComputedStyle) {
        traceExec("nd.currentStyle.borderWidth = " + oHtml.currentStyle.borderWidth, 20);
        bBorder = ((getComputStyleStr(oHtml, "borderStyle") != "none") && (getComputStyleStr(oHtml, "borderStyle") != ""));
        traceExec("getComputStyleStr(oHtml,borderStyle)= " + getComputStyleStr(oHtml, "borderStyle"), 20);
    } else {
        bBorder = (getComputStyle(oHtml, "borderTopWidth") != 0);
    }
    traceExec("getBorderStyle= " + bBorder, 20);
    return bBorder;
};
getBorderWidth = function (oHtml) {
    return (window.getComputedStyle) ? parseInt(window.getComputedStyle(oHtml, null)["borderTopWidth"]) : getBorderStyle(oHtml) ? parseInt(oHtml.currentStyle["borderWidth"]) : 0;
};
borderIfNecess = function (oHtml) {
    return ((window.getComputedStyle) ? (parseInt(window.getComputedStyle(oHtml, null)["borderTopWidth"]) + parseInt(window.getComputedStyle(oHtml, null)["borderBottomWidth"])) : 0);
};


rialto.utils.DataManager = {saveInCookie:function (key, content) {
    document.cookie = key + "=;";
    try {
        var dateToDay = rialto.date.today();
        var dateplusUnAn = rialto.date.add("year", dateToDay, 1);
        document.cookie = key + "=" + escape(content) + ";expires=" + dateplusUnAn.toGMTString();
    }
    catch (err) {
        console.error(err.message);
    }
}, loadInCookie:function (key) {
    var value = "";
    var strCherher = key + "=";
    if (document.cookie.length > 0) {
        place = document.cookie.indexOf(strCherher);
        if (place != -1) {
            debut = place + strCherher.length;
            fin = document.cookie.indexOf(";", debut);
            if (fin == -1) {
                fin = document.cookie.length;
            }
            value = document.cookie.substring(debut, fin);
        }
    }
    return unescape(value);
}, getFileName:function (filePath) {
    var fileName = null;
    var ind = filePath.lastIndexOf("\\");
    if (ind != -1) {
        fileName = filePath.substr(ind + 1);
    } else {
        fileName = filePath;
    }
    return fileName;
}, saveInFile:function (content, filePath) {
    var satus = null;
    if (rialtoConfig.userAgentIsIE) {
        status = this.IESaveFile(content, filePath);
    } else {
        if (rialtoConfig.userAgentIsGecko) {
            status = this.FFSaveFile(content, filePath);
        }
    }
    return status;
}, IESaveFile:function (content, filePath) {
    try {
        var fso = new ActiveXObject("Scripting.FileSystemObject");
    }
    catch (e) {
        console.error("Exception while attempting to save\n\n" + e.toString());
        return (null);
    }
    var file = fso.OpenTextFile(filePath, 2, -1, 0);
    file.Write(content);
    file.Close();
    return (true);
}, FFSaveFile:function (content, filePath) {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    if (!filePath) {
        file = this.FxChoiceFile();
    } else {
        var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
        file.initWithPath(filePath);
    }
    if (window.Components) {
        try {
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            if (file.exists()) {
            } else {
                file.create(0, 436);
            }
            var out = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
            out.init(file, 32 | 2, 4, null);
            out.write(content, content.length);
            out.flush();
            out.close();
            return (true);
        }
        catch (e) {
            console.error("Exception while attempting to save\n\n" + e);
            return (false);
        }
    }
    return (null);
}, loadFile:function (filePath) {
    var content = null;
    if (rialtoConfig.userAgentIsIE) {
        content = this.IELoadFile(filePath);
    } else {
        if (rialtoConfig.userAgentIsGecko) {
            content = this.FFLoadFile(filePath);
        }
    }
    return content;
}, IELoadFile:function (filePath) {
    try {
        var fso = new ActiveXObject("Scripting.FileSystemObject");
        var file = fso.OpenTextFile(filePath, 1);
        var content = file.ReadAll();
        file.Close();
    }
    catch (e) {
        return (null);
    }
    return (content);
}, FFLoadFile:function (filePath) {
    if (window.Components) {
        try {
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
            file.initWithPath(filePath);
            if (!file.exists()) {
                return (null);
            }
            var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
            inputStream.init(file, 1, 4, null);
            var sInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
            sInputStream.init(inputStream);
            return (sInputStream.read(sInputStream.available()));
        }
        catch (e) {
            return (false);
        }
    }
    return (null);
}, FxChoiceFile:function (initialDirectory) {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    var nsIFilePicker = Components.interfaces.nsIFilePicker;
    var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
    fp.init(window, "Select or create a file", nsIFilePicker.modeOpen);
    fp.appendFilters(nsIFilePicker.filterAll | nsIFilePicker.filterText);
    var rv = fp.show();
    if (rv == nsIFilePicker.returnOK) {
        alert(fp.file);
        return fp.file;
    } else {
        return null;
    }
}};


rialto.utils.RialtoWriter = function (objPar) {
    this.stringBuffer = new Array;
};
rialto.utils.RialtoWriter.prototype.createFunction = function (name, bExecute) {
    try {
        if (!name) {
            var name = "myFunct";
        }
        eval(name + "=function(){" + this.stringBuffer.join("") + "}");
        if (bExecute) {
            eval(name + "();");
        }
    }
    catch (e) {
        alert("erreur:" + e.message);
    }
    this.stringBuffer = new Array;
};
rialto.utils.RialtoWriter.prototype.getJavascriptCall = function () {
    var str = this.stringBuffer.join("\n");
    this.stringBuffer = new Array;
    return str;
};
rialto.utils.RialtoWriter.prototype.loadComponents = function (xmlDesc, withThisKeyWord) {
    if (rialto.lang.isString(xmlDesc)) {
        xmlDesc = rialto.utils.xml.createDocumentFromString(xmlDesc);
    }
    this.xmlDoc = rialto.utils.xml.getByTagName("rialto", xmlDesc)[0];
    this.topParent = this.xmlDoc.getAttribute("topParent");
    if (!this.topParent) {
        this.topParent = "document.body";
    }
    for (var i = 0; i < this.xmlDoc.childNodes.length; i++) {
        this.loadOneComponent(this.xmlDoc.childNodes[i], this.topParent, withThisKeyWord);
    }
};
rialto.utils.RialtoWriter.prototype.loadOneComponent = function (node, parent, withThisKeyWord) {
    try {
        var nodeName = node.nodeName;
        var objAttr = rialto.utils.xml.parseAttribute(node);
        objAttr.parent = parent;
        var objectName = objAttr.name;
        var strHeader = "";
        if (withThisKeyWord) {
            strHeader = "this." + objectName + "=";
        } else {
            if (objectName) {
                strHeader = "var " + objectName + "=";
            }
        }
        switch (nodeName) {
          case "alert":
            var lookAttribute = {message:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + "new rialto.widget.Alert(" + str + ");");
            break;
          case "button":
            var lookAttribute = {top:"", left:"", title:"", alt:"", parent:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + "new rialto.widget.Button(" + str + ");");
            break;
          case "checkbox":
            var lookAttribute = {name:"", top:"", left:"", parent:"", text:"", checked:"", className:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + "new rialto.widget.Checkbox(" + str + ");");
            break;
          case "codeLabel":
            var lookAttribute = {name:"", top:"", left:"", width:"", parent:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + "new rialto.widget.codeLabel(" + str + ");");
            break;
          case "comboItem":
            this.stringBuffer.push(parent + ".addItem(\"" + objAttr.value + "\",\"" + objAttr.text + "\");");
            if (objAttr.selected) {
                this.stringBuffer.push(parent + ".selWithText(\"" + objAttr.text + "\");");
            }
            break;
          case "combo":
            var lookAttribute = {tabData:"", name:"", top:"", left:"", width:"", parent:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + "new rialto.widget.Combo(" + str + ");");
            break;
          case "divHtml":
            var str = rialto.utils.xml.innerNode(node);
            var bodyStr = str.split("\n");
            this.stringBuffer.push("var strHTML=\"\";\n");
            for (var i = 0; i < bodyStr.length; i++) {
                var str = rialto.string.replace(bodyStr[i], "\"", "'");
                this.stringBuffer.push("strHTML+=\"" + str + "\";\n");
            }
            this.stringBuffer.push("var " + objectName + "=document.createElement('DIV');");
            this.stringBuffer.push(objectName + ".innerHTML=strHTML;");
            this.stringBuffer.push("if(" + parent + ".add){" + parent + ".add(" + objectName + ")}else{" + parent + ".appendChild(" + objectName + ")};");
            return;
          case "javascript":
            var str = rialto.utils.xml.innerNode(node);
            var bodyStr = str.split("\n");
            for (var i = 0; i < bodyStr.length; i++) {
                this.stringBuffer.push(bodyStr[i] + "\n");
            }
            return;
          case "form":
            var lookAttribute = {name:"", url:"", parent:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + "new rialto.widget.Form(" + str + ");");
            break;
          case "frame":
            var str = this.parseAttributeToString(objAttr);
            this.stringBuffer.push(strHeader + "new rialto.widget.Frame(" + str + ");");
            break;
          case "grid":
            var gridInit = this.loadGridChild(node);
            if (!objAttr.TabEntete) {
                objAttr.TabEntete = gridInit.tabEntete;
                objAttr.tabTypeCol = gridInit.tabTypeCol;
            }
            var str = this.parseAttributeToString(objAttr);
            this.stringBuffer.push(strHeader + "new rialto.widget.Grid(" + str + ");");
            if (gridInit.tabData.length > 0) {
                this.stringBuffer.push(objectName + ".fillGrid(" + rialto.array.arrayToString(gridInit.tabData) + ");");
            }
            return;
          case "gridTree":
            var gridInit = this.loadGridChild(node);
            if (!objAttr.TabEntete) {
                objAttr.TabEntete = gridInit.tabEntete;
                objAttr.tabTypeCol = gridInit.tabTypeCol;
            }
            var str = this.parseAttributeToString(objAttr);
            this.stringBuffer.push(strHeader + "new rialto.widget.GridTree(" + str + ");");
            return;
          case "image":
            var lookAttribute = {imageOut:"", left:"", top:"", parent:"", alt:"", imageOn:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + "new rialto.widget.Image(" + str + ");");
            break;
          case "label":
            var lookAttribute = {name:"", top:"", left:"", parent:"", text:"", className:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + "new rialto.widget.Label(" + str + ");");
            break;
          case "popup":
            var lookAttribute = {name:"", top:"", left:"", width:"", height:"", contenu:"", title:"", fond:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + "new rialto.widget.PopUp(" + str + ");");
            break;
          case "radio":
            var lookAttribute = {name:"", top:"", left:"", parent:"", group:"", text:"", checked:"", className:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + "new rialto.widget.Radio(" + str + ");");
            break;
          case "splitter":
            var str = this.parseAttributeToString(objAttr);
            this.stringBuffer.push(strHeader + "new rialto.widget.Splitter(" + str + ");");
            break;
          case "divSplitter":
            var arrDivSplitChild = rialto.utils.xml.getByTagName("divSplitter", node.parentNode);
            var index = rialto.array.indexOf(arrDivSplitChild, node) + 1;
            var objectName = parent + ".div" + index;
            var str = this.parseAttributeToString(objAttr);
            if (objAttr.backgroundColor) {
                this.stringBuffer.push(objectName + ".style.backgroundColor='" + objAttr.backgroundColor + "';");
            }
            break;
          case "tabfolder":
            var str = this.parseAttributeToString(objAttr);
            this.stringBuffer.push(strHeader + "new rialto.widget.TabFolder(" + str + ");");
            break;
          case "tabitem":
            var lookAttribute = {title:"", enable:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + parent + ".addTabItem(" + str + ");");
            break;
          case "text":
            var lookAttribute = {name:"", top:"", left:"", width:"", datatype:"", parent:""};
            var str = this.parseAttributeToString(objAttr, lookAttribute);
            this.stringBuffer.push(strHeader + "new rialto.widget.Text(" + str + ");");
            break;
          case "treeview":
            var str = this.parseAttributeToString(objAttr);
            this.stringBuffer.push(strHeader + "new rialto.widget.Tree(" + str + ");");
            break;
          case "treenode":
            objAttr.parent = null;
            var str = this.parseAttributeToString(objAttr);
            this.stringBuffer.push(strHeader + "new rialto.widget.TreeNode(" + str + ");");
            this.stringBuffer.push(parent + ".addNode(" + objectName + ");");
            break;
          case "simpleWindow":
            objAttr.top = 0;
            objAttr.left = 0;
            var str = this.parseAttributeToString(objAttr);
            this.stringBuffer.push(strHeader + "new rialto.widget.SimpleWindow(" + str + ");");
            break;
          default:
        }
        for (var i = 0; i < node.childNodes.length; i++) {
            this.loadOneComponent(node.childNodes[i], objectName);
        }
    }
    catch (e) {
        alert("erreur:" + e.message + "\nnodeName:" + nodeName);
    }
};
rialto.utils.RialtoWriter.prototype.parseAttributeToString = function (objAttr, lookAttribute) {
    var str = "";
    var attValue = "";
    if (lookAttribute) {
        for (var prop in lookAttribute) {
            attValue = "";
            if (objAttr[prop]) {
                attValue = objAttr[prop];
            }
            if (attValue == "true" || attValue == "false" || rialto.lang.isBoolean(attValue) || rialto.lang.isNumber(attValue) || prop == "parent") {
                str += attValue + ",";
            } else {
                if (rialto.lang.isString(attValue)) {
                    attValue = attValue.replace(new RegExp("\\\\", "g"), "\\\\").replace(new RegExp("\"", "g"), "\\\"");
                }
                str += "\"" + attValue + "\",";
            }
        }
    }
    str += "{";
    for (var prop in objAttr) {
        attValue = objAttr[prop];
        if (rialto.lang.isArray(attValue)) {
            str += prop + ":" + rialto.array.arrayToString(attValue) + ",";
        } else {
            if (attValue == "true" || attValue == "false" || rialto.lang.isBoolean(attValue) || rialto.lang.isNumber(attValue) || prop == "parent" || attValue.indexOf("[") != -1) {
                str += prop + ":" + attValue + ",";
            } else {
                if (rialto.lang.isString(attValue)) {
                    attValue = attValue.replace(new RegExp("\\\\", "g"), "\\\\").replace(new RegExp("\"", "g"), "\\\"");
                }
                str += prop + ":\"" + attValue + "\",";
            }
        }
    }
    str = str.substr(0, str.length - 1) + "}";
    return str;
};
rialto.utils.RialtoWriter.prototype.loadGridChild = function (node) {
    var gridInit = {tabEntete:new Array(), tabTypeCol:new Array(), tabData:new Array()};
    for (var i = 0; i < node.childNodes.length; i++) {
        var childG = node.childNodes[i];
        var nodeName = childG.nodeName;
        if (nodeName == "gridHeader") {
            var objAttr = rialto.utils.xml.parseAttribute(childG);
            gridInit.tabEntete.push(objAttr.title);
            gridInit.tabTypeCol.push([objAttr.type, objAttr.width]);
        } else {
            if (nodeName == "gridLine") {
                var tabLine = new Array;
                for (var j = 0; j < childG.childNodes.length; j++) {
                    var childC = childG.childNodes[j];
                    nodeName = childC.nodeName;
                    if (nodeName == "gridCell") {
                        var objAttr = rialto.utils.xml.parseAttribute(childC);
                        tabLine.push(objAttr.value);
                    }
                }
                gridInit.tabData.push(tabLine);
            }
        }
    }
    return gridInit;
};


rialto.utils.xml = {getByTagName:function (name, node) {
    return node.getElementsByTagName(name);
}, parseAttribute:function (node) {
    var objAttr = {};
    if (node.attributes) {
        for (var i = 0; i < node.attributes.length; i++) {
            var attValue = node.attributes[i].value;
            var attName = node.attributes[i].name;
            objAttr[attName] = attValue;
        }
    }
    return objAttr;
}, parseObjectAsAttribute:function (objAttr) {
    var strXML = "";
    for (prop in objAttr) {
        if (objAttr[prop] != "") {
            if (rialto.lang.isArray(objAttr[prop])) {
                strXML += " " + prop + "=\"" + rialto.array.arrayToString(objAttr[prop]) + "\"";
            } else {
                if (rialto.lang.isString(objAttr[prop])) {
                    strXML += " " + prop + "=\"" + objAttr[prop].replace(new RegExp("&", "g"), "&amp;").replace(new RegExp("\"", "g"), "&quot;").replace(new RegExp("<", "g"), "&lt;") + "\"";
                } else {
                    strXML += " " + prop + "=\"" + objAttr[prop] + "\"";
                }
            }
        }
    }
    return strXML;
}, outerNode:function (node) {
    if (node.xml) {
        return node.xml;
    } else {
        if (typeof XMLSerializer != "undefined") {
            return (new XMLSerializer()).serializeToString(node);
        }
    }
}, innerNode:function (node) {
    var str = this.outerNode(node);
    var nameLength = node.nodeName.length;
    var start = str.indexOf(">");
    var end = str.lastIndexOf("<") - 1;
    return str.substr(start + 1, end - start);
}, createDocument:function (url, onload, obj) {
    var xmlDoc = null;
    var onLoadFunc = null;
    if (onload) {
        if (obj) {
            onLoadFunc = rialto.lang.link(obj, onload);
        } else {
            onLoadFunc = onload;
        }
    }
    if (document.implementation && document.implementation.createDocument) {
        xmlDoc = document.implementation.createDocument("", "", null);
        if (onLoadFunc) {
            xmlDoc.onload = onLoadFunc;
        }
    } else {
        if (window.ActiveXObject) {
            xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
            if (onLoadFunc) {
                xmlDoc.onreadystatechange = function () {
                    if (xmlDoc.readyState == 4) {
                        onLoadFunc();
                    }
                };
            }
        }
    }
    if (url) {
        xmlDoc.load(url);
    }
    return xmlDoc;
}, createDocumentFromString:function (str) {
    if (window.DOMParser) {
        var parser = new DOMParser();
        return parser.parseFromString(str, "text/xml");
    } else {
        if (window.ActiveXObject) {
            var xmlDoc = this.createDocument();
            if (xmlDoc) {
                xmlDoc.async = false;
                xmlDoc.loadXML(str);
                return xmlDoc;
            }
        }
    }
    return null;
}, XSLTransform:function (xslDoc, xmlDoc) {
    if (window.XSLTProcessor) {
        var proc = new XSLTProcessor();
        proc.importStylesheet(xslDoc);
        var newDoc = proc.transformToDocument(xmlDoc);
    } else {
        var newDoc = xmlDoc.transformNode(xslDoc);
    }
    return newDoc;
}};


rialto.url = {getUrl:function () {
    return window.location;
}, getSearch:function () {
    return window.location.search;
}, getObjectParameter:function () {
    var sPar = this.getSearch();
    var arrPar = {};
    if (sPar.length > 1) {
        sPar = sPar.substring(1, sPar.length);
        var arrTemp = sPar.split("&");
        for (var i = 0; i < arrTemp.length; i++) {
            var arrPair = arrTemp[i].split("=");
            arrPar[arrPair[0]] = arrPair[1];
        }
    }
    return arrPar;
}, getArrayParameter:function () {
    var sPar = this.getSearch();
    var arrPar = new Array;
    if (sPar.length > 1) {
        sPar = sPar.substring(1, sPar.length);
        var arrTemp = sPar.split("&");
        for (var i = 0; i < arrTemp.length; i++) {
            var arrPair = arrTemp[i].split("=");
            arrPar.push(arrPair);
        }
    }
    return arrPar;
}};


rialto.widget.decoration = function (style, parent, classname) {
    this.style = "";
    this.classname = "";
    if (rialto.lang.isStringIn(style, ["popup", "simplewindow", "splitter", "calendar", "frame"])) {
        this.style = "_" + style;
    }
    if (rialto.lang.isString(classname)) {
        this.classname = classname;
    }
    this.id = this.style + "_decoration_" + (rialto.widget.AbstractComponent.prototype.nbreInstance++);
    var str = "<TABLE class=\"decoration_table" + this.style + "\" height=\"100%\" cellSpacing=0 cellPadding=0 width=\"100%\" border=0>";
    str += "<TBODY>";
    str += "<TR class='line1" + this.style + "'>";
    str += "<TD class='line1Cell1" + this.style + "'></TD>";
    str += "<TD colspan='3' class='line1Cell2" + this.style + "' ></TD>";
    str += "<TD class='line1Cell3" + this.style + "'></TD>";
    str += "</TR>";
    str += "<TR class='line2" + this.style + "'>";
    str += "<TD class='line2Cell1" + this.style + "'></TD>";
    str += "<TD colspan='3' class='line2Cell2" + this.style + "' >";
    str += "<TABLE  height=\"100%\" cellSpacing=0 cellPadding=0 width=\"100%\" border=0>";
    str += "<TBODY>";
    str += "<TR>";
    str += "<TD id='" + this.id + "_DIVICONG'></TD>";
    str += "<TD colspan='3' id='" + this.id + "_DIVTITLE'></TD>";
    str += "<TD id='" + this.id + "_DIVICOND'></TD>";
    str += "</TR>";
    str += "</TBODY>";
    str += "</TABLE>";
    str += "</TD>";
    str += "<TD class='line2Cell3" + this.style + "'></TD>";
    str += "</TR>";
    str += "<TR class='line3" + this.style + "'>";
    str += "<TD class='line3Cell1" + this.style + "'></TD>";
    str += "<TD colspan='3' class='line3Cell2" + this.style + "' ></TD>";
    str += "<TD class='line3Cell3" + this.style + "'></TD>";
    str += "</TR>";
    str += "<TR class='line4" + this.style + "'>";
    str += "<TD class='line4Cell1" + this.style + "'></TD>";
    str += "<TD colspan='3' class='line4Cell2" + this.style + "' ></TD>";
    str += "<TD class='line4Cell3" + this.style + "'></TD>";
    str += "</TR>";
    str += "<TR class='line5" + this.style + "'>";
    str += "<TD class='line5Cell1" + this.style + "'></TD>";
    str += "<TD colspan='3' class='line5Cell2" + this.style + "' ></TD>";
    str += "<TD class='line5Cell3" + this.style + "'></TD>";
    str += "</TR>";
    str += "</TBODY>";
    str += "</TABLE>";
    this.tDecor = document.createElement("DIV");
    this.tDecor.innerHTML = str;
    var tableStyle = this.tDecor.style;
    tableStyle.top = 0;
    tableStyle.left = 0;
    tableStyle.width = "100%";
    tableStyle.height = "100%";
    tableStyle.position = "absolute";
    parent.appendChild(this.tDecor);
    this.DivIconG = document.getElementById(this.id + "_DIVICONG");
    if (this.DivIconG) {
        this.DivIconG.className = this.getCssRuleName("iconG" + this.style);
    }
    this.DivIconD = document.getElementById(this.id + "_DIVICOND");
    if (this.DivIconD) {
        this.DivIconD.className = this.getCssRuleName("iconD" + this.style);
    }
    this.DivTitle = document.getElementById(this.id + "_DIVTITLE");
    if (this.DivTitle) {
        this.DivTitle.className = this.getCssRuleName("title" + this.style);
    }
};
rialto.widget.decoration.prototype.getCssRuleName = function (ruleName) {
    return this.classname != "" ? ruleName + " " + this.classname + ruleName : ruleName;
};


rialto.skin = {skins:new Array, currentSkin:"", initSkin:function () {
    this.currentSkin = rialtoConfig.skin ? rialtoConfig.skin : "defaultSkin";
    document.getElementById(this.currentSkin).disabled = false;
}, registerSkin:function (skin) {
    this.skins.push(skin);
}, setSkin:function (skin) {
    document.getElementById(this.currentSkin).disabled = true;
    this.currentSkin = skin;
    document.getElementById(this.currentSkin).disabled = false;
}};


ria.utils.event.keyPressHandler = function (oHtml) {
    this.oHtml = oHtml;
    this.event = ria.utils.event.genericAddEvent(oHtml, "keypress", this._onkeyPress, this);
    this._asciinotok = new Array;
};
ria.utils.event.keyPressHandler.prototype = {_asciiok:[8, 9, 16, 17, 18, 36, 37, 39, 46, 92, 93, 112, 111, 112, 113, 114, 115, 116, 118, 119, 120, 121, 122, 123, 124], _onkeyPress:function (e) {
    if (!e) {
        var e = window.event;
    }
    this.e = e;
    this.keyCode = e.keyCode ? e.keyCode : e.charCode ? e.charCode : e.which ? e.which : void 0;
    if (!this.isKeyCodeIn(this._asciinotok) && this.isKeyCodeIn(this._asciiok) && this.isNoCharCode()) {
        return true;
    }
    if (this.keyCode) {
        this.key = String.fromCharCode(this.keyCode);
    }
    if (this.isCtrlKey() && (this.key == "a" || this.key == "c" || this.key == "x" || this.key == "v")) {
        return true;
    }
    var returnVal = this.onkeyPress();
    if (!returnVal) {
        this.cancelKeyPress();
    }
    return returnVal;
}, onkeyPress:function () {
}, setAscii:function (arr) {
    this._asciinotok = arr;
}, setOnkeyDown:function () {
    if (this.event) {
        ria.utils.event.genericRemoveEvent(this.event);
    }
    this.event = ria.utils.event.genericAddEvent(this.oHtml, "keydown", this._onkeyPress, this);
}, setOnkeyUp:function () {
    if (this.event) {
        ria.utils.event.genericRemoveEvent(this.event);
    }
    this.event = ria.utils.event.genericAddEvent(this.oHtml, "keyup", this._onkeyPress, this);
}, setOnkeyUp:function () {
    if (this.event) {
        ria.utils.event.genericRemoveEvent(this.event);
    }
    this.event = ria.utils.event.genericAddEvent(this.oHtml, "keyup", this._onkeyPress, this);
}, setOnkeyPress:function () {
    if (this.event) {
        ria.utils.event.genericRemoveEvent(this.event);
    }
    this.event = ria.utils.event.genericAddEvent(this.oHtml, "keypress", this._onkeyPress, this);
}, getKeyCode:function () {
    return this.keyCode;
}, getKey:function () {
    return this.key;
}, setKey:function (key) {
    this.key = key;
    try {
        this.e.keyCode = key.charCodeAt();
    }
    catch (e) {
        this.cancelKeyPress();
        var oldSelectionStart = this.oHtml.selectionStart;
        var oldSelectionEnd = this.oHtml.selectionEnd;
        this.oHtml.value = this.oHtml.value.substring(0, oldSelectionStart) + key + this.oHtml.value.substring(oldSelectionEnd);
        this.oHtml.setSelectionRange(oldSelectionStart + key.length, oldSelectionStart + key.length);
    }
}, isKeyCodeIn:function (arrKeyCode) {
    return (rialto.array.indexOf(arrKeyCode, this.keyCode) != -1);
}, isKeyCode:function (keyCode) {
    return (this.keyCode == keyCode);
}, isKey:function (key) {
    return (this.key == key);
}, isShiftKey:function () {
    return this.e.shiftKey;
}, isAltKey:function () {
    return this.e.altKey;
}, isCtrlKey:function () {
    return this.e.ctrlKey;
}, isDelKey:function () {
    return (this.isKeyCode(8) && this.isNoCharCode());
}, isTabKey:function () {
    return (this.isKeyCode(9));
}, isSupKey:function () {
    return (this.isKeyCode(46) && this.isNoCharCode());
}, isUpArrowKey:function () {
    return (this.isKeyCode(38));
}, isDownArrowKey:function () {
    return (this.isKeyCode(40));
}, isLeftArrowKey:function () {
    return (this.isKeyCode(37));
}, isRightArrowKey:function () {
    return (this.isKeyCode(39));
}, isEnterKey:function () {
    return (this.isKeyCode(13));
}, isNoCharCode:function () {
    return (this.e.charCode == null || this.e.charCode == 0);
}, cancelKeyPress:function () {
    if (this.e.preventDefault) {
        this.e.preventDefault();
    }
}, whatWillBeValueWithThisKey:function () {
    value = this.oHtml.value;
    var oldSelectionStart = this.oHtml.selectionStart;
    var oldSelectionEnd = this.oHtml.selectionEnd;
    if (this.isDelKey() || this.isSupKey()) {
        value = value.substring(0, oldSelectionStart) + value.substring(oldSelectionEnd);
    } else {
        value = value.substring(0, oldSelectionStart) + this.key + value.substring(oldSelectionEnd);
    }
    return value;
}, remove:function () {
    ria.utils.event.genericRemoveEvent(this.event);
}};


rialto.utils.Formatter = function (objPar) {
    this.type = "string";
    this.pattern = "";
    this.type = objPar.type;
    this.list = objPar.list;
    this.pattern = this.getDefaultPattern(this.type);
    if (rialto.lang.isString(objPar.pattern, true)) {
        this.pattern = objPar.pattern;
    }
    this.maskPattern = this.pattern;
    if (rialto.lang.isString(objPar.maskPattern, true)) {
        this.maskPattern = objPar.maskPattern;
    }
};
rialto.utils.Formatter.prototype = {types:{number:{defaultPattern:"##.##", parse:function (data, pattern) {
    return rialto.utils.Formatter.prototype.parseNumber(data, pattern);
}, format:function (data, pattern) {
    return rialto.utils.Formatter.prototype.formatNumber(data, pattern);
}, validate:function (data, pattern) {
    return rialto.utils.Formatter.prototype.validateNumber(data, pattern);
}}, "boolean":{defaultPattern:"false|true", parse:function (data, pattern) {
    return rialto.utils.Formatter.prototype.parseBoolean(data, pattern);
}, format:function (data, pattern) {
    return rialto.utils.Formatter.prototype.formatBoolean(data, pattern);
}, validate:function (data, pattern) {
    return rialto.utils.Formatter.prototype.validateBoolean(data, pattern);
}}, date:{defaultPattern:rialto.config.datePattern, parse:function (data, pattern) {
    return rialto.date.parseDate(data, pattern);
}, format:function (data, pattern) {
    return rialto.date.formatDate(data, pattern);
}, validate:function (data, pattern) {
    return rialto.date.isDate(data, pattern);
}}, hour:{defaultPattern:"HH:mm:ss", parse:function (data, pattern) {
    return rialto.utils.Formatter.prototype.parseHour(data, pattern);
}, format:function (data, pattern) {
    return rialto.utils.Formatter.prototype.formatHour(data, pattern);
}, validate:function (data, pattern) {
    return rialto.utils.Formatter.prototype.validateHour(data, pattern);
}}}, getDefaultPattern:function (type) {
    if (this.types[type] != null) {
        return this.types[type].defaultPattern;
    }
    return "";
}, setDefaultPattern:function (type, pattern) {
    this.types[type].defaultPattern = pattern;
}, addType:function (type, f, p, v, pattern) {
    this.types[type] = {defaultPattern:pattern, parse:p, format:f, validate:v};
}, setPattern:function (pattern) {
    this.pattern = pattern;
}, getPattern:function () {
    return this.pattern;
}, setMaskPattern:function (mpattern) {
    this.maskPattern = mpattern;
}, getMaskPattern:function () {
    return this.maskPattern;
}, setValidateFunction:function (f) {
    this.validate = f;
}, setFormatFunction:function (f) {
    this.format = f;
}, setParseFunction:function (f) {
    this.parse = f;
}, applyMask:function (value) {
    if (this.pattern != this.maskPattern) {
        var data = this.parse(value);
        var value = this.format(data, true);
    }
    return value;
}, retrieveMask:function (value) {
    if (this.pattern != this.maskPattern) {
        var data = this.parse(value, true);
        var value = this.format(data);
    }
    return value;
}, format:function (data, bMaskPattern) {
    var pat = bMaskPattern ? this.maskPattern : this.pattern;
    if (this.types[this.type] != null && this.types[this.type].format) {
        return this.types[this.type].format(data, pat);
    }
    return data;
}, parse:function (data, bMaskPattern) {
    if (data == "") {
        return data;
    }
    var pat = bMaskPattern ? this.maskPattern : this.pattern;
    if (this.types[this.type] != null && this.types[this.type].parse) {
        return this.types[this.type].parse(data, pat);
    }
    return data;
}, validate:function (data, bMaskPattern) {
    var pat = bMaskPattern ? this.maskPattern : this.pattern;
    if (this.types[this.type] != null && this.types[this.type].validate) {
        return this.types[this.type].validate(data, pat);
    }
    return true;
}, _parsePattern:function (pattern, ob) {
    for (prop in ob) {
        ob[prop] = pattern.indexOf(prop);
    }
    return ob;
}, _parseBooleanPattern:function (pattern) {
    return pattern.split("|");
}, _parseHourPattern:function (pattern) {
    return this._parsePattern(pattern, {HH:-1, mm:-1, ss:-1});
}, parseHour:function (strHour, pattern) {
    var obf = this._parseHourPattern(pattern);
    var date = rialto.date.today();
    if (obf.HH != -1) {
        date.setHours(strHour.substr(obf.HH, 2));
    }
    if (obf.mm != -1) {
        date.setMinutes(strHour.substr(obf.mm, 2));
    }
    if (obf.ss != -1) {
        date.setSeconds(strHour.substr(obf.ss, 2));
    }
    return date;
}, formatHour:function (date, pattern) {
    var obf = this._parseHourPattern(pattern);
    var strDate = pattern;
    if (obf.HH != -1) {
        var h = date.getHours();
        if (h < 10) {
            (h = "0" + h);
        }
        strDate = rialto.string.replace(strDate, "HH", h);
    }
    if (obf.mm != -1) {
        var m = date.getMinutes();
        if (m < 10) {
            (m = "0" + m);
        }
        strDate = rialto.string.replace(strDate, "mm", m);
    }
    if (obf.ss != -1) {
        var s = date.getSeconds();
        if (s < 10) {
            (s = "0" + s);
        }
        strDate = rialto.string.replace(strDate, "ss", s);
    }
    return strDate;
}, validateHour:function (strHour, pattern) {
    var h = 0;
    var m = 0;
    var s = 0;
    var obf = this._parseHourPattern(pattern);
    var strDate = pattern;
    if (obf.HH != -1) {
        var h = parseInt(strHour.substr(obf.HH, 2), 10);
    }
    if (obf.mm != -1) {
        var m = parseInt(strHour.substr(obf.mm, 2), 10);
    }
    if (obf.ss != -1) {
        var s = parseInt(strHour.substr(obf.ss, 2), 10);
    }
    return ((h >= 0 && h <= 23) && (m >= 0 && m <= 59) && (s >= 0 && s <= 59));
}, _parseNumberPattern:function (pattern) {
    var ob = {ind:-1, nBefore:0, nAfter:0, exponant:false, npattern:"", idebP:0, iEndP:0};
    var ind = pattern.indexOf("E");
    if (ind != -1) {
        ob.exponant = (ind != -1);
    }
    var i0 = pattern.indexOf("0");
    var i1 = pattern.indexOf("#");
    if (i0 == -1) {
        ob.idebP = Math.max(0, i1);
    } else {
        if (i1 == -1) {
            ob.idebP = i0;
        } else {
            ob.idebP = Math.min(i0, i1);
        }
    }
    i0 = Math.max(0, pattern.lastIndexOf("0"));
    i1 = Math.max(0, pattern.lastIndexOf("#"));
    ob.iEndP = Math.max(i0, i1);
    ob.npattern = pattern.substr(ob.idebP, (ob.iEndP - ob.idebP) + 1);
    ob.ind = ob.npattern.indexOf(".");
    if (ob.ind != -1) {
        ob.nBefore = ob.ind;
        ob.nAfter = ob.npattern.length - ob.ind - 1;
    } else {
        ob.nBefore = ob.npattern.length;
    }
    return ob;
}, parseNumber:function (strNumber, pattern) {
    var obF = this._parseNumberPattern(pattern);
    return parseFloat(strNumber.substr(obF.idebP));
}, formatNumber:function (number, pattern) {
    var obF = this._parseNumberPattern(pattern);
    var stN = pattern;
    var n = number;
    if (obF.exponant) {
        n = number.toExponential(obF.nAfter);
    } else {
        n = number.toFixed(obF.nAfter);
    }
    var p = obF.npattern.substr(0, obF.ind);
    var nInt = parseInt(n, 10) + "";
    var i = p.indexOf("0");
    if (i != -1) {
        var n0 = p.length - i;
        while (nInt.length < n0) {
            nInt = "0" + nInt;
        }
    }
    if (obF.exponant) {
        stN = rialto.string.replace(stN, "E", "");
    }
    var nDec = n.substr(n.indexOf("."));
    stN = rialto.string.replace(stN, obF.npattern, nInt + nDec);
    return stN;
}, validateNumber:function (strHour, pattern) {
    return (!isNaN(this.parseNumber(strHour, pattern)));
}, parseBoolean:function (strBoolean, pattern) {
    var val = this._parseBooleanPattern(pattern);
    return (val[1] == strBoolean);
}, formatBoolean:function (bool, pattern) {
    var val = this._parseBooleanPattern(pattern);
    if (bool) {
        return val[1];
    } else {
        return val[0];
    }
}, validateBoolean:function (strBoolean, pattern) {
    var val = this._parseBooleanPattern(pattern);
    return ((val[0] == strBoolean) || (val[1] == strBoolean));
}};


ria.utils.event.genericAddEvent(window, "load", rialto._onload);
ria.utils.event.genericAddEvent(window, "resize", rialto._onresize);
ria.utils.event.genericAddEvent(window, "onunload", rialto._onunload);
window.onbeforeunload = function () {
    return rialto._beforeunload();
};