			var bDoGallery = true;
			var bIsFadeActive = false;
			var galleryIndex = 0;
			var newGalleryIndex = 0;
			var items = null;
			var timeOut = null;
			var imageSwapDelay = 8000;
			var fadeTime = 3000;
    	function doGallery() {
    		if( bDoGallery ) {
	        newGalleryIndex = galleryIndex + 1 < items.size() ? galleryIndex + 1 : 0;
	        $( items[galleryIndex] ).fadeOut( fadeTime );
	        $( items[newGalleryIndex] ).fadeIn( fadeTime );
	        galleryIndex = newGalleryIndex;
	        timeOut = setTimeout( "doGallery();", imageSwapDelay );
	      }
    	}

	    $( document ).ready( function() {
	    		items = $( ".galleryImage" );
	    		galleryIndex = Math.floor( Math.random() * items.size() );

	        items.each(function(i) {
            $(items[i]).mouseover(function() {
               bDoGallery = false;
            });
            
            $(items[i]).mouseout(function() {
                bDoGallery = true;
                if( !bIsFadeActive ) {
                	clearTimeout( timeOut );
                	timeOut = setTimeout( "doGallery();", 2000 );
                }
            });
	            
	        });

		    	$( ".galleryImage" )[galleryIndex].style.display = "block";			
		    	timeOut = setTimeout( "doGallery( galleryIndex );", imageSwapDelay );

					$("#subscribe").hover(
					 function()
					 {
					  this.src = this.src.replace("_off","_on");
					 },
					 function()
					 {
					  this.src = this.src.replace("_on","_off");
					 }
					);

	    });



