  //---------------------------------------------------------
  //  樲 皋牢 包访 努贰胶
  //---------------------------------------------------------
  function Shop(inst_Common,formname){

    //  傍侩 努贰胶 牢胶畔胶 肺爹
    this.inst_Common = inst_Common;
    var form;

				try { this.form = eval(formname+".elements"); }
				catch (e) { }

    //  惑前 可记 沥焊 硅凯 函荐
    var GoodsOptionArrays;

    //  惑前 魄概啊
    var SaleCost;
    this.SaleCost=0;

    //  林巩 陛咀
    var OrderAmount;
    this.OrderAmount = 0;

    //  眠啊惑前/荤篮前SelectBox 按眉 硅凯 急攫
    var AdditionBox;
    this.AdditionBox = new Array();

    //  眠啊惑前 荤篮前 啊拜
    var AdditionAmountSum;
    this.AdditionAmountSum = 0;

    //  惑前 荐樊 ( 檬扁 蔼捞聪瘪 1 )
    var Amt;
    this.Amt = 1;

    //  急琶 惑前 荐樊 钦拌
    var totalAmt;
    this.totalAmt = 1;  // 檬扁 荐樊 1 钦魂且锭 0栏肺 檬扁拳 窍绊 钦魂凳

    //  惑前 荐樊 input 冠胶 按眉
    var Amt_Form;

    //  泅犁 急琶 惑前狼 荐樊 烙矫滚欺
    var RmainAmt = 0;

    //  惑前 荤捞令 & 祸惑 Select Box 按眉 & 荐樊
    var ColorBox;
    this.ColorBox = new Array();
    var SizeBox;
    this.SizeBox = new Array();
    var AmtBox;
    this.AmtBox = new Array();
    
    // 可记啊 眠啊 
    var OptCostBox;
    this.OptCostBox = new Array();

    //  眠啊惑前 荤篮前 啊拜 按眉
    var AddCost;

    //  魄概啊拜 棺 搬犁 啊拜 SPAN 按眉
    var SaleCostSpan;
    var TotalCostSpan;

    //  弥措 备概 荐樊 span
    var MaxAmtSpan;

    //  惑前 备概 可记 急琶 牢磐其捞胶 巩磊凯
    var BuyOptionForm;

    //  惑前 可记 急琶 眠啊 抛捞喉 按眉
    var OptionTable;

    //  可记 锅龋
    var FormNumber;
    this.FormNumber = 0;

    //  泅犁 急琶茄 可记 锅龋
    var NowOption;
    this.NowOption = 0;

    //  可记 鸥涝
    var OptionType;
    this.OptionType = "insert";

    //  泅犁 急琶茄 可记狼 目辑
    var NowFormNumber;
    this.NowFormNumber = 0;

    //  吝汗 可记 规瘤 眉农侩 硅凯
    var NowSelectedOPTs;
    this.NowSelectedOPTs = new Array();

    //=====================================
    //  厘官备聪 郴开俊辑 惑前 林巩 急琶 函版矫
    //  荤侩 登绰 硅凯 棺 函荐甸
    //=====================================
    var SelectedOpt1,SelectedOpt2,SelectedOptStyle;

    this.SelectedOpt = new Array();
    this.SelectedOpt['Size'] = new Array();
    this.SelectedOpt['Color'] = new Array();
    this.SelectedOpt['Amt'] = new Array();
    this.SelectedOpt['Style'] = "";

    //  可记狼 荐樊 包府 规侥m 荐樊 瘤沥(荐樊包府窃) / l 荐樊 老褒屈 / i 荤侩磊 涝仿屈
    this.SelectedOptStyle = "";

    //  荐樊 包府 屈怕 檬扁拳( 惑前 荐沥矫俊 钦魂窍绰 何盒寇俊绰 荤侩登瘤 臼澜)
    var Section;
    this.Section = "";
     
				//================================================
				//  1. 弥措 备概 荐樊 函荐
				//  2. 惑前狼 醚 荐樊
				//  3. 惑前 荐樊 扁夯 刘啊 窜困
				//  4. 惑前 荐樊 扁夯 刘啊 窜困 滚欺
				//  角技泼篮 SelectBuyOptions() php 皋家靛俊辑 且寸 
				//================================================
				var MaxGoodsBuy;
				var GoodsTotalVolume;
				var increase_amount;
    var increase_amount_buffer; //  扁夯 荐樊 刘啊 窜困 烙矫 历厘 滚欺 				
				this.increase_amount = 0;
				this.increase_amount_buffer = 0;
				this.GoodsTotalVolume = 0;

				//==============================================
				//
				//  硅价厚 & 搬力 陛咀 包访 函荐甸 
				//
				//==============================================
				//  林巩辑 累己汽俊辑 利赋陛 荤侩且锭 荤侩 登绰 SPAN甸狼 ID 蔼捞 甸绢哎 函荐甸 
				//  LoadReserveForm 皋家靛俊辑 沥狼凳
				var UseReserveForm, SpentReserveForm, ResultTotalAmountForm, DelivCostForm, DelivCostTotalForm;
				
				//  林巩陛咀, 雀盔 焊蜡 利赋陛, 荤侩窍妨绰 利赋陛 , 捻迄 且牢 陛咀, 雀盔 且牢 陛咀, 扁夯 硅价丰, 且刘 硅价丰, 
    //  林巩磊 林家啊 且刘夸陛瘤开捞搁 秦寸 林巩磊 林家狼 且刘夸陛档 IncreaseDelivCostBuff <-- 捞函荐俊 檬扁俊 技泼茄促.
				var OriTotalSum=0, OriReserve=0, UseReserve=0, CouponSale=0,MemberSale=0;
				var DelivCostBasic=0, IncreaseDelivCost=0,IncreaseDelivCostBuff, DelivCostFreeLine=0;

        var DelivNotCost; //  捻迄且牢 利侩矫 硅价厚 固器窃 陛咀
        this.DelivNotCost=0;

        var DelivFreeCheck; // 惑前捻迄 利侩饶 公丰硅价捻迄 利侩矫 眉农蔼 : 2010-09-08
        this.DelivFreeCheck = 'N';

				//  text 膏飘 ( 蔼狼 汲沥篮 Shop_View 努贰胶狼 积己磊俊辑 汲沥 )
				var DelivCostMent,DelivIncreaseMent;
				
				//==================================================
				//  泅犁 林巩狼 硅价厚 利侩 扁霖
				//  ShopView->SetDelivPolicyJS 皋家靛俊辑 沥狼等促.
				//==================================================
				var DelivPolicy;
				this.DelivPolicy = 0;

				//=========================
				//   捻迄+利赋陛 荤侩咯何
				//=========================
				var Double_sale;

				//=========================
				//  可记捞 1俺楼府牢瘤 备盒
				//=========================
				var SingleOption;
				this.SingleOption = "none";

				//======================
				//  荤侩吝牢 PG荤 函荐
				//======================
    var PGCom;
				this.PGCom = "none";

				//===============================================================
				//  促吝 墨抛绊府 殿废 惑前 惑技其捞瘤俊辑 辑宏 墨抛绊府 免仿 惑怕
				//===============================================================
    var SubCateListsStatus;
				this.SubCateListsStatus = false;  // 扁夯利栏肺 啊妨柳 惑怕 

    var Buff_DelivCostDetailView;
    this.Buff_DelivCostDetailView = "";

    //=================================
    //    扑诀甸狼 z-index吝 弥措蔼 
    //    Head->DivPopup 皋家靛俊辑 沥狼
    //=================================
    var Max_zindex;
    this.Max_zindex = 0;

    //=====================================
    //  利赋陛父栏肺 搬力 且版快 眉农 
    //  GetTotalThisOrder 皋家靛俊辑 货肺 沥狼凳
    //=====================================
    var OnlyReserve;
    this.OnlyReserve = false;

  // function - End
  }

Shop.prototype={
// class - Start

  //-----------------------------------------------------------------------------
  //  孽府 单捞磐甫 努贰胶 郴何肺
  //-----------------------------------------------------------------------------
  SetData : function(GoodsOptionArrays) {
    this.GoodsOptionArrays = GoodsOptionArrays;
  // function - End
  },

  //----------------------------------------------------
  //  惑前 八祸 汽 傈价
  //----------------------------------------------------
  SearchKey : function(){
    var keyinput = document.getElementById("SearchKeyInput");
    if (!keyinput.value.trim()) {
      keyinput.focus();
      keyinput.value = "";
      alert('惑前疙阑 涝仿秦林技夸.');
      return false;
    }
    else {
       this.form.SearchKey.value=keyinput.value;
       this.form.submit();
    }
  // function - End
  },

  //----------------------------------------------------
  //  惑前 惑技 八祸 汽 傈价
  //----------------------------------------------------
  SearchKeyDetail : function(){

    //  咀记
    var formaction = document.getElementById("formaction");
    formaction.value='SearchDet';

				// 虐况靛
    var keywordinput = document.getElementById("KeyWord");

    //  啊拜 历 ~ 绊
    var lowinput = document.getElementById("Low");
    var highinput = document.getElementById("High");

    //  撤篮 啊拜苞 臭篮 啊拜 笛吝 窍唱扼档 蔼捞 涝仿 登菌阑锭
    if (lowinput.value.trim() != "" || highinput.value.trim() != "") {

      //  笛促 蔼捞 乐阑 版快父 汽傈价
      if (lowinput.value.trim() != "" && highinput.value.trim() != "") {

        //  虐况靛甫 涝仿沁阑 版快
        if (keywordinput.value!="") {
          this.form.SearchKey.value=lowinput.value+"|"+highinput.value+"|"+keywordinput.value;
          this.form.submit();
        // if - End
        }
        else {
          this.form.SearchKey.value=lowinput.value+"|"+highinput.value;
          this.form.submit();
        }
      }
      else {
        alert('啊拜措甫 葛滴 涝仿秦林技夸.');
        return false;
      }

    // if1 - End
    }
    //  葛电蔼捞 绝阑 锭
    else if(!lowinput.value.trim() && !highinput.value.trim() && !keywordinput.value.trim()){
      keywordinput.focus();
      alert('八祸 郴侩阑 涝仿秦林技夸.');
      return false;
    }
    //  虐况靛父 涝仿沁阑 锭
    else if(keywordinput.value.trim()!=""){
      this.form.SearchKey.value=keywordinput.value;
						this.form.submit();
    }
  // function - End
  },

  //-----------------------------------------------------------------------------
  //  祸惑 技泼
  //-----------------------------------------------------------------------------
  SetVolumes1 : function(Section){

     this.SizeBox[this.FormNumber] = document.getElementById("Size["+this.FormNumber+"]");
     this.ColorBox[this.FormNumber] = document.getElementById("Color["+this.FormNumber+"]");
     this.AmtBox[this.FormNumber] = document.getElementById("Amt["+this.FormNumber+"]");
     this.OptCostBox[this.FormNumber] = document.getElementById("OptCost["+this.FormNumber+"]");

     switch (Section) {

       case "manual" :
         for (var i=0; i < this.GoodsOptionArrays['Size'].length; i++){
           this.SizeBox[this.FormNumber][i+1]=new Option(this.GoodsOptionArrays['Size'][i],this.GoodsOptionArrays['Size'][i]);
         }
       break;

       case "lump" :
         //  荤捞令 技泼
         for (var i=0; i < this.GoodsOptionArrays['Size'].length; i++){
           this.SizeBox[this.FormNumber][i+1]=new Option(this.GoodsOptionArrays['Size'][i],this.GoodsOptionArrays['Size'][i]);
         }

         //  祸惑 技泼
         for (var i=0; i < this.GoodsOptionArrays['Color'].length; i++){
           this.ColorBox[this.FormNumber][i+1]=new Option(this.GoodsOptionArrays['Color'][i],this.GoodsOptionArrays['Color'][i]);
         }
       break;

     }

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  祸惑 冠胶 檬扁拳
  //-----------------------------------------------------------------------------
   ResetColorBox : function() {

     //  窍唱究 临咯唱啊搁辑 辨捞档 临绢甸扁锭巩俊 公炼扒 1锅掳芭父 绝局林搁
     //  扁夯 option 哗绊 促瘤况咙
     for (var i=1; i <= this.ColorBox[this.NowFormNumber].length+1; i++) { this.ColorBox[this.NowFormNumber][1] = null; }

     //  付瘤阜 1仇阑 力芭
     this.ColorBox[this.NowFormNumber][1] = null;

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  荤捞令 冠胶 檬扁拳
  //-----------------------------------------------------------------------------
   ResetSizeBox : function() {

     //  贸澜 牢磊甫 急琶
     this.SizeBox[this.NowFormNumber][0].selected = true;

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  急琶 可记阑 硅凯俊 淬酒林绰仇
  //  捞仇篮 公炼扒 淬酒林扁父茄促.
  //-----------------------------------------------------------------------------
   AddArraySelectedOPT : function(SelectedSize,SelectedColor) {

     //  急琶茄 可记捞 扁粮俊 急琶茄 可记捞 酒匆版快父
     if (this.inst_Common.in_array(this.NowSelectedOPTs,SelectedSize+"|"+SelectedColor) == true ) {
         this.NowSelectedOPTs[this.NowFormNumber] = SelectedSize+"|"+SelectedColor;
     }
  // function - End
  },

  //-----------------------------------------------------------------------------
  //  秦寸 牢郸胶狼 急琶 可记阑 官层霖促.
  //-----------------------------------------------------------------------------
  PadSelectedOPT : function(SelectedSize,SelectedColor) {
    this.NowSelectedOPTs[this.NowFormNumber] = SelectedSize+"|"+SelectedColor;
  // function - End
  },

  //----------------------------------------------------------------------------------
  //  鞍篮 可记 急琶 登绢 乐绰瘤 眉农窍绰 皋家靛
  //  泅犁 眠啊 登绢 乐绰 可记狼 肮荐父怒 风橇
  //----------------------------------------------------------------------------------
  CheckSameOPT1 : function(Section) {

   //  泅犁 急琶等 荤捞令狼 牢郸胶 ( 牢郸胶客 荤捞令啊 悼老窍促 , 溜 荤捞令啊 105捞搁 牢郸胶档 105]
   var SelectedSize = this.SizeBox[this.NowFormNumber][this.SizeBox[this.NowFormNumber].selectedIndex].value;
   var SelectedColor = this.ColorBox[this.NowFormNumber].selectedIndex-1;     //  泅犁 急琶等 祸惑狼 牢郸胶

    //  泅犁 急琶等 可记狼 牢郸胶( NowFormNumber )客 鞍篮
    //  NowSelectedOPTs 狼 夸家啊 厚绢 乐瘤臼栏搁
    //  NowSelectedOPTs狼 NowFormNumber 俊 泅犁 急琶 可记阑 持绢霖促.
    if (this.NowSelectedOPTs[this.NowFormNumber]!="") {

      //  急琶茄 可记捞 捞固 促弗 可记 牢郸胶俊辑 急琶 登菌阑锭
      if (this.inst_Common.in_array(this.NowSelectedOPTs,SelectedSize+"|"+SelectedColor) == false) {
        alert('捞固 急琶窍脚 可记 涝聪促.');
        //  伎泛飘 冠胶 檬扁拳
        //  荐樊 瘤沥屈
        if (Section=='manual') {
          this.ResetColorBox();
          this.ResetSizeBox();
        // if - End
        }
        //  荐樊 老褒屈
        else {
          this.SizeBox[this.NowFormNumber][0].selected = true;
          this.ColorBox[this.NowFormNumber][0].selected = true;
        }
        return false
      }
      else {
        this.PadSelectedOPT(SelectedSize,SelectedColor);
        return true;
      }
    }
    //  促弗 可记狼 牢郸胶俊辑 咀记捞 老绢朝锭
    else {
      //  急琶茄 可记捞 捞固 促弗 可记 牢郸胶俊辑 急琶 登菌阑锭
      if (this.inst_Common.in_array(this.NowSelectedOPTs,SelectedSize+"|"+SelectedColor) == false) {
        alert('捞固 急琶窍脚 可记 涝聪促.');
        //  伎泛飘 冠胶 檬扁拳
        //  荐樊 瘤沥屈
        if (Section=='manual') {
          this.ResetColorBox();
          this.ResetSizeBox();
        // if - End
        }
        //  荐樊 老褒屈
        else {
          this.SizeBox[this.NowFormNumber][0].selected = true;
          this.ColorBox[this.NowFormNumber][0].selected = true;
        }
        return false;
      }
      else {
        //  泅犁 急琶茄 可记阑 硅凯俊 持绢霖促.
        this.AddArraySelectedOPT(SelectedSize,SelectedColor);
        return true;
      }
    }
  // function - End
  },

  //-----------------------------------------------------------------------------
  //  可记 林巩 函版 扑诀=>急琶等 可记 技泼
  //-----------------------------------------------------------------------------
   AddSelectedOpt : function(SelectBoxIndex) {

    if (this.SelectedOpt['Style']=='m') { var OptStyle = 'manual'; }
    else {var OptStyle = 'lump';}

    //========================
    //  可记1(荤捞令) 何盒 技泼
    //========================
    for (var i=0; i<GoodsOptionArrays['Size'].length; i++) {
      if ( this.SelectedOpt['Size'][SelectBoxIndex] == GoodsOptionArrays['Size'][i] ) {
        //  惑前狼 可记1 格废吝俊辑 厘官备聪俊 淬变 可记1苞 悼老茄 可记1老 版快 眉农 窍绊
        this.SizeBox[SelectBoxIndex][i+1].selected = true;
        //  Opt2 SelectBox甫 技泼秦霖促.
        this.SetVolumes2(OptStyle,GoodsOptionArrays['Size'][i],this.SizeBox[SelectBoxIndex].name);
      }
    }

    //  惑前 可记捞 2俺 老 版快父 角青  
				if (this.SingleOption!='single') {
		
						//========================
						//  可记2(祸惑) 何盒 技泼
						//========================
						//  荐樊 瘤沥屈
						if (this.SelectedOpt['Style'] == 'm') {
								for (var i=0; i<GoodsOptionArrays[ this.SelectedOpt['Size'][SelectBoxIndex] ]['Color'].length; i++) {
										if ( this.SelectedOpt['Color'][SelectBoxIndex] == GoodsOptionArrays[ this.SelectedOpt['Size'][SelectBoxIndex] ]['Color'][i] ) {

												//  惑前狼 可记2 格废吝俊辑 厘官备聪俊 淬变 可记2苞 悼老茄 可记2老 版快 眉农
												this.ColorBox[SelectBoxIndex][i+1].selected = true;

												//  急琶可记 眉农侩 硅凯俊 火涝
												this.CheckSameOPT1(OptStyle);
										}
								}
						}
						//  荐樊 老褒屈
						else {
								for (var i=0; i<this.GoodsOptionArrays['Size'].length; i++) {
										if ( this.SelectedOpt['Color'][SelectBoxIndex] == GoodsOptionArrays['Color'][i] ) {
												//  惑前狼 可记2 格废吝俊辑 厘官备聪俊 淬变 可记2苞 悼老茄 可记2老 版快 眉农
												this.ColorBox[SelectBoxIndex][i+1].selected = true;
										}
								}
						}
				
				}

    //========================
    //  急琶 可记 荐樊 何盒 技泼
    //========================
     this.AmtBox[SelectBoxIndex].value = this.SelectedOpt['Amt'][SelectBoxIndex];

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  荐樊 技泼
  //-----------------------------------------------------------------------------
  SetVolumes3 : function(Section,Color,SelectName) {

    this.SetCursor(SelectName,'select');

     switch (Section) {

       case "manual" :

         //  捞仇捞 府畔窍绰 蔼俊 蝶扼 窍困 风凭 贸府 2008-01-04
         if (this.CheckSameOPT1(Section) == true) {

           //  泅犁 急琶等 荤捞令狼 牢郸胶 ( 牢郸胶客 荤捞令啊 悼老窍促 , 溜 荤捞令啊 105捞搁 牢郸胶档 105]
           var SelectedSize = this.SizeBox[this.NowFormNumber][this.SizeBox[this.NowFormNumber].selectedIndex].value;

           //  泅犁 急琶等 祸惑狼 牢郸胶
           var SelectedColor = this.ColorBox[this.NowFormNumber].selectedIndex-1;

           //  祸惑 急琶 救窍搁
           if (SelectedColor < 0) { this.RmainAmt = 0;}
           else {
             //  急琶 可记狼 儡咯 荐樊
             this.RmainAmt = this.GoodsOptionArrays[SelectedSize]['Amt'][SelectedColor];
           }

           //  荐樊捞 绝阑锭
           if (this.RmainAmt < this.ReturnRemainAmt( parseFloat( this.AmtBox[this.NowFormNumber].value ) ) && Color !='0' ) {
              
              alert("巢酒乐绰 荐樊篮 "+this.RmainAmt+"俺 涝聪促.");
              
              //  备涝 啊瓷茄 荐樊 技泼
              this.AmtBox[this.NowFormNumber].value = Math.floor( this.RmainAmt / this.increase_amount );

              //  荐樊捞 0牢版快
              if (Math.floor( this.RmainAmt / this.increase_amount ) < 1) {
                this.SizeBox[this.NowFormNumber][0].selected=true;
                this.SetVolumes2(Section,0,0);
              // if - End
              }

              // 陛咀 span 咆胶飘 函版
              this.SetCostSpan();
            //  return false;
           }
           //  沥惑 荐樊老锭
           else { 

            // 可记啊 硅凯 技泼 : 2009-05-04 冠霖屈 
            if ( this.GoodsOptionArrays[SelectedSize]['Cost'][SelectedColor]  > 0 ) {
              this.OptCostBox[this.NowFormNumber].value = parseFloat(this.GoodsOptionArrays[SelectedSize]['Cost'][SelectedColor]) * parseFloat(this.AmtBox[this.NowFormNumber].value);
            }
            else { this.OptCostBox[this.NowFormNumber].value = 0; }

            this.SetCostSpan(); 
           }

         // if - End
         }
         // 鞍篮 可记 急琶沁阑版快
         else { }

       break;

       case "lump" :
        //  吝汗 可记 眉欧
        this.CheckSameOPT1(Section);
       break;
     }

     //  荐樊捞 0俺啊 登绰巴阑 规瘤
     if (this.AmtBox[this.NowFormNumber].value < 1) { this.AmtBox[this.NowFormNumber].value = 1; this.SetCostSpan();}

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  可记 技泼
  //-----------------------------------------------------------------------------
  SetVolumes2 : function(Section,Size,SelectName) {

    this.SetCursor(SelectName,'select');

     //  可记 急琶 矫
     if (Size!=0) {
       switch (Section) {
         case "manual" :
          
									//  辑宏可记 格废 檬扁拳
          this.ResetColorBox();
           for (var i=0; i < this.GoodsOptionArrays[Size]['Color'].length; i++){

             // 2009-05-04 : 可记啊 利侩 冠霖屈
             if (this.GoodsOptionArrays[Size]['Cost'][i] > 0 ) {
               this.ColorBox[this.NowFormNumber][i+1] = new Option(this.GoodsOptionArrays[Size]['Color'][i]+" (+"+this.GoodsOptionArrays[Size]['Cost'][i]+"盔)",this.GoodsOptionArrays[Size]['Color'][i]);
             }
             else { this.ColorBox[this.NowFormNumber][i+1] = new Option(this.GoodsOptionArrays[Size]['Color'][i],this.GoodsOptionArrays[Size]['Color'][i]); }
													
													//  可记捞1俺牢 惑前狼 版快 可记 1俺 急琶矫 辑宏可记档 急琶  2008-08-05 眠啊 冠霖屈 
													if(this.SingleOption=='single'){
														 this.ColorBox[this.NowFormNumber][i+1].selected = true; //  快急 可记1苞 鞍篮 可记 急琶
														 this.SetVolumes3(Section,'','Color['+this.NowFormNumber+']'); //  荐樊 技泼 
													}	
											}

									break;
         case "lump" :
           this.ColorBox[this.FormNumber][0].selected = true;
         break;
       }
     // if - End
     }
     //  荤捞令 厚急琶 矫
     else {
        if (Section=='manual') {

          //  辑宏可记 格废 檬扁拳
          this.ResetColorBox();
										
										//  泅犁 急琶茄 可记 硅凯俊辑 规陛 秒家茄 可记 昏力 :  2008-08-05 眠啊 冠霖屈 
										this.NowSelectedOPTs[this.NowFormNumber]="";

								}
        else if(Section=='lump'){
          //this.ColorBox[this.FormNumber][0].selected = true;
        }
     }

     //  荤捞令甫 官曹版快 弥措 备概荐樊 檬扁拳
     try { this.MaxAmtSpan.innerHTML = ""; } catch (e) {}

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  荐樊 炼例俊 蝶弗 魄概啊 & 搬犁陛咀 函悼
  //-----------------------------------------------------------------------------
  SetCostVolume : function(Section) {

    //=========================
    //  可记捞 乐绰 版快父
    //  可记捞 弊成 咆胶飘 捞芭唱
    //  酒公 可记 郴侩捞 绝栏搁
    //  弊成 Amt父 钦魂
    //=========================
    if (Section != 'insert' && Section != 'NoneUI' && Section!="") {

      //  傈眉 荐樊捞 1捞窍 肚绰 Null 蔼栏肺 汲沥且荐绝霸阐.
      if (!this.AmtBox[this.NowFormNumber].value || parseFloat( this.AmtBox[this.NowFormNumber].value ) <= 1 ){ 
							this.totalAmt = 1; 
							this.AmtBox[this.NowFormNumber].value = 1; 
						}

      //  泅犁 急琶等 荤捞令狼 牢郸胶 ( 牢郸胶客 荤捞令啊 悼老窍促 , 溜 荤捞令啊 105捞搁 牢郸胶档 105]
      var SelectedSize = this.SizeBox[this.NowFormNumber][this.SizeBox[this.NowFormNumber].selectedIndex].value;

      //  泅犁 急琶等 祸惑狼 牢郸胶
      var SelectedColor = this.ColorBox[this.NowFormNumber].selectedIndex-1;

						//  可记阑 急琶救窍绊 荐樊 函版且锭
      if ( (SelectedSize==0 || SelectedColor==-1)  ) {
        alert("可记阑 刚历 急琶秦林技夸.");
        this.AmtBox[this.NowFormNumber].value = 1;
        this.OptCostBox[this.NowFormNumber].value = 0; // 可记啊 檬扁拳 2009-05-04 : 冠霖屈
        // 陛咀 span 咆胶飘 函版
        this.SetCostSpan(Section);
        return false;
      }

						//========================
						//   1. 儡樊 眉农 
						//========================
						if (	 this.ReturnRemainAmt( parseFloat(this.AmtBox[this.NowFormNumber].value) ) > parseFloat(this.GoodsOptionArrays[SelectedSize]['Amt'][SelectedColor])  ) {
								alert("巢酒乐绰 荐樊篮 "+this.GoodsOptionArrays[SelectedSize]['Amt'][SelectedColor]+"俺 涝聪促.");
								this.AmtBox[this.NowFormNumber].value = Math.floor( this.GoodsOptionArrays[SelectedSize]['Amt'][SelectedColor] / this.increase_amount);
								this.SetCostSpan(Section); // 陛咀 span 咆胶飘 函版
						// if3 - End
						}

      //========================
						//   2. 弥措 备概 荐樊 眉农
						//========================
						if ( this.GoodsMaxBuyCount(parseFloat(this.AmtBox[this.NowFormNumber].value)) == false ) {
								this.AmtBox[this.NowFormNumber].value = Math.floor( this.MaxGoodsBuy / this.increase_amount );
								this.SetCostSpan(Section); // 陛咀 span 咆胶飘 函版
						// if - End
						}

      //=====================================
      //   可记啊 眉农 2009-05-04 : 冠霖屈 眠啊
      //=====================================
      if ( this.GoodsOptionArrays[SelectedSize]['Cost'][SelectedColor] > 0 ) {
        this.OptCostBox[this.NowFormNumber].value = parseFloat(this.GoodsOptionArrays[SelectedSize]['Cost'][SelectedColor]) * parseFloat(this.AmtBox[this.NowFormNumber].value);
      }
      else { this.OptCostBox[this.NowFormNumber].value = 0; }

						//  荐樊 技泼俊 酒公 巩力啊 绝促搁
						//  扁夯 荐樊 刘啊 窜困 滚欺甫 惑前 沥焊俊辑 阂矾柯 扁夯 荐樊刘啊 窜困肺 且寸.
						this.increase_amount_buffer = this.increase_amount;

    // if1 - End
    }
   
			 //  可记喊 荐樊 包府 救窍绰 何盒老版快
    else {

     var AmtBox = document.getElementById("Amt");

      //  荐樊阑 急琶 救秦滚府搁 
      if ( isNaN(parseFloat(AmtBox.value)) ) { AmtBox.value =1; }

						//  傈眉 荐樊捞 1捞窍肺绰 汲沥且荐绝霸阐.
						if ( parseFloat( AmtBox.value ) <= 1 ){ this.totalAmt = 1; AmtBox.value = 1; }
						else { this.totalAmt = parseFloat(AmtBox.value); }

      //========================
						//   1. 儡樊 眉农 
						//========================
						if (	 this.ReturnRemainAmt( parseFloat(this.totalAmt) ) > parseFloat(this.GoodsTotalVolume) ) {
								alert("巢酒乐绰 荐樊篮 "+this.GoodsTotalVolume+"俺 涝聪促.");

        //  备涝 啊瓷茄 荐樊 技泼 
        AmtBox.value = parseFloat( Math.floor ( this.GoodsTotalVolume  / this.increase_amount ));
								this.SetCostSpan(Section); // 陛咀 span 咆胶飘 函版
						// if3 - End
						}
    
						//========================
						//   2. 弥措 备概 荐樊 眉农
						//========================
						if ( this.GoodsMaxBuyCount( this.totalAmt ) == false ) {
								AmtBox.value = Math.floor( this.MaxGoodsBuy / this.increase_amount );
								this.totalAmt = this.MaxGoodsBuy;
								this.SetCostSpan(Section); // 陛咀 span 咆胶飘 函版
						// if - End
						}

						//  荐樊 技泼俊 酒公 巩力啊 绝促搁
						//  扁夯 荐樊 刘啊 窜困 滚欺甫 惑前 沥焊俊辑 阂矾柯 扁夯 荐樊刘啊 窜困肺 且寸.
						this.increase_amount_buffer = this.increase_amount;
				}

    // 陛咀 span 咆胶飘 函版
    this.SetCostSpan(Section);
  // function - End
  },

  //-----------------------------------------------------------------------------
  //  惑前狼 儡樊阑 荐樊 刘啊 窜困甫 利侩秦辑 备概磊啊 涝仿茄 荐樊父怒 巢酒乐绰瘤 眉农窃
  //-----------------------------------------------------------------------------
  ReturnRemainAmt : function(Amt) {
    return Amt * this.increase_amount;
  // function - End
  },

  //-----------------------------------------------------------------------------
  //  魄概啊 & 搬犁陛咀 檬扁 惑前 惑技 其捞瘤 肺爹矫 技泼
  //-----------------------------------------------------------------------------
  SetAmountAndCost : function() {
				this.increase_amount_buffer = this.increase_amount;
				this.SetCostSpan('manual');
  // function - End
  },

  //-----------------------------------------------------------------------------
  //  啊拜 陛咀 技泼 皋家靛
  //-----------------------------------------------------------------------------
  SetCostSpan:function(Section) {

    //  亲惑 檬扁拳 窍绊 钦魂 矫累 秦具窃
    this.totalAmt = 0;

    //  醚 荐樊 (可记狼 蜡公俊 蝶扼辑 促弗 规过栏肺 钦拌 备窃)
    if (Section != 'insert' && Section != 'NoneUI' && Section!="") {
      for (var i=0; i<this.AmtBox.length; i++) {
        //  扁粮俊 荐樊捞 汲沥 登绢乐带 TR狼 荐樊
        try {
          var AmountOne = parseFloat(this.AmtBox[i].value);
        }
        //  货肺 眠啊等 TR捞扼辑 蔼捞 汲沥 登瘤 臼疽阑锭绰 1肺 技泼
        catch (e) { var AmountOne = 1; }

       this.totalAmt = parseFloat(this.totalAmt) + AmountOne;
					}
    }
    else {
      var form_ = document.getElementById("OrderForm");
      this.totalAmt = form_.Amt.value;
				}
    
				//  荐樊 急琶俊 喊促弗 巩力 绝捞 逞绢吭阑锭
				if (this.increase_amount_buffer > 0) { 
						this.totalAmt = this.totalAmt * this.increase_amount_buffer;
				}

    this.SaleCostSpan = document.getElementById("SaleCost");
    this.TotalCostSpan = document.getElementById("TotalCost");
    
    var OptCostSum = 0; // 可记啊 钦拌 2009-05-04 : 冠霖屈 
    for (var i=0; i<this.OptCostBox.length; i++) { OptCostSum+=parseFloat(this.OptCostBox[i].value);  }
    
    this.SaleCostSpan.innerHTML = this.inst_Common.number_format( (this.SaleCost*this.totalAmt)+OptCostSum);
    this.TotalCostSpan.innerHTML = this.inst_Common.number_format( ( (this.SaleCost*this.totalAmt)+OptCostSum ) + this.AdditionAmountSum );

    //  荐樊 钎矫 胶奇
    this.TotalAmtSpan = document.getElementById("TotalAmt");
    this.TotalAmtSpan.innerHTML = "(<B>"+this.totalAmt+"</B>)";

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  林巩 急琶 荐沥 其捞瘤 肺爹矫
  //  荐樊 技泼 皋家靛 龋免
  //-----------------------------------------------------------------------------
  SetAmountStart : function(Section) {
    if (Section == 'l' || Section == 'm'){ this.SetCostVolume(inst_Shop.Section); }
  // function - End
  },

  //-----------------------------------------------------------------------------
  //  弥措 备概 荐樊 眉农 
  //-----------------------------------------------------------------------------
  GoodsMaxBuyCount : function(Amt) {

				//  弥措 备概荐樊 眉农 
				if ( (Amt * this.increase_amount) > this.MaxGoodsBuy) {
						alert('弥措 备概 荐樊篮 : '+this.MaxGoodsBuy+"俺 涝聪促.");
						return false;
				// if - End
				}
				else {return true;}
  
  // function - End
  },


  //-----------------------------------------------------------------------------
  //  可记 函版 惑前 蜡公 眉农
  //-----------------------------------------------------------------------------
   CheckChangedGoods : function(form_) {

     //  函版等 惑前 眉农冠胶
     var aa = form_.item_check_none;

     //  函版等 惑前捞 乐阑 版快俊
     if (aa) { alert('厘官备聪救俊 可记捞 函版等 惑前捞 乐嚼聪促.\n秦寸 惑前阑 昏力 饶 促矫 淬酒 林技夸.'); return 'error';}
     else { return 'ok'; }
  // function - End
  },

  //-----------------------------------------------------------------------------
  //  惑前 林巩 傈价
  //  搬力 犬牢 其捞瘤肺 林巩阑 傈价
  //  1. 窜老 惑前 备概 : OrderSingle
  //  2. 厘官备聪 眠啊 : CartAdd
  //  3. 厘官备聪 备概 : OrderCart
  //  4. 厘官备聪 可记 函版 : CartEdit
  //-----------------------------------------------------------------------------
  Order_Submit : function(OrderSection) {

    //  厘官备聪 备概且锭 汽
    if (OrderSection=='OrderFormCart') {
      var form_ = document.getElementById("CartList");

      //  可记 函版 惑前捞 乐阑版快 备概且 荐 绝促.
      if (this.CheckChangedGoods(form_) != 'ok') { return false; }
						
						//  厘官备聪俊 惑前捞 绝栏搁 林巩 阂啊
						if (form_.CartTotal.value < 1) {return false;}

    }
    // 弊寇狼 汽
    else {
						var form_ = document.getElementById("OrderForm");
	  }
				
				//  弥措 林巩荐樊 捞惑 备概窍妨绊 且锭
				if (this.totalAmt > this.MaxGoodsBuy) {
  				alert("林巩荐樊捞 弥措备概 荐樊( "+this.MaxGoodsBuy+" )焊促 腹嚼聪促.");
						return false;
				}

    var AdditionTexts ="";

    //  惑前 可记 荐沥, 肚绰 厘官备聪 备概啊 酒匆锭父
    if (OrderSection!="CartEdit" && OrderSection!="OrderFormCart") {
      for (var i=0; i<this.AdditionBox.length; i++) {
          //  可记阑 急琶 沁阑 锭父
          if (parseFloat(this.AdditionBox[i].selectedIndex) > 0) {
            AdditionTexts = AdditionTexts+this.AdditionBox[i][this.AdditionBox[i].selectedIndex].text+"|";
          }
          else { AdditionTexts = AdditionTexts+"none|"; }
      }

      //  眠啊惑前/荤篮前 咆胶飘
      AdditionTexts = AdditionTexts.substring(0,AdditionTexts.length-1);
      form_.AdditionTexts.value = AdditionTexts;
    // if - End
    }

    //  积己等 可记1狼 葛电 咯何 魄喊
    for (var i=0; i<this.SizeBox.length; i++) {
      if (this.SizeBox[i].selectedIndex == 0) {
        alert("葛电 可记阑 急琶 窍寂具 钦聪促.");
        this.SizeBox[i].focus();
        return false;
      }
    }

    //  积己等 可记2狼 葛电 急琶 咯何 魄喊
    for (var i=0; i<this.ColorBox.length; i++) {
      if (this.ColorBox[i].selectedIndex == 0) {
        alert("葛电 可记阑 急琶 窍寂具 钦聪促.");
        this.ColorBox[i].focus();
        return false;
      }
    }

    if (this.totalAmt < 1) { alert('林巩 荐樊捞 1俺 捞窍老 版快 林巩捞 阂啊瓷 钦聪促.'); return false; }

    //  汽 action 蔼 汲沥
    form_.action.value = OrderSection;
    form_.submit();

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  府胶飘俊辑 林巩, 厘官备聪, 困矫 贸府 : 2009-05-20 沥荐柳
  //  1. 窜老 惑前 备概 : OrderSingle
  //  2. 厘官备聪 眠啊 : CartAdd
  //  3. 厘官备聪 备概 : OrderCart
  //  4. 厘官备聪 可记 函版 : CartEdit
  //-----------------------------------------------------------------------------
  Order2_Submit : function(GoodsCode,OrderSection,MemOnlyBuy,ViewGoodsCost,SESSUID) {

   //  雀盔 傈侩 备概 汲沥捞 登绢乐绰单 肺弊牢 救窍搁 府畔
   if (MemOnlyBuy==1 && !SESSUID) {
    alert('雀盔 傈侩栏肺 魄概 登绊 乐嚼聪促. 肺弊牢阑 秦林技夸.');
    return false;
   }

   //  厚雀盔俊霸 啊拜 啊府扁 汲沥 登绢 乐绰单 肺弊牢 救窍搁
   if(ViewGoodsCost==1 && !SESSUID) {
    alert('雀盔 傈侩栏肺 魄概 登绊 乐嚼聪促. 肺弊牢阑 秦林技夸.');
    return false;
   }

   //  困矫府胶飘绰 雀盔肺弊牢饶 荤侩
   if (OrderSection=='WishAddMulti' && !SESSUID) {
    alert('肺弊牢 饶 捞侩 啊瓷钦聪促.');
    return false;
   }

   var form_ = document.getElementById("OrderForm");

   //  汽 action 蔼 汲沥
   form_.action.value = OrderSection;
   form_.GoodsString.value = GoodsCode;
   form_.submit();
  // function - End
  },

	//-----------------------------------------------------------------------------
	//  府胶飘俊辑 困矫, 厘官备聪 眉农蔼 惑前内靛 逞扁绰 贸府 : 2009-05-22 沥荐柳
	//-----------------------------------------------------------------------------
	Order3_Submit : function(OrderSection,SESSUID) {

		//  困矫府胶飘绰 雀盔肺弊牢饶 荤侩
		if (OrderSection=='WishAddMulti' && !SESSUID) {
			alert('肺弊牢 饶 捞侩 啊瓷钦聪促.');
			return false;
		}

		//  眉农蔼
		var GoodsCode = ''; 
		obj = document.getElementsByName('choice[]');
		for(var i=0;i<obj.length;i++){
			if( obj[i].checked==true){
			var arr = obj[i].value;
			GoodsCode += arr+'|';
			}
		}

		var form_ = document.getElementById('OrderForm');

		//  汽 action 蔼 汲沥
		form_.action.value = OrderSection;
		form_.GoodsString.value = GoodsCode;
		form_.submit();
	// function - End
	},

	//-----------------------------------------------------------------------------
	//  厘官备聪 喊档 窜老 备概 汽 傈价 
	//-----------------------------------------------------------------------------
	SinggleOrderSubmit : function(CartID_,GoodsCode_) {
			
			var formsingle  = document.CartBuyOne;
			formsingle.CartID.value = CartID_;
			formsingle.GoodsCode.value = GoodsCode_;
			formsingle.submit();

	// function - End
	},

  //-----------------------------------------------------------------------------
  //  惑前 可记 急琶 汽 昏力
  //-----------------------------------------------------------------------------
  DelOptionForm : function(Section) {

    // tr 茄扼牢究 昏力 窍绊 可记 硅凯档 付瘤阜 仇何磐 窍唱究 昏力茄促.
    if(this.OptionTable.rows.length-1 <= 2){return false;}
    this.OptionTable.deleteRow(this.OptionTable.rows.length-1);
    this.SizeBox.pop();
    this.ColorBox.pop();
    this.AmtBox.pop();
				this.NowSelectedOPTs.pop();
				this.OptCostBox.pop(); // 可记啊 硅凯 昏力

    //  泅犁 目辑啊 醚 可记 肮荐焊促 臭篮 荐甫 啊府虐绊 乐阑锭
    //  目辑甫 付瘤阜 可记栏肺 颗败霖促.
    if (this.NowFormNumber >= this.AmtBox.length) { this.NowFormNumber = this.AmtBox.length-1; }

    // 荐樊 棺 啊拜 函版
    this.SetCostVolume(Section);

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  惑前 可记 急琶 汽 眠啊
  //-----------------------------------------------------------------------------
  ShowOptionForm : function(Section,Opt_name1,Opt_name2) {

				//  檬扁 肺爹矫 1锅父 犬牢 茄促. 可记捞 1俺 楼府牢瘤 2俺 楼府 牢瘤
				if (this.SingleOption=='none') { 
						//  可记捞 1俺牢瘤 2俺牢瘤 备盒  扁夯篮 厚汲沥 惑怕牢 none肺 积己磊俊辑 汲沥凳
						if(Opt_name1==Opt_name2){this.SingleOption = "single";} 
						else { this.SingleOption = "double"; }
				}

    //  Section狼 傈开拳 ( 可记 荐沥 矫 钦拌 免仿窍扁困秦辑 傈开拳 矫糯)
    this.Section = Section;

				//  可记 伎泛飘冠胶甫 眠啊积己 且锭
    if (this.SizeBox.length > 0) {

      //  泅犁 急琶等 荤捞令狼 牢郸胶 ( 牢郸胶客 荤捞令啊 悼老窍促 , 溜 荤捞令啊 105捞搁 牢郸胶档 105]
      var SelectedSize = this.SizeBox[this.NowFormNumber][this.SizeBox[this.NowFormNumber].selectedIndex].value;

      //  泅犁 急琶等 祸惑狼 牢郸胶
      var SelectedColor = this.ColorBox[this.NowFormNumber].selectedIndex-1;

     // 可记阑 急琶窍瘤 臼栏搁
     if (SelectedSize == 0 || SelectedColor == -1) { alert('可记阑 急琶秦 林技夸.'); return false; }
    }

    //  可记狼 辨捞啊 5俺甫 逞瘤 臼霸
    if (this.SizeBox.length >= 5 ){return false;}

    //  Tr狼 selectBox 捞抚
    this.FormNumber = this.SizeBox.length;

    var Trs;

    // tr眠啊
    Trs = this.OptionTable.insertRow();

    // 可记1 眠啊
    Tds = Trs.insertCell();
    //Tds.style.backgroundColor='#FFFFFF';

				//  可记捞 鞍阑 版快 荤捞令甫 疵妨霖促.. 2008-08-05 眠啊 
				if (this.SingleOption=='single') { Tds.style.width='400px'; }
    Tds.innerHTML = "<td>"+
    "  <select name='Size["+this.FormNumber+"]' id='Size["+this.FormNumber+"]' class='optselect1 optselect' onchange=\"inst_Shop.SetVolumes2('"+Section+"',this.value,this.name);\" >"+  // Section
    "  <option value='0'>"+Opt_name2+" 急琶</option>"+
    "  </select>"+
    "</td>";

    // 可记2 眠啊 
    Tds = Trs.insertCell();
    //Tds.style.backgroundColor='#FFFFFF';
				
				//  可记捞 鞍阑 版快 焊捞瘤臼绰促. 2008-08-05 眠啊 
				if (this.SingleOption=='single') { Tds.style.display='none';}

    Tds.innerHTML = "<td>"+
    "  <select name='Color["+this.FormNumber+"]' id='Color["+this.FormNumber+"]' class='optselect2 optselect' onchange=\"inst_Shop.SetVolumes3('"+Section+"',this.value,this.name);\" >"+
    "  <option value='0'>"+Opt_name1+" 急琶</option>"+
    "  </select>"+
				"</td>";

    // TD 眠啊
    Tds = Trs.insertCell();
    //Tds.style.backgroundColor='#FFFFFF';
    Tds.innerHTML = "<td align='center'>"+
    "<input type='text' maxlength='4' style='height:13px; 'id= 'Amt["+this.FormNumber+"]' name='Amt["+this.FormNumber+"]' class='optbox' value='1' onchange=\"inst_Shop.SetCostVolume('"+Section+"');\" onfocusout=\"inst_Shop.SetCostVolume('"+Section+"');\"  onkeypress=\"inst_Common.num_only(this);inst_Shop.SetCursor(this.name,'input');\" onclick=\"inst_Shop.SetCursor(this.name,'input');\">"+
    "<input type='hidden' name='OptCost["+this.FormNumber+"]' value='0'>"
    "</td>";

    //  可记 郴侩 技泼
    this.SetVolumes1(Section);

    //  茄俺捞惑 眠啊瞪 锭父 钦拌 啊拜 魂免 皋家靛 龋免
    if ( parseFloat(this.SizeBox.length) > 1 ) { this.SetCostVolume(Section); }

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  眠啊惑前 / 荤篮前 SelectBox蔼 技泼
  //-----------------------------------------------------------------------------
  SetAdditions : function(GoodsAdditionsArray) {

    var CountAdditions = GoodsAdditionsArray['Title'].length;
    var Temp = "";
    var TextValue;

    //  眠啊惑前/荤篮前 辆幅父怒 风橇
    for (var i=0; i<CountAdditions; i++) {

      //  按眉 疙 烙矫 函荐
      Temp = "Addition["+i+"]";

      //  眠啊惑前 荤篮前狼 SelectBox 按眉 沥狼
      this.AdditionBox[i] = document.getElementById( Temp );

      //  阿阿狼 眠啊惑前/荤篮前 付促 可记狼 肮荐父怒 风橇
      for (var j=0; j < GoodsAdditionsArray['Name'][i].length; j++){
        TextValue="";
        TextValue = GoodsAdditionsArray['Name'][i][j] +" + ("+ this.inst_Common.number_format(GoodsAdditionsArray['Cost'][i][j])+"盔)";
        this.AdditionBox[i][j+1]=new Option(TextValue, GoodsAdditionsArray['Cost'][i][j] );
      // loop2 - End
      }
    // loop1 - End
    }

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  眠啊惑前 / 荤篮前 眠啊 陛咀 技泼
  //-----------------------------------------------------------------------------
  SetAdditionCost : function(SelectedCost) {

    this.AddCost = document.getElementById("AddCost");
    var Sum = 0;
    for (var i=0; i<this.AdditionBox.length; i++) { Sum = Sum+parseFloat(this.AdditionBox[i].value); }
    this.AdditionAmountSum = Sum;
    this.AddCost.innerHTML = this.inst_Common.number_format(this.AdditionAmountSum);
    var TotalCostSpan = document.getElementById("TotalCost");

    var OptCostSum = 0; // 可记啊 钦拌 2009-05-04 : 冠霖屈 
    for (var i=0; i<this.OptCostBox.length; i++) { OptCostSum+=parseFloat(this.OptCostBox[i].value);  }
    TotalCostSpan.innerHTML = this.inst_Common.number_format( ( (this.SaleCost*this.totalAmt)+OptCostSum ) + this.AdditionAmountSum );

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  魄概啊 & 搬犁陛咀 技泼
  //-----------------------------------------------------------------------------
  SetSaleCost : function() {
     var SaleCostSpan = document.getElementById("SaleCost");
    // SaleCostSpan.innerHTML = this.inst_Common.number_format(this.SaleCost);
     var TotalCostSpan = document.getElementById("TotalCost");
     TotalCostSpan.innerHTML = this.inst_Common.number_format(this.SaleCost*this.totalAmt);
  // function - End
  },

  //-----------------------------------------------------------------------------
  //  泅犁 急琶 可记狼 目辑 技泼
  //-----------------------------------------------------------------------------
  SetCursor : function(SelectName,Section) {

    //  泅犁 急琶茄 可记狼 牢郸胶甫 备茄促.
    if (Section == 'select') {
      for (var i=0; i<this.SizeBox.length; i++) {
        if ( this.SizeBox[i].name == SelectName || this.ColorBox[i].name == SelectName) {
          this.NowFormNumber = i;
        }
      }
    }
    else { for (var i=0; i<this.AmtBox.length; i++) { if (this.AmtBox[i].name == SelectName) { this.NowFormNumber = i; } } }

  // function - End
  },

  //-----------------------------------------------------------------------------
  //  且刘 硅价厚 技泼 
  //-----------------------------------------------------------------------------
  SetIncreaseDelivCost : function(action) {

    var DelivCostDetailView = document.getElementById('DelivCostDetailView');
    var zipcode = document.getElementById('ZipcodeSpan');

    switch (action) {
       
      //  林巩磊 沥焊客 悼老 眉农矫 
      case "Set" :
        
        //  父距 荤侩磊啊 快祈锅龋 何磐 榜耳促啊 林巩磊 沥焊客 悼老 眉农甫 急琶沁促搁 檬扁拳 茄锅 秦霖促.
        if (zipcode.innerHTML.trim()!="") {
          this.IncreaseDelivCost = 0;
          DelivCostDetailView.innerHTML = this.Buff_DelivCostDetailView; 
          this.DelivCostForm.innerHTML = this.inst_Common.number_format(parseFloat(this.DelivCostBasic));
          this.DelivCostTotalForm.innerHTML = this.DelivCostForm.innerHTML;
          this.ResultTotalAmountForm.innerHTML = this.inst_Common.number_format(parseFloat(this.GetTotalThisOrder()));  
        }
        
        //  且刘 厚侩捞 乐阑版快父 
        if ( this.IncreaseDelivCostBuff > 0) {
          this.IncreaseDelivCost = this.IncreaseDelivCostBuff;
          DelivCostDetailView.innerHTML = this.Buff_DelivCostDetailView+" + ( 且刘 硅价厚 : "+this.inst_Common.number_format(this.IncreaseDelivCostBuff)+")"; 
          this.DelivCostForm.innerHTML = this.inst_Common.number_format(parseFloat(this.IncreaseDelivCostBuff)+parseFloat(this.DelivCostBasic));
          this.DelivCostTotalForm.innerHTML = this.DelivCostForm.innerHTML;
          this.ResultTotalAmountForm.innerHTML = this.inst_Common.number_format(parseFloat(this.GetTotalThisOrder()));
        }  

      break;
  
      //  林巩磊 沥焊客 悼老 眉农 钱锭 
      case "Unset" :
        this.IncreaseDelivCost = 0;
        DelivCostDetailView.innerHTML = this.Buff_DelivCostDetailView; 
        this.DelivCostForm.innerHTML = this.inst_Common.number_format(parseFloat(this.DelivCostBasic));
        this.DelivCostTotalForm.innerHTML = this.DelivCostForm.innerHTML;
        this.ResultTotalAmountForm.innerHTML = this.inst_Common.number_format(parseFloat(this.GetTotalThisOrder()));  
      break;
  
      //  快祈 锅龋 八祸秦辑 林家 急琶且锭 且刘 利侩
      case "Zset" :
          if ( this.IncreaseDelivCost > 0) {
          DelivCostDetailView.innerHTML = this.Buff_DelivCostDetailView+" + ( 且刘 硅价厚 : "+this.inst_Common.number_format(this.IncreaseDelivCost)+")"; 
          this.DelivCostForm.innerHTML = this.inst_Common.number_format(parseFloat(this.IncreaseDelivCost)+parseFloat(this.DelivCostBasic));
          this.DelivCostTotalForm.innerHTML = this.DelivCostForm.innerHTML;
          this.ResultTotalAmountForm.innerHTML = this.inst_Common.number_format(parseFloat(this.GetTotalThisOrder()));
        }
      break;

      //  快祈 锅龋 八祸秦辑 林家 急琶且锭 且刘 秒家 
      case "Zunset" :
        this.IncreaseDelivCost = 0;
        DelivCostDetailView.innerHTML = this.Buff_DelivCostDetailView; 
        this.DelivCostForm.innerHTML = this.inst_Common.number_format(parseFloat(this.DelivCostBasic));
        this.DelivCostTotalForm.innerHTML = this.DelivCostForm.innerHTML;
        this.ResultTotalAmountForm.innerHTML = this.inst_Common.number_format(parseFloat(this.GetTotalThisOrder()));  
      break;
    
    }
    

  // function - End
  },

//=========================================================================================
//
//
//           硅价厚 & 硅价厚 且刘 何盒  
//
//
//=========================================================================================

  //-----------------------------------------------------------------------------
  //  林巩磊 沥焊甫 荐飞磊 沥焊俊 盲框
  //-----------------------------------------------------------------------------
  SetOrder_Info : function() {
    
    var formname = document.MemmAddForm;
    var zipcode = document.getElementById('ZipcodeSpan');
    var orderaddress = formname.OrderAddress;
    var receiveraddress = formname.address;

    if (formname.SameInfo.checked == true) {
      formname.ReceiverName.value = formname.OrderName.value;
      formname.ReceiverMobil0.value = formname.OrderMobil0.value;
      formname.ReceiverMobil1.value = formname.OrderMobil1.value;
      formname.ReceiverMobil2.value = formname.OrderMobil2.value;
      formname.ReceiverTell0.value = formname.OrderTell0.value;
      formname.ReceiverTell1.value = formname.OrderTell1.value;
      formname.ReceiverTell2.value = formname.OrderTell2.value;
      zipcode.innerHTML = formname.OrderZipcode.value;
      formname.address_Seq.value = formname.OrderAddress_Seq.value;
      receiveraddress[0].value = orderaddress[0].value;
      formname.address_value.value = orderaddress[0].value;
      receiveraddress[1].value = orderaddress[1].value;
      
      //  且刘 硅价厚啊 乐栏搁 硅价厚 惑技 轰俊 焊咯 林绊 醚 硅价厚档 盎脚秦霖促.
      this.SetIncreaseDelivCost('Set');
    }
    else {
      formname.ReceiverName.value = '';
      formname.ReceiverMobil0.value =   '';
      formname.ReceiverMobil1.value =  '';
      formname.ReceiverMobil2.value =  '';
      formname.ReceiverTell0.value =  '';
      formname.ReceiverTell1.value =  '';
      formname.ReceiverTell2.value =  '';
      zipcode.innerHTML =  '';
      formname.address_Seq.value = '';
      receiveraddress[0].value =  '';
      formname.address_value.value = '';
			   receiveraddress[1].value =  '';

      //  且刘 硅价厚啊 乐栏搁 硅价厚 惑技 轰俊 焊咯 林绊 醚 硅价厚档 盎脚秦霖促.
      this.SetIncreaseDelivCost('Unset');
    }

  // function - End
  },

//=========================================================================================
//
//
//           捻迄 棺 利赋陛 利侩 何盒 
//
//
//=========================================================================================

		//-----------------------------------------------------------------------------
		//  利赋陛 荤侩 啊瓷 弥家 利赋陛咀 捞惑牢瘤 魄窜.
		//  1. 弥家 利赋陛咀阑 逞瘤 给窍搁 利赋陛 鞘靛甫 鞠傈矫难霖促.
		//  2. 弥家 备概 陛咀阑 逞瘤 给窍搁 利赋陛 鞘靛甫 鞠傈 矫难霖促.
		//-----------------------------------------------------------------------------
		ReserveMin : function(ObjR,MaxPer,UseMax,Double_sale,ReserveUse,MinReserve,MinAmount,CartSumCost) {
				
				var UseReserveBox = document.getElementById('UseReserve');
				var ReserveLayer = document.getElementById('ReserveLayer');
				var ReserveTr = document.getElementById('ReserveTr');
				var ReserveShow = document.getElementById('ReserveShow');

				this.Double_sale = Double_sale; // 利赋陛 + 捻迄 悼矫 搬力 啊瓷 咯何 
				this.UseMax = UseMax; //  1雀 弥措 荤侩 啊瓷 利赋陛咀 
				this.MaxPer = MaxPer;  // 林巩 陛咀俊 措茄 利赋陛 荤侩 弥措 %

				//  利赋陛 荤侩窃 技泼老 版快 
				if (ReserveUse == '0') {
						ReserveTr.style.display = 'block';
						ReserveShow.style.display = 'block';
				}
				
				//  雀盔 焊蜡 利赋陛 
				var Reserve = parseFloat(this.inst_Common.str_replace(ObjR.innerHTML,",",""));
				var MinReserve = parseFloat(MinReserve);
				
				//  荤侩啊瓷 弥家 利赋 陛咀 逞瘤 给沁阑 锭
				if (Reserve < MinReserve) {
						UseReserveBox.disabled=true;
						ObjR.innerHTML = ObjR.innerHTML+"<br>( 利赋陛篮 "+MinReserve+"盔 捞惑何磐 荤侩捞 啊瓷钦聪促. )";
						ReserveLayer.style.display='none';
				}
					
					//  利赋陛 荤侩 啊瓷 弥家 备概咀 逞瘤 给沁阑锭
					else if (parseFloat(CartSumCost) < parseFloat(MinAmount)) {
						UseReserveBox.disabled=true;
						ObjR.innerHTML = ObjR.innerHTML+"<br>( 利赋陛篮 "+this.inst_Common.number_format(MinAmount)+"盔 捞惑 备概窍寂具 荤侩捞 啊瓷钦聪促. )";
						ReserveLayer.style.display='none';
				}

		// function - End
		},

		//-----------------------------------------------------------------------------
		//  利赋陛 包访 SPAN & 函荐甸 肺爹 ( 林巩辑狼 积己磊扼绊 积阿窍搁 凳 )
		//  SPAN 汽阑 js 傈开俊辑 荤侩 且 荐 乐霸阐 傈开栏肺 剁况霖促.
		//-----------------------------------------------------------------------------
		LoadReserveForm : function( OriTotalSum, OriReserve, DelivCostMent,MemDiscount, DelivIncreaseMent,DelivCostBasic ,DelivCostFreeLine,IncreaseDelivCost, DelivCostFreeLineCost) {

				//  雀盔捞 荤侩 窍妨绊 持篮 利赋 陛咀 汽
				this.UseReserveForm = document.getElementById("UseReserve");

				//  利赋陛 荤侩咀 SPAN 
				this.SpentReserveForm = document.getElementById("SpentReserve");
				
				//  捻迄 荤侩咀 Span 
				this.CouponDiscountForm = document.getElementById("CouponDiscountMoney");
				
				//  角力 捻迄 荤侩咀 hidden 鞘靛 
				this.UseCouponSumCost = document.getElementById("CouponSum");

				//  醚拌 钎矫何盒狼 硅价厚 
				this.DelivCostTotalForm = document.getElementById("DelivCostSpan");
				
				//  硅价厚 救郴 钎矫何盒狼 硅价厚
				this.DelivCostForm = document.getElementById("DelivCostView");

				//  醚 搬力 陛咀 SPAN ( 函荐 )
				this.ResultTotalAmountForm = document.getElementById("ResultTotalAmount");
    
        //  且刘 硅价厚 眠啊窍扁傈 盔贰 硅价厚 免仿 巩备 盔夯阑 滚欺俊 啊瘤绊 乐绰促
        this.Buff_DelivCostDetailView = document.getElementById('DelivCostDetailView').innerHTML;
        
        try {
          //  公烹厘阑 荤侩窍绰瘤 咯何 眉农
          var MootongID = document.getElementById('M');
        }
        catch (e) { this.inst_Common.Show_tr(eval('Mootong'),"hide"); }

				//  硅价厚 膏飘  & 且刘 硅价厚 膏飘
				this.DelivCostMent = DelivCostMent;
				this.DelivIncreaseMent = DelivIncreaseMent;

				//  角力 醚 林巩 陛咀 + 硅价厚 扁夯  ( 惑荐 ) 
				this.OriTotalSum = OriTotalSum;

				//  角力 焊蜡 利赋 陛咀 ( 惑荐 ) 
				this.OriReserve = OriReserve;
    
				//  眠啊 且刘 硅价丰 ( 林巩磊狼 林家啊 且刘 备开老 版快俊 荤侩瞪 仇 荤侩磊啊 快祈锅龋 八祸俊辑 急琶茄仇窍绊绰 喊拌肺 累悼)
				if (IncreaseDelivCost < 1) { this.IncreaseDelivCostBuff = 0; }
				else { this.IncreaseDelivCostBuff = IncreaseDelivCost;}
    
    //  泅林巩俊 利侩瞪 且刘 硅价夸陛 檬扁 技泼 
    this.IncreaseDelivCost = 0;
		
				//  捻迄 且牢 陛咀 
				this.CouponSale=0;

				//  雀盔 且牢 陛咀 
				this.MemberSale=MemDiscount;
				
        //  公丰硅价 目飘扼牢 硅价厚
        this.DelivCostFreeLineCost = DelivCostFreeLineCost;

				//  扁夯 硅价丰 汲沥.
				//  硅价厚 沥氓俊 蝶扼辑 利侩等促.
				switch (this.DelivPolicy) {
							
						//  公丰硅价狼 版快 硅价厚 0盔 
						case "free" : this.DelivCostBasic = 0; break;
						
						//  急搬力
						case "pre" : this.DelivCostBasic = DelivCostBasic; break;
						
						//  馒阂 狼 版快 硅价厚 0盔
						case "after" : this.DelivCostBasic = 0; break;
						
						//  扁夯捞 蜡丰 硅价老锭
						default : this.DelivCostBasic = DelivCostBasic; break;
				}

				//  公丰 硅价 目飘扼牢
				this.DelivCostFreeLine = DelivCostFreeLine;

		// function - End
		},

  //-----------------------------------------------------------------------------
  //  捻迄 荤侩 陛咀 技泼
		//  捞仇篮 捻迄 荤侩 扑诀芒俊辑 捞仇阑 龋免茄促.
  //-----------------------------------------------------------------------------
  UseCoupon : function() {
				
				this.UseCouponSumCost;
		  this.CouponDiscountForm.innerHTML = this.inst_Common.number_format(this.UseCouponSumCost.value);

				//  醚 搬力 陛咀 Span俊 陛咀 盎脚 
				this.ResultTotalAmountForm.innerHTML = this.inst_Common.number_format(this.GetTotalThisOrder());
  // function - End
  },


  UseCoupon_temp : function() {
				
				this.UseCouponSumCost;
		  this.CouponDiscountForm.innerHTML = this.inst_Common.number_format(this.UseCouponSumCost.value);

				//  醚 搬力 陛咀 Span俊 陛咀 盎脚 
				this.ResultTotalAmountForm.innerHTML = this.inst_Common.number_format(this.GetTotalThisOrder());
  // function - End
  },

		//-----------------------------------------------------------------------------
		//  利赋陛 荤侩 : 利赋陛 input 捞抚阑 牢磊肺 罐澜
		//  利赋陛 包访 SPAN 甸捞 傈开栏肺 栋乐绰 惑怕俊辑 悼累秦具茄促.
		//-----------------------------------------------------------------------------
		UseReserve : function( ) {
				
				//  利赋陛 茄档 眉农俊 吧啡绰瘤 咯何 
				var UseNowMaxReserve = false;

				//  利赋陛 + 捻迄 荤侩 阂啊 惑怕老锭 眉农
				if (this.Double_sale=='N') {
						if (parseFloat(this.UseCouponSumCost.value) > 0) {
								alert('捻迄苞 利赋陛篮 悼矫俊 荤侩且 荐 绝嚼聪促.');
								this.UseReserveForm.value = 0;	
								return false;
						}
				}

				//  醚 搬力 陛咀 檬扁拳 
				var TotalAmount = 0;

				//  醚 林巩 陛咀 
				var OrderAmount = parseFloat(this.OriTotalSum);
				var DelivCostBasic = parseFloat(this.DelivCostBasic);  //  硅价厚
				var IncreaseDelivCost = parseFloat(this.IncreaseDelivCost);  //  硅价厚 且刘

				//  荤侩窍妨绰 利赋陛
				var UseReserve = parseFloat(this.UseReserveForm.value);
				if (!UseReserve || UseReserve==null || UseReserve=="NaN") { UseReserve = 0; }

				//  捻迄 且牢 咀 
				var CouponSale = parseFloat(this.UseCouponSumCost.value);

    //  雀盔 且牢咀 
				var MemberSale = Math.round(parseFloat(this.MemberSale));
    var CheckReserveUse = Math.round( ( OrderAmount-( CouponSale + MemberSale )  ) + ( IncreaseDelivCost+DelivCostBasic)  );
    
    // 荤侩窍妨绰 利赋陛捞 搬力 陛咀焊促 努版快
    if ( CheckReserveUse < UseReserve) {
						alert('林巩 陛咀焊促 腹篮 利赋陛篮 荤侩窍角 荐 绝嚼聪促.');
						this.UseReserveForm.value = parseFloat(CheckReserveUse);
						UseReserve = parseFloat(CheckReserveUse);
    // if - End
    }
        
				//  1雀 弥措 利赋陛 荤侩 茄档 眉农 
				if (this.UseMax < UseReserve) {
						alert('利赋陛篮 弥措'+this.inst_Common.number_format(this.UseMax)+"盔 鳖瘤 荤侩 啊瓷钦聪促.");
      
						//  利赋陛 弥措 茄档俊 吧啡绰单 弥措 茄档焊促 家瘤窍绊乐绰 利赋陛捞 利阑版快
						if (this.OriReserve < UseReserve) {
								this.UseReserveForm.value = this.OriReserve;
								UseReserve = this.OriReserve;
						}
						else {
								this.UseReserveForm.value = this.UseMax;
								UseReserve = this.UseMax;
						}
      UseNowMaxReserve = true; // 弥措 利赋陛 荤侩咀俊 吧啡促绊 
				}

				//  利赋陛捞 备概咀狼 老沥%甫 逞瘤给窍霸 眉农 
				var Per = Math.round( (parseFloat(UseReserve) / parseFloat(this.OriTotalSum))*100 );
				if (this.MaxPer < Per) {
						alert('利赋陛 荤侩篮 林巩 陛咀狼'+this.MaxPer+"%捞惑 荤侩窍角 荐 绝嚼聪促.");
						this.UseReserveForm.value = 0;
						UseReserve = 0;
				}

				//  利赋陛 荤侩咀捞 澄老锭 0栏肺
				if (!UseReserve || UseReserve==null || UseReserve=="NaN") { UseReserve = 0; }
					
				//  焊蜡 利赋陛 焊促 腹捞 静妨绊 窍搁
				if (UseReserve > this.OriReserve && UseNowMaxReserve == false) { 
						alert('利赋陛焊促 腹捞 静角荐绰 绝嚼聪促.'); 
						this.UseReserveForm.value = this.OriReserve;	
						UseReserve = this.OriReserve;	
				}

				//  醚 搬力 陛咀 犬牢鄂俊 钎矫瞪 荤侩 利赋陛咀
				this.SpentReserveForm.innerHTML = this.inst_Common.number_format(UseReserve);
				
				//  醚 搬力 陛咀 犬牢鄂俊 钎矫登绰 醚 搬力 陛咀
				var ResultTotalAmount = parseFloat(this.inst_Common.str_replace(this.ResultTotalAmountForm.innerHTML,",",""));

				//  醚 搬力 陛咀 Span俊 陛咀 盎脚 
				this.ResultTotalAmountForm.innerHTML = this.inst_Common.number_format(this.GetTotalThisOrder());

		// function - End
		},

		//-----------------------------------------------------------------------------
		//  林巩辑 郴狼 醚 搬力 陛咀 魂免 皋家靛
		//-----------------------------------------------------------------------------
		GetTotalThisOrder : function() {

				//  醚 林巩 陛咀 
				var OrderAmount = parseFloat(this.OriTotalSum);
				var DelivCostBasic = parseFloat(this.DelivCostBasic);  //  硅价厚
				var IncreaseDelivCost = parseFloat(this.IncreaseDelivCost);  //  硅价厚 且刘
        var DelivCostFreeLineCostValue = parseFloat(this.DelivCostFreeLineCost);  // 目飘扼牢 硅价厚

				//  荤侩窍妨绰 利赋陛
				var UseReserve = parseFloat(this.UseReserveForm.value);
				if (!UseReserve || UseReserve==null || UseReserve=="NaN") { UseReserve = 0; }

				//  捻迄 且牢 咀 
				var CouponSale = parseFloat(this.UseCouponSumCost.value);

        //  雀盔 且牢咀 
				var MemberSale = Math.round(parseFloat(this.MemberSale));

        //  硅价厚 固器窃等 陛咀
        this.DelivNotCost = OrderAmount-( UseReserve + CouponSale + MemberSale );

        if ( CouponSale > 0 && this.DelivPolicy=='0' && this.DelivCostFreeLine > this.DelivNotCost && DelivCostBasic=='0') {

          if (this.DelivFreeCheck=='Y' && DelivCostBasic=='0') {
            DelivCostFreeLineCostValue = DelivCostBasic;
          }

          var SendPGCost = Math.round( ( OrderAmount-( UseReserve + CouponSale + MemberSale )  ) + ( IncreaseDelivCost+DelivCostFreeLineCostValue)  );
          this.DelivCostTotalForm.innerHTML = this.inst_Common.number_format(IncreaseDelivCost+DelivCostFreeLineCostValue);
          this.DelivCostBasic = IncreaseDelivCost+DelivCostFreeLineCostValue;
        }
        else {
          var SendPGCost = Math.round( ( OrderAmount-( UseReserve + CouponSale + MemberSale )  ) + ( IncreaseDelivCost+DelivCostBasic)  );
        }
    
    // 利赋陛狼 荤侩捞 乐阑 版快父
    if (UseReserve >= 0 ) {
 
      // 醚 搬力 陛咀窍绊 荤侩 利赋陛咀窍绊 鞍阑 版快 
      if ( SendPGCost < 1) {

        //  利赋陛父 啊瘤绊 林巩阑 肯丰 茄促绊 眉农
        this.OnlyReserve=true;
        try {document.getElementById('M').style.display='none';}catch (e) {}
        try {document.getElementById('MT').style.display='none';}catch (e) {}
        try {document.getElementById('C').style.display='none';}catch (e) {}
        try {document.getElementById('CT').style.display='none';}catch (e) {}
        try {document.getElementById('O').style.display='none';}catch (e) {}
        try {document.getElementById('OT').style.display='none';}catch (e) {}
        try {document.getElementById('V').style.display='none';}catch (e) {}
        try {document.getElementById('VT').style.display='none';}catch (e) {}

        // 葛电 搬力 荐窜阑 厚劝己拳 矫挪促.
        try {document.getElementById('M').disabled=true;}catch (e) {}
        try {document.getElementById('C').disabled=true;}catch (e) {}
        try {document.getElementById('O').disabled=true;}catch (e) {}
        try {document.getElementById('V').disabled=true;}catch (e) {}
        try {document.getElementById('reserve_only_radio').checked=true;}catch (e) {}
        try {document.getElementById('reserve_only').innerHTML='利赋陛 搬力甫 急琶 窍继嚼聪促. 林巩 滚瓢阑 喘矾林技夸.';}catch (e) {}
        this.inst_Common.Show_tr(Mootong,'hide'); //  公烹厘 涝陛沥焊甫 急琶 沁阑 荐 乐扁锭巩俊 摧酒霖促.
      
      }
      else {

        if (this.OnlyReserve==true) {
          //  利赋陛 搬力 眉农甫 钱绢霖促.
          this.OnlyReserve=false;
          try {document.getElementById('V').style.display='inline';}catch (e) {}
          try {document.getElementById('VT').style.display='inline';}catch (e) {}
          try {document.getElementById('O').style.display='inline';}catch (e) {}
          try {document.getElementById('OT').style.display='inline';}catch (e) {}
          try {document.getElementById('C').style.display='inline';}catch (e) {}
          try {document.getElementById('CT').style.display='inline';}catch (e) {}
          try {document.getElementById('M').style.display='inline';}catch (e) {}
          try {document.getElementById('MT').style.display='inline';}catch (e) {}

          // 葛电 搬力 荐窜阑 厚劝己拳 矫挪促.
          try {document.getElementById('M').disabled=false;}catch (e) {}
          try {document.getElementById('C').disabled=false;}catch (e) {}
          try {document.getElementById('O').disabled=false;}catch (e) {}
          try {document.getElementById('V').disabled=false;}catch (e) {}
          try {document.getElementById('reserve_only_radio').checked=false;}catch (e) {}
          try {document.getElementById('reserve_only').innerHTML='';}catch (e) {}
        }
        else {}
      }
  
    // if - End
    }

    if (SendPGCost < 1) { SendPGCost = 0; }
 
    return SendPGCost;

		// function - End
		},

  //-----------------------------------------------------------------------------
  //  捻迄 扑诀 
  //-----------------------------------------------------------------------------
  PopupCoupon : function(action,OrderID,CartID) {
			
    // 利赋陛栏肺 葛滴 搬力秦辑 捻迄 荤侩啊瓷 陛咀捞 绝阑 锭
    if ( this.GetTotalThisOrder() < 1) { alert('捻迄阑 荤侩窍角 陛咀捞 绝嚼聪促.'); return false; }

		//  利赋陛 荤侩 咀捞 乐绰 惑炔俊辑 捻迄阑 荤侩窍妨绊且锭
		//  捻迄+利赋陛 悼矫 荤侩 阂啊老 版快 
		if (this.Double_sale=='N') {
			if (parseFloat(this.UseReserveForm.value) < 1 ) {
				inst_Common.Open_Dialog('/?action=Order_Coupon&Sub_action='+action+'&OrderID='+OrderID+'&CartID='+CartID,window,'850','580','no'); 
			}
			else { alert('捻迄苞 利赋陛篮 悼矫俊 荤侩窍角 荐 绝嚼聪促.'); }
		}
		else {inst_Common.Open_Dialog('/?action=Order_Coupon&Sub_action='+action+'&OrderID='+OrderID+'&CartID='+CartID,window,'850','580','no');}

  // function - End
  },

		//-----------------------------------------------------------------------------
		//  林巩 傈价 且锭 弥辆 搬力啊 鞘靛 蔼 技泼
		//-----------------------------------------------------------------------------
		SetOrderTotal : function() {

				var TotalCostForm = document.getElementById("TotalCost");
				var DelivCostForm = document.getElementById("DelivCost");
				var IncreaseDelivCostForm = document.getElementById("IncreaseDelivCost");
				var SendTotalForm = document.getElementById("SendTotal");  //  搬力 傈价矫 弥辆啊 
				TotalCostForm.value = this.GetTotalThisOrder();
				SendTotalForm.value = this.GetTotalThisOrder();
				IncreaseDelivCostForm.value = parseFloat(this.IncreaseDelivCost);

		// function - End
		},

		//-----------------------------------------------------------------------------
		//  林巩辑 累己汽 傈价 
		//-----------------------------------------------------------------------------
		SubmitOrderForm : function(Agree3yn) {
				var formname = document.MemmAddForm;
    var checkedMethod = null;
				var checkedAdd = "";
    var check_array1,check_array2;   

				// 厚雀盔 备概捞绊 厚雀盔 备概矫 俺牢沥焊秒鞭规魔, 距包 乐阑锭 鞘荐蔼 眉农
				if (Agree3yn == 1){

     // 公烹厘 涝陛老锭 鞘荐亲格甸
					check_array1 = new Array("Agree3","OrderName","OrderTell0","OrderTell1","OrderTell2","OrderMobil0","OrderMobil1","OrderMobil2",
								"OrderMail","ReceiverName","address","address_Seq","ReceiverTell0","ReceiverTell1","ReceiverTell2",
								"ReceiverMobil0","ReceiverMobil1","ReceiverMobil2","Receipts_name");
					
     // 傈磊 瘤阂老锭 鞘荐 亲格甸
					check_array2 = new Array("Agree3","OrderName","OrderTell0","OrderTell1","OrderTell2","OrderMobil0","OrderMobil1","OrderMobil2",
								"OrderMail","ReceiverName","address","address_Seq","ReceiverTell0","ReceiverTell1","ReceiverTell2",
								"ReceiverMobil0","ReceiverMobil1","ReceiverMobil2");
				} 
    else {

     // 公烹厘 涝陛老锭 鞘荐亲格甸
					check_array1 = new Array("OrderName","OrderTell0","OrderTell1","OrderTell2","OrderMobil0","OrderMobil1","OrderMobil2",
								"OrderMail","ReceiverName","address","address_Seq","ReceiverTell0","ReceiverTell1","ReceiverTell2",
								"ReceiverMobil0","ReceiverMobil1","ReceiverMobil2","Receipts_name");
					
     // 傈磊 瘤阂 肚绰 利赋陛 搬力 老锭 鞘荐 亲格甸
					check_array2 = new Array("OrderName","OrderTell0","OrderTell1","OrderTell2","OrderMobil0","OrderMobil1","OrderMobil2",
								"OrderMail","ReceiverName","address","address_Seq","ReceiverTell0","ReceiverTell1","ReceiverTell2",
								"ReceiverMobil0","ReceiverMobil1","ReceiverMobil2");

				}
    
				//  醚 搬力 陛咀 技泼
				this.SetOrderTotal();
    
    try {
      //  搬力 荐窜捞 窍唱档 绝阑锭
      if (formname.AccountMethod.value=='none') { alert('捞侩 啊瓷茄 搬力 荐窜捞 绝嚼聪促.'); return false; }
      
      // 利赋陛 父栏肺 搬力甫 秦具且 惑炔捞扼搁
      else if (this.OnlyReserve==true) { checkedMethod = '9'; }

      //  搬力 荐窜捞 汲沥 登菌阑 锭 , 绊按捞 急琶茄 搬力 荐窜 茫酒霖促.
      else { for (var i=0; i<formname.length; i++) {if (formname[i].name=='AccountMethod' && formname[i].checked == true) { checkedMethod = formname[i].value; } } }
      
      //  搬力 规侥 急琶窍瘤 
      if (checkedMethod == null) { alert('搬力 规侥阑 急琶秦 林寂具 钦聪促.');formname.AccountMethod[0].focus(); return false; }
    }
    catch (e) { return false; }

				//  公烹厘老锭 肚绰 利赋陛 搬力老锭
				if (checkedMethod == '2' || checkedMethod == '9') {

						//  汽傈价 
 					this.inst_Common.submitok = 'y';
      
      // 利赋陛搬力老版快
      if (checkedMethod =='9') { this.inst_Common.Check_submit(check_array2);  }
      else { this.inst_Common.Check_submit(check_array1); }

    }
				//  傈磊 瘤阂老 锭
				else {
						
						//========================
						//   PG荤俊 嘎苗辑 傈价
						//========================
						switch (this.PGCom) {
									
								//  棵歹 霸捞飘 
								case "allthegate" :
				
										//  搬力 葛碘 傈价 沥焊 盲况淋 
										formname.UserEmail.value = formname.OrderMail.value;
										formname.OrdPhone.value = formname.OrderMobil0.value+formname.OrderMobil1.value+formname.OrderMobil2.value;

										//  PG荤俊 焊尘 林巩磊 楷遏贸
										formname.OrdPhone.value = formname.OrderMobil0.value+formname.OrderMobil1.value+formname.OrderMobil2.value;

										//  PG荤俊 焊尘 林巩磊疙
										formname.OrdNm.value = formname.OrderName.value;
										
										//  PG荤俊 焊尘 荐飞磊疙
										formname.RcpNm.value = formname.ReceiverName.value;

										//  PG荤俊 焊尘 荐飞磊 楷遏贸
										formname.RcpPhone.value = formname.ReceiverTell0.value+formname.ReceiverTell1.value+formname.ReceiverTell2.value;
										
										//  PG荤俊 焊尘 硅价瘤 林家
										formname.DlvAddr.value = formname.address[0].value+formname.address[1].value;

										if (formname.comment.value!=""){formname.Remark.value = formname.comment.value; }
										else { formname.Remark.value = "硅价皋技瘤 绝澜"; }

										this.inst_Common.submitok = 'n';
										var checkok = this.inst_Common.Check_submit(check_array2);

										//  搬力 鸥涝 傈价鞘靛 技泼 
										if (checkok != false) {
												if (checkedMethod == 0) { formname.Job.value = "card"; formname.TempJob.value='onlycard'; }
												else if (checkedMethod == 1) { formname.Job.value = "iche"; formname.TempJob.value='onlyiche'; }
												else if (checkedMethod == 3) { formname.Job.value = "virtual"; formname.TempJob.value='onlyvirtual';}
												Pay(MemmAddForm);
										// if - End
										}				
								break;

								//  棵咖  
								case "allatpay" :

										//  PG荤俊 焊尘 硅价瘤 林家
  								formname.allat_recp_addr.value = formname.address[0].value+formname.address[1].value;
          
										//  捞皋老 林家 
										formname.allat_email_addr.value = formname.OrderMail.value;
          
										//  PG荤俊 焊尘 林巩磊疙
										formname.allat_buyer_nm.value = formname.OrderName.value;
										
										//  PG荤俊 焊尘 荐飞磊疙
										formname.allat_recp_nm.value = formname.ReceiverName.value;

										//  PG荤俊 焊尘 荐飞磊 楷遏贸
										formname.RcpPhone.value = formname.ReceiverTell0.value+formname.ReceiverTell1.value+formname.ReceiverTell2.value;

										if (formname.comment.value!=""){formname.Remark.value = formname.comment.value; }
										else { formname.Remark.value = "硅价皋技瘤 绝澜"; }

										this.inst_Common.submitok = 'n';
										var checkok = this.inst_Common.Check_submit(check_array2);

								  //  搬力 鸥涝 傈价鞘靛 技泼 
										if (checkok != false) {

												if (checkedMethod == 0) { formname.allat_card_yn.value = "Y";formname.allat_bank_yn.value = "N";formname.allat_vbank_yn.value = "N"; }
												else if (checkedMethod == 1) { formname.allat_card_yn.value = "N";formname.allat_bank_yn.value = "Y";formname.allat_vbank_yn.value = "N"; }
												else if (checkedMethod == 3) { formname.allat_card_yn.value = "N";formname.allat_bank_yn.value = "N";formname.allat_vbank_yn.value = "Y";}

												var ret;
												ret = visible_Approval(MemmAddForm);//Function 郴何俊辑 submit阑 窍霸 登绢乐澜.
												if( ret.substring(0,4)!="0000" && ret.substring(0,4)!="9999"){
														// 坷幅 内靛 : 0001~9998 狼 坷幅俊 措秦辑 利例茄 贸府甫 秦林矫扁 官而聪促.
														alert(ret.substring(4,ret.length));     // Message 啊廉坷扁
												}
												if( ret.substring(0,4)=="9999" ){
														// 坷幅 内靛 : 9999 狼 坷幅俊 措秦辑 利例茄 贸府甫 秦林矫扁 官而聪促.
														alert(ret.substring(8,ret.length));     // Message 啊廉坷扁
												}
										// if - End
										}				
								break;

								//  茄惫荤捞滚搬力  
								case "kcp" :

										// 林巩磊 捞皋老 林家 
										formname.buyr_mail.value = formname.OrderMail.value;
          
										//  PG荤俊 焊尘 林巩磊疙
										formname.buyr_name.value = formname.OrderName.value;

										//  PG荤俊 焊尘 [ 荐飞磊 ]疙
										formname.rcvr_name.value = formname.ReceiverName.value;

										//  PG荤俊 焊尘 [ 荐飞磊 ] 楷遏贸1
										formname.rcvr_tel1.value = formname.ReceiverTell0.value+formname.ReceiverTell1.value+formname.ReceiverTell2.value;

          //  PG荤俊 焊尘 [ 荐飞磊 ] 楷遏贸2
										formname.rcvr_tel2.value = formname.ReceiverMobil0.value+formname.ReceiverMobil1.value+formname.ReceiverMobil2.value;
										
          //  PG荤俊 焊尘 [ 荐飞磊 ] 快祈锅龋
          formname.rcvr_zipx.value = this.inst_Common.str_replace(document.getElementById('ZipcodeSpan').innerHTML,"-","");
          
          //  PG荤俊 焊尘 [ 荐飞磊 ] 林家1
										formname.rcvr_add1.value = formname.address[0].value;
										
          //  PG荤俊 焊尘 [ 荐飞磊 ] 林家2
										formname.rcvr_add2.value = formname.address[0].value;

										if (formname.comment.value!=""){formname.Remark.value = formname.comment.value; }
										else { formname.Remark.value = "硅价皋技瘤 绝澜"; }

										this.inst_Common.submitok = 'n';
										var checkok = this.inst_Common.Check_submit(check_array2);

								  //  搬力 鸥涝 傈价鞘靛 技泼 pay_method
										if (checkok != false) {
            
												if (checkedMethod == 0) { formname.pay_method.value = "100000000000";}
												else if (checkedMethod == 1) { formname.pay_method.value = "010000000000";}
												else if (checkedMethod == 3) { formname.pay_method.value = "001000000000";}
            
            var ret;
            ret = jsf__pay(MemmAddForm);
            if(ret==true){ MemmAddForm.submit(); }

          // if - End
										}

								break;

								//  扁鸥 PG荤 眠啊登搁 咯扁促啊 
									
						// switch - end 
						}
				
				// else - end 
				}

		// function - End
		},

		//-----------------------------------------------------------------------------
		//  林巩狼 秒家,背券,馆前 殿狼 脚没 扑诀 
		//-----------------------------------------------------------------------------
		PopCancle : function() {
				
				//  急琶茄 林巩 汽傈价 
				this.CancleOrder_selected('CartList','CartID[]','CancleForm',CancleAction);

		// function - End
		},

  //-----------------------------------------------------------------------------
  //  八祸汽俊 器目教
  //-----------------------------------------------------------------------------
  KeyFocus : function(action) {
				
				if (action=='search') { var SearchKey = document.getElementById("SearchKeyInput"); }
				else { var SearchKey = document.MemmAddForm.id; }

		  SearchKey.focus();

  // function - End
  },

		//-----------------------------------------------------------------------------
		//  馆前 脚没 荤蜡 扁鸥 钎矫
		//-----------------------------------------------------------------------------
		ViewMent : function(selectedvalue) {

				var texfield = document.getElementById("ReasonField");
					
				if (selectedvalue == '6') { texfield.disabled = false; }
				else { texfield.disabled = true; }

		// function - End
		},

  //-------------------------------------
  //  急琶等 林巩 秒家 格废 傈价 
  //-------------------------------------
  CancleOrder_selected : function(Order_id, CancleAction){

    var retstr = "";
				var formname = 'CartList';
				var boxname = 'CartID[]';
				var targetform = 'CancleForm';
    var form = eval("document."+formname+".elements");
    var target = eval("document."+targetform);
    var formlength =  form.length;
				var StatusArray = new Array();

    for(i = 0; i < formlength; i++) 	{

      if(form[i].type == 'checkbox' && form[i].name==boxname){
        if(form[i].checked == true){ retstr = retstr+form[i].value+"|"; }
      // if - End
      }
						
						//  涝陛 措扁 惑怕 捞寇俊 林巩 秒家甫 窍妨绊 窍搁
						if (form[i].type == 'hidden' && form[i].name=='StatusHidden') {
								if ( CancleAction == 'CancleOrder' && form[i].value!='13' ) { alert('林巩 秒家绰 涝陛 措扁 惑怕俊辑父 啊瓷钦聪促.');return false;}
						}

				// loop - End
    }

				//  急琶等 厘官备聪 ID啊 乐栏搁
    if(retstr!=""){
						
						//  扑诀阑 剁况 初绊 
						this.inst_Common.Open_Popup_Mousexy("/?action=CanclePopUp&Section="+CancleAction+"&Order_id="+Order_id, 'CancleProc' , 400, 300,'yes');
						
						// 扑诀阑 鸥百栏肺 窍绰 汽俊 鞘夸茄 洒电 蔼甸阑 盲况霖促.
						target.Str_list.value = retstr;
						target.section.value = CancleAction;
						target.OrderID.value = Order_id;
						
						//  汽阑 傈价茄促.
						target.submit();
    }
    else{
      alert("急琶等 亲格捞 绝嚼聪促.");
    }
  },

		//-----------------------------------------------------------------------------
		//  泅陛 康荐刘 , 技陛 拌魂辑 脚没 汽 扑诀   
		//-----------------------------------------------------------------------------
		AskBillPopUp : function(Action,Order_id) {

				//  扑诀阑 剁况 初绊 
				this.inst_Common.Open_Popup_Mousexy("/?action="+Action+"&Order_id="+Order_id, 'CancleProc' , 460, 400,'yes');
		// function - End
		},

		//-----------------------------------------------------------------------------
		//  惑前巩狼,饶扁 畴免
		//-----------------------------------------------------------------------------
		ShowRip : function(Obj,step) {

			for(i=0;i<Obj.length;i++){
				Obj[i].style.display='none';
			// loop - End
			}

			if (Obj.length == null) {
  			Obj.style.display='block';
      } else {
				for(k=0;k<Obj.length;k++){
					if (k == step){
						Obj[k].style.display='block';
					}
				// loop - End
				}
			}

		// function - End
		},

		//-----------------------------------------------------------------------------
		//  傍瘤矫亲 扑诀
		//-----------------------------------------------------------------------------
		ShowNoticeLayer : function(action,Obj,index) {

			var NoticeLayer = document.getElementById(Obj);  // 汽 饭捞绢
      
				if (action=='show' && this.inst_Common.GetCookie(Obj) != "close") { 
					NoticeLayer.style.left = 200+index*100;
					NoticeLayer.style.top  = 0+index*50;
					NoticeLayer.style.display="block"; 
				}
				else { NoticeLayer.style.display="none"; }

		// function - End
		},

		//-----------------------------------------------------------------------------
		//  技陛拌魂辑 惯青窃 贸府
		//-----------------------------------------------------------------------------
		SendBill : function(order_id,form) {

   window.print();
			form.order_id.value = order_id;
			form.submit();

		// function - End
		},

		//-----------------------------------------------------------------------------
		//  墨抛绊府甘 辑宏 免仿惑怕 炼例 
		//-----------------------------------------------------------------------------
		CatelistsStatus	: function() {
		  
				if (this.SubCateListsStatus==true) {
					 Effect.Shrink('overcates'); 
				  this.SubCateListsStatus=false;
				}
				else {
				 	Effect.Grow('overcates');
				  this.SubCateListsStatus=true; 
				}

		// function - End
		},

		//-----------------------------------------------------------------------------
		//  傍瘤荤亲 坷疵窍风 凯瘤 臼扁
		//-----------------------------------------------------------------------------
		Gonhji_cookie : function(Obj) {
    var c_name = Obj;
	 		inst_Common.SetCookie(c_name,'close');
		 	var NoticeLayer = document.getElementById(Obj);  // 汽 饭捞绢
    NoticeLayer.style.display="none";
		// function - End
		},

		//-----------------------------------------------------------------------------
		//  扑诀饭捞绢 坷疵窍风 凯瘤 臼扁 捻虐 积己 
		//-----------------------------------------------------------------------------
		Divpopup_cookie : function(Obj) {
    var c_name = Obj;
	 		this.inst_Common.SetCookie(c_name,'pclose');
		 	var PDiv = document.getElementById(Obj);  // 汽 饭捞绢
    PDiv.style.display="none";
		// function - End
		},

		//-----------------------------------------------------------------------------
		//  扑诀饭捞绢 弊成 摧扁 
		//-----------------------------------------------------------------------------
		Divpopup_close : function(Obj) {
		 	var PDiv = document.getElementById(Obj);  // 汽 饭捞绢
    PDiv.style.display="none";
		// function - End
		},

		//-----------------------------------------------------------------------------
		//  扑诀 饭捞绢 努腐矫 z-index 弥惑窜栏肺 缠绢棵府扁  
		//-----------------------------------------------------------------------------
		Divpopup_indexuper : function(Obj) {

    var c_name = Obj;
		 	var PDiv = document.getElementById(Obj);  // 汽 饭捞绢
    PDiv.style.zIndex = parseFloat(this.Max_zindex)+1;
  
    this.Max_zindex = parseFloat(this.Max_zindex)+1;

  // function - End
		}

// class - End
}