function update_header_data_bar(exp, level, morale, gold, vault, military, population, rank, off, def, spy, magic, exptolevel) {	
	$("#header_experience").html(exp);
	$("#header_level").html(level);
	$("#header_morale").html(morale);
	$("#header_gold").html(gold);
	$("#header_vault").html(vault);
	$("#header_military").html(military);
	$("#header_population").html(population);
	$("#header_rank").html(rank);
	$("#header_offence").html(off);
	$("#header_defence").html(def);
	$("#header_spy").html(spy);
	$("#header_magic").html(magic);
	$("#header_exptolevel").html(exptolevel);
}

function redirect(location) {
	window.location = location;
}

function review_site_update(site) {
	$.ajax({
	   type: "POST",
	   url: "/js/ajax/update_viewed_adverts.php",
	   data: "site=" + site
	});
}

$(function() {
	// show/hide nav blocks
	$("#banner_nav > span").hover(function() {
		$(this).find("div").show();
		$(this).addClass("active");
		$(this).find("a").addClass("active");
	}, function() {
		$(this).find("div").hide();
		$(this).removeClass("active");
		$(this).find("a").removeClass("active");
	});
	
	// highlight nav items on hover
	$("#banner_nav .nav_item").hover(function() {
		$(this).find("span").addClass("active");
	}, function() {
		$(this).find("span").removeClass("active");
	});
	
	// show/hide widgets & save status
	$(".widget .collapsesub img").click(function() {
		if($(this).attr("src").indexOf('minus') > 0) {
			$(this).parents(".widget").find(".widget_content").slideUp(500);
			$(this).attr("src", "/images/guilds/add.png");
			status    = "N";
		} else {
			$(this).parents(".widget").find(".widget_content").slideDown(500);
			$(this).attr("src", "/images/guilds/minus.png");
			status = "Y";
		}
		update = $(this).parents(".widget").find(".to_update").html();
		$.ajax({
		   type: "POST",
		   url: "/js/ajax/save_widgets.php",
		   data: "update=" + update + "&status=" + status
		});
	});
	
	
	
});