(function ($) {
	$(document).ready(function() {
		var ButtonHovers = {
			images: {
				'submit': {
					'standard': '/img/buttons/button-submit.png',
					'hover': '/img/buttons/button-submit-hover.png'
				},
				'go': {
					'standard': '/img/buttons/button-go.png',
					'hover': '/img/buttons/button-go-hover.png'
				}
			},
			submit: $('.submit input[type=image]'),
			go: $('#quick_search .submit'),
			
			initialize: function() {
				ButtonHovers.preloadImages();
				
				ButtonHovers.submit.each(function() {
					$(this).mouseover(function(e) {
						$(this).attr('src', ButtonHovers.images.submit.hover);
					});
					$(this).mouseout(function(e) {
						$(this).attr('src', ButtonHovers.images.submit.standard);
					});
				});
				
				ButtonHovers.go.each(function() {
					$(this).mouseover(function(e) {
						$(this).attr('src', ButtonHovers.images.go.hover);
					});
					$(this).mouseout(function(e) {
						$(this).attr('src', ButtonHovers.images.go.standard);
					});
				});
			},
			
			preloadImages: function() {
				var submitHover = new Image();
				submitHover.src = ButtonHovers.images.submit.hover;
				var goHover = new Image();
				goHover.src = ButtonHovers.images.go.hover;
				
				return true;
			}
		}
		
		ButtonHovers.initialize();
	});
})(jQuery);