function shippingReception(sr_id) { loading_start(); if(sr_id=='' && getId('shipping_reception')) sr_id = getId('shipping_reception').get('value'); var req = new Request({ method: 'post', url: '/ajax/cart/shipping_reception/', data: {sr_id:sr_id}, onComplete: function(data) { if(getId('shipping_reception_desc')) getId('shipping_reception_desc').set('html',data); loading_stop(); } }).send(); } var timer = 1; function cart_update_3830(t,i,q,jm10) { clearTimeout(timer); timer=setTimeout(function validate(){ cart_update2_3830(t,i,q,jm10); },1000); } function cart_update2_3830(t,i,q,jm10) { var f=getId('f_cart'); var inputs = f.getElementsByTagName('input'); var re = /[,]/gi; t.value=t.value.replace(re,'.'); if(t.value.toFloat()>q.toFloat() && i!=2) salert_mini('Wprowadzona ilość przez Ciebie jest niedostępna. Aktualny stan magazynowy dla tego produktu wynosi: '+q+'.','rc_warning'); if((t.value[t.value.length-1]!='.' && jm10=="true") || jm10=="false") { if(i==1 || i==3) { var re = /[^-10-9_.]/gi; var pid=t.id.replace(re,''); var pa=pid.split('_'); var v1=0; var pids=0; for(var i=0; iq.toFloat() && i!=2) salert_mini('Wprowadzona ilość przez Ciebie jest niedostępna. Aktualny stan magazynowy dla tego produktu wynosi: '+q+'.','warning'); if((t.value[t.value.length-1]!='.' && jm10=="true") || jm10=="false") { if(i==1 || i==3) { var re = /[^-10-9_.]/gi; var pid=t.id.replace(re,''); var pa=pid.split('_'); var v1=0; var pids=0; for(var i=0; i0 && jsonObj.discounts_code[0].msg==1) { salert(jsonObj.discounts_code[0].text,5000); } if(jsonObj.discounts_code[0].msg==1 && hideDiscountAlert == false) { salert(jsonObj.discounts_code[0].text); if(jsonObj.discounts_code[0].value=="") { if($('discount')) { $('discount').set('value',''); } } } if('19968'=='20597') { if($('sum_all_netto')) getId('sum_all_netto').set('html',jsonObj.sumall_netto); } if($('sum_all')) getId('sum_all').set('html',jsonObj.sumall); if($('affix_sum_all')) getId('affix_sum_all').set('html',jsonObj.sumall); /* if($('delivery_time_days')) getId('delivery_time_days').set('html',jsonObj.max_delivery_time_days); */ if(typeof(jsonObj.prices)!='null' && typeof(jsonObj.prices)!='undefined') { jsonObj.prices.each(function(el){ var pr=el.price.split('_'); if($('pp['+el.pid+']')) $('pp['+el.pid+']').set('value',pr[0]); if('19968'=='20597') { var prn=el.price_netto.split('_'); if($('ppn['+el.pid+']')) $('ppn['+el.pid+']').set('value',prn[0]); } }); } if(jsonObj.discounts) set_discounts(jsonObj); if($('countries_t')) { shpping_ajax($('countries_t').get('value'),0,isCartAccount); $('countries_t').dispose(); } else { if($('countries')) shpping_ajax($('countries').get('value'),0,isCartAccount); } } }).send(); if(''>0) { loading_start(); var req = new Request.JSON({ method: 'post', data:{}, async: false, url: '/ajax//cart/repeat_orders/', onComplete: function(jsonObj) { loading_stop(); salert(jsonObj.msg); } }).send(); } } function check_discount(d) { loading_start(); var val='{RC}'; if(d) val=d.value; var req = new Request.JSON({ method: 'post', url: '/ajax//cart/discount/', data: {"dis":val,"max":getId('sum_all').innerHTML}, onComplete: function(jsonObj) { loading_stop(); if(jsonObj.discounts_code[0].value>0 && jsonObj.discounts_code[0].msg==1) { salert(jsonObj.discounts_code[0].text,5000); } if(jsonObj.discounts_code[0].msg==1) { salert(jsonObj.discounts_code[0].text); } getId('sum_all').set('html',jsonObj.sumall); set_discounts(jsonObj); shpping_ajax($('countries').get('value')); } }).send(); } function round(number,x) { number=number*100; var x = (!x ? 2 : parseInt(x)); var xToFixed = (!x ? 2 : x); var wynik=''; number=(Math.round(number*Math.pow(10,x)) / Math.pow(10,x))/100; wynik=Math.round(number*Math.pow(10,x)) / Math.pow(10,x) return wynik.toFixed(xToFixed); } function roundCzk(price,roundFactor){ if (price>0) { price=round(price,roundFactor); if(price==0){ price=1; } } return price; } function set_discounts(dis) { dis.discounts.each(function(d) { if($('pp['+d.pid+'_'+d.opt+']') && d.discount>0) { pb=$('pp['+d.pid+'_'+d.opt+']').get('value'); npb=pb*(1-(d.discount/100)); pb=parseFloat(pb).toFixed(2); var roundFactor = 2; if("".toLowerCase()=="czk") { roundFactor = "0"; npb=roundCzk(npb, roundFactor); } else{ npb=round(npb, roundFactor); } if(19968==20597) { if($('ppn['+d.pid+'_'+d.opt+']')) { pn=$('ppn['+d.pid+'_'+d.opt+']').get('value'); npn=pn*(1-(d.discount/100)); pn=parseFloat(pn).toFixed(2); var roundFactor = 2; if("".toLowerCase()=="czk"){ roundFactor = "0"; npb=roundCzk(npb, roundFactor); }else{ npn=round(npn, roundFactor); } $('dpn['+d.pid+'_'+d.opt+']').set('html',npn+' '+dis.currency); $('prin['+d.pid+'_'+d.opt+']').addClass('through'); } } $('dp['+d.pid+'_'+d.opt+']').set('html',npb+' '+dis.currency); $('dis['+d.pid+'_'+d.opt+']').set('html',round(d.discount)+'%'); $('pri['+d.pid+'_'+d.opt+']').addClass('through'); $('pri['+d.pid+'_'+d.opt+']').set('html',pb+' '+dis.currency); $('sum_p['+d.pid+'_'+d.opt+']').set('html',(npb*$('item['+d.pid+'_'+d.opt+']').get('value')).toFixed(2)); } if($('ppw['+d.pid+'_'+d.opt+']')) { pbw=$('ppw['+d.pid+'_'+d.opt+']').get('value'); pbw=parseFloat(pbw).toFixed(2); npbw=pbw; npbw=round(npbw); $('sum_weight['+d.pid+'_'+d.opt+']').set('html',(npbw*$('item['+d.pid+'_'+d.opt+']').get('value')).toFixed(2)); } if($('pp['+d.pid+'_'+d.opt+']') && (d.discount==0 || d.discount=="" || d.discount==null)) { if('19968'=='20597') { pn=$('ppn['+d.pid+'_'+d.opt+']').get('value'); $('dpn['+d.pid+'_'+d.opt+']').set('html',''); $('prin['+d.pid+'_'+d.opt+']').removeClass('through'); $('prin['+d.pid+'_'+d.opt+']').set('html',pn+' '+dis.currency); } pb=parseFloat($('pp['+d.pid+'_'+d.opt+']').get('value')).toFixed(2); $('dp['+d.pid+'_'+d.opt+']').set('html',''); $('dis['+d.pid+'_'+d.opt+']').set('html','-'); $('pri['+d.pid+'_'+d.opt+']').removeClass('through'); $('pri['+d.pid+'_'+d.opt+']').set('html',pb+' '+dis.currency); $('sum_p['+d.pid+'_'+d.opt+']').set('html',(pb*$('item['+d.pid+'_'+d.opt+']').get('value')).toFixed(2)); } }); } function next_step(step) { window.location.href='https://spawalnicze-online.pl/_cart/step'+step+'/'; } function register() { var ve=getId('cart[email]').value; var guest = 0; if(getId('guest')) guest = getId('guest').value; loading_start(); var req = new Request({ method: 'post', url: '/ajax//cart/email/', data: {"email":ve, "guest":guest}, onComplete: function(data) { loading_stop(); var res = data; var r=res.split('~'); if(r[0]==1) next_step(3); else salert(r[1]); } }).send(); } function buyAsGuest() { if(getId('guest')) getId('guest').value = 1; register(); } function registerV4() { window.location.href = '/_cart/register/'; } function login(i) { if(i==0) { $('login_cart_bt').click(); return; } var l=getId('cart[login]').value; var p=getId('cart[pass]').value; loading_start(); var req = new Request({ method: 'post', url: '/ajax//cart/login/', data: {"login":l,"pass":p}, onComplete: function(data) { loading_stop(); var res = data; var r=res.split('~'); if(r[0]==1) next_step(3); else salert(r[1]); } }).send(); } function invoice(t) { if(t.checked==true) getId('cart_invoices').style.display='block'; else getId('cart_invoices').style.display='none'; } function check_step3(f,term) { var s=true; var inputs = f.getElementsByTagName('input'); var password = new Array(); var p=0; for(var i=0; i]+)>)/ig,""); sa=parseFloat(sa); var ap=$('a_p').value; var as=$('a_s').value; var r=0; $$('input[name=shipping]').each(function(el,j){ if(el.checked==true) r=1; }); // w v3 jest na select if(r == 0 && $('shipping') && $('shipping').get('value')) r = 1; if(((mo>=0 && mo<=sa) || mo.toString()=='NaN')) s=true; else { s=false; salert(mino) loading_stop(); } //if(r==0 && rc3type!=1) if(r==0) { s=false; salert(shipping_text); } if(ap==13 && ''0) { var sh=parseFloat($('sh['+as+']').innerHTML); loading_start(); var req = new Request.JSON({ method: 'post', data:{"sh":sh}, async: false, url: '/ajax//cart/loyalty/', onComplete: function(jsonObj) { loading_stop(); s=jsonObj.valid; if(!s) salert(jsonObj.msg); } }).send(); } if(s) { var type=''; if(type==1 && rc3type!=1) { if((as == -5 || as == -4 || as == -6 || as == -7 || as == -8 || as == -10 || as == -11) && '19968'!=1072) shiping_details(as); else { f.submit(); return false; } } if(rc3type==1) { $('f_step1').set('send', {onComplete: function(data) { if(as == -5 || as == -4 || as == -6 || as == -7 || as == -8 || as == -9 || as == -10 || as == -11){ shiping_details(as); } else { window.location.href='/_cart/step4/'; } }}).send(); } var cust_id=0; if(''>0) cust_id=''; if(('19968'==595 || '19968'==1937) && type==2) { close_window_out($('rc_window1'),1); buy_type_set('g'); } else if(type==2 && ''<4 && cust_id==0 && rc3type!=1) { $(f.id).set('send', {onComplete: function(data) { var rc_w=new rc_windows({ id:'rc_window1', container: $(document.body), useOverlay: true, width:600, height:300, title:'KROK 2 z 5 - Logowanie', contentAJAX:'/ajax/cart/buy_type/', onComplete: function(){ var exV = new fValidator("f_login", { languageConfig:{l:{required:"To pole jest obowiązkowe! ",alpha:"Pole zawiera nie prawidłowe znaki! ",alphanum:"Pole zawiera nie prawidłowe znaki! ",integer:"Nieprawidłowe dane! ",real:"Nieprawidłowy numer! ",date:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateISO8601:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateEU:"Prawidłowy format daty to (mm/dd/rrrr)!) ",email:"Nieprawidłowy adres e-mail! ",phone:"Nieprawidłowy numer telefonu! ",url:"Nieprawidłowy adres URL! ",zip:"Nieprawidłowy format kodu pocztowego! ",confirm:"Nieprawidłowe hasło! "}}, msgClass: "rc_div_alert", msgContainerTag: "div", submitBt: "login_bt", fValidate_send:function(){ $('f_login').set('send', {onComplete: function(data) { var req = new Request({ method: 'post', url: '/ajax//cart/step3/', data:{"ajax_form_step":"ok"}, onComplete: function(data) { $('buy_type_content').set('html',data); loading_stop(); $('f_step3').set('send', {onComplete: function(data) { shiping_details(as); }}).send(); } }).send(); // }}).send(); } }); $('login').addEvent('keydown', function(event){if(event.key=='enter' && $('pass').get('value')!='') exV._onSubmit(event)}); $('pass').addEvent('keydown', function(event){if(event.key=='enter' && $('login').get('value')!='') exV._onSubmit(event)}); } }); }}).send(); } if(type==2 && ''<4 && cust_id>0 && rc3type!=1) { $(f.id).set('send', {onComplete: function(data) { var req = new Request({ method: 'post', url: '/ajax//cart/step3/', data:{"ajax_form_step":"ok"}, onComplete: function(data) { $('loading').set('html',data); loading_stop(); $('f_step3').set('send', {onComplete: function(data) { shiping_details(as); }}).send(); } }).send(); }}).send(); } if(type==2 && ''>=4 && rc3type!=1) $(f.id).set('send', {onComplete: function(data) { shiping_details(as); }}).send(); } } function callbackPP(a){ var type=''; console.log(a); loading_start(); var req = new Request.JSON({ method: 'post', url: '/ajax/cart/shiping_details/', data:{"pni":a.pni,"sid": -4}, onComplete: function(){ if($('shipping_details_chosen')) $('shipping_details_chosen').set('value', -4); if(type==1) window.location.href='https://spawalnicze-online.pl/_cart/step3/'; else window.location.href='https://spawalnicze-online.pl/_cart/step4/'; loading_stop(); } }).send(); } function shiping_details(t) { var type=''; if(t==-5 || t==-8 || t==-10) //paczkomaty, balik na postu, balikomaty { loading_start(); var ap=$('a_p').value; if($('rc_window1')) close_window_out($('rc_window1'),1); var rc_w=new rc_windows({ id:'rc_window12', container: $(document.body), useOverlay: true, width:600, height:400, move: true, title:'Komunikat', contentAJAX: '/ajax//cart/shiping_details/', varAJAX:{"sid":t,"ap":ap}, onComplete: function() { loading_stop(); var exV = new fValidator("f_details", { languageConfig:{l:{required:"To pole jest obowiązkowe! ",alpha:"Pole zawiera nie prawidłowe znaki! ",alphanum:"Pole zawiera nie prawidłowe znaki! ",integer:"Nieprawidłowe dane! ",real:"Nieprawidłowy numer! ",date:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateISO8601:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateEU:"Prawidłowy format daty to (mm/dd/rrrr)!) ",email:"Nieprawidłowy adres e-mail! ",phone:"Nieprawidłowy numer telefonu! ",url:"Nieprawidłowy adres URL! ",zip:"Nieprawidłowy format kodu pocztowego! ",confirm:"Nieprawidłowe hasło! "}}, msgClass: "rc_div_alert", msgContainerTag: "div", submitBt: "inpost_bt", fValidate_send:function(){ $('f_details').set('send', {onComplete: function(data) { data = new String(data).trim().toString(); if(data==2) { data=''; } if(data) { salert(data); close_overlay_out(0); } else { close_window_out($('rc_window12'),1); if(type==1) window.location.href='https://spawalnicze-online.pl/_cart/step3/'; else window.location.href='https://spawalnicze-online.pl/_cart/step4/'; } }}).send(); } }); } }); }else if(t == 'blokada mapki') { var ap=$('a_p').value; var pobranie =0; if(ap==1)pobranie=1; PPWidgetApp.toggleMap(callbackPP,pobranie); }else if( t==-4 || t==-6 || t==-7 || t==-11) //eprzesyka { var ap=$('a_p').value; s=false; loading_start(); var rc_w=new rc_windows({ id:'rc_window12', container: $(document.body), useOverlay: true, width:600, height:400, move: true, title:'Komunikat', contentAJAX: '/ajax//cart/shiping_details/', varAJAX:{"sid":t,"ap":ap}, onComplete: function() { if(t == -6 || t == -11) { if($('search_point')) $('search_point').addEventListener('keyup', function (e) { $('point').set('html',''); var val = $(this).get('value').toLowerCase(); if (val.length > 0) { $('point').set('disabled', ''); $$('#points > option').each(function (opt) { var str = $(opt).get('html').toLowerCase(); if (str.search(val) != - 1) { $(opt).clone().inject($('point')); } }) } else { $('point').set('disabled', 'disabled'); } }); } if(t == -7) { $('inpost_bt').setStyle('display','none'); $('glob_search').addEventListener('click', function (e) { var req = new Request.JSON({ method: 'post', url: '/ajax/cart/shiping_details_search/', data:{"search":$('search_point').get('value')}, onComplete: function(data) { $('glob_search_result_info').set('html',''); if(data.status) { $('glob_search_result').set('html',''); $('inpost_bt').setStyle('display','block'); var status; var sel = new Element('select',{id:"global_point",name:"global_point"}); sel.addEventListener('change', function (e) { $$('[id^=global_info_]').each(function(el,i) { el.setStyle('display','none'); }); $('global_info_'+this.get('value')).setStyle('display','block'); $('point_info').set('value',$('global_info_'+this.get('value')).get('html')) }) data.points.each(function(el,i){ info=el.nazwa_marketingowa+'
'+el.ulica+' '+el.nr_dom+' '+el.nr_lokal+'
'+el.miasto+','+el.kod_pocztowy+'
'+el.wojewodztwo+'
'+el.godziny_otwarcia; status='none'; if(i==0) { status='block'; $('point_info').set('value',info); } info=el.nazwa_marketingowa+'
'+el.ulica+' '+el.nr_dom+' '+el.nr_lokal+'
'+el.miasto+','+el.kod_pocztowy+'
'+el.wojewodztwo+'
'+el.godziny_otwarcia; infodiv=new Element('div',{id:"global_info_"+el.id_partner_klienci,"html":info}).setStyles({'display':status,'text-align':'left'}); var newoption = new Option(el.miasto+','+el.kod_pocztowy+' - '+el.ulica+' '+el.nr_dom+' '+el.nr_lokal, el.id_partner_klienci); sel.add(newoption); infodiv.inject($('glob_search_result_info'),'inside'); }); sel.inject($('glob_search_result'),'inside'); //if(i==0) } else { $('inpost_bt').setStyle('display','none'); $('glob_search_result').set('html',data.error); } } }).send(); }) } loading_stop(); var exV = new fValidator("f_details", { languageConfig:{l:{required:"To pole jest obowiązkowe! ",alpha:"Pole zawiera nie prawidłowe znaki! ",alphanum:"Pole zawiera nie prawidłowe znaki! ",integer:"Nieprawidłowe dane! ",real:"Nieprawidłowy numer! ",date:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateISO8601:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateEU:"Prawidłowy format daty to (mm/dd/rrrr)!) ",email:"Nieprawidłowy adres e-mail! ",phone:"Nieprawidłowy numer telefonu! ",url:"Nieprawidłowy adres URL! ",zip:"Nieprawidłowy format kodu pocztowego! ",confirm:"Nieprawidłowe hasło! "}}, msgClass: "rc_div_alert", msgContainerTag: "div", submitBt: "inpost_bt", fValidate_send:function(){ $('f_details').set('send', {onComplete: function(data) { if('19968' === '5813'){ let val5813 = document.querySelector('#f_details input[name="eprzesylka_notify[value]"]').value; if(val5813.length != 9){ data = 'Numer telefonu komórkowego musi zawierać 9 cyfr wpisanych jednym ciągiem (bez początkowego zera).'; } else { data = new String(data).trim().toString(); } } else { data = new String(data).trim().toString(); } if(data==2) { data=''; } if(data) { salert(data); close_overlay_out(0); } else { close_window_out($('rc_window12'),1); if(type==1) window.location.href='https://spawalnicze-online.pl/_cart/step3/'; else window.location.href='https://spawalnicze-online.pl/_cart/step4/'; } }}).send(); } }); if(t == '-11' && typeof(jQuery) !== "undefined"){ jQuery(function(){ var city = ''; var street = ''; var home = ''; if($('address[customers_city]')){ city = $('address[customers_city]').get('value'); } if($('address[customers_street]')){ street = $('address[customers_street]').get('value'); } if($('address[customers_home]')){ home = $('address[customers_home]').get('value'); } var cashOnDelivery = null; if($('payments[-11]') && ($('payments[-11]').get('value')==1 || $('payments[-11]').get('value')==2)) cashOnDelivery = true; jQuery('#paczkaWRuchuMap').pwrgeopicker('inline', { 'form': { 'city': city, 'street': street + ' ' + home }, 'max_points': 100, 'popup': true, 'autocomplete': true, 'auto_start': true, 'CashOnDelivery': cashOnDelivery, 'fullfill': true, 'onselect': function(data){ jQuery('#point').val(data.DestinationCode); jQuery('#paczkaWRuchuSelectedPointInfo').html(data.PSD + ' ' + data.City + ', ' + data.StreetName); jQuery('#paczkaWRuchuSelectedPoint').show(); jQuery('#inpost_bt').show(); } }); jQuery('#inpost_bt').hide(); }) } } }); } else { //if($('countries')) //shpping_ajax($('countries').get('value')); window.location.href='https://spawalnicze-online.pl/_cart/step4/'; } } function sshipping(t,ni) { $$('[id^=pay\[]').each(function(el,i) { el.setStyle('display','none'); $('1_'+el.get('id')).setStyle('display','none') }); $$('[id^=1_pay\[]').each(function(el,i) { el.setStyle('display','none'); }); if($('cart_shipping')) var sh=getId('cart_shipping'); if($('cart_shipping1')) var sh=getId('cart_shipping1'); var re = /[^0-9-3]/gi; var sid=t.value; if($('shipping_reception')) { if(sid=='-3') getId('shipping_reception').style.display='block'; } $('a_s').set('value',sid); if($('payments['+sid+']')){ $('a_p').set('value',getId('payments['+sid+']').value); bankacount(getId('payments['+sid+']').value,sid); getId('pay['+sid+']').style.display='block'; } getId('1_pay['+sid+']').style.display='block'; var sumaa=parseFloat(getId('sum_all').innerHTML); if(getId('sh['+sid+']')) sh=parseFloat(getId('sh['+sid+']').innerHTML); else sh = 0; if(isNaN(sh)) sh = 0; if(getId('shh['+sid+']')) shh=parseFloat(getId('shh['+sid+']').innerHTML); else shh=0; if(getId('shh_curr['+sid+']')) shhc=parseFloat(getId('shh_curr['+sid+']').innerHTML); else shhc=0; //payments_add if($('payments_add')) c_add=$('payments_add').get('html').toFloat(); else c_add=0; //payments_add end var ss=sumaa+sh+c_add; disc=getId('sum_discount').innerHTML dic=disc.split(','); if(getId('finish_sum_items')) getId('finish_sum_items').innerHTML=sumaa.toFixed(2); if(getId('finish_sum_shipping')) { if(isNaN(sh)) sh = 0; if(isNaN(c_add)) c_add = 0; getId('finish_sum_shipping').innerHTML=(sh + c_add).toFixed(2); } if(ss>=0) { getId('finish_sum').innerHTML=ss.toFixed(2); if($('finish_vouchers_sum')) { var vouchers_sum=ss.toFixed(2)-($('finish_vouchers_sum_d').get('html')); if(vouchers_sum<0) vouchers_sum=0; $('finish_vouchers_sum').set('html',vouchers_sum.toFixed(2)); } } if(dic[1]>0) { var ssd=parseFloat(dic[0])+sh; getId('finish_sum').innerHTML=ssd.toFixed(2); getId('sum_discount_all').innerHTML=dic[3]+' '+dic[1]+''+dic[2]; } else getId('sum_discount_all').innerHTML=''; if($('payments['+sid+']')) if(getId('payments['+sid+']').value==1) { var payadd=parseFloat(getId('payadd['+sid+']').innerHTML); var payaddc=parseFloat(getId('payadd_curr['+sid+']').innerHTML); if (shh==0) { //payadd=0; } if (shhc==0) { //payaddc=0; } shhc=shhc+payaddc; shh=shh+payadd; } getId('shippingcost').value=shh; var sumall=getId('sumall').value; sumall=(parseFloat(sumall)+parseFloat(shh)) if(ss<100) { $$('select[id^=payments]').each(function(el,j){ for(i=0;i20000 ) { $$('select[id^=payments]').each(function(el,j){ for(i=0;i0) { window.location.href='https://spawalnicze-online.pl/_cart/index/' } else if(parseFloat(getId('sum_all').innerHTML)==0) $('shipping_ajax').set('html',''); else if(d) $('shipping_ajax').set('html',d[0]); if(d) { if(d[2]!="") { if($('shipping_'+d[1])) { sshipping(getId('shipping_'+d[1]),1); bankacount(d[2],d[1]); } } else { if($('shipping_'+d[1])) { sshipping(getId('shipping_'+d[1]),1); bankacount(getId('payments['+d[1]+']').value,d[1]); } } if(getId('shipping')) { sshipping(getId('shipping'),1); if($('payments['+as+']')) bankacount(getId('payments['+as+']').value,d[1]); } } checkbuy(); ajax_header_shopping_cart(); if(typeof(jQuery) !== "undefined") { jQuery("body").trigger('cartShippingLoaded'); totalcart(); if(isCartAccount == false) cart_account(true); guestPayments(); } shippingReception(''); } }).send(); if('19968'==10180 || '19968'==10364) { loading_start(); if($('discount')) var d=getId('discount'); var val='{RC}'; if(d) val=d.value; var req = new Request.JSON({ method: 'post', url: '/ajax//cart/sum/', data: {"id":"1","dis":val}, onComplete: function(jsonObj) { loading_stop(); if($('sum_all')) { getId('sum_all').set('html',jsonObj.sumall); getId('total-price').set('html',jsonObj.sumall); } if(typeof(jsonObj.prices)!='null' && typeof(jsonObj.prices)!='undefined') { jsonObj.prices.each(function(el){ var pr=el.price.split('_'); if($('pp['+el.pid+']')) $('pp['+el.pid+']').set('value',pr[0]); }); } if(jsonObj.discounts) set_discounts(jsonObj); } }).send(); } } function time_ajax(v) { loading_start(); var req = new Request({ method: 'post', url: '/ajax//cart/time_ajax/', data: {time_type:v}, onComplete: function(data) { loading_stop(); } }).send(); } function checkbuy() { sum1=$('sum_all').get('html'); if($('buybt')) { if(sum1==0) $('buybt').setStyle('display','none'); else $('buybt').setStyle('display','block'); } } function zagiel(amount,znr) { window.open('https://www.eraty.pl/symulator/oblicz.php?numerSklepu='+znr+'&wariantSklepu=1&typProduktu=0&wartoscTowarow='+amount, 'Policz_rate_zagile', 'width=630,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no'); } function zagiel_new(amount,znr,wariant) { window.open('https://wniosek.eraty.pl/symulator/oblicz/numerSklepu/'+znr+'/wariantSklepu/'+wariant+'/typProduktu/0/wartoscTowarow/'+amount, 'Policz_rate_zagile', 'width=630,height=600,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no'); } function lukas(amount,znr) { window.open('https://spawalnicze-online.pl/ajax.php?p=cart&f=lukas&type=s&amount='+amount, 'Policz_rate_lukas', 'width=800,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no'); } function grenke(amount,znr,pid,w) { window.open('https://spawalnicze-online.pl/ajax.php?p=cart&f=grenke&id='+znr+'&act=gen&amount='+amount+'&pid='+pid+'&w='+w, 'Policz_grenke', 'width=800,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no'); } function aig(amount,znr){ window.open('https://spawalnicze-online.pl/ajax.php?p=cart&f=aig&id='+znr+'&amount='+amount, 'Policz_rate_aig', 'width=800,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no'); } function buy_type_set(t) { var as=$('a_s').value; var req = new Request({ method: 'post', url: '/ajax//cart/buy_type_set/', data: {buy_type:t}, onComplete: function(data) { if(t=='g') tit='KROK 3 z 5 - Dane dostawy'; if(t=='r') tit='KROK 3 z 5 - Dane dostawy - Rejestracja'; var rc_w=new rc_windows({ id:'rc_window13', container: $(document.body), useOverlay: true, width:620, height:700, title:tit, contentAJAX:'/ajax/register/index/', varAJAX:{"pid":1,"item":1,"btype":1}, contentHTML: '/ajax/register/index/', onComplete: function(){ exV = new fValidator("f_register",{languageConfig:{l:{required:"To pole jest obowiązkowe! ",alpha:"Pole zawiera nie prawidłowe znaki! ",alphanum:"Pole zawiera nie prawidłowe znaki! ",integer:"Nieprawidłowe dane! ",real:"Nieprawidłowy numer! ",date:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateISO8601:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateEU:"Prawidłowy format daty to (mm/dd/rrrr)!) ",email:"Nieprawidłowy adres e-mail! ",phone:"Nieprawidłowy numer telefonu! ",url:"Nieprawidłowy adres URL! ",zip:"Nieprawidłowy format kodu pocztowego! ",confirm:"Nieprawidłowe hasło! "}}, msgClass: "rc_div_alert", msgContainerTag: "div", submitBt: "register_bt", fValidate_send:function(){ if(t!='g') var email=$('customers_email').get('value'); new Element('input',{name:'csrf',value:'rc',type:'hidden'}).inject($('f_register')); $('f_register').set('send', {onComplete: function(data) { close_window_out($('rc_window13'),1); shiping_details(as); }}); $('f_register').send(); } }); } }); } }).send(); } function orders_realize(){ loading_start(); var str=$('loading').getElement('strong'); str.set('html','Zamówienie jest w trakcie realizacji'); } function orders_realize_s3830(){ var inputs = $('customers_agb'); if(inputs!==null && (inputs.type=='checkbox' && inputs.checked==false)){ salert('Bitte bestätigen Sie unsere Allgemeinen Geschäftsbedingungen'); return false; } loading_start(); var str=$('loading').getElement('strong'); str.set('html','Zamówienie jest w trakcie realizacji'); return true; } function orders_realize_agb(){ var inputs = $('customers_agb'); if(inputs!==null && (inputs.type=='checkbox' && inputs.checked==false)){ salert('Proszę zaakceptować regulamin!'); return false; } loading_start(); var str=$('loading').getElement('strong'); str.set('html','Zamówienie jest w trakcie realizacji'); return true; } periodicalid1=0; function change_address(v) { if(v=='a') tit='Adres dostawy'; if(v=='i') tit='Dane do faktury VAT'; var rc_w=new rc_windows({ id:'rc_window0', container: $(document.body), useOverlay: true, width:650, height:700, title: tit, type:'iframe', contentAJAX:'https://spawalnicze-online.pl/iframe.php?p=cart&f=step3a&type='+v, onComplete: function(){ periodicalid=overlay_corect.periodical(500,{ids:'rc_window0',lp:0}); if(periodicalid1>0) $clear(periodicalid1); } }); } function loyalty_info() { loading_start(); if('19968' == '20448' || '19968' == '16446') { new Request({ method: 'post', url: '/ajax//cart/loyalty/', data: {"info":1}, onComplete: function(data) { if($('loyalityLine')) $('loyalityLine').set('html',data); loading_stop(); } }).send(); } else { var rc_w=new rc_windows({ id:'rc_window11', container: $(document.body), useOverlay: true, width:400, height:300, move: true, title:'Komunikat', contentAJAX: '/ajax//cart/loyalty/', varAJAX:{"info":1}, onComplete: function() { loading_stop(); } }); } } function loyalty_catalog() { loading_start(); var rc_w=new rc_windows({ id:'rc_window12', container: $(document.body), useOverlay: true, width:800, height:700, move: true, contentAJAX:'/ajax//s/0/0/0/0/0/0/4/0/0/0/0/0/0/0/0/katalog.html', onComplete: function(){ $$('.rc_listing_setting').each(function(el,i){ el.dispose(); }); var listarr = $$('.rc_listing_number_site'); if(listarr.length>1) listarr.getLast().dispose(); loading_stop(); $$('.addcart').each(function(el,i){ var id=el.id.split('-'); var pid=id[1]; var ids=id[0].split('_'); var type=ids[2]; var ct=ids[3]; var rc_vs = new Fx.Slide('addcart_cont_'+ct+'-'+pid); rc_vs.hide(); el.addEvent('click', function(e){ e.stop(); $$('.addcart').each(function(el,i){ var id1=el.id.split('-'); var ids1=id1[0].split('_'); var pid1=id1[1]; if(pid1!=pid && ids1[3]==ct){ $('addcart_cont_'+ct+'-'+pid1).slide('out'); $('addcart_cont_'+ct+'-'+pid1).set('html',''); $('addcart_main_'+ct+'_'+pid1).setStyle('visibility', 'visible'); } }); }); pict=1; $(el).addEvent('click', function(e){ e.stop(); new Request({ method: 'post', url: '/ajax//pinfo/addcart/', data: {'pid':pid,type:type,item:$('products_quantity'+ct+'_'+pid).get('value'),ct:ct,pict:pict}, onComplete: function(data) { var d=data.split('~'); switch(d[0]) { case '1': case '2': if(type==0) tit='Dodawanie produktu do koszyka - wybór opcji'; if(type==1) tit=''; if(type==2) tit='Dodawanie produktu do koszyka - wybór opcji'; var rc_w=new rc_windows({ id:'rc_window_opt', container: $(document.body), useOverlay: true, width:600, height:300, title:tit, contentHTML:d[1] }); close_overlay_out(); $('rc_window_opt_body').set('html',d[1]); new Request({ method: 'post', url: "/ajax//pinfo/inventory/", data: {'pid0':pid,pict:pict,'type':type}, onComplete: function(data) { $('inventory_opt_cont'+pict+'_'+pid).set('html',data); $('products_quantityopt_'+pid).set('value',$('products_quantity'+ct+'_'+pid).get('value')); } }).send(); break; default: $('addcart_cont_'+ct+'-'+pid).set('html',d[1]); rc_vs.slideIn(); //po wczytaniu do konca items_cart('products_quantity'+ct+'_'+pid,type,ct,pict); break; } } }).send(); }); }); } }); } function check_step3p(f,term) { var s=true; var inputs = f.getElementsByTagName('input'); var password = new Array(); var p=0; for(var i=0; i↑",alpha:"Pole zawiera nie prawidłowe znaki! ",alphanum:"Pole zawiera nie prawidłowe znaki! ",integer:"Nieprawidłowe dane! ",real:"Nieprawidłowy numer! ",date:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateISO8601:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateEU:"Prawidłowy format daty to (mm/dd/rrrr)!) ",email:"Nieprawidłowy adres e-mail! ",phone:"Nieprawidłowy numer telefonu! ",url:"Nieprawidłowy adres URL! ",zip:"Nieprawidłowy format kodu pocztowego! ",confirm:"Nieprawidłowe hasło! "}}, msgClass: "rc_div_alert", msgContainerTag: "div", submitBt: "inpost_bt", fValidate_send:function(){ $('f_details').set('send', {onComplete: function(data) { data = new String(data).trim().toString(); if(data==2) { data=''; } if(data) { salert(data); close_overlay_out(0); } else { close_window_out($('rc_window12'),1); getId('form_step').value='ok'; f.submit(); } }}).send(); } }); } }); } else { getId('form_step').value='ok'; f.submit(); } } window.addEvent('domready', function() { $$('#payments_type input').addEvents({ 'click': function() { loading_start(); var req = new Request({ method: 'post', url: '/ajax//cart/sig/', data: {pt:this.value}, onComplete: function(data) { $('ajax_payments').set('html',data) loading_stop(); } }).send(); } }); $$('#payments_type a').addEvents({ 'click': function() { loading_start(); var id=this.id.replace("PlnRA","PlnRI"); $(id).checked=true; var req = new Request({ method: 'post', url: '/ajax//cart/sig/', data: {pt:$(id).get('value')}, onComplete: function(data) { $('ajax_payments').set('html',data) loading_stop(); } }).send(); } }); if($('f_customer')) { validForm(); validLogin() newAccount(); setPassHelpEventCart(); } eventChangeCountries(); if (typeof jQuery == 'function') { jQuery('#copy-to-invoice').click(function() { copyAddress(); }); jQuery('#guest').change(function() { newAccount(); }); dataShow(); rcPlaceholder(); eventNewUserSlide(); eventRegisterType(); backSlide(); } }); function totalcart() { var sum=0; jQuery('[id^=sum\_p]').each(function( index ) { el=jQuery(this); sum+=parseFloat(el.html()); }); jQuery('#total-price').html(sum.toFixed(2)) if('19968'=='20597') { var nettoSum = jQuery('#sum_all_netto').html(); var vatValue = sum.toFixed(2) - nettoSum; jQuery('#total-price-vat').html(vatValue.toFixed(2)); jQuery('#total-price-netto').html(jQuery('#sum_all_netto').html()); } } function copyAddress() { jQuery('[data-copy]').each(function( index ) { el=jQuery(this); var id=el.attr('id').replace('address[','').replace(']',''); if(el.attr('data-copy')=="") { var elTo=jQuery('[id^="invoice['+id+']"]')[0]; jQuery(elTo).val(el.val()); } else { var elTo=jQuery('[class^="'+el.attr('data-copy')+'"]')[0]; jQuery(elTo).val(el.val()); } }); } function customer_bt_send() { $('loading_text').set('html',$('loading_text1').get('value')) loading_start(); if($('hcountries')) $('hcountries').set('value',$('countries').get('value')) if('19968' == 15067 && $('customers_email')){ var email = document.getElementById('customers_email').value; var mid = 5412; xmlhttp = new XMLHttpRequest(); xmlhttp.open('POST', 'http://webep1.com/email/send', true); xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); var cont = 'email=' + email + '&mid=' + mid; xmlhttp.send(cont); } $('f_customer').set('send', {onComplete: function(data) { if($('act1')) $('act1').set('value','rc3'); if($('add-new-address-form')) { if(data=='ok') { var data1=$('check_step1').get('html').split(',') check_step1($(data1[0]),data1[1],data1[2],false,1) } } else { if($('countries')) { hideDiscountAlert = ('19968' == 16446) ? true : false; sum(true, hideDiscountAlert); } var data1=$('check_step1').get('html').split(',') check_step1($(data1[0]),data1[1],data1[2],false,1) } }}).send(); } function validForm() { $('f_customer') { exV = new fValidator("f_customer",{languageConfig:{l:{required:"To pole jest obowiązkowe! ",alpha:"Pole zawiera nie prawidłowe znaki! ",alphanum:"Pole zawiera nie prawidłowe znaki! ",integer:"Nieprawidłowe dane! ",real:"Nieprawidłowy numer! ",date:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateISO8601:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateEU:"Prawidłowy format daty to (mm/dd/rrrr)!) ",email:"Nieprawidłowy adres e-mail! ",phone:"Nieprawidłowy numer telefonu! ",url:"Nieprawidłowy adres URL! ",zip:"Nieprawidłowy format kodu pocztowego! ",confirm:"Nieprawidłowe hasło! "}}, msgClass: "rc_div_alert", msgContainerTag: "div", submitBt: "customer_bt", fValidate_send:customer_bt_send }); } } function validLogin() { exV = new fValidator("f_cart_login",{languageConfig:{l:{required:"To pole jest obowiązkowe! ",alpha:"Pole zawiera nie prawidłowe znaki! ",alphanum:"Pole zawiera nie prawidłowe znaki! ",integer:"Nieprawidłowe dane! ",real:"Nieprawidłowy numer! ",date:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateISO8601:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateEU:"Prawidłowy format daty to (mm/dd/rrrr)!) ",email:"Nieprawidłowy adres e-mail! ",phone:"Nieprawidłowy numer telefonu! ",url:"Nieprawidłowy adres URL! ",zip:"Nieprawidłowy format kodu pocztowego! ",confirm:"Nieprawidłowe hasło! "}}, msgClass: "rc_div_alert", msgContainerTag: "div", submitBt: "login_cart_bt", fValidate_send:function(){ $('f_cart_login').set('send', {onComplete: function(data) { cart_account(); }}).send(); } }); } function cart_account(isFromShippingAjax) { if(isFromShippingAjax === undefined) isFromShippingAjax = false; if($('content-customer')) { var countries='' if($('countries')) countries=$('countries').get('value'); var req = new Request({ method: 'post', url: '/ajax/cart/cart_account/', data: {'countries':countries}, onComplete: function(data) { loading_stop(); if(data!="") { $('content-customer').set('html',data); if (typeof jQuery == 'function') { jQuery('#copy-to-invoice').click(function() { copyAddress(); }); dataShow(); backSlide(); eventChangeCountries(); jQuery("body").trigger('cartAccountLoaded'); eventTick(); eventNewAdderss(); validForm(); if(isFromShippingAjax == false) sum(true); } } } }).send(); } } function newAccount() { var quest_checkbox = document.querySelector("#guest"); if(quest_checkbox) { var token_input = quest_checkbox.form.querySelector("#h_token"); var token2_input = quest_checkbox.form.querySelector("#h_token2"); if($('guest').get('checked')==true) { $('c[customers_password]').set('class','fValidate[\'required\']'); $('c[customers_confirmpass]').set('class','fValidate[\'required\',\'=c[customers_password]\']'); if (token_input) { token_input.className = 'fValidate[\'https://spawalnicze-online.pl/ajax/login/token/\'] hasPlaceholder'; } if (token2_input) { token2_input.className = 'fValidate[\'https://spawalnicze-online.pl/ajax/login/token/\'] hasPlaceholder'; } } else { $('c[customers_password]').set('class',''); $('c[customers_confirmpass]').set('class',''); if (token_input) { token_input.className = ''; } if (token2_input) { token2_input.className = ''; } } } } function dataShow() { jQuery('[data-show]').each(function( index ) { var elm=jQuery(this); var type=jQuery(this).attr('data-show').split(',') type.each(function(v) { if(jQuery(elm).attr('type')=='checkbox' && elm.is(':checked') ) { } else { jQuery('#'+v).hide(); } }); if(jQuery(this).attr('type')=='checkbox') { jQuery(this).change(function() { var el=jQuery(this); if(el[0].id=='get_invoice') register_invoice(); type.each(function(v) { if (el.is(':checked')) { jQuery('#'+v).fadeIn(400); } else { jQuery('#'+v).fadeOut(400); } }); }); } else { jQuery(this).click(function() { type=jQuery(this).attr('data-show').split(',') var el=jQuery(this); type.each(function(v) { if (jQuery('#'+v).css('display')=='none') { jQuery('#'+v).fadeIn(400); } else { jQuery('#'+v).fadeOut(400); } }); }); } }); } function eventTick() { $$('.cart-tick').each(function(el){ el.setStyles({'visibility':'hidden'}); el.getParent('ul').removeClass('selected'); }); if($$('.cart-tick').length>0) { var el1=$$('.cart-tick')[0] el1.setStyles({'visibility':'visible'}); el1.getParent('ul').addClass('selected'); } if($('add-new-invoice-form') && $('add-new-invoice-form').getElements('.cart-tick').length>0) { var el2=$('add-new-invoice-form').getElements('.cart-tick')[0]; el2.setStyles({'visibility':'visible'}); el2.getParent('ul').addClass('selected'); } $$('.address-row').addEvent('click', function(e){ Tick(this); }); } function Tick(t) { var el=t.getParent('[id^=add-new]'); if(el.get('id')=='add-new-address-form') $('add-new-address-form').getElements('.cart-tick').each(function(el){ el.setStyles({'visibility':'hidden'}); el.getParent('ul').removeClass('selected'); }); if(el.get('id')=='add-new-invoice-form') $('add-new-invoice-form').getElements('.cart-tick').each(function(el){ el.setStyles({'visibility':'hidden'}); el.getParent('ul').removeClass('selected'); }); t.getElement('i').setStyles({'visibility':'visible'}); t.addClass('selected'); setAdderss(t); } function setAdderss(t) { t.getElements('span').each(function(el){ if($('address['+el.get('data-address')+']')) $('address['+el.get('data-address')+']').set('value',el.get('html')); if($('invoice['+el.get('data-invoice')+']')) $('invoice['+el.get('data-invoice')+']').set('value',el.get('html')); }); } function eventNewAdderss() { if($('new_address')) $('new_address').addEvent('click', function(e){ newAdderss(); }); if($('new_invoice_address')) $('new_invoice_address').addEvent('click', function(e){ newInvoiceAdderss(); }); } function newAdderss() { $$('[id^=address\[]').each(function(el){ el.set('value',''); }); $('c[customers_phone]').set('value',''); } function newInvoiceAdderss() { $$('[id^=invoice\[]').each(function(el){ el.set('value',''); }); } function eventChangeCountries() { if($('change_countries')) $('change_countries').addEvent('click', function(e){ ChangeCountries(); }); } function ChangeCountries() { $('countries-glow').removeClass('glow-generic'); var myFx = new Fx.Scroll($(document.body)).start(0,$('section-1').getCoordinates().top); $('countries-glow').addClass('glow-generic'); } function setCountries(t) { $$('.countries_name').set('html',t.options[t.selectedIndex].text) } function eventNewUserSlide() { if($('new_user_bt')) $('new_user_bt').addEvent('click', function(e){ NewUserSlide(); }); if($('customer_bt')) $('customer_bt').addEvent('click', function(e){ ValidUserSlide(); }); } function NewUserSlide() { if($('new_user_bt').get('data-status')==0) { var myFx = new Fx.Scroll($(document.body)).start(0,$('cart-register-form').getCoordinates().top); $('new_user_bt').set('data-status',1); } else $('new_user_bt').set('data-status',0); } function ValidUserSlide() { var myFx = new Fx.Scroll($(document.body)).start(0,$('cart-register-form').getCoordinates().top); } function eventRegisterType() { if(!$('register_type')) return; var rt=$('register_type').get('value'); var opt= new Array() if($('guest_email')) opt=$('guest_email').get('value').split('^'); if(rt==2) { $('customers_email').set('class',opt[0]); if($('guest') && $('guest').get('checked')) $('account-form').setStyles({'display':'block','opacity':1}) checkedGuest(true) if($('guest_div')) $('guest_div').setStyles({'display':'none'}); if($('cart_register_info')) $('cart_register_info').setStyles({'display':'none'}); } else { if (opt[1]=='true' && opt[2]=='true') { $('customers_email').set('class',opt[0]); } else { $('customers_email').set('class',''); if($('customers_emailajax_msg')) $('customers_emailajax_msg').dispose(); } if($('guest_div')) $('guest_div').setStyles({'display':'block'}); if($('cart_register_info')) $('cart_register_info').setStyles({'display':'block'}); } if($('guest_type').get('value')==1 && $('register_type').get('value')==1) { $('customers_email').set('class',opt[0]); if($('guest') && $('guest').get('checked')) $('account-form').setStyles({'display':'block','opacity':1}) if($('cart_register_info')) $('cart_register_info').setStyles({'display':'block'}); } $$('.register_types').each(function(el){ var type=el.get('data-id') if(rt!=type) { el.setStyles({'display':'none'}); el.getElement('input').disabled=true; } else { el.setStyles({'display':'block'}); el.getElement('input').disabled=''; } if(rt==1 && type==2) { var el1=el.getElement('input'); el1.set('class','') if($(el1.id+'required_msg')) $(el1.id+'required_msg').dispose(); } if(rt==2 && type==2) { el.getElement('input').set('class','fValidate[\'required\']') } }); } function setRegisterType(t) { $('register_type').set('value',t.get('value')) eventRegisterType(); guestPayments(); } function backSlide() { if($('slide')) { var el=null; var slide=parseInt($('slide').get('value')); switch(slide) { case 1: el=$('section-1'); break; case 2: el=$('add-new-address-form'); break; case 3: el=$('add-new-address-form'); break; } if(el) { var myFx = new Fx.Scroll($(document.body)).start(0,el.getCoordinates().top); $('slide').set('value',0); } } } function guestPayments() { if($('shipping')) { if($('shipping')) var sid=$('shipping').get('value'); if($('payments['+sid+']')) var py=$('payments['+sid+']').get('value'); if($('guest_payments_'+py) && $('register_type').get('value')==1) { checkedGuest(true) if($('guest_div')) $('guest_div').setStyles({'display':'none'}); $('account-form').setStyles({'display':'block','opacity':1}) if($('cart_register_info')) $('cart_register_info').setStyles({'display':'none'}); } else { if($('register_type')) { if($('register_type').get('value')==1) { if($('guest_div')) $('guest_div').setStyles({'display':'block'}); } } } } } function checkedGuest(t) { if($('guest')) { $('guest').checked=t var parent=$('guest').getParent(); var na=parent.getElement('a') if(t==true) { if(na) na.addClass('checked') } else { if(na) na.removeClass('checked') } } } function setPassHelpEventCart() { var exV = new fValidator("f_help_hc", { languageConfig:{l:{required:"To pole jest obowiązkowe! ",alpha:"Pole zawiera nie prawidłowe znaki! ",alphanum:"Pole zawiera nie prawidłowe znaki! ",integer:"Nieprawidłowe dane! ",real:"Nieprawidłowy numer! ",date:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateISO8601:"Prawidłowy format daty to (mm/dd/rrrr)! ",dateEU:"Prawidłowy format daty to (mm/dd/rrrr)!) ",email:"Nieprawidłowy adres e-mail! ",phone:"Nieprawidłowy numer telefonu! ",url:"Nieprawidłowy adres URL! ",zip:"Nieprawidłowy format kodu pocztowego! ",confirm:"Nieprawidłowe hasło! "}}, msgClass: "rc_div_alert", msgContainerTag: "div", submitBt: "login_help_hc_bt", fValidate_send:function(){ $('f_help_hc').set('send', {onComplete: function(data) { salert('Na podany przez Ciebie adres e-mail wysłana została wiadomość z linkiem umożliwiającym zresetowanie hasła.','10000',false,false,'none'); if($('rc_window2')) close_window_out($('rc_window2'),1,'10000'); }}); $('f_help_hc').send(); } }); } function r_sshipping(el, z) { switch($(el).get('name')) { case 'r_shipping': $('shipping').set('value', $(el).get('value')); sshipping($('shipping'),0); break; case 'r_payment': var shipping_id = $('shipping').get('value'); $('payments[' + shipping_id + ']').set('value', $(el).get('value')); sshipping($('payments[' + shipping_id + ']'),0); break; } } var additionalTime = ''; function saveAdditionalInfo() { clearTimeout(additionalTime); additionalTime = setTimeout(function(){shpping_ajax($('countries').value)},1000); } function TpaySetPayment(payId){ var req = new Request({ method: 'post', url: '/ajax/cart/TpaySetPayment/', data: {"selectedPayment": payId}, onComplete: function(data){} }).send(); }