 $(document).ready(function() {
      
      function addMega(){
        $(this).addClass("hovering");
        }

      function removeMega(){
        $(this).removeClass("hovering");
        }

    var megaConfig = {
         interval: 0,
         sensitivity: 4,
         over: addMega,
         timeout: 200,
         out: removeMega
    };

    $("li.mega").hoverIntent(megaConfig)

    
    $(".animate").each(function (k,v){
    	//alert(k);
    	$(this).animate({opacity:"1"}, (1000 + k * 1500)).slideDown('slow');
    });
    
    
    
    var $el = $("#slider div");
		var total = $("#slider div > *").length;
		var poz = 1;
		
		$('#next').click(function(){
		if (poz+1<total) {
			$el.animate({       left: "-=240px"    }, 'fast' );
			poz++;
			
		}

		});
		$('#prev').click(function(){

		if (poz>1) {
			$el.animate({       left: "+=240px"    }, 'fast' );
			poz--;
			
		}

		});

	$(".slider").each(function(){
		var slider=$(this);
		
		var sliderContainer = slider.find(".sliderContainer");
		sliderWidth= slider.width();
		var sliderControls = slider.find(".sliderControls a");

		sliderControls.click(function(){
			nrClicked = sliderControls.index($(this));
			sliderContainer.animate({left:-(sliderWidth*nrClicked)});
		
			$(this)
		    .parents('div:first') // find the first UL parent
		      .find('a') // find all the A elements
		        .attr('class','submeniu') // remove from all
		      .end() // go back to all A elements
		    .end() // go back to 'this' element
		    .attr('class','submeniuSel');
			
		});
		
	});
	

    $('.produs-lft a.zoom').lightBox();
    
    
});

