$(function() {
	$('.menu li').hover(function(){
		$(this).addClass('hover');
	}, function(){
		$(this).removeClass('hover');
	});
	$(".featured-products ul li:nth-child(3)").css("margin-right", "0px");
	$(".featured-products ul li:nth-child(6)").css("margin-right", "0px");
	var inprog = 0;

	$(".featured-products ul li").hover(function(){
		$(this).children('h6').animate({height: '18px'}, 'fast', function() {
		  });
	}, function(){
		$(this).children('h6').animate({height: '0px'}, 'fast', function() {
			$(this).hide();
		  });
	});
	$(".image-block").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
		visible: 1,
		circular: false,
		btnGo:
	    [".nav-block .1", ".nav-block .2",
	    ".nav-block .3", ".nav-block .4",
	    ".nav-block .5", ".nav-block .6",
	    ".nav-block .7", ".nav-block .8",
	    ".nav-block .9", ".nav-block .10",
	    ".nav-block .11", ".nav-block .12", 
		".nav-block .13", ".nav-block .14",
	    ".nav-block .15", ".nav-block .16",
	    ".nav-block .17", ".nav-block .18",
	    ".nav-block .19", ".nav-block .20",
	    ".nav-block .21", ".nav-block .22"]
		
    });
	$('.nav-block a.1').addClass('current');
	$('.nav-block .next').click(function(){
		var count=$('.nav-block a').length;
		count=count-2;
		left = $('.image-block ul').css('left');
		left = left.replace('-','');
		left = left.replace('px','');
		$('.nav-block a.current').removeClass('current');
		if(left >= 637) {
		pos = (left / 637) + 1;
		} else {
			pos = 1
		}
		pos = pos +1 ;
		$('.nav-block a.'+pos).addClass('current');
		if(pos>count){
			$('.nav-block a.'+(pos-1)).addClass('current');
		}
	});
	$('.nav-block .prev').click(function(){
	
		left = $('.image-block ul').css('left');
		left = left.replace('-','');
		left = left.replace('px','');
		$('.nav-block a.current').removeClass('current');
		if(left >= 0) {
		pos = (left / 637) ;
		} else {
			pos = 1;
			
		}
		pos = pos  ;
		if(pos==0){
			$('.nav-block a.'+(pos+1)).addClass('current');
		}
		$('.nav-block a.'+pos).addClass('current');
		
	});
	$('.nav-block a.numlink ').click(function(){
		$(this).addClass('current');
		$(this).siblings().removeClass('current')
	});
	
    /*$('.nav-block a.image-nav1').click(function() {
    	var image = new Image();
		image.onload = function() {
			$('image-block ul li img').attr('src', this.src);
		}
		image.src = $(this).attr('href');
		return(false);
    });*/
});
