// Kort form för document ready. Dvs kör functionen när sidan laddat klart
$(function(){
  // alert('ok');
});

    $(document).ready(function(){      
      
	var delayed = 100;

  
    var time = null;

  	function animateIt(item) {
    	item
      	.animate({backgroundPosition: "0% 0%"}, 100)
      	.animate({backgroundPosition: "0% 50%"}, 100)
      	.animate({backgroundPosition: "0% 100%"}, 100);
  	}

  	function testIt() {
    	animateIt($(".page-item-2 a"))
	    time = setTimeout(testIt, 300)
	};

  	$(".page-item-2 a").hover(testIt, function() {
      	clearTimeout(time);
  	});
  	
  	function testIt2() {
    	animateIt($(".page-item-5 a"))
	    time = setTimeout(testIt2, 300)
	};

  	$(".page-item-5 a").hover(testIt2, function() {
      	clearTimeout(time);
  	});
  	
  	function testIt3() {
    	animateIt($(".page-item-9 a"))
	    time = setTimeout(testIt3, 300)
	};

  	$(".page-item-9 a").hover(testIt3, function() {
      	clearTimeout(time);
  	});  	
  	
  	function testIt4() {
    	animateIt($(".page-item-11 a"))
	    time = setTimeout(testIt4, 300)
	};

  	$(".page-item-11 a").hover(testIt4, function() {
      	clearTimeout(time);
  	});  	  	

  	function testIt5() {
    	animateIt($(".page-item-13 a"))
	    time = setTimeout(testIt5, 300)
	};

  	$(".page-item-13 a").hover(testIt5, function() {
      	clearTimeout(time);
  	});  	  	
  	
  	function testIt6() {
    	animateIt($("#footer a.mailruta"))
	    time = setTimeout(testIt6, 300)
	};

  	$("#footer a.mailruta").hover(testIt6, function() {
      	clearTimeout(time);
  	});  	  	  	
  	
  	function testIt7() {
    	animateIt($(".page-item-150 a"))
	    time = setTimeout(testIt7, 300)
	};

  	$(".page-item-150 a").hover(testIt7, function() {
      	clearTimeout(time);
  	});  	  	   	

  	function testIt8() {
    	animateIt($(".page-item-197 a"))
	    time = setTimeout(testIt8, 300)
	};

  	$(".page-item-197 a").hover(testIt8, function() {
      	clearTimeout(time);
  	});  	  	   	
		    
  	function testIt9() {
    	animateIt($(".page-item-201 a"))
	    time = setTimeout(testIt9, 300)
	};

  	$(".page-item-201 a").hover(testIt9, function() {
      	clearTimeout(time);
  	});  			    

  	function testIt10() {
    	animateIt($(".page-item-205 a"))
	    time = setTimeout(testIt10, 300)
	};

  	$(".page-item-205 a").hover(testIt10, function() {
      	clearTimeout(time);
  	});  	

  	function testIt11() {
    	animateIt($(".page-item-207 a"))
	    time = setTimeout(testIt11, 300)
	};

  	$(".page-item-207 a").hover(testIt11, function() {
      	clearTimeout(time);
  	});  	
});
