  var CarouselDefaults = new Object({
    mouseWheel: true,
    btnNext: ".right",
    btnPrev: ".left",
    visible: 4,
    circular: false,
    start: 0
  });

  var WaitTimeOut = 5000;
  var WaitTime = 1000;
  var CarouselCount = 0;
  var speedout = 2000, speedin = 2000;

  jQuery(document).ready(function(){

    jQuery(".mouseWheel .jCarouselLite").jCarouselLite(CarouselDefaults);
    jQuery('#images li').hide();
    jQuery('#images1').show();
    CarouselCount = jQuery('#images li').size();

    jQuery('#links li').click(function(){
      ShowImage(this);
    });

    setTimeout(function(){
      ShowNextImage();
    }, WaitTimeOut);

  });

  function ShowNextImage(){
   if (WaitTime){
      setTimeout(function(){
        ShowNextImage();
      }, WaitTime);
      WaitTime = 0;
      return false;
    }
    var currentShowen = 1;
    jQuery('#images li').each(function(){
      if(jQuery(this).css('display') != 'none'){
        currentShowen = jQuery(this).attr('id').substr(6);
      }
    });

    var elm = '';
    currentShowen++;
    if (currentShowen > CarouselCount){
      currentShowen = 1;
    }
    jQuery('#images'+currentShowen).each(function(){
      elm = this;
    });
    ShowImage1(elm);

    setTimeout(function(){
      ShowNextImage();
    }, WaitTimeOut);
  }

  function ShowImage1(elm){
    jQuery('#images li').fadeOut(speedout);
    jQuery('#links li').removeClass('active');
    var id = jQuery(elm).attr('id').substr(6);
    jQuery('#images'+id).fadeIn(speedin);
    jQuery('.links'+id).addClass('active');
    // move carousele
    ScrollDiv(id);
  }

  function ScrollDiv(ShowenItem){
    var ShowenItem = (ShowenItem*1);
    var CarouselVisibleLength = CarouselDefaults.visible;
    if (ShowenItem == 1){
      CarouselDefaults.start = 0;
      $(".mouseWheel .jCarouselLite").jCarouselLite(CarouselDefaults);
      return false;
    }
    if (ShowenItem < CarouselVisibleLength){
      return false;
    } else {
      CarouselDefaults.start = (ShowenItem*1)-CarouselVisibleLength;
    }

    $(".mouseWheel .jCarouselLite").jCarouselLite(CarouselDefaults);
  }

  function ShowImage(elm){
    jQuery('#images li').fadeOut(speedout);
    jQuery('#links li').removeClass('active');
    var id = jQuery(elm).attr('id').substr(5);
    jQuery('#images'+id).fadeIn(speedin);
    jQuery('.links'+id).addClass('active');
    ScrollDiv(id);
    WaitTime = WaitTimeOut;
  }

