$(document).ready(function() {
	if ($('.dropdown .dd').length){
	$('.dd ul').append('<li> <span><span><span></span></span></span> </li>')
	$('.dropdown li').hover(
		function() {
			var sub = $(this).find('.dd:eq(0)');
			if( sub.length == 0 ) return false;
			
			
			if($(this).parent().parent().hasClass('dd-test')) {
				
			}
			
			sub.show();
			var t = (parseInt(sub.css('top').replace('px', '')) - 5);
			sub.hide();
			var new_t = t + 5;
			
			sub
				.css({ 'top' : t+'px' })
				.animate({ 'top' : new_t + 'px', opacity : 'show' }, 200, function(){
					$(this).css({ 'top' : new_t + 'px' });
				 });
				
				
			$(this).find('a:eq(0)').addClass('hover');
		},
		function() {
			var sub = $(this).find('.dd:eq(0)');
			
			sub.hide();
			$(this).find('a:eq(0)').removeClass('hover');
		}
	);
	
	}
});

function mycarousel_initCallback(carousel)
{
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};


$(document).ready(function() {
	if ($('#f-slider').length){
   $('#f-slider').jcarousel({
		auto:0,
    	wrap: 'circular',
		scroll:1,
		animation:600,
		initCallback: mycarousel_initCallback
    });
	}
});

$(document).ready(function() {
  if($('#slideshow').length){
    $('#slideshow').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		timeout: 2000,
		next:   '#slideshow'

	});
  }
});
