var asSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
asSt.prototype.sm = {Cl:'asSt',inr:0};
asSt.prototype.sm.it = function (ar) {
    
    this.ms = [];
    this.wait = false;
};
asSt.prototype.xc = function (ar) {
    if (ar && ar.sk) {
        if (ar.end) {
            this.ms.push(ar.sk);
        } else {
            this.ms.unshift(ar.sk);
        }
    }
    if (this.wait) {
        return;
    }
    if (this.bs) {
        return;
    }
    if (!this.ms[0]) {
        return;
    }
    while (this.ms[0] && this.ms[0].length == 0) {
        this.ms.shift();
        if (this.ms.length == 0) {
            
            return;
        }
    }
    if (this.ms[0].length) {
        this.bs = true;
        this.nxt = this.ms[0].shift();
        if (this.nxt.obj) {
            
            this.nxt.xc();
        } else {
            var ft = this.nxt.match(/\b\w+\b/);
            if (!(ft == null || ft == "function")) {
                
                eval(this.nxt);
            }
        }
        this.nxt = null;
        this.bs = false;
        if (!this.wait) {
            this.xc();
        }
    }
};
var as = new asSt();
var ob = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ob.prototype.sm = {Cl:'ob',inr:0};
ob.prototype.sm.it = function (ar) {
    
};
ob.prototype.al = function (ar) {
    if (!ar.Lobj) {
        debugger;
    }
    if (this === ar.Lobj) {
        alert("ob: addListenersLoop");
        debugger;
    }
    if (!this.ls) {
        this.ls = {};
    }
    if (!this.ls[ar.enm]) {
        this.ls[ar.enm] = [];
    }
    var ls = this.ls[ar.enm];
    var found = null;
    for (var i = 0; i < ls.length; i++) {
        if (ls[i][0] == ar.Lobj &&
            ls[i][1] == ar.mN) {
            found = i;
            break;
        }
    }
    var front = null;
    for (var i = 0; ar.front && i < ls.length; i++) {
        if (ls[i][0] == ar.front &&
            ls[i][1] == ar.mN) {
            front = i;
            break;
        }
    }
    if (found == null) {
        if (front != null) {
            ls.splice(front, 0, [ar.Lobj, ar.mN]);
        } else {
            ls.push([ar.Lobj, ar.mN]);
        }
    }
};
ob.prototype.rL = function (ar) {
    
    if (this.ls && this.ls[ar.enm]) {
        var ls = this.ls[ar.enm];
        var found = null;
        for (var i = 0; i < ls.length; i++) {
            if (ls[i][0] == ar.Lobj &&
                ls[i][1] == ar.mN) {
                found = i;
                break;
            }
        }
        if (found != null) {
            ls.splice(i, 1);
            if (!ls.length) {
                this.ls[ar.enm] = null;
            }
        }
    }
};
ob.prototype.nE = function (ar) {
    if (this.ls && this.ls[ar.enm]) {
        var ls = this.ls[ar.enm];
        for (var i = ls.length - 1; i >= 0; i--) {
            if (!ls[i][0].iid) {
                ls.splice(i, 1);
            }
        }
        for (var i = 0; i < ls.length; i++) {
            if (ls[i][0][ls[i][1]]) {
                ls[i][0][ls[i][1]](ar);
            }
        }
    }
};
ob.prototype.rv = function () {
    this.ls = null;
    this.iid = null;
};
var axSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
axSt.prototype.sm = {Cl:'axSt',inr:0};
axSt.prototype.sm.it = function (ar) {
    
    this.qe = [];
};
axSt.prototype.send = function (ar) {
    this.qe.push(ar);
    if (this.qe.length) {
        this.sn();
    }
};
axSt.prototype.sn = function () {
    if (window.XMLHttpRequest) {
        this.xr = new XMLHttpRequest;
    } else if (window.ActiveXObject) {
        try {
            this.xr = new ActiveXObject("Msxml2.XMLHTTP");
            
        } catch (e1) {
            try {
                this.xr = new ActiveXObject("Microsoft.XMLHTTP");
                
            } catch (e2) {
                
            }
        }
    }
    var ar = this.qe.shift();
    this.obj = ar.obj;
    this.pm = ar.pm;
    addEvent(this.xr, "readystatechange", function (e) {if (ax.xr.readyState == 4) {as.wait = false;if (ax.xr.status == 200) {ax.obj[ax.pm](ax.xr.responseText);} else {ax.obj[ax.pm]("HTTP error", ax.tnr);}if (ax.qe.length) {ax.sn();}}}, false);
    as.wait = true;
    this.xr.open("POST", ar.url, true);
    this.xr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    this.xr.send(ar.mg);
};
var ax = new axSt();
var cbSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
cbSt.prototype.sm = {Cl:'cbSt',inr:0};
cbSt.prototype.sm.it = function (ar) {
    
    document.body.style.cursor = "wait";
    this.ikh();
    this.hasFlash = null;
};
cbSt.prototype.aco = function (ar) {
    for (var i = 0; i < this.uco.length; i++) {
        if (this.uco[i] == ar.obj) {
            return;
        }
    }
    this.uco.push(ar.obj);
};
cbSt.prototype.amw = function (ar) {
    for (var i = 0; i < this.menuWidgets.length; i++) {
        if (this.menuWidgets[i] == ar.obj) {
            return;
        }
    }
    this.menuWidgets.push(ar.obj);
};
cbSt.prototype.rco = function (ar) {
    if (this.uco[this.ti] == ar.obj) {
        this.fnx();
    }
    for (var i = 0; i < this.uco.length; i++) {
        if (this.uco[i] == ar.obj) {
            this.uco.splice(i, 1);
            break;
        }
    }
};
cbSt.prototype.eal = function () {
    for (var i = 0; i < this.uco.length; i++) {
        this.uco[i].eE();
    }
};
cbSt.prototype.da = function () {
    for (var i = 0; i < this.uco.length; i++) {
        this.uco[i].dE();
    }
};
cbSt.prototype.ikh = function () {
    this.uco = [];
    this.menuWidgets = [];
    this.ti = -1;
    this.frm = dce("form");
    document.body.appendChild(this.frm);
    this.frm.style.position = "absolute";
    this.frm.style.top = "0px";
    this.frm.style.left = "-55px";
    this.frm.style.width = "50px";
    this.frm.style.height = "50px";
    this.frm.style.zIndex = "-1";
    addEvent(this.frm, "submit", function (e) {return false;}, false);
    this.inp1 = dce("textarea");
    this.frm.appendChild(this.inp1);
    this.inp1.id = "inp1";
    this.inp1.wrap = "off";
    this.inp1.style.width = "50px";
    this.inp1.style.height = "50px";
    this.inp2 = dce("input");
    this.frm.appendChild(this.inp2);
    this.inp2.style.width = "50px";
    this.inp1.focus();
    addEvent(document, "blur", function (e) {cb.inp1.focus();}, false);
    addEvent(document, "focus", function (e) {cb.inp1.focus();}, false);
    addEvent(document, "readyStateChanged", function (e) {cb.inp1.focus();}, false);
    addEvent(document, "keydown", function (e) {cb.evaluateKeyDown(e);}, false);
    addEvent(document, "keyup", function (e) {cb.evaluateKeyUp(e);}, false);
};
cbSt.prototype.evaluateKeyDown = function (e) {
    var eo = window.event || e;
    if (cb.eS) {
        cb.evaluateKeyDownEditState({evnt: eo});
    } else {
        cb.evaluateKeyDownDefaultState({evnt: eo});
    }
    cb.inp1.focus();
};
cbSt.prototype.evaluateKeyUp = function (e) {
    var eo = window.event || e;
    if (eo.keyCode == 9) {
        eo.returnValue = false;
    }
    if (cb.eS) {
        cb.evaluateKeyUpEditState({evnt: eo});
    } else {
        cb.evaluateKeyUpDefaultState({evnt: eo});
    }
    cb.inp1.focus();
};
cbSt.prototype.evaluateKeyDownEditState = function (ar) {
};
cbSt.prototype.evaluateKeyUpEditState = function (ar) {
    er.evaluateKey(ar);
};
cbSt.prototype.evaluateKeyUpDefaultState = function (ar) {
    switch (ar.evnt.keyCode) {
      case 9:
        cb.inp1.focus();
        cb.fnx();
        break;
      case 13:
        if (cb.ti != -1) {
            var currUED = cb.uco[cb.ti];
            currUED.dr.showSelected();
            currUED.dr.xc({mt: "klik"});
        }
        break;
      case 17:
        this.ctrl = false;
        break;
      default:
        cb.inp1.value = "";
        break;
    }
};
cbSt.prototype.evaluateKeyDownDefaultState = function (ar) {
    if (!mv.ro) {
        mv.ro = vt.selection;
    }
    switch (ar.evnt.keyCode) {
      case 17:
        this.ctrl = true;
        break;
      case 37:
        if (mv.ua == "mf") {
            mv.ro.mf({dx: -0.02});
        } else {
            mv.ro[mv.ua]({dx: -1});
        }
        mv.ro.rd();
        break;
      case 38:
        if (mv.ua == "mf") {
            mv.ro.mf({dy: 0.02});
        } else {
            mv.ro[mv.ua]({dy: -1});
        }
        mv.ro.rd();
        break;
      case 39:
        if (mv.ua == "mf") {
            mv.ro.mf({dx: 0.02});
        } else {
            mv.ro[mv.ua]({dx: 1});
        }
        mv.ro.rd();
        break;
      case 40:
        if (mv.ua == "mf") {
            mv.ro.mf({dy: -0.02});
        } else {
            mv.ro[mv.ua]({dy: 1});
        }
        mv.ro.rd();
        break;
      default:
        cb.inp1.value = "";
        break;
    }
};
cbSt.prototype.fnx = function () {
    if (!this.uco.length) {
        return;
    }
    if (this.ti >= this.uco.length) {
        this.ti = 0;
    }
    var i = this.ti + 1;
    var l = this.uco.length;
    if (i >= l) {
        i = 0;
    }
    
    while (this.uco[i].dr.isHidden() ||
        !this.uco[i].av && l >= 0) {
        i++;
        l--;
        if (i >= this.uco.length) {
            i = 0;
        }
        if (!l) {
            i = -1;
            break;
        }
    }
    this.setUEDModeKeyTab({idx: i});
};
cbSt.prototype.setUEDModeKeyTab = function (ar) {
    if (er.co) {
        er.co.fe();
    }
    if (ar.idx == -1) {
        return;
    }
    var currUED = this.ti == -1 ? null : this.uco[this.ti];
    if (currUED) {
        currUED.dr.showUnKeyTab();
        currUED.dr.xc({mt: "KTUnFocus"});
    }
    this.ti = ar.idx;
    currUED = this.uco[this.ti];
    if (currUED) {
        currUED.dr.showKeyTab();
        currUED.dr.xc({mt: "KTFocus"});
    }
};
cbSt.prototype.setUEDIndx = function (ar) {
    var newTabIdx = -1;
    for (var i = 0; i < this.uco.length; i++) {
        if (this.uco[i] == ar.obj) {
            newTabIdx = i;
            break;
        }
    }
    this.setUEDModeKeyTab({idx: newTabIdx});
};
cbSt.prototype.nuc = function (ar) {
    var newTabIdx = this.setUEDIndx(ar);
    var currUED = this.uco[this.ti];
    currUED.dr.xc({mt: "klik"});
    if (!currUED.dr.mw1) {
        if (this.lastUED && this.lastUED.dr.div) {
            this.lastUED.dr.showUnSelected();
        }
        currUED.dr.showSelected();
        this.lastUED = currUED;
    }
};
cbSt.prototype.checkFlash = function () {
    var axo;
    var e;
    var isIE = navigator.appVersion.indexOf("MSIE") != -1 ? true : false;
    var isWin = navigator.appVersion.toLowerCase().indexOf("win") != -1 ? true : false;
    var isOpera = navigator.userAgent.indexOf("Opera") != -1 ? true : false;
    if (navigator.plugins != null && navigator.plugins.length > 0) {
        if (navigator.plugins['Shockwave Flash 2.0'] ||
            navigator.plugins['Shockwave Flash']) {
            var swVer2 = navigator.plugins['Shockwave Flash 2.0'] ? " 2.0" : "";
            var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
            var descArray = flashDescription.split(" ");
            var tempArrayMajor = descArray[2].split(".");
            var versionMajor = tempArrayMajor[0];
            var versionMinor = tempArrayMajor[1];
            if (descArray[3] != "") {
                tempArrayMinor = descArray[3].split("r");
            } else {
                tempArrayMinor = descArray[4].split("r");
            }
            var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            this.hasFlash = versionMajor + "." + versionMinor + "." + versionRevision;
        }
    } else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) {
        this.hasFlash = 4;
    } else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) {
        this.hasFlash = 3;
    } else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) {
        this.hasFlash = 2;
    } else if (isIE && isWin && !isOpera) {
        try {
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
            this.hasFlash = axo.GetVariable("$version");
        } catch (e) {
        }
        if (!this.hasFlash) {
            try {
                axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
                this.hasFlash = "WIN 6,0,21,0";
                axo.AllowScriptAccess = "always";
                this.hasFlash = axo.GetVariable("$version");
            } catch (e) {
            }
        }
        if (!this.hasFlash) {
            try {
                axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
                this.hasFlash = axo.GetVariable("$version");
            } catch (e) {
            }
        }
        if (!this.hasFlash) {
            try {
                axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
                this.hasFlash = "WIN 3,0,18,0";
            } catch (e) {
            }
        }
        if (!this.hasFlash) {
            try {
                axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
                this.hasFlash = "WIN 2,0,0,11";
            } catch (e) {
                this.hasFlash = -1;
            }
        }
    }
    return this.hasFlash;
};
cbSt.prototype.getScrollXY = function () {
    var db = document.body;
    var dde = document.documentElement;
    cb.scrOfX = 0;
    cb.scrOfY = 0;
    if (typeof window.pageYOffset == "number") {
        cb.scrOfY = window.pageYOffset;
        cb.scrOfX = window.pageXOffset;
    } else if (db && (db.scrollLeft || db.scrollTop)) {
        cb.scrOfY = db.scrollTop;
        cb.scrOfX = db.scrollLeft;
    } else if (dde && (dde.scrollLeft || dde.scrollTop)) {
        cb.scrOfY = dde.scrollTop;
        cb.scrOfX = dde.scrollLeft;
    }
    cb.reposInfo();
};
cbSt.prototype.gws = function () {
    var db = document.body;
    var dde = document.documentElement;
    if (typeof window.innerWidth == "number") {
        cb.ww = window.innerWidth;
        cb.wh = window.innerHeight;
    } else if (dde && (dde.clientWidth || dde.clientHeight)) {
        cb.ww = dde.clientWidth;
        cb.wh = dde.clientHeight;
    } else if (db && (db.clientWidth || db.clientHeight)) {
        cb.ww = db.clientWidth;
        cb.wh = db.clientHeight;
    }
    cb.reposInfo();
};
cbSt.prototype.reposInfo = function () {
    var db = document.body;
    var dde = document.documentElement;
    var info = $("info");
    if (info) {
        var docWidth = Math.max(db.scrollWidth, dde.scrollWidth, db.offsetWidth, dde.offsetWidth, db.clientWidth, dde.clientWidth);
        if (docWidth > this.ww) {
            docWidth = 20;
        } else {
            docWidth = 0;
        }
        info.style.top = cb.wh + cb.scrOfY - info.offsetHeight - docWidth + "px";
        info.style.left = cb.scrOfX + "px";
    }
    this.frm.style.top = cb.scrOfY + "px";
};
cbSt.prototype.scW = function (ar) {
    addEvent(window, "resize", cb.cW, false);
    addEvent(window, "scroll", cb.getScrollXY, false);
    if (ar && ar.hor) {
        this.hor = true;
    }
    cb.getScrollXY();
    cb.cW();
};
cbSt.prototype.cW = function (ar) {
    cb.gws();
    var obj = ait.stage;
    if (ar && ar.obj) {
        obj = ar.obj;
    }
    if (ait.oTree && obj == ait.stage) {
        return;
    }
    var t = obj.te;
    t.x = (cb.ww - t.w * t.s) / 2;
    if (t.x < 0) {
        t.x = 0;
    }
    if (!(obj == ait.stage && cb.hor)) {
        t.y = (cb.wh - t.h * t.s) / 2;
        if (t.y < 0) {
            t.y = 0;
        }
    }
    obj.rd();
};
cbSt.prototype.bgd = function () {
    if (!this.bgd.x) {
        this.bgd.x = 1;
    }
    this.bgd.x += 1;
    if (this.bgd.x == 1024) {
        this.bgd.x += 1;
    }
    document.body.style.backgroundPosition = "" + this.bgd.x + "px 0px";
    setTimeout("cb.bgd()", 100);
};
var ummSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ummSt.prototype.sm = {Cl:'ummSt',inr:0};
ummSt.prototype.sm.it = function (ar) {
    
    this.sp = 100;
    this.ts = {};
    this.wg = true;
};
ummSt.prototype.at = function (ar) {
    if (this.ctime) {
        clearInterval(this.ctime);
        this.ctime = null;
    }
    if (!ar.dt) {
        ar.dt = 1;
    }
    ar.eT = (new Date).getTime() + ar.dt;
    this.ts[ar.obj.id] = ar;
    if (!this.ctime) {
        this.ctime = setInterval("umm.ds()", this.sp);
    }
};
ummSt.prototype.ds = function () {
    var cm = (new Date).getTime();
    var nrTransf = 0;
    for (idx in this.ts) {
        var cTf = this.ts[idx];
        if (cTf) {
            nrTransf++;
            var obj = cTf.obj;
            var ote = obj.te;
            var tte = cTf;
            var ss = (cTf.eT - cm) / this.sp | 0;
            if (ss > 1) {
                if (tte.s) {
                    obj.mf({dx: (tte.s - ote.s) * ote.w / ss});
                }
                if (tte.o || tte.o == 0) {
                    obj.fade({dx: (tte.o - ote.o) * ote.w / ss});
                }
                if (tte.x || tte.x == 0) {
                    obj.me({dx: (tte.x - ote.x) / ss});
                }
                if (tte.y || tte.y == 0) {
                    obj.me({dy: (tte.y - ote.y) / ss});
                }
                if (tte.w || tte.w == 0) {
                    obj.resize({dx: (tte.w - ote.w) / ss});
                }
                if (tte.h || tte.h == 0) {
                    obj.resize({dy: (tte.h - ote.h) / ss});
                }
            } else {
                if (tte.s) {
                    ote.s = tte.s;
                }
                if (tte.o || tte.o == 0) {
                    ote.o = tte.o;
                }
                if (tte.x || tte.x == 0) {
                    ote.x = tte.x;
                }
                if (tte.y || tte.y == 0) {
                    ote.y = tte.y;
                }
                if (tte.w || tte.w == 0) {
                    ote.w = tte.w;
                }
                if (tte.h || tte.h == 0) {
                    ote.h = tte.h;
                }
                this.ts[idx] = null;
                nrTransf--;
            }
            if (tte.s && obj.redrawTree) {
                obj.redrawTree();
            } else {
                obj.rd();
            }
        }
    }
    if (nrTransf == 0) {
        clearInterval(this.ctime);
        this.ctime = null;
        this.ts = {};
    }
};
var umm = new ummSt();
var rdbSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
rdbSt.prototype.sm = {Cl:'rdbSt',inr:0};
rdbSt.prototype.sm.it = function (ar) {
    
    this.tnr = 1;
    this.STt = "ok";
    this.mg = "m=";
    this.path = window.location.pathname;
    var idx = this.path.indexOf("html");
    if (idx == -1) {
        this.path += "index.";
    } else {
        this.path = this.path.substring(0, idx);
    }
};
rdbSt.prototype.send = function () {
    as.wait = true;
    if (this.mg != "m=") {
        this.mg = this.mg.replace(/m=qqq/g, "m=").replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/'/g, "\\\\\\'").replace(/%/g, "%25").replace(/&/g, "%26").replace(/\+/g, "%2B") + "q;";
        
        ax.send({url: rdb.path + "dsp", mg: this.mg + "&tm=" + (new Date).getTime(), obj: this, pm: "pc"});
        this.mg = "m=";
    } else {
        as.wait = false;
        as.xc();
    }
};
rdbSt.prototype.sc = function () {
    this.tob = {};
    if (ait.stage.STt != "ld") {
        ait.stage.STt = "cgd";
        ait.stage.d2 = [];
        if (!ait.applyCSS) {
            for (pr in DB) {
                if (DB[pr] && DB[pr].STt == "ok") {
                    DB[pr].STt = "cgd";
                }
            }
        }
    }
    var tobj = ait.stage;
    this.so({obj: tobj});
    if (vt.sd) {
        for (pr in DB) {
            if (DB[pr] && DB[pr].STt) {
                if (DB[pr].STt == "rv") {
                    this.tob[this.tnr] = DB[pr];
                    if (DB[pr].te) {
                        this.mg += "qqqt=lq;i=" + DB[pr].id + "q;tnr=" + this.tnr;
                    } else {
                        var tpe = DB[pr].sm.Cl;
                        this.mg += "qqqt=hq;p=" + tpe + "q;i=" + DB[pr].id + "q;tnr=" + this.tnr;
                    }
                    this.tnr++;
                    DB[pr].removeFromDB();
                }
            }
        }
    }
    this.send();
};
rdbSt.prototype.so = function (ar) {
    var r3 = ar.obj;
    var STt = r3.STt;
    if (STt == "ll" || r3.dr || r3.id.match(/\./)) {
        return;
    }
    for (var i = 0; r3.o2 && i < r3.o2.length; i++) {
        var cd = r3.o2[i];
        this.so({obj: cd});
    }
    for (var i = 0; r3.d2 && i < r3.d2.length; i++) {
        var cd = r3.d2[i];
        this.so({obj: cd});
    }
    if (vt.sd &&
        (STt == "new" || STt == "cgd" || STt == "ok") && r3.b5) {
        if (r3.b5.STt == "ll") {
            r3.b5.STt = "new";
        }
        var found = false;
        for (var i = 0; ait.stage.d2 && !found && i < ait.stage.d2.length; i++) {
            if (ait.stage.d2[i] == r3.b5) {
                found = true;
            }
        }
        if (!found) {
            ait.stage.d2.push(r3.b5);
        }
    }
    if (STt == "ld") {
        this.tob[this.tnr] = r3;
        var tpe = r3.sm.Cl;
        var tk = "f";
        if (r3.te) {
            tk = "j";
        }
        this.mg += "qqqt=" + tk + "q;p=" + tpe + "q;i=" + r3.id + (r3.name ? "q;a=" + r3.name : "") + "q;tnr=" + this.tnr;
        this.tnr++;
    } else if (vt.sd && (STt == "new" || STt == "cgd")) {
        this.tob[this.tnr] = r3;
        var tpe = null;
        var css = r3.name ? ait[r3.name + "_css"] : null;
        var tk = null;
        if (r3.te) {
            tk = STt == "new" ? "i" : "k";
            tpe = "q;f0=" + r3.sm.Cl;
            r3.Ct = "q;f1=";
            r3.cdc();
            r3.Ct += "q;f2=";
            for (var i = 0; r3.o2 && i < r3.o2.length; i++) {
                var cd = r3.o2[i];
                if (cd.STt != "ll") {
                    r3.Ct += cd.id + ";";
                }
            }
            r3.Ct += "q;f3=";
            for (var i = 0; r3.d2 && i < r3.d2.length; i++) {
                r3.Ct += r3.d2[i].sm.Cl + ";" + r3.d2[i].id + ";";
            }
            r3.scs();
            r3.Ct += "q;f4=";
            if (r3.csg) {
                r3.Ct += r3.csg;
            }
        } else {
            tk = STt == "new" ? "e" : "g";
            tpe = "q;p=" + r3.sm.Cl;
            r3.createContent();
        }
        this.mg += "qqqt=" + tk + "q;i=" + r3.id + (r3.name ? "q;a=" + r3.name : "") + (css ? "q;c=" + css.id : "") + tpe + r3.Ct + "q;tnr=" + this.tnr;
        r3.Ct = null;
        this.tnr++;
    } else if (STt == "qy") {
        this.tob[this.tnr] = r3;
        var l = r3.qv.length;
        this.mg += "qqqt=mq;i=" + r3.tta.id + "q;tnr=" + this.tnr;
        for (i = 0; i < l; i++) {
            this.mg += "q;f" + i + "=" + r3.qv[i];
        }
        this.tnr++;
    }
};
rdbSt.prototype.pc = function (ar) {
    if (vt.id != null && vt.id == 2) {
        Site.ssb({sg: "ONTVANGEN: " + ar.replace(/q/g, " ")});
    }
    var rcs = gp({sg: ar.substring(3).replace(/\\'/g, "'"), lm: "tnr"});
    for (var i = 0; rcs && i < rcs.length; i++) {
        
        if (rcs[i].match(/error/)) {
            Site.ssb({sg: "Er is iets fout gegaan in de Database: " + ar});
            Site.aw.dal();
        }
        var mk = rcs[i].indexOf("q;");
        var tan = rcs[i].substring(0, mk);
        
        rcs[i] = rcs[i].substring(mk + 2);
        var tao = this.tob[tan];
        if (!tao) {
            Site.ssb({sg: "Er is iets fout gegaan in de Synchronizatie met de Database"});
            Site.aw.dal();
        }
        if (tao.STt != "ld" &&
            tao.STt != "qy" && tao != ait.stage) {
            var isOk = true;
            var reply = gp({sg: rcs[i], lm: ";"});
            if (tao.id != reply[0]) {
                Site.ssb({sg: "Er is iets fout gegaan met het te synchronizeren object"});
                isOk = false;
            }
            if (reply[1] == "nok") {
                Site.ssb({sg: "Er is iets fout gegaan, de database kon het object niet verwerken"});
                isOk = false;
            }
            if (isOk) {
                if (tao.STt == "new") {
                    tao.STt = "ok";
                } else if (tao.STt == "cgd") {
                    tao.STt = "ok";
                } else if (tao.STt == "rv") {
                    DB[tao.id] = null;
                }
                this.tob[tan] = null;
                Site.ssb({sg: "De gegevens zijn met succes opgeslagen."});
            } else {
                Site.aw.dal();
                debugger;
            }
        } else if (tao.STt == "ld") {
            var csss = [];
            var o2 = gp({sg: rcs[i], lm: "qqq"});
            for (var j = 0; o2 && j < o2.length - 1; j++) {
                var idx = o2[j].indexOf("q;");
                var nid = o2[j].substring(0, idx);
                if (!DB[nid]) {
                    DB[nid] = o2[j];
                }
                if (o2[j].match("q;CSSq;")) {
                    tao.csss = o2[j];
                }
            }
            tao.fd = gp({sg: o2[o2.length - 1], lm: "q;"});
            if (tao.fd[0].match("error")) {
                tao.STt = "error";
            } else {
                tao.rid({id: tao.fd[0]});
            }
            if (tao.name) {
                Site._showPage({name: tao.name});
            }
        } else if (tao.STt == "qy") {
            var o2 = gp({sg: rcs[i], lm: "q;"});
            var rds = gp({sg: rcs[i], lm: ";"});
            tao.idb({rds: rds});
        }
    }
    this.cn();
};
rdbSt.prototype.cn = function (ar) {
    var oldDB = DB;
    DB = {};
    for (var ids in oldDB) {
        if (oldDB[ids] && oldDB[ids].STt != "rv") {
            DB[ids] = oldDB[ids];
            if (DB[ids].STt != "ll") {
                DB[ids].STt = "ok";
            }
            DB[ids].fd = undefined;
        }
    }
    oldDB = undefined;
    ait.stage.d2 = [];
    as.wait = false;
    as.xc();
};
var rdb = new rdbSt();
var dbr = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( dbr, ob);
dbr.prototype.sm = {Cl:'dbr',inr:0};
dbr.prototype.sm.it = function (ar) {
    ob.prototype.sm.it.call(this, ar);
    
    if (ar && ar.id) {
        this.id = ar.id;
        DB[this.id] = this;
        this.STt = "ld";
    } else {
        var ut = (new Date).getTime();
        while ((new Date).getTime() - ut < 1) {
            var dummy = 0;
        }
        this.id = (vt ? vt.id : 1) + "_" + (new Date).getTime();
        this.STt = "new";
        DB[this.id] = this;
    }
    if (ar) {
        if (ar.STt) {
            this.STt = ar.STt;
        }
        if (ar.name) {
            this.name = ar.name;
            ait[this.name] = this;
        }
    }
};
dbr.prototype.idb = function () {
};
dbr.prototype.it2 = function (ar) {
};
dbr.prototype.sCd = function (ar) {
    if (this.STt != "ll" &&
        this.STt != "new" && this.STt != "nrv") {
        this.STt = "cgd";
    }
};
dbr.prototype.rid = function (ar) {
    DB[this.id] = null;
    this.id = ar.id;
    DB[ar.id] = this;
};
dbr.prototype.sri = function () {
    var pt = this.pt;
    this.STt = "ll";
    for (var i = 0; i < pt.o2.length; i++) {
        if (pt.o2[i] == this) {
            this.old_id = this.id;
            var relID = pt.id + "." + i;
            this.id = relID;
            DB[relID] = this;
            break;
        }
    }
};
dbr.prototype.rv = function () {
    if (this.STt == "new" || this.STt == "ll" || this.STt == "error") {
        this.removeFromDB();
    } else {
        this.STt = "rv";
    }
};
dbr.prototype.removeFromDB = function () {
    ob.prototype.rv.call(this);
    DB[this.id] = null;
    if (this.old_id) {
        DB[this.old_id] = null;
    }
};
var CSS = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( CSS, dbr);
CSS.prototype.sm = {Cl:'CSS',inr:0};
CSS.prototype.sm.it = function (ar) {
    dbr.prototype.sm.it.call(this, ar);
    
    if (ar) {
        if (ar.aW) {
            this.aW = ar.aW;
            this.awid = ait[this.aW].id;
            this.csg = "";
        }
        this.it2();
    }
};
CSS.prototype.idb = function () {
    this.aW = this.fd[2];
    this.csg = this.fd[3];
    this.awid = this.fd[4];
    this.cssS = gp({sg: this.fd[3], lm: "|"});
    this.fd = null;
    this.STt = "ok";
};
CSS.prototype.it2 = function () {
    var csn = this.aW + "_css";
    if (ait[csn]) {
        DB[ait[csn].id] = null;
        ait[csn].rv();
        ait[csn] = null;
    }
    ait[csn] = this;
};
CSS.prototype.scs = function (ar) {
    ait[obj.name + "_css"].csg = "removed";
};
CSS.prototype.storeCSS_OLD = function (ar) {
    var obj = ar.obj;
    if (obj.STt == "ld" || obj.STt == "ll" || obj.dr) {
        return;
    }
    if (obj.bc) {
        var rCs;
        if (obj.name) {
            rCs = ait[obj.name + "_css"];
            rCs.old = rCs.csg;
            rCs.csg = "";
            if (obj.name == "stage") {
                this.storeCSS_SW({obj: Site.aw, css: rCs});
            }
        } else {
            rCs = ar.css;
        }
        this.storeCSS_SW({obj: obj, css: rCs});
        for (var i = 0; obj.o2 && i < obj.o2.length; i++) {
            var cd = obj.o2[i];
            this.scs({obj: cd, css: rCs});
        }
        if (obj.name && rCs.old != rCs.csg) {
            rCs.sCd();
        }
    } else {
        this.storeCSS_SW(ar);
    }
};
CSS.prototype.storeCSS_SW_OLD = function (ar) {
    var obj = ar.obj;
    var rCs = ar.css;
    var b5 = obj.b5 ? obj.b5.id : "";
    var stxt = ("" + obj.te.s).substring(0, 4);
    var otxt = "1";
    rCs.csg += obj.id + ";" + b5 + ";" + (obj.te.x + 0.5 | 0) + ";" + (obj.te.y + 0.5 | 0) + ";" + (obj.te.w + 0.5 | 0) + ";" + (obj.te.h + 0.5 | 0) + ";" + stxt + ";" + otxt + ";";
    if (obj.sO) {
        for (var pr in obj.sO) {
            if (typeof obj.sO[pr] != "undefined") {
                rCs.csg += pr + ":" + obj.sO[pr] + ";";
            }
        }
    }
    if (obj.dn) {
        for (var i = 0; obj.dn && i < obj.dn.length; i++) {
            var dec = obj.dn[i];
            if (!dec.STt) {
                var type = dec.type ? dec.type : "";
                rCs.csg += dec.sm.Cl + "-" + type + ";";
            }
        }
    }
    rCs.csg += "|";
};
CSS.prototype.act = function (ar) {
    for (var i = 0; this.cssS && i < this.cssS.length; i++) {
        var idx = this.cssS[i].indexOf(";");
        var id = this.cssS[i].substring(0, idx);
        var obj = DB[id];
        if (obj == ar.obj) {
            obj.csg = this.cssS[i];
            this.cssS.splice(i, 1);
            obj.applyCSS();
            obj.csg = undefined;
            break;
        }
    }
};
var ST = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( ST, ob);
ST.prototype.sm = {Cl:'ST',inr:0};
ST.prototype.sm.it = function (ar) {
    ob.prototype.sm.it.call(this, ar);
    
    this.value = ar.value;
};
var sw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( sw, dbr);
sw.prototype.sm = {Cl:'sw',inr:0};
sw.prototype.sm.it = function (ar) {
    dbr.prototype.sm.it.call(this, ar);
    
    this.my = 0;
    this.te = {x: 0, y: 0, w: 20, h: 20, s: 1, o: 1};
    this.acc = {x: 0, y: 0, w: 20, h: 20, s: 1};
    this.div = dce("div");
    this.div.id = this.iid;
    this.div.style.position = "absolute";
    this.div.style.display = "block";
    if (ar) {
        if (ar.x || ar.x == 0) {
            this.te.x = parseInt("" + ar.x);
        }
        if (ar.y || ar.y == 0) {
            this.te.y = parseInt("" + ar.y);
        }
        if (ar.w || ar.w == 0) {
            this.te.w = parseInt("" + ar.w);
        }
        if (ar.h || ar.h == 0) {
            this.te.h = parseInt("" + ar.h);
        }
        if (ar.s || ar.s == 0) {
            this.te.s = parseFloat("" + ar.s);
        }
        if (ar.o || ar.o == 0) {
            this.te.o = parseFloat("" + ar.o);
        }
        if (ar.style) {
            this.aSt({sg: ar.style.value});
        }
        if (ar.b5) {
            this.b5 = ar.b5;
        }
        if (ar.rt) {
            this.rt = ar.rt;
        }
        if (ar.target) {
            this.target = ar.target;
        }
        if (ar.intree) {
            this.intree = true;
        }
        if (ar.src) {
            this.src = true;
        }
    }
};
sw.prototype.idb = function () {
    if (this.fd[4]) {
        var d2 = gp({sg: this.fd[4], lm: ";"});
        if (d2.length) {
            this.d2 = [];
        }
        for (var i = 1; d2 && i < d2.length; i += 2) {
            var id = d2[i];
            if (id && DB[id]) {
                if (typeof DB[id] == "string") {
                    var fd = gp({sg: DB[id], lm: "q;"});
                    var cs = fd[1];
                    if (!window[cs]) {
                        new DBnokWidget({id: id});
                    } else {
                        eval("new " + fd[1] + "({id:'" + id + "', STt:'ld'})");
                    }
                }
                DB[id].fd = fd;
                DB[id].idb();
                this.d2.push(DB[id]);
            }
        }
        if (this.bnd) {
            this.bnd();
        }
    }
    this.csg = this.fd[5];
    this.applyCSS();
};
sw.prototype.cdc = function () {
};
sw.prototype.scs = function () {
    var b5 = this.b5 ? this.b5.id : "";
    var stxt = ("" + this.te.s).substring(0, 4);
    var otxt = "1";
    this.csg = this.id + ";" + b5 + ";" + (this.te.x + 0.5 | 0) + ";" + (this.te.y + 0.5 | 0) + ";" + (this.te.w + 0.5 | 0) + ";" + (this.te.h + 0.5 | 0) + ";" + stxt + ";" + otxt + ";";
    if (this == ait.stage) {
        var sO = Site.aw.sO;
        if (sO) {
            for (var pr in sO) {
                this.csg += "s_" + pr + ":" + sO[pr] + ";";
            }
        }
    }
    if (this.sO && b5 == "") {
        for (var pr in this.sO) {
            if (this.sO[pr] != "") {
                this.csg += pr + ":" + this.sO[pr] + ";";
            }
        }
    }
    if (this.dn) {
        for (var i = 0; this.dn && i < this.dn.length; i++) {
            var dec = this.dn[i];
            if (dec.sm != "ue") {
                var type = dec.type ? dec.type : "";
                this.csg += dec.sm.Cl + "-" + type + ";";
            }
        }
    }
};
sw.prototype.applyCSS = function () {
    ait[this.name] = this;
    var p2 = gp({sg: this.csg, lm: ";"});
    if (p2[8] == "b" || p2[8] == "n") {
        debugger;
        p2.splice(8, 1);
        this.sCd();
    }
    if (p2[1] && DB[p2[1]]) {
        this.b5 = DB[p2[1]];
    }
    var j = 8;
    if (this == ait.stage) {
        for (j = j; j < p2.length; j++) {
            if (p2[j].match(/:/) && p2[j].match(/^s_/)) {
                Site.aw.aSt({sg: p2[j].substring(2)});
            } else {
                break;
            }
        }
    }
    for (j = j; j < p2.length; j++) {
        if (p2[j].match(/:/)) {
            this.aSt({sg: p2[j]});
        } else {
            var vec = gp({sg: p2[j], lm: "-"});
            if (vec[0] != "ue") {
                var dec = eval("new " + vec[0] + "({sg:'" + vec[1] + "'})");
                this.ad({obj: dec});
            }
        }
    }
    this.te.x = parseInt("" + p2[2]);
    this.te.y = parseInt("" + p2[3]);
    this.te.w = parseInt("" + p2[4]);
    this.te.h = parseInt("" + p2[5]);
    this.te.s = parseFloat("" + p2[6]);
    this.te.o = parseFloat("" + p2[7]);
    if (this.te.o == 0) {
        debugger;
        this.te.o == 1;
        this.sCd();
    }
};
sw.prototype.rd = function () {
    if (this == Site.aw || !this.pt) {
        return;
    }
    if (this.de && !this.decorated) {
        this.decorated = true;
        this.de();
    }
    var t = this.te;
    var at = this.acc;
    var pat = this.pt.acc;
    at.s = pat.s * t.s;
    var _x = t.x * pat.s;
    var _y = t.y * pat.s;
    at.x = pat.x + _x;
    at.y = pat.y + _y;
    at.w = t.w * at.s;
    at.h = t.h * at.s;
    var s = this.div.style;
    if (t.o > 0.999) {
        t.o = 1;
        s.opacity = null;
    } else {
        if (/MSIE 8\./.test(navigator.userAgent)) {
            s['-ms-filter'] = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + t.o * 100 + ")";
        } else if (/MSIE/.test(navigator.userAgent)) {
            s.filter = "alpha(opacity=" + t.o * 100 + ")";
        } else {
            s.opacity = t.o;
        }
    }
    if (this.div.style.position == "relative" &&
        this.pt.div.style.overflow == "auto") {
        s.top = "";
        s.height = "";
    } else {
        s.top = _y + "px";
        s.height = at.h + "px";
    }
    s.left = _x + "px";
    s.width = at.w + "px";
    for (var i = 0; this.dn && i < this.dn.length; i++) {
        this.dn[i].rd();
    }
};
sw.prototype.redrawTree = function () {
    this.rd();
};
sw.prototype.atv = function () {
    if (this.dn &&
        this.dn[0] && this.dn[0].atv) {
        this.dn[0].atv();
    }
};
sw.prototype.deactivate = function () {
    if (this.dn &&
        this.dn[0] && this.dn[0].deactivate) {
        this.dn[0].deactivate();
    }
};
sw.prototype.xc = function (ar) {
    if (!ar.mt) {
        return;
    }
    var mt = this[ar.mt];
    if (mt) {
        if (mt.xc) {
            mt.xc();
        } else if (mt.match && mt.match(/^p_/)) {
            Site.dynamics.gst({obj: DB[mt.replace(/p_/, "")]});
        } else {
            eval(mt);
        }
    }
};
sw.prototype.ad = function (ar) {
    if (!this.dn) {
        this.dn = [];
    }
    this.dn.push(ar.obj);
    ar.obj.setRoot({obj: this});
};
sw.prototype.rdc = function (ar) {
    for (var i = 0; this.dn && i < this.dn.length; i++) {
        if (this.dn[i] == ar.obj) {
            return this.removeDecoration_i({idx: i});
        }
    }
};
sw.prototype.removeDecoration_i = function (ar) {
    var dec = this.dn[ar.idx];
    this.dn.splice(ar.idx, 1);
    if (this.dn.length == 0) {
        this.dn = null;
    }
    if (this.div) {
        dec.rv();
    }
};
sw.prototype.rse = function () {
    if (!this.sO) {
        return;
    }
    var s1 = this.div.style;
    if (this === Site.aw) {
        s1 = document.body.style;
    }
    for (s in this.sO) {
        s1[s] = "";
    }
    this.sO = null;
};
sw.prototype.ase = function (ar) {
    var pr = ar.pr;
    if (pr == "fontSize") {
        return;
    }
    var val = ar.val;
    if (val == "none" || val == "null" || !val) {
        val = "";
    }
    if (!this.sO) {
        this.sO = {};
    }
    this.sO[pr] = val;
    this.sse({pr: pr, val: val});
};
sw.prototype.aSt = function (ar) {
    if (!ar || !ar.sg) {
        return;
    }
    var p2 = gp({sg: ar.sg, lm: ";"});
    for (var i = 0; p2 && i < p2.length; i++) {
        var nSt = gp({sg: p2[i]});
        this.ase({pr: nSt[0], val: nSt[1]});
    }
};
sw.prototype.sses = function () {
    if (this.sO) {
        for (var pr in this.sO) {
            this.sse({pr: pr, val: this.sO[pr]});
        }
    }
};
sw.prototype.sse = function (ar) {
    if (this.isHidden()) {
        return;
    }
    var s1 = this.div.style;
    if (this === Site.aw) {
        s1 = document.body.style;
    }
    var val = ar.val;
    var pr = ar.pr;
    if (pr == "overflow") {
        removeEvent(this.div, "scroll", vt.scroll, false);
        if (val && (val == "auto" || val == "scroll")) {
            addEvent(this.div, "scroll", vt.scroll, false);
        }
    }
    if (val) {
        try {
            if (pr == "backgroundImage") {
                if (val.match(/\.png/i) !== null &&
                    /MSIE (5\.5|6\.)/.test(navigator.userAgent)) {
                    try {
                        s1.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + val + "', sizingMethod='scale')";
                        s1.backgroundImage = "shared/x.gif";
                    } catch (e) {
                        s1.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + val.replace(/\.png/, "gif") + "', sizingMethod='scale')";
                        s1.backgroundImage = "shared/x.gif";
                    }
                } else {
                    if (!val.match(/url/)) {
                        val = "url(" + val + ")";
                    }
                    s1.backgroundImage = val;
                }
            } else {
                s1[pr] = val;
            }
        } catch (e) {
            if (pr == "whiteSpace" && val == "pre-warp") {
                s1.whiteSpace = "normal";
            }
        }
    } else {
        s1.backgroundImage = "none";
    }
};
sw.prototype.me = function (ar) {
    if (!(ar.dx || ar.dy)) {
        return;
    }
    var s = this.pt.acc.s;
    if (ar.dx) {
        this.te.x += ar.dx / s;
    }
    if (ar.dy) {
        this.te.y += ar.dy / s;
    }
};
sw.prototype.resize = function (ar) {
    if (!(ar.dx || ar.dy)) {
        return;
    }
    var s = this.acc.s;
    if (ar.dx) {
        this.te.w += ar.dx / s;
        if (this.te.w < 1) {
            this.te.w = 1;
        }
    }
    if (ar.dy) {
        this.te.h += ar.dy / s;
        if (this.te.h < 1) {
            this.te.h = 1;
        }
    }
};
sw.prototype.mf = function (ar) {
    if (!ar.dx) {
        return;
    }
    var s = this.pt.acc.s;
    this.te.s += ar.dx / (s * this.te.w);
    if (this.te.s < 0.1) {
        this.te.s = 0.1;
    }
};
sw.prototype.fade = function (ar) {
    if (!ar.dx) {
        return;
    }
    var s = this.pt.acc.s;
    this.te.o -= ar.dx / (s * this.te.w);
    if (this.te.o < 0) {
        this.te.o = 0;
    } else if (this.te.o > 1) {
        this.te.o = 1;
    }
};
sw.prototype.tf = function (ar) {
    ar.obj = this;
    umm.at(ar);
};
sw.prototype.hide = function () {
    if (this.te.o == 0) {
        debugger;
        this.te.o = 1;
        this.sCd();
    }
    this.div.style.display = "none";
    this.nE({enm: "hide"});
};
sw.prototype.unhide = function () {
    if (this.te.o == 0) {
        debugger;
        this.te.o = 1;
        this.sCd();
    }
    this.div.style.display = "block";
    if (this.sO) {
        for (var pr in this.sO) {
            this.sse({pr: pr, val: this.sO[pr]});
        }
    }
    this.nE({enm: "unhide"});
};
sw.prototype.isHidden = function () {
    return this.div.style.display == "none";
};
sw.prototype.rv = function () {
    if (this.pt) {
        this.pt.ucd({obj: this});
    }
    for (var i = 0; this.dn && i < this.dn.length; i++) {
        this.dn[i].rv();
    }
    if (this.name) {
        ait[this.name] = null;
    }
    for (i = 0; this.d2 && i < this.d2.length; i++) {
        this.d2[i].rv();
    }
    if (this.otree_node) {
        this.otree_node.rv();
    }
    this.div = undefined;
    dbr.prototype.rv.call(this);
};
sw.prototype.sdg = function (ar) {
    this.ro = ar && ar.obj ? ar.obj : this;
    this.ase({pr: "cursor:", val: "pointer"});
    if (!this.isHidden()) {
        this.div.obj = this.ro;
        addEvent(this.div, "mousedown", mv.me, false);
    }
};
sw.prototype.ud = function () {
    this.ro = null;
    this.ase({pr: "cursor", val: "auto"});
    if (!this.isHidden()) {
        this.div.obj = null;
        removeEvent(this.div, "mousedown", mv.me, true);
    }
};
var Do = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( Do, dbr);
Do.prototype.sm = {Cl:'Do',inr:0};
Do.prototype.sm.it = function (ar) {
    dbr.prototype.sm.it.call(this, ar);
    
    for (var i = 0; i < this.sm.fd.length; i++) {
        var fn = this.sm.fd[i];
        this[fn] = ar && ar[fn] ? ar[fn] : "";
        this["check" + fn] = this.cf0;
    }
};
Do.prototype.idb = function () {
    for (var i = 0; i < this.sm.fd.length; i++) {
        this[this.sm.fd[i]] = this.fd[i + 2] ? this.fd[i + 2] : "";
    }
};
Do.prototype.createContent = function () {
    this.Ct = "";
    for (var i = 0; i < this.sm.fd.length; i++) {
        this.Ct += "q;f" + i + "=" + this[this.sm.fd[i]];
    }
};
Do.prototype.ct = function (ar) {
    new AsocInst({ao: ar.ao, obj1: this, obj2: ar.o2[i]});
    if (!this[ar.ao]) {
        this[ar.ao] = [];
    }
    for (var i = 0; i < o2.length; i++) {
        this.aas({ao: ar.ao, obj: ar.o2[i]});
        if (ar.sym) {
            ar.o2[i].aas({ao: ar.ao, obj: this});
        }
    }
};
Do.prototype.aas = function (ar) {
    if (!this[ar.ao]) {
        this[ar.ao] = [];
    }
    this[ar.ao].push(ar.obj);
};
Do.prototype.it2 = function (ar) {
    this[ar.field] = ar.value;
    this.STt = "it2";
};
Do.prototype.copyFrom = function (ar) {
    for (var i = 0; i < this.sm.fd.length; i++) {
        var fn = this.sm.fd[i];
        this[fn] = ar.obj[fn];
    }
};
Do.prototype.cT = function (ar) {
    as.xc({sk: ["rdb.cdot({obj:DB[" + this.id + "]})"], end: true});
};
Do.prototype.dt = function (ar) {
    as.xc({sk: ["rdb.ddot({obj:DB[" + this.id + "]})"], end: true});
};
var exb = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
exb.prototype.sm = {Cl:'exb',inr:0};
exb.prototype.sm.it = function (ar) {
    
    this.obj = ar.obj ? ar.obj : "";
    this.mN = ar.mN ? ar.mN : "";
    this.cas = ar.cas ? ar.cas : "";
    if (ar.onstack) {
        if (ar.onstack == 1) {
            as.xc({sk: [this]});
        } else if (ar.onstack == 2) {
            as.xc({sk: [this]});
        } else {
            ar.onstack.push(this);
        }
    }
};
exb.prototype.xc = function (ar) {
    this.obj[this.mN].call(this.obj, this.cas ? this.cas : ar);
};
var Txt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( Txt, Do);
Txt.prototype.sm = {Cl:'Txt',inr:0};
Txt.prototype.sm.fd = ['txt'];
Txt.prototype.sm.it = function (ar) {
    Do.prototype.sm.it.call(this, ar);
    
};
Txt.prototype.sT = function (ar) {
    var oldTxt = this.txt;
    if (ar && (ar.sg || ar.sg == "")) {
        var newTxt = ar.sg.replace(/\r\n/g, "\n");
        if (newTxt != oldTxt) {
            this.txt = newTxt;
            this.sCd();
        }
    }
    this.nE({enm: "sT", sg: oldTxt});
};
var tw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( tw, sw);
tw.prototype.sm = {Cl:'tw',inr:0};
tw.prototype.sm.isL = 'true';
tw.prototype.sm.it = function (ar) {
    sw.prototype.sm.it.call(this, ar);
    
    var s = this.div.style;
    s.fontSize = "12px";
    this.sg = "0,1,,|";
    this.md = "b";
    this.ase({pr: "whiteSpace", val: "pre"});
    this.ase({pr: "overflow", val: "visible"});
    if (this.STt != "ld") {
        if (ar && ar.txt) {
            txt = ar.txt;
        } else if (ar && ar.t1) {
            txt = new Txt({txt: ar.t1});
        } else {
            txt = new Txt({txt: ""});
        }
        this.d2 = [txt];
        this.bnd();
        if (Site.aw.sO) {
            var saw = Site.aw.sO;
            if (saw.color) {
                this.ase({pr: "color", val: saw.color});
            }
        }
    }
};
tw.prototype.idb = function () {
    sw.prototype.idb.call(this);
    if (this.fd[2] == "" || this.fd[2] == "null") {
        this.fd[2] = null;
    }
    if (!this.fd[2]) {
        debugger;
        this.lineElements = this.lineElementsFromText({sg: this.d2[0].txt});
        this.createHTML();
        this.createStrng();
        this.set_box();
        this.lineElements = undefined;
        this.sCd();
        return;
    }
    this.md = "n";
    this.sg = this.fd[2].substring(1);
    this.extractStrng();
    this.createHTML();
    this.lineElements = undefined;
};
tw.prototype.cdc = function () {
    this.Ct += this.md + this.sg;
};
tw.prototype.rd = function () {
    sw.prototype.rd.call(this);
    this.div.style.fontSize = (12 * this.acc.s + 0.5 | 0) + "px";
};
tw.prototype.redrawTree = function () {
    if (this.md == "b") {
        this.set_box();
    }
    this.rd();
};
tw.prototype.set_box = function () {
    var s = this.div.style;
    if (!this.pt) {
        document.body.appendChild(this.div);
        s.fontSize = "12px";
        s.fontSize = "12px";
        s.whiteSpace = "pre";
        s.overflow = "visible";
    }
    var old_dsp = s.display;
    s.display = "inline";
    s.width = "";
    s.height = "";
    s.margin = "";
    s.padding = "";
    s.border = "";
    this.offsetWidth = this.div.offsetWidth;
    this.offsetHeight = this.div.offsetHeight;
    this.te.w = this.offsetWidth / this.acc.s;
    this.te.h = this.offsetHeight / this.acc.s;
    this.div.style.display = old_dsp;
    this.sses();
    if (!this.pt) {
        document.body.removeChild(this.div);
    }
};
tw.prototype.set_wrap = function () {
    this.ase({pr: "position", val: "absolute"});
    this.ase({pr: "whiteSpace", val: "pre"});
    this.te.x = 20 / this.pt.acc.s;
    this.te.w = (this.pt.acc.w - 40) / this.pt.acc.s;
    var s = this.div.style;
    s.overflow = "visible";
    s.whiteSpace = "pre-wrap";
    s.border = "";
    s.height = "";
    s.left = this.pt.acc.x + 20 + "px";
    s.width = this.pt.acc.w - 40 + "px";
    this.reDistrXlfs();
    this.te.h = this.offsetHeight / this.acc.s;
    s.whiteSpace = "pre";
    this.sses();
};
tw.prototype.cleanText = function () {
    var oldLength;
    if (this.lineElements) {
        oldLength = this.lineElements.length;
    }
    this.extractStrng();
    for (var i = 0; i < this.lineElements.length - 1; i++) {
        var le1 = this.lineElements[i];
        var le2 = this.lineElements[i + 1];
        if (le1[0] == le2[0] &&
            le1[1] == le2[1] && le1[2] == le2[2] && le1[3] == le2[3]) {
            this.lineElements.splice(i + 1, 1);
            i--;
        }
    }
    this.createHTML();
    this.createStrng();
    if (!oldLength) {
        this.lineElements = undefined;
    }
    if (oldLength && oldLength != this.lineElements.length) {
        this.sCd();
    }
};
tw.prototype.bnd = function () {
    var txt;
    if (!this.d2 || this.d2[0].sm.Cl == "DBnokWidget") {
        txt = new Txt({txt: ""});
        this.d2 = [txt];
    }
    txt = this.d2[0];
    if (this.STt == "ll") {
        txt.STt = "ll";
    }
    txt.al({enm: "sT", Lobj: this, mN: "changedTxt"});
    txt.al({enm: "rv", Lobj: this, mN: "nTx"});
    this.lineElements = this.lineElementsFromText({sg: this.d2[0].txt});
    this.createHTML();
    this.createStrng();
    this.lineElements = undefined;
};
tw.prototype.unbind = function () {
    if (this.d2 && this.d2[0]) {
        var txt = this.d2[0];
        txt.rL({enm: "sT", Lobj: this, mN: "changedTxt"});
        txt.rL({enm: "rv", Lobj: this, mN: "nTx"});
        txt.rv();
        this.d2 = null;
    }
};
tw.prototype.replaceTxt = function (ar) {
    this.unbind();
    this.bnd(ar);
};
tw.prototype.et = function () {
    er.et({obj: this});
    this.editting = true;
    this.extractStrng();
    if ("selectionStart" in cb.inp1) {
        cb.inp1.value = this.old_txt;
    } else if (cb.inp1.createTextRange) {
        cb.inp1.value = this.old_txt.replace(/\n/g, "\r\n");
    }
    cb.caretIdx = 0;
    cb.caretEnd = 0;
    this.setInp1Selection();
    this.addCaret();
    cb.inp1.focus();
};
tw.prototype.continueEdit = function () {
    this.idx_se = this.idx_ss;
    cb.caretEnd = cb.caretIdx;
    this.setInp1Selection();
    er.et({obj: this});
    this.editting = true;
    this.getInp1Selection();
    this.addCaret();
    cb.inp1.focus();
};
tw.prototype.fe = function () {
    if (!this.editting) {
        return;
    }
    if (cb.caretEnd != cb.caretIdx) {
    } else {
        this.createStrng();
        this.removeXlfs();
        this.d2[0].txt = "";
        this.d2[0].sT({sg: this.old_txt});
        this.sCd();
        this.old_txt = undefined;
        this.lineElements = undefined;
        this.editting = undefined;
        cb.caretIdx = undefined;
        cb.caretEnd = undefined;
    }
    er.fe();
};
tw.prototype.lineElementsFromText = function (ar) {
    if (ar.sg == "" && !ar.delta) {
        return [[0, 0, null, null]];
    } else if (ar.sg == "" && ar.delta) {
        return [[ar.delta, ar.delta + 1, null, null]];
    }
    var delta = ar.delta ? ar.delta : 0;
    var lineElements = [];
    var LE;
    var cpy = ar.sg;
    var idx_s = 0;
    var idx_c = cpy.indexOf("\n");
    while (idx_c != -1) {
        if (idx_c > 0) {
            LE = [idx_s + delta, idx_s + idx_c + delta, null, null];
            lineElements.push(LE);
        }
        idx_s += idx_c;
        LE = [idx_s + delta, idx_s + 1 + delta, "lf", null];
        lineElements.push(LE);
        idx_s += 1;
        cpy = cpy.substring(idx_c + 1);
        idx_c = cpy.indexOf("\n");
    }
    if (idx_s < ar.sg.length) {
        LE = [idx_s + delta, ar.sg.length + delta, null, null];
        lineElements.push(LE);
    }
    return lineElements;
};
tw.prototype.addHTMLel = function (ar) {
    var LE = ar.le;
    var start = LE[0];
    var end = LE[1];
    if (start < end) {
        var stl = LE[2];
        var hrf = LE[3];
        if (stl == "lf" || stl == "xlf") {
            el = dce("br");
        } else {
            if (hrf != null) {
                el = dce("a");
                el.setAttribute("href", hrf);
            } else {
                el = dce("span");
            }
            var txt = ar.sg.substring(start, end);
            el.innerHTML = txt.replace(/</g, "&#60;").replace(/ /g, "&nbsp;");
            if (stl == "selection") {
                stl = "color:white;backgroundColor:blue;";
            }
            if (stl) {
                var p2 = gp({sg: stl, lm: ";"});
                for (i = 0; i < p2.length; i++) {
                    var items = gp({sg: p2[i]});
                    el.style[items[0]] = items[1];
                }
            }
        }
        return el;
    }
    return null;
};
tw.prototype.createHTML = function () {
    empty(this.div);
    for (var i = 0; i < this.lineElements.length; i++) {
        var el = this.addHTMLel({sg: this.d2[0].txt, le: this.lineElements[i]});
        if (el) {
            this.div.appendChild(el);
        }
    }
};
tw.prototype.createStrng = function () {
    this.sg = "";
    for (var i = 0; i < this.lineElements.length; i++) {
        var LE = this.lineElements[i];
        this.sg += LE[0] + "," + LE[1] + "," + (LE[2] ? LE[2] : "") + "," + (LE[3] ? LE[3] : "") + ",|";
    }
};
tw.prototype.extractStrng = function () {
    if (this.lineElements && this.lineElements.length) {
        return;
    }
    var elms = gp({sg: this.sg, lm: "|"});
    this.old_txt = "";
    this.lineElements = [];
    for (var i = 0; i < elms.length; i++) {
        var elm = elms[i];
        var p2 = gp({sg: elm, lm: ","});
        var start = parseInt(p2[0]);
        var end = parseInt(p2[1]);
        var LE = [start, end, p2[2] ? p2[2] : null, p2[3] ? p2[3] : null];
        this.lineElements.push(LE);
        if (LE[2] && (LE[2] == "lf" || LE[2] == "xlf")) {
            this.old_txt += "\n";
        } else {
            var txt = this.d2[0].txt.substring(start, end);
            this.old_txt += txt;
            if (!this.STt == "load" &&
                this.div.childNodes[i].innerHTML != txt) {
                debugger;
            }
        }
    }
    if (!this.lineElements.length) {
        this.lineElements = [[0, 0, null, null]];
    }
};
tw.prototype.addXlfs = function () {
    var sg = "";
    empty(this.div);
    try {
        this.div.style.whiteSpace = "pre-wrap";
    } catch (e) {
        this.div.style.whiteSpace = "pre";
    }
    this.oldy;
    this.el1;
    this.els = dce("span");
    this.els.innerHTML = "&nbsp;";
    var xspace;
    for (var i = 0; i < this.lineElements.length; i++) {
        try {
            this.div.removeChild(this.el2);
        } catch (e) {
        }
        this.el2 = dce("span");
        this.el2.innerHTML = "";
        this.div.appendChild(this.el2);
        var LE = this.lineElements[i];
        if (LE[2] == "lf") {
            if (xspace) {
                xspace = undefined;
                this.el2.innerHTML = ".";
                var el2y = this.el2.offsetTop;
                if (el2y > this.oldy) {
                    var LE_m = this.lineElements[i - 1];
                    var end = LE_m[1] - 1;
                    var LE_x = [end, end + 1, "xlf", null];
                    this.lineElements.splice(i - 1, 1, LE_x);
                    if (LE_m[0] < end) {
                        LE_a = [LE_m[0], end, LE_m[2], LE_m[3]];
                        this.lineElements.splice(i - 1, 0, LE_a);
                    }
                    this.div.insertBefore(dce("br"), this.el2);
                    sg += "\n";
                } else {
                    sg += " ";
                    this.el1.innerHTML += " ";
                }
            }
            this.div.insertBefore(dce("br"), this.el2);
            sg += "\n";
            this.el2.innerHTML = ".";
            this.oldy = this.el2.offsetTop;
            this.el2.innerHTML = "";
        } else {
            if (LE[3]) {
                this.el1 = dce("a");
                this.el1.setAttribute("href", LE[3]);
            } else {
                this.el1 = dce("span");
            }
            this.el1.innerHTML = "";
            this.div.insertBefore(this.el1, this.el2);
            var start = LE[0];
            end = LE[1];
            if (start < end) {
                if (LE[2]) {
                    var p2 = gp({sg: LE[2], lm: ";"});
                    for (var j = 0; j < p2.length; j++) {
                        var items = gp({sg: p2[j]});
                        this.el1.style[items[0]] = items[1];
                        this.el2.style[items[0]] = items[1];
                    }
                }
                var txt = this.d2[0].txt.substring(start, end);
                var idx = txt.indexOf(" ");
                var word = txt.substring(0, idx);
                if (start == 0) {
                    if (idx == 0) {
                        idx = 1;
                        sg += " ";
                        this.el1.innerHTML = " ";
                        txt = txt.substring(1);
                    } else {
                        if (idx == -1) {
                            word = txt;
                        }
                        sg += word;
                        if (this.iP) {
                            this.el1.innerHTML = word.replace(/./g, "*");
                        } else {
                            this.el1.innerHTML = word.replace(/</g, "&#60;").replace(/ /g, "&nbsp;");
                        }
                        txt = txt.substring(word.length);
                    }
                    this.oldy = this.el1.offsetTop;
                }
                while (txt) {
                    var fspace = txt.charAt(0) == " ";
                    if (fspace) {
                        var sspace = txt.length > 1 && txt.charAt(1) == " ";
                        if (xspace) {
                            if (this.testWord({sg: " ", ws: false})) {
                                sg += " ";
                                this.el1.innerHTML += " ";
                            } else {
                                debugger;
                            }
                            xspace = undefined;
                        } else if (sspace) {
                            fspace = undefined;
                            while (sspace) {
                                txt = txt.substring(1);
                                if (this.testSpace()) {
                                    sg += " ";
                                    this.el1.innerHTML += "&nbsp;";
                                } else {
                                    this.swap_sp_xlfs({lei: i, idx: sg.length});
                                    sg += "\n";
                                    i += 2;
                                }
                                sspace = txt.charAt(1) == " ";
                            }
                            sspace = true;
                        } else if (txt != " ") {
                            txt = txt.substring(1);
                            idx = txt.indexOf(" ");
                            if (idx == -1) {
                                word = txt;
                                txt = "";
                            } else {
                                word = txt.substring(0, idx);
                                txt = txt.substring(word.length);
                            }
                            if (this.testWord({sg: word, ws: true})) {
                                sg += " " + word;
                                if (this.iP) {
                                    this.el1.innerHTML += " " + word.replace(/./g, "*");
                                } else {
                                    this.el1.innerHTML += " " + word.replace(/</g, "&#60;").replace(/ /g, "&nbsp;");
                                }
                            } else {
                                this.swap_sp_xlfs({lei: i, idx: sg.length});
                                sg += "\n" + word;
                                if (this.iP) {
                                    this.el1.innerHTML += word.replace(/./g, "*");
                                } else {
                                    this.el1.innerHTML += word.replace(/</g, "&#60;").replace(/ /g, "&nbsp;");
                                }
                                i += 2;
                            }
                        }
                    } else {
                        if (xspace) {
                            xspace = false;
                            idx = txt.indexOf(" ");
                            if (idx == -1) {
                                word = txt;
                                txt = "";
                            } else {
                                word = txt.substring(0, idx);
                                txt = txt.substring(word.length);
                            }
                            if (this.testWord({sg: word, ws: true})) {
                                sg += " " + word;
                                if (this.iP) {
                                    this.el1.innerHTML += " " + word.replace(/./g, "*");
                                } else {
                                    this.el1.innerHTML += " " + word.replace(/</g, "&#60;").replace(/ /g, "&nbsp;");
                                }
                            } else {
                                LE_m = this.lineElements[i - 1];
                                end = LE_m[1] - 1;
                                LE_x = [end, end + 1, "xlf", null];
                                this.lineElements.splice(i - 1, 1, LE_x);
                                if (LE_m[0] < end) {
                                    LE_a = [LE_m[0], end, LE_m[2], LE_m[3]];
                                    this.lineElements.splice(i - 1, 0, LE_a);
                                }
                                this.div.insertBefore(dce("br"), this.el2);
                                this.el1 = dce("span");
                                this.div.insertBefore(this.el1, this.el2);
                                if (LE[2]) {
                                    p2 = gp({sg: LE[2], lm: ";"});
                                    for (i = 0; i < p2.length; i++) {
                                        items = gp({sg: p2[i]});
                                        this.el1.style[items[0]] = items[1];
                                    }
                                }
                                sg += "\n" + word;
                                if (this.iP) {
                                    this.el1.innerHTML = word.replace(/./g, "*");
                                } else {
                                    this.el1.innerHTML = word.replace(/</g, "&#60;").replace(/ /g, "&nbsp;");
                                }
                            }
                        } else {
                            idx = txt.indexOf(" ");
                            if (idx == -1) {
                                word = txt;
                                txt = "";
                            } else {
                                word = txt.substring(0, idx);
                                txt = txt.substring(word.length);
                            }
                            if (this.testWord({sg: word, ws: false})) {
                                sg += word;
                                if (this.iP) {
                                    this.el1.innerHTML += word.replace(/./g, "*");
                                } else {
                                    this.el1.innerHTML += word.replace(/</g, "&#60;").replace(/ /g, "&nbsp;");
                                }
                            } else {
                                debugger;
                            }
                        }
                    }
                    if (txt == " ") {
                        xspace = true;
                        txt = "";
                    }
                }
            }
        }
    }
    if (xspace) {
        if (this.testWord({sg: " ", ws: false})) {
            sg += " ";
            this.el1.innerHTML += " ";
        } else {
            debugger;
        }
    }
    this.div.removeChild(this.el2);
    this.div.style.whiteSpace = "pre";
    this.oldy = undefined;
    this.els = undefined;
    this.el2 = undefined;
    this.old_txt = sg;
};
tw.prototype.testWord = function (ar) {
    if (ar.ws) {
        this.div.insertBefore(this.els, this.el2);
    }
    this.el2.innerHTML = ar.sg.replace(/</g, "&#60;").replace(/ /g, "&nbsp;");
    var el2y = this.el2.offsetTop;
    if (ar.ws) {
        this.div.removeChild(this.els);
    }
    this.el2.innerHTML = "";
    if (el2y == this.oldy) {
        return true;
    } else {
        this.oldy = el2y;
        return false;
    }
};
tw.prototype.testSpace = function () {
    this.div.appendChild(this.els);
    this.els.innerHTML = ".";
    var elsy = this.els.offsetTop;
    this.els.innerHTML = "&nbsp;";
    this.div.removeChild(this.els);
    if (elsy == this.oldy) {
        return true;
    } else {
        this.oldy = elsy;
        return false;
    }
};
tw.prototype.swap_sp_xlfs = function (ar) {
    var LE = this.lineElements[ar.lei];
    var LE_a = [LE[0], ar.idx, LE[2], LE[3]];
    var LE_x = [ar.idx, ar.idx + 1, "xlf", null];
    var LE_b = [ar.idx + 1, LE[1], LE[2], LE[3]];
    this.lineElements.splice(ar.lei, 1, LE_a, LE_x, LE_b);
    this.div.insertBefore(dce("br"), this.el2);
    this.el1 = dce("span");
    this.el1.innerHTML = "";
    this.div.insertBefore(this.el1, this.el2);
    if (LE[2]) {
        var p2 = gp({sg: LE[2], lm: ";"});
        for (var i = 0; i < p2.length; i++) {
            var items = gp({sg: p2[i]});
            this.el1.style[items[0]] = items[1];
        }
    }
};
tw.prototype.removeXlfs = function (ar) {
    for (var i = 0; i < this.lineElements.length; i++) {
        var LE = this.lineElements[i];
        if (LE[2] == "xlf") {
            this.old_txt = this.old_txt.substring(0, LE[0]) + " " + this.old_txt.substring(LE[0] + 1);
            var LE_a = this.lineElements[i - 1];
            if (LE_a[2] == "lf") {
                LE[2] = null;
            } else {
                LE_a[1]++;
                this.lineElements.splice(i, 1);
                i--;
                LE = this.lineElements[i];
            }
        }
        if (i < this.lineElements.length - 1) {
            var LE_b = this.lineElements[i + 1];
            if (LE[2] != "lf" &&
                LE_b[2] != "lf" && LE[2] == LE_b[2] && LE[3] == LE_b[3]) {
                LE[1] = LE_b[1];
                this.lineElements.splice(i + 1, 1);
                i--;
            }
        }
    }
};
tw.prototype.reDistrXlfs = function () {
    this.extractStrng();
    this.removeXlfs();
    this.addXlfs();
    this.createStrng();
    this.sCd();
    this.old_txt = undefined;
    this.lineElements = undefined;
};
tw.prototype.processEdit = function (ar) {
    var new_text = cb.inp1.value.replace(/\t/g, " ").replace(/\r\n/g, "\n");
    if (this.old_txt != new_text) {
        this.deleteSelection();
        this.getInp1Selection();
        this.syncLEs({nw: new_text});
        this.removeXlfs();
        this.d2[0].txt = this.old_txt;
        this.addXlfs();
        if ("selectionStart" in cb.inp1) {
            cb.inp1.value = this.old_txt;
        } else if (cb.inp1.createTextRange) {
            cb.inp1.value = this.old_txt.replace(/\n/g, "\r\n");
        }
        this.setInp1Selection();
        this.addCaret();
    } else {
        this.unSelect();
        this.getInp1Selection();
        if (cb.caretIdx == cb.caretEnd) {
            this.addCaret();
        } else {
            this.addSelection();
        }
    }
};
tw.prototype.changedTxt = function (ar) {
    if (this.editting) {
        return;
    }
    this.extractStrng();
    this.old_txt = ar.sg;
    this.syncLEs({nw: this.d2[0].txt});
    this.createHTML();
    this.createStrng();
    this.sCd();
};
tw.prototype.writeChildNode = function (ar) {
    var LE = this.lineElements[ar.idx];
    if (this.iP) {
        this.div.childNodes[ar.idx].innerHTML = this.old_txt.substring(LE[0], LE[1]).replace(/./g, "*");
    } else {
        this.div.childNodes[ar.idx].innerHTML = this.old_txt.substring(LE[0], LE[1]).replace(/</g, "&#60;").replace(/ /g, "&nbsp;");
    }
};
tw.prototype.combineLEAdapt = function (ar) {
    var LE_1 = this.lineElements[ar.idx];
    var LE_2 = this.lineElements[ar.idx + 1];
    if (LE_1 &&
        LE_2 &&
        LE_1[2] != "lf" &&
        LE_2[2] != "lf" &&
        LE_1[2] != "xlf" &&
        LE_2[2] != "xlf" && LE_1[2] == LE_2[2] && LE_1[3] == LE_2[3]) {
        LE_1[1] = LE_2[1];
        this.writeChildNode(ar);
        this.lineElements.splice(ar.idx + 1, 1);
        this.div.removeChild(this.div.childNodes[ar.idx + 1]);
    }
};
tw.prototype.deleteLE = function (ar) {
    var LE = this.lineElements[ar.idx];
    if (LE) {
        var delta = LE[1] - LE[0];
        this.lineElements.splice(ar.idx, 1);
        this.shiftLEs({idx: ar.idx, delta: - delta});
        this.div.removeChild(this.div.childNodes[ar.idx]);
        this.old_txt = this.old_txt.substring(0, LE[0]) + this.old_txt.substring(LE[1]);
        this.combineLEAdapt(ar);
    }
};
tw.prototype.deleteText = function () {
    this.old_txt = "";
    empty(this.div);
    var el = dce("span");
    el.innderHTML = "";
    this.div.appendChild(el);
    this.lineElements = [[0, 0, null, null]];
    cb.caretIdx = 0;
    cb.caretEnd = 0;
    this.idx_ss = 0;
    this.idx_se = 0;
};
tw.prototype.combineLESync = function (ar) {
    var LE_0 = this.lineElements[ar.idx - 1];
    var LE_1 = this.lineElements[ar.idx];
    var LE_2 = this.lineElements[ar.idx + 1];
    if (!LE_1 || !LE_2 || LE_1[2] == "lf" || LE_2[2] == "lf") {
        return;
    }
    if (LE_1[2] == "xlf") {
        LE_0[1] = LE_2[1];
        this.lineElements.splice(ar.idx, 2);
    } else if (LE_1[2] == LE_2[2] && LE_1[3] == LE_2[3]) {
        LE_1[1] = LE_2[1];
        this.lineElements.splice(ar.idx + 1, 1);
    }
};
tw.prototype.syncLEs = function (ar) {
    var new_txt = ar.nw;
    var delta = new_txt.length - this.old_txt.length;
    if (new_txt == "") {
        this.deleteText();
        this.old_txt = "";
        return;
    }
    if (this.old_txt == "" || !this.editting) {
        this.lineElements = this.lineElementsFromText({sg: new_txt});
        this.old_txt = new_txt;
        return;
    }
    var ok = true;
    var oldCaretIdx = cb.caretIdx - delta;
    if (delta > 0) {
        if (this.old_txt.substring(0, oldCaretIdx) != new_txt.substring(0, oldCaretIdx)) {
            ok = false;
        }
        if (this.old_txt.substring(oldCaretIdx) != new_txt.substring(cb.caretIdx)) {
            ok = false;
        }
    } else {
        if (this.old_txt.substring(0, cb.caretIdx) != new_txt.substring(0, cb.caretIdx)) {
            ok = false;
        }
        if (this.old_txt.substring(cb.caretIdx + 1 - delta) != new_txt.substring(cb.caretIdx + 1)) {
            ok = false;
        }
    }
    if (!ok) {
        cb.caretIdx = null;
        var idx;
        var start;
        var end;
        var LE;
        debugger;
        for (idx = 0; idx < this.lineElements.length; idx++) {
            LE = this.lineElements[idx];
            os = this.old_txt.substring(LE[0], LE[1]);
            ns = new_txt.substring(LE[0], LE[1]);
            if (os != ns) {
                break;
            }
        }
        idx = 0;
        while (os.charAt(idx) == ns.charAt(idx) &&
            idx < os.length && idx < ns.length) {
            idx++;
        }
        start = LE[0] + idx;
        for (idx = this.lineElements.length - 1; idx >= 0; idx--) {
            LE = this.lineElements[idx];
            os = this.old_txt.substring(LE[0], LE[1]);
            ns = new_txt.substring(LE[0] + delta, LE[1] + delta);
            if (os != ns) {
                break;
            }
        }
        idx = 0;
        while (os.charAt(idx) == ns.charAt(idx) &&
            idx < os.length && idx < ns.length) {
            idx++;
        }
        end = LE[0] + idx;
        if (delta > 0 && start + delta == end + 1) {
            cb.caretIdx = end + 1;
            oldCaretIdx = cb.caretIdx - delta;
            this.idx_ss = this.findLE({idx: cb.caretIdx});
        } else if (delta < 0 && start == end) {
            cb.caretIdx = start;
            oldCaretIdx = cb.caretIdx - delta;
        } else {
            debugger;
        }
    }
    if (cb.caretIdx != null) {
        var idx;
        var LE;
        if (delta > 0) {
            idx = this.findLE({idx: oldCaretIdx});
            LE = this.lineElements[idx];
            if (idx != null) {
                this.shiftLEs({idx: idx + 1, delta: delta});
            }
            var txt = new_txt.substring(cb.caretIdx - delta, cb.caretIdx);
            var extraLEs = this.lineElementsFromText({sg: txt, delta: cb.caretIdx - delta});
            if (!LE) {
                if (oldCaretIdx < this.old_txt.length) {
                    debugger;
                }
                var idx = this.lineElements.length - 1;
                for (var i = 0; i < extraLEs.length; i++) {
                    this.lineElements.push(extraLEs[i]);
                }
                this.combineLESync({idx: idx});
            } else if (oldCaretIdx == LE[0]) {
                LE[0] += delta;
                LE[1] += delta;
                for (i = extraLEs.length - 1; i >= 0; i--) {
                    this.lineElements.splice(idx, 0, extraLEs[i]);
                }
                this.combineLESync({idx: idx});
            } else if (extraLEs.length == 1 && extraLEs[0][2] != "lf") {
                if (oldCaretIdx < LE[0] || oldCaretIdx >= LE[1]) {
                    debugger;
                }
                LE[1] += delta;
            } else {
                if (oldCaretIdx < LE[0] || oldCaretIdx >= LE[1]) {
                    debugger;
                }
                var LE_x = [oldCaretIdx + delta, LE[1] + delta, LE[2], LE[3]];
                LE[1] = oldCaretIdx;
                this.lineElements.splice(idx + 1, 0, LE_x);
                for (i = extraLEs.length - 1; i >= 0; i--) {
                    this.lineElements.splice(idx + 1, 0, extraLEs[i]);
                }
                this.combineLESync({idx: idx});
            }
        } else if (delta == -1) {
            idx = this.findLE({idx: cb.caretIdx});
            LE = this.lineElements[idx];
            if (idx != null) {
                this.shiftLEs({idx: idx + 1, delta: -1});
            }
            if (LE[0] == LE[1] - 1) {
                this.lineElements.splice(idx, 1);
                this.combineLESync({idx: idx - 1});
            } else {
                LE[1]--;
            }
        }
        this.old_txt = new_txt;
    } else {
        debugger;
        this.lineElements = this.lineElementsFromText({sg: new_txt});
        this.old_txt = new_txt;
    }
};
tw.prototype.addCaret = function () {
    if (!er.caretdiv) {
        er.createCaretDiv();
    }
    var el;
    if (cb.caretIdx >= this.old_txt.length) {
        if (this.old_txt == "" && this.div.childNodes[0]) {
            el = this.div.childNodes[0];
        } else {
            el = this.div.childNodes[this.lineElements.length];
        }
        if (el) {
            this.div.insertBefore(er.caret_el, el);
        } else {
            this.div.appendChild(er.caret_el);
        }
    } else {
        var idx = this.findLE({idx: cb.caretIdx});
        var LE_1 = this.lineElements[idx];
        var LE_a = [LE_1[0], cb.caretIdx, LE_1[2], LE_1[3]];
        var LE_b = [cb.caretIdx, LE_1[1], LE_1[2] == "lf" ? null : LE_1[2], LE_1[3]];
        var el_1b = this.addHTMLel({sg: this.old_txt, le: LE_a});
        var el_2b = this.addHTMLel({sg: this.old_txt, le: LE_b});
        el = this.div.childNodes[idx];
        if (el_1b) {
            this.div.insertBefore(el_1b, el);
        }
        this.div.insertBefore(er.caret_el, el);
        if (el_2b) {
            this.div.insertBefore(el_2b, el);
        }
        this.div.removeChild(el);
    }
    var as = this.acc.s;
    er.caretdiv.style.left = "" + (this.acc.x + er.caret_el.offsetLeft - 2.5 * as) + "px";
    er.caretdiv.style.top = "" + (this.acc.y + er.caret_el.offsetTop - 4 * as) + "px";
    if (el) {
        this.div.insertBefore(el, er.caret_el);
    }
    this.div.removeChild(er.caret_el);
    try {
        this.div.removeChild(el_1b);
    } catch (e) {
    }
    try {
        this.div.removeChild(el_2b);
    } catch (e) {
    }
};
tw.prototype.findLE = function (ar) {
    if (ar.idx < 0) {
        return null;
    }
    if (ar.idx > this.d2[0].txt.length) {
        return null;
    }
    for (var i = 0; i < this.lineElements.length; i++) {
        var LE = this.lineElements[i];
        if (ar.idx >= LE[0] && ar.idx < LE[1]) {
            return i;
        }
    }
    return null;
};
tw.prototype.addSelection = function () {
    er.removeCaretDiv();
    var el;
    var el_1a;
    var el_1b;
    var el_2a;
    var el_2b;
    var LE_1 = this.lineElements[this.idx_ss];
    if (cb.caretIdx != LE_1[0] &&
        cb.caretIdx != LE_1[1]) {
        var LE_1b = [cb.caretIdx, LE_1[1], LE_1[2] == "lf" ? null : LE_1[2], LE_1[3]];
        LE_1[1] = cb.caretIdx;
        this.lineElements.splice(this.idx_ss + 1, 0, LE_1b);
        el_1a = this.addHTMLel({sg: this.old_txt, le: LE_1});
        el_1a.id = "el_1a";
        el_1b = this.addHTMLel({sg: this.old_txt, le: LE_1b});
        el_1b.id = "el_1b";
        el = this.div.childNodes[this.idx_ss];
        this.div.insertBefore(el_1a, el);
        this.div.insertBefore(el_1b, el);
        this.div.removeChild(el);
        this.idx_ss++;
        this.idx_se++;
    }
    var LE_2 = this.lineElements[this.idx_se];
    if (cb.caretEnd != LE_2[0] &&
        cb.caretEnd != LE_2[1]) {
        var LE_2b = [cb.caretEnd, LE_2[1], LE_2[2] == "lf" ? null : LE_2[2], LE_2[3]];
        LE_2[1] = cb.caretEnd;
        el = this.div.childNodes[this.idx_se];
        this.lineElements.splice(this.idx_se + 1, 0, LE_2b);
        el_2a = this.addHTMLel({sg: this.old_txt, le: LE_2});
        if (el_1b && el === el_1b) {
            el_2a.id = "el_1b2a";
        } else {
            el_2a.id = "el_2a";
        }
        el_2b = this.addHTMLel({sg: this.old_txt, le: LE_2b});
        el_2b.id = "el_2b";
        this.div.insertBefore(el_2a, el);
        this.div.insertBefore(el_2b, el);
        this.div.removeChild(el);
    }
    for (var i = this.idx_ss; i <= this.idx_se; i++) {
        s = this.div.childNodes[i].style;
        s.color = "white";
        s.backgroundColor = "blue";
    }
};
tw.prototype.unSelect = function (ar) {
    if (cb.caretIdx != cb.caretEnd) {
        var el;
        var el_1a = $("el_1a");
        var el_1b = $("el_1b");
        var el_2a = $("el_2a");
        var el_1b2a = $("el_1b2a");
        var el_2b = $("el_2b");
        if (el_2b) {
            var LE_2 = this.lineElements[this.idx_se];
            var LE_2b = this.lineElements[this.idx_se + 1];
            LE_2[1] = LE_2b[1];
            this.lineElements.splice(this.idx_se + 1, 1);
            el = this.addHTMLel({sg: this.old_txt, le: LE_2});
            if (el_1b2a) {
                el_1b = el;
            }
            this.div.insertBefore(el, el_2b);
            this.div.removeChild(el_2b);
            if (el_1b2a) {
                this.div.removeChild(el_1b2a);
            } else if (el_2a) {
                this.div.removeChild(el_2a);
            }
        }
        if (el_1b) {
            var LE_1 = this.lineElements[this.idx_ss - 1];
            var LE_1b = this.lineElements[this.idx_ss];
            LE_1[1] = LE_1b[1];
            this.lineElements.splice(this.idx_ss, 1);
            el = this.addHTMLel({sg: this.old_txt, le: LE_1});
            this.div.insertBefore(el, el_1a);
            this.div.removeChild(el_1b);
            this.div.removeChild(el_1a);
            this.idx_ss--;
            this.idx_se--;
        }
        for (var i = this.idx_ss; i <= this.idx_se; i++) {
            var sLE = this.lineElements[i][2];
            var s = this.div.childNodes[i].style;
            if (sLE) {
                var idx = sLE.indexOf("color:");
                if (idx != -1) {
                    sLE = sLE.substring(idx + 6);
                    idx = sLE.indexOf(";");
                    sLE = sLE.substring(0, idx);
                    s.color = sLE;
                    sLE = this.lineElements[i][2];
                } else {
                    s.color = "";
                }
                idx = sLE.indexOf("backgroundColor:");
                if (idx != -1) {
                    sLE = sLE.substring(idx + 16);
                    idx = sLE.indexOf(";");
                    sLE = sLE.substring(0, idx);
                    s.backgroundColor = sLE;
                } else {
                    s.backgroundColor = "";
                }
            } else {
                s.color = "";
                s.backgroundColor = "";
            }
        }
    }
};
tw.prototype.setSelection = function (ar) {
    if (cb.caretIdx != cb.caretEnd) {
        var sO;
        if (ar.sg) {
            sO = {};
            var i;
            var p2 = gp({sg: ar.sg, lm: ";"});
            for (i = 0; p2 && i < p2.length; i++) {
                var nSt = gp({sg: p2[i]});
                sO[nSt[0]] = nSt[1];
            }
        }
        var el_1a = $("el_1a");
        if (el_1a) {
            el_1a.id = undefined;
        }
        var el_1b = $("el_1b");
        if (el_1b) {
            el_1b.id = undefined;
        }
        var el_2a = $("el_2a");
        if (el_2a) {
            el_2a.id = undefined;
        }
        var el_1b2a = $("el_1b2a");
        if (el_1b2a) {
            el_1b2a.id = undefined;
        }
        var el_2b = $("el_2b");
        if (el_2b) {
            el_2b.id = undefined;
        }
        for (i = this.idx_ss; i <= this.idx_se; i++) {
            var LE = this.lineElements[i];
            var s = this.div.childNodes[i].style;
            var stlObjLE = {color: "", backgroundColor: ""};
            if (LE[2]) {
                p2 = gp({sg: LE[2], lm: ";"});
                for (var j = 0; j < p2.length; j++) {
                    var items = gp({sg: p2[j]});
                    stlObjLE[items[0]] = items[1];
                }
            }
            for (stl in sO) {
                stlObjLE[stl] = sO[stl];
            }
            var sg = "";
            for (stl in stlObjLE) {
                if (stlObjLE[stl] != "") {
                    sg += stl + ":" + stlObjLE[stl] + ";";
                }
                s[stl] = stlObjLE[stl];
            }
            if (sg == "") {
                LE[2] = null;
            } else {
                LE[2] = sg;
            }
            if (ar.href) {
                LE[3] == ar.href;
            }
        }
    }
    cb.caretEnd = cb.caretIdx;
    this.setInp1Selection();
    er.et({obj: this});
    this.editting = true;
    this.getInp1Selection();
    this.addCaret();
    cb.inp1.focus();
};
tw.prototype.deleteSelection = function () {
    if (cb.caretIdx != cb.caretEnd) {
        var el_1a = $("el_1a");
        if (el_1a) {
            el_1a.id = undefined;
        }
        var el_1b = $("el_1b");
        if (el_1b) {
            el_1b.id = undefined;
        }
        var el_2a = $("el_2a");
        if (el_2a) {
            el_2a.id = undefined;
        }
        var el_1b2a = $("el_1b2a");
        if (el_1b2a) {
            el_1b2a.id = undefined;
        }
        var el_2b = $("el_2b");
        if (el_2b) {
            el_2b.id = undefined;
        }
        var start = this.lineElements[this.idx_ss][0];
        var end = this.lineElements[this.idx_se][1];
        this.old_txt = this.old_txt.substring(0, start) + this.old_txt.substring(end);
        for (var i = this.idx_se; i >= this.idx_ss; i--) {
            this.div.removeChild(this.div.childNodes[i]);
        }
        this.lineElements.splice(this.idx_ss, this.idx_se + 1 - this.idx_ss);
        this.shiftLEs({idx: this.idx_ss, delta: start - end});
        this.combineLEAdapt({idx: this.idx_ss - 1});
    }
};
tw.prototype.catchInTag = function (ar) {
    if (this.tag.match(ar.tpe)) {
        var i1 = this.tag.indexOf(ar.tpe + "=");
        var hrf = this.tag.substring(i1 + ar.tpe.length + 1);
        hrf = hrf.replace(/^\s+/, "");
        var ch = hrf[0];
        hrf = this.tag.substring(i1);
        var i2 = hrf.indexOf(ch);
        i2 += i1;
        hrf = this.tag.substring(i2 + 1);
        var i3 = hrf.indexOf(ch);
        i3 += i2 + 1;
        hrf = this.tag.substring(i2 + 1, i3);
        this.tag = this.tag.substring(0, i1) + this.tag.substring(i3 + 1);
        return hrf;
    } else {
        return null;
    }
};
tw.prototype.combineLEs = function () {
    for (var i = 0; i < this.lineElements.length; i++) {
        var LE = this.lineElements[i];
        while (i + 1 < this.lineElements.length) {
            var LEn = this.lineElements[i + 1];
            if (LE[2] == LEn[2] && LE[3] == LEn[3]) {
                LE[1] = LEn[1];
                this.lineElements.splice(i + 1, 1);
                if (this.iP) {
                    this.div.childNodes[i].innerHTML = this.d2[0].txt.substring(LE[0], LE[1]).replace(/./g, "*");
                } else {
                    this.div.childNodes[i].innerHTML = this.d2[0].txt.substring(LE[0], LE[1]).replace(/</g, "&#60;").replace(/ /g, "&nbsp;");
                }
                this.div.removeChild(this.div.childNodes[i + 1]);
            } else {
                break;
            }
        }
    }
};
tw.prototype.spliceLE = function (ar) {
    var LE = this.lineElements[ar.idx];
    this.d2[0].txt = this.d2[0].txt.substring(0, LE[0]) + this.d2[0].txt.substring(LE[1]);
    this.lineElements.splice(ar.idx);
    this.shiftLEs({idx: ar.idx, delta: LE[1] - LE[0]});
};
tw.prototype.htmlToTxt_new = function (ar) {
    for (var i = 0; ar.nd.childNodes && i < ar.nd.childNodes.length; i++) {
        var nd = ar.nd.childNodes[i];
        if (nd.childNodes) {
            this.htmlToTxt_new({nd: nd});
        } else if (nd.nodeType == 3) {
            debugger;
            if (nd.nodeValue) {
                this.lineElements.push([nd.nodeValue, null, null, null]);
            }
        } else if (nd.nodeName == "p") {
            if (nd.nodeValue) {
                this.lineElements.push([nd.nodeValue, null, null, null]);
            }
        } else if (nd.nodeName == "B") {
            if (nd.nodeValue) {
                this.lineElements.push([nd.nodeValue, null, "fontWeight:bold", null]);
            }
        } else if (nd.nodeName == "FONT") {
            debugger;
        } else if (nd.nodeName == "A") {
            debugger;
            this.lineElements.push([nd.nodeValue, null, null, nd.attributes.href]);
        } else if (nd.nodeName == "br") {
            debugger;
            try {
                var start = this.d2[0].txt.length;
                this.lineElements.push([start, start + 1, null, null]);
                this.d2[0].txt += "\n";
            } catch (e) {
            }
        } else {
            debugger;
        }
    }
};
tw.prototype.addLE = function (ar) {
    if (ar.sg == "") {
        return;
    }
    var start = this.d2[0].txt.length;
    var end = start + ar.sg.length;
    var LE = [start, end, ar.stle ? ar.stle : null, ar.href ? ar.href : null];
    this.lineElements.push(LE);
    this.d2[0].txt += ar.sg;
};
tw.prototype.htmlToTxt = function () {
    this.lineElements = [];
    var cpy = cb.inp1.value.replace(/\n/g, "<br>");
    cpy = cpy.replace(/\r/g, "");
    cpy = cpy.replace(/<div>/g, "");
    cpy = cpy.replace(/<\/div>/g, "");
    cpy = cpy.replace(/<p>/g, "<br>");
    cpy = cpy.replace(/<\/p>/g, "");
    cpy = cpy.replace(/<ul>/g, "<br>");
    cpy = cpy.replace(/<\/ul>/g, "<br>");
    cpy = cpy.replace(/<li>/g, " - ");
    cpy = cpy.replace(/<\/li>/g, "<br>");
    cpy = cpy.replace(/<\/font>/g, "");
    cpy = cpy.replace(/<br> */g, "<br>");
    cpy = cpy.replace(/<br>\s*<br>/g, "<br>");
    this.d2[0].txt = "";
    var firstpart;
    var secndpart;
    this.tag = null;
    var idx_1 = cpy.indexOf("<");
    var idx2 = cpy.indexOf(">", idx_1);
    while (idx_1 != -1) {
        firstpart = cpy.substring(0, idx_1);
        this.tag = cpy.substring(idx_1, idx2 + 1);
        secndpart = cpy.substring(idx2 + 1);
        if (this.tag.match(/<font/)) {
            cpy = firstpart + secndpart;
            idx_1 = cpy.indexOf("<", idx_1);
        } else {
            idx_1 = cpy.indexOf("<", idx_1 + 1);
        }
        idx2 = cpy.indexOf(">", idx_1);
    }
    idx_1 = cpy.indexOf("<");
    idx2 = cpy.indexOf(">", idx_1);
    while (idx_1 != -1) {
        firstpart = cpy.substring(0, idx_1);
        this.tag = cpy.substring(idx_1, idx2 + 1);
        this.tag = this.tag.replace(/\s+=/g, "=");
        secndpart = cpy.substring(idx2 + 1);
        var hrf = this.catchInTag({tpe: "href"});
        if (hrf) {
            hrf = hrf.replace(/http:\/\/www.ijssellijn.info\//, "").replace(/ijssellijn\/Files/, "Files");
        }
        var stl = this.catchInTag({tpe: "style"});
        if (this.tag.match(/<br/)) {
            this.addLE({sg: firstpart});
            this.addLE({sg: "\n", stle: "lf"});
            cpy = cpy.substring(idx2 + 1);
        } else if (this.tag.match(/<span/)) {
            this.addLE({sg: firstpart});
            cpy = cpy.substring(idx2 + 1);
            idx_1 = cpy.indexOf("<");
            idx2 = cpy.indexOf(">", idx_1);
            firstpart = cpy.substring(0, idx_1).replace(/\n/g, " ").replace(/\s+/g, " ");
            this.addLE({sg: firstpart, stle: stl});
            cpy = cpy.substring(idx2 + 1);
        } else if (this.tag.match(/<b/)) {
            this.addLE({sg: firstpart});
            cpy = cpy.substring(idx2 + 1);
            idx_1 = cpy.indexOf("<");
            idx2 = cpy.indexOf(">", idx_1);
            firstpart = cpy.substring(0, idx_1).replace(/\n/g, " ").replace(/\s+/g, " ");
            this.addLE({sg: firstpart, stle: "fontWeight:bold;"});
            cpy = cpy.substring(idx2 + 1);
        } else if (this.tag.match(/<i/)) {
            this.addLE({sg: firstpart});
            cpy = cpy.substring(idx2 + 1);
            idx_1 = cpy.indexOf("<");
            idx2 = cpy.indexOf(">", idx_1);
            firstpart = cpy.substring(0, idx_1).replace(/\n/g, " ").replace(/\s+/g, " ");
            this.addLE({sg: firstpart, stle: "fontStyle:italic;"});
            cpy = cpy.substring(idx2 + 1);
        } else if (this.tag.match(/<a/)) {
            debugger;
            this.addLE({sg: firstpart});
            cpy = cpy.substring(idx2 + 1);
            idx_1 = cpy.indexOf("<");
            idx2 = cpy.indexOf(">", idx_1);
            firstpart = cpy.substring(0, idx_1);
            firstpart = cpy.substring(0, idx_1).replace(/\n/g, " ").replace(/\s+/g, " ");
            this.addLE({sg: firstpart, href: hrf});
            cpy = cpy.substring(idx2 + 1);
        } else {
            this.addLE({sg: firstpart});
            this.tag = this.tag.substring(1);
            if (this.tag.match(/</) || this.tag.match(/\n/)) {
                this.addLE({sg: this.tag});
            }
            cpy = cpy.substring(idx2 + 1);
        }
        idx_1 = cpy.indexOf("<");
        idx2 = cpy.indexOf(">", idx_1);
    }
    if (cpy.length) {
        this.addLE({sg: cpy});
    }
    this.cleanText();
};
tw.prototype.getInp1Selection = function () {
    cb.caretIdx = 0;
    cb.caretEnd = 0;
    if (cb.inp1.setSelectionRange) {
        cb.caretIdx = cb.inp1.selectionStart;
        cb.caretEnd = cb.inp1.selectionEnd;
    } else if (document.selection) {
        cb.inp1.focus();
        var range;
        var textrange1;
        var textrange2;
        range = document.selection.createRange().duplicate();
        textrange1 = cb.inp1.createTextRange();
        textrange1.collapse(false);
        textrange1.moveToBookmark(range.getBookmark());
        if (range.text == "") {
            textrange2 = textrange1.duplicate();
            textrange2.moveEnd("character", 1);
            if (range.boundingWidth === textrange2.boundingWidth &&
                range.boundingHeight === textrange2.boundingHeight) {
                textrange1 = textrange2;
            }
        }
        var text = textrange1.text;
        cb.caretIdx = Math.abs(textrange1.moveStart("character", -1000000));
        cb.caretEnd = text.length + cb.caretIdx;
    }
    this.idx_ss = this.findLE({idx: cb.caretIdx});
    if (cb.caretEnd == cb.caretIdx) {
        this.idx_se = this.idx_ss;
    } else {
        this.idx_se = this.findLE({idx: cb.caretEnd - 1});
    }
};
tw.prototype.setInp1Selection = function () {
    cb.inp1.focus();
    if (cb.inp1.setSelectionRange) {
        cb.inp1.setSelectionRange(cb.caretIdx, cb.caretEnd);
        cb.inp1.selectionStart = cb.caretIdx;
        cb.inp1.selectionEnd = cb.caretEnd;
    } else if (cb.inp1.createTextRange) {
        var range = cb.inp1.createTextRange();
        range.collapse(true);
        range.moveEnd("character", cb.caretEnd);
        range.moveStart("character", cb.caretIdx);
        var textRange = cb.inp1.createTextRange();
        var idx = cb.inp1.value.indexOf("\r\n");
        while (idx != -1 && idx < cb.caretIdx) {
            cb.caretIdx -= 0.5;
            idx = cb.inp1.value.substring(idx + 1).indexOf("\r\n");
        }
        idx = cb.inp1.value.indexOf("\r\n");
        while (idx != -1 && idx < cb.caretEnd) {
            cb.caretEnd -= 0.5;
            idx = cb.inp1.value.substring(idx + 1).indexOf("\r\n");
        }
        textRange.moveEnd("textedit", -1);
        textRange.moveStart("character", cb.caretIdx);
        textRange.moveEnd("character", cb.caretEnd - cb.caretIdx);
        textRange.select();
    }
};
tw.prototype.shiftLEs = function (ar) {
    var delta = ar.delta;
    if (ar.start || ar.start == 0) {
        delta = ar.start - this.lineElements[0][0];
    }
    if (delta == 0) {
        return;
    }
    for (var i = ar.idx; i < this.lineElements.length; i++) {
        this.lineElements[i][0] += delta;
        this.lineElements[i][1] += delta;
    }
};
tw.prototype.upLEs = function (ar) {
    var idx = this.pt.o2.indexOf(this);
    if (idx == 0) {
        return;
    }
    var up = this.pt.o2[idx - 1];
    if (!up.addLEs) {
        return;
    }
    var obj = this.deleteLEs({st: 0, end: ar.nr - 1});
    up.addLEs(obj);
};
tw.prototype.downLEs = function (ar) {
    var idx = this.pt.o2.indexOf(this);
    if (idx == this.pt.o2.length - 1) {
        return;
    }
    var down = this.pt.o2[idx + 1];
    if (!down.addLEs) {
        return;
    }
    var l = this.lineElements.length;
    var obj = this.deleteLEs({st: l - ar.nr - 1, end: l - 1});
    obj.start = 0;
    down.addLEs(obj);
};
tw.prototype.deleteLEs = function (ar) {
    this.extractStrng();
    var l = this.lineElements.length;
    if (ar.st > l) {
        return [];
    }
    if (ar.end >= l) {
        ar.end = l - 1;
    }
    var LE1 = this.lineElements[ar.st];
    var LE2 = this.lineElements[ar.end];
    var start = LE1[0];
    var end = LE2[1];
    var delta = start - end;
    var txt = this.d2[0].txt.substring(start, end);
    this.d2[0].txt = this.d2[0].txt.substring(0, start) + this.d2[0].txt.substring(end);
    var LEs = this.lineElements.splice(ar.st, ar.end - ar.st + 1);
    this.shiftLEs({idx: ar.st, delta: delta});
    this.sCd();
    return {les: LEs, sg: txt};
};
tw.prototype.addLEs = function (ar) {
    this.extractStrng();
    if (!ar.idx) {
        ar.idx = this.lineElements.length;
    }
    var LE = this.lineElements[ar.idx - 1];
    if (!LE) {
        ar.idx = 0;
        LE = [0, 0, 0, 0];
    }
    var start = LE[0];
    var LEs = ar.les;
    LE = LEs[LEs.length - 1];
    var end = LE[1];
    this.shiftLEs({idx: ar.idx, start: end});
    for (var i = LEs.length - 1; i >= 0; i--) {
        this.lineElements.splice(ar.idx, 0, LEs[i]);
    }
    this.d2[0].txt = this.d2[0].txt.substring(0, start) + ar.sg + this.d2[0].txt.substring(start);
    this.sCd();
};
tw.prototype.sT = function (ar) {
    this.d2[0].sT(ar);
};
var iW = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( iW, sw);
iW.prototype.sm = {Cl:'iW',inr:0};
iW.prototype.sm.isL = 'true';
iW.prototype.sm.it = function (ar) {
    sw.prototype.sm.it.call(this, ar);
    
    var img = dce("img");
    this.div.appendChild(img);
    if (this.STt != "ld") {
        this.sP({path: ar && ar.path ? ar.path : "shared/leeg.gif"});
    }
};
iW.prototype.idb = function () {
    sw.prototype.idb.call(this);
    this.sP({path: this.fd[2] ? this.fd[2] : "shared/leeg.gif"});
};
iW.prototype.cdc = function () {
    this.Ct += this.path;
};
iW.prototype.sP = function (ar) {
    this.path = ar.path;
    var img = this.div.childNodes[0];
    if (/MSIE (5\.5|6\.)/.test(navigator.userAgent)) {
        img.style.width = "50px";
        img.style.height = "50px";
        img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.path + "', sizingMethod='scale')";
        img.src = "shared/x.gif";
    } else {
        img.setAttribute("src", this.path);
    }
};
iW.prototype.rd = function () {
    sw.prototype.rd.call(this);
    var at = this.acc;
    var s = this.div.style;
    s.width = at.w + "px";
    s.height = at.h + "px";
    s = this.div.childNodes[0].style;
    s.width = at.w + "px";
    s.height = at.h + "px";
};
iW.prototype.naturalSize = function () {
    return [this.div.childNodes[0].naturalWidth, this.div.childNodes[0].naturalHeight];
};
var miw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( miw, iW);
miw.prototype.sm = {Cl:'miw',inr:0};
miw.prototype.sm.it = function (ar) {
    iW.prototype.sm.it.call(this, ar);
    
    this.pts = ar && ar.pts ? ar.pts : ["shared/leeg.png"];
    this.on();
};
miw.prototype.idb = function () {
    sw.prototype.idb.call(this);
    this.pts = gp({sg: this.fd[2], lm: ";"});
};
miw.prototype.cdc = function () {
    for (var i = 0; i < this.pts.length; i++) {
        this.Ct += this.pts[i] + ";";
    }
};
miw.prototype.six = function (ar) {
    this.idx = ar.idx;
    if (this.idx >= this.pts.length) {
        this.idx = this.pts.length - 1;
    } else if (this.idx < 0) {
        this.idx = 0;
    }
    this.sP({path: this.pts[this.idx] ? this.pts[this.idx] : "shared/leeg.png"});
    this.path = this.pts[this.idx];
};
miw.prototype.on = function () {
    this.six({idx: 0});
};
miw.prototype.off = function (ar) {
    this.six({idx: 1});
};
var GoogleMapWidget = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( GoogleMapWidget, sw);
GoogleMapWidget.prototype.sm = {Cl:'GoogleMapWidget',inr:0};
GoogleMapWidget.prototype.sm.isL = 'true';
GoogleMapWidget.prototype.sm.it = function (ar) {
    sw.prototype.sm.it.call(this, ar);
    
    var map = dce("div");
    this.div.appendChild(map);
    if (ar && ar.path) {
        this.sP({path: ar.path});
    }
};
GoogleMapWidget.prototype.idb = function () {
    sw.prototype.idb.call(this);
    if (this.html) {
        var idx = this.html.indexOf("?");
        this.html = this.html.substring(idx + 1);
        var idx = this.html.indexOf("output=embed");
        this.html = this.html.substring(0, idx);
        this.sP({path: this.html});
        this.html = undefined;
        this.sCd();
    } else if (this.fd[2]) {
        this.sP({path: this.fd[2]});
    }
};
GoogleMapWidget.prototype.cdc = function () {
    this.Ct += this.path;
};
GoogleMapWidget.prototype.sP = function (ar) {
    this.path = ar.path;
    this.div.childNodes[0].innerHTML = "<iframe width=\"300\" height=\"300\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"http://maps.google.com/maps/ms?" + this.path + "output=embed\"></iframe><br /><small><a href=\"http://maps.google.com/maps/ms?" + this.path + "\" style=\"color:#0000FF;text-align:left\">weergeven op een grotere kaart</a></small>";
};
GoogleMapWidget.prototype.rd = function () {
    sw.prototype.rd.call(this);
    var at = this.acc;
    var s = this.div.style;
    s.width = at.w + "px";
    s.height = at.h + "px";
    this.div.childNodes[0].childNodes[0].setAttribute("width", at.w);
    this.div.childNodes[0].childNodes[0].setAttribute("height", at.h);
};
var aw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( aw, sw);
aw.prototype.sm = {Cl:'aw',inr:0};
aw.prototype.sm.it = function (ar) {
    sw.prototype.sm.it.call(this, ar);
    
    this.o2 = [];
};
aw.prototype.idb = function () {
    sw.prototype.idb.call(this);
    var o2 = gp({sg: this.fd[3], lm: ";"});
    for (var i = 0; o2 && i < o2.length; i++) {
        var id = o2[i];
        if (id && DB[id]) {
            var cs;
            if (typeof DB[id] == "string") {
                var fd = gp({sg: DB[id], lm: "q;"});
                cs = fd[1];
                if (!window[cs]) {
                    new DBnokWidget({id: id, intree: false});
                } else {
                    eval("new " + fd[1] + "({id:'" + id + "', STt:'ld', intree:true})");
                }
            }
            DB[id].fd = fd;
            DB[id].idb();
            if (window[cs]) {
                this.bc({obj: DB[id]});
            } else {
                this.sCd();
            }
        }
    }
    var Ct = gp({sg: this.fd[2], lm: "|"});
    if (Ct != "") {
        if (this.sm.Cl == "bw" ||
            this.sm.Cl == "HoverButtonWidget") {
        } else if (this.name == "stage") {
            Site.dynamics = Ct[1] && window[Ct[1]] ? window[Ct[1]] : dyd;
            if (Ct[0] && DB[Ct[0]]) {
                ait.sMenu = DB[Ct[0]];
            } else {
                ait.sMenu = new Menu({sr: "N,,menu,;"});
                var mw1 = new mw({menu: ait.sMenu});
                ait.stage.bc({obj: mw1});
            }
        } else if (Ct.length) {
            this.st = {aw: this, h_a: []};
            States.arr.push(this.st);
            for (var i = 0; i < Ct.length; i++) {
                if (Ct[i] != "e") {
                    this.st.h_a.push(Ct[i]);
                }
            }
        }
    }
};
aw.prototype.cdc = function () {
    if (this.name == "stage") {
        this.Ct += ait.sMenu.id;
        this.Ct += "|";
        this.Ct += Site.dynamics == dyd ? "" : Site.dynamics.sm.Cl.replace(/St/, "");
        this.Ct += "|";
    } else if (this.st) {
        if (this.st.h_a.length == 0) {
            this.Ct += "e";
        } else {
            for (var j = 0; j < this.st.h_a.length; j++) {
                this.Ct += this.st.h_a[j] + "|";
            }
        }
    }
};
aw.prototype.redrawTree = function () {
    if (this.st && this != Site.dynamics.newState) {
        return;
    }
    this.rd();
    if (this._wrapped) {
        var wrap_w = 10;
        var wrap_h = 10;
        for (var i = 0; i < this.o2.length; i++) {
            var cd = this.o2[i];
            cd.redrawTree();
            if (wrap_w < cd.div.offsetLeft + cd.div.offsetWidth + 1) {
                wrap_w = cd.div.offsetLeft + cd.div.offsetWidth + 1;
            }
            if (wrap_h < cd.div.offsetTop + cd.div.offsetHeight + 1) {
                wrap_h = cd.div.offsetTop + cd.div.offsetHeight + 1;
            }
        }
        if (wrap_w > 10) {
            this.te.w = wrap_w / this.acc.s;
            this.te.h = wrap_h / this.acc.s;
            this.rd();
        }
    } else {
        for (var i = 0; i < this.o2.length; i++) {
            var cd = this.o2[i];
            cd.redrawTree();
        }
    }
};
aw.prototype.set_box = function () {
    if (!this.o2) {
        return;
    }
    var x_min = this.o2[0];
    var y_min = this.o2[0];
    var x_max = this.o2[0];
    var y_max = this.o2[0];
    for (var i = 1; i < this.o2.length; i++) {
        var cd = this.o2[i];
        if (x_min.acc.x > cd.acc.x) {
            x_min = cd;
        }
        if (y_min.acc.y > cd.acc.y) {
            y_min = cd;
        }
        if (x_max.acc.x + x_max.acc.w < cd.acc.x + cd.acc.w) {
            x_max = cd;
        }
        if (y_max.acc.y + y_max.acc.h < cd.acc.y + cd.acc.h) {
            y_max = cd;
        }
    }
    var dx = this.acc.x - x_min.acc.x - 1;
    this.te.x -= dx / this.pt.acc.s;
    if (this.te.x < 0) {
        this.te.x--;
    }
    var dy = this.acc.y - y_min.acc.y - 1;
    this.te.y -= dy / this.pt.acc.s;
    if (this.te.y < 0) {
        this.te.y--;
    }
    var _w = x_max - x_min;
    this.te.w = (x_max + 1 - x_min) / this.acc.s;
    this.te.h = (y_max + 1 - y_min) / this.acc.s;
    dx = dx / this.acc.s;
    dy = dy / this.acc.s;
    for (var i = 0; i < this.o2.length; i++) {
        var cd = this.o2[i];
        cd.te.x += dx;
        cd.te.y += dy;
        this.rd();
    }
    this.rd();
};
aw.prototype.ase = function (ar) {
    sw.prototype.ase.call(this, ar);
    if (ar.pr == "opacity") {
        for (var i = 0; i < this.o2.length; i++) {
            this.o2[i].ase(ar);
        }
    }
};
aw.prototype.removeChild = function (ar) {
    var idx = null;
    var obj = null;
    if (ar.idx || ar.idx == 0) {
        idx = ar.idx;
        obj = this.o2[idx];
    } else {
        obj = ar.obj;
        idx = this.o2.indexOf(obj);
    }
    this.ucd({idx: idx});
    obj.rv();
};
aw.prototype.rac = function () {
    while (this.o2.length) {
        this.removeChild({idx: this.o2.length - 1});
    }
};
aw.prototype.rv = function () {
    this.rac();
    if (this.name && ait[this.name + "_css"]) {
        ait[this.name + "_css"].rv();
        ait[this.name + "_css"] = null;
    }
    sw.prototype.rv.call(this);
};
aw.prototype.setName = function (ar) {
    if (ar && ar.sg) {
        var onm = null;
        var oldcss = null;
        if (this.name) {
            onm = this.name;
            ait[onm] = null;
            oldcss = ait[onm + "_css"];
            if (oldcss) {
                ait[onm + "_css"] = null;
            }
        }
        this.name = ar.sg;
        ait[this.name] = this;
        if (oldcss) {
            ait[this.name + "_css"] = oldcss;
            oldcss.aW = this.name;
        } else {
            ait[this.name + "_css"] = new CSS({aW: this.name});
        }
        this.nE({enm: "changedName", sg: this.name});
        this.sCd();
    }
};
aw.prototype.unm = function () {
    if (this.name) {
        var css = ait[this.name + "_css"];
        css.rv();
        ait[this.name + "_css"] = null;
        ait[this.name] = null;
        this.name = null;
        this.nE({enm: "changedName", sg: ""});
        this.sCd();
    }
};
aw.prototype.sri = function () {
    for (var i = 0; this.d2 && i < this.d2.length; i++) {
        this.d2[i].STt = "ll";
    }
    dbr.prototype.sri.call(this);
    for (var i = 0; i < this.o2.length; i++) {
        this.o2[i].STt = "ll";
    }
};
aw.prototype.bc = function (ar) {
    var idx = ar.idx;
    var obj = ar.obj;
    if (idx != null && idx >= 0 && idx < this.o2.length) {
        this.o2.splice(idx, 0, obj);
        this.div.insertBefore(obj.div, this.o2[idx + 1].div);
        if (this.otree_node && obj.otree_node) {
            var idx2 = 0;
            if (idx > 0) {
                var sibl = this.o2[idx - 1].otree_node;
                idx2 = this.otree_node.childslist.o2.indexOf(sibl) + 1;
                if (sibl.childslist) {
                    idx2++;
                }
            }
            if (obj.otree_node.childslist) {
                this.otree_node.childslist.bc({obj: obj.otree_node.childslist, idx: idx2});
            }
            this.otree_node.childslist.bc({obj: obj.otree_node, idx: idx2});
        }
    } else {
        this.o2.push(obj);
        this.div.appendChild(obj.div);
        if (this.otree_node && obj.otree_node) {
            this.otree_node.childslist.bc({obj: obj.otree_node});
        }
    }
    obj.pt = this;
    if (ar.w || ar.w == 0) {
        obj.te.w = parseInt("" + ar.w);
    }
    if (ar.h || ar.h == 0) {
        obj.te.h = parseInt("" + ar.h);
    }
    if (ar.x || ar.x == 0) {
        obj.te.x = parseInt("" + ar.x);
    }
    if (ar.y || ar.y == 0) {
        obj.te.y = parseInt("" + ar.y);
    }
    if (ar.s || ar.s == 0) {
        obj.te.s = ar.s;
    }
    if (ar.o || ar.o == 0) {
        obj.te.o = ar.o;
    }
    if (!obj.style) {
        if (ar.style) {
            obj.style = ar.style;
        } else if (this.style) {
            obj.style = this.style;
        }
    }
    if (this.STt == "ll") {
        obj.sri();
    }
    this.sCd();
};
aw.prototype.ucd = function (ar) {
    if (!this.o2) {
        return;
    }
    var idx = null;
    var obj = null;
    if (ar.idx || ar.idx == 0) {
        idx = ar.idx;
        obj = this.o2[idx];
    } else {
        obj = ar.obj;
        idx = this.o2.indexOf(obj);
    }
    this.o2.splice(idx, 1);
    obj.pt = null;
    this.div.removeChild(obj.div);
    if (this.otree_node && obj.otree_node) {
        this.otree_node.childslist.ucd({obj: obj.otree_node});
        if (obj.otree_node.childslist) {
            this.otree_node.childslist.ucd({obj: obj.otree_node.childslist});
        }
        this.otree_node.rd();
    }
    this.sCd();
    return obj;
};
aw.prototype.toIndexChild = function (ar) {
    var idx1 = ar.idx1;
    var idx2 = ar.idx2;
    var obj = this.o2[idx1];
    if (idx1 != null &&
        idx1 >= 0 &&
        idx1 <= this.o2.length - 1 &&
        idx2 != null && idx2 >= 0 && idx2 <= this.o2.length - 1) {
        var cd = this.ucd({idx: idx1});
        this.bc({obj: cd, idx: idx2});
    }
};
aw.prototype.aal = function () {
    this.atv();
    for (var i = 0; i < this.o2.length; i++) {
        if (this.o2[i].aal) {
            this.o2[i].aal();
        }
    }
};
aw.prototype.dal = function () {
    this.deactivate();
    for (var i = 0; i < this.o2.length; i++) {
        if (this.o2[i].dal) {
            this.o2[i].dal();
        }
    }
};
aw.prototype.eal = function () {
    for (var i = 0; i < this.o2.length; i++) {
        var cd = this.o2[i];
        if (cd.dn &&
            cd.dn[0] && cd.dn[0].eE) {
            cd.dn[0].eE();
        }
        if (cd.eal) {
            cd.eal();
        }
    }
};
aw.prototype.da = function () {
    for (var i = 0; i < this.o2.length; i++) {
        var cd = this.o2[i];
        if (cd.dn &&
            cd.dn[0] && cd.dn[0].dE) {
            cd.dn[0].dE();
        }
        if (cd.da) {
            cd.da();
        }
    }
};
aw.prototype.algLeft = function (ar) {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.algLeft(ar);
};
aw.prototype.algRight = function (ar) {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.algRight(ar);
};
aw.prototype.algTop = function (ar) {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.algTop();
};
aw.prototype.algBot = function (ar) {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.algBot();
};
aw.prototype.algVC = function () {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.algVC();
};
aw.prototype.algHC = function () {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.algHC();
};
aw.prototype.forceH = function () {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.forceH();
};
aw.prototype.forceV = function () {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.forceV();
};
aw.prototype.distrH = function () {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.distrH();
};
aw.prototype.distrV = function () {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.distrV();
};
aw.prototype.listH = function () {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.listH();
    sel.algTop();
};
aw.prototype.listV = function () {
    var sel = new SelectionWidget({obj: this, clipped: this.clipped ? this.clipped : undefined, scrollX: this.scrollX ? this.scrollX : undefined, scrollY: this.scrollY ? this.scrollY : undefined});
    sel.listV();
    sel.algLeft();
};
var DBnokWidget = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( DBnokWidget, sw);
DBnokWidget.prototype.sm = {Cl:'DBnokWidget',inr:0};
DBnokWidget.prototype.sm.it = function (ar) {
    sw.prototype.sm.it.call(this, ar);
    
    var img = dce("img");
    this.div.appendChild(img);
    if (this.STt != "ld") {
        this.sP({path: ar && ar.path ? ar.path : "shared/leeg.gif"});
    }
};
DBnokWidget.prototype.idb = function () {
    this.fd = null;
    this.STt = "rv";
};
DBnokWidget.prototype.rd = function () {
};
var Fw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( Fw, aw);
Fw.prototype.sm = {Cl:'Fw',inr:0};
Fw.prototype.sm.it = function (ar) {
    aw.prototype.sm.it.call(this, ar);
    
};
Fw.prototype.addInput = function (ar) {
    var sg = ar && ar.sg ? ar.sg : this.hlabel_input;
    var data = ar && ar.data ? ar.data : null;
    var intree = this.intree ? true : false;
    if (!ar) {
        this.htype_label = null;
    }
    var last_input;
    for (var i = 0; i < this.o2.length; i++) {
        var child_i = this.o2[i];
        if (child_i.sm.Cl == "iw") {
            last_input = child_i;
        }
    }
    var label = new tw({t1: sg});
    if (this.intree) {
        ait.oTree.createWidget({obj: label});
    }
    this.bc({obj: label});
    var w_label = label.te.w;
    var inp = new iw({data: data, label: label, ol: ar && ar.ol, iP: ar && ar.iP, requird: ar && ar.requird});
    if (this.intree) {
        ait.oTree.createWidget({obj: inp});
    }
    this.bc({obj: inp});
    label.te.x = 20;
    if (!last_input) {
        label.te.y = 20;
        label.te.h = 20;
        inp.te.x = 40 + w_label;
        inp.te.y = 20;
        inp.te.w = 200;
        inp.te.h = 20;
        this.te.h = 60;
    } else {
        this.te.h += 30;
        var last_label = last_input.label;
        label.te.x = last_label.te.x;
        label.te.y = last_label.te.y + last_label.te.h + 10;
        label.te.w = last_label.te.w;
        label.te.h = last_label.te.h;
        label.te.s = last_label.te.s;
        label.te.o = last_label.te.o;
        inp.te.x = last_input.te.x;
        inp.te.y = label.te.y;
        inp.te.w = last_input.te.w;
        inp.te.h = last_input.te.h;
        inp.te.s = last_input.te.s;
        inp.te.o = last_input.te.o;
        if (w_label > last_label.te.w) {
            for (var i = 0; i < this.o2.length; i++) {
                var input = this.o2[i];
                if (input.sm.Cl == "iw") {
                    input.label.te.w = w_label;
                    input.te.x = 40 + w_label;
                }
            }
        } else {
            w_label = last_label.te.w;
        }
    }
    this.te.w = 260 + w_label;
    return inp;
};
Fw.prototype.addSendButton = function (ar) {
    var sg = ar && ar.sg ? ar.sg : "send";
    var b2 = new bw({t1: sg, klik: "DB[\"" + this.id + "\"].ckF();", STt: "ll", intree: false});
    this.bc({obj: b2});
    this.te.h += b2.te.h + 13;
    b2.te.x = this.te.w - b2.te.w - 10;
    b2.te.y = this.te.h - b2.te.h - 10;
    return b2;
};
Fw.prototype.addKillButton = function (ar) {
    var b2 = new bw({t1: "X", klik: "DB[\"" + this.id + "\"].rv();", b5: bDD.grs({sg: "bwToggle_default"}), STt: "ll", intree: false});
    this.te.h += b2.te.h + 6;
    for (var i = 0; i < this.o2.length; i++) {
        this.o2[i].te.y += b2.te.h + 6;
    }
    b2.te.x = this.te.w - b2.te.w - 6;
    b2.te.y = 3;
    this.bc({obj: b2});
    return b2;
};
Fw.prototype.clickOn = function (ar) {
    cb.nuc({obj: this.o2[1].dn[0]});
};
Fw.prototype.ckF = function () {
    Site.ssb({sg: "De gegevens worden nagekeken.", targ: this});
    var sg = "";
    var child_o;
    for (var i = this.o2.length - 1; i >= 0; i--) {
        var input = this.o2[i];
        if (input.requird) {
            var result = input.checkRequired();
            if (result != "") {
                sg = result + sg;
                child_o = input;
            }
        }
        if (input.check) {
            var result = input[input.check]();
            if (result != "") {
                sg = "\n" + this.label.d2[0].txt + " : " + result + sg;
                child_o = input;
            }
        }
    }
    if (child_o) {
        sg = "Bekijk de volgende velden:\n" + sg;
        alert(sg);
        cb.nuc({obj: child_o.dn[0]});
        this.aal();
    } else {
        this.sendForm();
    }
};
Fw.prototype.sendForm = function () {
    Site.ssb({sg: "De gegevens worden verwerkt.", targ: this});
    if (this.s_meth) {
        eval(this.s_meth);
    } else {
        var sg = "";
        for (var i = 0; i < this.o2.length; i++) {
            var child_i = this.o2[i];
            if (child_i.sm.Cl == "iw") {
                sg += child_i.label.d2[0].txt + ":" + eval(child_i.data) + "\n";
            }
        }
        alert(sg);
        this.clearForm();
        this.aal();
    }
};
Fw.prototype.clearForm = function () {
    for (var i = 0; i < this.o2.length; i++) {
        var child_i = this.o2[i];
        if (child_i.clearF) {
            child_i.clearF();
        }
    }
};
var fw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( fw, Fw);
fw.prototype.sm = {Cl:'fw',inr:0};
fw.prototype.sm.it = function (ar) {
    Fw.prototype.sm.it.call(this, ar);
    
};
fw.prototype.send = function (ar) {
    ar.mg = ar.mg.replace(/m=qqq/g, "m=").replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/'/g, "\\\\\\'").replace(/%/g, "%25").replace(/&/g, "%26").replace(/\+/g, "%2B") + "q;";
    ax.send({url: rdb.path + "mlf", mg: ar.mg + "&tm=" + (new Date).getTime(), obj: this, pm: ar.pm});
};
fw.prototype.sendForm = function () {
    Site.ssb({sg: "De gegevens worden opgestuurd.", targ: this});
    var mailstring = "m=";
    for (var i = 0; i < this.o2.length; i++) {
        var child_i = this.o2[i];
        if (child_i.sm.Cl == "iw") {
            mailstring += child_i.label.d2[0].txt + ":" + eval(child_i.data) + ";";
        }
    }
    this.send({mg: mailstring, pm: "postSend"});
};
fw.prototype.postSend = function (ar) {
    if (ar.match(/error/)) {
        Site.ssb({sg: "Er is iet mis gegaan, probeer later nogmaals te verzenden"});
    } else {
        Site.ssb({sg: "De gegevens zijn ontvangen."});
        this.clearForm();
    }
    this.aal();
};
var vuw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( vuw, sw);
vuw.prototype.sm = {Cl:'vuw',inr:0};
vuw.prototype.sm.isL = 'true';
vuw.prototype.sm.it = function (ar) {
    sw.prototype.sm.it.call(this, ar);
    
    var mov = dce("div");
    this.div.appendChild(mov);
    if (ar && ar.path) {
        this.sP({path: ar.path});
    }
};
vuw.prototype.idb = function () {
    sw.prototype.idb.call(this);
    if (this.fd[2]) {
        this.sP({path: this.fd[2]});
    }
};
vuw.prototype.cdc = function () {
    this.Ct += this.path;
};
vuw.prototype.sP = function (ar) {
    this.path = ar.path;
    this.div.childNodes[0].innerHTML = "<embed src='http://www.youtube.com/v/" + this.path + "&autoplay=1&rel=0' type='application/x-shockwave-flash' wmode='transparent' width='" + this.acc.w + "' height='" + this.acc.h + "' />";
};
vuw.prototype.rd = function () {
    sw.prototype.rd.call(this);
    var at = this.acc;
    var s = this.div.style;
    s.width = at.w + "px";
    s.height = at.h + "px";
    this.div.childNodes[0].childNodes[0].setAttribute("width", at.w);
    this.div.childNodes[0].childNodes[0].setAttribute("height", at.h);
};
var SelectionWidget = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
SelectionWidget.prototype.sm = {Cl:'SelectionWidget',inr:0};
SelectionWidget.prototype.sm.it = function (ar) {
    
    var color = "gold";
    var tpe = "solid";
    var _bw = "1px";
    this.te = {o: 1};
    this.lft = dce("div");
    document.body.appendChild(this.lft);
    var s = this.lft.style;
    s.position = "absolute";
    s.backgroundColor = color;
    s.borderColor = color;
    s.borderStyle = tpe;
    s.borderWidth = _bw;
    s.width = _bw;
    this.tp = dce("div");
    document.body.appendChild(this.tp);
    s = this.tp.style;
    s.position = "absolute";
    s.backgroundColor = color;
    s.borderColor = color;
    s.borderStyle = tpe;
    s.borderWidth = _bw;
    s.height = _bw;
    this.rht = dce("div");
    document.body.appendChild(this.rht);
    s = this.rht.style;
    s.position = "absolute";
    s.backgroundColor = color;
    s.borderColor = color;
    s.borderStyle = tpe;
    s.borderWidth = _bw;
    s.width = _bw;
    this.dwn = dce("div");
    document.body.appendChild(this.dwn);
    s = this.dwn.style;
    s.position = "absolute";
    s.backgroundColor = color;
    s.borderColor = color;
    s.borderStyle = tpe;
    s.borderWidth = _bw;
    s.height = _bw;
    this.magn = dce("div");
    document.body.appendChild(this.magn);
    dct(this.magn, "M");
    s = this.magn.style;
    s.position = "absolute";
    s.color = "#000";
    s.border = "solid 1px";
    s.backgroundColor = color;
    s.cursor = "pointer";
    s.width = "12px";
    s.height = "12px";
    s.fontSize = "10px";
    s.zIndex = "2";
    this.magn.obj = this;
    addEvent(this.magn, "mousedown", mv.mf, false);
    this.opac = dce("div");
    document.body.appendChild(this.opac);
    dct(this.opac, "O");
    s = this.opac.style;
    s.position = "absolute";
    s.color = "#000";
    s.border = "solid 1px";
    s.backgroundColor = color;
    s.cursor = "se-resize";
    s.width = "12px";
    s.height = "12px";
    s.fontSize = "10px";
    s.zIndex = "2";
    this.opac.obj = this;
    addEvent(this.opac, "mousedown", mv.fade, false);
    this.drag = dce("div");
    document.body.appendChild(this.drag);
    dct(this.drag, "D");
    s = this.drag.style;
    s.position = "absolute";
    s.color = "#000";
    s.border = "solid 1px";
    s.backgroundColor = color;
    s.cursor = "pointer";
    s.width = "12px";
    s.height = "12px";
    s.fontSize = "10px";
    s.zIndex = "2";
    this.drag.obj = this;
    addEvent(this.drag, "mousedown", mv.me, false);
    this.size = dce("div");
    document.body.appendChild(this.size);
    dct(this.size, "S");
    s = this.size.style;
    s.position = "absolute";
    s.color = "#000";
    s.border = "solid 1px";
    s.backgroundColor = color;
    s.cursor = "se-resize";
    s.width = "12px";
    s.height = "12px";
    s.fontSize = "10px";
    s.zIndex = "2";
    this.size.obj = this;
    addEvent(this.size, "mousedown", mv.resize, false);
    this.info = dce("div");
    document.body.appendChild(this.info);
    this.info.id = "info";
    s = this.info.style;
    s.position = "absolute";
    s.color = "#000";
    s.border = "solid 1px";
    s.backgroundColor = color;
    s.width = "150px";
    s.height = "150px";
    s.fontSize = "11px";
    s.fontFamily = "courier new";
    s.whiteSpace = "pre";
    if (ar) {
        if (ar.obj && ar.obj.o2) {
            for (var i = 0; i < ar.o2.length; i++) {
                this.itemClick({obj: ar.o2[i]});
            }
        }
    } else {
        this.o2 = [];
    }
};
SelectionWidget.prototype.rd = function () {
    if (!this.x_min || !this.y_min || !this.x_max || !this.y_max) {
        return;
    }
    for (var i = 0; i < this.o2.length; i++) {
        this.o2[i].rd();
    }
    this.te.x = this.x_min.acc.x;
    this.te.y = this.y_min.acc.y;
    this.te.w = this.x_max.acc.x + this.x_max.acc.w - this.te.x;
    this.te.h = this.y_max.acc.y + this.y_max.acc.h - this.te.y;
    if (this.o2.length == 1) {
        this.te.o = this.o2[0].te.o;
    }
    var tlx = this.te.x - 3 + "px";
    var tly = this.te.y - 3 + "px";
    var trx = this.te.x + this.te.w + 3 + "px";
    var dly = this.te.y + this.te.h + 3 + "px";
    var w = this.te.w + 6 + "px";
    var h = this.te.h + 6 + "px";
    s = this.lft.style;
    s.left = tlx;
    s.top = tly;
    s.height = h;
    s = this.tp.style;
    s.left = tlx;
    s.top = tly;
    s.width = w;
    s = this.rht.style;
    s.left = trx;
    s.top = tly;
    s.height = h;
    s = this.dwn.style;
    s.left = tlx;
    s.top = dly;
    s.width = w;
    tlx = this.te.x - 14 + "px";
    tly = this.te.y - 14 + "px";
    trx = this.te.x + this.te.w + 2 + "px";
    dly = this.te.y + this.te.h + 2 + "px";
    w = this.te.w + 6 + "px";
    h = this.te.h + 6 + "px";
    s = this.drag.style;
    s.left = tlx;
    s.top = tly;
    s = this.size.style;
    if (this.o2.length == 1) {
        s.display = "block";
        s.left = trx;
        s.top = dly;
    } else {
        s.display = "none";
    }
    s = this.magn.style;
    s.left = trx;
    s.top = tly;
    s = this.opac.style;
    s.left = this.te.x + (1 - this.te.o) * this.te.w + "px";
    s.top = dly;
    var rt = this.o2[0];
    var t = rt.te;
    var at = rt.acc;
    var stxt = ("" + at.s).substring(0, 4);
    var rstxt = ("" + t.s).substring(0, 4);
    var rotxt = ("" + t.o).substring(0, 4);
    var text = " ";
    text += "\n";
    var max = text.length;
    var line = " Acc x:" + (at.x + 0.5 | 0) + " y:" + (at.y + 0.5 | 0) + " w:" + (at.w + 0.5 | 0) + " h:" + (at.h + 0.5 | 0) + " s:" + stxt + "\n";
    if (max < line.length) {
        max = line.length;
    }
    text += line;
    line = " Rel x:" + (t.x + 0.5 | 0) + " y:" + (t.y + 0.5 | 0) + " w:" + (t.w + 0.5 | 0) + " h:" + (t.h + 0.5 | 0) + " s:" + rstxt + " o:" + rotxt + "\n";
    if (max < line.length) {
        max = line.length;
    }
    text += line;
    var sd = rt.sO;
    var nrl = 3;
    for (pr in sd) {
        if (sd[pr]) {
            text += " " + pr + ": " + sd[pr] + "\n";
            nrl++;
        }
    }
    if (rt.ol) {
        line = " one line: true\n";
        if (max < line.length) {
            max = line.length;
        }
        text += line;
        nrl++;
    }
    if (rt.iP) {
        line = " is password: true\n";
        if (max < line.length) {
            max = line.length;
        }
        text += line;
        nrl++;
    }
    if (rt.requird) {
        line = " is required: true\n";
        if (max < line.length) {
            max = line.length;
        }
        text += line;
        nrl++;
    }
    if (rt.check) {
        line = " check: " + rt.check + "\n";
        if (max < line.length) {
            max = line.length;
        }
        text += line;
        nrl++;
    }
    this.info.innerHTML = text.replace(/\n/g, "<br/>");
    s = this.info.style;
    s.width = max * 7 + "px";
    s.height = nrl * 14 + "px";
    cb.reposInfo();
};
SelectionWidget.prototype.redrawTree = function () {
    for (var i = 0; i < this.o2.length; i++) {
        if (this.o2[i].redrawTree) {
            this.o2[i].redrawTree();
        }
    }
};
SelectionWidget.prototype.itemClick = function (ar) {
    var i;
    var obj = ar.obj;
    mv.ro = this;
    var idx = this.o2.indexOf(obj);
    if (idx == null) {
        this.o2.push(obj);
        obj.otree_node.o2[0].showSelected();
        this.checkXMin(ar);
        this.checkYMin(ar);
        this.checkXMax(ar);
        this.checkYMax(ar);
    } else {
        this.sliceOne({idx: idx});
    }
    if (this.o2.length == 1) {
        var obj = this.o2[0];
        this.te.o = obj.te.o;
        if (obj.nd && obj.nd.mu == ait.sMenu) {
            obj.nd.nC();
        } else {
            var stObj = obj;
            while (!stObj.st && stObj.pt) {
                stObj = stObj.pt;
            }
            if (stObj.st) {
                Site.dynamics.gst({obj: stObj});
            }
        }
    }
};
SelectionWidget.prototype.sliceOne = function (ar) {
    var i;
    var obj = this.o2.splice(ar.idx, 1)[0];
    obj.otree_node.o2[0].showUnSelected();
    if (obj == this.x_min) {
        this.x_min = undefined;
        for (i = 0; i < this.o2.length; i++) {
            this.checkXMin({obj: this.o2[i]});
        }
    }
    if (obj == this.y_min) {
        this.y_min = undefined;
        for (i = 0; i < this.o2.length; i++) {
            this.checkYMin({obj: this.o2[i]});
        }
    }
    if (obj == this.x_max) {
        this.x_max = undefined;
        for (i = 0; i < this.o2.length; i++) {
            this.checkXMax({obj: this.o2[i]});
        }
    }
    if (obj == this.y_max) {
        this.y_max = undefined;
        for (i = 0; i < this.o2.length; i++) {
            this.checkYMax({obj: this.o2[i]});
        }
    }
    if (this.o2.length == 0) {
        debugger;
    }
};
SelectionWidget.prototype.empty = function (ar) {
    for (var i = 0; i < this.o2.length; i++) {
        try {
            this.o2[i].otree_node.o2[0].showUnSelected();
        } catch (err) {
        }
    }
    this.o2 = [];
    this.x_min = undefined;
    this.y_min = undefined;
    this.x_max = undefined;
    this.y_max = undefined;
};
SelectionWidget.prototype.checkXMin = function (ar) {
    if (!this.x_min || this.x_min.acc.x > ar.obj.acc.x) {
        this.x_min = ar.obj;
    }
};
SelectionWidget.prototype.checkYMin = function (ar) {
    if (!this.y_min || this.y_min.acc.y > ar.obj.acc.y) {
        this.y_min = ar.obj;
    }
};
SelectionWidget.prototype.checkXMax = function (ar) {
    if (!this.x_max ||
        this.x_max.acc.x + this.x_max.acc.w < ar.obj.acc.x + ar.obj.acc.w) {
        this.x_max = ar.obj;
    }
};
SelectionWidget.prototype.checkYMax = function (ar) {
    if (!this.y_max ||
        this.y_max.acc.y + this.y_max.acc.h < ar.obj.acc.y + ar.obj.acc.h) {
        this.y_max = ar.obj;
    }
};
SelectionWidget.prototype.me = function (ar) {
    for (var i = 0; i < this.o2.length; i++) {
        this.o2[i].me(ar);
    }
};
SelectionWidget.prototype.resize = function (ar) {
    this.o2[0].resize(ar);
};
SelectionWidget.prototype.mf = function (ar) {
    for (var i = 0; i < this.o2.length; i++) {
        var cd = this.o2[i];
        var dx = ar.dx * cd.acc.w / (this.te.w * cd.acc.s);
        cd.mf({dx: dx});
        cd.redrawTree();
    }
};
SelectionWidget.prototype.fade = function (ar) {
    for (var i = 0; i < this.o2.length; i++) {
        var cd = this.o2[i];
        var dx = ar.dx * cd.acc.w / (this.te.w * cd.acc.s);
        cd.fade({dx: dx});
    }
    this.te.o -= ar.dx / this.te.w;
    if (this.te.o < 0) {
        this.te.o = 0;
    } else if (this.te.o > 1) {
        this.te.o = 1;
    }
};
SelectionWidget.prototype.algLeft = function (ar) {
    var o2 = this.o2.length == 1 && this.o2[0].o2 ? this.o2[0].o2 : this.o2;
    if (!o2 || o2.length == 0) {
        return;
    }
    var xmin = ar && ar.x ? ar.x : o2[0].acc.x;
    for (var i = 0; i < o2.length; i++) {
        if (o2[i].acc.x < xmin) {
            xmin = o2[i].acc.x;
        }
    }
    for (i = 0; i < o2.length; i++) {
        o2[i].me({dx: xmin - o2[i].acc.x});
    }
    this.rd();
};
SelectionWidget.prototype.algRight = function (ar) {
    var o2 = this.o2.length == 1 && this.o2[0].o2 ? this.o2[0].o2 : this.o2;
    if (!o2 || o2.length == 0) {
        return;
    }
    var xmax = ar && ar.x ? ar.x : o2[0].acc.x + o2[0].acc.w;
    for (var i = 0; i < o2.length; i++) {
        if (o2[i].acc.x + o2[i].acc.w > xmax) {
            xmax = o2[i].acc.x + o2[i].acc.w;
        }
    }
    for (i = 0; i < o2.length; i++) {
        o2[i].me({dx: xmax - o2[i].acc.x - o2[i].acc.w});
    }
    this.rd();
};
SelectionWidget.prototype.algTop = function (ar) {
    var o2 = this.o2.length == 1 && this.o2[0].o2 ? this.o2[0].o2 : this.o2;
    if (!o2 || o2.length == 0) {
        return;
    }
    var ymin = ar && ar.y ? ar.y : o2[0].acc.y;
    for (var i = 0; i < o2.length; i++) {
        if (o2[i].acc.y < ymin) {
            ymin = o2[i].acc.y;
        }
    }
    for (i = 0; i < o2.length; i++) {
        o2[i].me({dy: ymin - o2[i].acc.y});
    }
    this.rd();
};
SelectionWidget.prototype.algBot = function (ar) {
    var o2 = this.o2.length == 1 && this.o2[0].o2 ? this.o2[0].o2 : this.o2;
    if (!o2 || o2.length == 0) {
        return;
    }
    var ymax = ar && ar.y ? ar.y : o2[0].acc.y + o2[0].acc.h;
    for (var i = 0; i < o2.length; i++) {
        if (o2[i].acc.y + o2[i].acc.h > ymax) {
            ymax = o2[i].acc.y + o2[i].acc.h;
        }
    }
    for (i = 0; i < o2.length; i++) {
        o2[i].me({dy: ymax - o2[i].acc.y - o2[i].acc.h});
    }
    this.rd();
};
SelectionWidget.prototype.algVC = function () {
    var o2 = this.o2.length == 1 && this.o2[0].o2 ? this.o2[0].o2 : this.o2;
    if (!o2 || o2.length == 0) {
        return;
    }
    var ymin = o2[0].acc.y;
    var ymax = o2[0].acc.y + o2[0].acc.h;
    for (var i = 1; i < o2.length; i++) {
        if (o2[i].acc.y < ymin) {
            ymin = o2[i].acc.y;
        }
        if (o2[i].acc.y + o2[i].acc.h > ymax) {
            ymax = o2[i].acc.y + o2[i].acc.h;
        }
    }
    var vc = (ymax + ymin) / 2;
    for (i = 0; i < o2.length; i++) {
        o2[i].me({dy: vc - o2[i].acc.y - parseInt(o2[i].acc.h / 2)});
    }
    this.rd();
};
SelectionWidget.prototype.algHC = function () {
    var o2 = this.o2.length == 1 && this.o2[0].o2 ? this.o2[0].o2 : this.o2;
    if (!o2 || o2.length == 0) {
        return;
    }
    var xmin = o2[0].acc.x;
    var xmax = o2[0].acc.x + o2[0].acc.w;
    for (var i = 1; i < o2.length; i++) {
        if (o2[i].acc.x < xmin) {
            xmin = o2[i].acc.x;
        }
        if (o2[i].acc.x + o2[i].acc.w > xmax) {
            xmax = o2[i].acc.x + o2[i].acc.w;
        }
    }
    var hc = (xmax + xmin) / 2;
    for (i = 0; i < o2.length; i++) {
        o2[i].me({dx: hc - o2[i].acc.x - o2[i].acc.w / 2});
    }
    this.rd();
};
SelectionWidget.prototype.forceH = function () {
    var o2 = this.o2.length == 1 && this.o2[0].o2 ? this.o2[0].o2 : this.o2;
    if (!o2 || o2.length == 0) {
        return;
    }
    for (var i = 0; i < o2.length; i++) {
        var pat = o2[i].pt.acc;
        o2[i].te.x = (this.te.x - pat.x) * pat.s;
        o2[i].te.w = this.te.w / pat.s;
    }
    this.rd();
};
SelectionWidget.prototype.forceV = function () {
    var o2 = this.o2.length == 1 && this.o2[0].o2 ? this.o2[0].o2 : this.o2;
    if (!o2 || o2.length == 0) {
        return;
    }
    for (var i = 0; i < o2.length; i++) {
        var pat = o2[i].pt.acc;
        o2[i].te.y = (this.te.y - pat.y) * pat.s;
        o2[i].te.h = this.te.h / pat.s;
    }
    this.rd();
};
SelectionWidget.prototype.distr = function () {
    var o2 = this.o2.length == 1 && this.o2[0].o2 ? this.o2[0].o2 : this.o2;
    if (!o2 || o2.length == 0) {
        return;
    }
    var sorted = [];
    for (var i = 0; i < o2.length; i++) {
        var obj = o2[i];
        var at = obj.acc;
        var inserted = false;
        for (var j = 0; j < sorted.length; j++) {
            if (this.H && sorted[j].acc.x > at.x ||
                this.V && sorted[j].acc.y > at.y) {
                sorted.splice(j, 0, obj);
                inserted = true;
                break;
            }
        }
        if (!inserted) {
            sorted.push(obj);
        }
    }
    o2 = sorted;
    var dl = 0;
    if (this.dx) {
        dl = this.dx;
    } else if (this.dy) {
        dl = this.dy;
    } else {
        if (this.H) {
            dl = this.te.w;
            for (i = 0; i < o2.length; i++) {
                dl -= o2[i].acc.w;
            }
        } else if (this.V) {
            dl = this.te.h;
            for (i = 0; i < o2.length; i++) {
                dl -= o2[i].acc.h;
            }
        }
        if (dl < 0) {
            dl = 0;
        }
        dl = dl / o2.length + 0.5 | 0;
    }
    var li;
    if (this.H) {
        if (this.scrollX < 0) {
            this.scrollX = 0;
        }
        li = this.te.x - this.scrollX;
        o2[0].me({dx: li - o2[0].acc.x});
        for (i = 1; i < o2.length; i++) {
            li += dl + o2[i - 1].acc.w;
            o2[i].me({dx: li - o2[i].acc.x});
        }
    } else if (this.V) {
        if (this.scrollY < 0) {
            this.scrollY = 0;
        }
        li = this.te.y - this.scrollY;
        o2[0].me({dy: li - o2[0].acc.y});
        for (i = 1; i < o2.length; i++) {
            li += dl + o2[i - 1].acc.h;
            o2[i].me({dy: li - o2[i].acc.y});
        }
    }
    if (this.clipped) {
        var xmin = this.te.x;
        var xmax = this.te.x + this.te.w;
        var ymin = this.te.y;
        var ymax = this.te.y + this.te.h;
        for (i = 0; i < o2.length; i++) {
            obj = o2[i];
            at = obj.acc;
            if (at.x < xmin ||
                at.x + at.w > xmax || at.y < ymin || at.y + at.h > ymax) {
                obj.hide();
            } else {
                obj.unhide();
            }
        }
    }
};
SelectionWidget.prototype.distrH = function () {
    this.H = true;
    this.V = false;
    this.dx = 0;
    this.dy = 0;
    this.distr();
};
SelectionWidget.prototype.distrV = function () {
    this.H = false;
    this.V = true;
    this.dx = 0;
    this.dy = 0;
    this.distr();
};
SelectionWidget.prototype.listH = function () {
    this.H = true;
    this.V = false;
    this.dx = 10;
    this.dy = 0;
    this.distr();
};
SelectionWidget.prototype.listV = function () {
    this.H = false;
    this.V = true;
    this.dx = 0;
    this.dy = 10;
    this.distr();
};
SelectionWidget.prototype.sCd = function () {
    for (var i = 0; this.o2 && i < this.o2.length; i++) {
        this.o2[i].sCd();
    }
};
var auDSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
auDSt.prototype.sm = {Cl:'auDSt',inr:0};
auDSt.prototype.sm.it = function (ar) {
    
};
auDSt.prototype.grs = function (ar) {
    if (ar.sg == "audio_default") {
        if (!ait.rsrcs.audio_default) {
            new Rs({sg: "auD,audio_default,shared/play.jpg,shared/pause.jpg,20,17,1", STt: "ll"});
        }
        return ait.rsrcs.audio_default;
    }
};
auDSt.prototype.de = function (ar) {
    if (!this.audiodiv) {
        this.audiodiv = dce("div");
        document.body.appendChild(this.audiodiv);
        this.audiodiv.style.position = "absolute";
        this.audiodiv.style.top = "5px";
        this.audiodiv.style.left = "5px";
        cb.checkFlash();
        if (cb.hasFlash != -1) {
            this.audiodiv.innerHTML = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"165\" height=\"37\" id=\"niftyPlayer1\" align=\"\"> <param name=movie value=\"shared/niftyplayer.swf?file=media/Amapola.mp3&as=1\"> <param name=quality value=high> <param name=bgcolor value=#000000> <embed src=\"shared/niftyplayer.swf?file=media/Amapola.mp3&as=1\" quality=high bgcolor=#000000 width=\"165\" height=\"37\" name=\"niftyPlayer1\" align=\"\" type=\"application/x-shockwave-flash\" swLiveConnect=\"true\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed> </object>";
        }
    }
    var audio = ar.obj;
    var b5 = audio.b5;
    audio.rac();
    var _miw = new miw({pts: [b5.p2[2], b5.p2[3]], w: b5.p2[4], h: b5.p2[5], STt: "ll"});
    var b2 = new bw({obj: _miw, klik: new exb({obj: this, mN: "toggleAudio", cas: {obj: audio}}), x: 0, STt: "ll"});
    audio.bc({obj: b2});
};
auDSt.prototype.toggleAudio = function (ar) {
    var obj = ar.obj;
    var plyr = navigator.appName.indexOf("Microsoft") != -1 ? window.niftyPlayer1 : document.niftyPlayer1;
    if (this.audioObj) {
        var _miw = this.audioObj.o2[0].o2[0];
        if (this.audioObj == obj) {
            if (_miw.idx == 1) {
                _miw.on();
                if (cb.hasFlash == -1) {
                    this.audiodiv.innerHTML = "";
                } else if (plyr) {
                    plyr.TCallLabel("/", "pause");
                }
            } else {
                _miw.off();
                if (cb.hasFlash == -1) {
                    this.writeInnerHTML(ar);
                } else if (plyr) {
                    plyr.TCallLabel("/", "play");
                }
            }
        } else {
            _miw.on();
            this.audioObj = obj;
            this.audioObj.o2[0].o2[0].off();
            if (cb.hasFlash == -1) {
                this.writeInnerHTML(ar);
            } else if (plyr) {
                plyr.SetVariable("currentSong", obj.path);
                plyr.TCallLabel("/", "load");
                if (typeof plyr != "undefined") {
                    plyr.TCallLabel("/", "play");
                }
            }
        }
    } else {
        this.audioObj = obj;
        this.audioObj.o2[0].o2[0].off();
        if (cb.hasFlash == -1) {
            this.writeInnerHTML(ar);
        } else if (plyr) {
            plyr.SetVariable("currentSong", obj.path);
            plyr.TCallLabel("/", "load");
            plyr.TCallLabel("/", "play");
        }
    }
};
auDSt.prototype.writeInnerHTML = function (ar) {
    var objTypeTag = navigator.userAgent.toLowerCase().indexOf("windows") != -1 ? "audio/mpeg" : "application/x-mplayer2";
    this.audiodiv.innerHTML = "<object width='280' height='69'><param name='type' value='" + objTypeTag + "'><param name='src' value='" + ar.obj.path + "'><param name='autostart' value='1'><param name='showcontrols' value='1'><param name='showstatusbar' value='1'><embed src ='" + ar.obj.path + "' type='" + objTypeTag + "' autoplay='true'  autostart='1' width='280' height='69' controller='1' showstatusbar='1' bgcolor='#9999ff' kioskmode='true'></embed></object>";
};
var auD = new auDSt();
var auw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( auw, aw);
auw.prototype.sm = {Cl:'auw',inr:0};
auw.prototype.sm.isL = 'true';
auw.prototype.sm.it = function (ar) {
    aw.prototype.sm.it.call(this, ar);
    
    this.path = ar && ar.path ? ar.path : "shared/leeg.mp3";
};
auw.prototype.idb = function () {
    sw.prototype.idb.call(this);
    this.path = this.fd[2];
};
auw.prototype.cdc = function () {
    this.Ct += this.path;
};
auw.prototype.sP = function (ar) {
    this.path = ar.path;
    this.b5.dc.de({obj: this});
    this.sCd();
};
auw.prototype.de = function () {
    if (!this.b5) {
        this.b5 = auD.grs({sg: "audio_default"});
    }
    this.b5.dc.de({obj: this});
};
var ue = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( ue, ob);
ue.prototype.sm = {Cl:'ue',inr:0};
ue.prototype.sm.it = function (ar) {
    ob.prototype.sm.it.call(this, ar);
    
    cb.aco({obj: this});
    this.STm = 1;
    this.av = false;
    this.div = dce("div");
    this.div.obj = this;
    var s = this.div.style;
    s.position = "absolute";
    s.zIndex = 1;
    s.backgroundImage = "url(\"shared/click.gif\")";
};
ue.prototype.rd = function () {
    var at = this.dr.acc;
    s = this.div.style;
    s.width = at.w + "px";
    s.height = at.h + "px";
    if (this.av) {
        this.eE();
    }
};
ue.prototype.setRoot = function (ar) {
    this.dr = ar.obj;
    this.dr.div.appendChild(this.div);
};
ue.prototype.atv = function () {
    if (!this.av) {
        this.av = true;
        this.eE();
    }
};
ue.prototype.deactivate = function () {
    this.av = false;
    this.dE();
};
ue.prototype.eE = function () {
    if (!this.av) {
        return;
    }
    var s = this.div.style;
    s.cursor = "pointer";
    switch (this.STm) {
      case 1:
        addEvent(this.div, "mouseover", this.setMouseModeHover, false);
        break;
      case 2:
        addEvent(this.div, "mouseout", this.setMouseModeUnHover, false);
        addEvent(this.div, "mousedown", this.setMouseModeDown, false);
        break;
      case 3:
        addEvent(this.div, "mouseup", this.smk, false);
        break;
      case 4:
        addEvent(this.div, "mousemove", this.setMouseModeDrag, false);
        addEvent(this.div, "mouseup", this.setMouseModeUnDrag, false);
        break;
      default:;
    }
};
ue.prototype.dE = function () {
    var s = this.div.style;
    s.cursor = "auto";
    removeEvent(this.div, "mouseover", this.setMouseModeHover, false);
    removeEvent(this.div, "mouseout", this.setMouseModeUnHover, false);
    removeEvent(this.div, "mousedown", this.setMouseModeDown, false);
    removeEvent(this.div, "mouseup", this.smk, false);
    removeEvent(this.div, "mousemove", this.setMouseModeDrag, false);
    removeEvent(this.div, "mouseup", this.setMouseModeUnDrag, false);
};
ue.prototype.setMouseModeHover = function (e) {
    var obj = getTarget(e).obj;
    removeEvent(obj.div, "mouseover", obj.setMouseModeHover, true);
    obj.STm = 2;
    obj.eE();
    var pt = obj.dr.pt;
    for (var i = 0; pt.o2 && i < pt.o2.length; i++) {
        var sibbling = pt.o2[i].hbw;
        if (sibbling &&
            sibbling != obj.dr && sibbling != obj.dr.hbw) {
            sibbling.hideTreeDown();
        }
    }
    if (pt.cancelTimerHide) {
        pt.cancelTimerHide();
    }
    obj.dr.showHover();
    obj.dr.xc({mt: "hover"});
    return false;
};
ue.prototype.setMouseModeUnHover = function (e) {
    var obj = getTarget(e).obj;
    removeEvent(obj.div, "mouseout", obj.setMouseModeUnHover, true);
    removeEvent(obj.div, "mousedown", obj.setMouseModeDown, true);
    obj.STm = 1;
    obj.eE();
    obj.dr.showUnHover();
    obj.dr.xc({mt: "unhover"});
    return false;
};
ue.prototype.setMouseModeDown = function (e) {
    var obj = getTarget(e).obj;
    removeEvent(obj.div, "mouseout", obj.setMouseModeUnHover, true);
    removeEvent(obj.div, "mousedown", obj.setMouseModeDown, true);
    obj.STm = 3;
    obj.eE();
    return false;
};
ue.prototype.setMouseModeDrag = function (e) {
    var obj = getTarget(e).obj;
    removeEvent(obj.div, "mouseup", obj.smk, true);
    obj.STm = 4;
    obj.eE();
    return false;
};
ue.prototype.smk = function (e) {
    var obj = getTarget(e).obj;
    removeEvent(obj.div, "mouseup", obj.smk, true);
    removeEvent(obj.div, "mousemove", obj.setMouseModeDrag, true);
    obj.STm = 2;
    obj.eE();
    cb.nuc({obj: obj});
    obj.dr.showUnKeyTab();
    return false;
};
ue.prototype.setMouseModeUnDrag = function (e) {
    var obj = getTarget(e).obj;
    removeEvent(obj.div, "mouseup", obj.setMouseModeUnDrag, true);
    obj.STm = 2;
    obj.eE();
    return false;
};
ue.prototype.rv = function () {
    cb.rco({obj: this});
    try {
        this.dr.div.removeChild(this.div);
    } catch (err) {
    }
};
var EMenuButton = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
EMenuButton.prototype.sm = {Cl:'EMenuButton',inr:0};
EMenuButton.prototype.sm.it = function (ar) {
    
    this.names = ar.names;
    var mu = ait.eMenu.d2[0];
    var pt = mu.tree[0];
    var cd = null;
    for (var i = 0; i < this.names.length - 1; i++) {
        for (var j = 0; j < pt.tree.length; j++) {
            if (pt.tree[j].txt.txt == this.names[i]) {
                cd = pt.tree[j];
                break;
            }
        }
        if (cd) {
            pt = cd;
            cd = null;
        } else {
            cd = mu.cnn({sg: this.names[i]});
            pt.bindChildNode({nd: cd});
            pt = cd;
            cd = null;
        }
    }
    cd = mu.cnn({sg: this.names[this.names.length - 1], isLeaf: ar.isNode ? false : true});
    pt.bindChildNode({nd: cd});
    cd.mt = new exb({obj: this, mN: "xc"});
    if (ar.xc) {
        this.xc = ar.xc;
    }
    if (ar.filter) {
        this.filter = ar.filter;
    }
    this.nd = cd;
    ctr.buttons.push(this);
};
EMenuButton.prototype.xc = function () {
    this.nd.ls.nC[0][0].tG();
};
EMenuButton.prototype.filter = function (ar) {
    this.setMenuItem({mis: "v"});
};
EMenuButton.prototype.setMenuItem = function (ar) {
    var widget = this.nd.ls.nC[0][0];
    if (ar.mis == "i") {
        widget.hide();
        if (widget.front) {
            widget.front.hide();
        }
    } else {
        widget.unhide();
        if (widget.front) {
            widget.front.unhide();
        }
    }
};
var ctSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ctSt.prototype.sm = {Cl:'ctSt',inr:0};
ctSt.prototype.sm.it = function (ar) {
    
};
ctSt.prototype.cms = function () {
    States.checkStates();
    this.cem();
    ait.eMenu.tf({x: ait.stage.te.x + ait.stage.te.w + 10, dt: 1000});
    this.cot();
    ait.oTree.tf({x: ait.stage.te.x + ait.stage.te.w + ait.eMenu.te.w + 20, dt: 1000});
};
ctSt.prototype.cem = function () {
    var twoDim = [["N", "", "Edit Menu"]];
    var mnu = new Menu({twoDim: twoDim});
    new mw({name: "eMenu", menu: mnu, x: 1040, y: 5, STt: "ll", intree: false});
    Site.aw.bc({obj: ait.eMenu});
    ait.eMenu.rd();
    ait.eMenu.de();
    this.addMenuItems();
    ait.eMenu.redrawTree();
    ait.eMenu.sdg();
    ait.eMenu.aal();
};
ctSt.prototype.cot = function () {
    if (ait.oTree) {
        ait.oTree.rv();
    }
    new ot({name: "oTree", STt: "ll", intree: false, x: 1140, y: 5});
    Site.aw.bc({obj: ait.oTree});
    ait.oTree.c5();
    ait.oTree.redrawTree();
    ait.oTree.sdg();
    ait.oTree.aal();
    ait.oTree.smi({obj: Site.aw});
};
ctSt.prototype.newFilter = function (ar) {
    var funcStr = "if(";
    for (var i = 0; i < ar.arr.length; i++) {
        funcStr += "ar.cs=='" + ar.arr[i] + "' || ";
    }
    funcStr += "ar.cs=='kweenie' ) this.setMenuItem({mis:'" + (ar.e ? "e" : "v") + "'}); else this.setMenuItem({mis:'i'});";
    return new Function("ar", funcStr);
};
ctSt.prototype.addMenuItems = function () {
    var menu = ait.eMenu.d2[0];
    this.buttons = [];
    var b2 = new EMenuButton({names: ["logout"]});
    b2.xc = function () {Site.logout();Site.ssb({sg: "Logout ok... Until next time " + vt.lgn});};
    b2 = new EMenuButton({names: ["save"]});
    b2.xc = function () {rdb.sc();};
    var AWfilter = this.newFilter({arr: ["aw", "HoverButtonWidget"]});
    b2 = new EMenuButton({names: ["to page nd"]});
    b2.filter = function (ar) {if (ar.cs == "aw" && !ar.obj.st) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.toStateN();};
    b2 = new EMenuButton({names: ["to page leaf"]});
    b2.filter = function (ar) {if (ar.cs == "aw" && !ar.obj.st) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.toStateL();};
    b2 = new EMenuButton({names: ["un-page"]});
    b2.filter = function (ar) {if (ar.cs == "aw" && ar.obj.st) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.delState();};
    b2 = new EMenuButton({names: ["duplicate"]});
    b2.filter = function (ar) {if (ar.obj != Site.aw && ar.obj != ait.stage && !ar.obj.nd) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.duplicate();};
    b2 = new EMenuButton({names: ["copy"]});
    b2.filter = function (ar) {if (ar.obj != Site.aw && ar.obj != ait.stage && !ar.obj.nd) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.copy();};
    b2 = new EMenuButton({names: ["cut"]});
    b2.filter = function (ar) {if (ar.obj != Site.aw && ar.obj != ait.stage && !vt.dragObjs) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.drag();};
    b2 = new EMenuButton({names: ["paste"]});
    b2.filter = function (ar) {if (ar.obj != Site.aw && vt.selection.dragObjs && ar.obj.bc) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.drop();};
    b2 = new EMenuButton({names: ["delete"]});
    b2.filter = function (ar) {if (ar.obj != Site.aw && ar.obj != ait.stage && ar.obj != ait.sMenu.ls.cnn[0][0]) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.del();};
    var notAWnotStagefilter = function (ar) {if (ar.obj != Site.aw && ar.obj != ait.stage) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["to back"]});
    b2.filter = notAWnotStagefilter;
    b2.xc = function () {vt.toBack();};
    b2 = new EMenuButton({names: ["back 1"]});
    b2.filter = notAWnotStagefilter;
    b2.xc = function () {vt.downLayer();};
    b2 = new EMenuButton({names: ["front 1"]});
    b2.filter = notAWnotStagefilter;
    b2.xc = function () {vt.upLayer();};
    b2 = new EMenuButton({names: ["to front"]});
    b2.filter = notAWnotStagefilter;
    b2.xc = function () {vt.toFront();};
    var InputFilter = this.newFilter({arr: ["InputFilter"]});
    b2 = new EMenuButton({names: ["toggle one line"]});
    b2.filter = InputFilter;
    b2.xc = function () {var input = vt.selection.o2[0];input.ol = !input.ol;input.sCd();vt.updateInfo();};
    b2 = new EMenuButton({names: ["toggle is password"]});
    b2.filter = InputFilter;
    b2.xc = function () {var input = vt.selection.o2[0];input.iP = !input.iP;input.sCd();vt.updateInfo();};
    b2 = new EMenuButton({names: ["toggle required"]});
    b2.filter = InputFilter;
    b2.xc = function () {var input = vt.selection.o2[0];input.requird = !input.requird;input.sCd();vt.updateInfo();};
    b2 = new EMenuButton({names: ["check as email field"]});
    b2.filter = InputFilter;
    b2.xc = function () {var input = vt.selection.o2[0];if (input.check && input.check == "checkEmail") {input.check = null;} else {input.check = "checkEmail";}input.sCd();vt.updateInfo();};
    var AWnotSiteFilter = function (ar) {if ((ar.cs == "aw" || ar.cs == "fw" || ar.cs == "HoverButtonWidget") && ar.obj != Site.aw) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["NEW"], isNode: true});
    b2.filter = AWnotSiteFilter;
    b2 = new EMenuButton({names: ["NEW", "container"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {vt.n0({cls: "aw", w: 200, h: 100});};
    b2 = new EMenuButton({names: ["NEW", "text"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {vt.n0({cls: "tw", w: 100, h: 50});};
    b2 = new EMenuButton({names: ["NEW", "image"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {vt.newImage();};
    b2 = new EMenuButton({names: ["NEW", "google map"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {vt.newGoogleMap();};
    b2 = new EMenuButton({names: ["NEW", "audio"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {vt.newAudio();};
    b2 = new EMenuButton({names: ["NEW", "video"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {vt.newVideo();};
    b2 = new EMenuButton({names: ["NEW", "contact form"]});
    b2.filter = function (ar) {if (ar.cs == "aw" && ar.obj != Site.aw) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.newForm();};
    var FormWidgetFilter = this.newFilter({arr: ["fw"]});
    b2 = new EMenuButton({names: ["NEW", "add label + input"]});
    b2.filter = FormWidgetFilter;
    b2.xc = function () {vt.newInput();};
    b2 = new EMenuButton({names: ["NEW", "add send button"]});
    b2.filter = FormWidgetFilter;
    b2.xc = function () {vt.addSendButton();};
    b2 = new EMenuButton({names: ["NEW", "add kill button"]});
    b2.filter = FormWidgetFilter;
    b2.xc = function () {vt.addKillButton();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS"], isNode: true});
    b2.filter = this.newFilter({arr: ["aw"], e: true});
    var Selectionfilter = function (ar) {if (vt.selection.o2.length > 0) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "toggle scroll"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {var obj = vt.selection.o2[0];obj.toggle_scroll();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "list cds"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {var _y = 5;var obj = vt.selection.o2[0];var o2 = obj.o2;for (var i = 0; i < o2.length; i++) {var cd = o2[i];cd.te.y = _y;cd.set_wrap();cd.rd();cd.sCd();_y += cd.te.h + 5;}};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "align left"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.algLeft();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "align H centre"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.algHC();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "align right"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.algRight();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "align top"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.algTop();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "align V centre"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.algVC();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "align bottom"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.algBot();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "distribute_H"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.distrH();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "distribute_V"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.distrV();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "as list H"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.listH();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "as list V"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.listV();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "same Width"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.forceV();};
    b2 = new EMenuButton({names: ["SELECTED OBJECTS", "same height"]});
    b2.filter = Selectionfilter;
    b2.xc = function () {vt.selection.forceH();};
    var SiteFilter = function (ar) {if (ar.obj == Site.aw) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    var BWFilter = this.newFilter({arr: ["bw"]});
    var SiteBWfilter = function (ar) {if (ar.obj == Site.aw || ar.cs == "bw") {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["DYNAMICS"], isNode: true});
    b2.filter = SiteBWfilter;
    b2 = new EMenuButton({names: ["DYNAMICS", "default"]});
    b2.filter = SiteBWfilter;
    b2.xc = function () {if (vt.selection.o2[0] == Site.aw) {Site.dynamics = dyd;} else {vt.selection.o2[0].b5 = bDD.grs({sg: "bwd"});}};
    b2 = new EMenuButton({names: ["DYNAMICS", "shift"]});
    b2.filter = SiteFilter;
    b2.xc = function () {Site.dynamics = dsd;};
    b2 = new EMenuButton({names: ["DYNAMICS", "grow"]});
    b2.filter = BWFilter;
    b2.xc = function () {vt.selection.o2[0].b5 = bgd.grs({sg: "bw_grow"});};
    b2 = new EMenuButton({names: ["DYNAMICS", "fade"]});
    b2.filter = SiteFilter;
    b2.xc = function () {Site.dynamics = dfd;};
    var Menufilter = function (ar) {if (ar.obj.nd || ar.cs == "mw") {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["DECORATOR"], isNode: true});
    b2.filter = Menufilter;
    b2 = new EMenuButton({names: ["DECORATOR", "default"]});
    b2.filter = Menufilter;
    b2.xc = function () {vt.dc({sg: "default"});};
    b2 = new EMenuButton({names: ["DECORATOR", "lespap"]});
    b2.filter = Menufilter;
    b2.xc = function () {vt.dc({sg: "lespap"});};
    b2 = new EMenuButton({names: ["combineLEs"]});
    b2.filter = this.newFilter({arr: ["tw"]});
    b2.xc = function () {var obj = vt.selection.o2[0];obj.extractStrng();obj.combineLEs();obj.createStrng();obj.lineElements = undefined;obj.sCd();};
    b2 = new EMenuButton({names: ["cn text"]});
    b2.filter = this.newFilter({arr: ["tw"]});
    b2.xc = function () {vt.selection.o2[0].cleanText();vt.updateInfo();};
    b2 = new EMenuButton({names: ["break down text"]});
    b2.filter = this.newFilter({arr: ["tw"]});
    b2.xc = function () {vt.breakdownTW();Site.aw.aal();Site.aw.redrawTree();};
    b2 = new EMenuButton({names: ["set box"]});
    b2.filter = function (ar) {this.setMenuItem({mis: "v"});};
    b2.xc = function () {for (var i = 0; i < vt.selection.o2.length; i++) {if (vt.selection.o2[i].set_box) {vt.selection.o2[i].set_box();vt.selection.o2[i].rd();}}vt.selection.rd();};
    b2 = new EMenuButton({names: ["EDIT"]});
    b2.filter = function (ar) {if (ar.cs == "tw" || ar.obj.sP || ar.obj.nd) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.editText();};
    b2 = new EMenuButton({names: ["set_wrap"]});
    b2.filter = function (ar) {if (ar.cs == "tw") {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.selection.o2[0].set_wrap();vt.updateInfo();};
    var fontFilter = function (ar) {if (ar.cs == "tw" || ar.obj == Site.aw) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["TEXT STYLE"], isNode: true});
    b2.filter = fontFilter;
    b2 = new EMenuButton({names: ["TEXT STYLE", "color"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.setColor({pr: "color"});vt.selection.o2[0].continueEdit();};
    b2 = new EMenuButton({names: ["TEXT STYLE", "normal"]});
    b2.filter = fontFilter;
    b2.xc = function () {var obj = vt.selection.o2[0];if (cb.caretIdx != cb.caretEnd) {obj.setSelection({sg: "fontWeight:normal;fontStyle:normal;textDecoration:none"});} else {obj.ase({pr: "fontWeight", val: "normal"});vt.updateInfo();}};
    b2 = new EMenuButton({names: ["TEXT STYLE", "bold"]});
    b2.filter = fontFilter;
    b2.xc = function () {var obj = vt.selection.o2[0];if (cb.caretIdx != cb.caretEnd) {obj.setSelection({sg: "fontWeight:bold"});} else {obj.ase({pr: "fontWeight", val: "bold"});vt.updateInfo();}};
    b2 = new EMenuButton({names: ["TEXT STYLE", "italic"]});
    b2.filter = fontFilter;
    b2.xc = function () {var obj = vt.selection.o2[0];if (cb.caretIdx != cb.caretEnd) {obj.setSelection({sg: "fontStyle:italic"});} else {obj.ase({pr: "fontStyle", val: "italic"});vt.updateInfo();}};
    b2 = new EMenuButton({names: ["TEXT STYLE", "underline"]});
    b2.filter = fontFilter;
    b2.xc = function () {var obj = vt.selection.o2[0];if (cb.caretIdx != cb.caretEnd) {obj.setSelection({sg: "textDecoration:underline"});} else {obj.ase({pr: "textDecoration", val: "underline"});vt.updateInfo();}};
    b2 = new EMenuButton({names: ["TEXT STYLE", "add link"]});
    b2.filter = fontFilter;
    b2.xc = function () {var obj = vt.selection.o2[0];if (cb.caretIdx != cb.caretEnd) {obj.setSelection({href: "www.areth-it.nl"});} else {vt.buttnLink();}};
    b2 = new EMenuButton({names: ["FONT"], isNode: true});
    b2.filter = function (ar) {if (ar.cs == "tw" || ar.obj == Site.aw) {this.setMenuItem({mis: "c"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["FONT", "Arial"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Arial, Helvetica, sans-serif"});};
    b2 = new EMenuButton({names: ["FONT", "Comic"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Comic Sans MS, Comic Sans MS5, cursive"});};
    b2 = new EMenuButton({names: ["FONT", "Courier New"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Courier New, Courier New, Courier6, monospace"});};
    b2 = new EMenuButton({names: ["FONT", "Georgia"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Georgia1, Georgia, serif"});};
    b2 = new EMenuButton({names: ["FONT", "Impact"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Impact, Impact5, Charcoal6, sans-serif"});};
    b2 = new EMenuButton({names: ["FONT", "Lucida Console"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Lucida Console, Monaco5, monospace"});};
    b2 = new EMenuButton({names: ["FONT", "Lucida Sans Unicode"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Lucida Sans Unicode, Lucida Grande, sans-serif"});};
    b2 = new EMenuButton({names: ["FONT", "Palatino Linotype"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Palatino Linotype, Book Antiqua3, Palatino6, serif"});};
    b2 = new EMenuButton({names: ["FONT", "Tahoma"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Tahoma, Geneva, sans-serif"});};
    b2 = new EMenuButton({names: ["FONT", "Times New Roman"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Times New Roman, Times, serif"});};
    b2 = new EMenuButton({names: ["FONT", "Trebuchet"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Trebuchet MS1, Helvetica, sans-serif"});};
    b2 = new EMenuButton({names: ["FONT", "Verdana"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Verdana, Geneva, sans-serif"});};
    b2 = new EMenuButton({names: ["FONT", "Wingdings"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Wingdings, Zapf Dingbats"});};
    b2 = new EMenuButton({names: ["FONT", "MS Serif"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "MS Serif4, New York6, serif"});};
    b2 = new EMenuButton({names: ["FONT", "Arial"]});
    b2.filter = fontFilter;
    b2.xc = function () {vt.changeFont({val: "Arial, Helvetica, sans-serif"});};
    b2 = new EMenuButton({names: ["OVERFLOW"], isNode: true});
    b2.filter = AWnotSiteFilter;
    b2 = new EMenuButton({names: ["OVERFLOW", "none"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {vt.selection.o2[0].ase({pr: "overflow", val: "visible"});};
    b2 = new EMenuButton({names: ["OVERFLOW", "auto"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {vt.selection.o2[0].ase({pr: "overflow", val: "auto"});};
    b2 = new EMenuButton({names: ["OVERFLOW", "scroll"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {vt.selection.o2[0].ase({pr: "overflow", val: "scroll"});};
    b2 = new EMenuButton({names: ["OVERFLOW", "hidden"]});
    b2.filter = AWnotSiteFilter;
    b2.xc = function () {vt.selection.o2[0].ase({pr: "overflow", val: "hidden"});};
    var borderFilter = function (ar) {if (ar.obj.sP || ar.cs == "iw" || ar.cs == "fw" || ar.cs == "HoverButtonWidget" || ar.cs == "aw" && ar.obj != Site.aw) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["BORDER"], isNode: true});
    b2.filter = function (ar) {if (ar.obj.sP || ar.cs == "iw" || ar.cs == "fw" || ar.cs == "HoverButtonWidget" || ar.cs == "aw" && ar.obj != Site.aw) {this.setMenuItem({mis: "c"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["BORDER", "none"]});
    b2.filter = borderFilter;
    b2.xc = function () {vt.borderNone();};
    b2 = new EMenuButton({names: ["BORDER", "color"]});
    b2.filter = borderFilter;
    b2.xc = function () {vt.setColor({pr: "borderColor"});};
    b2 = new EMenuButton({names: ["BORDER", "width"]});
    b2.filter = borderFilter;
    b2.xc = function () {vt.setBWidth();};
    b2 = new EMenuButton({names: ["BORDER", "dashed"]});
    b2.filter = borderFilter;
    b2.xc = function () {vt.setBorderProp({pr: "borderStyle", val: "dashed"});vt.updateInfo();};
    b2 = new EMenuButton({names: ["BORDER", "solid"]});
    b2.filter = borderFilter;
    b2.xc = function () {vt.setBorderProp({pr: "borderStyle", val: "solid"});vt.updateInfo();};
    b2 = new EMenuButton({names: ["BORDER", "double"]});
    b2.filter = borderFilter;
    b2.xc = function () {vt.setBorderProp({pr: "borderStyle", val: "double"});vt.updateInfo();};
    b2 = new EMenuButton({names: ["BORDER", "groove"]});
    b2.filter = borderFilter;
    b2.xc = function () {vt.setBorderProp({pr: "borderStyle", val: "groove"});vt.updateInfo();};
    b2 = new EMenuButton({names: ["BORDER", "ridge"]});
    b2.filter = borderFilter;
    b2.xc = function () {vt.setBorderProp({pr: "borderStyle", val: "ridge"});vt.updateInfo();};
    b2 = new EMenuButton({names: ["BORDER", "inset"]});
    b2.filter = borderFilter;
    b2.xc = function () {vt.setBorderProp({pr: "borderStyle", val: "inset"});vt.updateInfo();};
    b2 = new EMenuButton({names: ["BORDER", "outset"]});
    b2.filter = borderFilter;
    b2.xc = function () {vt.setBorderProp({pr: "borderStyle", val: "outset"});vt.updateInfo();};
    b2 = new EMenuButton({names: ["BORDER", "windows-gray"]});
    b2.filter = borderFilter;
    b2.xc = function () {var bdg = new BorderDecoration({sg: "gray,15,19,15,17"});vt.selection.o2[0].ad({obj: bdg});};
    b2 = new EMenuButton({names: ["BORDER", "black-round"]});
    b2.filter = borderFilter;
    b2.xc = function () {var bdg = new BorderDecoration({sg: "black_round,38,60,43,54"});vt.selection.o2[0].ad({obj: bdg});};
    b2 = new EMenuButton({names: ["BACKGROUND"], isNode: true});
    b2.filter = this.newFilter({arr: ["aw", "HoverButtonWidget"], e: true});
    b2 = new EMenuButton({names: ["BACKGROUND", "none"]});
    b2.filter = AWfilter;
    b2.xc = function () {vt.selection.o2[0].aSt({sg: "backgroundImage:null;backgroundColor:null"});vt.updateInfo();};
    b2 = new EMenuButton({names: ["BACKGROUND", "color"]});
    b2.filter = AWfilter;
    b2.xc = function () {vt.setColor({pr: "backgroundColor"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image"]});
    b2.filter = AWfilter;
    b2.xc = function () {vt.setBGImage();};
    var AWBGIfilter = function (ar) {if ((ar.cs == "aw" || ar.cs == "HoverButtonWidget") && vt.selection.o2[0].sO && vt.selection.o2[0].sO.backgroundImage) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - set repeat xy"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "xy"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - set repeat x"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "x"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - set repeat y"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "y"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - C"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "C"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - NW"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "NW"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - N"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "N"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - NE"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "NE"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - E"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "E"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - SE"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "SE"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - S"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "S"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - SW"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "SW"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - W"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "W"});};
    b2 = new EMenuButton({names: ["BACKGROUND", "image - fixed/scroll"]});
    b2.filter = AWBGIfilter;
    b2.xc = function () {vt.toggleBGImage({sg: "fs"});};
    var Buttonizefilter = function (ar) {if (ar.cs == "aw" && ar.obj != Site.aw && ar.obj != ait.stage && !ar.obj.st || ar.cs == "tw" || ar.obj.sP || ar.cs == "bw") {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["UN-BUTTON"]});
    b2.filter = BWFilter;
    b2.xc = function () {vt.unbutton();};
    b2 = new EMenuButton({names: ["BUTTONIZE"], isNode: true});
    b2.filter = function (ar) {if (ar.cs == "aw" && ar.obj != Site.aw && ar.obj != ait.stage && !ar.obj.st || ar.cs == "tw" || ar.obj.sP || ar.cs == "bw") {this.setMenuItem({mis: "e"});} else {this.setMenuItem({mis: "i"});}};
    b2 = new EMenuButton({names: ["BUTTONIZE", "to page"]});
    b2.filter = Buttonizefilter;
    b2.xc = function () {vt.buttnState();};
    b2 = new EMenuButton({names: ["BUTTONIZE", "to link"]});
    b2.filter = Buttonizefilter;
    b2.xc = function () {vt.buttnLink();};
    b2 = new EMenuButton({names: ["BUTTONIZE", "to link new"]});
    b2.filter = Buttonizefilter;
    b2.xc = function () {vt.buttnLKnew();};
    b2 = new EMenuButton({names: ["BUTTONIZE", "hover show"]});
    b2.filter = function (ar) {if (ar.cs == "aw" && ar.obj != Site.aw && ar.obj != ait.stage && !ar.obj.st || ar.cs == "tw" || ar.obj.sP || ar.cs == "bw" && !ar.hbw) {this.setMenuItem({mis: "v"});} else {this.setMenuItem({mis: "i"});}};
    b2.xc = function () {vt.buttnHover();};
    b2 = new EMenuButton({names: ["BUTTONIZE", "stage*1.2"]});
    b2.filter = Buttonizefilter;
    b2.xc = function () {vt.createAIncr();};
    b2 = new EMenuButton({names: ["BUTTONIZE", "stage*0.8"]});
    b2.filter = Buttonizefilter;
    b2.xc = function () {vt.createADcrmt();};
    b2 = new EMenuButton({names: ["BUTTON-STYLE"], isNode: true});
    b2.filter = this.newFilter({arr: ["bw", "HoverButtonWidget"], e: true});
    var BStyleFilter = this.newFilter({arr: ["bw", "HoverButtonWidget"]});
    b2 = new EMenuButton({names: ["BUTTON-STYLE", "new"]});
    b2.filter = BStyleFilter;
    b2.xc = function () {vt.button_style_new();};
    b2 = new EMenuButton({names: ["BUTTON-STYLE", "edit non active"]});
    b2.filter = BStyleFilter;
    b2.xc = function () {vt.button_style_edit({idx: 0});};
    b2 = new EMenuButton({names: ["BUTTON-STYLE", "edit active"]});
    b2.filter = BStyleFilter;
    b2.xc = function () {vt.button_style_edit({idx: 1});};
    b2 = new EMenuButton({names: ["BUTTON-STYLE", "edit hovering"]});
    b2.filter = BStyleFilter;
    b2.xc = function () {vt.button_style_edit({idx: 2});};
    b2 = new EMenuButton({names: ["BUTTON-STYLE", "edit last selected"]});
    b2.filter = BStyleFilter;
    b2.xc = function () {vt.button_style_edit({idx: 3});};
    b2 = new EMenuButton({names: ["BUTTON-STYLE", "edit kb-tab focused"]});
    b2.filter = BStyleFilter;
    b2.xc = function () {vt.button_style_edit({idx: 4});};
    b2 = new EMenuButton({names: ["BUTTON-STYLE", "choose"]});
    b2.filter = BStyleFilter;
    b2.xc = function () {vt.button_style_choose();};
    b2 = new EMenuButton({names: ["INPUT-STYLE"], isNode: true});
    b2.filter = this.newFilter({arr: ["iw"], e: true});
    var IWFilter = this.newFilter({arr: ["iw"]});
    b2 = new EMenuButton({names: ["INPUT-STYLE", "new"]});
    b2.filter = IWFilter;
    b2.xc = function () {vt.button_style_new();};
    b2 = new EMenuButton({names: ["INPUT-STYLE", "edit non active"]});
    b2.filter = IWFilter;
    b2.xc = function () {vt.button_style_edit({idx: 0});};
    b2 = new EMenuButton({names: ["INPUT-STYLE", "edit active"]});
    b2.filter = IWFilter;
    b2.xc = function () {vt.button_style_edit({idx: 1});};
    b2 = new EMenuButton({names: ["INPUT-STYLE", "edit hovering"]});
    b2.filter = IWFilter;
    b2.xc = function () {vt.button_style_edit({idx: 2});};
    b2 = new EMenuButton({names: ["INPUT-STYLE", "edit last selected"]});
    b2.filter = IWFilter;
    b2.xc = function () {vt.button_style_edit({idx: 3});};
    b2 = new EMenuButton({names: ["INPUT-STYLE", "edit kb-tab focused"]});
    b2.filter = IWFilter;
    b2.xc = function () {vt.button_style_edit({idx: 4});};
    b2 = new EMenuButton({names: ["INPUT-STYLE", "choose"]});
    b2.filter = IWFilter;
    b2.xc = function () {vt.button_style_choose();};
};
ctSt.prototype.selectMenuItems = function (ar) {
    var obj = vt.selection.o2[0];
    var cs = obj.sm.Cl;
    for (var i = 0; i < this.buttons.length; i++) {
        ctr.buttons[i].filter({obj: obj, cs: cs});
    }
    ait.eMenu.redrawTree();
};
var ctr = new ctSt();
var mvSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
mvSt.prototype.sm = {Cl:'mvSt',inr:0};
mvSt.prototype.sm.it = function (ar) {
    
};
mvSt.prototype.me = function (e) {
    mv.ua = "me";
    mv.mouseInit(e);
};
mvSt.prototype.resize = function (e) {
    mv.ua = "resize";
    mv.mouseInit(e);
};
mvSt.prototype.mf = function (e) {
    mv.ua = "mf";
    mv.mouseInit(e);
};
mvSt.prototype.fade = function (e) {
    mv.ua = "fade";
    mv.mouseInit(e);
};
mvSt.prototype.mouseInit = function (e) {
    this.target = getTarget(e);
    if (!this.target.obj) {
        debugger;
        return;
    }
    this.ro = this.target.obj;
    if (this.ro.sm.Cl == "ue") {
        return;
    }
    addEvent(document, "mouseup", mv.mouseUp, false);
    addEvent(document, "mousemove", mv.mouseMove, false);
    var eo = window.event || e;
    mv.mous_x0 = eo.clientX;
    mv.mous_y0 = eo.clientY;
    mv.mous_x = eo.clientX;
    mv.mous_y = eo.clientY;
    mv.mous_dx = 0;
    mv.mous_dy = 0;
    if (mv.ro.sm.Cl == "vuw" &&
        (mv.ua == "resize" || mv.ua == "mf")) {
        mv.ro.innerHTML = "";
    } else if (mv.ro._wrapped && mv.ua == "resize") {
        mv.ro._wrapped = undefined;
    }
};
mvSt.prototype.mouseMove = function (e) {
    var eo = window.event || e;
    mv.mous_dx = eo.clientX - mv.mous_x;
    mv.mous_dy = eo.clientY - mv.mous_y;
    mv.mous_x = eo.clientX;
    mv.mous_y = eo.clientY;
    if (mv.ua == "mf" || mv.ua == "fade") {
        mv.ro[mv.ua]({dx: mv.mous_dx});
        mv.ro.redrawTree();
    } else {
        mv.ro[mv.ua]({dx: mv.mous_dx, dy: mv.mous_dy});
        mv.ro.rd();
        for (var i = 0; mv.ro.dn &&
            i < mv.ro.dn.length; i++) {
            mv.ro.dn[i].rd();
        }
    }
};
mvSt.prototype.mouseUp = function (e) {
    if (!mv.target) {
        return;
    }
    removeEvent(document, "mouseup", mv.mouseUp, false);
    removeEvent(document, "mousemove", mv.mouseMove, false);
    if (mv.ro.sm &&
        mv.ro.sm.Cl == "vuw" &&
        (mv.ua == "resize" || mv.ua == "mf")) {
        mv.ro.writeInnerHTML();
    } else {
        mv.ro.rd();
    }
    mv.ro.sCd();
};
var mv = new mvSt();
var Rs = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( Rs, Do);
Rs.prototype.sm = {Cl:'Rs',inr:0};
Rs.prototype.sm.fd = ['sg'];
Rs.prototype.sm.it = function (ar) {
    Do.prototype.sm.it.call(this, ar);
    
    if (this.STt != "ld" && this.STt != "idb") {
        this.bnd();
    }
};
Rs.prototype.idb = function () {
    this.sg = this.fd[2];
    this.bnd();
};
Rs.prototype.bnd = function (ar) {
    this.sg = this.sg.replace(/\s\s+/g, "");
    this.p2 = gp({sg: this.sg, lm: ","});
    if (this.p2 && this.p2[0] && this.p2[1]) {
        this.dc = window[this.p2[0]];
        ait.rsrcs[this.p2[1]] = this;
    } else {
        ait.rsrcs[this.id] = this;
    }
};
Rs.prototype.createContent = function () {
    this.sg = "";
    for (var i = 0; i < this.p2.length; i++) {
        this.sg += this.p2[i] + ",";
    }
    this.sg = this.sg.replace(/\w+:;/g, "").replace(/\w+:undefined;/g, "");
    Do.prototype.createContent.call(this);
};
Rs.prototype.sCd = function (ar) {
    if (this.STt == "ll") {
        this.STt = "new";
    } else if (this.STt != "new" && this.STt != "nrv") {
        this.STt = "cgd";
    }
};
var bDDSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
bDDSt.prototype.sm = {Cl:'bDDSt',inr:0};
bDDSt.prototype.sm.it = function (ar) {
    
};
bDDSt.prototype.grs = function (ar) {
    if (ar.sg == "bwd") {
        if (!ait.rsrcs.bwd) {
            new Rs({sg: "bDD,bwd,color:gray;backgroundColor:lightgray;,color:black;,color:black;backgroundColor:gold;,color:black;,color:gold;,100,20,1", STt: "ll"});
        }
        return ait.rsrcs.bwd;
    }
    if (ar.sg == "bwToggle_default") {
        if (!ait.rsrcs.bwToggle_default) {
            new Rs({sg: "bDD,bwToggle_default,color:gray;backgroundImage:url(\"shared/redButton.png\");backgroundColor:darkred;,color:white;backgroundImage:url(\"shared/redButton.png\");backgroundColor:red;,color:gold;backgroundImage:url(\"shared/redButton.png\");backgroundColor:red;,color:white;backgroundImage:url(\"shared/redButton.png\");backgroundColor:red;,color:gold;backgroundImage:url(\"shared/redButton.png\");backgroundColor:red;border:1px solid gold;,15,15,1", STt: "ll"});
        }
        return ait.rsrcs.bwToggle_default;
    }
};
bDDSt.prototype.de = function (ar) {
    var b2 = ar.obj;
    var bobj = b2.o2[0];
    if (b2.STt == "new") {
        b2.te.w = bobj.te.w;
        b2.te.h = bobj.te.h;
    }
    this.sM({obj: ar.obj, md: 1});
};
bDDSt.prototype.sM = function (ar) {
    var b2 = ar.obj;
    if (b2.src || !b2.o2) {
        return;
    }
    var bobj = b2.o2[0];
    if (!bobj) {
        return;
    }
    var b5 = b2.b5;
    if (!b5.modes) {
        this.irc({obj: b5});
    }
    var md = b5.modes[ar.md];
    b2.rse();
    if (md.border || md.border == "") {
        b2.ase({pr: "border", val: md.border});
    }
    if (md.backgroundColor || md.backgroundColor == "") {
        b2.ase({pr: "backgroundColor", val: md.backgroundColor});
    }
    if (md.backgroundImage || md.backgroundImage == "") {
        b2.ase({pr: "backgroundImage", val: md.backgroundImage});
    }
    for (stle in md) {
        if (stle != "border" &&
            stle != "backgroundImage" && stle != "backgroundColor") {
            bobj.ase({pr: stle, val: md[stle]});
        }
    }
};
bDDSt.prototype.irc = function (ar) {
    var b5 = ar.obj;
    if (b5.modes) {
        return;
    }
    b5.modes = [];
    for (var state = 0; state < 5; state++) {
        var md = {border: "", backgroundImage: "", backgroundColor: "", color: "", textAlign: ""};
        var s = gp({sg: b5.p2[2 + state], lm: ";"});
        for (var i = 0; s && i < s.length; i++) {
            var nSt = gp({sg: s[i]});
            md[nSt[0]] = nSt[1];
        }
        b5.modes.push(md);
    }
};
var bDD = new bDDSt();
var bgdSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( bgdSt, bDDSt);
bgdSt.prototype.sm = {Cl:'bgdSt',inr:0};
bgdSt.prototype.sm.it = function (ar) {
    bDDSt.prototype.sm.it.call(this, ar);
    
};
bgdSt.prototype.grs = function (ar) {
    if (ar.sg == "bw_grow") {
        if (!ait.rsrcs.bw_grow) {
            new Rs({sg: "bgd,bw_grow,c,c", STt: "ll"});
        }
        return ait.rsrcs.bw_grow;
    }
};
bgdSt.prototype.sM = function (ar) {
    var b2 = ar.obj;
    if (ar.md == 2 || ar.md == 4) {
        this.doGrow(ar);
    } else {
        this.doUngrow(ar);
    }
};
bgdSt.prototype.irc = function (ar) {
};
bgdSt.prototype.doGrow = function (ar) {
    var b2 = ar.obj;
    var t = b2.te;
    if (!b2.e_s) {
        b2.e_s = t.s;
        b2.e_x = t.x;
        b2.e_y = t.y;
    }
    var hor = b2.b5.p2[2];
    var ver = b2.b5.p2[3];
    var s = b2.e_s * 1.3;
    var x = b2.e_x;
    if (hor == "c") {
        x -= t.w * 0.15;
    } else if (hor == "r") {
        x -= t.w * 0.3;
    }
    var y = b2.e_y;
    if (ver == "c") {
        y -= t.h * 0.15;
    } else if (ver == "b") {
        y -= t.h * 0.3;
    }
    b2.tf({s: s, x: x, y: y, dt: 300});
};
bgdSt.prototype.doUngrow = function (ar) {
    var b2 = ar.obj;
    if (b2.e_s) {
        b2.tf({s: b2.e_s, x: b2.e_x, y: b2.e_y, dt: 100});
    }
};
var bgd = new bgdSt();
var BWHDefaultDecoratorSingleton = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( BWHDefaultDecoratorSingleton, bDDSt);
BWHDefaultDecoratorSingleton.prototype.sm = {Cl:'BWHDefaultDecoratorSingleton',inr:0};
BWHDefaultDecoratorSingleton.prototype.sm.it = function (ar) {
    bDDSt.prototype.sm.it.call(this, ar);
    
};
BWHDefaultDecoratorSingleton.prototype.grs = function (ar) {
    if (ar.sg == "bwh_default") {
        if (!ait.rsrcs.bwh_default) {
            new Rs({sg: "BWHDefaultDecorator,bwh_default,color:gray;backgroundColor:lightgray;,,,,", STt: "ll"});
        }
        return ait.rsrcs.bwh_default;
    }
};
BWHDefaultDecoratorSingleton.prototype.sM = function (ar) {
    var b2 = ar.obj;
    if (b2.src || !b2.o2) {
        return;
    }
    var bobj = b2.o2[0];
    if (!bobj) {
        return;
    }
    var b5 = b2.b5;
    if (!b5.modes) {
        this.irc({obj: b5});
    }
    var md = b5.modes[ar.md];
    b2.rse();
    if (md.border || md.border == "") {
        b2.ase({pr: "border", val: ""});
    }
    if (md.backgroundColor || md.backgroundColor == "") {
        b2.ase({pr: "backgroundColor", val: md.backgroundColor});
    }
    if (md.backgroundImage || md.backgroundImage == "") {
        b2.ase({pr: "backgroundImage", val: md.backgroundImage});
    }
    for (stle in md) {
        if (stle != "border" &&
            stle != "backgroundImage" && stle != "backgroundColor") {
            bobj.ase({pr: stle, val: md[stle]});
        }
    }
};
var BWHDefaultDecorator = new BWHDefaultDecoratorSingleton();
var bw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( bw, aw);
bw.prototype.sm = {Cl:'bw',inr:0};
bw.prototype.sm.it = function (ar) {
    aw.prototype.sm.it.call(this, ar);
    
    this.modeActive = true;
    if (this.STt != "ld" && this.STt != "idb") {
        this._wrapped = true;
        var bobj;
        if (ar) {
            if (ar.obj) {
                bobj = ar.obj;
            } else if (ar.txt) {
                bobj = new tw({txt: ar.txt});
            } else if (ar.t1) {
                bobj = new tw({t1: ar.t1});
            } else {
                bobj = new tw({t1: "..."});
            }
            this.bc({obj: bobj});
            this.te.w = bobj.te.w;
            this.te.h = bobj.te.h;
            if (ar.klik) {
                this.klik = ar.klik;
            }
            if (ar.hover) {
                this.hover = ar.hover;
            }
            if (ar.unhover) {
                this.unhover = ar.unhover;
            }
            if (ar.mw1) {
                this.mw1 = ar.mw1;
            }
        }
    }
};
bw.prototype.idb = function () {
    if (!this.fd[3]) {
        var bobj = new tw({t1: "error txt"});
        this.bc({obj: bobj});
        this.te.w = bobj.te.w;
        this.te.h = bobj.te.h;
    }
    aw.prototype.idb.call(this);
    var p2 = gp({sg: this.fd[2], lm: ";"});
    this.klik = p2[0];
    if (p2.length >= 2) {
        this.hover = p2[1];
    }
    if (p2.length >= 3) {
        this.unhover = p2[2];
    }
};
bw.prototype.cdc = function () {
    this.Ct += (this.klik && this.klik.match ? this.klik : "") + ";" + (this.hover && this.hover.match && !this.hbw ? this.hover + ";" : "") + (this.unhover && this.unhover.match && !this.hbw ? this.unhover + ";" : "");
};
bw.prototype.de = function () {
    if (!this.b5) {
        this.b5 = bDD.grs({sg: "bwd"});
    }
    this.b5.dc.de({obj: this});
    if (!this.dn || !this.dn.length) {
        this.ad({obj: new ue});
    }
};
bw.prototype.sM = function () {
    if (!this.b5) {
        return;
    }
    if (!this.modeActive) {
        this.b5.dc.sM({obj: this, md: 0});
    } else if (this.mdmH) {
        this.b5.dc.sM({obj: this, md: 2});
    } else if (this.modeKeyTab) {
        this.b5.dc.sM({obj: this, md: 4});
    } else if (this.modeSelected) {
        this.b5.dc.sM({obj: this, md: 3});
    } else {
        this.b5.dc.sM({obj: this, md: 1});
    }
};
bw.prototype.showActive = function () {
    this.modeActive = true;
    this.sM();
};
bw.prototype.showDeActive = function () {
    this.modeActive = null;
    this.sM();
};
bw.prototype.showHover = function () {
    this.mdmH = true;
    this.sM();
};
bw.prototype.showUnHover = function () {
    this.mdmH = null;
    this.sM();
};
bw.prototype.showSelected = function () {
    this.modeSelected = true;
    this.sM();
};
bw.prototype.showUnSelected = function () {
    this.modeSelected = null;
    this.sM();
};
bw.prototype.showKeyTab = function () {
    this.modeKeyTab = true;
    this.sM();
};
bw.prototype.showUnKeyTab = function () {
    this.modeKeyTab = null;
    this.sM();
};
bw.prototype.fitWidth = function () {
    if (!this.o2) {
        return;
    }
    var bt = this.te;
    var ot = this.o2[0].te;
    ot.s = bt.w / ot.w;
    ot.x = 0;
};
bw.prototype.fitHeight = function () {
    if (!this.o2) {
        return;
    }
    var bt = this.te;
    var ot = this.o2[0].te;
    ot.s = bt.h / ot.h;
    ot.y = 0;
};
bw.prototype.fitWidthRSRC = function () {
    if (!this.o2) {
        return;
    }
    if (this.b5) {
        var w = parseInt(this.b5.p2[7]);
        this.te.w = w;
        this.fitWidth();
    }
};
bw.prototype.fitHeightRSRC = function () {
    if (!this.o2) {
        return;
    }
    if (this.b5) {
        var h = parseInt(this.b5.p2[8]);
        this.te.h = h;
        this.fitHeight();
    }
};
bw.prototype.fitRSRC = function () {
    if (!this.o2) {
        return;
    }
    if (this.b5) {
        var w = parseInt(this.b5.p2[7]);
        this.te.w = w;
        var h = parseInt(this.b5.p2[8]);
        this.te.h = h;
    }
};
bw.prototype.alignLeft = function () {
    if (!this.o2) {
        return;
    }
    this.o2[0].te.x = 0;
};
bw.prototype.centerW = function () {
    if (!this.o2) {
        return;
    }
    this.o2[0].te.x = (this.te.w - this.o2[0].te.w * this.o2[0].te.s) / 2;
};
bw.prototype.alignRight = function () {
    if (!this.o2) {
        return;
    }
    this.o2[0].te.x = this.te.w - this.o2[0].te.w * this.o2[0].te.s;
};
bw.prototype.alignTop = function () {
    if (!this.o2) {
        return;
    }
    this.o2[0].te.y = 0;
};
bw.prototype.centerH = function () {
    if (!this.o2) {
        return;
    }
    this.o2[0].te.y = (this.te.h - this.o2[0].te.h * this.o2[0].te.s) / 2;
};
bw.prototype.alignBottom = function () {
    if (!this.o2) {
        return;
    }
    this.o2[0].te.y = this.te.h - this.o2[0].te.h * this.o2[0].te.s;
};
var HoverButtonWidget = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( HoverButtonWidget, aw);
HoverButtonWidget.prototype.sm = {Cl:'HoverButtonWidget',inr:0};
HoverButtonWidget.prototype.sm.it = function (ar) {
    aw.prototype.sm.it.call(this, ar);
    
    this.ad({obj: new ue});
    if (this.STt != "ld" && this.STt != "idb") {
        this.bw_top = ar.obj;
        this.it2();
    }
};
HoverButtonWidget.prototype.idb = function () {
    aw.prototype.idb.call(this);
    var p2 = gp({sg: this.fd[2], lm: ";"});
    this.bw_top = DB[p2[0]];
    this.it2();
};
HoverButtonWidget.prototype.it2 = function (ar) {
    this.bw_top.hbw = this;
    this.bw_top.hover = "DB[\"" + this.id + "\"].inTop()";
    this.bw_top.unhover = "DB[\"" + this.id + "\"].outTop()";
};
HoverButtonWidget.prototype.cdc = function () {
    this.Ct += this.bw_top.id;
};
HoverButtonWidget.prototype.redrawTree = function () {
    aw.prototype.redrawTree.call(this);
    this.hide();
};
HoverButtonWidget.prototype.de = function () {
    if (!this.b5) {
        this.b5 = BWHDefaultDecorator.grs({sg: "bwh_default"});
    }
    this.b5.dc.de({obj: this});
};
HoverButtonWidget.prototype.inTop = function () {
    this.showHoverButtn();
};
HoverButtonWidget.prototype.outTop = function () {
    this.setTimerHide();
};
HoverButtonWidget.prototype.showHoverButtn = function () {
    var i;
    if (this.pt.cancelTimerHide) {
        this.pt.cancelTimerHide();
    }
    this.cancelTimerHide();
    if (this.isHidden()) {
        this.unhide();
    }
};
HoverButtonWidget.prototype.hideHoverButtn = function () {
    if (ait.oTree) {
        return;
    }
    if (this.isHidden()) {
        return;
    }
    if (this.dn[0].STm == 2) {
        return;
    }
    if (this.bw_top.dn[0].STm == 2) {
        return;
    }
    if (this.lastChild &&
        this.lastChild.dn &&
        this.lastChild.dn[0] &&
        this.lastChild.dn[0].STm &&
        this.lastChild.dn[0].STm == 2) {
        return;
    }
    for (var i = 0; i < this.o2.length; i++) {
        var cd = this.o2[i];
        if (cd.hideHoverButtn && cd.div.style.display == "block") {
            return;
        }
    }
    this.cancelTimerHide();
    this.hide();
    if (this.pt.setTimerHide) {
        this.pt.setTimerHide();
    }
};
HoverButtonWidget.prototype.setTimerHide = function () {
    this.cancelTimerHide();
    this.ctime = setTimeout("DB[\"" + this.id + "\"].hideHoverButtn()", 3000);
};
HoverButtonWidget.prototype.cancelTimerHide = function () {
    if (this.ctime) {
        clearTimeout(this.ctime);
        this.ctime = null;
    }
};
HoverButtonWidget.prototype.hideTreeDown = function () {
    if (this.isHidden()) {
        return;
    }
    this.cancelTimerHide();
    for (i = 0; i < this.o2.length; i++) {
        var cd = this.o2[i];
        if (cd.hideTreeDown) {
            cd.hideTreeDown();
        }
    }
    this.hide();
};
HoverButtonWidget.prototype.hideTreeUp = function () {
    this.cancelTimerHide();
    this.hide();
    if (this.pt.hideTreeUp) {
        this.pt.hideTreeUp();
    }
};
HoverButtonWidget.prototype.childHover = function (ar) {
    this.lastChild = ar.obj;
    if (this.lastChild == this.lastCHB) {
        return;
    }
    if (this.lastCHB) {
        this.lastCHB.hide();
    }
    if (this.lastChild.hbw) {
        this.lastCHB = this.lastChild.hbw;
    }
};
HoverButtonWidget.prototype.childUnHover = function (ar) {
    this.lastChild = null;
};
HoverButtonWidget.prototype.childClick = function () {
    this.hideTreeUp();
};
HoverButtonWidget.prototype.showActive = function () {
};
HoverButtonWidget.prototype.showDeActive = function () {
};
HoverButtonWidget.prototype.showHover = function () {
    this.cancelTimerHide();
};
HoverButtonWidget.prototype.showUnHover = function () {
    this.setTimerHide();
};
HoverButtonWidget.prototype.showSelected = function () {
};
HoverButtonWidget.prototype.showUnSelected = function () {
};
HoverButtonWidget.prototype.showKeyTab = function () {
};
HoverButtonWidget.prototype.showUnKeyTab = function () {
};
var iDfSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( iDfSt, bDDSt);
iDfSt.prototype.sm = {Cl:'iDfSt',inr:0};
iDfSt.prototype.sm.it = function (ar) {
    bDDSt.prototype.sm.it.call(this, ar);
    
};
iDfSt.prototype.grs = function (ar) {
    if (ar.sg == "iw_default") {
        if (!ait.rsrcs.iw_default) {
            new Rs({sg: "iDf,iw_default,backgroundColor:gray;color:black;,backgroundColor:white;color:black;,backgroundColor:white;color:black;border:1px solid gold;,backgroundColor:white;color:black;,backgroundColor:white;color:blue;border:1px solid gold;,200,20,1", STt: "ll"});
        }
        return ait.rsrcs.iw_default;
    }
};
iDfSt.prototype.de = function (ar) {
    var input = ar.obj;
    if (input.STt == "new") {
        input.te.w = parseInt(input.b5.p2[7]);
        input.te.h = parseInt(input.b5.p2[8]);
        input.te.s = parseFloat(input.b5.p2[9]);
        input.te.x = 2;
        input.te.y = 2;
    }
    this.sM({obj: input, md: 1});
};
iDfSt.prototype.sM = function (ar) {
    var input = ar.obj;
    var b5 = input.b5;
    if (!b5.modes) {
        this.irc({obj: b5});
    }
    var md = b5.modes[ar.md];
    input.rse();
    for (stle in md) {
        input.ase({pr: stle, val: md[stle]});
    }
    input.ase({pr: "overflow", val: "auto"});
    input.ase({pr: "whiteSpace", val: "pre"});
};
var iDf = new iDfSt();
var iw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( iw, tw);
iw.prototype.sm = {Cl:'iw',inr:0};
iw.prototype.sm.isL = 'true';
iw.prototype.sm.it = function (ar) {
    tw.prototype.sm.it.call(this, ar);
    
    this.val = "";
    this.data = "DB['" + this.id + "'].val";
    this.modeActive = true;
    this.md = "n";
    this.KTFocus = "DB['" + this.id + "'].et()";
    this.KTUnFocus = "DB['" + this.id + "'].fe()";
    if (this.STt != "ld" && this.STt != "idb") {
        this.d2[0].STt = "ll";
        if (ar) {
            if (ar.label) {
                this.label = ar.label;
            }
            if (ar.data) {
                this.data = ar.data;
                this.d2[0].txt = eval(this.data);
                this.rebind();
            }
            if (ar.iP) {
                this.iP = true;
            }
            if (ar.ol) {
                this.ol = true;
            }
        }
    }
};
iw.prototype.idb = function () {
    sw.prototype.idb.call(this);
    var p2 = gp({sg: this.fd[2], lm: ";"});
    this.label = DB[p2[0]];
    if (p2[1]) {
        this.data = p2[1];
        this.rebind();
    }
    if (p2[2] && p2[2].match(/n/)) {
        this.ol = true;
    }
    if (p2[2] && p2[2].match(/p/)) {
        this.iP = true;
    }
    if (p2[2] && p2[2].match(/r/)) {
        this.requird = true;
    }
    if (p2[3] && this[p2[3]]) {
        this.check = p2[3];
    }
};
iw.prototype.cdc = function () {
    var tp = "";
    if (this.ol) {
        tp += "n";
    }
    if (this.iP) {
        tp += "p";
    }
    if (this.requird) {
        tp += "r";
    }
    this.Ct += this.label.id + ";" + (this.data ? this.data : "") + ";" + tp + ";" + (this.check ? this.check : "");
};
iw.prototype.bnd = function () {
    tw.prototype.bnd.call(this);
    this.d2[0].STt = "ll";
};
iw.prototype.rebind = function () {
    this.d2[0].txt = this.data ? eval(this.data) : "";
    this.lineElements = this.lineElementsFromText({sg: this.d2[0].txt});
    this.createHTML();
    this.createStrng();
    this.lineElements = undefined;
};
iw.prototype.de = function () {
    if (!this.b5) {
        this.b5 = iDf.grs({sg: "iw_default"});
    }
    this.b5.dc.de({obj: this});
    this.ad({obj: new ue});
};
iw.prototype.sM = function (ar) {
    bw.prototype.sM.call(this);
};
iw.prototype.showActive = function () {
    bw.prototype.showActive.call(this);
};
iw.prototype.showDeActive = function () {
    bw.prototype.showDeActive.call(this);
};
iw.prototype.showHover = function () {
    bw.prototype.showHover.call(this);
};
iw.prototype.showUnHover = function () {
    bw.prototype.showUnHover.call(this);
};
iw.prototype.showSelected = function () {
    bw.prototype.showSelected.call(this);
};
iw.prototype.showUnSelected = function () {
    bw.prototype.showUnSelected.call(this);
};
iw.prototype.showKeyTab = function () {
    bw.prototype.showKeyTab.call(this);
};
iw.prototype.showUnKeyTab = function () {
    bw.prototype.showUnKeyTab.call(this);
};
iw.prototype.aal = function () {
    this.atv();
};
iw.prototype.dal = function () {
    this.deactivate();
};
iw.prototype.fe = function (ar) {
    if (this.data) {
        eval("" + this.data + "= this.d2[0].txt");
    }
    if (this.enter) {
        this.enter = null;
        this.pt.ckF();
    }
    tw.prototype.fe.call(this);
};
iw.prototype.clearF = function (ar) {
    eval(this.data + "=''");
    this.d2[0].txt = "";
    this.createHTML();
};
iw.prototype.checkRequired = function () {
    if (!eval(this.data) || eval(this.data + "==''")) {
        return "\n" + this.label.d2[0].txt + " : moet nog worden ingevuld";
    } else {
        return "";
    }
};
iw.prototype.checkEmail = function () {
    var emailStr = eval(this.data);
    if (!emailStr) {
        return "";
    }
    var specialChars = "\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
    var validChars = "[^\\s" + specialChars + "]";
    var quotedUser = "(\"[^\"]*\")";
    var atom = validChars + "+";
    var word = "(" + atom + "|" + quotedUser + ")";
    var emailPat = /^(.+)@(.+)$/;
    var matchArray = emailStr.match(emailPat);
    if (matchArray == null) {
        return "\n" + this.label.d2[0].txt + " : moet een '@' en een '.' bevatten";
    }
    var user = matchArray[1];
    var domain = matchArray[2];
    for (i = 0; i < user.length; i++) {
        if (user.charCodeAt(i) > 127) {
            return "\n" + this.label.d2[0].txt + " : bevat ongeldige tekens";
        }
    }
    for (i = 0; i < domain.length; i++) {
        if (domain.charCodeAt(i) > 127) {
            return "\n" + this.label.d2[0].txt + " : bevat ongeldige tekens";
        }
    }
    var userPat = new RegExp("^" + word + "(\\." + word + ")*$");
    if (user.match(userPat) == null) {
        return "\n" + this.label.d2[0].txt + " : het deel voor de @ ziet er raar uit";
    }
    var ipDomainPat = /^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
    var IPArray = domain.match(ipDomainPat);
    if (IPArray != null) {
        for (var i = 1; i <= 4; i++) {
            if (IPArray[i] > 255) {
                return "\n" + this.label.d2[0].txt + " : het IP adres is ongeldig";
            }
        }
    }
    var domArr = domain.split(".");
    var len = domArr.length;
    var atomPat = new RegExp("^" + atom + "$");
    for (i = 0; i < len; i++) {
        if (domArr[i].search(atomPat) == -1) {
            return "\n" + this.label.d2[0].txt + " : de domain naam is ongeldig";
        }
    }
    if (domArr[domArr.length - 1].length < 3 || len < 2) {
        return "\n" + this.label.d2[0].txt + " : het deel na de '@' is ongeldig";
    }
    return "";
};
var erSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( erSt, ob);
erSt.prototype.sm = {Cl:'erSt',inr:0};
erSt.prototype.sm.it = function (ar) {
    ob.prototype.sm.it.call(this, ar);
    
};
erSt.prototype.et = function (ar) {
    this.co = ar.obj;
    cb.eS = true;
    var s = cb.frm.style;
    if (vt.id != null && vt.id == 2) {
        s.left = "5px";
        s.zIndex = 1;
        var s = cb.inp1.style;
        s.width = "800px";
        s.height = "100px";
    } else {
        s.left = this.co.acc.x + "px";
        s.top = this.co.acc.y + "px";
    }
};
erSt.prototype.evaluateKey = function (ar) {
    switch (ar.evnt.keyCode) {
      case 13:
        if (this.co.ol) {
            this.co.enter = true;
            this.co.fe();
            cb.fnx();
        } else {
            this.co.processEdit();
        }
        break;
      case 9:
        cb.inp1.focus();
        this.co.fe();
        cb.fnx();
        break;
      case 27:
        this.co.fe();
        cb.fnx();
        break;
      default:
        this.co.processEdit();
        break;
    }
};
erSt.prototype.createCaretDiv = function (ar) {
    this.caretdiv = dce("div");
    document.body.appendChild(this.caretdiv);
    var as = this.co.acc.s;
    var s1 = this.caretdiv.style;
    s1.width = "5px";
    s1.height = "" + 19 * as + "px";
    s1.position = "absolute";
    s1.color = "red";
    s1.fontFamily = "Verdana, Geneva, sans-serif";
    s1.fontWeight = "bold";
    s1.fontSize = "" + (17 * as + 0.5 | 0) + "px";
    s1.textDecoration = "blink";
    this.caretdiv.innerHTML = "|";
    this.caret_el = dce("span");
    this.caret_el.innerHTML = "|";
};
erSt.prototype.removeCaretDiv = function (ar) {
    if (this.caretdiv) {
        document.body.removeChild(this.caretdiv);
        this.caretdiv = undefined;
        if (this.caret_el.parentNode) {
            this.caret_el.parentNode.removeChild(this.caret_el);
        }
        this.caret_el = undefined;
    }
};
erSt.prototype.fe = function () {
    if (!this.co) {
        return;
    }
    this.co = null;
    var s = cb.frm.style;
    s.left = "-55px";
    this.removeCaretDiv();
    cb.eS = false;
};
var er = new erSt();
var ssSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ssSt.prototype.sm = {Cl:'ssSt',inr:0};
ssSt.prototype.sm.it = function (ar) {
    
    this.arr = [];
};
ssSt.prototype.addNewState = function (ar) {
    var aw = ar.obj;
    for (var i = 0; i < this.arr.length; i++) {
        if (this.arr[i].aw == aw) {
            return null;
        }
    }
    var t1 = aw.iid.replace(/aw/, "to page");
    var nd = ait.sMenu.cnn({sg: t1, mt: "p_" + aw.id, isLeaf: ar.isLeaf});
    aw.st = {aw: aw, h_a: [], nd: nd};
    this.arr.push(aw.st);
    return aw.st;
};
ssSt.prototype.addNode = function (ar) {
    for (var i = 0; i < this.arr.length; i++) {
        if (ar.nd.mt == "p_" + this.arr[i].aw.id) {
            this.arr[i].nd = ar.nd;
            return;
        }
    }
    return;
};
ssSt.prototype.checkStates = function (ar) {
    for (var i = this.arr.length - 1; i >= 0; i--) {
        var st = this.arr[i];
        if (!DB[st.aw.id]) {
            this.delState({obj: st});
        }
    }
};
ssSt.prototype.delState = function (ar) {
    var idx = this.findState(ar);
    if (idx + 1) {
        this.arr.splice(idx, 1);
        ar.st.h_a = null;
        var aw = ar.st.aw;
        if (aw) {
            aw.st = null;
            st.aw = null;
            aw.sCd();
        }
        ar.st.aw = null;
        var child_node = ar.st.nd;
        if (child_node) {
            var p_n = child_node.pt;
            p_n.orphanChildNode({nd: child_node});
            ait.sMenu.don();
            st.nd = null;
            child_node.mu.sCd();
        }
        ar.st.nd = null;
    }
};
ssSt.prototype.findState = function (ar) {
    for (var i = 0; this.arr && i < this.arr.length; i++) {
        if (this.arr[i] == ar.obj) {
            return i;
        }
    }
    return -1;
};
var States = new ssSt();
var Menu = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( Menu, Do);
Menu.prototype.sm = {Cl:'Menu',inr:0};
Menu.prototype.sm.fd = ['sr'];
Menu.prototype.sm.it = function (ar) {
    Do.prototype.sm.it.call(this, ar);
    
    if (ar) {
        if (ar.sr) {
            this.sr = ar.sr;
            this.create2Dim();
        } else if (ar.twoDim) {
            this.twoDim = ar.twoDim;
            this.c5();
        }
    }
};
Menu.prototype.createContent = function () {
    this.sr = "";
    if (this.tree) {
        this.aC({obj: this.tree, sg: ""});
    }
    Do.prototype.createContent.call(this);
};
Menu.prototype.aC = function (ar) {
    var tree = ar.obj;
    for (var i = 0; i < tree.length; i++) {
        var nd = tree[i];
        var mt = "";
        if (nd.mt) {
            mt = "," + nd.mt;
        }
        this.sr += (nd.tree ? "N" : "L") + "," + ar.sg + "," + nd.txt.txt + mt + ";";
        var sg = ar.sg == "" ? "" + i : ar.sg + "-" + i;
        if (nd.tree) {
            this.aC({obj: nd.tree, sg: sg});
        }
    }
};
Menu.prototype.idb = function () {
    Do.prototype.idb.call(this);
    this.create2Dim();
};
Menu.prototype.create2Dim = function () {
    this.p2 = gp({sg: this.sr, lm: ";"});
    if (!this.p2 || !this.p2.length) {
        this.p2 = ["0,error;"];
    }
    this.twoDim = [];
    while (this.p2.length) {
        var next = this.p2.splice(0, 1);
        var oneDim = gp({sg: next, lm: ","});
        if (oneDim) {
            this.twoDim.push(oneDim);
        } else {
            this.twoDim.push([]);
        }
    }
    this.c5();
};
Menu.prototype.c5 = function () {
    if (!this.twoDim) {
        return;
    }
    var createState = false;
    if (this.iid.replace(/Menu/, "") == "_0") {
        ait.sMenu = this;
        createState = true;
    }
    this.tree = [];
    while (this.twoDim.length) {
        var next = this.twoDim.splice(0, 1)[0];
        var p_n = this.fdp({nd: this, p2: gp({sg: next[1], lm: "-"})});
        if (!p_n) {
            p_n = this;
        }
        var child_node = null;
        var mt = next.length == 4 ? next[3] : null;
        if (next[0] == "L") {
            child_node = new ml({mu: this, pt: p_n, sg: next[2], mt: mt});
        } else {
            child_node = new mn({mu: this, pt: p_n, sg: next[2], mt: mt});
        }
        p_n.tree.push(child_node);
        if (createState && mt && mt.match(/^p_/)) {
            States.addNode({nd: child_node});
        }
    }
    this.twoDim = null;
    this.p2 = null;
};
Menu.prototype.fdp = function (ar) {
    var nd = ar.nd;
    var p2 = ar.p2;
    if (!p2 || p2.length == 0) {
        return nd;
    }
    var idx = parseInt(ar.p2.splice(0, 1)[0]);
    return this.fdp({nd: nd.tree[idx], p2: ar.p2});
};
Menu.prototype.cnn = function (ar) {
    var nd = null;
    ar.mu = this;
    if (ar.isLeaf) {
        nd = new ml(ar);
    } else {
        nd = new mn(ar);
    }
    this.nE({enm: "cnn", nd: nd});
    return nd;
};
Menu.prototype.bindChildNode = function (ar) {
    return mn.prototype.bindChildNode.call(this, ar);
};
Menu.prototype.unbindChildNode = function (ar) {
    return mn.prototype.unbindChildNode.call(this, ar);
};
var mw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( mw, aw);
mw.prototype.sm = {Cl:'mw',inr:0};
mw.prototype.sm.it = function (ar) {
    aw.prototype.sm.it.call(this, ar);
    
    this.d2 = [];
    this.orphans = [];
    this._wrapped = true;
    cb.amw({obj: this});
    if (this.STt != "ld" && this.STt != "idb") {
        if (ar && ar.menu) {
            this.d2 = [ar.menu];
            this.bnd();
        }
    }
    this.mw1 = this;
};
mw.prototype.idb = function () {
    sw.prototype.idb.call(this);
    this.collapsed = gp({sg: this.fd[2], lm: ";"});
};
mw.prototype.cdc = function () {
    this.adc({obj: this});
};
mw.prototype.adc = function (ar) {
    var obj = ar.obj;
    if (obj.isHidden()) {
        this.Ct += obj.id.replace(this.id + ".", "") + ";";
    }
    for (var i = 0; obj.o2 && i < obj.o2.length; i++) {
        this.adc({obj: obj.o2[i]});
    }
};
mw.prototype.bnd = function (ar) {
    if (ar && ar.obj) {
        this.d2.push(ar.obj);
    }
    if (!this.d2 || !this.d2[0]) {
        return;
    }
    var mnu = this.d2[0];
    mnu.al({enm: "cnn", Lobj: this, mN: "createNodeWidget"});
    mnu.al({enm: "bindChildNode", Lobj: this, mN: "adoptOrphanNodeWidget"});
    mnu.al({enm: "unbindChildNode", Lobj: this, mN: "ornw"});
};
mw.prototype.unbind = function () {
    if (this.d2 && this.d2[0]) {
        var mnu = this.d2[0];
        mnu.rL({enm: "cnn", Lobj: this, mN: "createNodeWidget"});
        mnu.rL({enm: "bindChildNode", Lobj: this, mN: "adoptOrphanNodeWidget"});
        mnu.rL({enm: "unbindChildNode", Lobj: this, mN: "ornw"});
        if (!mnu.ls.cnn) {
            mnu.rv();
        }
        this.d2 = null;
    }
};
mw.prototype.de = function () {
    if (!this.b5) {
        this.b5 = mwDf.grs({sg: "mw_default"});
    }
    this.b5.dc.de({obj: this});
};
mw.prototype.di = function () {
    this.b5.dc.di({obj: this});
};
mw.prototype.c5 = function () {
    if (!this.d2 || !this.d2.length) {
        return;
    }
    this.createSubWidgets({widget: this, nd: this.d2[0]});
};
mw.prototype.createSubWidgets = function (ar) {
    var nd = ar.nd;
    var widget = ar.widget;
    for (var i = 0; nd.tree && i < nd.tree.length; i++) {
        var child_node = nd.tree[i];
        var child_widget = this.createNodeWidget({nd: child_node});
        widget.adoptOrphanNodeWidget({nd: child_node});
        this.createSubWidgets({widget: child_widget, nd: child_node});
    }
};
mw.prototype.createNodeWidget = function (ar) {
    var nd = ar.nd;
    var widget = null;
    if (nd.tree) {
        widget = new ndw({mw1: this, nd: nd});
    } else {
        widget = new lfw({mw1: this, nd: nd});
    }
    if (ait.oTree && widget.mw1.intree) {
        ait.oTree.createWidget({obj: widget});
    }
    this.mw1.b5.dc.decorateWidget({widget: widget, nd: nd});
    this.orphans.push(widget);
    return widget;
};
mw.prototype.ornw = function (ar) {
    return ndw.prototype.ornw.call(this, ar);
};
mw.prototype.adoptOrphanNodeWidget = function (ar) {
    return ndw.prototype.adoptOrphanNodeWidget.call(this, ar);
};
var ml = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( ml, ob);
ml.prototype.sm = {Cl:'ml',inr:0};
ml.prototype.sm.it = function (ar) {
    ob.prototype.sm.it.call(this, ar);
    
    this.mt = ar.mt;
    this.mu = ar.mu;
    this.pt = ar.pt;
    var t1 = ar.sg ? ar.sg : "nd";
    this.txt = new Txt({txt: t1, STt: "ll"});
};
ml.prototype.nC = function () {
    var mt = this.mt;
    if (mt) {
        if (mt.xc) {
            mt.xc();
        } else if (mt.match && mt.match(/^p_/)) {
            Site.dynamics.gst({obj: DB[mt.replace(/p_/, "")]});
        } else {
            eval(mt);
        }
    }
    this.nE({enm: "nC"});
};
ml.prototype.rv = function () {
    if (this.pt) {
        alert("mn.rv() while having parent");
    }
    this.txt.rv();
    this.nE({enm: "rv"});
    ob.prototype.rv.call(this);
};
var lfw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( lfw, aw);
lfw.prototype.sm = {Cl:'lfw',inr:0};
lfw.prototype.sm.isL = 'true';
lfw.prototype.sm.it = function (ar) {
    aw.prototype.sm.it.call(this, ar);
    
    this.STt = "ll";
    this._wrapped = true;
    this.mw1 = ar.mw1;
    this.nd = ar.nd;
    this.nd.al({enm: "nC", Lobj: this, mN: "nC"});
    this.nd.al({enm: "rv", Lobj: this, mN: "rv"});
    this.div.style.position = "relative";
};
lfw.prototype.nC = function () {
    this.mw1.b5.dc.showNodeClick({widget: this});
};
var mn = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( mn, ml);
mn.prototype.sm = {Cl:'mn',inr:0};
mn.prototype.sm.it = function (ar) {
    ml.prototype.sm.it.call(this, ar);
    
    this.tree = [];
};
mn.prototype.toIndexChild = function (ar) {
    if (ar.idx1 != null &&
        ar.idx1 >= 0 &&
        ar.idx1 <= this.tree.length - 1 &&
        ar.idx2 != null &&
        ar.idx2 >= 0 && ar.idx2 <= this.tree.length - 2) {
        var nd = this.unbindChildNode({nd: ar.idx1});
        this.bindChildNode({nd: nd, idx: ar.idx2});
    }
};
mn.prototype.bindChildNode = function (ar) {
    var nd = ar.nd;
    if (ar.idx && ar.idx >= 0 && ar.idx < this.tree.length) {
        this.tree.splice(ar.idx, 0, nd);
    } else {
        this.tree.push(nd);
    }
    nd.pt = this;
    this.mu.sCd();
    this.nE({enm: "bindChildNode", nd: nd, idx: ar.idx});
};
mn.prototype.unbindChildNode = function (ar) {
    if (this.tree.length == 0) {
        return;
    }
    var idx = null;
    var nd = null;
    if (ar.idx || ar.idx == 0) {
        idx = ar.idx;
        nd = this.tree[idx];
    } else {
        nd = ar.nd;
        idx = this.tree.indexOf(nd);
    }
    var nd = this.tree.splice(idx, 1)[0];
    nd.pt = null;
    if (this.mu) {
        this.mu.sCd();
    }
    ar.enm = "";
    this.nE(ar);
    this.nE({enm: "unbindChildNode", nd: nd});
    return nd;
};
mn.prototype.removeChildNode = function (ar) {
    var nd = this.unbindChildNode(ar);
    nd.rv();
};
var ndw = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( ndw, lfw);
ndw.prototype.sm = {Cl:'ndw',inr:0};
ndw.prototype.sm.it = function (ar) {
    lfw.prototype.sm.it.call(this, ar);
    
    this.nd.al({enm: "bindChildNode", Lobj: this, mN: "adoptOrphanNodeWidget"});
    this.nd.al({enm: "unbindChildNode", Lobj: this, mN: "ornw"});
};
ndw.prototype.adoptOrphanNodeWidget = function (ar) {
    var nd = ar.nd;
    var widget = null;
    for (var i = 0; i < this.mw1.orphans.length; i++) {
        if (this.mw1.orphans[i].nd == nd) {
            widget = this.mw1.orphans[i];
            this.mw1.orphans.splice(i, 1);
            break;
        }
    }
    this.mw1.b5.dc.showAdoptNodeWidget({pt: this, widget: widget, idx: ar.idx});
};
ndw.prototype.ornw = function (ar) {
    this.mw1.b5.dc.showOrphanNodeWidget({pt: this, nd: ar.nd});
};
ndw.prototype.tG = function () {
    this.mw1.b5.dc.showToggle({widget: this});
};
ndw.prototype.collapse = function () {
    if (!this.isHidden()) {
        this.tG();
    }
};
ndw.prototype.xp = function () {
    if (this.isHidden()) {
        this.tG();
    }
};
var mwDfSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
mwDfSt.prototype.sm = {Cl:'mwDfSt',inr:0};
mwDfSt.prototype.sm.it = function (ar) {
    
};
mwDfSt.prototype.grs = function (ar) {
    if (ar.sg == "mw_default") {
        if (!ait.rsrcs.mw_default) {
            new Rs({sg: "mwDf,mw_default,fontFamily:Arial;backgroundImage:url(\"shared/g3sf15.gif\");border:1px solid black", STt: "ll"});
        }
        return ait.rsrcs.mw_default;
    }
    if (ar.sg == "mwToggle_default") {
        if (!ait.rsrcs.mwToggle_default) {
            new Rs({sg: "bDD,mwToggle_default,color:gray;backgroundImage:url(\"shared/redButton.png\");backgroundColor:darkred;,color:white;backgroundImage:url(\"shared/redButton.png\");backgroundColor:red;,color:gold;backgroundImage:url(\"shared/redButton.png\");backgroundColor:red;,color:white;backgroundImage:url(\"shared/redButton.png\");backgroundColor:red;,color:gold;backgroundImage:url(\"shared/redButton.png\");backgroundColor:red;border:1px solid gold;,10,10,1", STt: "ll"});
        }
        return ait.rsrcs.mwToggle_default;
    }
    if (ar.sg == "mwLeaf_default") {
        if (!ait.rsrcs.mwLeaf_default) {
            new Rs({sg: "bDD,mwLeaf_default,color:gray;,color:white;,color:black;backgroundColor:gold;,color:white;border:1px solid gold;,color:red;border:1px solid gold;,100,20,1", STt: "ll"});
        }
        return ait.rsrcs.mwLeaf_default;
    }
};
mwDfSt.prototype.de = function (ar) {
    var mw1 = ar.obj;
    mw1.rac();
    mw1.rse();
    mw1.aSt({sg: mw1.b5.p2[2]});
    if (mw1.sO) {
        for (var pr in mw1.sO) {
            mw1.sse({pr: pr, val: mw1.sO[pr]});
        }
    }
    this.currentNode = null;
    mw1.c5();
};
mwDfSt.prototype.decorateWidget = function (ar) {
    var widget = ar.widget;
    widget.label = new bw({txt: widget.nd.txt, klik: new exb({obj: widget.nd, mN: "nC"}), mw1: widget.mw1, b5: this.grs({sg: "mwLeaf_default"})});
    if (ar.nd.tree) {
        widget.front = new aw;
        widget.front.te.x = 25;
        var _miw = new miw({pts: ["shared/red_plus.png", "shared/red_min.png"], STt: "ll", w: 15, h: 15});
        var toggle = new bw({obj: _miw, klik: new exb({obj: widget, mN: "tG"}), b5: this.grs({sg: "mwToggle_default"}), STt: "ll"});
        _miw.off();
        widget.front.bc({obj: toggle});
        toggle.te.x = 5;
        widget.front.bc({obj: widget.label});
        widget.label.te.x = 25;
    } else {
        widget.bc({obj: widget.label});
    }
    widget.aal();
};
mwDfSt.prototype.findIdxByNode = function (ar) {
    var pt = ar.pt;
    var nd = ar.nd;
    var widget = null;
    for (var i = 0; i < pt.o2.length; i++) {
        widget = pt.o2[i];
        if (widget.nd && widget.nd == nd) {
            return i;
        }
    }
    return null;
};
mwDfSt.prototype.showAdoptNodeWidget = function (ar) {
    var pt = ar.pt;
    var widget = ar.widget;
    if (ar.idx != null &&
        ar.idx >= 0 && ar.idx < pt.nd.tree.length - 1) {
        var s_node = pt.nd.tree[ar.idx + 1];
        var s_idx = this.findIdxByNode({pt: pt, nd: s_node});
        var s_widget = pt.o2[s_idx];
        if (s_widget.front) {
            s_idx--;
        }
        pt.bc({obj: widget, idx: s_idx});
    } else {
        pt.bc({obj: widget});
    }
    widget.rd();
    if (widget.front) {
        var idx = pt.o2.indexOf(widget);
        pt.bc({obj: widget.front, idx: idx});
        widget.front.div.style.position = "relative";
    }
    if (pt == widget.mw1) {
        widget.te.x = 0;
    } else {
        widget.te.x = 25;
    }
};
mwDfSt.prototype.showOrphanNodeWidget = function (ar) {
    var pt = ar.pt;
    var nd = ar.nd;
    var idx = this.findIdxByNode({pt: pt, nd: nd});
    var widget = pt.ucd({idx: idx});
    pt.mw1.orphans.push(widget);
    if (widget.front) {
        pt.ucd({obj: widget.front});
    }
};
mwDfSt.prototype.showToggle = function (ar) {
    ar.widget.mw1.div.style.height = "";
    var s = ar.widget.mw1.o2[1].div.style;
    s.height = "";
    var toggle = ar.widget.front.o2[0].o2[0];
    if (toggle.idx == 1) {
        ar.widget.hide();
        toggle.on();
    } else {
        ar.widget.unhide();
        toggle.off();
    }
};
mwDfSt.prototype.showNodeClick = function (ar) {
    var widget = ar.widget;
    var mw1 = widget.mw1;
    var label = widget.front ? widget.front.o2[1] : widget.label;
    if (mw1.lastLabel) {
        mw1.lastLabel.showUnSelected();
    }
    label.showSelected();
    mw1.lastLabel = label;
};
var mwDf = new mwDfSt();
var mldSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( mldSt, mwDfSt);
mldSt.prototype.sm = {Cl:'mldSt',inr:0};
mldSt.prototype.sm.it = function (ar) {
    mwDfSt.prototype.sm.it.call(this, ar);
    
};
mldSt.prototype.grs = function (ar) {
    if (ar.sg == "mw_lespap") {
        if (!ait.rsrcs.mw_lespap) {
            new Rs({sg: "mld,mw_lespap,color:white;,color:white;border:1px solid white;,30,50", STt: "ll"});
        }
        return ait.rsrcs.mw_lespap;
    }
    if (ar.sg == "bw_lespap") {
        if (!ait.rsrcs.bw_lespap) {
            new Rs({sg: "bDD,bw_lespap,color:gray;fontFamily:Comic Sans ms;,color:white;fontFamily:Comic Sans ms;,color:red;fontFamily:Comic Sans ms;,color:white;fontFamily:Comic Sans ms;,color:white;fontFamily:Comic Sans ms;,100,14,1", STt: "ll"});
        }
        return ait.rsrcs.bw_lespap;
    }
};
mldSt.prototype.de = function (ar) {
    var mw1 = ar.obj;
    mw1.dx = parseInt(mw1.b5.p2[4]);
    mw1.dy = parseInt(mw1.b5.p2[5]);
    mw1.currentWidget = null;
    mwDfSt.prototype.de.call(this, ar);
    for (var i = 0; i < mw1.o2.length; i++) {
        var widget = mw1.o2[i];
        if (widget.nd) {
            widget.div.style.position = "absolute";
        }
        if (widget.nd.tree) {
            this.dnd({widget: widget});
        }
    }
    for (var i = 0; i < mw1.o2.length; i++) {
        var widget = mw1.o2[i];
        if (widget.nd) {
            widget.hide();
        }
    }
    mw1.div.style.background = "";
    var widget = mw1.o2[0];
    mw1.currentWidget = widget;
    mw1.currentWidget.unhide();
    this.shiftRight({obj: mw1});
};
mldSt.prototype.decorateWidget = function (ar) {
    var widget = ar.widget;
    if (ar.nd.tree) {
        this.decorateNodeWidget(ar);
    } else {
        this.dlfw(ar);
    }
    widget.aal();
};
mldSt.prototype.decorateNodeWidget = function (ar) {
    var widget = ar.widget;
    var nd = widget.nd;
    var p_n = nd.pt;
    var mw1 = widget.mw1;
    var exebitChildClick = new exb({obj: nd, mN: "nC"});
    var exebitCancelLeft = new exb({obj: this, mN: "cancelLeft", cas: {obj: mw1}});
    var exebitShiftLeft = new exb({obj: this, mN: "shiftLeft", cas: {obj: mw1}});
    var exebitShiftRight = new exb({obj: this, mN: "shiftRight", cas: {obj: mw1}});
    widget.label = new bw({txt: nd.txt, klik: exebitChildClick, hover: exebitCancelLeft, x: 5, b5: this.grs({sg: "bw_lespap"})});
    var b2 = new bw({txt: nd.txt, klik: new exb({obj: p_n.nC ? p_n : nd, mN: "nC"}), hover: exebitShiftRight, unhover: exebitShiftLeft, b5: this.grs({sg: "bw_lespap"})});
    widget.bc({obj: b2});
    var aw_child_nodes = new aw;
    aw_child_nodes._wrapped = true;
    aw_child_nodes.aSt({sg: ait.rsrcs.mw_lespap.p2[3]});
    var bw_mouse_lr = new bw({obj: aw_child_nodes, hover: exebitCancelLeft, unhover: exebitShiftLeft, y: mw1.dy, src: true});
    widget.bc({obj: bw_mouse_lr});
    bw_mouse_lr.de();
    bw_mouse_lr.div.childNodes[1].style.zIndex = -1;
};
mldSt.prototype.dlfw = function (ar) {
    var widget = ar.widget;
    var nd = widget.nd;
    var mw1 = widget.mw1;
    var exebitChildClick = new exb({obj: nd, mN: "nC"});
    var exebitCancelLeft = new exb({obj: this, mN: "cancelLeft", cas: {obj: mw1}});
    widget.label = new bw({txt: nd.txt, klik: exebitChildClick, hover: exebitCancelLeft, x: 5, b5: this.grs({sg: "bw_lespap"})});
};
mldSt.prototype.dnd = function (ar) {
    var widget = ar.widget;
    var butt1 = widget.o2[0];
    var bw_mouse_lr = widget.o2[1];
    var aw_child_nodes = bw_mouse_lr.o2[0];
    var deltaY = 1;
    var y_child = deltaY;
    for (var i = 0; aw_child_nodes.o2 && i < aw_child_nodes.o2.length; i++) {
        var cd = aw_child_nodes.o2[i];
        cd.te.y = y_child;
        y_child += cd.te.h + deltaY;
    }
    y_child -= deltaY;
};
mldSt.prototype.showAdoptNodeWidget = function (ar) {
    var pt = ar.pt;
    var widget = ar.widget;
    var nd = widget.nd;
    if (nd.tree) {
        pt.mw1.bc({obj: widget, idx: ar.idx});
    } else {
        pt.bc({obj: widget, idx: ar.idx});
    }
    widget.rd();
    if (pt != pt.mw1) {
        pt.o2[1].o2[0].bc({obj: widget.label});
    }
};
mldSt.prototype.showOrphanNodeWidget = function (ar) {
    var pt = ar.pt;
    var mw1 = pt.mw1;
    var nd = pt.nd.tree[ar.idx];
    var idx = this.findIdxByNode({pt: mw1, nd: nd});
    var widget = mw1.ucd({idx: idx});
    mw1.orphans.push(widget);
    if (pt != pt.mw1) {
        pt.o2[1].o2[0].ucd({obj: widget.label});
    }
};
mldSt.prototype.shiftRight = function (ar) {
    this.cancelLeft(ar);
    var mw1 = ar.obj;
    var bw_mouse_lr = mw1.currentWidget.o2[1];
    bw_mouse_lr.tf({x: mw1.dx, dt: 500});
};
mldSt.prototype.shiftLeft = function (ar) {
    var mw1 = ar.obj;
    if (!mw1.currentWidget) {
        return;
    }
    if (mw1.currentWidget.tree) {
        return;
    }
    var bw_mouse_lr = mw1.currentWidget.o2[1];
    if (bw_mouse_lr.ctime) {
        clearTimeout(bw_mouse_lr.ctime);
    }
    var dx = - bw_mouse_lr.te.w - mw1.dx;
    if (ar.now) {
        bw_mouse_lr.tf({x: dx, dt: 500});
        bw_mouse_lr.ctime = null;
    } else {
        bw_mouse_lr.ctime = setTimeout("DB['" + bw_mouse_lr.id + "'].tf({x:" + dx + ", dt:500});", 2000);
    }
};
mldSt.prototype.cancelLeft = function (ar) {
    var mw1 = ar.obj;
    var bw_mouse_lr = mw1.currentWidget.o2[1];
    if (bw_mouse_lr.ctime) {
        clearTimeout(bw_mouse_lr.ctime);
    }
};
mldSt.prototype.changeLevel = function (ar) {
    var widget = ar.widget;
    var mw1 = widget.mw1;
    if (mw1.currentWidget && widget == mw1.currentWidget) {
        return;
    }
    if (mw1.currentWidget) {
        this.shiftLeft({obj: mw1, now: true});
        setTimeout("mld.changeLevel2({widget:DB['" + widget.id + "']})", 600);
    } else {
        this.changeLevel2(ar);
    }
};
mldSt.prototype.changeLevel2 = function (ar) {
    var widget = ar.widget;
    var mw1 = widget.mw1;
    if (mw1.currentWidget) {
        mw1.currentWidget.hide();
    }
    mw1.currentWidget = widget;
    mw1.currentWidget.unhide();
    mw1.currentWidget.redrawTree();
    mw1.currentWidget.aal();
    this.shiftRight({obj: mw1});
};
mldSt.prototype.showNodeClick = function (ar) {
    if (ar.widget.tG) {
        this.changeLevel(ar);
    } else {
        this.shiftLeft({obj: ar.widget.mw1, now: true});
    }
    ar.widget.mw1.div.style.background = "";
};
var mld = new mldSt();
var dydSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
dydSt.prototype.sm = {Cl:'dydSt',inr:0};
dydSt.prototype.sm.it = function (ar) {
    
};
dydSt.prototype.de = function () {
    for (var i = 0; i < ait.stage.o2.length; i++) {
        var cd = ait.stage.o2[i];
        if (cd.st) {
            var h_a = cd.st.h_a;
            if (h_a.length) {
                for (var j = h_a.length - 1; j >= 0; j--) {
                    var cgd = false;
                    var obj = DB[h_a[j]];
                    if (!obj) {
                        h_a.splice(j, 1);
                        cd.sCd();
                    }
                }
            }
            this.doUnfocus({obj: cd});
        }
    }
    this.newState = null;
};
dydSt.prototype.checkInState = function (ar) {
    if (!ar.st) {
        return 0;
    }
    var obj = ar.obj;
    if (obj.st) {
        if (obj == ar.st) {
            return 1;
        } else {
            return 2;
        }
    }
    if (obj.pt == ait.stage) {
        return 0;
    }
    return this.checkInState({obj: obj.pt, st: ar.st});
};
dydSt.prototype.gst = function (ar) {
    if (typeof ar.obj == "string") {
        ar.obj.idb();
    }
    if (this.newState) {
        if (this.newState == ar.obj) {
            return;
        }
        this.doUnfocus({obj: this.newState});
    }
    this.newState = ar.obj;
    for (var i = 0; i < ait.stage.o2.length; i++) {
        var cd = ait.stage.o2[i];
        if (cd.st) {
            this.doUnfocus({obj: cd});
        } else {
            this.cst({obj: cd});
        }
    }
    this.doFocus({obj: this.newState});
    for (var i = 0; i < this.newState.o2.length; i++) {
        this.cst({obj: this.newState.o2[i]});
    }
    ait.stage.redrawTree();
    ait.stage.aal();
};
dydSt.prototype.isA = function (ar) {
    for (var i = 0; ar.arr && i < ar.arr.length; i++) {
        if (ar.arr[i] == ar.obj.id) {
            if (DB[ar.obj.id]) {
                return i + 1;
            } else {
                ar.arr.splice(i, 1);
                return null;
            }
        }
    }
    return null;
};
dydSt.prototype.cst = function (ar) {
    var obj = ar.obj;
    if (obj.sm.Cl == "ndw" ||
        obj.sm.Cl == "lfw") {
        return;
    } else if (obj.sm.Cl == "HoverButtonWidget") {
        obj.unhide();
    } else {
        var in_new_hide = this.isA({obj: obj, arr: this.newState.st.h_a});
        if (in_new_hide) {
            obj.hide();
        } else {
            obj.unhide();
        }
    }
    if (obj.div.style.display == "block") {
        for (var i = 0; obj.o2 && i < obj.o2.length; i++) {
            this.cst({obj: obj.o2[i]});
        }
    }
};
dydSt.prototype.doFocus = function (ar) {
    ar.obj.unhide();
    if (ait.oTree) {
        ait.oTree.xp(ar);
    }
};
dydSt.prototype.doUnfocus = function (ar) {
    ar.obj.hide();
    if (ait.oTree) {
        ait.oTree.collapse(ar);
    }
};
var dyd = new dydSt();
var dfdSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( dfdSt, dydSt);
dfdSt.prototype.sm = {Cl:'dfdSt',inr:0};
dfdSt.prototype.sm.it = function (ar) {
    dydSt.prototype.sm.it.call(this, ar);
    
};
dfdSt.prototype.doFocus = function (ar) {
    ar.obj.tf({o: 0.999, dt: 1});
    setTimeout("DB[\"" + ar.obj.id + "\"].tf({o:0.001, dt:500})", 50);
    setTimeout("DB[\"" + ar.obj.id + "\"].tf({o:0, dt:1})", 600);
};
dfdSt.prototype.doUnfocus = function (ar) {
    setTimeout("DB[\"" + ar.obj.id + "\"].tf({o:0.001, dt:1})", 650);
    setTimeout("DB[\"" + ar.obj.id + "\"].tf({o:1, dt:600})", 700);
};
var dfd = new dfdSt();
var dsdSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( dsdSt, dydSt);
dsdSt.prototype.sm = {Cl:'dsdSt',inr:0};
dsdSt.prototype.sm.it = function (ar) {
    dydSt.prototype.sm.it.call(this, ar);
    
};
dsdSt.prototype.de = function () {
    if (this.newState) {
        var h_a = this.newState.st ? this.newState.st.h_a : null;
        this.checkAllVisible({arr: h_a, obj: ait.stage});
        for (var i = 0; i < ait.stage.o2.length; i++) {
            var cd = ait.stage.o2[i];
            if (cd.st) {
                var tp = cd.acc;
                cd.tf({x: - (tp.x + tp.w + 10)});
            }
        }
        var tp = this.newState.acc;
        setTimeout("DB['" + this.newState.id + "'].tf({x:81, dt:800})", 800);
    }
};
dsdSt.prototype.checkAllVisible = function (ar) {
    if (!this.isA({obj: ar.obj, arr: ar.arr}) &&
        ar.obj.sm.Cl != "HoverButtonWidget") {
        ar.obj.div.style.display = "block";
    } else {
        ar.obj.div.style.display = "none";
    }
    if (ar.obj.o2 && ar.obj.sm.Cl != "mw") {
        for (var i = 0; i < ar.obj.o2.length; i++) {
            this.checkAllVisible({obj: ar.obj.o2[i], arr: ar.arr});
        }
    }
};
dsdSt.prototype.shiftLeft = function (ar) {
    var obj = ar.obj;
    var tp = obj.acc;
    obj.tf({x: -2500, dt: 800});
};
dsdSt.prototype.shiftRight = function (ar) {
    var obj = ar.obj;
    var tp = obj.acc;
    setTimeout("DB['" + obj.id + "'].tf({x:81, dt:800})", 800);
};
dsdSt.prototype.doFocus = function (ar) {
    this.shiftRight(ar);
};
dsdSt.prototype.doUnfocus = function (ar) {
    this.shiftLeft(ar);
};
var dsd = new dsdSt();
var ot = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( ot, aw);
ot.prototype.sm = {Cl:'ot',inr:0};
ot.prototype.sm.it = function (ar) {
    aw.prototype.sm.it.call(this, ar);
    
    if (!ait.rsrcs.bw_ot_text) {
        new Rs({sg: "bDD,bw_ot_text,        color:gray;backgroundColor:white;,color:blue;backgroundColor:white;    ,color:black;backgroundColor:gold;,color:black;backgroundColor:gold;border:1px solid black;,color:black;backgroundColor:gold;border:1px solid black;,100,20,1", STt: "ll"});
    }
    if (!ait.rsrcs.bw_ot_default) {
        new Rs({sg: "bDD,bw_ot_default,     color:gray;backgroundColor:white;,color:black;backgroundColor:white;   ,color:black;backgroundColor:gold;,color:black;backgroundColor:gold;border:1px solid black;,color:black;backgroundColor:gold;border:1px solid black;,100,18,1", STt: "ll"});
    }
    if (!ait.rsrcs.bwNode_otree_aw) {
        new Rs({sg: "bDD,bwNode_otree_aw,   color:gray;border:1px solid gray;,color:green;border:1px solid green;  ,color:black;backgroundColor:gold;,color:black;backgroundColor:gold;border:1px solid black;,color:black;backgroundColor:gold;border:1px solid black;,100,18,1", STt: "ll"});
    }
    if (!ait.rsrcs.bwNode_otree_mw) {
        new Rs({sg: "bDD,bwNode_otree_mw,   color:gray;border:1px solid gray;,color:black;border:1px solid black;  ,color:black;backgroundColor:gold;,color:black;backgroundColor:gold;border:1px solid black;,color:black;backgroundColor:gold;border:1px solid black;,100,18,1", STt: "ll"});
    }
    if (!ait.rsrcs.bwNode_otree_bw) {
        new Rs({sg: "bDD,bwNode_otree_bw,   color:gray;border:1px solid gray;,color:purple;border:1px solid purple;,color:black;backgroundColor:gold;,color:black;backgroundColor:gold;border:1px solid black;,color:black;backgroundColor:gold;border:1px solid black;,100,18,1", STt: "ll"});
    }
    if (!ait.rsrcs.bwNode_otree_state) {
        new Rs({sg: "bDD,bwNode_otree_state,color:gray;border:1px solid gray;,color:red;border:1px solid red;      ,color:black;backgroundColor:gold;,color:black;backgroundColor:gold;border:1px solid black;,color:black;backgroundColor:gold;border:1px solid black;,100,18,1", STt: "ll"});
    }
};
ot.prototype.c5 = function () {
    this.createWidget({obj: Site.aw});
    this.bindChildWidgets({obj: Site.aw, pt: this});
    this.aSt({sg: "fontFamily:Arial;backgroundColor:white;border:3px groove black"});
    this.te.w = this.o2[0].te.w;
    this.te.h = this.o2[0].te.h;
    this.di();
    this.aal();
};
ot.prototype.rd = function () {
    sw.prototype.rd.call(this);
    this.div.style.height = "";
};
ot.prototype.redrawTree = function () {
    aw.prototype.redrawTree.call(this);
    this.setWidgetRelative({obj: Site.aw});
};
ot.prototype.setWidgetRelative = function (ar) {
    var obj = ar.obj;
    if (!obj.intree) {
        return;
    }
    var childslist = obj.otree_node.childslist;
    if (childslist) {
        childslist.div.style.top = "";
        childslist.div.style.height = "";
    }
    for (var i = 0; obj.o2 && i < obj.o2.length; i++) {
        this.setWidgetRelative({obj: obj.o2[i]});
    }
};
ot.prototype.di = function () {
    this.adaptStyle({obj: Site.aw});
    var _w = Site.aw.otree_node.te.w;
    if (_w < Site.aw.otree_node.childslist.te.w) {
        _w = Site.aw.otree_node.childslist.te.w;
    }
    this.te.w = _w;
    this.rd();
};
ot.prototype.adaptStyle = function (ar) {
    var obj = ar.obj;
    var widget = obj.otree_node;
    var childslist = widget.childslist;
    if (obj.o2) {
        s = childslist.div.style.height = "";
        var _w = 20;
        for (var i = 0; i < obj.o2.length; i++) {
            var cd = obj.o2[i];
            if (cd.intree) {
                this.adaptStyle({obj: cd});
                if (_w < cd.otree_node.te.w) {
                    _w = cd.otree_node.te.w;
                }
                if (cd.otree_node.childslist &&
                    _w < cd.otree_node.childslist.te.w) {
                    _w = cd.otree_node.childslist.te.w;
                }
            }
        }
        widget.childslist.te.w = _w;
        widget.childslist.te.h = widget.childslist.div.offsetHeight;
        widget.childslist.rd();
        childslist.div.style.height = "";
        widget.te.w = 21 + widget.childslist.te.w;
        widget.rd();
        if (obj != Site.aw && obj != ait.stage) {
            childslist.hide();
            widget.o2[2].o2[0].off();
        }
    }
};
ot.prototype.smi = function (ar) {
    cb.ctrl = null;
    vt.selection.empty();
    var ued = ar.obj.otree_node.o2[0].dn[0];
    cb.nuc({obj: ued});
};
ot.prototype.createWidget = function (ar) {
    var obj = ar.obj;
    obj.intree = true;
    var tpe = obj.sm.Cl;
    var icon = "shared/imw_child.png";
    var b5 = "bw_ot_default";
    obj.otree_node = new aw({STt: "ll"});
    var widget = obj.otree_node;
    widget.aSt({sg: "position:relative"});
    if (obj.o2) {
        widget.childslist = new aw({x: 20});
        widget.childslist.aSt({sg: "position:relative"});
    }
    if (tpe == "tw") {
        b5 = "bw_ot_text";
        icon = "shared/tw_child.png";
    } else if (tpe == "iW") {
        icon = "shared/imw_child.png";
    } else if (tpe == "auw") {
        icon = "shared/mdw_child.png";
    } else if (tpe == "mw") {
        this.lastMenu = obj;
        b5 = "bwNode_otree_mw";
    } else if (tpe == "aw") {
        if (obj.st) {
            b5 = "bwNode_otree_state";
        } else {
            b5 = "bwNode_otree_aw";
        }
    } else if (tpe == "bw") {
        b5 = "bwNode_otree_bw";
    } else if (tpe == "HoverButtonWidget") {
        b5 = "bwNode_otree_bw";
    }
    b5 = ait.rsrcs[b5];
    var label = new bw({t1: obj.iid, klik: new exb({obj: this, mN: "nC", cas: {obj: obj}}), b5: b5});
    if (obj == Site.aw) {
        label.te.x = 0;
    } else {
        label.te.x = 35;
    }
    widget.te.w = 35 + label.te.w + 1;
    widget.te.h = 20;
    widget.bc({obj: label});
    if (obj == Site.aw) {
        label.te.x = 0;
    } else {
        var _miw = new miw({pts: ["shared/eye-1.jpg", "shared/eye-0.jpg"], w: 20, h: 10});
        obj.al({enm: "hide", Lobj: _miw, mN: "off"});
        obj.al({enm: "unhide", Lobj: _miw, mN: "on"});
        var eye = new bw({obj: _miw, klik: new exb({obj: this, mN: "tgv", cas: {obj: obj}}), x: 0});
        if (obj.isHidden()) {
            _miw.off();
        }
        eye.te.x = -25;
        widget.bc({obj: eye});
        if (obj == ait.stage) {
            eye.hide();
        }
        if (!obj.o2) {
            _miw = new iW({path: icon, w: 31, h: 16});
            var dot = new bw({obj: _miw, klik: new exb({obj: this, mN: "nC", cas: {obj: obj}})});
            widget.bc({obj: dot});
        } else {
            _miw = new miw({pts: ["shared/aw_open.png", "shared/aw_closed.png"], w: 31, h: 16});
            var toggle = new bw({obj: _miw, klik: new exb({obj: this, mN: "tG", cas: {obj: obj}})});
            _miw.off();
            widget.bc({obj: toggle});
        }
    }
    for (var i = 0; obj.o2 && i < obj.o2.length; i++) {
        this.createWidget({obj: obj.o2[i]});
    }
    this.addaptTitleWidget({obj: obj});
};
ot.prototype.addaptTitleWidget = function (ar) {
    var obj = ar.obj;
    var tpe = obj.sm.Cl;
    var t1 = obj.iid;
    if (obj.name) {
        t1 = obj.name;
    }
    if (tpe == "tw") {
        t1 = obj.d2[0].txt;
    } else if (tpe == "iW") {
        t1 = obj.path;
    } else if (tpe == "mw") {
        t1 = t1.replace(/mw/, "Menu");
    } else if (tpe == "aw") {
        if (obj == Site.aw) {
            t1 = "Site Background";
        } else {
            t1 = t1.replace(/aw/, "AW");
        }
        if (obj.st && obj.st.nd) {
            t1 = obj.st.nd.txt.txt;
        }
    } else if (tpe == "bw" && obj.o2[0] && obj.o2[0].otree_node) {
        t1 = "B_" + obj.o2[0].otree_node.o2[0].o2[0].d2[0].txt;
    } else if (tpe == "HoverButtonWidget" && obj.bw_top && obj.bw_top.otree_node) {
        t1 = "H" + obj.bw_top.otree_node.o2[0].o2[0].d2[0].txt;
    }
    if (!t1) {
        t1 = "---";
    }
    t1 = t1.replace(/\n/g, " ").replace(/^\s*/, "");
    if (t1.length > 25) {
        t1 = t1.substring(0, 23) + "...";
    }
    obj.otree_node.o2[0].o2[0].d2[0].sT({sg: t1});
};
ot.prototype.bindChildWidgets = function (ar) {
    var obj = ar.obj;
    if (!obj.intree) {
        return;
    }
    var widget = obj.otree_node;
    ar.pt.bc({obj: widget});
    if (widget.childslist) {
        ar.pt.bc({obj: widget.childslist});
        for (var i = 0; obj.o2 && i < obj.o2.length; i++) {
            this.bindChildWidgets({obj: obj.o2[i], pt: widget.childslist});
        }
    }
};
ot.prototype.nC = function (ar) {
    if (!cb.ctrl) {
        vt.selection.empty();
    }
    vt.selection.itemClick({obj: ar.obj});
    vt.selection.rd();
    ctr.selectMenuItems();
    cb.ctrl = null;
};
ot.prototype.tG = function (ar) {
    var widget = ar.obj.otree_node;
    var toggle = widget.o2[2];
    if (widget.childslist.isHidden()) {
        widget.childslist.unhide();
        toggle.o2[0].on();
    } else {
        widget.childslist.hide();
        toggle.o2[0].off();
    }
};
ot.prototype.collapse = function (ar) {
    if (!ar.obj.otree_node.childslist.isHidden()) {
        this.tG(ar);
    }
};
ot.prototype.xp = function (ar) {
    if (ar.obj.otree_node.childslist.isHidden()) {
        this.tG(ar);
    }
};
ot.prototype.tgv = function (ar) {
    var obj = ar.obj;
    var inState = Site.dynamics.checkInState({obj: obj, st: Site.dynamics.newState});
    var h_a = Site.dynamics.newState ? Site.dynamics.newState.st.h_a : [];
    var inHideArr = Site.dynamics.isA({obj: obj, arr: h_a});
    if (inState == 0 || inState == 1) {
        if (inHideArr) {
            h_a.splice(inHideArr - 1, 1);
            if (obj.te.o == 0) {
                obj.te.o = 1;
            }
            obj.unhide();
            obj.redrawTree();
        } else {
            h_a.push(obj.id);
            obj.hide();
        }
        if (Site.dynamics.newState) {
            Site.dynamics.newState.sCd();
        }
    } else {
        if (obj.isHidden()) {
            if (obj.te.o == 0) {
                obj.te.o = 1;
            }
            obj.unhide();
            obj.redrawTree();
        } else {
            obj.hide();
        }
    }
};
var BorderDecoration = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( BorderDecoration, ob);
BorderDecoration.prototype.sm = {Cl:'BorderDecoration',inr:0};
BorderDecoration.prototype.sm.it = function (ar) {
    ob.prototype.sm.it.call(this, ar);
    
    this.type = ar.sg;
    var vec = gp({sg: this.type, lm: ","});
    this.name = vec[0];
    this.N_h = vec[1];
    this.S_h = vec[2];
    this.W_w = vec[3];
    this.E_w = vec[4];
    this.createImg({sg: "NW"});
    this.createImg({sg: "N"});
    this.createImg({sg: "NE"});
    this.createImg({sg: "W"});
    this.createImg({sg: "E"});
    this.createImg({sg: "SW"});
    this.createImg({sg: "S"});
    this.createImg({sg: "SE"});
};
BorderDecoration.prototype.rd = function (ar) {
    var at = this.dr.acc;
    var N_h = this.N_h * at.s + 0.5 | 0;
    var S_h = this.S_h * at.s + 0.5 | 0;
    var W_w = this.W_w * at.s + 0.5 | 0;
    var E_w = this.E_w * at.s + 0.5 | 0;
    var x0 = - W_w;
    var y0 = - N_h;
    var s = this.NW.style;
    s.left = x0 + "px";
    s.top = y0 + "px";
    s.width = W_w + "px";
    s.height = N_h + "px";
    var s = this.N.style;
    s.left = "0px";
    s.top = y0 + "px";
    s.width = at.w + "px";
    s.height = N_h + "px";
    var x1 = at.w;
    s = this.NE.style;
    s.left = x1 + "px";
    s.top = y0 + "px";
    s.width = E_w + "px";
    s.height = N_h + "px";
    s = this.W.style;
    s.left = x0 + "px";
    s.top = "0px";
    s.width = W_w + "px";
    s.height = at.h + "px";
    s = this.E.style;
    s.left = x1 + "px";
    s.top = "0px";
    s.width = E_w + "px";
    s.height = at.h + "px";
    var y1 = at.h;
    s = this.SW.style;
    s.left = x0 + "px";
    s.top = y1 + "px";
    s.width = W_w + "px";
    s.height = S_h + "px";
    s = this.S.style;
    s.left = "0px";
    s.top = y1 + "px";
    s.width = at.w + "px";
    s.height = S_h + "px";
    s = this.SE.style;
    s.left = x1 + "px";
    s.top = y1 + "px";
    s.width = E_w + "px";
    s.height = S_h + "px";
};
BorderDecoration.prototype.setRoot = function (ar) {
    this.dr = ar.obj;
    this.dr.div.appendChild(this.NW);
    this.NW.obj = this.dr;
    this.dr.div.appendChild(this.N);
    this.N.obj = this.dr;
    this.dr.div.appendChild(this.NE);
    this.NE.obj = this.dr;
    this.dr.div.appendChild(this.W);
    this.W.obj = this.dr;
    this.dr.div.appendChild(this.E);
    this.E.obj = this.dr;
    this.dr.div.appendChild(this.SW);
    this.SW.obj = this.dr;
    this.dr.div.appendChild(this.S);
    this.S.obj = this.dr;
    this.dr.div.appendChild(this.SE);
    this.SE.obj = this.dr;
    this.rd();
};
BorderDecoration.prototype.createImg = function (ar) {
    this[ar.sg] = dce("img");
    var path = "shared/border/" + this.name + "_" + ar.sg + ".png";
    if (/MSIE (5\.5|6\.)/.test(navigator.userAgent)) {
        this[ar.sg].style.width = "50px";
        this[ar.sg].style.height = "50px";
        this[ar.sg].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + path + "', sizingMethod='scale')";
        this[ar.sg].src = "shared/x.gif";
    } else {
        this[ar.sg].setAttribute("src", path);
    }
    var s = this[ar.sg].style;
    s.position = "absolute";
    s.cursor = "pointer";
    addEvent(this[ar.sg], "mousedown", mv.me, false);
};
BorderDecoration.prototype.removeImg = function (ar) {
    this.dr.div.removeChild(this[ar.sg]);
    this[ar.sg] = null;
};
BorderDecoration.prototype.rv = function (ar) {
    this.removeImg({sg: "NW"});
    this.removeImg({sg: "N"});
    this.removeImg({sg: "NE"});
    this.removeImg({sg: "W"});
    this.removeImg({sg: "E"});
    this.removeImg({sg: "SW"});
    this.removeImg({sg: "S"});
    this.removeImg({sg: "SE"});
};
var vtSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
ih ( vtSt, Do);
vtSt.prototype.sm = {Cl:'vtSt',inr:0};
vtSt.prototype.sm.fd = ['lgn','pswd','isE','ip','pid','nn'];
vtSt.prototype.sm.it = function (ar) {
    Do.prototype.sm.it.call(this, ar);
    
    this.STt = "ok";
    this.id = 1;
    this.lgn = "";
    this.pswd = "";
};
vtSt.prototype.breakdownTW = function () {
    var obj = vt.selection.o2[0];
    var idx = obj.d2[0].txt.lastIndexOf("\n\n");
    if (idx != -1) {
        var new_obj = this.duplicateObj({obj: obj});
        obj.sT({sg: obj.d2[0].txt.substring(idx + 1)});
        obj.set_box();
        obj.rd();
        if (obj.d2[0].txt.replace(/\n/g, "").replace(/\s*/g, "") == "") {
            this.del();
        }
        ait.oTree.smi({obj: new_obj});
        new_obj.sT({sg: new_obj.d2[0].txt.substring(0, idx + 1)});
        new_obj.set_box();
        new_obj.rd();
        this.breakdownTW();
    }
};
vtSt.prototype.copy = function () {
    this.selection.dragObjs = [];
    for (var i = 0; i < this.selection.o2.length; i++) {
        var oldobj = this.selection.o2[i];
        var new_obj = this.duplicateObj({obj: oldobj});
        if (oldobj.st) {
            this.toState({obj: new_obj, pt: oldobj.st.nd.pt, isLeaf: !oldobj.st.nd.tree});
        } else {
            if (new_obj.nd) {
                var nd = obj.nd;
                nd.pt.unbindChildNode({nd: nd});
            } else {
                if (new_obj.sm.Cl == "iw" &&
                    new_obj.label) {
                    this.selection.dragObjs.push(new_obj.label);
                    new_obj.label.pt.ucd({obj: new_obj.label});
                    ait.stage.bc({obj: new_obj.label});
                } else if (new_obj.sm.Cl == "HoverButtonWidget" &&
                    new_obj.bw_top) {
                    this.selection.dragObjs.push(new_obj.bw_top);
                    new_obj.bw_top.pt.ucd({obj: new_obj.bw_top});
                    ait.stage.bc({obj: new_obj.bw_top});
                }
                this.selection.dragObjs.push(new_obj);
                new_obj.pt.ucd({obj: new_obj});
                ait.stage.bc({obj: new_obj});
            }
        }
    }
    Site.aw.redrawTree();
    Site.aw.aal();
};
vtSt.prototype.duplicate = function () {
    for (var i = 0; i < this.selection.o2.length; i++) {
        var oldobj = this.selection.o2[i];
        var new_obj = this.duplicateObj({obj: oldobj});
        new_obj.redrawTree();
        if (oldobj.st) {
            this.toState({obj: new_obj, pt: oldobj.st.nd.pt, isLeaf: !oldobj.st.nd.tree});
        }
    }
    Site.aw.aal();
    ait.oTree.smi({obj: new_obj});
};
vtSt.prototype.duplicateObj = function (ar) {
    var i;
    var obj = ar.obj;
    var tpe = obj.sm.Cl;
    var new_obj;
    if (obj.hbw) {
        obj = obj.hbw;
    }
    var pt = ar.pt ? ar.pt : obj.pt;
    if (tpe == "HoverButtonWidget") {
        obj.bw_top.hbw = null;
        var bw_top = this.duplicateObj({obj: obj.bw_top});
        obj.bw_top.hbw = obj;
        new_obj = new HoverButtonWidget({obj: bw_top});
    } else {
        new_obj = eval("new " + tpe + "()");
    }
    if (obj.intree) {
        ait.oTree.createWidget({obj: new_obj});
    }
    var parnt_idx = pt.o2.indexOf(obj);
    pt.bc({obj: new_obj, idx: parnt_idx});
    new_obj.otree_node.redrawTree();
    if (tpe == "HoverButtonWidget") {
        this.downLayer({obj: new_obj});
    }
    if (obj.pts) {
        new_obj.pts = [];
        for (var i = 0; i < obj.pts.length; i++) {
            var path = obj.pts[i];
            new_obj.pts.push(path);
        }
    }
    if (obj.sP) {
        new_obj.sP({path: obj.path});
    } else if (obj.changedTxt) {
        new_obj.md = obj.md;
        new_obj.sg = obj.sg;
    }
    if (tpe == "bw" || tpe == "iw") {
        new_obj.klik = obj.klik;
        new_obj.hover = obj.hover;
        new_obj.unhover = obj.unhover;
    }
    if (tpe == "iw" && obj.label) {
        var label = this.duplicateObj({obj: obj.label});
        new_obj.label = label;
        this.downLayer({obj: new_obj});
        new_obj.ol = obj.ol;
        new_obj.iP = obj.iP;
        new_obj.requird = obj.requird;
        new_obj.check = obj.check;
    }
    if (obj.te) {
        var ot = obj.te;
        var nt = new_obj.te;
        nt.x = ot.x;
        nt.y = ot.y;
        nt.w = ot.w;
        nt.h = ot.h;
        nt.s = ot.s;
        nt.o = ot.o;
        var ot = obj.acc;
        var nt = new_obj.acc;
        nt.x = ot.x;
        nt.y = ot.y;
        nt.w = ot.w;
        nt.h = ot.h;
        nt.s = ot.s;
        nt.o = ot.o;
    }
    if (obj.html) {
        new_obj.html = obj.html;
    }
    if (obj.sO) {
        new_obj.sO = {};
        for (var pr in obj.sO) {
            new_obj.sO[pr] = obj.sO[pr];
        }
    }
    if (obj.b5) {
        new_obj.b5 = obj.b5;
    }
    if (obj.dn) {
        for (i = 0; obj.dn && i < obj.dn.length; i++) {
            var dec = obj.dn[i];
            if (!dec.STt) {
                var type = dec.type ? dec.type : "";
                eval("var new_dec = new " + dec.sm.Cl + "({sg:'" + type + "'})");
                new_obj.ad({obj: new_dec});
            }
        }
    }
    if (obj.d2) {
        for (i = 0; i < obj.d2.length; i++) {
            var old_dobj = obj.d2[i];
            var new_dobj = new_obj.d2[i];
            for (var j = 0; j < old_dobj.sm.fd.length; j++) {
                var fn = old_dobj.sm.fd[j];
                new_dobj[fn] = old_dobj[fn];
            }
            if (new_dobj.sm.Cl == "Txt") {
                new_dobj.nE({enm: "sT", sg: old_dobj.txt});
            }
        }
    }
    if (obj.o2) {
        for (var i = 0; i < obj.o2.length; i++) {
            if (!obj.o2[i].hbw) {
                this.duplicateObj({obj: obj.o2[i], pt: new_obj});
            }
        }
    }
    ait.oTree.addaptTitleWidget({obj: new_obj});
    return new_obj;
};
vtSt.prototype.scroll = function () {
    if (vt.selection) {
        vt.selection.rd();
    }
    if (er.caretdiv) {
        er.caretdiv.style.left = "" + (parseInt(er.caretdiv.style.left) + er.co.acc.x) + "px";
        er.caretdiv.style.top = "" + (parseInt(er.caretdiv.style.top) + er.co.acc.y) + "px";
    }
};
vtSt.prototype.updateInfo = function () {
    var dec = this.selection.o2[0].dn;
    if (dec) {
        dec[dec.length - 1].rd();
    }
};
vtSt.prototype.drag = function () {
    this.selection.dragObjs = [];
    for (var i = 0; i < this.selection.o2.length; i++) {
        var obj = this.selection.o2[i];
        this.selection.dragObjs.push(obj);
        if (obj.nd) {
            var nd = obj.nd;
            nd.pt.unbindChildNode({nd: nd});
        } else {
            if (obj.st) {
                this.delState({obj: obj});
            }
            obj.pt.ucd({obj: obj});
            ait.stage.bc({obj: obj});
        }
    }
};
vtSt.prototype.drop = function () {
    if (!this.selection.dragObjs) {
        return;
    }
    var pt = this.selection.o2[0];
    while (this.selection.dragObjs.length) {
        var obj = this.selection.dragObjs.shift();
        if (obj.nd) {
            if (!pt.nd) {
                continue;
            }
            pt.nd.bindChildNode({nd: obj.nd});
        } else {
            var i = obj.pt.o2.indexOf(obj);
            obj.pt.ucd({idx: i});
            pt.bc({obj: obj});
        }
    }
    this.selection.dragObjs = null;
};
vtSt.prototype.ask = function (ar) {
    this.pm = ar.pm;
    this.names = ar.names;
    this.sform = new Fw({h: 20, style: {value: "border:solid 1px black;backgroundColor:#228B22;"}, STt: "ll", intree: false});
    Site.aw.bc({obj: this.sform});
    this.sform.s_meth = "vt.sendAsk()";
    for (var i = 0; i < this.names.length; i++) {
        var varname = "h" + this.names[i].replace(/\s/g, "_");
        this[varname] = ar.strngs ? ar.strngs[i] : "";
        this.sform.addInput({sg: this.names[i], data: "vt." + varname, ol: true, requird: true});
    }
    this.sform.addSendButton({sg: "verzenden"});
    this.sform.addKillButton();
    cb.cW({obj: this.sform});
    this.sform.sdg();
    this.sform.redrawTree();
    this.sform.aal();
    this.sform.clickOn({idx: 1});
    Site.ssb({sg: "Voer de gegevens in", targ: this.sform});
};
vtSt.prototype.sendAsk = function () {
    var i;
    var varname;
    this.sform.rv();
    this.sform = null;
    for (i = 0; i < this.names.length; i++) {
        varname = "h" + this.names[i].replace(/\s/g, "_");
        if (!this[varname]) {
            return;
        }
    }
    this.pm();
    for (i = 0; i < this.names.length; i++) {
        varname = "h" + this.names[i].replace(/\s/g, "_");
        this[varname] = null;
    }
    this.pm = null;
    this.names = null;
};
vtSt.prototype.nameObj = function () {
    this.ask({pm: this.postName, names: ["object name"]});
};
vtSt.prototype.postName = function () {
    if (ait[this.hobject_name]) {
        alert("Er is al een object met die naam.");
        return;
    }
    var obj = this.selection.o2[0];
    if (obj.setName) {
        obj.setName({sg: this.hobject_name});
    }
};
vtSt.prototype.unm = function () {
    var obj = this.selection.o2[0];
    if (obj.unm) {
        obj.unm();
    }
};
vtSt.prototype.n0 = function (ar) {
    var pt = this.selection.o2[0];
    var new_obj;
    var sg = "new_obj = new " + ar.cls + "({";
    for (var pr in ar) {
        if (pr != "cls") {
            sg += pr + (":\"" + ar[pr] + "\", ");
        }
    }
    sg += "pt:null})";
    eval(sg);
    ait.oTree.createWidget({obj: new_obj});
    if (new_obj.sP) {
        new_obj.sP({path: ar.path});
    }
    pt.bc({obj: new_obj});
    ait.oTree.addaptTitleWidget({obj: pt});
    new_obj.redrawTree();
    ait.oTree.aal();
    ait.oTree.smi({obj: new_obj});
    return new_obj;
};
vtSt.prototype.newImage = function () {
    this.ask({pm: this.postNewImage, names: ["image path"]});
};
vtSt.prototype.postNewImage = function () {
    this.n0({cls: "iW", path: this.himage_path, w: 100, h: 100});
};
vtSt.prototype.newGoogleMap = function () {
    this.ask({pm: this.postnewGoogleMap, names: ["url map"]});
};
vtSt.prototype.postnewGoogleMap = function () {
    this.n0({cls: "GoogleMapWidget", sg: this.url_map, w: 100, h: 100});
};
vtSt.prototype.newAudio = function () {
    this.ask({pm: this.setAudio, names: ["audio path"]});
};
vtSt.prototype.setAudio = function () {
    this.n0({cls: "auw", path: this.haudio_path, w: 160, h: 90});
};
vtSt.prototype.newVideo = function () {
    this.ask({pm: this.setVideo, names: ["video path"]});
};
vtSt.prototype.setVideo = function () {
    this.n0({cls: "vuw", path: this.hvideo_path, w: 160, h: 90});
};
vtSt.prototype.newForm = function () {
    var sform = this.n0({cls: "fw", w: 270, h: 90});
    this.newInput();
};
vtSt.prototype.newInput = function () {
    this.ask({pm: this.addInput, names: ["label input"]});
};
vtSt.prototype.addInput = function (ar) {
    if (!ar) {
        ar = {};
    }
    var sform = ar.obj ? ar.obj : this.selection.o2[0];
    if (!ar.sg) {
        ar.sg = this.hlabel_input;
    }
    var inp = sform.addInput(ar);
    sform.aal();
    Site.aw.redrawTree();
    return inp;
};
vtSt.prototype.addSendButton = function (ar) {
    if (!ar) {
        ar = {};
    }
    var sform = ar.obj ? ar.obj : this.selection.o2[0];
    var b2 = sform.addSendButton(ar);
    sform.aal();
    Site.aw.redrawTree();
    return b2;
};
vtSt.prototype.addKillButton = function (ar) {
    if (!ar) {
        ar = {};
    }
    var sform = ar.obj ? ar.obj : this.selection.o2[0];
    var b2 = sform.addKillButton(ar);
    sform.aal();
    Site.aw.redrawTree();
    return b2;
};
vtSt.prototype.changeFont = function (ar) {
    var obj = this.selection.o2[0];
    if (obj.swap_idx1 || obj.swap_idx1 == 0) {
        obj.setSelection({sg: "fontFamily" + ":" + ar.val + ";"});
    } else {
        obj.ase({pr: "fontFamily", val: ar.val});
    }
    this.updateInfo();
};
vtSt.prototype.toStateL = function () {
    this.toState({isLeaf: true});
};
vtSt.prototype.toStateN = function () {
    this.toState({isLeaf: false});
};
vtSt.prototype.toState = function (ar) {
    var aw = null;
    if (ar.obj) {
        aw = ar.obj;
    } else {
        aw = this.selection.o2[0];
    }
    if (!aw.st) {
        var p_n = ar.pt ? ar.pt : ait.sMenu;
        p_n.bindChildNode({nd: child_node});
        States.addNewState({obj: aw, isLeaf: ar.isLeaf});
        var labelBW = aw.otree_node.o2[0];
        labelBW.bobj.replaceTxt({obj: aw.st.nd.txt});
        labelBW.b5 = ait.rsrcs.bwNode_otree_state;
        aw.sCd();
        aw.otree_node.aal();
        ait.sMenu.aal();
    }
    Site.dynamics.gst({obj: aw});
};
vtSt.prototype.delState = function (ar) {
    var aw = ar && ar.obj ? ar.obj : this.selection.o2[0];
    var labelBW = aw.otree_node.o2[0];
    labelBW.bobj.replaceTxt({obj: new Txt({txt: aw.iid.replace(/aw/, "AW")})});
    labelBW.b5 = ait.rsrcs.bwNode_otree_aw;
    States.delState({obj: aw.st});
    aw.sCd();
    if (!ar) {
        Site.dynamics.gfst();
    }
};
vtSt.prototype.newMenu = function () {
    this.ask({pm: this.setMenu, names: ["Menu tittle"]});
};
vtSt.prototype.setMenu = function () {
    var pt = this.selection.o2[0];
    var mnu = new Menu({sr: "N,,menu,;"});
    var mw1 = new mw({menu: mnu});
    pt.bc({obj: mw1});
    ait.oTree.smi({obj: mw1});
};
vtSt.prototype.newNode = function (ar) {
    var nd = ar.nd;
    var child_node = nd.addNode({pt: nd, arr: [nd.gen + 1, ar.sg, ar.mt], isLeaf: ar.isLeaf});
    child_node.aw_st = this.selection.o2[0];
};
vtSt.prototype.newSubmenu = function () {
    this.ask({pm: this.setSubmenu, names: ["submenu label"]});
};
vtSt.prototype.setSubmenu = function () {
    this.newNode({nd: this.selection.o2[0].nd, sg: this.hsubmenu_label, mt: "Site.dynamics.changeTo({obj:DB[\"" + Site.lastState_aw.id + "\"})"});
};
vtSt.prototype.newMenuItem = function () {
    this.ask({pm: this.setMenuItem, names: ["menu_item label"]});
};
vtSt.prototype.setMenuItem = function () {
    this.newNode({nd: this.selection.o2[0].nd, sg: this.hmenu_item_label, mt: "Site.dynamics.changeTo({obj:DB[\"" + Site.lastState_aw.id + "\"})", isLeaf: true});
};
vtSt.prototype.editText = function () {
    var obj = this.selection.o2[0];
    if (obj.sP) {
        this.ask({pm: this.setImagePath, names: ["image path"], strngs: [obj.path]});
    } else if (obj.et) {
        obj.et();
    } else if (obj.nd) {
        this.ask({pm: this.setNodeTitle, names: ["menu item text"], strngs: [obj.nd.txt.txt]});
    }
};
vtSt.prototype.setImagePath = function () {
    var obj = this.selection.o2[0];
    obj.sP({path: this.himage_path});
    obj.rd();
    obj.sCd();
};
vtSt.prototype.setNodeTitle = function () {
    this.selection.o2[0].nd.txt.sT({sg: this.hmenu_item_text});
    ait.sMenu.sCd();
};
vtSt.prototype.loadText = function () {
    alert("ld txt not implemented yet.");
};
vtSt.prototype.toIndexChild = function (ar) {
    var obj = this.selection.o2[0];
    ait.oTree.smi({obj: obj.pt});
    if (obj.nd) {
        var p_n = obj.nd.pt;
        p_n.toIndexChild(ar);
        var mw1 = p_n.mu.ls.cnn[0][0];
    } else {
        obj.pt.toIndexChild(ar);
        obj.rd();
    }
    ait.oTree.smi({obj: obj});
};
vtSt.prototype.toFront = function () {
    var obj = this.selection.o2[0];
    var idx1;
    var idx2;
    if (obj.nd) {
        var p_n = obj.nd.pt;
        idx1 = p_n.o2.indexOf(obj.nd);
        idx2 = p_n.tree.length - 1;
    } else {
        var pt = obj.pt;
        idx1 = pt.o2.indexOf(obj);
        idx2 = pt.o2.length - 1;
    }
    this.toIndexChild({idx1: idx1, idx2: idx2});
};
vtSt.prototype.toBack = function () {
    var obj = this.selection.o2[0];
    var idx;
    if (obj.nd) {
        var p_n = obj.nd.pt;
        idx = p_n.o2.indexOf(obj.nd);
    } else {
        idx = obj.pt.o2.indexOf(obj);
    }
    this.toIndexChild({idx1: idx, idx2: 0});
};
vtSt.prototype.upLayer = function (ar) {
    var obj = ar && ar.obj ? ar.obj : this.selection.o2[0];
    var idx;
    if (obj.nd) {
        var p_n = obj.nd.pt;
        idx = p_n.o2.indexOf(obj.nd);
    } else {
        idx = obj.pt.o2.indexOf(obj);
    }
    this.toIndexChild({idx1: idx, idx2: idx + 1});
};
vtSt.prototype.downLayer = function (ar) {
    var obj = ar && ar.obj ? ar.obj : this.selection.o2[0];
    var idx;
    if (obj.nd) {
        var p_n = obj.nd.pt;
        idx = p_n.o2.indexOf(obj.nd);
    } else {
        idx = obj.pt.o2.indexOf(obj);
    }
    this.toIndexChild({idx1: idx, idx2: idx - 1});
};
vtSt.prototype.decorWIN = function (ar) {
};
vtSt.prototype.toButton = function (ar) {
    var b2 = null;
    var bobj = this.selection.o2[0];
    if (bobj.sm.Cl == "bw") {
        b2 = this.selection.o2[0];
    } else {
        var pt = bobj.pt;
        ait.oTree.smi({obj: pt});
        var ot = bobj.te;
        var bt = {};
        bt.x = ot.x;
        bt.y = ot.y;
        bt.w = ot.w;
        bt.h = ot.h;
        bt.s = ot.s;
        bt.o = ot.o;
        ot.x = 0;
        ot.y = 0;
        ot.s = 1;
        var idx = pt.o2.indexOf(bobj);
        pt.ucd({idx: idx});
        if (ar && ar.type) {
            b2 = eval("new " + ar.type + "({obj:bobj})");
        } else {
            b2 = new bw({obj: bobj});
        }
        b2.te = bt;
        ait.oTree.createWidget({obj: b2});
        pt.bc({obj: b2, idx: idx});
        b2.redrawTree();
        ait.oTree.aal();
        ait.oTree.smi({obj: b2});
    }
    if (ar && ar.mt) {
        b2.klik = ar.mt;
    }
    b2.sCd();
    Site.aw.redrawTree();
    Site.aw.aal();
    return b2;
};
vtSt.prototype.unbutton = function () {
    var b2 = this.selection.o2[0];
    if (b2.sm.Cl != "bw") {
        return;
    }
    var isBHW;
    if (b2.unhover && b2.unhover.match(/outHBW/)) {
        debugger;
        b2.unhover = b2.unhover.replace(/DB\["/, "");
        b2.unhover = b2.unhover.replace(/"].outHBW()/, "");
        isBHW = b2.unhover;
        this.unbuttnHover({obj: DB[isBHW]});
    }
    var pt = b2.pt;
    var bobj = b2.o2[0];
    ait.oTree.smi({obj: pt});
    var bt = b2.te;
    var ot = bobj.te;
    ot.x = bt.x;
    ot.y = bt.y;
    ot.w = bt.w;
    ot.h = bt.h;
    ot.s = bt.s;
    ot.o = bt.o;
    b2.ucd({obj: bobj});
    pt.ucd({obj: b2});
    b2.rv();
    pt.bc({obj: bobj, idx: idx});
    ait.oTree.smi({obj: bobj});
};
vtSt.prototype.linkTo = function (ar) {
    if (ar.nw) {
        var newWindow = window.open("http://" + ar.sg, "_blank");
        newWindow.focus();
    } else {
        window.location = ar.sg;
    }
};
vtSt.prototype.buttnLink = function () {
    var obj = vt.selection.o2[0];
    if (er.co &&
        er.co == obj &&
        cb.caretIdx != cb.caretEnd) {
        debugger;
        er.fe();
    }
    this.ask({pm: this.createLK, names: ["http address"]});
};
vtSt.prototype.createLK = function () {
    var obj = vt.selection.o2[0];
    if (er.co &&
        er.co == obj &&
        cb.caretIdx != cb.caretEnd) {
        er.co.setSwap({href: this.hhttp_address});
    } else {
        this.toButton({mt: "vt.linkTo({sg:\"" + this.hhttp_address + "\"})"});
    }
    this.hhttp_address = null;
};
vtSt.prototype.buttnLKnew = function () {
    this.ask({pm: this.createLKnew, names: ["http address"]});
};
vtSt.prototype.createLKnew = function () {
    this.toButton({mt: "vt.linkTo({nw:true, sg:\"" + this.hhttp_address + "\"})"});
    this.hhttp_address = null;
};
vtSt.prototype.createAIncr = function () {
    vt.toButton({mt: "vt.buttnAIncr({s:1.2048})"});
};
vtSt.prototype.createADcrmt = function () {
    vt.toButton({mt: "vt.buttnAIncr({s:0.83})"});
};
vtSt.prototype.buttnAIncr = function (ar) {
    var t = ait.stage.te;
    var s = t.s * ar.s;
    var x = (cb.ww - t.w * s) / 2 + 0.5 | 0;
    var y = (cb.wh - t.h * s) / 2 + 0.5 | 0;
    ait.stage.tf({s: s, x: x, y: y, dt: 1000});
};
vtSt.prototype.buttnHover = function () {
    var bw_top = this.toButton();
    var pt = bw_top.pt;
    var new_obj = new HoverButtonWidget({obj: bw_top});
    ait.oTree.createWidget({obj: new_obj});
    pt.bc({obj: new_obj});
    new_obj.redrawTree();
    ait.oTree.aal();
    ait.oTree.smi({obj: new_obj});
};
vtSt.prototype.unbuttnHover = function (ar) {
    var pt = ar.obj.pt;
    var new_obj = new aw;
    ait.oTree.createWidget({obj: new_obj});
    pt.bc({obj: new_obj});
    while (ar.obj.o2) {
        var cd = ar.obj.ucd({idx: 0});
        new_obj.bc({obj: cd});
    }
    ar.obj.rv();
    pt.redrawTree();
    ait.oTree.aal();
    ait.oTree.smi({obj: new_obj});
};
vtSt.prototype.buttnState = function () {
    States.checkStates();
    if (ait.popup) {
        ait.popup.rv();
    }
    ait.popup = new aw({style: {value: "backgroundImage:url(\"shared/g3sf15.gif\");border:1px solid black"}, STt: "ll"});
    ait.popup._wrapped = true;
    Site.aw.bc({obj: ait.popup});
    var txt = new tw({t1: "choose a page:", style: {value: "color:white;"}, x: 10, y: 5});
    ait.popup.bc({obj: txt});
    var _struct = "";
    for (var i = 0; States.arr && i < States.arr.length; i++) {
        var st = States.arr[i];
        _struct += "L,," + st.otree_node.o2[0].d2[0].txt + ",vt.post_buttnState({id:'" + st.id + "'});";
    }
    var mu = new Menu({sr: _struct});
    var mw1 = new mw({menu: mu, STt: "ll"});
    ait.popup.bc({obj: mw1, x: 15, y: 30});
    mw1.ase({pr: "border", val: "none"});
    ait.popup.te.w = mw1.te.w + 30;
    ait.popup.te.h = mw1.te.h + 50;
    ait.popup.te.x = ait.eMenu.te.x - ait.popup.te.w - 5;
    ait.popup.te.y = 5;
    var b2 = new bw({t1: "X", klik: "ait.popup.rv()", b5: mwDf.grs({sg: "mwToggle_default"})});
    b2.centerW();
    b2.centerH();
    ait.popup.bc({obj: b2, x: ait.popup.te.w - 18, y: 3});
    ait.popup.redrawTree();
    ait.popup.sdg();
    ait.popup.aal();
};
vtSt.prototype.post_buttnState = function (ar) {
    ait.popup.rv();
    vt.toButton({mt: "p_" + ar.id});
};
vtSt.prototype.del = function () {
    if (this.selection) {
        for (var i = 0; i < this.selection.o2.length; i++) {
            this.delOne({obj: this.selection.o2[i]});
        }
        this.selection.empty();
    }
};
vtSt.prototype.delOne = function (ar) {
    var obj = ar.obj;
    if (obj.st) {
        this.delState();
        obj.pt.removeChild({obj: obj});
    }
    if (obj.nd) {
        var child_node = obj.nd;
        var p_n = child_node.pt;
        var mw1 = obj.mw1;
        var mu = child_node.mu;
        p_n.removeChildNode({nd: child_node});
        p_n.removeChildNode({nd: child_node});
    } else {
        obj.pt.removeChild({obj: obj});
    }
};
vtSt.prototype.button_style_new = function () {
    this.ask({pm: this.post_button_style_new, names: ["name style"]});
};
vtSt.prototype.post_button_style_new = function () {
    var obj = this.selection.o2[0];
    var old_rsrc = obj.b5;
    obj.b5 = new Rs;
    obj.b5.p2 = [];
    for (var i = 0; i < old_rsrc.p2.length; i++) {
        obj.b5.p2.push(old_rsrc.p2[i]);
    }
    if (obj.sm.Cl == "iw") {
        obj.b5.p2[1] = "iw_" + this.hname_style.replace(/ /g, "_");
    } else {
        obj.b5.p2[1] = "bw_" + this.hname_style.replace(/ /g, "_");
    }
    obj.b5.dc = old_rsrc.dc;
    if (obj.b5.dc.irc) {
        obj.b5.dc.irc({obj: obj.b5});
    }
    ait.rsrcs[obj.b5.id] = undefined;
    ait.rsrcs[obj.b5.p2[1]] = obj.b5;
    obj.rd();
    obj.aal();
};
vtSt.prototype.button_style_edit = function (ar) {
    if (ait.popup) {
        ait.popup.rv();
    }
    this.b_idx = ar.idx;
    ait.popup = new aw({style: {value: "backgroundImage:url(\"shared/g3sf15.gif\");border:1px solid black"}, STt: "ll"});
    ait.popup._wrapped = true;
    Site.aw.bc({obj: ait.popup});
    var txt = new tw({t1: "EDIT BUTTON STYLE:", style: {value: "color:white;"}, x: 10, y: 5});
    ait.popup.bc({obj: txt});
    var _struct = "";
    _struct += "N,,TEXT-STYLE;";
    _struct += "L,0,color,vt.edit_button({sg:'ts_color'});";
    _struct += "L,0,normal,vt.edit_button({sg:'ts_normal'});";
    _struct += "L,0,bold,vt.edit_button({sg:'bold'});";
    _struct += "L,0,italic,vt.edit_button({sg:'italic'});";
    _struct += "L,0,underline,vt.edit_button({sg:'underline'});";
    _struct += "L,0,overline,vt.edit_button({sg:'overline'});";
    _struct += "L,0,line-through,vt.edit_button({sg:'line-through'});";
    _struct += "N,,TEXT-FONT;";
    _struct += "L,1,Arial,vt.edit_button({sg:'Arial'});";
    _struct += "L,1,Comic,vt.vt.edit_button({sg:'Comic'});";
    _struct += "L,1,Courier New,vt.edit_button({sg:'Courier New'});";
    _struct += "L,1,Georgia,vt.edit_button({sg:'Georgia'});";
    _struct += "L,1,Impact,vt.edit_button({sg:'Impact'});";
    _struct += "L,1,Lucida Console,vt.edit_button({sg:'Lucida Console'});";
    _struct += "L,1,Lucida Sans Unicode,vt.edit_button({sg:'Lucida Sans Unicode'});";
    _struct += "L,1,Palatino Linotype,vt.edit_button({sg:'Palatino Linotype'});";
    _struct += "L,1,Tahoma,vt.edit_button({sg:'Tahoma'});";
    _struct += "L,1,Times New Roman,vt.edit_button({sg:'Times New Roman'});";
    _struct += "L,1,Trebuchet,vt.edit_button({sg:'Trebuchet'});";
    _struct += "L,1,Verdana,vt.edit_button({sg:'Verdana'});";
    _struct += "L,1,Wingdings,vt.edit_button({sg:'Wingdings'});";
    _struct += "L,1,MS Serif,vt.edit_button({sg:'MS Serif'});";
    _struct += "N,,BACKGROUND;";
    _struct += "L,2,none,vt.edit_button({sg:'bg_none'});";
    _struct += "L,2,color,vt.edit_button({sg:'bg_color'});";
    _struct += "L,2,image,vt.edit_button({sg:'image'});";
    _struct += "N,,BORDER;";
    _struct += "L,3,none,vt.edit_button({sg:'b_none'});";
    _struct += "L,3,color,vt.edit_button({sg:'b_color'});";
    _struct += "L,3,width,vt.edit_button({sg:'width'});";
    _struct += "L,3,dashed,vt.edit_button({sg:'dashed'});";
    _struct += "L,3,solid,vt.edit_button({sg:'solid'});";
    _struct += "L,3,double,vt.edit_button({sg:'double'});";
    _struct += "L,3,groove,vt.edit_button({sg:'groove'});";
    _struct += "L,3,ridge,vt.edit_button({sg:'ridge'});";
    _struct += "L,3,inset,vt.edit_button({sg:'inset'});";
    _struct += "L,3,outset,vt.edit_button({sg:'outset'});";
    var mu = new Menu({sr: _struct});
    var mw1 = new mw({menu: mu, STt: "ll"});
    ait.popup.bc({obj: mw1, x: 15, y: 30});
    mw1.ase({pr: "border", val: "none"});
    ait.popup.te.w = mw1.te.w + 30;
    ait.popup.te.h = mw1.te.h + 50;
    ait.popup.te.x = ait.eMenu.te.x - ait.popup.te.w - 5;
    ait.popup.te.y = 5;
    var b2 = new bw({t1: "X", klik: "ait.popup.rv()", b5: mwDf.grs({sg: "mwToggle_default"})});
    b2.centerW();
    b2.centerH();
    ait.popup.bc({obj: b2, x: ait.popup.te.w - 18, y: 3});
    ait.popup.redrawTree();
    ait.popup.sdg();
    ait.popup.aal();
};
vtSt.prototype.setColor = function (ar) {
    this.s_clr = ar.pr;
    this.s_obj = ar.obj ? ar.obj : this.selection.o2[0];
    this.ask({pm: this.setColorCode, names: ["color"]});
};
vtSt.prototype.setColorCode = function () {
    if (this.s_obj.swap_idx1 || this.s_obj.swap_idx1 == 0) {
        this.s_obj.setSelection({sg: this.s_clr + ":" + this.hcolor + ";"});
    } else if (this.s_obj.ase) {
        this.s_obj.ase({pr: this.s_clr, val: this.hcolor});
    } else {
        this.s_obj[this.s_clr] = this.hcolor;
        if (this.s_clr == "borderColor") {
            if (!this.s_obj.borderWidth) {
                this.s_obj.borderWidth = "1px";
            }
            if (!this.s_obj.borderStyle) {
                this.s_obj.borderStyle = "solid";
            }
        }
        var b5 = this.selection.o2[0].b5;
        b5.sCd();
        var md = b5.modes[this.b_idx];
        b5.p2[this.b_idx + 2] = "";
        for (var pr in md) {
            b5.p2[this.b_idx + 2] += pr + ":" + md[pr] + ";";
        }
    }
    this.s_obj.sCd();
};
vtSt.prototype.setColor_old = function (ar) {
    this.s_clr = ar.pr;
    this.s_obj = ar.obj ? ar.obj : this.selection.o2[0];
    if (this.clrpkr) {
        this.clrpkr.rv();
    }
    this.clrpkr = new Fw({style: {value: "backgroundImage:url(\"shared/g3sf15.gif\");border:1px solid black"}, x: 10, y: 10, w: 300, h: 400, STt: "ll"});
    this.clrpkr.s_meth = "vt.postColor(vt.clr_val)";
    this.clr_val = this.s_obj.sO && this.s_obj.sO[this.s_clr] ? this.s_obj.sO[this.s_clr].replace(/#/, "") : "";
    this.clrpkr.addInput({sg: "edit color", data: "vt.clr_val", ol: true, requird: true});
    this.clrpkr.addSendButton({sg: "verzenden"});
    this.clrpkr.addKillButton();
    Site.aw.bc({obj: this.clrpkr});
    this.clrpkr.te.h += 270;
    for (var i = 0; i < 3; i++) {
        this.clrpkr.o2[i].te.y += 270;
    }
    var _aw = new aw({style: {value: "border:1px solid black"}, STt: "ll", x: 15, y: 42, w: 240, h: 240});
    this.clrpkr.bc({obj: _aw});
    this.createCT({r: 0});
    _aw = new aw({style: {value: "border:1px solid black"}, STt: "ll", x: 270, y: 42, w: 15, h: 240});
    this.clrpkr.bc({obj: _aw});
    var colorstrng = "<table style='border-collapse:collapse;'>";
    var hextab = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
    for (var r = 0; r < 16; r++) {
        colorstrng += "<tr><td onclick=vt.createCT({r:" + r + "}) style='background:#" + hextab[r] + "00;width:10px;height:10px'></td><tr>";
    }
    colorstrng += "</table>";
    _aw.div.innerHTML = colorstrng;
    _aw = new tw({t1: "CHOOSE COLOR:", style: {value: "color:white;"}, x: 10, y: 5});
    this.clrpkr.bc({obj: _aw});
    this.clrpkr.set_box();
    this.clrpkr.sdg();
    this.clrpkr.redrawTree();
    this.clrpkr.aal();
    cb.nuc({obj: this.clrpkr.o2[1].dn[0]});
};
vtSt.prototype.createCT = function (ar) {
    var r = ar.r;
    var _aw = this.clrpkr.o2[4];
    var colorstrng = "<table style='border-collapse:collapse;'>";
    var hextab = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
    for (var g = 0; g < 16; g++) {
        colorstrng += "<tr>";
        for (var b = 0; b < 16; b++) {
            var clrval = hextab[r] + hextab[g] + hextab[b];
            colorstrng += "<td onclick=vt.postColor('" + clrval + "') onmouseover=vt.hoverColor('#" + clrval + "') style='background:#" + clrval + ";width:15px;height:15px'></td>";
        }
        colorstrng += "</tr>";
    }
    colorstrng += "</table>";
    _aw.div.innerHTML = colorstrng;
};
vtSt.prototype.hoverColor = function (ar) {
    this.clrpkr.o2[1].d2[0].sT({sg: ar});
};
vtSt.prototype.postColor = function (ar) {
    if (this.s_obj.ase) {
        this.s_obj.ase({pr: this.s_clr, val: ar});
    } else {
        this.s_obj[this.s_clr] = ar;
        if (this.s_clr == "borderColor") {
            if (!this.s_obj.borderWidth) {
                this.s_obj.borderWidth = "1px";
            }
            if (!this.s_obj.borderStyle) {
                this.s_obj.borderStyle = "solid";
            }
        }
        var b5 = this.selection.o2[0].b5;
        b5.sCd();
        var md = b5.modes[this.b_idx];
        b5.p2[this.b_idx + 2] = "";
        for (var pr in md) {
            b5.p2[this.b_idx + 2] += pr + ":" + md[pr] + ";";
        }
    }
    this.selection.o2[0].rd();
    this.updateInfo();
};
vtSt.prototype.borderNone = function (ar) {
    var obj = this.selection.o2[0];
    obj.aSt({sg: "borderStyle:null;borderWidth:null;borderColor:null"});
    for (var i = obj.dn.length - 1; obj.dn && i >= 0; i--) {
        var dec = obj.dn[i];
        if (!dec.STt) {
            obj.removeDecoration_i({idx: i});
        }
    }
    vt.updateInfo();
};
vtSt.prototype.setBGImage = function (ar) {
    this.i_obj = ar && ar.obj ? ar.obj : this.selection.o2[0];
    this.ask({pm: this.postSetBGImage, names: ["image path"]});
};
vtSt.prototype.postSetBGImage = function (ar) {
    if (this.i_obj.ase) {
        this.i_obj.ase({pr: "backgroundImage", val: this.himage_path});
    } else {
        this.i_obj.backgroundImage = this.himage_path;
        var b5 = this.selection.o2[0].b5;
        b5.sCd();
        var md = b5.modes[this.b_idx];
        b5.p2[this.b_idx + 2] = "";
        for (var pr in md) {
            b5.p2[this.b_idx + 2] += pr + ":" + md[pr] + ";";
        }
    }
    this.himage_path = null;
    this.i_obj = null;
    this.selection.o2[0].rd();
    this.updateInfo();
};
vtSt.prototype.toggleBGImage = function (ar) {
    var obj = this.selection.o2[0];
    if (ar.sg == "xy") {
        obj.ase({pr: "backgroundRepeat", val: "none"});
    } else if (ar.sg == "x") {
        obj.ase({pr: "backgroundRepeat", val: "repeat-x"});
    } else if (ar.sg == "y") {
        obj.ase({pr: "backgroundRepeat", val: "repeat-y"});
    } else if (ar.sg == "NW") {
        obj.ase({pr: "backgroundAttachment", val: "fixed"});
        obj.ase({pr: "backgroundPosition", val: "left top"});
    } else if (ar.sg == "N") {
        obj.ase({pr: "backgroundAttachment", val: "fixed"});
        obj.ase({pr: "backgroundPosition", val: "center top"});
    } else if (ar.sg == "NE") {
        obj.ase({pr: "backgroundAttachment", val: "fixed"});
        obj.ase({pr: "backgroundPosition", val: "right top"});
    } else if (ar.sg == "E") {
        obj.ase({pr: "backgroundAttachment", val: "fixed"});
        obj.ase({pr: "backgroundPosition", val: "right center"});
    } else if (ar.sg == "SE") {
        obj.ase({pr: "backgroundAttachment", val: "fixed"});
        obj.ase({pr: "backgroundPosition", val: "right bottom"});
    } else if (ar.sg == "S") {
        obj.ase({pr: "backgroundAttachment", val: "fixed"});
        obj.ase({pr: "backgroundPosition", val: "center bottom"});
    } else if (ar.sg == "SW") {
        obj.ase({pr: "backgroundAttachment", val: "fixed"});
        obj.ase({pr: "backgroundPosition", val: "left bottom"});
    } else if (ar.sg == "W") {
        obj.ase({pr: "backgroundAttachment", val: "fixed"});
        obj.ase({pr: "backgroundPosition", val: "left center"});
    } else if (ar.sg == "C") {
        obj.ase({pr: "backgroundAttachment", val: "fixed"});
        obj.ase({pr: "backgroundPosition", val: "center center"});
    } else if (ar.sg == "fs") {
        if (obj.sO.backgroundAttachment) {
            obj.ase({pr: "backgroundAttachment", val: "none"});
        } else {
            obj.ase({pr: "backgroundAttachment", val: "fixed"});
        }
    }
};
vtSt.prototype.setBWidth = function (ar) {
    this.b_obj = ar && ar.obj ? ar.obj : this.selection.o2[0];
    this.ask({pm: this.postSetBWidth, names: ["border width"]});
};
vtSt.prototype.postSetBWidth = function () {
    this.setBorderProp({obj: this.b_obj, pr: "borderWidth", val: this.hborder_width + "px"});
    this.b_obj = null;
};
vtSt.prototype.setBorderProp = function (ar) {
    var obj = ar && ar.obj ? ar.obj : this.selection.o2[0];
    if (obj.ase) {
        obj.ase({pr: ar.pr, val: ar.val});
        if (!obj.sO.borderStyle) {
            obj.ase({pr: "borderStyle", val: "solid"});
        }
        if (!obj.sO.borderWidth) {
            obj.ase({pr: "borderWidth", val: "1px"});
        }
        if (!obj.sO.borderColor) {
            obj.ase({pr: "borderColor", val: "black"});
        }
    } else {
        obj[ar.pr] = ar.val;
        var b5 = this.selection.o2[0].b5;
        b5.sCd();
        var md = b5.modes[this.b_idx];
        b5.p2[this.b_idx + 2] = "";
        for (var pr in md) {
            b5.p2[this.b_idx + 2] += pr + ":" + md[pr] + ";";
        }
    }
    this.selection.o2[0].rd();
    this.updateInfo();
};
vtSt.prototype.edit_button = function (ar) {
    var obj = this.selection.o2[0];
    var b5 = obj.b5;
    var md = b5.modes[this.b_idx];
    if (ar.sg == "ts_normal") {
        md.fontWeight = "normal";
        md.fontStyle = "normal";
        md.textDecoration = "none";
    } else if (ar.sg == "ts_color") {
        this.setColor({obj: md, pr: "color"});
    } else if (ar.sg == "bold") {
        md.fontWeight = "bold";
    } else if (ar.sg == "italic") {
        md.fontStyle = "italic";
    } else if (ar.sg == "underline") {
        md.textDecoration = "underline";
    } else if (ar.sg == "overline") {
        md.textDecoration = "overline";
    } else if (ar.sg == "line-through") {
        md.textDecoration = "line-through";
    }
    if (ar.sg == "Arial") {
        md.fontFamily = "Arial, Helvetica, sans-serif";
    } else if (ar.sg == "Comic") {
        md.fontFamily = "Comic Sans MS, Comic Sans MS5, cursive";
    } else if (ar.sg == "Courier New") {
        md.fontFamily = "Courier New, Courier New, Courier6, monospace";
    } else if (ar.sg == "Georgia") {
        md.fontFamily = "Georgia1, Georgia, serif";
    } else if (ar.sg == "Impact") {
        md.fontFamily = "Impact, Impact5, Charcoal6, sans-serif";
    } else if (ar.sg == "Lucida Console") {
        md.fontFamily = "Lucida Console, Monaco5, monospace";
    } else if (ar.sg == "Lucida Sans Unicode") {
        md.fontFamily = "Lucida Sans Unicode, Lucida Grande, sans-serif";
    } else if (ar.sg == "Palatino Linotype") {
        md.fontFamily = "Palatino Linotype, Book Antiqua3, Palatino6, serif";
    } else if (ar.sg == "Tahoma") {
        md.fontFamily = "Tahoma, Geneva, sans-serif";
    } else if (ar.sg == "Times New Roman") {
        md.fontFamily = "Times New Roman, Times, serif";
    } else if (ar.sg == "Trebuchet") {
        md.fontFamily = "Trebuchet MS1, Helvetica, sans-serif";
    } else if (ar.sg == "Verdana") {
        md.fontFamily = "Verdana, Geneva, sans-serif";
    } else if (ar.sg == "Wingdings") {
        md.fontFamily = "Wingdings, Zapf Dingbats";
    } else if (ar.sg == "MS Serif") {
        md.fontFamily = "MS Serif4, New York6, serif";
    }
    if (ar.sg == "bg_none") {
        md.backgroundImage = "none";
        md.backgroundColor = "none";
    } else if (ar.sg == "bg_color") {
        this.setColor({obj: md, pr: "backgroundColor"});
    } else if (ar.sg == "image") {
        this.setBGImage({obj: md});
    }
    if (ar.sg == "b_none") {
        md.border = "none";
        md.borderStyle = "none";
        md.borderWidth = "none";
        md.borderColor = "none";
    } else if (ar.sg == "b_color") {
        this.setColor({obj: md, pr: "borderColor"});
    } else if (ar.sg == "width") {
        this.setBWidth({obj: md});
    } else if (ar.sg == "dashed") {
        this.setBorderProp({obj: md, pr: "borderStyle", val: "dashed"});
    } else if (ar.sg == "solid") {
        this.setBorderProp({obj: md, pr: "borderStyle", val: "solid"});
    } else if (ar.sg == "double") {
        this.setBorderProp({obj: md, pr: "borderStyle", val: "double"});
    } else if (ar.sg == "groove") {
        this.setBorderProp({obj: md, pr: "borderStyle", val: "groove"});
    } else if (ar.sg == "ridge") {
        this.setBorderProp({obj: md, pr: "borderStyle", val: "ridge"});
    } else if (ar.sg == "inset") {
        this.setBorderProp({obj: md, pr: "borderStyle", val: "inset"});
    } else if (ar.sg == "outset") {
        this.setBorderProp({obj: md, pr: "borderStyle", val: "outset"});
    }
    b5.p2[this.b_idx + 2] = "";
    for (var pr in md) {
        b5.p2[this.b_idx + 2] += pr + ":" + md[pr] + ";";
    }
    b5.sCd();
    obj.rd();
    this.updateInfo();
};
vtSt.prototype.button_style_choose = function () {
    var obj = this.selection.o2[0];
    var b5 = obj.b5;
    var p2 = b5.p2;
    if (ait.popup) {
        ait.popup.rv();
    }
    ait.popup = new aw({style: {value: "backgroundImage:url(\"shared/g3sf15.gif\");border:1px solid black"}, STt: "ll"});
    ait.popup._wrapped = true;
    Site.aw.bc({obj: ait.popup});
    var txt = new tw({t1: "choose a style:", style: {value: "color:white;"}, x: 10, y: 5});
    ait.popup.bc({obj: txt});
    var _struct = "";
    for (rsrc_i in ait.rsrcs) {
        if (ait.rsrcs[rsrc_i]) {
            var parts_i = ait.rsrcs[rsrc_i].p2;
            if (parts_i &&
                (parts_i[0] == "iDf" &&
                p2[0] == "iDf" ||
                (parts_i[0] == "bDD" ||
                parts_i[0] == "bgd") &&
                (p2[0] == "bDD" ||
                p2[0] == "bgd") ||
                parts_i[0] == "BWHDefaultDecorator" &&
                p2[0] == "BWHDefaultDecorator")) {
                _struct += "L,," + parts_i[1] + ",vt.post_button_style_choose({b5:'" + parts_i[1] + "'});";
            }
        }
    }
    var mu = new Menu({sr: _struct});
    var mw1 = new mw({menu: mu, STt: "ll"});
    ait.popup.bc({obj: mw1, x: 15, y: 30});
    mw1.ase({pr: "border", val: "none"});
    var _y = 3;
    for (var i = 0; i < mw1.o2.length; i++) {
        var _lw = mw1.o2[i];
        var _bw = _lw.o2[0];
        var _txt = _bw.o2[0].d2[0].txt;
        var _h = _bw.te.h;
        _lw.te.y = _y;
        _lw.te.h = _h;
        _bw.b5 = ait.rsrcs[_txt];
        _y += _h + 3;
    }
    mw1.te.h = _y;
    ait.popup.te.w = mw1.te.w + 30;
    ait.popup.te.h = mw1.te.h + 50;
    ait.popup.te.x = ait.eMenu.te.x - ait.popup.te.w - 5;
    ait.popup.te.y = 5;
    var b2 = new bw({t1: "X", klik: "ait.popup.rv()", b5: mwDf.grs({sg: "mwToggle_default"})});
    b2.centerW();
    b2.centerH();
    ait.popup.bc({obj: b2, x: ait.popup.te.w - 18, y: 3});
    ait.popup.redrawTree();
    ait.popup.sdg();
    ait.popup.aal();
};
vtSt.prototype.post_button_style_choose = function (ar) {
    ait.popup.rv();
    var obj = this.selection.o2[0];
    obj.b5 = ait.rsrcs[ar.b5];
    obj.de();
    obj.aal();
};
vtSt.prototype.dc = function (ar) {
    var obj = this.selection.o2[0];
    ait.oTree.smi({obj: Site.aw});
    if (obj.mw1) {
        obj = obj.mw1;
    }
    obj.b5.rv();
    if (ar.sg == "default") {
        obj.b5 = mwDf.grs({sg: "mw_default"});
    } else if (ar.sg == "lespap1") {
        obj.b5 = mld.grs({sg: "mw_lespap1"});
    }
    obj.de();
    obj.sCd();
    Site.aw.redrawTree();
    obj.aal();
    ait.oTree.smi({obj: obj});
};
var vt = new vtSt();
var stSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
stSt.prototype.sm = {Cl:'stSt',inr:0};
stSt.prototype.sm.it = function (ar) {
    
    this.aw = new aw({id: "1_1", intree: true});
    this.aw.div = $("aw_0");
    this.aw.hidden = undefined;
    var s = this.aw.div.style;
    s.position = "absolute";
    this.dynamics = dyd;
};
stSt.prototype.ld = function (ar) {
    if (!(ar && ar.cls && ar.name)) {
        alert("Site.ld Error: at least one of the arguments is missing");
    }
    if (ait[ar.name]) {
        ait[ar.name].rv();
    }
    eval("new " + ar.cls + "({name:\"" + ar.name + "\", intree:true, STt:\"ld\"})");
    if (ar.pt) {
        ar.pt.bc({obj: ait[ar.name]});
    }
    rdb.sc();
};
stSt.prototype._showPage = function (ar) {
    if (!ar.name) {
        alert("Site._showPage Error: page name is missing");
    }
    var obj = ait[ar.name];
    obj.idb();
    this.dynamics.de();
    if ($("img_load")) {
        this.aw.div.removeChild($("img_load"));
    }
    if (ar.name == "stage") {
        ait.stage.unhide();
        this.dynamics.gst({obj: States.arr[0].aw});
    } else {
        this.dynamics.gst({obj: ait[ar.name]});
    }
    this.aw.redrawTree();
    this.aw.aal();
    document.body.style.cursor = "pointer";
    code();
};
stSt.prototype.li = function (ar) {
    lgw.s1();
};
stSt.prototype.eL = function (ar) {
    ait.law.rv();
    if (ait.stage.te.y < 15) {
        ait.stage.tf({y: 15, dt: 1000});
    }
    this.ssb({sg: "Login ok... Welkom " + vt.lgn + "!"});
    if (!vt.selection) {
        vt.selection = new SelectionWidget;
    }
    ctr.cms();
};
stSt.prototype.logout = function (ar) {
    lgw.sl0();
    window.location.reload();
};
stSt.prototype.ssb = function (ar) {
    if (!ait.statusbar) {
        ait.statusbar = new tw({t1: ar.sg, s: 1.2, z: 999999});
        ait.statusbar.aSt({sg: "padding:8px;color:black;backgroundColor:white;border:1px solid black"});
        Site.aw.bc({obj: ait.statusbar});
        ait.statusbar.sdg();
    } else {
        if (ait.statusbar.ctime) {
            clearTimeout(ait.statusbar.ctime);
        }
        ait.statusbar.sT(ar);
        ait.statusbar.rd();
    }
    var t = ait.statusbar.te;
    var info = $("info");
    if (ar && ar.targ) {
        var t2 = ar && ar.targ.te;
        t.x = t2.x;
        t.y = t2.y - 40 - t.h;
    } else if (info) {
        t.x = info.offsetLeft + 10;
        t.y = info.offsetTop - 40 - t.h;
    } else {
        t.x = cb.scrOfX + 10;
        t.y = cb.wh + cb.scrOfY - t.h - 50;
    }
    ait.statusbar.unhide();
    ait.statusbar.redrawTree();
    ait.statusbar.ctime = setTimeout("Site.unsetStatusBar()", 7000);
};
stSt.prototype.unsetStatusBar = function () {
    ait.statusbar.hide();
    ait.statusbar.ctime = null;
};
var lgwSt = function (ar) {
    
    this.iid = this.sm.Cl + "_" + this.sm.inr;
    this.sm.inr++;
    this.sm.it.call(this, ar);
};
lgwSt.prototype.sm = {Cl:'lgwSt',inr:0};
lgwSt.prototype.sm.it = function (ar) {
    
};
lgwSt.prototype.send = function (ar) {
    ax.send({url: rdb.path + "lgi", mg: ar.mg + "&tm=" + (new Date).getTime(), obj: this, pm: ar.pm});
};
lgwSt.prototype.s1 = function () {
    vt.id = null;
    vt.lgn = "";
    this.send({mg: "t=s", pm: "sl5"});
};
lgwSt.prototype.si = function () {
    for (var i = 0; i < ait.law.o2.length; i++) {
        var cd = ait.law.o2[i];
        cd.dn[0].deactivate();
    }
};
lgwSt.prototype.setActive = function () {
    vt.pswd = "";
    var sform = new Fw({name: "law", style: {value: "border:solid 1px black;backgroundColor:#228B22;"}, STt: "ll", intree: false});
    sform.s_meth = "lgw.ckF()";
    Site.aw.bc({obj: sform});
    sform.addInput({sg: "naam", data: "vt.lgn", ol: true});
    sform.addInput({sg: "password", data: "vt.pswd", ol: true, iP: true});
    sform.addSendButton({sg: "login"});
    sform.addKillButton();
    sform.sdg();
    cb.cW({obj: sform});
    sform.redrawTree();
    sform.aal();
    sform.clickOn({idx: 1});
    Site.ssb({sg: "Voer uw gegevens in", targ: sform});
};
lgwSt.prototype.sl5 = function (ar) {
    var op = parseInt(ar);
    if (op < 0) {
        var mnt = - op / 60000 | 0;
        var sec = - op / 1000 - mnt * 60 | 0;
        Site.ssb({sg: "3 x FOUT ingelogd. Probeer het over " + mnt + ":" + sec + " nog eens"});
    } else {
        this.setActive();
        vt.nn = 0;
        vt.STt = "ok";
        vt.sd = op;
    }
};
lgwSt.prototype.ckF = function () {
    if (this.cg) {
        return;
    }
    this.sl1();
};
lgwSt.prototype.sl1 = function () {
    Site.ssb({sg: "login wordt gecontroleerd", targ: ait.law});
    this.SHA1();
    vt.pswd += vt.sd;
    this.SHA1();
    this.send({mg: "t=i&v=" + vt.lgn.toLowerCase() + "&p=" + vt.pswd, pm: "CL"});
    vt.pswd = "";
};
lgwSt.prototype.CL = function (ar) {
    var l0 = ar.match(/\_/);
    if (l0) {
        Site.ssb({sg: "login ok.\nEen moment aub,\nde menus worden opgebouwd.", targ: ait.law});
        var p2 = gp({sg: ar, lm: "_"});
        vt.sd = parseInt(p2[0]);
        vt.id = p2[1];
        this.k4();
        setTimeout("Site.eL()", 300);
    } else if (ar == "Log Out First!" || ar == "500 Internal Server Error!") {
        Site.ssb({sg: ar});
        Site.logout();
    } else if (Number(ar) == Number.NaN) {
        alert("Verbinding met de server is verbroken.\nDe pagina wordt opnieuw geladen.");
        Site.logout();
    } else {
        vt.nn = parseInt(ar);
        vt.pswd = "";
        ait.law.o2[1].sT("");
        if (vt.nn < 3) {
            var sg = "" + vt.nn + "x FOUT, u heeft nog " + (3 - vt.nn) + " pogingen";
            Site.ssb({sg: sg, targ: ait.law});
            cb.nuc({obj: ait.law.o2[3].dn[0]});
        } else {
            Site.ssb({sg: "3x FOUT, probeer het na 5 minuten nog eens"});
            this.rv();
        }
    }
};
lgwSt.prototype.k4 = function () {
    if (!vt) {
        return;
    }
    this.send({mg: "t=s", pm: "s5"});
    setTimeout("lgw.k4()", 1500000);
};
lgwSt.prototype.s5 = function (ar) {
    vt.sd = parseInt(ar);
};
lgwSt.prototype.sl0 = function () {
    this.send({mg: "t=o&v=" + vt.lgn.toLowerCase(), pm: "pL"});
    vt.sd = null;
    vt.id = null;
};
lgwSt.prototype.pL = function (ar) {
    Site.ssb({sg: ar});
};
lgwSt.prototype.SHA1 = function () {
    
    

    function rl(n, s) {
        var t4 = n << s | n >>> 32 - s;
        return t4;
    }


    function lsb(val) {
        var str = "";
        var i;
        var vh;
        var vl;
        for (i = 0; i <= 6; i += 2) {
            vh = val >>> i * 4 + 4 & 15;
            vl = val >>> i * 4 & 15;
            str += vh.toString(16) + vl.toString(16);
        }
        return str;
    }


    function cvt(val) {
        var str = "";
        var i;
        var v;
        for (i = 7; i >= 0; i--) {
            v = val >>> i * 4 & 15;
            str += v.toString(16);
        }
        return str;
    }


    function u8(string) {
        string = string.replace(/\r\n/g, "\n");
        var utftext = "";
        for (var n = 0; n < string.length; n++) {
            var c = string.charCodeAt(n);
            if (c < 128) {
                utftext += String.fromCharCode(c);
            } else if (c > 127 && c < 2048) {
                utftext += String.fromCharCode(c >> 6 | 192);
                utftext += String.fromCharCode(c & 63 | 128);
            } else {
                utftext += String.fromCharCode(c >> 12 | 224);
                utftext += String.fromCharCode(c >> 6 & 63 | 128);
                utftext += String.fromCharCode(c & 63 | 128);
            }
        }
        return utftext;
    }

    var bS;
    var i, j;
    var W = new Array(80);
    var H0 = 1732584193;
    var H1 = 4023233417;
    var H2 = 2562383102;
    var H3 = 271733878;
    var H4 = 3285377520;
    var A, B, C, D, E;
    var temp;
    var msg = u8(vt.pswd);
    
    var msl = msg.length;
    var wa = new Array;
    for (i = 0; i < msl - 3; i += 4) {
        j = msg.charCodeAt(i) << 24 | msg.charCodeAt(i + 1) << 16 | msg.charCodeAt(i + 2) << 8 | msg.charCodeAt(i + 3);
        wa.push(j);
    }
    
    switch (msl % 4) {
      case 0:
        i = 2147483648;
        break;
      case 1:
        i = msg.charCodeAt(msl - 1) << 24 | 8388608;
        break;
      case 2:
        i = msg.charCodeAt(msl - 2) << 24 | msg.charCodeAt(msl - 1) << 16 | 32768;
        break;
      case 3:
        i = msg.charCodeAt(msl - 3) << 24 | msg.charCodeAt(msl - 2) << 16 | msg.charCodeAt(msl - 1) << 8 | 128;
        break;
      default:;
    }
    wa.push(i);
    
    while (wa.length % 16 != 14) {
        wa.push(0);
    }
    wa.push(msl >>> 29);
    wa.push(msl << 3 & 4294967295);
    
    for (bS = 0; bS < wa.length; bS += 16) {
        for (i = 0; i < 16; i++) {
            W[i] = wa[bS + i];
        }
        for (i = 16; i <= 79; i++) {
            W[i] = rl(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
        }
        A = H0;
        B = H1;
        C = H2;
        D = H3;
        E = H4;
        for (i = 0; i <= 19; i++) {
            temp = rl(A, 5) + (B & C | ~B & D) + E + W[i] + 1518500249 & 4294967295;
            E = D;
            D = C;
            C = rl(B, 30);
            B = A;
            A = temp;
        }
        for (i = 20; i <= 39; i++) {
            temp = rl(A, 5) + (B ^ C ^ D) + E + W[i] + 1859775393 & 4294967295;
            E = D;
            D = C;
            C = rl(B, 30);
            B = A;
            A = temp;
        }
        for (i = 40; i <= 59; i++) {
            temp = rl(A, 5) + (B & C | B & D | C & D) + E + W[i] + 2400959708 & 4294967295;
            E = D;
            D = C;
            C = rl(B, 30);
            B = A;
            A = temp;
        }
        for (i = 60; i <= 79; i++) {
            temp = rl(A, 5) + (B ^ C ^ D) + E + W[i] + 3395469782 & 4294967295;
            E = D;
            D = C;
            C = rl(B, 30);
            B = A;
            A = temp;
        }
        H0 = H0 + A & 4294967295;
        H1 = H1 + B & 4294967295;
        H2 = H2 + C & 4294967295;
        H3 = H3 + D & 4294967295;
        H4 = H4 + E & 4294967295;
    }
    var temp = cvt(H0) + cvt(H1) + cvt(H2) + cvt(H3) + cvt(H4);
    
    vt.pswd = temp.toLowerCase();
};
var lgw = new lgwSt();
window.onload = function(){ setTimeout( 'ia()', 300);};

