$(document).ready(function () {
	var hideControls = true;
	$("div.banner").hover(function () {
		$("p.jshowoff-controls").fadeIn(150);
	}, function () {
		hideControls = setTimeout(function () { hideArrows() }, 3000);
	});

	$("div.banner a").hover(function () {
		clearTimeout(hideControls);
	});

	function hideArrows() {
		$("p.jshowoff-controls").fadeOut(150);
	}

	$("div.contentNarrow").width(603);
	$("input.sfsearchTxt").val("Search...");
	$("input.sfsearchTxt").blur(function () {
		if ($(this).val() == '') {
			$(this).css("color", "#666666").val("Search...");
		}
	});
	$("input.sfsearchTxt").focus(function () {
		if ($(this).val() == 'Search...') {
			$(this).val("");
		}
	});

	$("div.siteContent>div.sf_cols").each(function () {
		$('<div class="top"></div>').insertBefore($(this));
		$('<div class="bottom"></div>').insertAfter($(this));
		$(this).addClass("middle");
	});

	var x = 1;
	$("ul.rmRootGroup>li").each(function () {
		$(this).children("a").removeAttr("title");
		switch (x) {
			case 1: $(this).width(70); break;
			case 2: $(this).width(80); break;
			case 3: $(this).width(85); break;
			case 4: $(this).width(65); break;
			case 5: $(this).width(75); break;
			case 6: $(this).width(117); break;
			case 7: $(this).width(95); break;
			case 8: $(this).width(85); break;
			case 9: $(this).width(75); break;
		}
		if ($(this).children("div.rmSlide").length > 0) {
			$(this).children("a").append('<span class="imgIcon"></span>');
		}
		x++;
	});

	$("ul.rmVertical.rmLevel2>li.rmFirst").each(function () {
		$(this).parent("ul").prepend('<li class="floatTop"></span>');
	});

	$("h3").each(function () {
		if ($(this).parent("div").next("span").html() == '') {
			$(this).parent("div").next("span").append("<ul><li>No current items.</li></ul>")
		};
	});

	$("ul.sfnewsList a").each(function () {
		if ($(this).attr("href").indexOf('fall-harvest-and-tillage-expo-clinic-registration') > 0) {
			$(this).attr("href", "/event-signup");
		};
	});

	$("input.sfsearchSubmit").val("");

	$("div.siteContent div.sfContentBlock").addClass("content");

	$("div.banner").jshowoff({ speed: 5000, links: true, controls: true, effect: 'fade', hoverPause: false });
	/*
	$("div.siteNav ul.mainNav>li").hover(function () {
	var newHeight;
	$(this).children("a").children("img").attr("src", "img/drop-down-icon-hover.png");
	if ($(this).children("div.subNav").length > 0) {
	newHeight = $(this).children("div.subNav").children("ul").height() + 30;
	$(this).children("div.subNav").animate({
	height: '+=' + newHeight
	}, 200);
	}
	}, function () {
	$(this).children("a").children("img").attr("src", "img/drop-down-icon.png");
	if ($(this).children("div.subNav").length > 0) {
	newHeight = $(this).children("div.subNav").children("ul").height() + 30;
	$(this).children("div.subNav").animate({
	height: '-=' + newHeight
	}, 200);
	}
	});
	*/
});
