$(document).ready(function() { 
	$('ul.menu').superfish({ 
		delay:       1000,                            // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'normal',                          // faster animation speed 
		autoArrows:  false,                           // disable generation of arrow mark-up 
		dropShadows: false                            // disable drop shadows 
	}); 
	
	$('.button2').hover(function(){
			$(this).find('span').stop().animate({backgroundPosition:'-20 -105'},400, 'easeInQuad',function(){$(this).css({backgroundColor:'#f77b0c'})})
		}, function(){
			$(this).find('span').css({background:'url(images/menu_hover.png) -20px -105px no-repeat'})
			$(this).find('span').stop().animate({backgroundPosition:'-250 -250'},400, 'easeOutQuad')
		}
	)
	
	$('.thumbs li')
		.live('mouseenter',function(){
			$(this).stop()
			.animate({top:-10},300)
			$(this).css({opacity:1.0})
			th=$(this).find('img');
			th.stop()
			.animate({ width:118, height:87 },300);
		})
		.live('mouseleave',function(){
			$(this).stop()
			.animate({top:0},300)
			$(this).css({opacity:0.8})
			th=$(this).find('img');
			th.stop()
			.animate({ width:98, height:67 },300);
		});
		
	$('.thumbs li.selected')
		.live('mouseenter',function(){
			$(this).stop()
			.animate({top:-10},300)
			$(this).css({opacity:1.0})
			th=$(this).find('img');
			th.stop()
			.animate({ width:118, height:87 },300);
		})
		.live('mouseleave',function(){
			$(this).stop()
			.animate({top:0},300)
			$(this).css({opacity:1.0})
			th=$(this).find('img');
			th.stop()
			.animate({ width:98, height:67 },300);
		});
		
	  $('#l_sidebar > ul > li').each(function(index, element) {
              $(this).addClass('left_bar_element_'+$(this).index());
      });
		
      $('.page_item > a').each(function(index, element) {
              $(this).wrapInner('<span></span>');
      });

       $('.ngg-gallery-thumbnail-box:has(div.new)').each(function() {
			 $(this).find('a').append('<span class="new"></span>');
			 $(this).find('div.new').remove();
      });
	   $('.ngg-gallery-thumbnail-box:has(div.sale)').each(function() {
			 $(this).find('a').append('<span class="sale"></span>');
			 $(this).find('div.sale').remove();
      });
}); 
