var Showcase; var ShowcaseTimer; var PlywakTop; window.addEvent('domready', function() { if($('product_list')) { var el = document.getElementById('product_list').getElementsByTagName('a'); for (var x = 0; x < el.length; x++) { //var img = el[x].getElementsByTagName('span')[0].getElement('img'); var desc = el[x].getElementsByTagName('span')[1]; var price = el[x].getElementsByTagName('span')[2]; /* if (img.get('height') < 300) { img.style.position = 'relative'; img.style.top = '50%'; img.style.marginTop = - img.get('height') / 2 + 'px'; } */ desc.style.width = 172 - price.offsetWidth + "px"; if (el[x].getElementsByTagName('span')[3]) el[x].getElementsByTagName('span')[3].style.width = el[x].getElementsByTagName('span')[2].offsetWidth - 18 + "px"; } $$('#product_list > a').addEvents({ 'mouseenter' : function(){ new Fx.Morph(this.getElement('span.info'),{duration: 50}).start({'opacity' : ['0','1']}) }, 'mouseleave' : function(){ new Fx.Morph(this.getElement('span.info'),{duration: 350}).start({'opacity' : ['1','0']}) } }) } if($('lewa_czesc')) { $$('#lewa_czesc > a').addEvent('click',function(e){ new Event(e).stop(); $('main_foto').set('src',this.get('href')); }) ctn=new Element('div',{ 'styles' : {'width' : 1,'height' : 1,'overflow' : 'hidden'} }) ctn.inject(document.body,'bottom') $$('lewa_czesc > a').each(function(){ obr=new Element('img',{ 'src' : this.get('href') ,'styles' : {'width' : 1,'height' : 1} }) obr.inject(ctn) }) } if($('tell_uns')) { $('tell_uns').addEvent( 'submit', function(e){ new Event(e).stop(); check=/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/; pole_mail=this.getElement('#mail') if(!check.test(pole_mail.value)) { tween=new Fx.Tween(pole_mail,{duration : 1000}) tween.start('border-color','#ff0000','#ff9e9e') return false; } pole_tresc=this.getElement('#powiedzial') if(!pole_tresc.value) { tween=new Fx.Tween(pole_tresc,{duration : 1000}) tween.start('border-color','#ff0000','#ff9e9e') return false; } this.send(); }); $('tell_uns').getElement('#powiedzial').setStyle('border','1px solid #ffffff') $('tell_uns').getElement('#mail').setStyle('border','1px solid #ffffff') } if($('navi')) { $$('#navi > a').addEvents({ 'mouseenter' : function(){ new Fx.Morph(this,{duration: 50}).start({'background-color' : ['#D7CAB5','#2B2B2B'],'color' : ['#2B2B2B','#D7CAB5']}) }, 'mouseleave' : function(){ new Fx.Morph(this,{duration: 250}).start({'background-color' : ['#2B2B2B','#D7CAB5'],'color' : ['#D7CAB5','#2B2B2B']}) } }) } if($('do_sklepu_hop')) { $('do_sklepu_hop').addEvents({ 'mouseenter' : function(){ new Fx.Morph(this,{duration: 400}).start({'border-bottom-color' : ['#2b2b2b','#ffdd00']}) }, 'mouseleave' : function(){ new Fx.Morph(this,{duration: 400}).start({'border-bottom-color' : ['#ffdd00','#2b2b2b']}) } }) } else { $$('#main-menu > a').addEvents({ 'mouseenter' : function(){ new Fx.Morph(this,{duration: 100}).start({'border-bottom-color' : ['#ffdd00','#2b2b2b']}) }, 'mouseleave' : function(){ new Fx.Morph(this,{duration: 200}).start({'border-bottom-color' : ['#2b2b2b','#ffdd00']}) } }) } if($('paginacja')) { $$('#paginacja > a').addEvents({ 'mouseenter' : function(){ if(!this.hasClass('active')) new Fx.Morph(this,{duration: 50}).start({'background-color' : ['#ffdd00','#2b2b2b'],'color' : ['#2b2b2b','#ffdd00']}) }, 'mouseleave' : function(){ if(!this.hasClass('active')) new Fx.Morph(this,{duration: 250}).start({'background-color' : ['#2b2b2b','#ffdd00'],'color' : ['#ffdd00','#2b2b2b']}) } }) } if($('blog_entry_content')) { $$('#blog_entry_content a').addEvents({ 'mouseenter' : function(){ if(!this.hasClass('active')) new Fx.Morph(this,{duration: 50}).start({'background-color' : ['#ffdd00','#2b2b2b'],'color' : ['#2b2b2b','#ffdd00']}) }, 'mouseleave' : function(){ if(!this.hasClass('active')) new Fx.Morph(this,{duration: 250}).start({'background-color' : ['#2b2b2b','#ffdd00'],'color' : ['#ffdd00','#2b2b2b']}) } }) $('submit_blog_comment').addEvents({ 'mouseenter' : function(){ this.set('src','media/dodaj_komentarz_hover.png') }, 'mouseleave' : function(){ this.set('src','media/dodaj_komentarz.png') } }) } if($('blog_list')) { $$('img.vam').addEvents({ 'mouseenter' : function(){ this.set('src','media/arrow_click_hover.gif') }, 'mouseleave' : function(){ this.set('src','media/arrow_click.gif') } }) } if($('koszyk_dalej')) { $('koszyk_dalej').addEvents({ 'mouseenter' : function(){ this.set('src','/media_s/dalej_hover_pl.gif') }, 'mouseleave' : function(){ this.set('src','/media_s/dalej_pl.gif') } }) } if($('koszyk_przelicz')) { $('koszyk_przelicz').addEvents({ 'mouseenter' : function(){ this.set('src','/media_s/przelicz_hover.gif') }, 'mouseleave' : function(){ this.set('src','/media_s/przelicz.gif') } }) } if($('powrot_do_koszyka')) { $('powrot_do_koszyka').addEvents({ 'mouseenter' : function(){ this.set('src','/media_s/powrot_do_koszyka_hover_pl.gif') }, 'mouseleave' : function(){ this.set('src','/media_s/powrot_do_koszyka_pl.gif') } }) $('kosz_place').addEvents({ 'mouseenter' : function(){ this.set('src','/media_s/place_hover_pl.gif') }, 'mouseleave' : function(){ this.set('src','/media_s/place_pl.gif') } }) } if($('place')) { $('place').addEvents({ 'mouseenter' : function(){ this.set('src','/media_s/place_hover_pl.gif') }, 'mouseleave' : function(){ this.set('src','/media_s/place_pl.gif') } }) } if($('showcase')) { Fx.Elements.implement({ active_element : 0 ,flip : function(el_id) { if(this.running) return false; if(el_id == this.active_element) return false; if(el_id > this.elements.length-1) return false; wymiar=this.elements[this.active_element].getSize().x; a={}; a[this.active_element]={'width': [wymiar, 0]}; a[el_id]={'width': [0, wymiar]}; this.toel=el_id; if(this.right_click && !this.left_click) loc='before'; if(this.left_click && !this.right_click) loc='after'; if(!this.left_click && !this.right_click) loc=this.active_element > el_id ? 'before' : 'after'; this.elements[el_id].grab(this.elements[this.active_element],loc); this.start(a); this.running=true; } ,show_next : function() { this.right_click=true; this.flip(this.active_element+1 == this.elements.length ? next=0 : this.active_element+1); } ,show_prev : function() { this.left_click=true; this.flip(this.active_element==0?this.elements.length-1 : this.active_element-1); }, switchElement: function() { //$('showcase_button_'+this.active_element).removeClass('active'); //$('showcase_button_'+this.toel).addClass('active'); this.active_element=this.toel; this.right_click=false; this.left_click=false; } }); Showcase=new Fx.Elements($$('#showcase_content > div.ctn'),{duration: 600,transition: Fx.Transitions.Expo.easeInOut,onComplete: function(){this.running=false;this.switchElement();}}); Showcase.active_element=0; Showcase.running=false; //$$('.showcase_button').each(function(el){el.addEvent('click',function(){$clear(ShowcaseTimer); b_id=parseInt(this.get('id').replace('showcase_button_','')); Showcase.flip(b_id);})}) ShowcaseTimer = setInterval("Showcase.show_next();",6000); $('left').addEvent('click',function(){$clear(ShowcaseTimer); Showcase.show_prev();}) $('right').addEvent('click',function(){$clear(ShowcaseTimer); Showcase.show_next();}) } if($('basket_postage1')) { map_basket(); } if($('cart_add')) { $('cart_add').set('send', { onRequest: function(){ }, onSuccess: function(responseText){ $('kosz').load('_basket.inc.php') }, onFailure: function(obj){ alert('failed') } }); $('cart_add').addEvent( 'submit', function(e){ new Event(e).stop(); this.send(); }); } if($('search_submit')) { $('search_submit').addEvents({ 'mouseenter' : function(){ this.set('src','/media_s/search_submit_hover.gif') }, 'mouseleave' : function(){ this.set('src','/media_s/search_submit.gif') } }) } $$('#blog_facebook_en img').addEvents({ 'mouseenter' : function(){ new Fx.Tween(this,{duration: 50}).start('border-color','#2b2b2b','#ffdd00') }, 'mouseleave' : function(){ new Fx.Tween(this,{duration: 350}).start('border-color','#ffdd00','#2b2b2b') } }) if($('kosz')) { $$('#kosz a.bin_delete').addEvent('click',function(e){ new Event(e).stop(); $('kosz').load(this.get('href')) }) $('kosz').set('load', { onSuccess: function(responseText){ $$('#kosz a.bin_delete').addEvent('click',function(e){ new Event(e).stop(); $('kosz').load(this.get('href')) }) } }); } $$('input').addEvent('click',function(){this.set('value','')}) }); function map_basket() { $('basket_final').set('load',{ onSuccess: function(responseText){ map_basket(); } }); $('basket_form').addEvent( 'submit', function(e){ new Event(e).stop(); checked=false; for(i=0;i label'),{duration : 1000}) tween.start({'0' : {'color' : ['#ff0000','#ff9e9e']},'1' : {'color' : ['#ff0000','#ff9e9e']},'2' : {'color' : ['#ff0000','#ff9e9e']}}) return false; } this.send(); }); $('basket_form').set('send', { onSuccess: function(responseText){ $('basket_final').set('html',responseText) $('powrot_do_koszyka').addEvent('click',function(e){ new Event(e).stop(); $('basket_final').load('_basket.inc.php') }) new Form.Validator($('checkout_final'), { stopOnFailure : true, evaluateFieldsOnChange : true }); } }); $$('#basket_final a.basket_delete').addEvent('click',function(e){ new Event(e).stop(); $('basket_final').load(this.get('href')) }) } Form.Validator.language = "pl-PL"; var MovingAnim; var LastScrollPos; function deferred_checker() { window_scroll=$(window).getScroll().y; window_height=parseInt($(window).getHeight()); viewport_bottom=window_scroll+window_height; plywak=$('plywamy'); if(plywak) { am=parseInt(plywak.getStyle('margin-top')); if(window_scroll > PlywakTop) { if(MovingAnim) MovingAnim.cancel(); MovingAnim = new Fx.Morph(plywak, {duration: 500, transition: Fx.Transitions.Sine.easeOut}); MovingAnim.start({ 'margin-top': [am, window_scroll-PlywakTop+140] }); } else { if(MovingAnim) MovingAnim.cancel(); MovingAnim = new Fx.Morph(plywak, {duration: 500, transition: Fx.Transitions.Sine.easeOut}); MovingAnim.start({ 'margin-top': [am, 20] }); } } setTimeout("deferred_checker()",500); }