$(function(){
	$('.table_div table tr,.div_har table tr').hover(
		function(){
			$(this).addClass('hover');
		},
		function(){
			$(this).removeClass('hover');
	});
	
	
	$('.catalog_menu:first > li').hover(
		function(){
			$(this).find('ul:first').show();
		},
		function(){
			$(this).find('ul:first').hide();
		});
	// add class no for list like ul>li>ul
	$('.catalog_menu li, .left_catalog li').has('ul').addClass('no');
	// Show sub menu
	$('.catalog_menu .no > a').click(function(){
		$(this).next().toggle();
		return false
	});
	/*
	// fix href
	$('.catalog_menu:first .no > a , .left_catalog:first .no > a').click(function(){
		return false;
	});
	*/
	$('.header_div a').click(function(){
		$('.div_har,.black').hide();
		return false;
	});
	$('.show_teh').click(function(){
		$('.div_har,.black').show();
		return false;
	})
	
	
	 function formatText(index, panel) {
		  return index + "";
	    }
     
          $('.anythingSlider').anythingSlider({
              easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
              autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
              delay: 3000,                    // How long between slide transitions in AutoPlay mode
              startStopped: false,            // If autoPlay is on, this can force it to start stopped
              animationTime: 600,             // How long the slide transition takes
              hashTags: true,                 // Should links change the hashtag in the URL?
              buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
      		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
      		startText: "Старт",             // Start text
		        stopText: "Стоп",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
          });
          $("#slide-jump").click(function(){
              $('.anythingSlider').anythingSlider(6);
          });
       $('.catalog_menu .catalog_menu li').hover(
    	function(){
    	   $(this).addClass('li-hover');
       },function(){
    	   $(this).removeClass('li-hover');
       }) 
       
       $('.aff_parents_item a').hover(
    		   function(){
    			   $(this).find('img.color_img').show();
    			   $(this).parent().find('img.black_img').hide();
    		   },
    		   function(){
    			   $(this).find('img.color_img').hide();
    			   $(this).parent().find('img.black_img').show();
    		   }
       );
	   
	   //map
	   $('area').hover(function(e){
			src = $('#map').get(0).src;    	
			$('#map').get(0).src=$(this).attr('rel');    	    	
		},function(e){    	
			$('#map').get(0).src=src;
		});
	   
	   $('div#seoText > * ').not('.visibleText').css('display','none')
	   	.end().filter('.visibleText').after('<p align="right" id="showMore" style="cursor: pointer; color: blue;">Далее...</p>');
		$('div#seoText > p:last').after('<p align="right" id="showMin" style="cursor: pointer; color: blue; display: none;">Скрыть...</p>');
	   
	   
	   $('#showMore').click(function(){
		   $('div#seoText > * ').css('display','block')
		   .filter('#showMore').css('display','none')
		   .filter('#showMin').css('display','block');
	   });
	   
	   $('#showMin').click(function(){
		   $('div#seoText > * ').not('.visibleText').css('display','none')
		   .filter('#showMore').css('display','block')
		   .filter('#showMin').css('display','none');
	   });
	   

	   
     
})
