$(document).ready(function(){
    /* COTENT */
    
    var speedSlide = 200;
    var speedItemSelect = 500;
    /* for auto scroll*/
    var cooldown = 6000; //milli-seconds

    /* auto scroll  */
    //var showProductsAuto = setInterval("nextProduct("+speedSlide+")", cooldown);
    /* MENU CHOICE */
    /* products */
     $('.productShow_choice_item').click(function() {

        var newestElementId = $(this).attr('id').split("pcs")[1];
        //check if current visible reference is 
         if($(".productShow_info_item:visible").attr('id').split('item')[1] != newestElementId) {
                //hide actual element
                $(".productShow_info_item:visible").hide('slide', {direction: 'left'}, speedSlide, function() {
                      //show the newest
                     $('#item'+newestElementId).show('slide', {direction: 'right'}, speedSlide);
                });
         }
      

    });
    /*  menu */
    $('.productShow_choice_item').click(function() {
       // clearInterval(showProductsAuto);
		var pos = $(this).offset(),
			pos2 = $('#productShow_choice_select').offset();
        $("#productShow_choice_select").animate({
                backgroundPosition: (pos.left-pos2.left) + 'px ' + '0px'
            },
            speedItemSelect,
            'easeOutQuart'
        );
    });
    /* discover it button */
    $('.discoverIt').hover(function() {
        enableHover($(this));
    }, function() {
        disableHover($(this));
    });
    /* MENU PRODUCT */
    $('.productShow_info_item_menu ul li a').hover(function() {
            $(this).stop().animate({ paddingLeft: 45 }, 'fast');
        }, function() {
            $(this).stop().animate({ paddingLeft: 35 }, 'fast');
        });
});
/*
function nextProduct(speedSlide) {
    var productVisible = $(".productShow_info_item:visible");
    next = productVisible.next('div.productShow_info_item');
    
    if(next.html() != null) {
         //hide actual element
        $(productVisible).hide('slide', {direction: 'left'}, speedSlide, function() {
              //show the newest
             $(next).show('slide', {direction: 'right'}, speedSlide);
        });
       
    }else {
          //hide actual element
        $(productVisible).hide('slide', {direction: 'left'}, speedSlide, function() {
              //show the newest
             $(".productShow_info_item:first-child").show('slide', {direction: 'left'}, speedSlide);
        });
    }
        
}*/