// JavaScript Document

$(document).ready(function() {



// contact form
	
	$('#step3, #step4').hide();
		
	$('#gotostep2').click(function() {
								   
		$('#step1, #step2').fadeOut(function() {
									 
			$('#step3, #step4').fadeIn();
				
			}); // end "fadeOut"
	
		return false;
			
	}); // end "click"
	
	
	
		
	$('#gotostep1').click(function() {
								   
		$('#step3, #step4').fadeOut(function() {
									 
			$('#step1, #step2').fadeIn();
				
			}); // end "fadeOut"
		
		return false;
			
	}); // end "click"



// create automated image rollovers

	$('.mainnav img').each(function() {    // pulls all <img> tags inside div class "mainnav"
	
		var imgFile = $(this).attr('src');    // pulls each image's "src" attribute in turn
		
		var preloadImage = new Image();    // creates preload function
		
		preloadImage.src = imgFile.replace(/.jpg/, '2.jpg');    // uses "replace" function to make, e.g., "home2.jpg" out of "home.jpg"
		
		$(this).hover(    
		
			function() {    // jQuery "hover" function takes two arguments, first "mouseover" and then "mouseout"
			
				$(this).attr('src', preloadImage.src);
				
			},
			
			function() {
			
				$(this).attr('src', imgFile);
		
			}
		
		); // end "hover"
	
	}); // end "each"
	
	
    	
}); // end "ready"