function validate_formmail(f) { antyspam_answer = $(".antyspamVer").attr('answer'); antyspam_value = $(".antyspamVer").val(); antyspam_title = $(".antyspamVer").attr('title'); if(antyspam_answer != antyspam_value || antyspam_value == '') { alert("Odpowiedz na pytanie weryfikujące"); return false; } required = 0; wymagane = $(".required_field"); $.each(wymagane, function () { title = $(this).attr('title'); wartosc = $(this).val(); if(wartosc.length < 3) { alert('Wypelnij pole obowiązkowe: '+title); required++; } }); if(required > 0) { return false; } } function registration() { required = 0; required_titles = ''; wymagane = $(".required_field"); errorStyle = "solid 1px #FA5A5A"; okStyle = "solid 1px #BDBDBD"; var ErrorMsg = ''; mailValue = $(".userProfileEmail").val(); if(!MailIsValid(mailValue)) { $(".userProfileEmail").css('border', errorStyle); ErrorMsg = ErrorMsg+"
Nieprawidłowy adres e-mail"; required++; } else { $.get("Registration.html", { ajaxData: "get", userMail: mailValue }, function(data){ if(data == 'MAIL_EXIST') { $(".userProfileEmail").css('border', errorStyle); alert("Podany adres e-mail jest już używany w serwisie"); required++; } else if(data == 'MAIL_EMPTY') { $(".userProfileEmail").css('border', errorStyle); required++; } else { $(this).css('border', okStyle); } $.each(wymagane, function () { title = $(this).attr('title'); wartosc = $(this).val(); if(wartosc.length < 1) { //alert('Wypelnij pole obowiązkowe: '+title); //required_titles = required_titles+"
  • "+title+"
  • "; $(this).css('border', errorStyle); required++; } else { $(this).css('border', okStyle); } }); pass1 = $("#register1").val(); pass2 = $("#register2").val(); if(pass1 != pass2) { ErrorMsg = ErrorMsg+"
    Podane hasła są różne"; $("#register1, #register2").css('border', errorStyle); required++; } else { $("#register1, #register2").css('border', okStyle); } if(required > 0) { $("#registrationInformation").html("

    Wypełnij poprawnie wszystkie wymagane pola
    Pola które musisz wypełnić zostały oznaczone czerwonym kolorem"+ErrorMsg+"

    "); return false; } else { $("#RegistrationForm").submit(); } }); } } $('.show-sub-menu a').hover ( function(e) { $(this).addClass('active'); $('.sub-menu').css('display', 'none'); rel = $(this).attr('rel'); $('.catmenu' + rel).css('display', 'block'); position = $(this).position(); $('.catmenu' + rel).css('left', position.left + 'px'); $('.catmenu' + rel).css('top', (position.top + 42) + 'px'); }, function() { $(this).removeClass('active'); } ); $('.sub-menu').hover( function() { rel = $(this).attr('rel'); $('.show-sub-menu').find('a').each ( function() { if ($(this).attr('rel') == rel) { $(this).addClass('active'); } } ); }, function() { $('.sub-menu').css('display', 'none'); rel = $(this).attr('rel'); $('.show-sub-menu').find('a').each ( function() { if ($(this).attr('rel') == rel) { $(this).removeClass('active'); } } ); } ); $(".home").hover ( function() { $('.sub-menu').css('display', 'none'); $('.show-sub-menu a').removeClass('active'); }, function() { } ); $("#RegistrationFromButton").click(function() { registration(); }); $("#UserPassSubmit").click(function() { val = $("#UserPassValue").val(); if(!MailIsValid(val)) { $("#UserPassError").html("Podany adres jest niepoprawny"); return false; } else { $("#UserPassError").html(""); } }); function MailIsValid(Email) { var Pattern = /^[a-z0-9-_]+(\.[a-z0-9-_]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; return (Pattern.test(Email)) ? true : false; } function testuj_email(f) { if (!MailIsValid(f.newsletter_add.value)) { alert("Niepoprawny adres e-mail"); return false; } } function usun (link) { komunikat = "Czy napewno chcesz to zrobić?" if (confirm(komunikat)) document.location.href = link; } function ask (link, komunikat) { if (confirm(komunikat)) document.location.href = link; } function goToUrl(s) { var gourl = s.options[s.selectedIndex].value; window.top.location.href = gourl; } $(".gThumb").click(function() { fileReplace = $(this).attr('rel'); $("#gThumbBig").attr('src', 'public/foto/products/big_'+fileReplace); $("#gThumbLink").attr('href', 'public/foto/products/org_'+fileReplace); }); $(".cartVariant").click(function() { priceVal = $(this).attr('price'); $("#priceProduct").html(priceVal); }); $("#ajaxLoginForm").submit(function() { loginValue = $("#ajaxLoginUser").val(); passValue = $("#ajaxLoginPass").val(); $.get("Login.html", { ajaxData: "login", login: loginValue, pass: passValue }, function(data){ if(data == 'USER_LOGGED') { alert("Witamy w serwisie!"); $.get("Login.html", { ajaxData: "user", userAccount: 'box' }, function(userData){ $("#ajaxLoginForm").remove(); $("#userAccount").html(userData); }); } else { alert("Błąd logowania! Użytkownik nieistnieje lub konto nie zostało aktywowane"); $("#userAccount").empty(); } }); return false; }); function PoliczRate(koszyk, nrSklepu) { window.open('https://www.eraty.pl/symulator/oblicz.php?numerSklepu='+nrSklepu+'&wariantSklepu=1&typProduktu=0&wartoscTowarow='+koszyk, 'Policz_rate', 'width=630,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no'); } $(".productTitle").hover( function(e) { $(this).append("

    dostawiam

    "); console.log('xxx'); }, function(){ }); function tooltip() { xOffset = 10; yOffset = 20; $(".pokazOpis").hover(function(e){ t = $(this).attr('title'); baseTitle = t; $(this).removeAttr('title'); $("body").append("

    "+ t +"

    "); $("#tooltipA") .css("top",(e.pageY - xOffset) + "px") .css("left",(e.pageX + yOffset) + "px") .fadeIn("fast"); }, function(){ title = baseTitle; $(this).attr('title', title); $("#tooltipA").remove(); }); $(".pokazOpis").mousemove(function(e){ $("#tooltipA") .css("top",(e.pageY - xOffset) + "px") .css("left",(e.pageX + yOffset) + "px"); }); } tooltip(); $("#CartWidget").hover ( function() { $("#CartWidget").stop(true, false).animate({marginLeft: "-224"}, "medium"); }, function() { $("#CartWidget").stop(true, false).animate({marginLeft: "-75"}, "medium"); }, 500 ); $(function() { $("a[rel^='prettyPhoto'], a.lightbox").prettyPhoto({theme:'facebook'}); $("#FBWidget").hover ( function() { $("#FBWidget").stop(true, false).animate({marginLeft: "-242"}, "medium"); }, function() { $("#FBWidget").stop(true, false).animate({marginLeft: "-38"}, "medium"); }, 500 ); $('#slider1').bxSlider ({ auto: true, mode: 'fade', controls: false, pager: true, pause: 6000 //autoControls: true }); $.datepicker.regional['pl'] = { closeText: 'Zamknij', prevText: '<Poprzedni', nextText: 'Następny>', currentText: 'Dziś', monthNames: ['Styczeń', 'Luty', 'Marzec', 'Kwiecień', 'Maj', 'Czerwiec', 'Lipiec', 'Sierpień', 'Wrzesień', 'Październik', 'Listopad', 'Grudzień'], monthNamesShort: ['Sty', 'Lu', 'Mar', 'Kw', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Pa', 'Lis', 'Gru'], dayNames: ['Niedziela', 'Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota'], dayNamesShort: ['Nie', 'Pn', 'Wt', 'Śr', 'Czw', 'Pt', 'So'], dayNamesMin: ['N', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'], weekHeader: 'Tydz', dateFormat: 'yy-mm-dd', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: '' }; $.datepicker.setDefaults($.datepicker.regional['pl']); $('#footer .column').height(Math.max($('#footer .column.A').height(), $('#footer .column.B').height(), $('#footer .column.C').height(), $('#footer .column.D').height())); $('.main-news .news_item h4').height(Math.max($('.main-news .news_item.item1 h4').height(), $('.main-news .news_item.item2 h4').height(), $('.main-news .news_item.item3 h4').height(), $('.main-news .news_item.item4 h4').height())); $('.newsContent').height($('.main-news .news_item').height() - 60); $('.main-news .news_item').height(Math.max($('.main-news .news_item.item1').height(), $('.main-news .news_item.item2').height(), $('.main-news .news_item.item3').height(), $('.main-news .news_item.item4').height())); }); $(".Rotator").css({opacity: 0.0}).hide(); $(".Rotator:first").css({opacity: 1.0}).show(); setInterval('gallery()', 15000); $(".FindText").focus ( function() { if ($(this).val() == 'wpisz wyszukiwane słowo lub frazę') $(this).val(''); } ); $(".FindText").blur ( function() { if ($(this).val() == '') $(this).val('wpisz wyszukiwane słowo lub frazę'); } ); function gallery() { var current = ($('.Rotator.show') ? $('.Rotator.show') : $('.Rotator:first')); var next = ((current.next('.Rotator').length) ? ((current.next('.Rotator').hasClass('show')) ? ('.Rotator:first') : current.next('.Rotator')) : $('.Rotator:first')); next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 1000).show(); current.animate({opacity: 0.0}, 1000).removeClass('show').hide(); }