function reload_cart(type) {    $.get("/body/includes/library/cart_reload.php?cart", function(data){        if (type==1) {            $(".list_zakaza").html(data);            $.get("/body/includes/library/free_reload.php", function(data){$(".free_pizza").html(data);});         }        else if (type==undefined) {            $("#cart-list ul").html(data);            $('#cart-list ul').jScrollPane({showArrows:true});                   }    });    $.get("/body/includes/library/cart_reload.php?price", function(data){        $(".price_write").html(data);    });    }function add_to_cart(id,type) {yaCounter6193726.reachGoal('addpizza');	if ($("#item-button-"+id).html()=="Заказать") {		$("#item-counter-"+id).show();		$("#item-counter-more-"+id).show();		$("#item-button-"+id).html('Убрать из заказа');		$("#item-button-more-"+id).html('Убрать из заказа');		$("#item-counter-count-"+id).html('1');		$("#item-counter-more-count-"+id).html('1');                if (type=='drinks') {            $("#item-"+id).addClass('sel');        }        else $("#item-counter-count-"+id).html('1');        		$.get("/body/includes/library/cart.php?id="+id, function(data){			if (data==1) reload_cart();		});        	}	else {		$("#item-counter-"+id).hide();		$("#item-button-"+id).html('Заказать');		$("#item-counter-count-"+id).html('0');				$("#item-counter-more-"+id).hide();		$("#item-button-more-"+id).html('Заказать');		$("#item-counter-more-count-"+id).html('0');                if (type=='drinks') {            $("#item-"+id).removeClass('sel');        }                                             		        $.get("/body/includes/library/cart.php?dell&id="+id, function(data){			if (data==1) reload_cart();		});	}}function add_to_cart_plus(id) {	var count = $("#item-counter-count-"+id).html();	count++;	$("#item-counter-count-"+id).html(count);	$("#item-counter-more-count-"+id).html(count);	$.get("/body/includes/library/cart.php?id="+id, function(data){		if (data==1) reload_cart();	});}function add_to_cart_minus(id) {	var count = $("#item-counter-count-"+id).html();	count--;	if (count==0) {	$("#item-counter-"+id).hide();	$("#item-counter-more-"+id).hide();	$("#item-button-"+id).html('Заказать');	}	$("#item-counter-count-"+id).html(count);	$("#item-counter-more-count-"+id).html(count);	$.get("/body/includes/library/cart.php?minus&id="+id, function(data){		if (data==1) reload_cart();	});}function add_to_cart_pizza(id) {	if ($("#item-button-"+id).html()=="Заказать") {		$("#item-counter-"+id).show();		$("#item-counter-more-"+id).show();		$("#item-button-"+id).html('Убрать из заказа');		$("#item-button-more-"+id).html('Убрать из заказа');		$("#item-counter-count-"+id).html('1');		$("#item-counter-more-count-"+id).html('1');		$.get("/body/includes/library/cart.php?num="+$("#item-pizza-"+id).val()+"&id="+id, function(data){			if (data==1) reload_cart();		});	}	else {		$("#item-counter-"+id).hide();		$("#item-counter-more-"+id).hide();		$("#item-button-"+id).html('Заказать');		$("#item-button-more-"+id).html('Заказать');		$("#item-counter-count-"+id).html('0');		$("#item-counter-more-count-"+id).html('0');		$.get("/body/includes/library/cart.php?num="+$("#item-pizza-"+id).val()+"&dell&id="+id, function(data){			if (data==1) reload_cart();		});	}}function add_to_cart_pizza_plus(id) {	var count = $("#item-counter-count-"+id).html();	count++;	$("#item-counter-count-"+id).html(count);	$("#item-counter-more-count-"+id).html(count);	$.get("/body/includes/library/cart.php?num="+$("#item-pizza-"+id).val()+"&id="+id, function(data){		if (data==1) reload_cart();	});}function add_to_cart_pizza_minus(id) {	var count = $("#item-counter-count-"+id).html();	count--;	if (count==0) {	$("#item-counter-"+id).hide();	$("#item-counter-more-"+id).hide();	$("#item-button-"+id).html('Заказать');	$("#item-button-more-"+id).html('Заказать');	}	$("#item-counter-count-"+id).html(count);	$("#item-counter-more-count-"+id).html(count);	$.get("/body/includes/library/cart.php?num="+$("#item-pizza-"+id).val()+"&minus&id="+id, function(data){		if (data==1) reload_cart();	});}function replace_pizza(id,pizza) {	var nowpizza = $("#item-pizza-"+id).val();		$.get("/body/includes/library/cart_pizza_price.php?id="+id+"&pizza="+pizza, function(data){		$("#price-pizza-"+id).html(data);		$("#price-pizza-more-"+id).html(data);	});		$.get("/body/includes/library/cart_pizza_price.php?weight&id="+id+"&pizza="+pizza, function(data){		$("#weight-pizza-"+id).html(data);	});		$.get("/body/includes/library/cart_pizza_isset.php?id="+id+"&pizza="+pizza, function(data){		if (data!=0) {			$("#item-counter-"+id).show();			$("#item-counter-more-"+id).show();			$("#item-button-"+id).html('Убрать из заказа');			$("#item-button-more-"+id).html('Убрать из заказа');			$("#item-counter-count-"+id).html(data);			$("#item-counter-more-count-"+id).html(data);		}		else {			$("#item-counter-"+id).hide();				$("#item-counter-more-"+id).hide();			$("#item-button-"+id).html('Заказать');			$("#item-button-more-"+id).html('Заказать');			$("#item-counter-count-"+id).html(data);			$("#item-counter-more-count-"+id).html(data);		}	});		$("#item-link-"+id+"-"+nowpizza).removeClass('active');	$("#item-link2-"+id+"-"+nowpizza).removeClass('active');	$("#item-link-"+id+"-"+pizza).addClass('active');	$("#item-link2-"+id+"-"+pizza).addClass('active');		$("#item-link-more-"+id+"-"+nowpizza).removeClass('active');	$("#item-link2-more-"+id+"-"+nowpizza).removeClass('active');	$("#item-link-more-"+id+"-"+pizza).addClass('active');	$("#item-link2-more-"+id+"-"+pizza).addClass('active');		$("#item-pizza-"+id).val(pizza);		return false;}function delete_item(id,pizza,q) {    $.get("/body/includes/library/cart_delete.php?id="+id+"&pizza="+pizza, function(data){        if (data==1) {            if (q==1) {                $("#item-"+id+"-"+pizza).hide();            }            else {                                   if (pizza==0) {                    $("#item-counter-"+id).hide();                    $("#item-button-"+id).html('Заказать');                    $("#item-counter-count-"+id).html('0');					$("#item-counter-more-"+id).hide();                    $("#item-button-more-"+id).html('Заказать');                    $("#item-counter-more-count-"+id).html('0');                }                else {                    var nowpizza = $("#item-pizza-"+id).val();                    if (nowpizza==pizza) {                        $("#item-counter-"+id).hide();                        $("#item-button-"+id).html('Заказать');                        $("#item-counter-count-"+id).html('0');						 $("#item-counter-more-"+id).hide();                        $("#item-button-more-"+id).html('Заказать');                        $("#item-counter-more-count-"+id).html('0');                    }                }            }                        $.get("/body/includes/library/cart_reload.php?cart&type="+q, function(data){                if (q==1) {                    $(".list_zakaza").html(data);                    $.get("/body/includes/library/free_reload.php", function(data){$(".free_pizza").html(data);});                 }                else {                    $("#cart-list ul").html(data);                    $('#cart-list ul').jScrollPane({showArrows:true});                           }            });            $.get("/body/includes/library/cart_reload.php?price", function(data){                    $(".price_write").html(data);            });        }    });        return false;}function delete_all_items() {	$.get("/body/includes/library/cart_delete.php?all&id=0&pizza=0", function(data){		if (data==1) {			window.location.href=window.location.href;		}	});		return false;}$(document).ready(function(){	    $(".item-desc-energy a").click(function (){		return false;	});	 	$('.item-desc-energy a').hover(function(){	var what = $(this).attr('href');       $("#energy-over-"+what).stop().animate({top:'0px'},{queue:false,duration:160});    }, function() {	var what = $(this).attr('href');       $("#energy-over-"+what).stop().animate({top:'157px'},{queue:false,duration:160});    });        //Регистрация    $("a.button_proverka").click(function(){        $(".emailfind").css({'display':'block'});                if ($("input[name=user_email]").val()!='') {            $.get("/body/includes/library/checkemail.php?e="+$("input[name=user_email]").val(), function(data){                if (data==2) $(".emailfind").html('<img src="/images/icon_att_red.png" border="0" width="12" height="13"> не правильно заполнено поле');                else if (data==3) $(".emailfind").html('<img src="/images/icon_att_red.png" border="0" width="12" height="13"> Email присудствует в базе');                                    else if (data==1) $(".emailfind").html('<img src="/images/icon_ok.png" border="0" width="12" height="13"> Email свободен');             });        }        else $(".emailfind").html('<img src="/images/icon_att_red.png" border="0" width="12" height="13"> необходимо ввести email');        return false;            });        $(".kod_podtvergdeniya").focus(function(){        $("a.button_reg").css({'background':'url("../images/button_reg_off.png") no-repeat 0 0'});        $(this).val('');        $(this).keypress(function() {            $("a.button_reg").css({'background':'url("../images/button_reg_on.png") no-repeat 0 0'});        });            });        $(".button_reg,.button_no_kod").click(function(){        $("input[name=ActionCode]").val($(this).attr('id'));        $("form[name=Registration]").submit();        return false;    });        $(".loginpanel,.entrance_close").click(function(){        $("#loginpanel").slideToggle("slow");        return false;    });        $(".button_login_main,.button_login").click(function(){          $.post("/body/includes/library/entrance.php", {user_login:$("input[name=user_login]").val(),user_password:$("input[name=user_password]").val()}, function(data){            if (data==1 || data==2) {                if ($("input[name=LoginForm]").val()=='entrance_order') $(".panel_auto").css({'background':'url(../images/panel_background_b.gif) no-repeat','height':'180px'});                $(".entrance_panel").html('<div class="att_red">Не правильная пара логин-пароль!<br/>Авторизоваться не удалось.</div>');                $("input[name=user_login],input[name=user_password]").val('');            }            else if (data==3) {                if ($("input[name=LoginForm]").val()=='entrance_order') window.location='/myroom/orders/';                else window.location='/';            }        });    });        $("#kalendar").click(function(){        $("#block_kalendar").toggle("slow");    });    $("#calendar-bottom .close").click(function(){         $("#block_kalendar").toggle("slow");    });        $(".button_add_adres").click(function(){        $(".addardess").show();                return false;            });        $(".buy_sign, .buy_clearance").click(function() {                if ($(this).find("img").attr('id')=='s_1') {            $("#s_1").attr('src','/images/checked.png');            $("#s_2").attr('src','/images/check.png');            $(".type_1").show();            $(".type_2").hide();        }        else if ($(this).find("img").attr('id')=='s_2') {            $("#s_1").attr('src','/images/check.png');            $("#s_2").attr('src','/images/checked.png');            $(".type_1").hide();            $(".type_2").show();        }       });        $("#designer_clear").click(function(){        $.get("/body/includes/library/designer-clear.php", function(data){            if (data==1) window.location='/designer/'; return false;        });        return false;    });           $("div.mymenu_button").click(function(){        ID_select=$(this).attr('id');         ID_select=ID_select.substring(2);         $(".mysel-"+ID_select).hide();        $(this).toggleClass("active");                 $.get("/body/includes/library/mymenu.php?id="+ID_select, function(data){            $(".submenu ul li:last a span").text('['+data+']');        });    });        $(".btn_cash,.btn_chilimoney,.btn_card").click(function(){        $(".btn_cash,.btn_chilimoney,.btn_card").removeClass('active');        v_class=$(this).attr('class');        $(this).addClass('active');                if (v_class=='btn_chilimoney'){            $("input[name='type_payment']").val(2);            $.get("/body/includes/library/check_chilimoney.php", function(data){                if (data==0) {                    $(".checkmoney").html('<img src="/images/icon_att_red.png" border="0" width="12" height="13"> Вам не хватает Chili-денег');                    $("input[name='type_payment']").val(1);                                        $(".btn_chilimoney").removeClass('active');                    $(".btn_cash").addClass('active');                                    }                else $(".checkmoney").html(data);                                });        }         else {            if (v_class=='btn_card') $("input[name='type_payment']").val(3);            else $("input[name='type_payment']").val(1);            $(".checkmoney").html('');        }    });        calendar=new Date();    var cal_year=calendar.getFullYear();    var cal_month=calendar.getMonth()+1;        arrMonth = new Array ("","Январь","Февраль","Март", "Апрель","Май", "Июнь","Июль","Август", "Сентябрь","Октябрь", "Ноябрь","Декабрь");                $(".year-previous,.year-next,.month-previous,.month-next").click(function(){                if ($(this).attr('class')=='year-previous') cal_year--;         else if ($(this).attr('class')=='year-next') cal_year++;        else if ($(this).attr('class')=='month-previous') cal_month--;        else if ($(this).attr('class')=='month-next') cal_month++;                if (cal_month<=1) $("a.month-previous").html('');        else $("a.month-previous").html('&#x2190;');                if (cal_month>=12) $("a.month-next").html('');        else $("a.month-next").html('&#x2192;');                $("#year span").text(cal_year);        $("#month span").text(arrMonth[cal_month]);                $.get("/body/includes/library/calendar.php?year="+cal_year+"&month="+cal_month, function(data){            setTimeout(function () {                $("#block_kalendar div.inner").html(data);            }, 500);        });             $("#block_kalendar div.inner").html('<img src="/images/loader.gif" border="0" width="32" height="32">');                return false;    });        $("span#min,span#plus").click(function(){         ID_style=$(this).parent('td.st_5').attr('class');        if (ID_style=='st_5 sel') {            ID_item=$(this).parent('td.st_5').attr('id');            ID_item=ID_item.substring(5);                         if ($(this).attr('id')=='min') {                                add_to_cart_minus(ID_item);                if (parseInt($("#item-counter-count-"+ID_item).text(),10)==0) $("#item-"+ID_item).removeClass('sel');             }            else if ($(this).attr('id')=='plus') add_to_cart_plus(ID_item);        }    });        $(".rating_reviews ul.rating li a").click(function() {        this_class=$(this).parent('li').attr('class');        this_id=$(this).parent().parent('ul').attr('id');                $("input[name='"+this_id+"']").val(this_class);                $(this).parent().parent('ul').removeClass($(this).parent().parent('ul').attr('class'));        $(this).parent().parent('ul').addClass('rating');        $(this).parent().parent('ul').addClass(this_class+'star');                        return false;            });        $("div.att_block a.close").click(function() {        $.get('/body/includes/library/close_att.php');        $("div.att_block").remove();        return false;    });        $("#learnmore").click(function(){        $("#carousel-wrap").toggleClass('text_view');        if($('#learnmore>img').attr('src')=='/images/more-1.png') {            $('#learnmore>img').attr('src', '/images/more-2.png');        }        else $('#learnmore>img').attr('src', '/images/more-1.png');    });		});function take_atrr_to_more(id) {	if ($("#item-link-"+id+"-1").hasClass('active')){		$("#item-link-more-"+id+"-1").addClass('active');	}	if ($("#item-link2-"+id+"-2").hasClass('active')){		$("#item-link2-more-"+id+"-2").addClass('active');		$("#item-link2-more-"+id+"-1").removeClass("active");	}}	
