jQuery(document).ready(function()
{


	var n = jQuery("div.basket_block div#anyClass li").size();
	var m = jQuery("div.product input.product_hidden").size();
	
	for (i=0;i<n;i++){
		for(j=0;j<m;j++){
				if (jQuery("div.basket_block div#anyClass li input.top_basket_hidden").eq(i).val()==jQuery("div.product input.product_hidden").eq(j).val()){
					jQuery("div.product").eq(j).addClass("add");
					}
			}
	}
	
	var now_good = jQuery("input.good_num").val();
	var nesc = jQuery("ul.catalog_card li").size();
	for (k=0;k<nesc;k++)
	{
		if (jQuery("ul.catalog_card li input").eq(k).val() == now_good)
		{
//			jQuery("ul.catalog_card li input").eq(k).parent().find("a").addClass("now");
			jQuery("ul.catalog_card li input").eq(k).parent().find("a").css('border', '1px solid #d50303');

			}
		}
		
		
	if (n<=3)
	{
		jQuery("a.left_basket_arrow").remove();
		jQuery("a.right_basket_arrow").remove();
		}

	if (n==1)
	{
				
		} else {
				jQuery('#anyClass ul').jcarousel({ 
					scroll: 1, 
					visible:3,
				   auto: 6.09,
				   animation: 400,
				   wrap: 'both'
				 /*, both или last
				 initCallback: mycarousel_initCallback*/
				});
			}
		
	jQuery('#carousel').infiniteCarousel({
		displayTime: 6000,
		textholderHeight : .35
	});
	jQuery(".jCarouselLite").jCarouselLite({
	    btnNext: ".next3",
	    btnPrev: ".prev3",
	    vertical: true,
		 speed: 1000,
		 //auto: 6000,
	    visible: 4
	});
			jQuery('#scrollable UL').jcarousel({ 
				scroll: 1, 
			   //auto: 6.09,
			   animation: 400,
	         wrap: 'both'/*, both или last
	         initCallback: mycarousel_initCallback*/

			});		
	
	var rf = jQuery("a.removeFromCompare").size()
	if (rf==1){
		jQuery("div.compare_block_left_link").remove();
		}
	
	jQuery(".form ul li a.edit").click(function() {
	  jQuery(this).parent().find("input").focus().val();
	});

});
