function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    $("#subscribeEmail").attr({oldValue: $("#subscribeEmail").attr("value")});
    
	$("#subscribeEmail").focus(function() {
	    if ( $(this).attr("value") == $(this).attr("oldValue") ) {
            $(this).attr({value: ""});
	    }
	});
    
    
    jQuery('.scroller ul').jcarousel({
		visible:3,
		scroll: 1
    });
	
	
	$("a.zoom").lightBox();
	
	// заказ
	$("#rulesBox").click(function() {
	    $("#contButton").attr({"disabled": !$(this).attr("checked")});
	    if ( $(this).attr("checked") ) {
	        $("#contButton").removeClass("inactive");
	    } else {
	        $("#contButton").addClass("inactive");
	    }
	});
	
	// hover
    $(".but:not(:disabled)").hover(
        function () {
            $(this).addClass("hover");
        }, 
        function () {
            $(this).removeClass("hover");
        }
    );
    $(".bigbut:not(:disabled)").hover(
        function () {
            $(this).addClass("hover");
        }, 
        function () {
            $(this).removeClass("hover");
        }
    );
    
    // корзмна
    $(".delete").click(function() {
        $("#submitValue").attr({"name": "BasketRefresh"});
        
        document.getElementById("basketItem" + $(this).attr("name")).value = "Y";
        $("#submitButton").click();
        return false;
    });
    
    $(".quantity").keyup(function() {
        if ( $(this).attr("value") > 0 ) {
            $("#submitValue").attr({"name": "BasketRefresh"});
            
            $("#bigBasketForm").attr({"action": $("#bigBasketForm").attr("action") + "#" + $(this).attr("id")});
            $("#submitButton").click();
        }
    });
});
