What is a more readable version of this slideshow code?
<p>I am trying to learn by making my own jQuery slideshow based on existing open source code on the net.</p>

<p>I am getting lost in one chunk of coding and I think it's mainly because I am not very strong to begin with in programming/jQuery, and also the guy who wrote it used a bunch of ternary operators (I believe that's what this is).</p>

<p>Could someone please help me break this down and maybe even replace the ternary operators with more "traditional" operators?</p>

<pre><code>//if no IMGs have the show class, grab the first image
var current = ($('ul.slideshow li.show') ?  $('ul.slideshow li.show') : $('#ul.slideshow li:first'));

//Get next image, if it reached the end of the slideshow, rotate it back to the first image
var next = ((current.next().length) ? ((current.next().attr('id') == 'slideshow-caption') ? $('ul.slideshow li:first') :current.next()) : $('ul.slideshow li:first'));
</code></pre>

<p>I am mostly confused on the last line.</p>
