function disable_skype_highlighting (i) {
	i = i+1;
	if ($('.skype_pnh_container').get(0)) {
		$('.skype_pnh_container').html('');
		$('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
	}
	if (i < 20) {
		setTimeout('disable_skype_highlighting('+(i+1)+');', 50);
	}
}

$(function() {
	$('#banners').jcarousel({
		'scroll': 1,
		'auto': 9,
		'wrap': 'circular',
		'itemVisibleInCallback': {
			'onAfterAnimation': function(carousel, item, index) {
				$('#pages a').removeClass('active');
				$('#pages a:contains('+(index%5==0?5:index%5)+')').addClass('active');
			}
		}
	});
	$('#pages a').bind('click', function() {
	    $('#banners').data('jcarousel').scroll($.jcarousel.intval($(this).text()));
	    return false;
	});
	
	$('.hndl_submit_prds_cmp').addClass('inactive');
	$('.ctrl_products_cmp').change(function() {
		if ($('.ctrl_products_cmp:checked').length > 1) {
			$('.hndl_submit_prds_cmp').removeClass('inactive');
		} else {
			$('.hndl_submit_prds_cmp').addClass('inactive');
		}
	});
	if ($('.ctrl_products_cmp:checked').length > 1) {
		$('.hndl_submit_prds_cmp').removeClass('inactive');
	};
	
	if ($('.paginator:has(.showall>span)').get(0)) {
		var all_link = $('.paginator li').eq(1).find("a").attr("href");
		$('.paginator').html('<li class="showpages"><a href="'+all_link+'">Показать страницы</a></li>');
		
	}
	
	$(
		'<img src="images/light-hover.png" alt="" />' +
		'<img src="images/find-button-hover.png" alt="" />' +
		'<img src="images/button-buy-hover.png" alt="" />'		
	).hide().appendTo('body');
	
	setTimeout('disable_skype_highlighting(1);', 50);

	$('.product_list .image-wrap img, #reviews-feed img')
		.each(function() {
			$(this).css('margin-top', (163-$(this).height())/2);
		})
		.load(function() {
			$(this).css('margin-top', (163-$(this).height())/2);
		});

});
