function scrollSwitch() {
	$(".header_banner.active").each(function() {
		var currentActive = $(this);
		var bgurl = $("img:first", this).attr("src");
		var index = $(".header_banner").index(this);
		var nextElement;
		if (index == $(".header_banner").length - 1) {
			nextElement = 0;
		} else {
			nextElement = index + 1;
		}
		$(".header_banner:eq("+nextElement+")").addClass("active").each(function() {
			if ($(this).hasClass("slide-vert")) {
				$("img", this).hide();
				$(this).show().css("background", "url('"+bgurl+"')");
				$(".slide-top", this).show("slide", {direction: "up"}, 600);
				$(".slide-bottom", this).show("slide", {direction: "down"}, 600);
				var wait = setTimeout(currentActive.hide(), 10000);
			} else if ($(this).hasClass("slide-horiz")) {
				$("img", this).hide();
				$(this).show().css("background", "url('"+bgurl+"')");
				$(".slide-left", this).show("slide", {direction: "left"}, 600);
				$(".slide-right", this).show("slide", {direction: "right"}, 600);
				var wait = setTimeout(currentActive.hide(), 10000);
			} else {
				$(this).fadeIn(300, function() {
					currentActive.fadeOut(300);
				});
			}
		});
	}).removeClass("active");
} //scrollSwitch

$(document).ready(function() {
	$(".header_banner").removeClass("hidden").hide();
	$(".header_banner:first").show().addClass("active");
	var timer = setInterval("scrollSwitch()", 4000);				
});