Demonstrating basic cross fade function
In the code below, you will find a function called fadeOut, others may include fadeIn function in their tutorials but that isn't included this code. As the function name defines, it does the fade out.
How it works
In absence of fadeIn function, you will find helper functions such as rotatePics and slideImages functions that do exactly what their names describe. The code is self-explanatory, however, comments are included to aid readability.