	var t=0;
	var t_elem;

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();
    });
};


jQuery(document).ready(function(){




  jQuery('.product_main_image ul li').hide();
  jQuery('.product_main_image ul li').eq(0).show();

  jQuery('.product_carousel li').click(function(){
	
	  jQuery('.product_main_image ul li').hide();
		
	  relid = jQuery(this).attr('rel');	
  	  jQuery('.product_main_image ul li').eq(relid).show();


	
  });
	
		
  jQuery('.categories').each(function(){
		csswidth = (jQuery(this).find('.category').length)*120;
		if(csswidth == 120){

			csswidth = 163;

		}
		jQuery(this).css('width',csswidth+0+'px');
		if(jQuery(this).outerHeight() > t) {
		
		    t_elem=this;
		
		    t= jQuery(this).outerHeight();

    	}

		jQuery(this).find('.category:last').css('border','0px');
  		jQuery(this).find('.category').css('height',t-50);
		t = 0;
  });
		



  jQuery('.categories').hover(function(){
	
		jQuery(this).parent('li').find('a').addClass('hover');

	},function(){

		jQuery(this).parent('li').find('a').removeClass('hover');

  })	
	t = 0;
  jQuery('.tabber').each(function(){

		if(jQuery(this).outerHeight() > t) {
		
		    t_elem=this;
		
		    t= jQuery(this).outerHeight();

    	}
	

		
  });


  jQuery('.board_selector a').css('cursor','pointer');
  jQuery('.tab_home').hide();
  jQuery('.tab_home').eq(0).show();


  jQuery('.board_selector a').click(function(){

		jQuery('.board_selector a').removeClass('active');
		jQuery(this).addClass('active');

		releq = parseInt(jQuery(this).attr('rel'));

		jQuery('.tab_home').hide();
  		jQuery('.tab_home').eq(releq).show();

		return false;
		
  });

  jQuery('.tabber_nav a').click(function(){

		jQuery('.tabber_nav a').removeClass('active');
		jQuery(this).addClass('active');	
		rel = jQuery(this).attr('rel');	
		jQuery('#spec').css('display','none');
		jQuery('#info').css('display','none');
		jQuery('#'+rel).css('display','block');
		return false;

   })		

	jQuery('.product_block').hover(function(){

	
		jQuery(this).find('.product_link a').addClass('active');

		},function(){

		jQuery(this).find('.product_link a').removeClass('active');

	})

	jQuery('#slides').before('<div id="nav-slides">'); 

	jQuery('#slides').cycle({ 
	    fx:     'scrollHorz', 
	    speed:  'slow', 
	    timeout: 5000, 
	    pager:  '#nav-slides' 
	});




	jQuery('.quick_basket').click(function(){
		
		link = jQuery(this).find('a').attr('href');
		
		window.location = link;

	});






});
