PeriodicalExecuter = new Class({ // name: 'PeriodicalExecuter', initialize: function(callback, frequency) { this.callback = callback; this.frequency = frequency; this.currentlyExecuting = false; this.registerCallback() }, registerCallback: function() { this.stop(); this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); return this }, execute: function() { this.callback(this); return this }, stop: function() { if (!this.timer) return this; clearInterval(this.timer); this.timer = null; return this }, onTimerEvent: function() { if (!this.currentlyExecuting) { try { this.currentlyExecuting = true; this.execute(); } finally { this.currentlyExecuting = false; } } return this } }); var CountDown = new Class({ /* options: { onChange: $empty, onComplete: $empty, date: null, frequency: 1000 //define the update frequency (in ms), default to 1000 }, */ Implements: [Options, Events], initialize: function (options) { this.setOptions(options); if(!this.options.date instanceof Date) this.options.date = new Date(this.options.date); this.timer = new PeriodicalExecuter(this.update.bind(this), (this.options.frequency || 1000) / 1000); }, stop: function () { this.timer.stop(); return this }, start: function () { this.timer.registerCallback(); return this }, update: function () { var millis = Math.max(0, this.options.date.getTime() - new Date().getTime()), time = Math.floor(millis / 1000), stop = time == 0, countdown = { days: Math.floor(time / (60 * 60 * 24)), time: time, millis: millis }; time %= (60 * 60 * 24); countdown.hours = Math.floor(time / (60 * 60)); time %= (60 * 60); countdown.minutes = Math.floor(time / 60); countdown.second = time % 60; this.fireEvent('onChange', countdown); if(stop) { this.timer.stop(); this.fireEvent('onComplete'); } } }); function show_div(div) { var div2 = document.getElementById(div); if(div2.style.display == 'none') div2.style.display = 'block'; else div2.style.display = 'none'; } function send_form_pinfo_9182(f,text) { var ok=false; var sels=''; var i=0 var elementsToSends = 0; try{ $$('.addcartcross').each(function(el,i){ var s=true; var id=el.id.split('_'); var pid=id[1]; if($('products_quantity_'+pid)) if($('products_quantity_'+pid).get('value')!='' && $('products_quantity_'+pid).get('value')!=0) { ok=false; //alert(pid); elementsToSends += 1; sels = getId('cross2_'+pid).getElementsByTagName('select'); s=true; for(i=0; i0)) qua=1; else qua=obj.value; var f=getId('price_produsts_info'); var fonts = f.getElementsByTagName('font'); f.className='view_price_shipping'; var arr = new Array(); var counter=0; var curr; for(var j=0; j0) mySlide.set(0); href=$('link_img_main').href; var src=$('img_main').src.replace(/thumb\/([^\/]+)\/([^\/]+)\/([^\/]+)\//, "thumb//0/0/"); var zimg = Asset.images([src], { onComplete: function(){ sv=Math.floor((zimg[0].width/$('image_zamk').getStyle('width').toInt()))*80; mySlide.steps=sv; } }); } } function check_com(f) { var s=true; var inputs = f.getElementsByTagName('input'); for(var i=0; i0) { omb=new multiBox({ mbClass: '.mb', container: $(document.body), descClassName: '', path: './Files/', useOverlay: ov1, maxSize: {w:1000, h:1000}, addDownload: false, pathToDownloadScript:'', addRollover: true, addOverlayIcon: true, addChain: false, recalcTop: true, addTips: false }); } if($$('[class=vmb]').length>0) { new multiBox({ mbClass: '.vmb', container: $(document.body), descClassName: '', path: './Files/', useOverlay: true, maxSize: {w:1000, h:1000}, addDownload: false, pathToDownloadScript:'', addRollover: true, addOverlayIcon: false, addChain: false, recalcTop: true, addTips: false }); } $$('input.redcart_input').each(function(el){ el.addEvents({ 'focus': function(){this.set('class','redcart_input_hover');}, 'blur': function(){this.set('class','redcart_input');} }); }); $$('textarea.redcart_textarea').each(function(el){ el.addEvents({ 'focus': function(){this.set('class','redcart_textarea_hover');}, 'blur': function(){this.set('class','redcart_textarea');} }); }); //rate if($('mstar')) { var rating = new rc_ratings({ moostarwidth:$('mstar').getSize().x, moostarnum:5, inpercent:false, isFractional:false, moostar:$('mstar'), moostartval:$('mstarval'), moostartval2:$('mstarval2'), msid:$('msid'), sid:'', cookie:'redcart_products_', url: '/ajax//pinfo/rating/', url1: '/ajax//pinfo/rating_get/' }); } //rate }); function runCarousel() { $$('.content_Carousel:not(.ready)').each(function(el,i){ $(el).addClass('ready'); var box=el.id.split('-'); var box_config={}; if($('config-'+box[3])) { var as = $('config-'+box[3]).getElements('span'); as.each(function(el1,i){ box_config[el1.get('id')]=parseInt(el1.get('html')); }); } //console.log(el.id, {id:box[3],width:box_config['config-opt-width-'+box[3]], height:box_config['config-opt-height-'+box[3]],duration:box_config['config-opt-duration-'+box[3]],delay:box_config['config-opt-delay-'+box[3]],box:box_config['config-opt-box-'+box[3]],name:box[3],autoplay:box_config['config-opt-autoplay-'+box[3]]}) new RCCarousel_content(el.id, {id:box[3],width:box_config['config-opt-width-'+box[3]], height:box_config['config-opt-height-'+box[3]],duration:box_config['config-opt-duration-'+box[3]],delay:box_config['config-opt-delay-'+box[3]],box:box_config['config-opt-box-'+box[3]],name:box[3],autoplay:box_config['config-opt-autoplay-'+box[3]]}); }); } //rc-Carousel window.addEvent('load', function() { runCarousel(); //carusel //tooltips var Tips1 = new Tips($$('.tooltips'),{ className: 'rc_tooltips', fixed: false, offsets: {x: 50, y: 50}, showDelay: 0, hideDelay: 0, windowPadding:{x:20, y:20} } ); // }); window.addEvent('load', function() { $$('.content_Carousel').each(function(el,i){ var rcmax=0; var size=0; var box=el.id.split('-'); if($('rc-carousel-content-inner-'+box[3])) { var divs = $('rc-carousel-content-inner-'+box[3]).getElements('div'); divs.each(function(el1){ if(el1.className=='rc-carousel-content-animate') { size=el1.getSize(); if(size.y>rcmax) rcmax=size.y; } }); $('rc-carousel-content-inner-'+box[3]).setStyle("height",rcmax); } }); }); function inventory(pid0,pict, searcher, pinfo) { if(searcher=="undefined") searcher = false; if(pinfo=="undefined") pinfo = false; loading_start(); var val={}; val['opt1']={}; val['opt1'][0]={}; val['opt1'][1]={}; val['pict']=pict; val['searcher']=searcher; val['pinfo']=pinfo; if(!pict) var suff=''; else var suff=pict; var pid=getId('products_id'+suff).value; val['pid']=pid; if(pid0) val['pid0']=pid0; if($('option_type_1') && $$('input[name=option_type]:checked').length > 0) val['option_type']=$$('input[name=option_type]:checked')[0].get('value'); if($('cat_id')) val['cat_id'] = $('cat_id').get('value'); val['isWithCross2'] = 1; val['parentCross2'] = pid; if($('inventory_opt_cont'+suff+'_'+pid)) { var f=getId('inventory_opt_cont'+suff+'_'+pid); var sels = f.getElementsByTagName('select'); for(var i=0; i0) option_type_set(val['option_type']); var optd=0; $$('[id^=options\[]').each(function(el,i){ optd=1; }); if(optd==0) { $$('.pinfo-features').each(function(el){ el.setStyles({'display':'none'}); }); } if(optd==0 && ''==1) { salert('Produkt chwilowo niedostępny',4000,'back','',true); } if(''==13493) getInventoryPrice(pid, pict); if(typeof jQuery !== "undefined") { jQuery("body").trigger('inventoryLoaded'); } if(''==9455) amount_price('1',false,''); if(''==2300) { jQuery('.tooltip-s1, .tooltip-s2').tooltip({ track: true, position: { my: "left+35 center", at: "right center" } }); } if(''==13818 ){ jQuery("select[id^=options]").select2({ templateResult: formatOption, minimumResultsForSearch: Infinity }); } if(''==16481){ amount_price('1',false,''); $('fixcurrency').set('html',$('hcurrency').get('html')) } } }).send(); } function formatOption (option) { if(option.element) var color = jQuery(option.element).attr('data-color'); if (!option.id) { return option.text; } var $option = jQuery( '' + option.text + ' 
 
' ); return $option; }; function getInventoryPrice(pid, pict) { var unselectedOptions = jQuery('#options_form_tab select[value=0]'); if(unselectedOptions.length == 0) { var optionsValuesIdArray = new Array(); jQuery('#options_form_tab'+ pict +' select').each( function() { var valueArray = jQuery(this).val().split(',') var optionValueId = valueArray[3]; optionsValuesIdArray.push(parseInt(optionValueId)); }); // optionsValuesIdArray.sort(); optionsValuesIdString='.' + optionsValuesIdArray.join('.') + '.'; new Request({ method: 'post', url: '/ajax/pinfo/get_inventory_price/', data:{'options': optionsValuesIdString, 'pid': pid }, onComplete: function(data) { data = JSON.parse(data); if(parseFloat(data) > 0) { var priceArray = data.split('.'); jQuery('.price_1_pinfo').html(priceArray[0] + ','); jQuery('.price_2_pinfo').html(priceArray[1]); jQuery('.price_1_big').html(priceArray[0] + ','); jQuery('.price_2_big').html(priceArray[1]); } } }).send(); } } function inventory_items_9182(t, pid0) { loading_start(); var val={}; val['opt1']={}; val['opt1'][0]={}; val['opt1'][1]={}; var pid=pid0; val['pid']=pid0; //var pid=getId('products_id'+suff).value; //val['pid']=pid; if(pid0) val['pid0']=pid0; val['isWithCross2'] = 0;; if($('option_type_1')) val['option_type']=$$('input[name=option_type]:checked')[0].get('value'); //if($('addcartcross_'+pid)) if($('target_'+pid0)) { //var f=getId('addcartcross_'+pid); var f=getId('target_'+pid0); var sels = f.getElementsByTagName('select'); for(var i=0; imax) p1=max; } else p1 = 0; t.value=p1; loading_stop(); console.log(data); } }).send(); } function inventory_items_set(t, pid0) { loading_start(); var val={}; val['opt1']={}; val['opt1'][0]={}; val['opt1'][1]={}; var pid=pid0; val['pid']=pid0; //var pid=getId('products_id'+suff).value; //val['pid']=pid; if(pid0) val['pid0']=pid0; val['isWithCross2'] = 0;; if($('option_type_1')) val['option_type']=$$('input[name=option_type]:checked')[0].get('value'); //if($('addcartcross_'+pid)) if($('target_'+pid0)) { //var f=getId('addcartcross_'+pid); var f=getId('target_'+pid0); var sels = f.getElementsByTagName('select'); for(var i=0; imax) p1=max; } else p1 = 0; t.value=p1; loading_stop(); console.log(data); } }).send(); } function inventory_set(pid0,pict, parentCross2) { loading_start(); var val={}; val['opt1']={}; val['opt1'][0]={}; val['opt1'][1]={}; val['pict']=pict; if(!pict) var suff=''; else var suff=pict; var pid=pid0; val['pid']=pid0; //var pid=getId('products_id'+suff).value; //val['pid']=pid; if(pid0) val['pid0']=pid0; val['isWithCross2'] = 0; val['parentCross2'] = parentCross2; if($('option_type_1')) val['option_type']=$$('input[name=option_type]:checked')[0].get('value'); //if($('addcartcross_'+pid)) if($('target_'+pid0)) { //var f=getId('addcartcross_'+pid); var f=getId('target_'+pid0); var sels = f.getElementsByTagName('select'); for(var i=0; i0) option_type_set(val['option_type']); var optd=0; $$('[id^=options\[]').each(function(el,i){ optd=1; }); if(optd==0 && ''==1) { salert('Produkt chwilowo niedostępny',4000,'back','',true); } if(''==9455) amount_price('1',false,''); } }).send(); } function inventory_9182(pid0,pict, parentCross2) { loading_start(); var val={}; val['opt1']={}; val['opt1'][0]={}; val['opt1'][1]={}; val['pict']=pict; if(!pict) var suff=''; else var suff=pict; var pid=pid0; val['pid']=pid0; //var pid=getId('products_id'+suff).value; //val['pid']=pid; if(pid0) val['pid0']=pid0; val['isWithCross2'] = 0; val['parentCross2'] = parentCross2; if($('option_type_1')) val['option_type']=$$('input[name=option_type]:checked')[0].get('value'); //if($('addcartcross_'+pid)) if($('target_'+pid0)) { //var f=getId('addcartcross_'+pid); var f=getId('target_'+pid0); var sels = f.getElementsByTagName('select'); for(var i=0; i0) option_type_set(val['option_type']); var optd=0; $$('[id^=options\[]').each(function(el,i){ optd=1; }); if(optd==0 && ''==1) { salert('Produkt chwilowo niedostępny',4000,'back','',true); } if(''==9455) amount_price('1',false,''); } }).send(); } function service_calc() { var sum=0; $$('.products_services_type').each(function(v,i){ if(v.id.lastIndexOf("[sg]")!=-1) { re = /[^0-9]/gi; psvid=v.id.replace(re, ''); signs_val=getId('psv['+psvid+']').value stop_signs=getId('stop_signs['+psvid+']').value signs_val=signs_val.replace(eval("/["+stop_signs+"]/g"),''); signs=signs_val.length val=v.value; cost=signs*val; sum+=cost getId('psv_cost['+psvid+']').innerHTML=cost.toFixed(2) } }); getId('psv_sum['+psvid+']').innerHTML=sum.toFixed(2) } function fclear() { service_calc(); var f=getId('products_services'); var ins = f.getElementsByTagName('input'); 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: "question_bt", fValidate_send:function(){ $('q_user').set('send', {onComplete: function(data) { rc_w.close_window(); salert('Twoje zapytanie zostało wysłane',5000,false,false,'none'); // definicja! close_window_out($('rc_window3'),1,5000); }}); $('q_user').send(); } }); } }); } function openSendFriendWindow() { var rc_w=new rc_windows({ id:'rc_window4', container: $(document.body), useOverlay: true, width:600, height:300, title: 'Poleć znajomemu', contentAJAX:'/ajax//send_friend/index/'+$('products_id').get('value')+'/', onComplete: function(){ $(rc_w.options.id+'_title').set('html',$(rc_w.options.id+'_title').get('html')+' - '+$('sproduct_title').get('html')); var exV = new fValidator("s_friend", { 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: "send_friend_bt", fValidate_send:function(){ $('s_friend').set('send', {onComplete: function(data) { rc_w.close_window(); salert('Twoja wiadomość została wysłana',5000,false,false,'none'); // definicja! close_window_out($('rc_window4'),1,5000); }}); $('s_friend').send(); } }); } }); } function openPrintPageWindow() { var rc_w=new rc_windows({ id:'rc_window5', container: $(document.body), useOverlay: true, width:800, height:300, title: 'Wydrukuj stronę', contentAJAX:'/ajax//pinfo/print_page/'+$('products_id').get('value')+'/', onComplete: function() { $(rc_w.options.id+'_title').set('html',$(rc_w.options.id+'_title').get('html')+' - '+$('sproduct_title').get('html')); } }); } window.addEvent('domready', function() { if($('pinfoTabs')) { var arr=$('pinfoTabs').getElements('li'); if(arr.length>0) Tabs1 = new mootabs('pinfoTabs', {changeTransition: 'none', mouseOverClass: 'over'}); } $$('.products_services_ev').each(function(el){ el.addEvents({ 'keyup': service_calc }); }); //zapytaj o produkt if ($('q_user_text')){ $('q_user_text').addEvent('click', function(e){ openQuestionWindow(); }); } if(''==1652){ setTimeout(function(){ $$('[id^=n_user_text]').each(function(el,i){ el.addEvent('click', function(e){ var pid=0; if ($('products_id')) pid=$('products_id').get('value'); else { var p1=el.id.split('-'); pid=p1[1]; } var rc_w=new rc_windows({ id:'rc_window7', container: $(document.body), useOverlay: true, width:600, height:300, title: 'Negocjuj cenę', contentAJAX:'/ajax//question/index/'+pid+'&t=1/', onComplete: function(){ $(rc_w.options.id+'_title').set('html',$(rc_w.options.id+'_title').get('html')+' - '+$('qproduct_title').get('html')); var exV = new fValidator("q_user1", { 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: "question_bt1", fValidate_send:function(){ $('q_user1').set('send', {onComplete: function(data) { rc_w.close_window(); salert('Twoje zapytanie zostało wysłane',5000,false,false,'none'); // definicja! close_window_out($('rc_window3'),1,5000); }}); $('q_user1').send(); } }); } }); }); }); }, 750); // koniec setTimeout dla 1652 } else { $$('[id^=n_user_text]').each(function(el,i){ el.addEvent('click', function(e){ var pid=0; if ($('products_id')) pid=$('products_id').get('value'); else { var p1=el.id.split('-'); pid=p1[1]; } var rc_w=new rc_windows({ id:'rc_window7', container: $(document.body), useOverlay: true, width:600, height:300, title: 'Negocjuj cenÄ™', contentAJAX:'/ajax//question/index/'+pid+'&t=1/', onComplete: function(){ $(rc_w.options.id+'_title').set('html',$(rc_w.options.id+'_title').get('html')+' - '+$('qproduct_title').get('html')); var exV = new fValidator("q_user1", { 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: "question_bt1", fValidate_send:function(){ $('q_user1').set('send', {onComplete: function(data) { rc_w.close_window(); salert('Twoje zapytanie zostało wysłane',5000,false,false,'none'); // definicja! close_window_out($('rc_window3'),1,5000); }}); $('q_user1').send(); } }); } }); }); }); } //polec znajomemu if ($('send_friend_text')){ $('send_friend_text').addEvent('click', function(e){ openSendFriendWindow(); }); } //wydrukuj strone if ($('print_page')){ $('print_page').addEvent('click', function(e){ openPrintPageWindow(); }); } //rate if ($('send_rate')){ $('send_rate').addEvent('click', function(e){ var rc_w=new rc_windows({ id:'rc_window5', container: $(document.body), useOverlay: true, width:800, height:300, title: 'Napisz opinię', contentAJAX:'/ajax//pinfo/send_rate/'+$('products_id').get('value')+'/', onComplete: function() { $(rc_w.options.id+'_title').set('html',$(rc_w.options.id+'_title').get('html')); } }); }); } }); window.addEvent('load', function() { //searcher //end searcher var u=0; if($('area')) { width=$('img_main').width; height=$('img_main').height; $('link_img_main').style.marginBottom=0; $('link_img_main').style.marginRight=0; href=$('link_img_main').href; //ustawienie boxów var myEffect1 = new Fx.Morph('image_zamk', {duration: 1000, transition: Fx.Transitions.Sine.easeOut}); myEffect1.start({ 'height': [$('image_zamk').getStyle('height'), $('img_main').height], 'width': [$('image_zamk').getStyle('width'), $('img_main').width] }); var myEffect2 = new Fx.Morph('zamk', {duration: 1000, transition: Fx.Transitions.Sine.easeOut}); myEffect2.start({ 'height': [$('zamk').getStyle('height'), $('img_main').height], 'width': [$('zamk').getStyle('width'), $('img_main').width] }); if(!Browser.Engine.trident) { var myEffect89 = new Fx.Morph('image_zamk', {duration: 1000, transition: Fx.Transitions.Sine.easeOut}); var pos=(($('area').getStyle('width').toInt()+64)-$('img_main').width)/2; myEffect89.start({ 'left': [0, pos] }); } $('zoom_but_rigth').addEvent('click', function(e){ if((mySlide.step+(mySlide.steps*0.10))<= mySlide.steps) { mySlide.set(mySlide.step+(mySlide.steps*0.10)); } else { mySlide.set(mySlide.steps); } }); $('zoom_but_left').addEvent('click', function(e){ if((mySlide.step-(mySlide.steps*0.10))>=0) { mySlide.set(mySlide.step-(mySlide.steps*0.10)); } else { mySlide.set(0); } }); //end var start=0; mySlide = new Slider($('area'), $('knob'), { steps: 160, onComplete: function(step){ if(start==1) { if(step>0) { if(flagi==0) { href=$('link_img_main').href; loading_start(); var src=$('img_main').src.replace(/thumb\/([^\/]+)\/([^\/]+)\/([^\/]+)\//, "thumb//0/0/"); var zimg = Asset.images([src], { onComplete: function(){ $('img_main').src =src; sv=Math.floor((zimg[0].width/width))*80; mySlide.steps=sv; loading_stop(); } }); flagi=1; } $('link_img_main').removeEvents('click'); $('link_img_main').href="javascript:void(0);"; $('img_main').style.cursor="move"; } } else start=1; if(step==0) { $('img_main').style.cursor="hand"; $('img_main').style.cursor="pointer"; if(u==1) { $('link_img_main').href=href; omb.content.each(function(el,i){ $('link_img_main').addEvent('click', function(e){ var myTarget = ($(e.target).match('a')) ? $(e.target) : $(e.target).getParent('a'); e.preventDefault(); //images sort var ile=omb.options.start_array.length; for(var ii=0; ii0) { if(sels[i].id != 'c['+ids+']') sels[i].setAttribute('disabled','disabled'); else sels[i].removeAttribute('disabled'); } else { sels[i].removeAttribute('disabled'); } } } loading_stop(); } }).send(); } function secure_open(products_id) { var rc_w=new rc_windows({ id:'rc_window4', container: $(document.body), useOverlay: true, width:600, height:470, title: '', contentAJAX:'/ajax/.php?p=pinfo&f=secure_cost&products_id='+products_id }); } function inform_send(error1,error2) { loading_start(); $('email_inform').className=''; $('email_inform_div').innerHTML=''; $('token').className=''; $('token_inform_div').innerHTML=''; var req = new Request({ method: 'post', url: '/ajax/.php?p=pinfo&f=products_inform', data:{"token_t": $('token').value}, onComplete: function(data) { token=data; var s='true'; if(!$('email_inform').value.match('@')) { $('email_inform').className='alert_fValidator'; $('email_inform_div').innerHTML=error1; var s='false'; } if(token=='false') { var s='false'; $('token').className='alert_fValidator'; $('token_inform_div').innerHTML=error2; } if(s=='true') { var timeout_price=''; if($('timeout_price')) timeout_price=$('timeout_price').get('value'); var req2 = new Request({ method: 'post', url: '/ajax/.php?p=pinfo&f=products_inform', data:{"token": $('token').value, "products_id": $('products_id_inform').value, "email": $('email_inform').value, "newsletter": $('newsletter').value,"timeout_price":timeout_price}, onComplete: function(data) { var response = data; getId('rc_window5_body').innerHTML=response; } }).send(); } loading_stop(); } }).send(); } function open_opinions(mid,products_id) { var rc_w=new rc_windows({ id:'rc_window5', container: $(document.body), useOverlay: true, width:800, height:300, title: 'Napisz opinię', contentAJAX:'/ajax.php?p=opinions&f=create&pid='+products_id+'&mid='+mid, onComplete: function() { if($('stars')) { Sekcja=document.getElementById('stars'); inputs=Sekcja.getElementsByTagName('input'); for(var i=0;i } else { $('opinions_alert').setStyle('display','block'); } } function option_to_image(sel) { var tab=sel.value.split(','); if(tab.length>2) { if($('image_'+tab[3])) { var img=$('image_'+tab[3]).innerHTML; if(img!='') { if($('rc_window_opt') && 1==0) { Sekcja=document.getElementById('rc_window_opt'); table=Sekcja.getElementsByTagName('table'); td=table[0].getElementsByTagName('td'); img=td[0].getElementsByTagName('img'); var image=$('image_'+tab[3]).innerHTML; img[0].src='http://photos05.redcart.pl/templates/images/thumb//250/250/pl/0/templates/images/products//'+image; } else { // var zimg = Asset.images([$('img_main').get('src')], {}); // var height=zimg[0].height; // var width=zimg[0].width; var thumb = $('img_main').get('src').split('thumb'); thumb = thumb[1].split('/'); //console.log(thumb); var height=thumb[2]; var width=thumb[2]; var tobj={}; tobj.src='http://photos05.redcart.pl/templates/images/thumb//'+width+'/'+height+'/pl/0/templates/images/products//'+img; link=tobj.src; if($('rcVer') && $('rcVer').get('html')==3) { var datasrc0arr=$('img_main').get('data-src').split('/'); var src0arr=$('img_main').get('src').split('/'); var link0arr=link.split('/'); $('img_main').set('src',$('img_main').get('src').replace(src0arr[15],link0arr[15])) $('img_main').set('data-src',$('img_main').get('data-src').replace(datasrc0arr[15],link0arr[15])) } $$('.m_pinfo_mini_img').each(function(el,i){ image=el.getElementsByTagName('img'); if(image[0].src.match(img)) { // link='/ajax//pinfo/gallery/'+($('products_id').value)+'/'+i+'/'; link=image[0].src; link=link.replace(/thumb\/([^\/]+)\/([^\/]+)\/([^\/]+)\//, "thumb/$1/0/0/"); tobj=image[0]; //console.log(image[0]); //image[0].click(); $(image[0]).onclick(); } }); //change_main_img(tobj,link,width,height); } } } } } function inform_window(products_id,timeout) { if(timeout==0) var title='Powiadom mnie o dostępności'; if(timeout==1) var title='Poinformuj mnie gdy cena osiągnie określoną wartość'; new rc_windows({ id:'rc_window5', container: $(document.body), useOverlay: true, width:800, height:300, title: title, varAJAX: {"timeout":timeout}, contentAJAX:'/ajax//pinfo/products_inform/'+products_id+'/', onComplete: function() { if($('f_product_inform')) { var exV = new fValidator("f_product_inform", { 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: "btn_f_product_inform", fValidate_send:function(){ inform_send($('email_inform').get('value'),$('token').get('value')); } }); } } }); } window.addEvent('load',function(){ $$('[id^=small_cutdown]').each(function(el,i){ tab = el.id.split('_'); var countdown = new CountDown({ date: new Date(Math.round($('promotion_over_'+tab[2]).get('html'))*1000), frequency: 100, onChange: function(counter) { var text = ''; var def_day='dzień'; var def_days='dni'; if(counter.days == 1) var dday=def_day; else var dday=def_days; if(counter.days > 0) text = counter.days + ' '+dday+' '; if(counter.hours > 9 && counter.hours!=9) var z=''; else var z='0'; text += z+counter.hours+':'; if(counter.minutes > 9 && counter.minutes!=9) var z=''; else var z='0'; text += z+counter.minutes+':'; if(counter.second > 9 && counter.second!=9) var z=''; else var z='0'; text += z+counter.second; el.set('html', text) }, onComplete: function () { // window.location.reload(); } }); countdown.start(); }); }); function timeout_window(id,title) { new rc_windows({ id:'rc_window55', container: $(document.body), useOverlay: true, width:800, height:300, title: title, contentHTML: $('timeout_information_'+id).get('html') }); } function secure_1020(t) { var el=$('secure'); if(t.checked==false) el.style.display='none'; else el.style.display='block'; el=$('no_secure'); if(t.checked==true) el.style.display='none'; else el.style.display='block'; } function amount_price_5217(c,pc,pict) { if(!pict) var suff=''; else var suff=pict; if($('base_price2')) amount_price(c,pc,pict); else { if($('options_form'+suff)) { var f=getId('options_form'+suff); var sels = f.getElementsByTagName('select'); if($('inventoryprice')) { price = $('inventoryprice').value; if(price == 'brak') { price=$('options_products_price_brutto').value; price = parseFloat(price); price = price.toFixed(2); } } else { price = $('base_price').value; } if(!(price)>0) price = $('base_price').value; pb=price; pb=String(pb); var f=getId('price_produsts_info'+suff); if(f) { var fonts = f.getElementsByTagName('font'); for(var j=0; j0) option_type_set(val['option_type']); var optd=0; $$('[id^=options\[]').each(function(el,i){ optd=1; }); if($('selected_options')) { if($('hidden_thumbs')) { ooo = $('selected_options').get('value'); Sekcja=document.getElementById('hidden_thumbs'); divs=Sekcja.getElementsByTagName('div'); for(var j=0;j0) { if($(divs[j]).get('class').match('.'+ooo+'.')) { divs[j].setAttribute('class','fl m_pinfo_mini_img .'+ooo+'.'); divs[j].setStyle('display',''); } } } } } if(optd==0 && ''==1) { salert('Produkt chwilowo niedostępny',4000,'back','',true); } amount_price_5217('1',false,''); } }).send(); } function saveLikeProduct(productsId, fbUserId) { loading_start(); var req = new Request({ method: 'post', url: '/ajax/facebook/add_like_product/', data: { 'products_id': productsId, 'fb_user_id': fbUserId }, onComplete: function(data) { loading_stop(); } }).send(); } function rememberFbUser(fbUserId) { loading_start(); var req = new Request({ method: 'post', url: '/ajax/facebook/remember_fb_user/', data: { 'fb_user_id': fbUserId }, onComplete: function(data) { loading_stop(); } }).send(); } function items_cart2(v,t,ct,pict) { if(!pict) var suff=''; else var suff=pict; if($('listing_msg')) $('listing_msg').set('html',''); var p=v.split('_'); var pid=p[2]; var opt={}; var opts={}; var opts1=new Array(); opts1[0]={}; opts1[1]={}; var opts1s=new Array(); opts1s[0]={}; opts1s[1]={}; var s=true; if($('options_form'+suff) && pict!='cross') { var sels = $('options_form'+suff).getElementsByTagName('select'); for(var i=0; i0) { var req = new Request({ method: 'post', url: '/ajax/pinfo/items_cart/', data: {"pid":pid,"item":item}, onComplete: function(data) { var d = data.split('~'); //console.log(data); if(d[0]==0) { salert_mini('Obecnie w magazynie jest: '+d[1],'warning'); $("buy_quantity_input").set('value', d[1]); } } }).send(); } } function selectImgThumb(optionId, optionValueId) // 13293 { select = $('options[' + optionId + ']'); if(select) { options = select.getElements('option') options.each(function(el, i) { currentOptionValueId = el.get('value').split(',').pop(); if(optionValueId == currentOptionValueId) el.set("selected", "selected"); }); $$('.lens_' + optionId).each(function(el, i) { el.removeClass('selected'); }); $('len_' + optionValueId).addClass('selected'); } } function selectIcon(icon) { var dataId = jQuery(icon).attr('data-id'); var dataValue = jQuery(icon).attr('data-value'); var current = $('options[' + dataId + ']').get('value'); $$('.option-icon').each(function(el){ if(el.get('data-id') == dataId) el.removeClass('selected'); }); if(current != dataValue) { icon.addClass('selected'); jQuery('[id^="options\[' + dataId + '\]"]').val(dataValue); } else{ jQuery('#options[' + dataId + ']').val(0); } } function selectRadioOption(radio, priceType, pict) { var sel = radio.get('data-id'); var val = radio.get('value'); if($('options[' + sel + ']')){ $('options[' + sel + ']').set('value', val); amount_price(priceType,pict,''); option_to_image($('options[' + sel + ']')); } } function quickView() { $$('.qv-button').addEvent('click', function(){ var pid = $(this).get('data-id'); var rc_w=new rc_windows({ id:'brief_'+pid, container: $(document.body), useOverlay: true, varAJAX: {"pid":pid}, contentAJAX:'http://sklep.meblesedia.pl/ajax.php?p=pinfo&f=get_brief&products_id=' + pid, width:900, head: true, onComplete: function(){ inventory(pid); $$('a.gallery-main.').addEvent('click', function(e) { e.stop(); $('img_main').set('src',$(this).get('href')); var datasrc = $(this).getElements('img')[0].get('data-src'); $('img_main').set('data-src',datasrc); $('link_img_main').set('href',datasrc); }) add_cart_pinfo_new(); rc3Event(); jQuery("a.slideHref").fancybox(); jQuery('#thumbs .thumb a').each(function(i) { jQuery(this).addClass( 'itm'+i ); }); jQuery('#thumbs a.itm0').addClass( 'selected' ); jQuery('#thumbs').carouFredSel({ direction: 'left', responsive: true, circular: false, infinite: false, items: 3, align: false, auto: false, prev: '#prev', next: '#next' }); } }); }) } window.addEvent('domready', function() { quickView(); });