$(document).ready(function(){ /* confirm */ $('a.confirm,input.confirm,button.confirm').click(function(){ var answer = 'Czy napewno chcesz to zrobić?'; var title = $(this).attr('title'); if(title != '' && title != ' '){ if(confirm(title)){ return answerTitle; }else{ return false; } }else{ if(confirm(answer)){ return answer; }else{ return false; } } }); /* end confirm */ /* form-inner-url */ $('#form-inner-url').change(function(){ var $selected = $(this).find('option:selected').attr('value'); if($selected==''){ $(this).parents('form').find('.hidden-for-empty').fadeIn(); } else { $(this).parents('form').find('.hidden-for-empty').fadeOut(); } }); /* end form-inner-url */ /* sortable */ $('#sortable').sortable({ items: 'tr', update: function(event,ui){ $(this).find('input[name=ord]').each(function(index){ $(this).attr('value',index+1); }); if($('#sortable').parents('form').find('#sortable-save').length===0){ $('#sortable').parents('table').after('
'); } } }); $('#sortable').disableSelection(); /* end sortable */ /* elementSlider */ var $rotationId; var $slider_length = $("#elementSlider nav ul li").length; if($slider_length>1){ var $rotateTime = 25000; var $rotateTimeInterval = 40000; function rotateSlider(){ var $item = $('#elementSlider nav ul').find('li.active').is("li:last-child"); if($item===true){ $('#elementSlider ul.list li.active').fadeOut(600).removeClass('active').find('.images').css({ marginRight: '0px', marginLeft: '0px' }).animate({ marginLeft: '-=200' }, 500); $('#elementSlider nav ul li').removeClass('active'); $('#elementSlider ul.list li').eq(0).fadeIn(600).addClass('active').find('.images').css({ marginRight: '-200px', marginLeft: '0px' }).animate({ marginRight: '+=200' }, 500); $('#elementSlider nav ul li').eq(0).addClass('active'); }else{ var $eq = $('#elementSlider ul.list li.active').index(); $('#elementSlider ul.list li.active').fadeOut(600).removeClass('active').find('.images').css({ marginRight: '0px', marginLeft: '0px' }).animate({ marginLeft: '-=200' }, 500); $('#elementSlider nav ul li').removeClass('active') $('#elementSlider ul.list li').eq($eq+1).fadeIn(600).addClass('active').find('.images').css({ marginRight: '-200px', marginLeft: '0px' }).animate({ marginRight: '+=200' }, 500); $('#elementSlider nav ul li').eq($eq+1).addClass('active'); } window.clearInterval($rotationId); $rotationId = window.setInterval(rotateSlider,$rotateTime); } $rotationId = window.setInterval(rotateSlider,$rotateTime); } $('#elementSlider nav ul li').click(function(){ var $eq = $(this).index(); var $eq_active = $('#elementSlider nav ul li.active').index(); if($eq!=$eq_active){ $('#elementSlider ul.list li.active').fadeOut(600).removeClass('active').find('.images').css({ marginRight: '0px', marginLeft: '0px' }).animate({ marginLeft: '-=200' }, 500); $('#elementSlider nav ul li').removeClass('active'); $('#elementSlider ul.list li').eq($eq).fadeIn(600).addClass('active').find('.images').css({ marginRight: '-200px', marginLeft: '0px' }).animate({ marginRight: '+=200' }, 500); $('#elementSlider nav ul li').eq($eq).addClass('active'); window.clearInterval($rotationId); $rotationId = window.setInterval(rotateSlider,$rotateTime); } }); /* end elementSlider */ /* partnerSlider */ function mycarousel_initCallback(carousel){ // Disable autoscrolling if the user clicks the prev or next button. carousel.buttonNext.bind('click', function() { carousel.startAuto(0); }); carousel.buttonPrev.bind('click', function() { carousel.startAuto(0); }); // Pause autoscrolling if the user moves with the cursor over the clip. carousel.clip.hover(function() { carousel.stopAuto(); }, function() { carousel.startAuto(); }); }; jQuery('#horiz_container').jcarousel({ auto: 3, wrap: 'both', easing: 'easeOutQuad', initCallback: mycarousel_initCallback }); $("#horiz_container_outer").hover(function(){ $(this).find('.jcarousel-prev').fadeIn(); $(this).find('.jcarousel-next').fadeIn(); },function(){ $(this).find('.jcarousel-prev').fadeOut(); $(this).find('.jcarousel-next').fadeOut(); },500); /* end partnerSlider */ /* header nav */ $("#header nav.main > ul > li").hover(function(){ $(this).addClass('hover').find('ul').show(); }, function(){ $(this).removeClass('hover').find('ul').hide(); }); /* end header nav */ /* colorbox */ $("a[rel='lightbox'],a[rel='gallery'],a.gallery").colorbox({ slideshowSpeed:10000, slideshow:true, initialHeight:300, maxHeight:'90%', initialWidth:600, maxWidth:'90%', current:"Zdjęcie {current} z {total}", previous:"Poprzednie", next:"Następne", close:"Zamknij", slideshowStart:"Włącz pokaz slajdów", slideshowStop:"Zatrzymaj pokaz slajdów" }); /* end colorbox */ /* ------------------------------------------------------------------------------------------------------------- */ // ifie // lt ie <=8 if($.browser.msie && $.browser.version.substr(0,1)<=8){ $('ul li:first-child, ol li:first-child, table tr th:first-child, table tr td:first-child').addClass('first-child'); $('ul li:last-child, ol li:last-child, table tr th:last-child, table tr td:last-child').addClass('last-child'); $('table tr:odd, ul li:odd, ol li:odd').addClass('odd'); $('table tr:even, ul li:even, ol li:even').addClass('even'); $('.box .recommended ul li:nth-child(3n+1)').addClass('3n1'); }; // lt ie <=8, opera if(($.browser.msie && $.browser.version.substr(0,1)<=8) || $.browser.opera){ $('table tr th:first-child, table tr td:first-child').prepend(''); $('table tr th:last-child, table tr td:last-child').prepend(''); }; // lt ie <=7 if($.browser.msie && $.browser.version.substr(0,1)<=7){ $('.photo a, a.photo').click(function(){ window.location=$(this).attr("href"); return false; }); }; /* ------------------------------------------------------------------------------------------------------------- */ });