// JScript 文件
function AddOrder()
{
 document.getElementById("orderNo").disabled=true;
 document.getElementById("orderTime").disabled=true;
 document.getElementById("mark").disabled=true;
 document.getElementById("orderSubmit").disabled=true;
 var menuid=document.getElementById("menuTypeList").value;
 var menuno=document.getElementById("orderNo").value;
 var menutime=document.getElementById("orderTime").value;
 var obj=customer_myorder_aspx.AddOrder(menuid,menuno,menutime,document.getElementById("mark").value);
 if(obj.value!="")
  alert("您的订单号为:"+obj.value);
}
function getadminmenu()
{
  var obj=customer_myorder_aspx.GetAdminMenuType();
  var menuSelect=document.getElementById("menuTypeList");
  if(obj.value!="")
  {
   delSelect();
   var data=obj.value.split("|");
   for(i=0;i<data.length;i++)
   {
    var temp=data[i].split("*");
    var the_option= new Option(temp[1],temp[0]);
    menuSelect.add(the_option);
   }
  }
}
function getmynmenu()
{
  var obj=customer_myorder_aspx.GetMyMenuType();
  var menuSelect=document.getElementById("menuTypeList");
  if(obj.value!="")
  {
   delSelect();
   var data=obj.value.split("|");
   for(i=0;i<data.length;i++)
   {
    var temp=data[i].split("*");
    var the_option= new Option(temp[1],temp[0]);
    menuSelect.add(the_option);
   }
  }
}
function delSelect()
{
 var menuSelect=document.getElementById("menuTypeList");
 if(menuSelect.options.length>0)
    menuSelect.options.length=0; 

}
function GetMenuInfo()
{
 var obj=customer_myorder_aspx.GetInfo(document.getElementById("menuTypeList").value);
 var data=obj.value.split("|");
 var countItems=0;
 var moneyItems=0;
 for(i=0;i<data.length-1;i++)
 {
  var temp=data[i].split("*");
  moneyItems=moneyItems+parseFloat(temp[1]);
  countItems=countItems+1;
 }
 document.getElementById("state").innerHTML="总共有"+countItems+"个菜  总价格:"+moneyItems;
}