// JavaScript Document
<!--
$(document).ready(function() {
		var loaded = 0;
		var timerId = 0;
		var current = null;

		var stop = function() {
			clearTimeout(timerId);
			timerId = 0;
		};

		var resume = function(e) {
			timerId = window.setTimeout(e, 4000);
		};

		var original = $("#home_photo");

		original.fadeIn(1000,function() { loaded = 1; });

		$(".banner_image").each(function(i) {
			if($(this).attr('id') != 'banner_image') {
				var banner = $(this);
				
				var e = function() {
					banner.hide();
					original.fadeIn(1000);
				};

				$(this).mouseover(function() { stop(); });
				$(this).mouseout(function() { resume(e); });
			}
		});

		$("#banner_sub > a").each(function(i) {
			i++;
			var banner = $('#banner_image'+i);
			var current = $('#current_image');

			$(this).mouseover(function() {
				if(!loaded)
					return;

				original.hide();

				if(current.val() != '')
					$('#banner_image'+current.val()).hide();

				current.val(i);
				banner.show();
				
				stop();
			});

			$(this).mouseout(function() {
				if(!loaded)
					return;

				var e = function() {
					banner.hide();
					original.fadeIn(1000);
				};

				resume(e);
			});
		});
	});
//-->
