// ************************ // *** animacje JD menu *** // ************************ function onAnimateFadeInOut(show) {if (show) {$(this).hide().fadeIn('normal');} else {$(this).fadeOut('normal');}} function onAnimateSlideUpDown(show) {if (show) {$(this).hide().slideDown('fast');} else {$(this).slideUp('fast');}} function onAnimateSlideLeftRight(show) {if (show) {$(this).hide().animate({width: 'show'}, 'fast');} else {$(this).animate({width: 'hide'}, 'fast');}} function onAnimateShowHide(show) {if (show) {$(this).hide().show('normal');} else {$(this).hide('normal');}} // *********************** $.extend($.validator.messages, {required: "required"}); $(document).ready(function(){$("#CMSform").validate({errorElement: "span", errorPlacement: function(error, element) {error.appendTo(element.parent().prev());}}); $("a.slidedown").click(function(event){event.preventDefault(); if ($(this).hasClass("slidedown")) {$('#linkBox div').hide().slideDown('fast');$('#linkownia').removeClass();$('#linkownia').addClass('slideup');} else {$('#linkownia').removeClass();$('#linkownia').addClass('slidedown');$('#linkBox div').slideUp('fast')}});$(".msg_body").hide(); $(".msg_body").hide(); $(".msg_head").click(function(){ $(this).next(".msg_body").slideToggle(50); if ($(this).is('.opened')) { $(this).removeClass('opened'); } else { $(this).addClass('opened'); } }); $(".download_list").hide(); $(".download_title").click(function(){ $(this).next("ul").slideToggle(50); if ($(this).is('.opened')) { $(this).removeClass('opened'); } else { $(this).addClass('opened'); } }); }); // ******************** // *** site map hover *** // ******************** $(document).ready(function(){$("#sitemap li").hover(function () {$(this).addClass("hover");}, function () {$(this).removeClass("hover");});}); // *** news slide *** $(function(){ if ($('.SlideTab').length) { $('.SlideTab').tabSwitch('create',{width: 222, height: 90}); $('.SlideTab').tabSwitch('startAuto',{interval: 8000}); $('.Nav').click(function(e){ $('.SlideTab').tabSwitch('moveStep',{step: parseInt($(this).attr("rel"))}); e.preventDefault(); }); } }); // *** tabs *** $().ready(function() { $(".content_tabs div:first").addClass("firstTab"); $(".bookmarks li a").click(function() { $(".bookmarks .active").removeClass("active"); $(this).parent().addClass("active"); var element_index = $(".bookmarks a").index(this); $(".content_tabs div.tab:visible").hide(); $(".content_tabs div.tab").eq(element_index).show(); return false; }); }); // *** accordion *** $(document).ready(function(){ var ktoreAktywne=99; if ($('#accordion .spolka').length){ var ktoreAktywne=0; } if ($('#accordion .rynek').length){ var ktoreAktywne=1; } $("#accordion").accordion({ collapsible: true, active: false, autoHeight: false, active: ktoreAktywne}); $("#accordion2").accordion({ collapsible: true, active: false, autoHeight: false}); $("#accordion3").accordion({ collapsible: true, active: false, autoHeight: false }); $("#accordion4").accordion({ collapsible: true, active: false, autoHeight: false }); //$(".openBox").css("display","block").removeClass("openBox"); //var ooo = $("#accordion h3").attr("id"); //alert(ooo); }); // PNG Fix $("#menubar").ready(function(){$(document).pngFix();}); // footer hover $(document).ready(function(){ $("#footSub .right span").hover( function () {$(this).addClass("hover");}, function () {$(this).removeClass("hover");} ); }); // newsletter hover $(document).ready(function(){ $("form[name=newsletter] input[name=validateAndSend_guest_subscribe1:method]").hover( function () {$(this).attr("src", "ff_gfx_templates/produktowy/images/newsletterButtonHover.gif");}, function () {$(this).attr("src", "ff_gfx_templates/produktowy/images/newsletterButton.gif");} ); }); // ****************************** // *** formularze - opis pola *** // ****************************** $(document).ready(function() {$('input[type="text"]').addClass("idleField");$('input[type="text"]').focus(function() {$(this).removeClass("idleField").addClass("focusField");if (this.value == this.defaultValue){this.value = '';}if(this.value != this.defaultValue){this.select();}});$('input[type="text"]').blur(function() {$(this).removeClass("focusField").addClass("idleField");if ($.trim(this.value) == ''){this.value = (this.defaultValue ? this.defaultValue : '');}});}); $(document).ready(function() {$('textarea').addClass("idleField");$('textarea').focus(function() {$(this).removeClass("idleField").addClass("focusField");if (this.value == this.defaultValue){this.value = '';}if(this.value != this.defaultValue){this.select();}});$('textarea').blur(function() {$(this).removeClass("focusField").addClass("idleField");if ($.trim(this.value) == ''){this.value = (this.defaultValue ? this.defaultValue : '');}});}); // ******************************* // *** tabela z danymi prduktu *** // ******************************* $(document).ready(function(){ $(".tabela_ramka tr td:last-child, .tabela_ramka tr th:last-child").addClass("noborder"); $(".table_data tr td:last-child, .table_data tr th:last-child").addClass("noborder"); if($("#accordion2").length){ $("#accordion2 h3:first").click(function(){ var szerokoscTabeli = $(".table_data").width(); wyswietlSlider(szerokoscTabeli); }) } else { var szerokoscTabeli = $(".table_data").width(); wyswietlSlider(szerokoscTabeli); } function wyswietlSlider(szerokoscTabeli) { $("#content-slider").css({'display' : 'none'}) if (szerokoscTabeli > 562) { $("#content-slider").css({'display' : 'block'}).slider({animate: true, change: handleSliderChange, slide: handleSliderSlide}); } else { $(".table_data-desc").addClass("noscrol"); } } }); function handleSliderChange(e, ui) { var maxScroll = $("#content-scroll").attr("scrollWidth") - $("#content-scroll").width(); $("#content-scroll").animate({scrollLeft: ui.value * (maxScroll / 100) }, 100); } function handleSliderSlide(e, ui) { var maxScroll = $("#content-scroll").attr("scrollWidth") - $("#content-scroll").width(); $("#content-scroll").attr({scrollLeft: ui.value * (maxScroll / 100) }); } // kolorowanie wierszy $(document).ready(function(){ $(".table_data-desc tr:even, .table_data tr:even").addClass("even"); }); // ********************************** // *** piktogramy - strona glowna *** // ********************************** $(document).ready(function(){ $("#tab1-ul a").hover(function(){ var aktywnyLink = $(this).attr("class"); var aktywnyPik = $("#piktogramy").find("."+aktywnyLink); $(aktywnyPik).addClass("hoverPik"); }, function () { $("#piktogramy li").removeClass("hoverPik"); }); $("#piktogramy li").hover(function(){ //var aktywnyLink = $(this).attr("class"); //var aktywnyPik = $("#piktogramy").find("."+aktywnyLink); //alert(aktywnyLink); var aktywnyPik = $(this).attr("class"); var aktywnyLink = $("#tab1-ul1, #tab1-ul2, #tab1-ul3").find("."+aktywnyPik); $(aktywnyLink).addClass("hoverLink"); $(this).addClass("hoverPik"); }, function () { $("#piktogramy li").removeClass("hoverPik"); $("#tab1-ul1 a, #tab1-ul2 a, #tab1-ul3 a").removeClass("hoverLink"); }); });