$(document).ready(function()
				  {
				    $(".menu_link").hover(function()
										  {
										  var img=$(this).children("img"),
										  	  src=img.attr("src"),
											  index_1=src.indexOf("menu_")+5,
											  index_2=src.indexOf(".png"),
											  section_id=src.substr( index_1,index_2-index_1 );
											img.attr("src","images/menu_"+section_id+"_hover.png");
											$(this).parent("td")
												   .css("background", "url(images/menu_"+section_id+"_active.png) no-repeat right 0");
										  },
										  function()
										  {
										  var img=$(this).children("img"),
										  	  src=img.attr("src"),
											  index_1=src.indexOf("menu_")+5,
											  index_2=src.indexOf("_hover.png"),
											  section_id=src.substr( index_1,index_2-index_1 );
											img.attr("src","images/menu_"+section_id+".png");
											$(this).parent("td")
												   .css("background","none");
										  });
					
					$(".home_brand_opacity").bind("mouseover",function()
															  {
															    $(this).hide();
															  });
					$(".home_brand_link").bind("mouseout",function()
														  {
															$(this).next("img")
																   .show();
														  });
					
					$(".languages a").hover(function()
											{
											  $(this).parent()
											  		 .css("background-image","url(images/lang_ramka.png)");
											},
											function()
											{
											  $(this).parent()
											  		 .css("background-image","none");
											});
					
					$(".fancyImage").fancybox({
											   "overlayShow"   : true,
											   "transitionIn"  : "elastic",
											   "transitionOut" : "elastic"
											  });
					
					markMenuItem();
				  });

$(window).load(function()
			   {
			     $(".scroll_content").jScrollbar({
												  allowMouseWheel : true,
												  scrollStep		 : 50
												 });
			   });

function markMenuItem()
{
var a=$("#content_"+TOPSECTION),
	src=a.children("img").attr("src"),
	index_1=src.indexOf("menu_")+5,
    index_2=src.indexOf(".png"),
    section_id=src.substr( index_1,index_2-index_1 );
	
	a.children("img")
	 .attr("src","images/menu_"+section_id+"_hover.png");
	a.unbind()
	 .css("cursor","default")
	 .bind("click",function()
				   {
				     return false;
				   });
	a.parent("td")
	 .css( "background", "url(images/menu_"+section_id+"_active.png) no-repeat right 0" );
}

function changeProductsTableHeight()
{
var maxHeight=0;
  $(".product_div").each(function( index )
						 {
						 var height=$(this).height();
						   if ( height > maxHeight )
						   	  maxHeight=height;
						 });
  $(".product_div").css("height",maxHeight+1+"px");
}
