
						$(document).ready(function() {
							rotatePics(1);
							rotateText(1);
						});
						
						function rotatePics(currentPhoto) {
							var numberOfPhotos = $('#slides .slide img').length;
							currentPhoto = currentPhoto % numberOfPhotos;
							
							$('#slides .slide img').eq(currentPhoto).fadeOut(function() {
								//re-order the z-index
								$('#slides .slide img').each(function(i) {
									$(this).css(
										'zIndex',((numberOfPhotos - i) + currentPhoto) % numberOfPhotos
									);
								});
								
								$(this).show();
								setTimeout(function() {rotatePics(++currentPhoto);}, 12000);
							});
						}
						
						function rotateText(currentText) {
							var numberOfTexts = $('#slides .slide .slideText').length;
							currentText = currentText % numberOfTexts;
							
							$('#slides .slide .slideText').eq(currentText).fadeOut(function() {
								//re-order the z-index
								$('#slides .slide .slideText').each(function(i) {
									$(this).css(
										'zIndex',((numberOfTexts - i) + currentText) % numberOfTexts
									);
								});
								
								$(this).show();
								setTimeout(function() {rotateText(++currentText);}, 12000);
							});
						}

