/**
* Javascript for Footer Logos
*
* @package js
* @author Tim Carr
* @version 1
* @copyright n7 Studios 2009
*/
$(document).ready(function() {
    // When the DOM is ready start the image reloading process
    $(document).everyTime(speed, function(e) {
        // Fade out, set HTML and fade back in
        // It seems this runs asynchronously, and p / count gets incremented before we've faded out / in
        // Store the current state of p and count for this instance
        thisP = p;
        thisCount = count;
        $('li.item_'+thisP).fadeOut(0, function() {
            $('li.item_'+thisP).html('<a href="'+urls[thisCount]+'"><img src="wp-content/themes/awards/images/member-logos/'+images[thisCount]+'" width="95" height="74" alt="'+names[thisCount]+'" /></a>');
            $('li.item_'+thisP).fadeIn(fadeInTime);
        });                    
                                
        // Elements and counts
        if (p == maxLogosToDisplay) {
            p = 0;
        } else {
            p++;
        }
        if (count >= (memberLogos-1)) {
            count = 0;
        } else {
            count++; 
        }
    }); 
});