
   var preloaded = new Array();
   var preload_images = new Array(
      'images/menu/index.jpg',
      'images/menu/index_a.jpg',
      'images/menu/news.jpg',
      'images/menu/news_a.jpg',
      'images/menu/pages.jpg',
      'images/menu/pages_a.jpg',
      'images/menu/assortment.jpg',
      'images/menu/assortment_a.jpg',
      'images/menu/menu.jpg',
      'images/menu/menu_a.jpg',
      'images/menu/orders.jpg',
      'images/menu/orders_a.jpg',
      'images/menu/clients.jpg',
      'images/menu/clients_a.jpg',
      'images/menu/settings.jpg',
      'images/menu/settings_a.jpg',
      'images/menu/about.jpg',
      'images/menu/about_a.jpg',
      'images/menu/service.jpg',
      'images/menu/service_a.jpg',
      'images/menu/banquet.jpg',
      'images/menu/banquet_a.jpg',
      'images/menu/action.jpg',
      'images/menu/action_a.jpg',
      'images/menu/calls.jpg',
      'images/menu/calls_a.jpg'
      );
      
   
   for (var i = 0; i < preload_images.length; i++)
   {
      preloaded[i] = new Image();
      preloaded[i].src = preload_images[i];
   };
   
   var g_bRed;
   g_bRed = false;
   //onmouseover="this.src=preloaded[22].src;" onmouseout="this.src = preloaded[23].src;"
   //actionIMG
   function blinkAction()
   {
      objActionIMG = document.getElementById("actionIMG");
      if (g_bRed)
      {
         g_bRed = false;
         objActionIMG.src = preloaded[23].src;
      }
      else
      {
         g_bRed = true;
         objActionIMG.src = preloaded[22].src;
      }

   }

	function getCheckedItems()
	{
		var strSendList = "";
		for (var i = 0; i < arrItems.length; i++)
	   {
	   	var chkElem = document.getElementById("inpCHK"+arrItems[i]);
	   	if (chkElem && chkElem.checked)
			{
				strSendList += arrItems[i]+"|";	
			} 
	   };
	   return strSendList;
	}
   function editItem(p_strId,p_strMonth,p_strDay,p_strMenuId)
   {
      document.location = "assortment.php?id="+p_strId+"&par=edit&m="+p_strMonth+"&d="+p_strDay+"&idm="+p_strMenuId+"&sel="+getCheckedItems();
   }

   function removeItem(p_strId,p_strMonth,p_strDay,p_strMenuId)
   {
      if (confirm('Вы действительно хотите удалить это блюдо?'))
      {
         document.location = "assortment.php?id="+p_strId+"&par=del&m="+p_strMonth+"&d="+p_strDay+"&idm="+p_strMenuId;
      }
   }
   
   function addItem(p_strMonth,p_strDay,p_strMenuId)
   {
      document.location = "assortment.php?par=add&m="+p_strMonth+"&d="+p_strDay+"&idm="+p_strMenuId+"&sel="+getCheckedItems();
   }
   
   function editNewsItem(p_strId)
   {
      document.location="news.php?par=edit&id="+p_strId;
   }
   function removeNewsItem(p_strId)
   {
      if (confirm('Вы действительно хотите удалить эту новость?'))
      {
         document.location = "news.php?id="+p_strId+"&par=del";
      }
   }
   
   function editActItem(p_strId)
   {
      document.location="action.php?par=edit&id="+p_strId;
   }
   function removeActItem(p_strId)
   {
      if (confirm('Вы действительно хотите удалить эту акцию?'))
      {
         document.location = "action.php?id="+p_strId+"&par=del";
      }
   }
   
   function editCallItem(p_strId)
   {
      document.location="calls.php?par=edit&id="+p_strId;
   }
   function removeCallItem(p_strId)
   {
      if (confirm('Вы действительно хотите удалить этот отзыв?'))
      {
         document.location = "calls.php?id="+p_strId+"&par=del";
      }
   }
   
   function RemoveClient(p_strName)
   {
      if (confirm('Вы действительно хотите удалить клиента "'+p_strName+'" ?'))
      {
         return true;
         //document.getElementById("register_form").submit();
      }
      return false;
   }
   
   function CalculateHalfPrice()
   {
      if (document.getElementById("HAS_HALF").checked)
      {
         strPrice1 = document.getElementById("ITEM1_PRICE").value;
         fPrice2 = strPrice1.replace(",",".") / 2;
         document.getElementById("ITEM2_PRICE").value = fPrice2.toFixed(2);
      }
   }
   
   function editSubUser(p_strId,p_strFid)
   {
      document.location = "clients.php?id="+p_strId+"&fid="+p_strFid+"&par=edit";
   }
   
   function removeSubUser(p_strId)
   {
       if (confirm('Вы действительно хотите удалить сотрудника ?'))
      {
         document.location = "clients.php?id="+p_strId+"&par=del";
      }
      
   }
   

   

