﻿var actPage;


$(document).ready(

	function(){
	
		var tmp = document.location.href.split("/").pop();
		
		if(tmp.indexOf('?') != -1)
			tmp = tmp.split('?').shift();
		
		tmp != "" ? actPage = tmp : actPage = "index.html";
		
		$('#menu a').each(
			function(){
			
				var blockDiv = '#b_' + $(this).attr('href').replace(/(\.html|\.php)/, '');
				
				if($(this).attr('href') == actPage)
					$(blockDiv).css({'background-color':'#d80000'});
			
				$(this).bind('mouseover',
					function(){
						if($(this).attr('href') != actPage)
							$(blockDiv).css('background-color', '#d80000');
					}
				);
				
				$(this).bind('mouseout',
					function(){
						if($(this).attr('href') != actPage)
							$(blockDiv).css('background-color', '#fff');
					}
				);
			}
		);
	}
);
