jQuery(document).ready(function($){
	$('#menu-navigation').find('.sub-menu').parent().addClass('has-sub-menu');

	$('#menu-navigation').find('.sub-menu').each(function(){
   		$(this).children('li').each(function(index){
        	if(index%2 ==0) $(this).addClass('odd');
        	else $(this).addClass('even');
    	});
	});

	if($.browser.msie && $.browser.version == 7  ) {
    	var level = 0;
    	$('#menu-navigation').find('li').hover(function(){
        	if(level != 0){
        	}
        	level ++;
    	},function(){
        	level --;
    	});
	}

	var menu_height=parseInt($('#navigation').outerHeight()) - 1;
		$('#menu-navigation').children('li').children('.sub-menu').css('top',menu_height);

	$('a .small_image,a .big_image,a .gallery_image,a .fresh_recent_posts_image, .size-thumbnail, .size-medium, .size-large, .size-full, a img').hover(function(){
    	$(this).stop().animate({
        	'filter':'alpha(opacity=50)',
        	'-moz-opacity':'0.5',
        	'-khtml-opacity':'0.5',
        	'opacity': '0.5'}, 200);
 	 },function(){
 	 $(this).stop().animate({
           	'filter':'alpha(opacity=100)',
          	'-moz-opacity':'1',
           	'-khtml-opacity':'1',
            'opacity': '1'}, 200);
  	});

	$("a[rel^='prettyPhoto']").prettyPhoto({theme: 'light_square',slideshow:5000, autoplay_slideshow:false, overlay_gallery:false});
	$('.size-thumbnail, .size-medium, .size-large, .size-full').parent().prettyPhoto({theme: 'light_square', autoplay_slideshow:false, overlay_gallery:false});

	$('.info_line, .cube').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		next: '.cube_right_arrow',
		prev: '.cube_left_arrow',
		pager: '.slider_nav',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '.slider_nav li:eq(' + (idx) + ') a';
        },
		pause:   1,
		timeout: 7000
	});
});
