var arrBanners = new Array();
var intBannerCount = 0;
var intCurBanner = 0;
var itvBannerRotate = 0;
var intBannerSpeed = 4000;
var boolAdmin = false;

function rotateBanner() {
	intTempBanner = intCurBanner + 1;
	if ($(".main-banner > div:eq(" + intTempBanner + ")").length <= 0) {
		intTempBanner = 0;
	}
	$(".main-banner > div:eq(" + intCurBanner + ")").hide();
	$(".main-banner > div:eq(" + intTempBanner + ")").fadeIn("fast");
	intCurBanner = intTempBanner;
}

sfHover = function() {
	var sfEls = document.getElementById("main-navigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

(function($) {
	$(".header #main-navigation li ul").wrap("<div />");
	$(".header #main-navigation .SelectedTab a:first").addClass("active");
	if (($(".main-banner > div").length > 1) && ($("input[value='EDIT']:checked").length <= 0)) {
		$(".main-banner > div").each(function() {
			$(this).hide();
			intBannerCount++;
		});
		$(".main-banner > div:first").fadeIn("fast");
		itvBannerRotate = setInterval(rotateBanner, intBannerSpeed);
	}
	$(".rollover").mouseover(function() {
		var strTemp = $(this).attr("src").replace("-off.","-on.");
		$(this).attr("src",strTemp);
		delete strTemp;
	}).mouseout(function() {
		var strTemp = $(this).attr("src").replace("-on.","-off.");
		$(this).attr("src",strTemp);
		delete strTemp;
	});
	if ($(".landing-tabs li").length > 0) {
		$(".landing-tabs li").mouseenter(function() {
			$(this).addClass("mouseover");
		}).mouseleave(function() {
			$(this).removeClass("mouseover");
		});
	}
})(jQuery);
