$(document).ready(function(e){var spacing=16.6,$slider=$('#slider .item'),itemHeight=0;var prev=$("<span class='prev'></span>").appendTo('#slider').hide();var next=$("<span class='next\'></span>").appendTo('#slider').hide();function onResize(){$('#slider').show();itemHeight=0;$slider.each(function(){if(itemHeight<$(this).find('img').outerHeight()+$(this).find('strong').outerHeight()){itemHeight=$(this).find('img').outerHeight()+$(this).find('strong').outerHeight();}});$slider.css('height',itemHeight);$('#slider .sliderline').height(itemHeight);prev.show();next.show();}$(window).resize(function(){onResize()});window.onload=onResize;var sliderStart=function(){$slider=$('#slider .item');$('#slider .prev').unbind('click');$('#slider .next').unbind('click');$slider.eq(0).css('left',0);$slider.eq(1).css('left',spacing+"%");$slider.eq(2).css('left',2*spacing+"%");$slider.eq(3).css('left',3*spacing+"%");$slider.eq(4).css('left',4*spacing+"%");$slider.eq(5).css('left',5*spacing+"%");$slider.eq(6).css('left',6*spacing+"%");$('#slider .prev').click(function(event){$(this).unbind('click');$slider.eq(0).animate({'left':spacing+"%"},'slow');$slider.eq(1).animate({'left':2*spacing+"%"},'slow');$slider.eq(2).animate({'left':3*spacing+"%"},'slow');$slider.eq(3).animate({'left':4*spacing+"%"},'slow');$slider.eq(4).animate({'left':5*spacing+"%"},'slow');$slider.eq(5).animate({'left':6*spacing+"%"},'slow');$slider.eq($slider.length-1).css('left',-1*spacing+"%").animate({'left':"0px"},'slow',function(){$(this).prependTo('#slider .sliderline');sliderStart();});event.preventDefault();});$('#slider .next').click(function(event){$(this).unbind('click');$slider.eq(0).animate({'left':-1*spacing+"%"},'slow',function(){$(this).appendTo('#slider .sliderline').css('left',5000);sliderStart();});$slider.eq(1).animate({'left':0},'slow');$slider.eq(2).animate({'left':spacing+"%"},'slow');$slider.eq(3).animate({'left':2*spacing+"%"},'slow');$slider.eq(4).animate({'left':3*spacing+"%"},'slow');$slider.eq(5).animate({'left':4*spacing+"%"},'slow');$slider.eq(6).animate({'left':5*spacing+"%"},'slow');event.preventDefault();});}
sliderStart();});