<%@ control language="C#" autoeventwireup="true" inherits="UserControls_PayMent, WebApp_deploy" %>
<%@ Register tagPrefix="hl" TagName="HoWaveProvinceCity" Src="HoWaveProvinceCity.ascx" %>
<script type="text/javascript" src="../Js/Howave_ShopBuyProduct.js"></script>
<div class="payment"  style="display:none">
  <div class="tradeTitle"><span>选择支付方式&nbsp;
  </span></div>
  <div class="payTye">
<table class="paymentlist" runat="server">
<tr>
<td style="height: 47px">
    <asp:RadioButtonList ID="paytype" runat="server">
    </asp:RadioButtonList></td>
</tr>
</table>
</div>
</div>
<div>
<div class="tradeTitle"><span>确定配送方式</span></div>
<table class="paymentlist">

<tr>
<td>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
    <div id="deliverInfo" runat="server">
    配送至    <asp:Label ID="Label1" runat="server" Text="全国"></asp:Label>
    <asp:RadioButtonList ID="deliverType" runat="server" />
    </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</td>
</tr>
</table>

<div id="ContactAddress" class="trade">
       <div class="HackBox"></div>
       <div class="tradeTitle"><span>确认收货地址</span></div>
       <div>
            <table id="manage_address_tr" runat="server" class="tradeAddress">
                 <tr id="add_new_address" runat="server">
                     <th width="150px" align="right">选择收货地址：</th>
                     <td><a href="../Member/Shop_ReceiveAddress.aspx" target="_blank"><font style="font-weight:bolder">管理我的收货地址</font></a></td>
                 </tr>
                 <tr id="my_receive_address_list">
                     <th align="right">收货地址：</th>
                     <td>
                         <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                             <ContentTemplate>
                                 <asp:RadioButtonList ID="address_list" runat="server"  RepeatLayout="Flow" AutoPostBack="True" OnSelectedIndexChanged="address_list_SelectedIndexChanged1"/>
                             </ContentTemplate>
                         </asp:UpdatePanel>
                     </td>
                 </tr>
            </table>
            <table id="show_new_address" runat="server" class="show_new_address">
                <tr>
                    <th>*收货人姓名：</th>
                    <td><asp:TextBox id="ContacterName" runat="server" MaxLength="50"></asp:TextBox>必须为中文
               
                    </td>
                </tr>
                 <tr>
                    <th>*联系电话：</th>
                    <td>手机：<asp:TextBox id="TextBox2" runat="server" MaxLength="11"/><br />
                        固话：<asp:TextBox id="TextBox3" runat="server" Width="100px" MaxLength="20"/>(区号-电话号码-分机号)若没分机号则留空</td>
                </tr>
                <tr>
                   <th>所在地：</th>
                   <td>
                       <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                           <ContentTemplate>
                               <asp:DropDownList ID="Province" runat="server" AutoPostBack="True" OnSelectedIndexChanged="Province_SelectedIndexChanged">
                                   <asp:ListItem></asp:ListItem>
                               </asp:DropDownList>
                               <asp:DropDownList ID="City" runat="server" Width="80px">
                                   <asp:ListItem></asp:ListItem>
                               </asp:DropDownList>
                           </ContentTemplate>
                       </asp:UpdatePanel>
                   </td>
                </tr>
                 <tr>
                    <th>*街道地址：</th>
                    <td style="height: 26px"><asp:TextBox id="Address" runat="server" Width="200px" MaxLength="50"/></td>
                </tr>
                 <tr>
                    <th>Email地址：</th>
                    <td><asp:TextBox id="Email" runat="server" Width="200px" MaxLength="50"/></td>
                </tr>
                 <tr>
                    <th>*邮编：</th>
                    <td><asp:TextBox id="zipCode" runat="server" MaxLength="6"/></td>
                </tr>
                 <tr visible="false">
                    <th>是否保存地址：</th>
                    <td><asp:CheckBox id="CheckBox1" runat="server"/>是</td>
                </tr>
            </table>
        </div> 
    </div>

<script type="text/javascript">
function refreshCode(){
    if(document.getElementById("ImgCheckCode") != null )
        document.getElementById("ImgCheckCode").innerHTML="<img src='/Passport/CheckCode.aspx' />";
}
refreshCode();
function SelectBus(id,choice)
{
  var _teamNums=<asp:literal id="TeamNumLiteral" runat="server" Text="0"/>;  
  var _busID="otherBus_";
  if(document.getElementById(id).checked)
  {
        for(var j=choice+1;j<_teamNums;j++)
        {
           document.getElementById(_busID+j).checked=true; 
           document.getElementById(_busID+j).disabled=true;
        } 
        
  }
  else
  {
        for(var j=choice+1;j<_teamNums;j++)
        {
           document.getElementById(_busID+j).checked=false; 
           document.getElementById(_busID+j).disabled=false;
        } 
       
  }
}
function show_new_address(){
  var new_address_table=document.getElementById("show_new_address");
  var add_new_addressHidenField=document.getElementById("add_new_address");
  var my_receive_address_listTable=document.getElementById("my_receive_address_list");
  var my_receive_address_listObjs=document.getElementsByName("my_receive_address");
  if(new_address_table.style.display=="none"){
     new_address_table.style.display="block"; 
     add_new_addressHidenField.value="true"; 
     my_receive_address_listTable.style.display="none";
     if(typeof(InitProvince)!="undefined")InitProvince();//初始化省   
      
     if(my_receive_address_listObjs!=null && my_receive_address_listObjs.length>0){
        my_receive_address_listObjs[1].checked=true;
        
     }
     
     
  }
  else{
     new_address_table.style.display="none";
     if( my_receive_address_listObjs != null && 0 == my_receive_address_listObjs.length){
        add_new_addressHidenField.value="true"; 
     }
     else{
        add_new_addressHidenField.value="false"; 
     }
     my_receive_address_listTable.style.display="block";
     setAreaPrice(defaultArea);//设置回默认地区的值
    
  }
}  
 function checkSubmit(){
   //设置地区值
   var h_provObj=document.getElementById("h_prov");
   var h_cityObj=document.getElementById("h_city");
   var h_areaObj=document.getElementById("h_area");
   var d_prov_select=document.getElementById("d_prov");
   var d_city_select=document.getElementById("d_city");
   var d_area_select=document.getElementById("d_area");
   var add_new_addressHiden=document.getElementById("add_new_address");
   if(add_new_addressHiden.value == "true" ){
       
        if((d_prov_select.value !="" && d_city_select.value !="")){
            h_provObj.value=d_prov_select.options[d_prov_select.selectedIndex].text;
            h_cityObj.value=d_city_select.options[d_city_select.selectedIndex].text;
            if(d_area_select.length > 0 && d_area_select.value!=""){
                h_areaObj.value=d_area_select.options[d_area_select.selectedIndex].text;        
            }
            else{
               alert('收货地址设置不正确');
               return false;   
            }
        }
        else{
           alert('收货地址设置不正确');
           return false;
        }
   
   }
 
   //判断验证码是否正确
   var checkcodeObj=document.getElementById("CheckCode");
   if(checkcodeObj.value.length!=5){
      alert('验证码不正确');
      checkcodeObj.focus();
      return false;
   }
   clearMemo();
   
   return true;
  
 
 }
  var DEFAULT_MEMO_TEXT = '请将说明文字限制在100字以内';
  var DEFAULT_MEMO_CLASS = 'Gray';
  var DEFAULT_TAX_TEXT='发票抬头：xx 商品名称：xx 发票金额： xx元'
  var memoObj = document.getElementById('Remark');
  var taxObj = document.getElementById("Invoice_Content");
  fillMemo();
  fillTax();
		  function fillMemo() {
		    memoObj = document.getElementById('Remark');
		    if(memoObj==null)return;
			if(0 == memoObj.value.length) {
				memoObj.value = DEFAULT_MEMO_TEXT;
				memoObj.className = DEFAULT_MEMO_CLASS;
			}
			
		  }
		  function fillTax(){
		    if(taxObj !=null && 0 == taxObj.value.length) {
				taxObj.value = DEFAULT_TAX_TEXT;
				taxObj.className = DEFAULT_MEMO_CLASS;
			}
		  }
		  function clearTax(){
		     if(taxObj!=null && DEFAULT_TAX_TEXT == taxObj.value) {
				taxObj.value = '';
				taxObj.className = '';
			}
		  
		  }

		  function clearMemo() {
			if(DEFAULT_MEMO_TEXT == memoObj.value) {
				memoObj.value = '';
				memoObj.className = '';
			}
			
		  }
if(typeof(InitProvince)!="undefined")InitProvince();//初始化省   

</script> 

</div>