jQuery(document).ready(function(){

		// ****************************
    // produkt Highlights
		// ****************************
		$("#cycle-highlight-container").css("visibility","visible");    
		
		$("#cycle-highlight-navi li:nth-child(1) a img");
		
		
		var ccc = 0;

    $('#cycle-highlight-big').cycle({
          fx:     'fade',
          speed:  2000,
          activePagerClass: 'activeSlide',
          timeout: 2000,
          pager:  '#cycle-highlight-navi',
          
          pagerAnchorBuilder: function(idx, slide) {
              // return sel string for existing anchor
              //$(".activeSlide").show();
              return '#cycle-highlight-navi li:eq(' + (idx) + ') a';
          },
          
          before:  function(currSlideElement, nextSlideElement, options, forwardFlag){
               //xx = currSlideElement.find('img').attr('src');
               //currSlideElement.hide();

                           
              // set the act 
              thePointer = options.nextSlide + 1;
              if(thePointer <= 0) thePointer = 1; 
              if(ccc == 0) thePointer = 1;
              ccc++; 

              // reset the older
              theSrc = $(this).attr('src');
              allItems = jQuery("#cycle-highlight-navi a img");
              jQuery.each(allItems, function() {
                    theSrcItem = $(this).attr('src');
                    $(this).attr('src', theSrcItem.replace('_a_', '_t_'));
              });
                 
                             
              theActImg = $("#cycle-highlight-navi li:nth-child(" + thePointer + ") a img");
              if(theActImg){
                 theActImgSrc = theActImg.attr('src');
                 theActImg.attr('src', theActImgSrc.replace('_t_', '_a_'));
               }
          }          
      });


      jQuery("#cycle-highlight-navi a img").mouseover( function(){
          theSrc = $(this).attr('src');
          $(this).attr('src', theSrc.replace('_t_', '_h_'));
          //$(this).attr('src', theSrc.replace('_a_', '_h_'));
      }).mouseout(function(){
          theSrc = $(this).attr('src');
          $(this).attr('src', theSrc.replace('_h_', '_t_'));
          //$(this).attr('src', theSrc.replace('_a_', '_t_'));
      });
      
      
      jQuery("#cycle-highlight-navi a img").click( function(){
          
          theSrc = $(this).attr('src');
          allItems = jQuery("#cycle-highlight-navi a img");
          jQuery.each(allItems, function() {
                theSrcItem = $(this).attr('src');
                $(this).attr('src', theSrcItem.replace('_a_', '_t_'));
          });
          $(this).attr('src', theSrc.replace('_h_', '_a_'));
          $('#cycle-highlight-big').cycle('pause');
      })

      
      
});  





/*
jQuery(document).ready(function(){

		// ****************************
    // produkt Highlights
		// ****************************
		$("#cycle-highlight-container").css("visibility","visible");

     $('#cycle-highlight-big').cycle({
          fx:     'fade',
          speed:  1500,
          timeout: 1500
          
          //pager:  '#cycle-highlight-navi',
          //pagerAnchorBuilder: function(idx, slide) {
          //  console.log(idx);
              // return sel string for existing anchor
              //$(".activeSlide").css("opacity","0.1");
          //    
          //    return '#cycle-highlight-navi li:eq(' + (idx) + ') a';
          //}
          
      });
}); 
*/   
  

