jQuery(document).ready(function($){
     $('.expertBlogs .new_pager .up a, .expertBlogs .new_pager .down a').live('click',function () {
          jQuery.each(jQuery.browser, function(i){
               if ($.browser.msie) {
                    $('.expertBlogs .box1 img').css('opacity', 0.3);
                    $('.expertBlogs .box1 div').css('opacity', 0.3);
               }
               else {
                    $('.expertBlogs .box1 div').css('opacity', 0.3);
               }
          });
          
          $('.expertBlogs').load($(this).attr('href'));
          
          return false;
     });
     
     $('.news .new_pager .up a, .news .new_pager .down a').live('click',function () {
            jQuery.each(jQuery.browser, function(i){
               if ($.browser.msie) {
                    $('.news .box1 img').css('opacity', 0.3);
                    $('.news .box1 div').css('opacity', 0.3);
                    $('a.news_short').css('opacity', 0.3);
               }
               else {
                    $('.news .box1 div').css('opacity', 0.3);
                    $('a.news_short').css('opacity', 0.3);
               }
            });
            
            $('.news').load($(this).attr('href'));
          
          
          return false;
     });
     
     $('.pubs .new_pager .up a, .pubs .new_pager .down a').live('click',function () {
          jQuery.each(jQuery.browser, function(i){
               if ($.browser.msie) {
                    $('.pubs .publikacje div').css('opacity', 0.3);
               }
               else {
                    $('.pubs .publikacje div').css('opacity', 0.3);
               }
          });
          
          $('.pubs').load($(this).attr('href'));
          
          return false;
     });
     
     $('.communityBlogs .new_pager .up a, .communityBlogs .new_pager .down a').live('click',function () {
          jQuery.each(jQuery.browser, function(i){
               if ($.browser.msie) {
                    $('.communityBlogs .box1 img').css('opacity', 0.3);
                    $('.communityBlogs .box1 div').css('opacity', 0.3);
               }
               else {
                    $('.communityBlogs .box1 div').css('opacity', 0.3);
               }
          });
          
          $('.communityBlogs').load($(this).attr('href'));
          
          return false;
     });
     
     
     $("#slider").easySlider({
		auto: true,
        prevText: '&lt;',
        nextText: '&gt;',
        speed: 1500,
		continuous: true,
        sliderElements: 1
	});
    
    /**
    * YET ANOTHER SLIDER
    */
    //rotation speed and timer
	var speed = 3000;
	var run = setInterval('rotate()', speed);	
	
	//grab the width and calculate left value
	var item_width = $('#reports_slider li').outerWidth(); 
	var left_value = item_width * (-1); 
        
    //move the last item before first item, just in case user click prev button
	$('#reports_slider li:first').before($('#reports_slider li:last'));
	
	//set the default item to the correct position 
	$('#reports_slider ul').css({'left' : left_value});
    
    //if user clicked on next button
	$('#next_report').click(function() {
	   //get the right position
       var left_indent = parseInt($('#reports_slider ul').css('left')) - item_width;
       
       //slide the item
       $('#reports_slider ul:not(:animated)').animate({'left' : left_indent}, 1200, function () {
            //move the first item and put it as last item
            $('#reports_slider li:last').after($('#reports_slider li:first'));                 	
            
            //set the default item to correct position
			$('#reports_slider ul').css({'left' : left_value});
		});
        
		//cancel the link behavior
		return false;
	});
    
    $('#reports_slider').hover(
        function() {
			clearInterval(run);
		}, 
		function() {
			run = setInterval('rotate()', speed);	
		}
	);
});

//a simple function to click next link
//a timer will call this function, and the rotation will begin :)  
function rotate() {
	jQuery('#next_report').click();
}