$(document).ready(function(){
	
	$("#askquestion").draggable();
	$("#recount_this_item").draggable();
    $(".menu li").hover(function(){
        $(this).toggleClass("lihov");
    }, function(){
        $(this).removeClass("lihov");
    });
    
    $(".faq .questn a").click(function(){
        $(".faq.fopen").removeClass("fopen");
        $(this).parents(".faq").toggleClass("fopen"); 
    });
    
    $('div.thumbs a').click(function(event){
        var prevCount = $(this).parent().prevAll().size();
        $(this).parent().parent().find('div.thact').removeClass('thact').end()
                         .parent().find('div.datails img.show').removeClass('show').addClass('hide').end()
                                   .find('div.datails img').eq(prevCount).removeClass('hide').addClass('show');
        $(this).parent().addClass('thact');
        event.preventDefault();
        return false;
    });
	
	$("a[rel=fancybox]").fancybox({
				'speedIn'		:	1000,
				'speedOut'		:	600,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
				    return '<span id="fancybox-title-over">Изображение ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
				}
			});
	
});

function recount_my_basket()
{
	$.post('/basket_core.php?method=actionReportSimple',{'my_basket_recount_col':document.getElementById("recount_this_item_col_id").value, 'my_basket_recount_id':document.getElementById("recount_this_item_id_id").value}, function(data){$("#retelling_recount_when_changed").html(data);});	
	}
