
function slideSwitch(){var $active=$('#slideshow img.active');if($active.length==0)$active=$('#slideshow img:last');var $next=$active.next().length?$active.next():$('#slideshow IMG:first');$active.addClass('last-active');$next.css({opacity:0.0}).addClass('active').animate({opacity:1.0},2000,function(){$active.removeClass('active last-active');});}
function initImageBrowser(){var settings={imageLoading:'/images/nf.lightbox/loading.gif',imageBtnPrev:'/images/nf.lightbox/prev.png',imageBtnNext:'/images/nf.lightbox/next.png',imageBtnClose:'/images/nf.lightbox/close.png',imageBlank:'/images/nf.lightbox/blank.gif',imageBtnBottomPrev:'/images/nf.lightbox/btm_prev.gif',imageBtnBottomNext:'/images/nf.lightbox/btm_next.gif',imageBtnPlay:'/images/nf.lightbox/start.png',imageBtnStop:'/images/nf.lightbox/pause.png',txtImage:"Zdjęcie",txtOf:'z',txtPrev:'Poprzednie',txtNext:'Następne'};$('#thumbnails a').lightBox(settings);};function orderImageFormsHandler(){function rebuildOrderImageForms(){i=0;jQuery('.order_image tbody tr').each(function(){jQuery(this).children('.filename').children('input').attr('id','order_images_'+i+'_filename').attr('name','order[images]['+i+'][filename]');jQuery(this).children('.format').children('select').attr('id','order_images_'+i+'_format').attr('name','order[images]['+i+'][format]');jQuery(this).children('.paper_type').children('select').attr('id','order_images_'+i+'_paper_type').attr('name','order[images]['+i+'][paper_type]');jQuery(this).children('.quantity').children('input').attr('id','order_images_'+i+'_quantity').attr('name','order[images]['+i+'][quantity]');i++;});}
var rows=jQuery('.order_image tbody tr');jQuery('#add_order_image_form').click(function(){var new_row=rows.last().clone();new_row.children('.quantity').append('<button class="order_image_delete">Usuń</button>');new_row.children('.quantity').children('.order_image_delete').click(function(){jQuery(this.parentNode.parentNode).remove();rebuildOrderImageForms();return false;});rows.parent().append(new_row);rebuildOrderImageForms();return false;});};$(function(){setInterval("slideSwitch()",6000);initImageBrowser();orderImageFormsHandler();});