$("body").addClass("javascript_enabled");
main_navigation_id ="main_navigation";

$(document).ready(function() {
	var nav_buttons =$(".navigation_button");
	$(nav_buttons).each(function() {
		var button_height =$(this).height();

		if ($(this).hasClass("selected")) {
			$(this).height(button_height+4);
			$(this).css({'paddingTop' : '0px'});
		} else {
			$(this).height(button_height);
		}

		$(this).not(".selected").mouseout(function() {
			$(this).stop();
			$(this).animate({'height' : (button_height) + 'px', 'paddingTop' : '4px'}, { queue: false, duration:400 });
		});
		$(this).not(".selected").mouseover(function() {
			$(this).stop();
			$(this).animate({'height' : (button_height+4) + 'px', 'paddingTop' : '0px'}, { queue: false, duration:100 });
		});
	});
	background_counter =0;

	var backgrounds = $(".header .background");
	$(backgrounds[background_counter]).css("zIndex","6");
	$(backgrounds[background_counter]).show();
	$(backgrounds[background_counter]).siblings(".background").hide();
	setInterval("rotate_background()", 6000);
});

function rotate_background() {
	var backgrounds = $(".header .background");

	var current_background =background_counter;

	if (background_counter == (backgrounds.length-1)) {
		background_counter =0;
	} else {
		background_counter++;
	}

	var next_background =background_counter;

	$(backgrounds[next_background]).show();

	$(backgrounds[current_background]).fadeOut(4000, function() {
		$(backgrounds[current_background]).css("zIndex","5");
		$(backgrounds[next_background]).css("zIndex","6");
	});
	
	return;
}
