// JavaScript Document

			// ---------------------------------------------
			// controls move gal down			
			// ---------------------------------------------

//			$(function(){
//			
//				$("div.scrollDown").mouseover(function () { // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ADD THIS AS AN ARROW TO THE PAGE
//				
//				// get height of div as css attribute of "div.galleryScrollPanel" 
//				
//				$("div.galleryScrollPanel").scrollTo( '520px', 800, {duration:3000} );
//				
//				}) // end of mouseover
//				
//				
//				$("div.scrollUp").mouseover(function () { // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ADD THIS AS AN ARROW TO THE PAGE
//				
//				// get height of div as css attribute of "div.galleryScrollPanel" 
//				
//				$("div.galleryScrollPanel").scrollTo( '0px', 200, {duration:3000} );
//				
//				}) // end of mouseover
//
//			});
					

			// ---------------------------------------------
			// rollover in gal thumbnails				
			// ---------------------------------------------			

			$(document).ready(function() {
			
				$('#gallery img').each(function() {
					var imgFile = $(this).attr('src');
					var preloadImage = new Image();
					preloadImage.src = imgFile.replace('_BW.','_TH.');
						
					$(this).hover(
						function() {
							$(this).attr('src', preloadImage.src);
						},
						function () {
							$(this).attr('src', imgFile);
						}
					); // end hover
				}); // end each
				
			}); // end ready()		
				
			// ---------------------------------------------
			// load and fade in main image				
			// ---------------------------------------------
			
			$(document).ready(function() {	
				
			$('div.foo a.gallery').click(function(evt) {
				//don't follow link
				 evt.preventDefault();
				 //get path to new image
			   var imgPath = $(this).attr('href');
				 //get reference to old image
				 var oldImage = $('#mainstage_home img');
				 //check to see if they're the same image
			
					
					 //create HTML for new image
					 var newImage = $('<img src="' + imgPath +'">');
					 //make new image invisible
					 newImage.hide();
					 
					 //fade out old image and remove from DOM
					 //oldImage.fadeOut(1000,function(){
					 //$(this).remove();
					 //	});
					
					 oldImage.remove();	
									 
					 //add to the #photo div
					 $('#mainstage_home').prepend(newImage);
					 //fade in new image
					 newImage.fadeIn(1000);
					 
			}); // end click
		
		$('div.foo a.gallery:first').click();
				
				
				
					
		}); // end ready()	
