$(document).ready(function(){
			var picwid = 388,
				wrapper = $('div.portfolio-thumb'),
				ul = wrapper.find('> ul'),
				li = ul.find('> li'),
				len = li.length,
				wlen = -picwid * len,
				x=-picwid,
				
				first = li.filter(":first"),
				last = li.filter(":last");
				
			
			first.clone().appendTo(ul);
			last.clone().prependTo(ul);
			ul.css('left', '-388px');
			
			$("a.rarr").click(function(){
				if(x > wlen){
					x-=picwid;	
					ul.animate( { left:""+x+"px" }, { queue:true, duration:750 } )
				}
				else {
					x-=picwid;	
					ul.animate( { left:""+x+"px" }, { queue:true, duration:750 } )
					x=0;
					x-=picwid;
					ul.animate( { left:""+x+"px" }, { queue:true, duration:0 } )
				};
			});
			$("a.larr").click(function(){
				if(x < -picwid){	
					x+=picwid;
					ul.animate( { left:""+x+"px" }, { queue:true, duration:750 } )
				}
				else {
					x+=picwid;	
					ul.animate( { left:""+x+"px" }, { queue:true, duration:750 } )
					x=wlen;
					ul.animate( { left:""+x+"px" }, { queue:true, duration:0 } )
				};
			});
		});
