jQuery(document).ready(function(){
	jQuery('#mycarousel').hide();
	jQuery('#mycarousel').fadeIn('4000');
	jQuery('.jcarousel-prev-horizontal').hide();
	jQuery('.jcarousel-prev-horizontal').fadeIn('4000');
	jQuery('.jcarousel-next-horizontal').hide();
	jQuery('.jcarousel-next-horizontal').fadeIn('4000');
});
function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

   // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
function carousel_1_beforeAnimation(carousel,element,i,status){
		$('#carousel_1_slide_'+carousel.selected).attr("src","img/slide_off.gif");    
    var idx = carousel.index(i, carousel.options.size);
		carousel.add(i,carousel.get(idx).html())
  	}
        	
function carousel_1_afterAnimation(carousel,element,index,status){
    var idx = carousel.index(index, carousel.options.size);
		carousel.selected=idx
		$('#carousel_1_slide_'+idx).attr("src","img/slide_on.gif");
		}

function carousel_1_itemVisibleOutCallback(carousel, item, i, state, evt){
   	if (i>carousel.options.size || i<0){
    	carousel.remove(i);
    	}
  	carousel.startAuto();
		};
		
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 5,
        scroll: 1,
        animation: 1200,
        wrap: 'circular',
        initCallback: mycarousel_initCallback,
        itemVisibleInCallback: {
  					onBeforeAnimation: carousel_1_beforeAnimation,
  					onAfterAnimation: carousel_1_afterAnimation
						},
				itemVisibleOutCallback:carousel_1_itemVisibleOutCallback
    });
});

jQuery(document).ready(function(){
	jQuery('div.slider').hide();
	jQuery('#trigger').toggle(function() {
		jQuery(this).addClass('activator-up');
		}, function() {
		jQuery(this).removeClass('activator-up');										   
	});
	jQuery('#trigger').click(function() {
		jQuery('div.slider').slideToggle('slow');	
	});
});

$(document).ready(function() {
     $('a#trigger').smoothScroll({
       afterScroll: function() {
          /* location.hash = this.hash; */
     }
   });
});
