<!--#include file="conn.asp"-->
<!--#include file="myAlipay/myAlipay.asp"-->
<!--#include file="chinabank/MD5.asp"-->
<%
if request.Cookies("bjx")("username")<>"" then
username=trim(request.Cookies("bjx")("username"))
else
username=request.Cookies("bjx")("dingdanusername")
end if%>
<!--#include file="webconfig.asp"-->
<html><head><title><%=webname%>--我要下订单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="webtop.asp"-->
<TABLE width=778 border=0 align=center cellPadding=0 cellSpacing=0 background="images/content.gif">
  <TBODY>
    <TR>
      <TD class=b width=7>&nbsp;</TD>
      <TD class=b vAlign=top align=left width=764><%dim bookid,action,i
action=request("action")
set rs=server.CreateObject("adodb.recordset")
rs.open "select count(*) as rec_count from shop_action where username='"&username&"' and zhuangtai=7",conn,1,1
if rs("rec_count")=0 then
response.write "<script language=javascript>alert('对不起，您购物车没有商品，请在购物后，再去“结算中心”！');window.close();</script>"
response.End
end if
rs.close
set rs=nothing
//////////////////////////////////
select case action
case ""
set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_action.actionid,shop_action.bookid,shop_action.bookcount,shop_action.zonger,shop_books.bookname,shop_action.shjiaid,shop_books.shichangjia,shop_books.huiyuanjia,shop_books.vipjia from shop_books inner join  shop_action on shop_books.bookid=shop_action.bookid where shop_action.username='"&username&"' and shop_action.zhuangtai=7",conn,1,1 
%>
        <table width="760" align="center" border="0" cellspacing="0" cellpadding="0" class="table-zuoyou" bordercolor="#CCCCCC">
          <tr>
            <td class="table-shangxia" background="images/class_bg.jpg" height=50>　<img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 下定单 <font color="#FF6633"><b>(在最后结算前您还可以修改购物车内容)</b></font></td>
          </tr>
        </table>
        <table width="760" align="center" border="0" cellspacing="0" cellpadding="0" class="table-zuoyou" bordercolor="#CCCCCC">
          <tr>
            <td bgColor=#ffffff colSpan=5 height=1></TD>
          </tr>
          <form name='form1' method='post' action=jszx.asp?action=shop1>
            <tr bgcolor="#f1f1f1" align="center">
              <td width=25% height="30">商品名称 </td>
              <td width=15%>市场价</td>
              <td width=15%>单价
                  <%if request.Cookies("bjx")("reglx")=2 then %>
        (VIP)
        <%else%>
        (会员)
        <%end if%>
              </td>
              <td width=15%>数量</td>
              <td width=10%>总价</td>
            </tr>
            <tr>
              <td bgColor=#cccccc colSpan=5 height=1></TD>
            </tr>
            <tr>
              <td bgColor=#f1f1f1 colSpan=5 height=3></TD>
            </tr>
            <%shuliang=rs.recordcount
jianshu=0
zongji=0
do while not rs.eof%>
            <tr bgcolor="#ffffff">
              <td height="30" width="25%" class="table-xia"><%=rs("bookname")%>
                  <input name=bookid type=hidden value="<%=rs("bookid")%>">
                  <input name=actionid type=hidden value="<%=rs("actionid")%>">
              </td>
              <td align="center" class="table-xia"><%=rs("shichangjia")%></td>
              <td align="center" class="table-xia"><%
	if request.Cookies("bjx")("reglx")=2 then 
	response.write rs("vipjia")
	else
	response.write rs("huiyuanjia")
	end if%>
        元</td>
              <td align="center" class="table-xia"><%=rs("bookcount")%></td>
              <td align="center" class="table-xia"><%=rs("zonger")%> 元</td>
            </tr>
            <%
jianshu=jianshu+rs("bookcount")
zongji=zongji+rs("zonger")
rs.movenext
loop
rs.close
set rs=nothing%>
            <tr bgcolor=#ffffff align=center>
              <td height=30 colspan=5> 您的购物车里有商品：<%=shuliang%> 件　总数量：<%=jianshu%> 件　共计：<font color=red><%=zongji%></font> 元　您有预存款：<%=request.Cookies("bjx")("yucun")%> 元 </td>
            </tr>
            <tr bgcolor=#ffffff align=center>
              <td height=40 colspan=5><input class="go-wenbenkuang" type="button" name="Submit" value="修改购物车" onClick="this.form.action='gouwu.asp?action=show';this.form.submit()">
                  <input class="go-wenbenkuang" type="submit" name="Submit3" value="OK,下一步">
              </td>
            </tr>
            <%set Godbook=server.CreateObject("adodb.recordset")
	Godbook.open "select * from shop_action_jp where username='"&username&"' and zhuangtai=7",conn,1,1
	if Godbook.recordcount>0 then%>
            <tr bgcolor="#ffffff">
              <td colspan=5><table width="95%" border="0" cellspacing="1" cellpadding="1" bgcolor="#cccccc" align="center">
                  <tr bgcolor="#ffffff">
                    <td colspan="2" align="center" height="30">您已选择的奖品清单</td>
                  </tr>
                  <tr bgcolor="#cccccc" align="center">
                    <td height="30"><b><font color="#ffffff">奖品名称</font></b></td>
                    <td height="30"><b><font color="#ffffff">使用积分</font></b></td>
                  </tr>
                  <%while not Godbook.eof%>
                  <tr bgcolor="#ffffff">
                    <td><%
	set Godbook1=server.CreateObject("adodb.recordset")
	Godbook1.open "select * from shop_jiangpin where bookid="&Godbook("bookid"),conn,1,1
	if Godbook1.recordcount=1 then
	response.write "<font color=blue>"&Godbook1("bookname")&"</font>"
	end if
	Godbook1.close
	set Godbook1=nothing%>
                    </td>
                    <td align="center"><%=Godbook("jifen")%></td>
                  </tr>
                  <%Godbook.movenext
wend%>
              </table></td>
            </tr>
            <%end if
Godbook.close
set Godbook=nothing%>
          </form>
        </table>
        <%
/////////////////////////////////////////
case "shop1"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&username&"'",conn,1,1
userid=rs("userid")
%>
        <table width="760" align="center" border="0" cellspacing="0" cellpadding="0" class="table-zuoyou" bordercolor="#CCCCCC">
          <tr>
            <td class="table-shangxia" background="images/class_bg.jpg" height=50>　<img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 填写收货信息</td>
          </tr>
        </table>
        <table width="760" align="center" border="0" cellspacing="0" cellpadding="0" class="table-zuoyou" bordercolor="#CCCCCC">
          <tr>
            <td bgColor=#ffffff colSpan=2 height=1></TD>
          </tr>
          <tr bgcolor="#ffffff">
            <td bgColor="#f1f1f1" colspan="2" height="30" align="center">请正确填写以下收货信息</td>
          </tr>
          <tr>
            <td bgColor=#cccccc colSpan=2 height=1></TD>
          </tr>
          <tr>
            <td bgColor=#f1f1f1 colSpan=2 height=3></TD>
          </tr>
          <form name="shouhuoxx" method="post" action="jszx.asp?action=shop2" onsubmit="ssxx">
            <tr bgcolor="#ffffff">
              <td width="30%" height="30" align="right" class="table-xia">收货人真实姓名：</td>
              <td width="70%" height="30" style="PADDING-LEFT: 20px" class="table-xia"><input name=userid type=hidden value="<%=userid%>">
                  <input name="userzhenshiname" class="wenbenkuang" type="text" id="userzhenshiname" size="16" value=<%=trim(rs("userzhenshiname"))%>>
        性别：
        <select class="wenbenkuang" name="shousex" id="shousex">
          <option value=1 <%if rs("sex")="1" then%>selected<%end if%>>男</option>
          <option value=2 <%if rs("sex")="0" then%>selected<%end if%>>女</option>
          <option value=0 <%if rs("sex")="2" then%>selected<%end if%>>保密</option>
        </select>
              </td>
            </tr>
            <tr bgcolor="#ffffff">
              <td width="30%" height="30" align="right" class="table-xia">详细地址：</td>
              <td width="70%" height="30" style="PADDING-LEFT: 20px" class="table-xia"><input class="wenbenkuang" name="shouhuodizhi" type="text" id="shouhuodizhi" size="50" value=<%=trim(rs("shouhuodizhi"))%>>
              </td>
            </tr>
            <tr bgcolor="#ffffff">
              <td width="30%" height="30" align="right" class="table-xia">邮政编码：</td>
              <td width="70%" height="30" style="PADDING-LEFT: 20px" class="table-xia"><input class="wenbenkuang" name="youbian" type="text" id="youbian" size="16" value="<%=rs("youbian")%>" ONKEYPRESS="event.returnValue=IsDigit();"></td>
            </tr>
            <tr bgcolor="#ffffff">
              <td width="30%" height="30" align="right" class="table-xia">联系电话：</td>
              <td width="70%" height="30" style="PADDING-LEFT: 20px" class="table-xia"><input class="wenbenkuang" name="usertel" type="text" id="usertel" size="16" value=<%=trim(rs("usertel"))%>>
              </td>
            </tr>
            <tr bgcolor="#ffffff">
              <td width="30%" height="30" align="right" class="table-xia">电子邮件：</td>
              <td width="70%" height="30" style="PADDING-LEFT: 20px" class="table-xia"><input class="wenbenkuang" name="useremail" type="text" id="useremail" size="30" value=<%=trim(rs("useremail"))%>>
              </td>
            </tr>
            <tr bgcolor="#ffffff">
              <td width="30%" height="30" align="right" class="table-xia">送货方式：</td>
              <td width="70%" height="30" style="PADDING-LEFT: 20px" class="table-xia"><%
          set rs2=server.CreateObject("adodb.recordset")
          rs2.Open "select * from youbian where youbian='"&trim(request("youbian"))&"'",conn,1,1
          if rs2.recordcount=1 then
          shangmen=1
          else
          shangmen=0
          end if
          rs2.close
          set rs2=nothing
          '//////////判断送货方式
          set rs3=server.CreateObject("adodb.recordset")
          rs3.Open "select * from shop_songhuo where fangshi=0 order by songidorder",conn,1,1
          response.Write "<select name=songhuofangshi size=5 style='width:180px'>"
          do while not rs3.EOF
          if not(shangmen=3 and trim(rs3("songid"))=3) then          '显示不显示“送货上门”
          	response.Write "<option value="&rs3("songid")
          	if int(rs("songhuofangshi"))=int(rs3("songid")) then 
          	response.Write " selected>"
          	else
          	response.Write ">"
          	end if
			response.Write trim(rs3("subject"))&"</option>"          
			end if
			rs3.MoveNext
			loop
			response.Write "</select>"
			rs3.Close
			set rs3=nothing
			%>
              </td>
            </tr>
            <tr bgcolor="#ffffff">
              <td width="30%" height="30" align="right" class="table-xia">支付方式：</td>
              <td width="70%" height="30" style="PADDING-LEFT: 20px" class="table-xia"><%
		'set rs2=server.CreateObject("adodb.recordset")
          'rs2.Open "select * from shop_songhuo where songid="&trim(request("songhuofangshi")),conn,1,1
          if cint(request("songhuofangshi"))=3 then
          fukuan=1
          else
          fukuan=0
          end if
          'rs2.close
          'set rs2=nothing
          '//////////判断支付方式
          set rs3=server.CreateObject("adodb.recordset")
          rs3.open "select * from shop_songhuo where fangshi=1 order by songidorder",conn,1,1
          response.Write "<select name=zhifufangshi size=5 style='width:180px'>"
          do while not rs3.eof
          if not(fukuan=4 and trim(rs3("songid"))=4) then	'显示不显示“货到付款”
          	response.Write "<option value="&rs3("songid")
          	if int(rs("zhifufangshi"))=int(rs3("songid")) then
          	response.Write " selected>"
          	else
          	response.Write ">"
          	end if
          	response.Write trim(rs3("subject"))&"</option>"
          end if
          rs3.movenext
          loop
          response.Write "</select>"
          rs3.close
          set rs3=nothing
		  %>
              </td>
            </tr>
            <tr bgcolor="#ffffff">
              <td height="40" colspan="2" align=center><input class="go-wenbenkuang" type="button" name="Submit2" value="上一步" onclick="javascript:history.go(-1)">
                  <input class="go-wenbenkuang" type="submit" name="Submit4" value="OK,下一步" onclick='return ssxx();'>
              </td>
            </tr>
          </form>
        </table>
        <SCRIPT LANGUAGE="JavaScript">
<!--
function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}

function ssxx()
{
   if(checkspace(document.shouhuoxx.userzhenshiname.value)) {
	document.shouhuoxx.userzhenshiname.focus();
    alert("对不起，请填写收货人姓名！");
	return false;
  }
  if(checkspace(document.shouhuoxx.shouhuodizhi.value)) {
	document.shouhuoxx.shouhuodizhi.focus();
    alert("对不起，请填写收货人详细收货地址！");
	return false;
  }
  if(checkspace(document.shouhuoxx.youbian.value)) {
	document.shouhuoxx.youbian.focus();
    alert("对不起，请填写邮编！");
	return false;
  }
  if(document.shouhuoxx.youbian.value.length!=6) {
	document.shouhuoxx.youbian.focus();
    alert("对不起，请正确填写邮编！");
	return false;
  } 
    if(checkspace(document.shouhuoxx.usertel.value)) {
	document.shouhuoxx.usertel.focus();
    alert("对不起，请留下您的电话！");
	return false;
  }
    if(checkspace(document.shouhuoxx.songhuofangshi.value)) {
	document.shouhuoxx.songhuofangshi.focus();
    alert("对不起，请选择送货方式！");
	return false;
  }
    if(checkspace(document.shouhuoxx.zhifufangshi.value)) {
	document.shouhuoxx.zhifufangshi.focus();
    alert("对不起，请选择支付方式！");
	return false;
  }
  if(document.shouhuoxx.useremail.value.length!=0)
  {
    if (document.shouhuoxx.useremail.value.charAt(0)=="." ||        
         document.shouhuoxx.useremail.value.charAt(0)=="@"||       
         document.shouhuoxx.useremail.value.indexOf('@', 0) == -1 || 
         document.shouhuoxx.useremail.value.indexOf('.', 0) == -1 || 
         document.shouhuoxx.useremail.value.lastIndexOf("@")==document.shouhuoxx.useremail.value.length-1 || 
         document.shouhuoxx.useremail.value.lastIndexOf(".")==document.shouhuoxx.useremail.value.length-1)
     {
      alert("Email地址格式不正确！");
      document.shouhuoxx.useremail.focus();
      return false;
      }
   }
 else
  {
   alert("Email不能为空！");
   document.shouhuoxx.useremail.focus();
   return false;
   }
   
}
//-->
        </script>
        <%
rs.close
set rs=nothing
'/////////////////////////////////////////
case "shop2"
%>
        <table width="760" align="center" border="0" cellspacing="0" cellpadding="0" class="table-zuoyou" bordercolor="#CCCCCC">
          <tr>
            <td class="table-shangxia" background="images/class_bg.jpg" height=50>　<img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 提交定单</td>
          </tr>
        </table>
        <table width="760" align="center" border="0" cellspacing="0" cellpadding="0" class="table-zuoyou" bordercolor="#CCCCCC">
          <tr>
            <td bgColor=#ffffff height=1></TD>
          </tr>
          <tr bgcolor="#ffffff">
            <td bgColor="#f1f1f1" height="30" align="center">请正确填写定单以便收货 </td>
          </tr>
          <tr>
            <td bgColor=#cccccc height=1></TD>
          </tr>
          <tr>
            <td bgColor=#f1f1f1 height=3></TD>
          </tr>
          <tr>
            <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr bgcolor="#ffffff">
                  <td align="center" valign="top" height=50 colspan=2><%set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_action.actionid,shop_action.bookid,shop_action.bookcount,shop_action.zonger,shop_books.bookname,shop_action.shjiaid,shop_books.anclassid,shop_books.banci,shop_books.shichangjia,shop_books.huiyuanjia,shop_books.vipjia from shop_books inner join  shop_action on shop_books.bookid=shop_action.bookid where shop_action.username='"&username&"' and shop_action.zhuangtai=7 order by shop_books.shjiaid",conn,1,1 
%>
                      <br>
                      <table width=95% border=0 align=center cellpadding=2 cellspacing=1 bgcolor=#cccccc>
                        <tr align=center bgcolor=#f1f1f1>
                          <td width=25%>商品名称</td>
                          <td width=10%>市 场 价</td>
                          <td width=15%>单 价
                              <%if request.Cookies("bjx")("reglx")=2 then %>
                  (VIP)
                  <%else%>
                  (会员)
                  <%end if%>
                          </td>
                          <td width=10%>数 量</td>
                          <td width=10%>邮寄浮动(单价)</td>
                          <td width=15%>总 价</td>
                        </tr>
                        <%shuliang=rs.recordcount
jianshu=0
zongji=0
fudongjia=0
bjxbookname=""
do while not rs.eof
bjxbookname=bjxbookname&"|"&rs("bookname")
%>
                        <tr align="center" bgcolor=#ffffff>
                          <td height="30" align="left"><%=rs("bookname")%>
                              <input name=bookid2 type=hidden value="<%=rs("bookid")%>">
                              <input name=actionid2 type=hidden value="<%=rs("actionid")%>">
                          </td>
                          <td><s><%=rs("shichangjia")%></s>元</td>
                          <td><%
	if request.Cookies("bjx")("reglx")=2 then 
	response.write rs("vipjia")
	else
	response.write rs("huiyuanjia")
	end if%>
                  元</td>
                          <td><%=rs("bookcount")%></td>
                          <td><%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from shop_fudong where id="&rs("banci"),conn,1,1
if cint(request("songhuofangshi"))=3 then	'看是不是“送货上门”
	if request.Cookies("bjx")("reglx")=2 then
		fudongjia_dj=rs_s("smvip")
	else
		fudongjia_dj=rs_s("smhy")
	end if
	elseif cint(request("songhuofangshi"))=1 then	'看是不是“平邮”
	if request.Cookies("bjx")("reglx")=2 then
		fudongjia_dj=rs_s("pyvip")
		else
		fudongjia_dj=rs_s("pyhy")
		end if
		else
	if request.Cookies("bjx")("reglx")=2 then
		fudongjia_dj=rs_s("emsvip")
		else
		fudongjia_dj=rs_s("emshy")
		end if
		end if
response.write fudongjia_dj
rs_s.close
set rs_s=nothing
%>
                          </td>
                          <td><%=rs("zonger")%> 元</td>
                        </tr>
                        <%
jianshu=jianshu+rs("bookcount")
zongji=zongji+rs("zonger")
'算每件商品的浮动价
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from shop_fudong where id="&rs("banci"),conn,1,1 
fudongjia=fudongjia+rs("bookcount")*fudongjia_dj
rs_s.close
set rs_s=nothing

firstshjid=rs("shjiaid")
rs.movenext
if not rs.eof then
nextshjid=rs("shjiaid")
end if

loop
rs.close
set rs=nothing%>
                        <tr bgcolor=#ffffff>
                          <td height=30 colspan=6 align=center>货款总计：<font color=red><%=zongji%></font> 元</td>
                        </tr>
                        <%set Godbook=server.CreateObject("adodb.recordset")
Godbook.open "select * from shop_action_jp where username='"&username&"' and zhuangtai=7",conn,1,1
if Godbook.recordcount>0 then%>
                        <tr>
                          <td colspan=6 bgcolor=#ffffff><table width="95%" border="0" cellspacing="1" cellpadding="1" bgcolor="#cccccc" align="center">
                              <tr bgcolor="#ffffff">
                                <td colspan="2" align="center">您已选择的奖品清单</td>
                              </tr>
                              <tr align="center" bgcolor="#f1f1f1">
                                <td>奖品名称</td>
                                <td>使用积分</td>
                              </tr>
                              <%
while not Godbook.eof%>
                              <tr bgcolor="#ffffff">
                                <td align="center"><%
	set Godbook1=server.CreateObject("adodb.recordset")
	Godbook1.open "select * from shop_jiangpin where bookid="&Godbook("bookid"),conn,1,1
	if Godbook1.recordcount=1 then
	response.write "<font color=blue>"&Godbook1("bookname")&"</font>"
	end if
	Godbook1.close
	set Godbook1=nothing%>
                                </td>
                                <td align="center"><%=Godbook("jifen")%></td>
                              </tr>
                              <%Godbook.movenext
wend%>
                          </table></td>
                        </tr>
                        <%end if
Godbook.close
set Godbook=nothing%>
                      </table>
                      <br>
                  </td>
                </tr>
                <tr bgcolor="#ffffff">
                  <td width="50%" align="center" valign="top"><table width="90%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
                      <tr>
                        <td colspan="2" height="24" bgcolor="#f1f1f1" align="center">您的订单信息</td>
                      </tr>
                      <tr bgcolor="ffffff">
                        <td width="30%" align="center">姓名：</td>
                        <td width="70%" style="PADDING-LEFT: 20px"><%=request("userzhenshiname")%></td>
                      </tr>
                      <tr bgcolor="ffffff">
                        <td align="center">邮编：</td>
                        <td style="PADDING-LEFT: 20px"><%=request("youbian")%></td>
                      </tr>
                      <tr bgcolor="ffffff">
                        <td align="center">地址：</td>
                        <td style="PADDING-LEFT: 20px"><%=request("shouhuodizhi")%></td>
                      </tr>
                      <tr bgcolor="ffffff">
                        <td align="center">电话：</td>
                        <td style="PADDING-LEFT: 20px"><%=request("usertel")%></td>
                      </tr>
                      <tr bgcolor="ffffff">
                        <td align="center">邮箱：</td>
                        <td style="PADDING-LEFT: 20px"><%=request("useremail")%></td>
                      </tr>
                      <tr bgcolor="ffffff">
                        <td align="center">送货：</td>
                        <td style="PADDING-LEFT: 20px"><%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_songhuo where songid="&request("songhuofangshi"),conn,1,1
if rs.eof and rs.bof then
response.write "方式已经被删除"
else
response.write rs("subject")
end if
rs.close
set rs=nothing%>
                        </td>
                      </tr>
                      <tr bgcolor="ffffff">
                        <td align="center">支付：</td>
                        <td style="PADDING-LEFT: 20px"><%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_songhuo where songid="&request("zhifufangshi"),conn,1,1
if rs.eof and rs.bof then
response.write "方式已经被删除"
else
response.write rs("subject")

end if
rs.close
set rs=nothing%>
                        </td>
                      </tr>
                  </table></td>
                  <td width="50%" align="center" valign="top"><table width="90%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
                      <tr>
                        <td colspan="2" height="24" bgcolor="#f1f1f1" align="center">送货费计算</td>
                      </tr>
                      <%
'计算费用
'先取出参数
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_sys ",conn,1,1
t_sm1=rs("sm1")
t_sm2=rs("sm2")
t_sm3=rs("sm3")
t_py1=rs("py1")
t_py2=rs("py2")
t_py3=rs("py3")
t_ems1=rs("ems1")
t_ems2=rs("ems2")
t_ems3=rs("ems3")

'先看是不是送货
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_songhuo where songid="&trim(request("songhuofangshi")),conn,1,1
if cint(request("songhuofangshi"))=3 then	'先看是不是送货
	rs.close
	if request.Cookies("bjx")("reglx")=2 then
		if zongji>=t_sm3 then 
		jijia=0
		else
		jijia=t_sm1
		end if
	else
		if zongji>=t_sm2 then 
		jijia=0
		else
		jijia=t_sm1
		end if
	end if
	feiyong=jijia+fudongjia
else
	'不是送货上门的还要看是什么方式送货
	if cint(request("songhuofangshi"))=1 then	'看是不是"普通平邮"
		rs.close
		if request.Cookies("bjx")("reglx")=2 then
			if zongji>=t_py2 then 
			jijia=t_py1-t_py3
			else
			jijia=t_py1
			end if
			else
			jijia=t_py1
		end if
		else
		rs.close
		if request.Cookies("bjx")("reglx")=2 then
			if zongji>=t_ems2 then 
			jijia=t_ems1-t_ems3
			else
			jijia=t_ems1
			end if
			else
			jijia=t_ems1
		end if
		end if
	'算商品基价+浮动价=费用
	
	feiyong=jijia+fudongjia
	if request("zhifufangshi")=17 then
          '得到预存款
          set rs2=server.CreateObject("adodb.recordset")
          rs2.Open "select yucun from [user] where username='"&username&"'",conn,1,1
          yucunkuan=rs2("yucun")
          rs2.close
          set rs2=nothing
	  if yucunkuan<feiyong+zongji then
	  	response.write "<script language=javascript>alert('您的预存款不足，请更换支付方式！');history.go(-1);</script>"
	end if
	end if
	end if%>
                      <tr>
                        <td style="PADDING-right: 20px" align="right" bgcolor="ffffff">您的送货费用计：<%=feiyong%> 元<br>
                  其中基价：<%=jijia%> 元<br>
                  浮动价：<%=fudongjia%> 元</td>
                      </tr>
                      <tr>
                        <td style="PADDING-right: 20px" align="right" bgcolor="ffffff"><font color=red>您的订单总金额： <%=feiyong+zongji%> 元</font></td>
                      </tr>
                      <tr>
                        <td style="PADDING-right: 20px" align="right" bgcolor="ffffff"><a href="help.asp?action=feiyong" >查看送货费用说明</a></td>
                      </tr>
                                        </table></td>
                </tr>
                <form name="shouhuoxx" method="post" action="jszx.asp?action=ok">
                  <tr bgcolor="#ffffff" align="center">
                    <td colspan="2"><table width="95%" border="0" cellspacing="0" cellpadding="2">
                        <tr>
                          <td width="20%"><input type="checkbox" name="fapiao" value="1">
                    是否要发票？
                      <input name="userzhenshiname" type="hidden" value=<%=trim(request("userzhenshiname"))%>>
                      <input name="shousex" type="hidden" value=<%=trim(request("shousex"))%>>
                      <input name="useremail" type="hidden" value=<%=trim(request("useremail"))%>>
                      <input name="shouhuodizhi" type="hidden" value=<%=trim(request("shouhuodizhi"))%>>
                      <input name="youbian" type="hidden" value=<%=trim(request("youbian"))%>>
                      <input name="usertel" type="hidden" value=<%=trim(request("usertel"))%>>
                      <input name="songhuofangshi" type="hidden" value=<%=trim(request("songhuofangshi"))%>>
                      <input name="zhifufangshi" type="hidden" value=<%=trim(request("zhifufangshi"))%>>
                      <input name="feiyong" type="hidden" value=<%=feiyong%>>
                      <input name="zongji" type="hidden" value=<%=zongji%>>
                      <input name=userid type=hidden value="<%=request("userid")%>" >
					  <input name="bjxbookname" type="hidden" value=<%=bjxbookname%>>
                          </td>
                          <td width="60%"><input class="wenbenkuang" type="text" name="liuyan" size="35" maxlength="30">
                    您对此订单的特殊说明(30字内) </td>
                          <td width="20%" align="center" height="60"><input class="go-wenbenkuang" type="button" name="Submit22" value="上一步" onClick="javascript:history.go(-1)">
                              <input class="go-wenbenkuang" type="submit" name="Submit42" value="完　成">
                          </td>
                        </tr>
                    </table></td>
                  </tr>
                </form>
            </table></td>
          </tr>
        </table>
        <%
case "ok"
'/////////////////////////////////////////////////
function HTMLEncode2(fString)
	fString = Replace(fString, CHR(13), "")
	fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
	fString = Replace(fString, CHR(10), "<BR>")
	HTMLEncode2 = fString
end function

'修改用户的送货信息
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&username&"'",conn,1,3
rs("userzhenshiname")=trim(request("userzhenshiname"))
rs("sex")=trim(request("shousex"))
rs("useremail")=trim(request("useremail"))
rs("shouhuodizhi")=trim(request("shouhuodizhi"))
rs("youbian")=trim(request("youbian"))
rs("usertel")=trim(request("usertel"))
rs("songhuofangshi")=trim(request("songhuofangshi"))
rs("zhifufangshi")=trim(request("zhifufangshi"))
rs.update
rs.close
set rs=nothing

if session("xiadan")<>minute(now) then
'再判断库存
'未写

dim shijian,dingdan
shijian=now()
'dingdan=year(shijian)&month(shijian)&day(shijian)&hour(shijian)&minute(shijian)&second(shijian)
'response.write bookid
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_action where username='"&username&"' and zhuangtai=7",conn,1,3
if request.Cookies("bjx")("username")<>"" then
'dingdan=year(shijian)&month(shijian)&day(shijian)&hour(shijian)&minute(shijian)&second(shijian)
dingdan=now()
dingdan=replace(trim(dingdan),"-","")
dingdan=replace(dingdan,":","")
dingdan=replace(dingdan," ","")
else
dingdan=username
end if
do while not rs.eof
'得到价格，减库存
set rs2=server.CreateObject("adodb.recordset")
rs2.open "select * from shop_books where bookid="&rs("bookid"),conn,1,3
if request.Cookies("bjx")("reglx")=2 then 
danjia=rs2("vipjia")
else
danjia=rs2("huiyuanjia")
end if
rs2("chengjiaocount")=rs2("chengjiaocount")+rs("bookcount")
rs2("kucun")=rs2("kucun")-rs("bookcount")
rs2.update
rs2.close
set rs2=nothing
'rs.addnew
'rs("username")=trim(request.cookies("bookshop")("username"))
'rs("bookid")=rs2("bookid")
rs("actiondate")=shijian
'rs("bookcount")=CInt(Request("Godbook"&rs2("bookid")))
if request("zhifufangshi")=17 then    '送货上门或预存款支付，直接改为订单完成（已收到款）
rs("zhuangtai")=3
else
rs("zhuangtai")=1
end if
rs("dingdan")=dingdan
rs("youbian")=int(request("youbian"))
rs("shouhuoname")=trim(request("userzhenshiname"))
rs("shouhuodizhi")=trim(request("shouhuodizhi"))
rs("zhifufangshi")=int(request("zhifufangshi"))
rs("songhuofangshi")=int(request("songhuofangshi"))
rs("shousex")=int(request("shousex"))
rs("liuyan")=HTMLEncode2(trim(request("liuyan")))
'rs("zonger")=request("zongji")
rs("userzhenshiname")=trim(request("userzhenshiname"))
rs("useremail")=trim(request("useremail"))
rs("usertel")=trim(request("usertel"))
rs("userid")=request("userid")
'新增
if request("fapiao")<>1 then 
fapiao=0
else
fapiao=1
end if
rs("fapiao")=fapiao
rs("feiyong")=request("feiyong")
rs("danjia")=danjia
rs.update
'rs.close
'set rs=nothing
'conn.execute "delete from shop_action where username='"&request.cookies("bookshop")("username")&"' and bookid in ("&bookid&") and zhuangtai=6"
rs.movenext
loop
rs.close
set rs=nothing
'再改奖品
z_jifen=0
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_action_jp where username='"&username&"' and zhuangtai=7",conn,1,3
do while not rs.eof
rs("actiondate")=shijian
rs("zhuangtai")=5
rs("dingdan")=dingdan
rs("userid")=request("userid")
z_jifen=z_jifen+rs("jifen")
rs.update
rs.movenext
loop
rs.close
set rs=nothing
'减去积分
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&username&"'",conn,1,3
rs("jifen")=rs("jifen")-z_jifen
'如果是在线支付，要扣预存款
if request("zhifufangshi")=17 then 
rs("yucun")=rs("yucun")-request("feiyong")-request("zongji")
end if
rs.update
rs.close
set rs=nothing

session("xiadan")=minute(now)
else
response.Write "<center>您不能重复提交！</center>"
response.End
end if

%>
        <table width="760" align="center" border="0" cellspacing="0" cellpadding="0" class="table-zuoyou" bordercolor="#CCCCCC">
          <tr>
            <td class="table-shangxia" background="images/class_bg.jpg" height=50>　<img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=index.asp><%=webname%></a> >>定单提交成功</td>
          </tr>
        </table>
        <table width="760" align="center" border="0" cellspacing="0" cellpadding="0" class="table-zuoyou" bordercolor="#CCCCCC">
          <tr>
            <td bgColor=#ffffff height=1></TD>
          </tr>
          <tr bgcolor="#ffffff">
            <td bgColor="#f1f1f1" height="30" align="center">您的订单已经成功提交，我们会在第一时间进行处理，请记清您的订单号以备查询。</td>
          </tr>
          <tr>
            <td bgColor=#cccccc height=1></TD>
          </tr>
          <tr>
            <td bgColor=#f1f1f1 height=3></TD>
          </tr>
          <tr>
            <td height="30" bgcolor="ffffff" style="PADDING-LEFT: 100px">订单号：<font color=red><%=dingdan%></font></td>
          </tr>
		  <%if request.Cookies("bjx")("username")<>"" then%>
          <tr>
            <td height="30" bgcolor="ffffff" style="PADDING-LEFT: 100px">订单查询：您可通过“<a href="javascript:;" onclick="javascript:window.open('user.asp','','')">我的专区</a>”&gt;&gt;“<a href="javascript:;" onclick="javascript:window.open('user.asp?action=dingdan','','')">我的订单</a>”查询您的订单状态。</td>
          </tr>
          <tr>
            <td height="30" bgcolor="ffffff" style="PADDING-LEFT: 100px">购物积分：请在收货后通过“<a href="javascript:;" onclick="javascript:window.open('user.asp','','')">我的专区</a>”&gt;&gt;“<a href="javascript:;" onclick="javascript:window.open('user.asp?action=dingdan','','')">我的订单</a>”及时更改您的订单状态为“完成”，因为每笔订单的积分只有在订单完成后才能累计到您的购物积分中。 </td>
          </tr>
		  <%else%>
		  <tr>
            <td height="30" bgcolor="ffffff" style="PADDING-LEFT: 100px">订单查询：因为您不是我们的会员，所以您不能查询您的订单状态。</td>
          </tr>
		  <tr>
            <td height="30" bgcolor="ffffff" style="PADDING-LEFT: 100px">购物积分：因为您不是我们的会员，所以您不能获得积分奖励。 </td>
          </tr>
          <%
		  end if
		  if request("zhifufangshi")=17 then %>
          <tr>
            <td height="30" bgcolor="ffffff" style="PADDING-LEFT: 100px">您是通过预存款支付的，我们会尽快地给你发货的！</td>
            <script language=javascript>alert('您是通过预存款支付的，我们会尽快地给你发货的！');</script>
          </tr>
          <%else
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_songhuo where songid="&trim(request("zhifufangshi")),conn,1,1
if trim(rs("subject"))="货到付款" then
rs.close
set rs=nothing
%>
          <tr>
            <td height="30" bgcolor="ffffff" style="PADDING-LEFT: 100px">您是选择的“货到付款”，我们会尽快给您送货的！</td>
            <script language=javascript>alert('您是选择的“货到付款”，请确认您的订单，我们会尽快给您送货的！');</script>
          </tr>
          <%else
rs.close
set rs=nothing%>
          <tr>
            <td height="30" bgcolor="ffffff" style="PADDING-LEFT: 100px">请您在一周内依照您选择的支付方式进行汇款，汇款时请注明您的<font color="#FF0000">订单号</font>！</td>
            <script language=javascript>alert('请您在一周内依照您选择的支付方式进行汇款，汇款时请注明您的订单号！');</script>
          </tr>
          <%end if%>
          <%end if%>
		  
  <%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_songhuo where songid="&request("zhifufangshi"),conn,1,1
if rs.eof and rs.bof then
'response.write "方式已经被删除"
else
'response.write rs("subject")
dim bjxpayway
if rs("subject")="在线支付" then
bjxpayway=1
end if

end if
rs.close
set rs=nothing
  if bjxpayway=1 then
  %>
    <tr>
    <td height="30" bgcolor="#FFFFFF" STYLE='PADDING-LEFT: 20px'>
<div align="center">
<%
dim SHJIAUserName,iiii,bjxbookname
iiii=int(request("feiyong"))+int(request("zongji"))
bjxbookname=request("bjxbookname")
SHJIAUserName="bjxshop_admin"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from BJX_PAY where SHJIAUserName='"&SHJIAUserName&"' ",conn,1,1	
if rs.eof and rs.bof then
response.Write "<script LANGUAGE='javascript'>alert('此店铺还没有设置在线支付帐号！');</script>"
else
if rs("BJX_PAY_CLASS")=1 then '支付宝
	'Dim goodsBid,ordinaryFee,expressFee,sellerEmail,goodsTitle,securityCode,Cmd,Subject,Body
	'Dim myAlipayObj,ResponseTxt1,ResponseTxt2,ResponseTxt3
	
	'六个必要参数,您可以设置成表单或链接提交表单/请求链接的方式
	goodsBid			= formatnumber(iiii,2) 	'商品价格
	ordinaryFee			= "0.00"	'平邮费用
	expressFee			= "0.00"	'快递费用
	sellerEmail			= rs("BJX_PAY_ZHANGHAO")'您的支付宝认证Email,必须通过支付宝认证才可以
	goodsTitle			= dingdanhao	'订单编号
	securityCode		= rs("BJX_PAY_MIYAO")  '安全校验码,在支付宝网站“商家工具”那里可以获得
	Cmd					= "0001"	'命令编号
	Subject				= bjxbookname		'商品名称
	Body				= bjxbookname	'商品描述

	'创建一个myAlipay实例,并初始化myAlipay_Initialize()
	Set myAlipayObj		= New myAlipay
	myAlipayObj.myAlipay_Initialize()

	'ResponseTxt1为请求i_link处理链接后生成的支付链接
	'ResponseTxt1		= myAlipayObj.getTradeButtonURL(goodsBid,ordinaryFee,expressFee,sellerEmail,goodsTitle,securityCode)
	'ResponseTxt2为采用MD5等方法自动组合生成的支付链接,支持商品中文名称
	'ResponseTxt2		= myAlipayObj.generateTradeButtonURL(goodsBid,ordinaryFee,expressFee,sellerEmail,goodsTitle,securityCode)
	'ResponseTxt3为采用MD5等方法自动组合生成的payto支付链接,支持商品中文名称
	ResponseTxt3		= myAlipayObj.generatePaytoURL(goodsBid,ordinaryFee,expressFee,sellerEmail,goodsTitle,securityCode,Cmd,Subject,Body)
	
	'Response.Write "ResponseTxt1 = " & ResponseTxt1
	'Response.Write "<br>--------------------------------------------<br>"
	'Response.Write "ResponseTxt2 = " & ResponseTxt2
	'Response.Write "<br>--------------------------------------------<br>"
	'Response.Write "ResponseTxt3 = " & ResponseTxt3
%>
<a href="<%=ResponseTxt3%>" target="_parent"><img src="images/alibtn2.gif" border="0"></a>
<%

elseif rs("BJX_PAY_CLASS")=2 then '网银支付
    
	 ' 表单的各项参数如下：

	 ' v_mid
	 '      商户号,这里为测试商户号1001，替换为自己的商户号即可
	 ' key
	 '      MD5私钥
	 ' v_oid
	 '      订单号，构成格式 年月日-商户号-小时分钟秒
	 ' v_amount
	 '      订单金额
	 ' v_moneytype
	 '      支付币种0为人民币
	 ' v_url
	 '      商户自定义返回接收支付结果的页面	 
	 ' remark1 
	 '      备注字段1
	 ' remark2 
	 '      备注字段2
	 ' style
	 '      指网关模式0(普通)，1(银行列表中带外卡)


	 '********以下几项与网上支付货款无关，建议不用**************
	 ' v_rcvname 
	 '      收货人
	 ' v_rcvaddr
	 '      收货地址	       
	 ' v_rcvtel
	 '      订货人电话	
	 ' v_rcvpost
	 '      邮编
	 ' v_ordername
	 '      发货人
	 ' v_orderemail
	 '      订货人EMAIL


	key = rs("BJX_PAY_MIYAO")
	v_mid = rs("BJX_PAY_ZHANGHAO")
	v_amount=formatnumber(iiii,2)
	v_moneytype = "0"
	style="0"
	v_url=rs("BJX_PAY_BACKURL")
	remark1=""
	remark2=""

	'根据系统时间产生订单，格式：YYYYMMDD-v_mid-HMMSS
	curdate=now()
	v_oid=year(curdate)&month(curdate)&day(curdate)&"-"&v_mid&"-"&hour(curdate)&minute(curdate)&second(curdate)
	text = v_amount&v_moneytype&v_oid&v_mid&v_url&key
	v_md5info=Ucase(trim(BJXSHOPWYMD5(text)))					'网银支付平台对MD5值只认大写字符串，所以小写的MD5值得转换为大写

	'**********以下几项与网上支付货款无关，建议不用**************
	v_rcvname="www_gzshopping_com"
	v_rcvaddr="BJX_STUDIO"
	v_rcvtel="02023835760"
	v_rcvpost="510090"
	v_ordername="BJXSHOP"
	v_orderemail = "bjxshop@21cn.com"
	
%>
<form method="post" action="https://pay3.chinabank.com.cn/select_bank" name="E_FORM" target="_parent">  
	<input type="hidden" name="v_md5info" size="100"  value="<%=v_md5info%>">
	<input type="hidden" name="v_mid" value="<%=v_mid%>">
	<input type="hidden" name="v_oid" value="<%=v_oid%>">
	<input type="hidden" name="v_amount" value="<%=v_amount%>">
	<input type="hidden" name="v_moneytype"  value="<%=v_moneytype%>">
	<input type="hidden" name="v_url" value="<%=v_url%>">
	<input type="hidden" name="style" value="<%=style%>">
	<input type="hidden" name="remark1" value="<%=remark1%>">
	<input type="hidden" name="remark2" value="<%=remark2%>">
	<!--以下几项与网上支付货款无关，建议不用//-->
	<input type="hidden" name="v_rcvname" value="<%=v_rcvname%>">
	<input type="hidden" name="v_rcvaddr" value="<%=v_rcvaddr%>">
	<input type="hidden" name="v_rcvtel" value="<%=v_rcvtel%>">
	<input type="hidden" name="v_rcvpost" value="<%=v_rcvpost%>">
	<input type="hidden" name="v_ordername"  value="<%=v_ordername%>">
	<input type="hidden" name="v_orderemail"  value="<%=v_orderemail%>">
	<input type=submit name=v_action value="进入购物系统在线支付平台">
</form>
<%

elseif rs("BJX_PAY_CLASS")=3 then 'NPS支付

		
	' 接收订单提交信息
	m_id		= 	rs("BJX_PAY_ZHANGHAO")'商 家 号
	m_orderid	= 	dingdanhao                                     '订单号
	m_oamount	= 	formatnumber(iiii,2) '订单金额
	
	key		    =     rs("BJX_PAY_MIYAO")
	
	m_url		= 	rs("BJX_PAY_BACKURL")                           '返回地址
	
	if m_url ="" then 
	   m_url = null
	end if
	m_ocurrency = 	1'币    种
	if m_ocurrency ="" then 
	   m_ocurrency = null
	end if 

	m_language	= 	1'语言选择
	if m_language ="" then 
	   m_language = null
	end if 

	s_name		= 	trim(request("shouhuoname"))
	if s_name ="" then 
	   s_name = null
	end if 

	s_addr		= 	trim(request("shouhuodizhi"))
	if s_addr ="" then 
	   s_addr = null
	end if 

	s_postcode	= 	trim(request("youbian"))
	if s_postcode ="" then 
	   s_postcode = 0
	end if 

	s_tel		= 	trim(request("usertel"))
	if s_tel ="" then 
	   s_tel = 0
	end if 

	s_eml		= 	trim(request("useremail"))
	if s_eml ="" then 
	   s_eml = null
	end if 

	r_name		= 	trim(request("shouhuoname"))
	if r_name ="" then 
	   r_name = null
	end if 

	r_addr		= 	trim(request("shouhuodizhi"))
	if r_addr ="" then 
	   r_addr = null
	end if 

	r_postcode	= 	trim(request("youbian"))
	if r_postcode ="" then 
	   r_postcode = 0
	end if 

	r_tel		= 	trim(request("usertel"))
	if r_tel ="" then 
	   r_tel = 0
	end if 

	r_eml		= 	trim(request("useremail"))
	if r_eml ="" then 
	   r_eml = null
	end if 

	m_ocomment	= 	"BJXSHOP购物系统支付平台！"
	if m_ocomment ="" then 
	   m_ocomment = null
	end if 

	m_status	=	0

	modate	= 	date()'时间字段
	if modate ="" then 
	   modate = 2004-12-22
	end if 	
	
	OrderMessage =m_id&m_orderid&m_oamount&m_ocurrency&m_url&m_language&s_postcode&s_tel&s_eml&r_postcode&r_tel&r_eml&modate&key


	
	digest = Ucase(trim(BJXSHOPWYMD5(OrderMessage)))
	
%>
              </div>
					  <form name="form2" method="post" action="https://payment.nps.cn/VirReceiveMerchantAction.do" target="_parent">
    <div align="center">
    <input type="submit" name="Submit5" value="进入购物系统在线支付平台">
    <input Type="hidden" Name="M_ID" value="<%=m_id%>">
	<input Type="hidden" Name="MOrderID" value="<%=m_orderid%>">
	<input Type="hidden" Name="MOAmount" value="<%=m_oamount%>">
	<input Type="hidden" Name="MOCurrency" value="<%=m_ocurrency%>">
	<input Type="hidden" name="M_URL" value="<%=m_url%>">
	<input Type="hidden" Name="M_Language" value="<%=m_language%>">
	<input Type="hidden" Name="S_Name" value="<%=s_name%>">
	<input Type="hidden" Name="S_Address" value="<%=s_addr%>">
    <input Type="hidden" Name="S_PostCode" value="<%=s_postcode%>">
	<input Type="hidden" Name="S_Telephone" value="<%=s_tel%>">
	<input Type="hidden" Name="S_Email" value="<%=s_eml%>">
	<input Type="hidden" Name="R_Name" value="<%=r_name%>"> 
	<input Type="hidden" Name="R_Address" value="<%=r_addr%>">
	<input Type="hidden" Name="R_PostCode" value="<%=r_postcode%>">
	<input Type="hidden" Name="R_Telephone" value="<%=r_tel%>">
	<input Type="hidden" Name="R_Email" value="<%=r_eml%>">
	<input Type="hidden" name="MOComment" value="<%=m_ocomment%>">
	<input Type="hidden" Name="MODate" value="<%=modate%>">
	<input Type="hidden" Name="State" value="<%=m_status%>">
	<input Type="hidden" Name="digestinfo" value="<%=digest%>">
                      
                      <br>
        您选择的是在线支付，汇款后请及时和店主联系！！          </div> 
    </form>
	<%end if
	end if%>	
    </td>
    
  </tr><%end if%>	
		  
          <tr>
            <td height="30" bgcolor="ffffff" style='PADDING-LEFT: 100px' align="right"><a href="#" onClick=javascript:window.close()> 关闭窗口</a><font color="#999999">　订单提交完成 创建时间：<%=shijian%>&nbsp;</font> </td>
          </tr>
        </table>
        <%
		response.Cookies("bjx")("dingdanusername")=""
		end select%></TD>
      <TD class=b width=7></TD>
    </TR>
  </TBODY>
</TABLE>
<!--#include file="service.asp"-->
<!--#include file="copyright.asp"-->
</body>
</html>
<script language=javascript>
<!--
function regInput(obj, reg, inputStr)
{
	var docSel	= document.selection.createRange()
	if (docSel.parentElement().tagName != "INPUT")	return false
	oSel = docSel.duplicate()
	oSel.text = ""
	var srcRange	= obj.createTextRange()
	oSel.setEndPoint("StartToStart", srcRange)
	var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
	return reg.test(str)
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
   //-->
</script>