var $ = jQuery;
$(function(){
	$('.product-tabs').each(function(){
		$(this)
		.find('.products-header a')
			.css('cursor', 'pointer')
			.click(function(){
				if($(this).parent().parent().hasClass('gallery')){
					$('.gallery .products-header a').removeClass('current');
					$('.gallery .tab-content').hide();
				}
				$(this).parent().find('a').removeClass('current');
				$(this).addClass('current');
				$(this).parent().parent().find('.tab-content').hide().eq($(this).data('index')-1).fadeIn('normal');
			})
			.each(function(i){
				$(this).data('index', i+1);
			});
		$(this).find('.tab-content:gt(0)').hide();
	});
	$('.gallery .tab-content:gt(0)').hide();
	$('#menu a').filter(function(){ return this.href==window.location; }).css('color', 'orange');
	$('.product-links a, a.lightbox').lightBox({
		imageLoading:'../images/lightbox-ico-loading.gif',
		imageBtnPrev:'../images/lightbox-btn-prev.gif',	
		imageBtnNext:'../images/lightbox-btn-next.gif',	
		imageBtnClose:'../images/lightbox-btn-close.gif',
		imageBlank:'../images/lightbox-blank.gif'
	});
});