function aw_carousel( param ){


        var auto_slide = 1;
        var hover_pause = 1;
        var key_slide = 1;
        var min_showWidth = 800; //
        var min_moveWidth = 799; //
        var auto_slide_seconds = 10;//3000;
        var galleryContainerWidth = 0;
        var galleryItemWidth = 100;
        var startIndex = 0;
        var countIndex = 0;
        
        
        
      
      jQuery.each($('div#nav-gallery ul li'), function() {
        galleryContainerWidth += this.offsetWidth;
        if( $(this).hasClass("selected")) {
          startIndex = $('div#nav-gallery ul li').index(this);
        }
        countIndex++;
      });
      
      
      if( $('div#nav-gallery ul').width() <= min_showWidth ) {
          $('div#nav-gallery ul').css({'left' : '0px'});
          countIndex--;
        }
      
      
      $('div#nav-gallery').css({'width' : galleryContainerWidth + 'px'});
        
        /*move he last list item before the first item. The purpose of this is 
        if the user clicks to slide left he will be able to see the last item.*/

        for( var i =0; i <= countIndex - startIndex; i++ ){
          //$('div#nav-gallery ul li:first').before($('div#nav-gallery ul li:last')); 
        }
        
        if( galleryContainerWidth <= min_moveWidth ) {
          return false;
        }

        var ie6 = document.uniqueID  && !window.XMLHttpRequest && document.execCommand ;
      	if(!!ie6){
      	 $('div#nav-gallery ul').css({'position' : 'absolute'});
        }

        //$('div#nav-gallery ul').css({'position' : 'absolute'});
        
        if(auto_slide == 1){
            var timer = setInterval('slide("right")', auto_slide_seconds); 
            
        }
  
        if(hover_pause == 1){
            $('div#nav-gallery ul').hover(function(){
                clearInterval(timer)
            },function(){
                timer = setInterval('slide("right")', auto_slide_seconds); 
            });
        } 
       
             
};

//slide function  
    function slide(where){
        var move = ( parseInt($('div#nav-gallery ul').css('left')) - 1 ) + 'px';
        $('div#nav-gallery ul').css({'left' : move});
        
        if( parseInt($('div#nav-gallery ul').css('left')) <=  (-106) ){
          $('div#nav-gallery ul li:last').after($('div#nav-gallery ul li:first'));
          $('div#nav-gallery ul').css({'left' : '0px'});
        }               
    }

      



 

