  $(document).ready(function(){
        updatecart();
//    $(".slider_all").css('display','none');
    var f = 0;
    $("td[type=menu_master]")
    .bind("mouseenter",
        function(){
	    var id = $(this).attr('mid');
	    var pos = $(this).offset();

	    $("div[pid="+id+"]").show();
	    $("div[pid="+id+"]").css({ left: pos.left });
	    
	}
    ).bind("mouseover",
        function(){
	    var id = $(this).attr('mid');
	    
	    $("div[pid="+id+"]").show();
	    
	}
    ).bind("mouseleave",
	function () {
	    if (!f) {
		var id = $(this).attr('mid');
		$("div[pid="+id+"]").hide();}
	}
    );
    $("div[type=menu_child]")
    .bind("mouseleave",
	function () {
	    $(this).hide();
	    f=0;
	}
    ).bind("mousenter",
	function () {
	    f=1;
	}
    );   
    $("div#block1")
    .bind("mouseenter",
        function(){
		$("div#block1").hide(); 
		$("div#block2").show(); 
	}
    );

    $("div#block2")	
    .bind("mouseleave",
	function () {
		$("div#block2").hide();
		$("div#block1").show(); 
	}
    );



 });
          
        function resetcart() {
	$(document.cookie.split("; ")).each( 
	    function () { 
		var cook = this.split("=");
		var name_id = cook[0].split("_");
		if (name_id[0] == "count") {
		    $.cookie(cook[0], null, {path: "/"}); 
		    $.cookie("price_"+name_id[1], null, {path: "/"}); 
		    $.cookie("tname_"+name_id[1], null, {path: "/"});
		    $.cookie("imgsrc_"+name_id[1], null, {path: "/"});
		} 
	    }
	);
	$.cookie("all_count", null, {path: "/"});    
	$.cookie("summ", null, {path: "/"});    
	updatecart();
    }
    
    function updatecart() {
	$("#all_count").text($.cookie("all_count") || '0');
	$("#all_count2").text($.cookie("all_count") || '0');
	var summ = $.cookie("summ") || '0';
	summ = summ + ' руб';
	$("#summ").text(summ);
	$("#summ2").text(summ);
    }     




