 $(document).ready(function()
 {       
   $('#cssdropdown li.headlink').hover(        
		function() 
    { 
			$('ul', this).css('display', 'block'); 
    },       
    function() 
    { 
			$('ul', this).css('display', 'none'); 
    });       

		if ($('#show-screenshots').is('*'))
		{	
			$(function() 
			{ 				
				$('#show-screenshots a').lightBox({fixedNavigation:true}); 			
			});
		}	
	
 });		 

 /***********************
 * @title shuffle 
 * @desc  rotate images functions
 ***********************/
 (function($){
   $.fn.shuffle = function() {
     return this.each(function(){
       var items = $(this).children();
       return (items.length)
         ? $(this).html($.shuffle(items))
         : this;
     });
   }
 
   $.shuffle = function(arr) {
     for(
       var j, x, i = arr.length; i;
       j = parseInt(Math.random() * i),
       x = arr[--i], arr[i] = arr[j], arr[j] = x
     );
     return arr;
   }	
 });

	
  /***********************
  * @title JCarousel
  * @desc  Carousel functions
  ***********************/
  function mycarousel_itemVisibleInCallbackBeforeAnimation(carousel, item, idx, state) {
		// No animation on first load of the carousel
		if (state == 'init')
			return;

    jQuery('img', item).fadeIn('slow');
  };

  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 flashcarousel_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();
		});
/*	 
		jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    }); 
*/		
		jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr('title')));
        return false;
    }); 	
	};
