// JavaScript Document
$(document).ready(function(){		   
	var $_GET = {};

	document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
		function decode(s) { return decodeURIComponent(s.split("+").join(" ")); }
		$_GET[decode(arguments[1])] = decode(arguments[2]);
	});

	var bl = $_GET["bl"];
	if ( !bl ) {
		/*$("#noe").addClass('act');
		$("#bl_noe").addClass('show');
		$("#bl_noe").show();*/
	} else {
		$("div.blac").hide();
		$("#"+bl).addClass('act');
		$("#bl_"+bl).addClass('show');
		$("#bl_"+bl).show();
		setAbl(bl);
	}
	
	$("#bl li a").click(function () {
		var bln = ($(this).parent().attr("id"));
		$("div.show").hide();
		$("#bl li.act").removeClass('act');
		$("#"+bln).addClass('act');
		$("#bl_"+bln).addClass('show');
		$("#bl_"+bln).show();
		setAbl(bln);
	});
	
	function setAbl(bl){
		$("#leftinnerpage a").attr("href", function(i, href) {
 			splitHref = href.split("?");
			return splitHref[0] + '?bl='+bl;
		});
		$("#header a").attr("href", function(i, href) {
 			splitHref = href.split("?");
			return splitHref[0] + '?bl='+bl;
		});
		$("#logo a").attr("href", function(i, href) {
 			splitHref = href.split("?");
			return splitHref[0] + '?bl='+bl;
		});
	}
	
	 $("map[name='AUT'] area").hover(
	
          function(){$("#autmap").attr("src","img/bl/aut_"+this.id+".png")},
          function(){$("#autmap").attr("srx","img/bl/aut.png");
     });

});
