function menu_activation(id_table,input_pole,big_img,recept){
  document.getElementById(id_table).className = "menu_akt";

  var urlik = 'url("'+big_img+'")';
	document.getElementById("big_img").style.backgroundImage = urlik;

  document.getElementById(input_pole).focus();
	document.getElementById(input_pole).select();
	
	if(recept == '' || recept == 'undefind'){
  document.getElementById("recept_n").style.visibility = 'hidden';
	} else {
  document.getElementById("recept_n").innerHTML = "<strong>Состав:</strong><br>"+recept+" ";
  document.getElementById("recept_n").style.visibility = 'visible';	
  }
}
function menu_deactivation(id_table){
  document.getElementById(id_table).className = "menu_neakt";
  document.getElementById("recept_n").style.visibility = 'hidden';
}
function show_recept(id)
{
    document.getElementById(id).style.visibility = 'visible';
}
function hide_recept(id)
{
    document.getElementById(id).style.visibility = 'hidden';
}
/*function plus_tovar(id)
{
  var n;
  n = eval(document.getElementById(id).value);
  n = n + 1;
  document.getElementById(id).value = n;
}*/
function plus_tovar(id,id_tovar)
{
  ajax_plus(id_tovar);
  var n;
  n = eval(document.getElementById(id).value);
  n = n + 1;
  document.getElementById(id).value = n;
}
function ajax_plus(id_t)
        {  
            $.ajax({  
                url: "/tpl/plus_tovar_ajax.php",  
                cache: false,
                data: "id="+id_t,  
                success: function(html){  
                    $("#koshik").html(html);  
                }
            });
        }
function minus_tovar(id,id_tovar)
{
  var n;
  n = eval(document.getElementById(id).value);
  if (n > 0) {
    ajax_minus(id_tovar);
    n = n - 1;
    document.getElementById(id).value = n;
  }
}
function ajax_minus(id_t)
        {  
            $.ajax({  
                url: "/tpl/minus_tovar_ajax.php",  
                cache: false,
                data: "id="+id_t,  
                success: function(html){  
                    $("#koshik").html(html);  
                }
            });
        }
function screenSize() {
    var w, h;
    w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
    h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
    return {w:w, h:h};
}
function size_div(){
	var l=Math.round((screenSize().w-528)/2);
	var t=Math.round((screenSize().h-260)/2);
    
    document.getElementById("thenk2").style.margin = t+"px 0px 0px "+l+"px";
}
function div_d() {
    var a = document.body.scrollTop;

	l=(screenSize().w-528)/2;
	t=(screenSize().h-260)/2;
	a = a + t;
    
    document.getElementById("thenk2").style.margin = a+"px 0px 0px "+l+"px";
}
function init() {
    document.body.onscroll = div_d
}
function hide_screen(id){
    document.getElementById(id).style.visibility='hidden';
}
function show_screen(id){
    document.getElementById(id).style.visibility='visible';
}
function getDocumentHeight2(){
  var hhh = 0;
  hhh = getDocumentHeight();
  document.getElementById("thenk").style.height = hhh+"px";
}
function getDocumentHeight(){
    return (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;
}
