$(document).ready(function(){

	$("ul.side-nav li").hover(
		function() {
				$(this).children('a').toggleClass('hover');
				$(this).children('i').css("background-position","left -61px");},
		function() {
				$(this).children('a').toggleClass('hover');
				$(this).children('i').css("background-position","left top");}		
	);
	
	$("div.button").hover(
		function() {
				$(this).css("background-position","left bottom");
				$(this).children('a').css("background-position","right bottom");
				$(this).children('input').css("background-position","right bottom");},
		function() {
				$(this).css("background-position","left top");
				$(this).children('a').css("background-position","right top");
				$(this).children('input').css("background-position","right top");}		
	);
	
	i = false
	$("ul.side-nav li i").click( function() {
		if (!i) {
			$(this).addClass("hover");
			$(this).prev().addClass("select");
			$(this).next().addClass("show");
			i = true;
		} else {
			$(this).removeClass("hover");
			$(this).prev().removeClass("select");
			$(this).next().removeClass("show");
			i = false;
		}
	});
	
	$(".partner-box").each(function (){
									 ht = $(this).outerHeight();
									 lt = $(this).children(".img").height();
									 $(this).children(".img").css("top", ht/2 - lt/2 + "px");
									 });
	
	$(".gal li a img").each(function (){
									 ht = $(this).height();
									 /*lt = $(this).children(".img").height();*/
									 $(this).css("top", 64 - ht/2 + "px");
									 });

	
	
});

if (document.images)
{
  pic1= new Image; 
  pic1.src="http://ostmetal.ru/img/frontend/images/ff01-ov.png";
  pic2= new Image; 
  pic2.src="http://ostmetal.ru/img/frontend/images/gx5-ov.png"; 

  pic3= new Image; 
  pic3.src="http://ostmetal.ru/img/frontend/images/hp01-ov.png";
  pic4= new Image; 
  pic4.src="http://ostmetal.ru/img/frontend/images/noj-ov.png";
  
  pic5= new Image; 
  pic5.src="http://ostmetal.ru/img/frontend/images/redmig02-ov.png";
  pic6= new Image; 
  pic6.src="http://ostmetal.ru/img/frontend/images/redmig-ov.png";
 
  pic7= new Image; 
  pic7.src="http://ostmetal.ru/img/frontend/images/smt-ov.png"; 
  pic16= new Image; 
  pic16.src="http://ostmetal.ru/img/frontend/images/umb02-ov.png";
  
  pic8= new Image; 
  pic8.src="http://ostmetal.ru/img/frontend/images/umb-ov.png"; 
  pic9= new Image; 
  pic9.src="http://ostmetal.ru/img/frontend/images/umt-1-ov.png";
  
  pic10= new Image; 
  pic10.src="http://ostmetal.ru/img/frontend/images/umt-2-ov.png"; 
  pic11= new Image; 
  pic11.src="http://ostmetal.ru/img/frontend/images/umt-ov.png";
  
}
