      

$(document).ready(function() 

{

	// HOVER IMAGES
	
	$(".hover img").hover(function() {
		  this.src = this.src.replace(".png","_over.png"); },
		 function() {
		  this.src = this.src.replace("_over.png",".png");
		 }
	);
	
	$(".hover").hover(function() {
		  this.src = this.src.replace(".png","_over.png"); },
		 function() {
		  this.src = this.src.replace("_over.png",".png");
		 }
	);
	
	// SLIDESHOWS
	
	 $('.slides').cycle({
  		fx: 'fade',
        speed: 600,
        timeout: 5000,
        next:   '.slide img',
        after:  onAfter
 	});

 
      



 	

	function onAfter(curr,next,opts) {
	var caption = (opts.currSlide + 1) + ' / ' + opts.slideCount;
	$('.pager').html(caption);
	}
	
	// MENU ACTIONS
	var first_time_check = true;
	
	
	$('ul#menu-items .menu-item.ready').mouseenter(function(event) {
		/*if ($(event.target).parent().hasClass('active')){
			if (!first_time_check){
        		$('.heurtebise').fadeIn('fast');
        		first_time_check = false;
        	}
		}else{*/
        	$('.heurtebise').fadeIn('fast');
        //}
     });
     
    $('.heurtebise').mouseenter(function() {
        $(this).fadeOut('slow')
     });
	
	$('li.next').hoverIntent(function() {
		$('.heurtebise').fadeIn('fast');
        $(this).children('ul').fadeIn('fast')
     },function() {
        $(this).children('ul').fadeOut('fast');
     });
	$('li.next').mouseleave(function() {
        $(this).children('ul').fadeOut('fast');
     });
	

	// ROLLOVER THUMNS

      $('.ovslides').cycle({                            
            timeout:500,
            speed:  800
      });
      
      $('.ovslides').each( function(){
   		$(this).cycle('pause'); 
		});

      $('.ovslides').hover(function() {
            $(this).cycle('resume');
      },function(){
            $(this).cycle('pause');
      });

});
	
  


