$(document).ready(function() {

	/* This is basic - uses default settings */
	
	$(".product-image-small123").fancybox();
	
	/* Using custom settings */
	
	$("a#inline").fancybox({
		'hideOnContentClick': true
	});

	/* Apply fancybox to multiple items */
	
	$("a.group").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
	});
	
	$('.related-product-item:nth-child(2n), .quattro-catalog-news .catBox:nth-child(2n), .quattro-catalog-hits .catBox:nth-child(2n)').after('<div class="clr"></div>');
	
	/* сорри, по-другому нет возможности сделать */
	
	razdellink = $('.breadcrumps a:last').attr('href');
	$('.quattro-catalog-menu ul ul a[href="'+razdellink+'"]').parent().next('ul').css('display','block');
    $('.quattro-catalog-menu-level-2-no, .quattro-catalog-menu-level-3-no').click(function(event){
            if($(this).next('ul').length > 0){
                event.preventDefault();
                $(this).next('ul').slideToggle();
            }
        });
		
/* 	if (razdellink == 'catalogue/drugie_izdelija/porogi/'){
			pics = $('div.product-image-small a img');
			colors = ['дуб деревенский', 'дуб тёмнный', 'гранит', 'красное дерево', 'латунь', 'мёд', 'мрамор зелёный', 'пробка', 'серебро', 'шампань', 'сосна', 'венге', 'вишня', 'золото' ,'акация', 'белый', 'без покрытия', 'бронза', 'дуб'];
			for(i=0;i<pics.length;i++)
				{
					$(pics[i]).attr('title',colors[i]);
				}
				$('div.product-image-small a img').qtip({
					style: { 
						padding: 5,
						background: '#fbf5e7',
						color: 'black',
						textAlign: 'center',
						tip: 'topMiddle',
						border: {
							width: 1,
							radius: 5,
							color: '#1e7699'
							},
						position: {
							target: 'mouse',
							corner: {
								target: 'topMiddle',
								tooltip: 'bottomMiddle'
								},
							adjust: {
							x:145,
							y:3100
								}
							},	
									
					}
				})
				
			// tips = $('div.qtip');
			// alert(tips.length)
			
		} */
		
	if (razdellink == 'catalogue/drugie_izdelija/otdelochnye_ugolki/')
		{
			$('.product-info').css('width','340px')
			$('.product-related').show()
		}
		

	
});
