$(document).ready(function(){

	var busy1 = 0;
	var busy2 = 0;
	var busy3 = 0;
	var busy4 = 0;
	
	var speed = 100;
	
	if ($("#content").height() < 650)
     $("#content").height(650);

	$("#menu1").mouseover(function(){

		if( busy1 == 0 ){

			busy1 = 1;
			$("#HTMLBlock")
				.animate({ backgroundColor: "#4b3903" }, speed);
			$("body")
				.animate({ backgroundColor: "#4b3903" }, speed);
			$("#menu1 img")
				.animate({ width: "228" }, speed);
		}
			
		return false;			
	});
	
	
	$("#menu1").mouseout(function(){
			
		if( busy1 == 1 )	{
			
			$("#menu1 img")
				.animate({ width: "220" }, speed, function(){busy1 = 0;});
		}
		
		return false;
			
	});
	
	$("#menu2").mouseover(function(){

		if( busy2 == 0 ){
			busy2 = 1;
			$("#HTMLBlock")
				.animate({ backgroundColor: "#013f58" }, speed);
			$("body")
				.animate({ backgroundColor: "#013f58" }, speed);
			$("#menu2 img")
				.animate({ width: "228" }, speed);
		}
		return false;	
	});
	$("#menu2").mouseout(function(){
		
		if( busy2 == 1 ) {
			
			$("#menu2 img")
				.animate({ width: "220" }, speed, function(){busy2 = 0;});
		}
		return false;
			
	});

	
	$("#menu3").mouseover(function(){
		
		if( busy3 == 0 ) {
			busy3 = 1;
			$("#HTMLBlock")
				.animate({ backgroundColor: "#495558" }, speed);
			$("body")
				.animate({ backgroundColor: "#495558" }, speed);	
			$("#menu3 img")
				.animate({ width: "228" }, speed);
		}
		return false;	
	});
	$("#menu3").mouseout(function(){
								  								   
		if( busy3 == 1 ) {
			$("#menu3 img")
				.animate({ width: "220" }, speed, function(){busy3 = 0;});
		}
		return false;			
	});

	
	$("#menu4").mouseover(function(){

		if( busy4 == 0 ) {
			busy4 = 1;
			$("#HTMLBlock")
				.animate({ backgroundColor: "#531506" }, speed);
			$("body")
				.animate({ backgroundColor: "#531506" }, speed);
			$("#menu4 img")
				.animate({ width: "228" }, speed);
		}		
		return false;
	});
	$("#menu4").mouseout(function(){
			
		if( busy4 == 1 ) {
			$("#menu4 img")
				.animate({ width: "220" }, speed, function(){busy4 = 0;});
		}
		return false;	
	});
	
	$("#bigMenu").mouseout(function(){
		$("#HTMLBlock")
			.animate({ backgroundColor: "#015257" }, speed);
		$("body")
			.animate({ backgroundColor: "#015257" }, speed);
	});
	
	/*
	$("#privet").mouseover(function(){
		$("#HTMLBlock")
			.animate({ backgroundColor: "#015257" }, speed);
	});*/
	
	
});
