$(document).ready( function() {
	// PNG;

$("#exit").click(function () {

$("#message_text").hide( 10, function () { $("#window").animate( { width:"0px", height:"0px", left:"650px", top:"1000px" }, 500, function(){$('#opaco').toggleClass('hidden').removeAttr('style')} ).hide() } );


/*  $("#window").slideUp(300);*/
});



	// Karusel;
			$('.b-news UL').jcarousel({ scroll: 1 });	
			$('.b-news2 UL').jcarousel({ scroll: 1 });				
			
	// Flash;
	$("#flash").flash({
		src: "/templates/flash/baner.swf",
		width: "267",
		height: "239",
		wmode: "transparent"
	});
	
		$("#flash2").flash({
		src: "/templates/flash/euromed.swf",
		width: "500",
		height: "700",
		wmode: "transparent"
	});

	$("#logo2").flash({
		src: "/templates/flash/logo.swf",
		width: "150",
		height: "150",
		wmode: "transparent"
	});

$(".punkt").mouseover( function() {


$(".img_na",this).hide();
$(".img_a",this).show();
});
$(".punkt" ).mouseout( function() {
$(".img_a",this).hide();
$(".img_na",this).show();
});


$(".topmenu ul li").mouseover( function() {
	$(".img_a").hide();
	$(".img_na").show();
	$(".topmenu ul li").css("backgroundColor","#ffffff");
	$(".img_na",this).hide();
	$(".img_a",this).show();
	$(this).css("backgroundColor","#cde8fb");
});

$(".rrr ul li ").mouseover( function() {
	$(".rrr ul li").css("backgroundColor","#ffffff");
	$(this).css("backgroundColor","#cde8fb");


$(".topmenu").mouseout( function() {
	$(".img_a").hide();
	$(".img_na").show();
	$(".topmenu ul li").css("backgroundColor","#ffffff");
});


});


/*$(".topmenu ul li").mouseout( function() {
	$(".img_a",this).hide();
	$(".img_na",this).show();
});*/


	$(".zak").mousedown(function(){		
		$(".zak").css({ background: "url(/templates/images/knopka_act.png) center top no-repeat" } )
		return false;
	});

	$(".zak").mouseup(function(){		
		$(".zak").css({ background: "url(/templates/images/knopka.png) center top no-repeat" } )
		return false;
	});
	$(".zak").mouseout(function(){		
		$(".zak").css({ background: "url(/templates/images/knopka.png) center top no-repeat" } )
		return false;
	});
	
		$(".pirogi").mousedown(function(){		
		$(".pirogi").css({ background: "url(/templates/images/pirogi_act.png) center top no-repeat" } )
		return false;
	});

	$(".pirogi").mouseup(function(){		
		$(".pirogi").css({ background: "url(/templates/images/pirogi.png) center top no-repeat" } )
		return false;
	});
		$(".pirogi").mouseout(function(){		
		$(".pirogi").css({ background: "url(/templates/images/pirogi.png) center top no-repeat" } )
		return false;
	});
		

		$(".spectorti").mousedown(function(){		
		$(".spectorti").css({ background: "url(/templates/images/spectorti_act.png) center top no-repeat" } )
		return false;
	});

	$(".spectorti").mouseup(function(){		
		$(".spectorti").css({ background: "url(/templates/images/spectorti.png) center top no-repeat" } )
		return false;
	});
		$(".spectorti").mouseout(function(){		
		$(".spectorti").css({ background: "url(/templates/images/spectorti.png) center top no-repeat" } )
		return false;
	});
		

		$(".torti").mousedown(function(){		
		$(".torti").css({ background: "url(/templates/images/torti_act.png) center top no-repeat" } )
		return false;
	});

	$(".torti").mouseup(function(){		
		$(".torti").css({ background: "url(/templates/images/torti.png) center top no-repeat" } )
		return false;
	});
	$(".torti").mouseout(function(){		
		$(".torti").css({ background: "url(/templates/images/torti.png) center top no-repeat" } )
		return false;
	});





	$(".punkt").mouseover(function(){		
		$(".spa",this).css({ background: "url(/templates/images/gr.jpg) bottom center repeat-x" } )
		return false;
	});
	
	$(".punkt").mouseout(function(){		
		$(".spa",this).css({background: "" } )
		return false;
	});




    $('.topmenu ul li').hover(
        function() {
            
            $(this).find('ul:first').stop(true, true);
            $(this).find('ul:first').slideDown();
        },
        function() {            
            $(this).find('ul:first').slideUp('fast');
        }
    );    




});






<!--var partners = Number($('#count2').val());-->


function price() {
	// ;
$("#price").toggle('fast');	
}



function part(x) {
	// ;
$("#pic1"+x).show();	
$("#pic2"+x).hide();

}

function partout(x) {
	// ;
$("#pic1"+x).hide();	
$("#pic2"+x).show();

}







function Busc()
{
  var b = document.getElementById("search");

  if (b!=null)
  {
    if(b.value=="����� �� ��������")
    { 
      b.value=""; 
    }
  }
}



var flag = 1;

function mouseout(f){

	flag = f;
	if (flag == 0) {
	myTimer2 = setTimeout("mouseout('1')", 300);
	
	}
		
}

// Random bags;
function randbags() {
	$('#randbags').load('/systems/includes/php/randbags.php');
}



function input() {
	var count = Number($('#count').val());
	var price = Number($('#price').val());
	if (count < 10000 ){
		$('#count').val(count);
		var allb = price * count; 
		$('#summa').val(allb);
		$('#allb').html(allb);
	}
	else
	{
	alert("�����-�?")		
		}
}

function plus() {
	var count = Number($('#count').val());
	var price = Number($('#price').val());
	if (count < 10000 ){
		count = count + 1;
		$('#count').val(count);
		var allb = price * count; 
		$('#summa').val(allb);
		$('#allb').html(allb);
	}
}
function minus() {
	var count = Number($('#count').val());
	var price = Number($('#price').val());
	if (count > 0 ){
		count = count - 1;
		$('#count').val(count);
		var allb = price * count; 
		$('#summa').val(allb);		
		$('#allb').html(allb);
	}
}

var radio = 0;

function send_form() {
	if (radio == 0){

		var empty = $(".required2").css({border: "1px solid  #A8A090", backgroundColor: "#ffffff"}).filter('[value=""]');
		if(empty.size()) {
			empty.css({border: "1px solid #f00", backgroundColor: "#FCAEEB"});
			$("#outt").html("<font color=red>��������� ��� ������������ ����</font>");
		} else {
			$("#outt").html("<font color=green></font>").slideUp(1000, function(){$('#zakaz').submit();});
			// �������� ������ ����� ����� ��������� ��������
		}
	}
	else {

		var empty = $(".required").css({border: "1px solid  #A8A090", backgroundColor: "#ffffff"}).filter('[value=""]');
		if(empty.size()) {
			empty.css({border: "1px solid #f00", backgroundColor: "#fee"});
			$("#outt").html("<font color=red>��������� ��� ������������ ����</font>");
		} else {
			$("#outt").html("<font color=green></font>").hide(1000, function(){$('#zakaz').submit();});
			// �������� ������ ����� ����� ��������� ��������
		}
		}

}






var count = 0;
function wind() {
	if (count == 0) {
	count = 1;	
/*	$("#window").show().animate( { width:"400px", height:"300px", left:"500px" }, 500, function () { $("#message_text").show('slow', function() {$('div#opaco').height($(document).height()).toggleClass('hidden').fadeTo(0, 0.3);}); });*/
	$("#window").show().animate( { width:"400px", height:"300px", left:"350px", top:"170px" }, 500, function () { $('div#opaco').height($(document).height()).toggleClass('hidden').fadeTo(0, 0.3 , function() {$("#message_text").show('fast'); }); });
	
	
	
/*	$("div#fancy_overlay").show();
	$("div#fancy_overlay").css("opacity","0.2");*/
	//$('div#opaco').height($(document).height()).toggleClass('hidden').fadeTo(0, 0.3);
	}
	
}


//open pop-up
function showPopup(popup_type)
{
  //when IE - fade immediately
  if($.browser.msie)
  {
   $('#opaco').height($(document).height()).toggleClass('hidden');
  }
  else
  //in all the rest browsers - fade slowly
  {
   $('#opaco').height($(document).height()).toggleClass('hidden').fadeTo('slow', 0.3);
  }

  $('#popup')
   .html($('#popup_' + popup_type).html())
   .alignCenter()
   .toggleClass('hidden');

  return false;
}

//close pop-up box
function closePopup()
{
  $('#opaco').toggleClass('hidden').removeAttr('style');
  $('#popup').toggleClass('hidden');
  return false;
}



var qwqw = 0;
var y = 0;
function vacancy(x) {
//	if (x == y){
//		$('#idnomer'+x).slideToggle('normal');
//	}
//	else {
//		$('.nomer2').slideUp('normal');
//		$('#idnomer'+x).slideDown('normal');
//		}
//	y = x;
}

var qwqw = 0;
var y2 = 0;
function vacancy2(x2) {
/*	if (x2 == y2){*/
//		$('#idnomer'+x2).toggle();
/*	}
	else {
		$('.nomer2').hide();
		$('#idnomer'+x2).show();
		}
	y2 = x2;	*/	
	//	y = x2;
}







