<!--#include virtual="/inc/conn.asp"-->
<!--#include virtual="/inc/sitecon.asp"-->
<!--#include virtual="/show/g_pay2.asp"-->
<!--#include virtual="/inc/buysyspc.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="/Template/newbuy/css/style.css" type="text/css" rel="stylesheet">
<link href="/Template/newbuy/css/nyro.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/Template/newbuy/css/jquery.min.js" ></script>
<script type="text/javascript" src="/inc/layer/layer.js" ></script>
<script type="text/javascript" src="/inc/qrcode.min.js" ></script>
<script language=javascript>
function check_log()
{ 
   if(document.formlog.username.value=="")
   {alert("请填写帐号");return false} 
    if(document.formlog.password.value=="") 
   {alert("请填写密码");return false}
} 
function closeDiv(){document.getElementById("gift_tip").style.visibility="hidden";}
</script>

<%
set rserji=server.CreateObject("adodb.recordset")
set rsquanju=server.CreateObject("adodb.recordset")

formform=trim(SafeRequest("form"))			'来路方式 后缀
formid=trim(SafeRequest("id"))				'来路ID
isduliurl=trim(SafeRequest("isduliurl")) 	'是否独立链接来源

uid=""
gid="0"
fid="0"
isfan="no"

if request.Cookies("lailuyu")="" then
response.Cookies("lailuyu")=request.ServerVariables("HTTP_REFERER")'来路域名
end if

zdwapurl=wapurl	'默认wap地址 


if formform="" or formid="" then call PopErr2("数据获取失败，请联系商户！错误代码ERR_G01",weburl)
laiyuanid=formid

'生成 微信获取卡密 获取微信openid 所需验证字符串
Const stringmodarr = "abcdefghijklmnopqrstuvwxyzABCDEDFHIJKLMNOPQRSTUVWXYZ0123456789"
strlength = Len(stringmodarr)
Randomize timer
For i = 1 To 20 
getopenidstr = getopenidstr&Mid(stringmodarr,Int(Rnd * strlength + 1),1)  
Next 
response.Cookies("getopenidstr")=getopenidstr

'*************来源ID为分类来源******************
if formform="fenlei" then
laiyuanfid=formid '来源ID  原参数
houzhui=".html"  
	if isduliurl<>"y" then
	flwhere="aykafenleimd5='"&formid&"'"  'MD5链接
	else
	flwhere="ayfldlmd5url='"&formid&"'"   '固定链接
	end if
	rs.open "select aykafenleiid,aykanamesuoyou,aykafenleimd5,aykafenleikg,ayfldlmd5url,iszhuxiao from aykafenlei where "&flwhere&" and aykafenleikg=0 and iszhuxiao=0",conn,1,1
	if rs.bof and rs.eof then call PopErr2("未找到分类信息，请联系商户确认!错误代码ERR_G08",weburl&"index.html")
	fid=rs("aykafenleiid")       '分类数字ID
	uid=rs("aykanamesuoyou")     '商户数字ID
	rs.close
	sql="select * from ayname where aynameid="&uid&" and iszhuxiao=0"
end if

'*****************来源ID为商品ID来源*******************
if formform="shangpin" then
laiyuangid=formid '来源ID  原参数
houzhui=".htm" 
	if isduliurl<>"y" then
	spwhere="aygoodmd5='"&laiyuangid&"'" 	 'MD5链接
	else
	isduliurlg="y"
	spwhere="aygdlmd5url='"&laiyuangid&"'"   '固定链接
	end if
	rs.open "select aygoodid,aygoodsuoyouid,aygdlmd5url,aygoodmd5,aygoodfl,aygoodzhuangtai,iszhuxiao from aygood where "&spwhere&" and aygoodzhuangtai=0 and iszhuxiao=0",conn,1,1
	if rs.bof and rs.eof then call PopErr2("未找商品信息，请联系商户确认!错误代码ERR_G09",weburl&"index.html")
	fid=rs("aygoodfl")  '分类数字ID
	gid=rs("aygoodid")           '商品数字ID
	uid=rs("aygoodsuoyouid")     '商户数字ID
	rs.close
	sql="select * from ayname where aynameid="&uid&" and iszhuxiao=0"
end if
 
'***************来源ID为商户ID来源**************************
if formform="name" then
laiyuanuid=formid '来源ID  原参数 
houzhui=""
sql="select * from ayname where aygename='"&formid&"' and iszhuxiao=0"
end if

'获取后缀*********************************************
if formform="name" then 
houzhui=""
elseif formform="fenlei" then
houzhui=".html"
elseif formform="shangpin" then
houzhui=".htm" 
end if

'***********商户数据信息 开始*********************************************
rs.open sql,conn,1,1
if rs.bof and rs.eof then call PopErr2("未找到此商户信息，请联系商户确认!错误代码ERR_G02",weburl&"index.html")


'if cint(rs("ayusersuo"))=1 then call PopErr2("未找到该商家，请联系管理员!错误代码ERR_G03",weburl&"index.html")
if cint(rs("ayispay"))=1 then call PopErr2("该商家被禁止销售!",weburl&"index.html")
if isnull(trim(rs("ayqq")))=true or trim(rs("ayqq"))="" then call PopErr2("未设置商家联系QQ!暂时不能购买!错误代码ERR_G09",weburl&"index.html")

uid=rs("aynameid")
ayjibie=rs("ayjibie")       	 '级别
ayisxiaobao=rs("ayisxiaobao")    '是否加入诚信保障 0否 1是
ayisxiaojin=rs("ayisxiaojin")    '消保金额  默认0  
aychengjiao=rs("aychengjiao")    '成交笔数 默认0
aywebname=trim(rs("aywebname"))  '站点名称
ayweburl=trim(rs("ayweburl"))    '站点url
shanghuqq=trim(rs("ayqq"))       'QQ
ismailrz=rs("ismailrz")          '邮箱认证
istelrz=rs("istelrz")            '电话认证
ischengxin=rs("ischengxin")      '可信商家
ayusermiaoshu=rs("ayusermiaoshu")'商户描述
iswappay=rs("iswappay")          '是否开启wap支付
isbutishi=rs("isbutishi")        '是否开启购买提示
tousumd5=trim(rs("aymd5"))
aydata=DateValue(rs("aydata"))

tanchuang=trim(rs("tanchuang"))
if tanchuang<>"" then 
tanchuang=trim(ReplaceTrim(rs("tanchuang"))) '商家设置 弹窗提示
tanchuang=replace(tanchuang,"\n","<br>")
end if

ayweixinid=trim(rs("ayweixinid"))
shangjiabao_user=rs("shangjiabao")    '未缴纳消保是否允许上架销售 1禁止
moban=trim(rs("moban"))
if cint(rs("ayisweixinok"))=2 then showweixinerweima=trim(rs("ayweixinpic"))
isjiekoustr=split(trim(rs("isjiekou")),"|")  '强制接口  isjiekoustr(0)网银  isjiekoustr(1)支付宝 isjiekoustr(2)财付通 isjiekoustr(3)微信 isjiekoustr(4) 手Q
isbuylog=rs("isbuylog")			 '是否强制买家登录购买 1是 *************************************************
'if cint(ayjibie)=1 or cint(ayjibie)=10 or cint(ayjibie)=8 or cint(ayjibie)=12 then isbuylog=1


isbuymailog="no" 				 '买家是否已登录
if request.Cookies("aynameid")<>"" then

'检查是否在全站买家ID黑名单
call chkbuyheiall(request.Cookies("aynameid"))

isbuymailog="yes"

	if trim(rs("nobuyid"))<>"" and isnull(trim(rs("nobuyid")))=false then
	diankastr=mid(trim(rs("nobuyid")),1,len(trim(rs("nobuyid")))-1)	
	diankastr=split(trim(diankastr),",") 
		For dianka=0 To Ubound(diankastr) 
		if trim(diankastr(dianka))=request.Cookies("aynameid") then
		call logadd(request.Cookies("aynameid"),"买家被商家限制购买",0,1)
		response.Write "<div style=text-align:center;padding-top:50px;color:#F00;font-size:18px>商家禁止该买家进行购买！</div>"
		response.end
		end if
		next 
	end if
	maitel=gettelnum(request.Cookies("aynameid"))
end if

'买家ID信息
'if request.Cookies("aynameid")<>"" then 
'set rsmail=server.CreateObject("adodb.recordset")
'sqlmail="select aynameid,aymail,ayyue,ayusername from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
'rsmail.open sqlmail,conn,1,1
'buyuseryue=trim(rsmail("ayyue"))       '账户余额
'buyusername=trim(rsmail("ayusername")) '用户名
'rsmail.close
'end if
rs.close

'买家购买提示
if isbuytishi="yes" then
if ayjibie=10 or ayjibie=1 then istishi="yes"
end if

if buytishi="yes" or istishi="yes" or isbutishi=1 then
listbuytishi="yes"
end if


if formform="fenlei" then%>
	<script language="javascript">
	window.onload = function(){
	fenlei('<%=fid%>',' ');document.getElementById("fid").value=<%=fid%>;
	//if('<%'=tanchuang%>' != null && '<%'=tanchuang%>' != ""){alert('商家重要提示：\n<%'=tanchuang%>');	}
	if('<%=listbuytishi%>'=="yes"){	document.getElementById('joinclub').style.display = 'block';document.getElementById('bg123').style.display = 'block';}
	if('<%=tanchuang%>' != null && '<%=tanchuang%>' != ""){layer.alert('<%=tanchuang%>', {title: '商家通知公告',});}
	//layer.alert('爱卡平台抵制一切网络违禁商品，倡导并践行绿色网络，如遇到涉黄/涉毒/贩卖公民信息及其他违规，请立即向平台客服人员进行举报！', {title: '爱卡平台提示',});
	}
    </script>
<%
end if

if formform="shangpin" then%>
	<script language="javascript">
	window.onload = function(){
	fenlei('<%=fid%>','<%=gid%>');good('<%=gid%>');
	//if('<%'=tanchuang%>' != null && '<%'=tanchuang%>' != ""){alert('商家重要提示：\n<%'=tanchuang%>');	}
	if('<%=listbuytishi%>'=="yes"){	document.getElementById('joinclub').style.display = 'block';document.getElementById('bg123').style.display = 'block';}
	if('<%=tanchuang%>' != null && '<%=tanchuang%>' != ""){layer.alert('<%=tanchuang%>', {title: '商家通知公告',});}
	//layer.alert('爱卡平台抵制一切网络违禁商品，倡导并践行绿色网络，如遇到涉黄/涉毒/贩卖公民信息及其他违规，请立即向平台客服人员进行举报！', {title: '爱卡平台提示',});
	}
    </script>
<%
end if

if formform="name" then%>
	<script language="javascript">
	window.onload = function(){
	//if('<%'=tanchuang%>' != null && '<%'=tanchuang%>' != ""){alert('商家重要提示：\n<%'=tanchuang%>');	}
	if('<%=listbuytishi%>'=="yes"){	document.getElementById('joinclub').style.display = 'block';document.getElementById('bg123').style.display = 'block';}
	if('<%=tanchuang%>' != null && '<%=tanchuang%>' != ""){layer.alert('<%=tanchuang%>', {title: '商家通知公告',});}
	//layer.alert('爱卡平台抵制一切网络违禁商品，倡导并践行绿色网络，如遇到涉黄/涉毒/贩卖公民信息及其他违规，请立即向平台客服人员进行举报！', {title: '爱卡平台提示',});
	}
    </script>
<%
end if



'##########获取wap地址  普通购买【需要]】 VIP嵌套【不需要】 and cint(iswappay)=1 
if iswap="yes" then
	if isduliurl="y" then 
	wapurl=zdwapurl&"buy/"&formid&houzhui
	else
	wapurl=zdwapurl&formid&houzhui
	end if	
	if getistel="wap" then '手机访问 直接跳转到WAP
	response.Redirect wapurl
	end if
end if
'##########获取wap地址 普通购买【需要】 VIP嵌套【不需要】

'获取当前地址
if isduliurl="y" then 
thispcurl=weburl&"shop/old/buy/"&moban&"/"&formid&houzhui
else
thispcurl=weburl&"shop/old/"&formid&houzhui
end if


%>
<!--购买提示 开始-->
<script type="text/javascript">
function closeCustomer(){document.getElementById("joinclub").style.display='none';document.getElementById("bg123").style.display='none';}
function closeurl(){window.location.href="/";}
</script> 

<div class="weixinid" id="weixinid" style="display: none;">
<img src="<%=showweixinerweima%>"  width="250"/>
</div>

<div id="bg123" class="bg123" style="display:none;"></div>
<div class="joinclub" id="joinclub" style="display:none;">
<div class="joinclub01"><img src="<%=ossurl%>images/wxts.jpg" /></img></div>
	<div class="joinclub02">
    购买须知：<br>
    【<%=webname%>】运营性质和某宝一样！<br>
    【<%=webname%>】并非商品直接销售商！<br>
    【<%=webname%>】是买家与商家之间的中间平台！<br>
    <div class="joinclub03"></div>
    <span style="color:#F60">重要提示：</span><br>
    <span style="color:#F60">商品的使用与售后，需要联系商家，请知晓！！！</span><br>
    <span style="color:#F60">商家QQ：<span id="jsqq"><a style="color:#F60" href="tencent://message/?uin=<%=shanghuqq%>&Site=<%=shanghuqq%>&Menu=yes" title="<%=shanghuqq%>"><%=shanghuqq%></a> (先添加好友)</span></span><br>
    <%if ayweixinid<>"" then%>
    <span style="color:#F60">商家微信：<%=ayweixinid%></span><br>
    <%end if%>
    <div class="joinclub03"></div>
    关于投诉与退款：<br>
    商品出现任何问题请在24小时内<a href="<%=weburl%>tousu" target="_blank">【进行投诉】</a>！<br>
    <div class="joinclub04"></div>
    <input type="button" value=" 继续购买，我知道商品售后联系商家 " onClick="closeCustomer()" style="cursor:pointer" />&nbsp;
    <input type="button" value=" 我要离开 " onClick="closeurl()" style="cursor:pointer" />
    </div>
</div>
<!--购买提示 结束-->

<!--联系方式提示 开始
<script type="text/javascript">
function closelx(){document.getElementById("lxclub").style.display='none';document.getElementById("bg123").style.display='none';}
function closemail(){document.getElementById("mailclub").style.display='none';document.getElementById("bg123").style.display='none';}
function checklx(str)
{
document.getElementById('lxclub').style.display = 'block';document.getElementById('bg123').style.display = 'block';
lianxitx.innerHTML=str;
}
function checkmail()
{
document.getElementById('mailclub').style.display = 'block';document.getElementById('bg123').style.display = 'block';
}
</script> 
<div class="lxclub" id="lxclub" style="display:none;">
	<div class="lxclub01">你预留的订单查询唯一依据，<span style="color:#F60">联系方式</span>为：</div>
    <div class="lxclub02" id="lianxitx"></div>
	<div class="lxclub03">订单查询/提卡地址  <a href="<%'=weburl%>chaxun" target="_blank"><%'=weburl%>chaxun</a></div>
    <div class="lxclub04"><input type="button" class="logindlreg" value=" 我知道了 " onClick="closelx()" style="cursor:pointer" /></div>
</div>
-->

<!--买家邮箱提示框 开始
<div class="lxclub" id="mailclub" style="display:none;">
	<div class="lxclub05"><%'=jname%>提示您：</div>
    <div class="lxclub06">由于发信机制限制。<br>我们发送给您的邮件可能被归类到垃圾邮件中！<br><br>当您收件箱没有收到我们的邮件时，不妨查看一下垃圾邮件！<br></div><br>
    <div class="lxclub04"><input type="button" class="logindlreg" value=" 我知道了 " onClick="closemail()" style="cursor:pointer" /></div>
</div>
-->


<!--微信接收通知 开始  --> 
<script type="text/javascript">
function closewx(){document.getElementById("wxclub").style.display='none';document.getElementById("bg123").style.display='none';}
function openlog(){document.getElementById("logclub").style.display='block';document.getElementById("bg123").style.display='block';}
function closelog(){document.getElementById("logclub").style.display='none';document.getElementById("bg123").style.display='none';}
function huoquopenid()
{
document.getElementById('wxclub').style.display = 'block';document.getElementById('bg123').style.display = 'block';
var timer;
$(function(){
var handler = function(){
$.post("/inc/getopenid/",null,function(msg){
if(msg != 'no'){
document.getElementById("wxclub").style.display='none';document.getElementById("bg123").style.display='none';
hqopenid.innerHTML="扫码成功！卡密将发送至 "+msg+" 的微信";   
clearInterval(timer);
}});} 
timer = setInterval(handler , 2000);});
}
</script> 
<div class="wxclub" id="wxclub" style="display:none;">
	<div class="wxclub01">
        <div class="wxclubl">
    	<span style="color:#F60">如果还未关注公众号<br>请扫描下面二维码关注公众号</span><br>
    	<img src="<%=ossurl%>images/weixinma.jpg" width="190" /></img>
        </div>
        <div class="gexian"></div>
        <div class="wxclubr">
    	<span style="color:#F60">我已关注公众号<br>直接扫描下面二维码</span><br>
        <%
		thisurl=zdwapurl&"index/getopenid?id="&request.Cookies("getopenidstr")
		'togzhurl=zdwapurl&"index/gzh?url="&thisurl
		%>
        <div id="qrcodewx" style="padding-left:45px; padding-top:10px;"></div>
        <script type="text/javascript">var qrcodewx = new QRCode(document.getElementById("qrcodewx"), {width:170,height:170});qrcodewx.makeCode("<%=thisurl%>");</script>
        </div>
    <input type="button" class="logindlreg" value=" 关    闭 " onClick="closewx()" style="cursor:pointer" />
    </div>
</div>
<!--微信接收通知 结束-->

<!--买家登录 开始-->
<div class="logclub" id="logclub" style="display:none;">
	<div class="wxclub01">
        <div class="wxclubl">
    	<span style="color:#F60">买家快捷登录</span><br><br>
        <%if isqqkfon="yes" then%>
    	<a href="https://open.weixin.qq.com/connect/qrconnect?appid=<%=wxkfappid%>&redirect_uri=<%=wxkfre%>&response_type=code&scope=snsapi_login&state=<%=thispcurl%>#wechat_redirect"><img src="<%=ossurl%>Template/newbuy2/images/wxlog.png" /></img></a><br><br>
        <%end if%>
        <%if iswxkfon="yes" then%>
        <a href="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=<%=qqkfappid%>&redirect_uri=<%=qqkfre%>&state=<%=thispcurl%>"><img src="<%=ossurl%>Template/newbuy2/images/qqlog.png" /></img></a>
        <%end if%>
        </div>
        <div class="gexian"></div>
        <div class="wxclubr">
    	<span style="color:#F60">使用密码登录</span><br><br>
        <form action="/index/checkuser" method="post" name="formlog" target="_self" id="formlog" onSubmit="return check_log()">
        手机：<input name="username" type="text"  class="xzspsrk1" id="username" /><br><br>
		密码：<input name="password" type="password"  class="xzspsrk1" id="password" />
        <input name="pcurl" type="hidden" value="<%=thispcurl%>" />
        <input name="act" type="hidden" value="logindex" />
        <input name="lei" type="hidden" value="mai" />
		<input class="buymai" name="mailog" type="submit" id="mailog" value=" 买 家 登 录 " />
        &nbsp;
        <input class="buymai" name="reguid" type="button" id="reguid" value=" 快 速 注册 " onClick="javascript:window.location.href='/u/addbuyuser?l=w&url=<%=thispcurl%>'" />
        </form>
        </div>
    <input type="button" class="logindlreg" value=" 关    闭 " id="closelog" onClick="closelog()" style="cursor:pointer" />
    </div>
</div>
<!--买家登录 结束-->
<%

'**************全局设置************************
sql="select buyisdl,ayisjdpay,shangjiabao,ayisbankpay,ayisalipay,ayistenpay,ayissaopay,aybankpay,ayisqqpay from ayquanju"
rs.open sql,conn,1,1

if cint(shangjiabao_user)<>2 then
	if cint(rs("shangjiabao"))=1 or cint(shangjiabao_user)=1 then
		if ccur(ayisxiaojin)<ccur(xiaobaojine) then
			call PopErr2("2018-1-18日起为保障交易安全，非VIP会员商家，暂时不能上架销售","/") 
			response.End
		end if
	end if
end if

ayisbankpay=rs("ayisbankpay") '网银支付 1开启
ayisalipay=rs("ayisalipay")   '支付宝支付 1开启
ayistenpay=rs("ayistenpay")   '财付通支付 1开启
ayissaopay=rs("ayissaopay")   '扫码支付 1开启
aybankpay=rs("aybankpay")     '网银支付方式  1支付宝 2财富通 3易宝 4盛付通 5国付宝 6 51网银
ayisqqpay=rs("ayisqqpay")     'QQ支付
ayisjdpay=rs("ayisjdpay")
if cint(isbuylog)<>2 then					'2=关闭强制登录
if cint(rs("buyisdl"))=1 then isbuylog=1	'全站设置 买家必须登录才可以购买 1是 0否
end if
rs.close

if cint(ayjibie)<>5 and cint(ayjibie)<>9 then
rs.open "select ayisjdpay,aybankpay,ayujbgid,ayisbankpay,ayisalipay,ayistenpay,ayissaopay,ayisqqpay from ayujb where ayujbgid="&ayjibie&"" ,conn,1,1
if rs.bof and rs.eof then call PopErr2("获取参数有误，请重新尝试",weburl&"index/exit")
aybankpay=rs("aybankpay")
ayisbankpay=rs("ayisbankpay")
ayisalipay=rs("ayisalipay")
ayistenpay=rs("ayistenpay")
ayissaopay=rs("ayissaopay")
ayisqqpay=rs("ayisqqpay")
ayisjdpay=rs("ayisjdpay")
rs.close
end if
%>


<title><%=aywebname%>(<%=webname%>)</title>
</head>
<body>
<script language="javascript">
function agreed(){protect2.style.display = "";}
<%'必要组件%>
var xmlhttp;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){try{xmlhttp=new XMLHttpRequest();}catch (e){}}}
var xmlhttp2;try{xmlhttp2=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try{xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){try{xmlhttp2=new XMLHttpRequest();}catch (e){}}}
var xmlhttpx;try{xmlhttpx=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try{xmlhttpx=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){try{xmlhttpx=new XMLHttpRequest();}catch (e){}}}
function HTMLEncode(input){var converter = document.createElement("DIV");converter.innerText = input;var output = converter.innerHTML;converter = null;return output;} 

<%'优惠券初始化%>
function is_youhui(){form1.youhuiquan.value="";checkcoupon.style.display = "none";document.getElementById("youhuiquanzhi").value=0;if(document.form1.isyouhui.checked == true){youhuiquancon.style.display = "";}else{youhuiquancon.style.display = "none";}return jisuan();}

<%'数字检测%>
function CheckIfid( String )
{ 
    var Letters = "1234567890";
     var i;
     var c;
      if(String.charAt( 0 )=='-')
	return false;
      if( String.charAt( String.length - 1 ) == '-' )
          return false;
     for( i = 0; i < String.length; i ++ )
     {
          c = String.charAt( i );
	  if (Letters.indexOf( c ) < 0)
	     return false;
     }
     return true;
}

<%'使用优惠券%>
function ckyouhuiquan()
{
checkcoupon.style.display = "";
checkcoupon.innerHTML="<img src=<%=ossurl%>Template/Template4/images/load.gif> 正在查询..";
	if(form1.youhuiquan.value=="")
	{
	document.form1.isyouhui.checked = false;
	checkcoupon.innerHTML="请填写优惠券!";
	}
	else
	{
		xmlhttp.open("get","/show/chagood/?id="+form1.youhuiquan.value+"&act=ckyhq&fenleiid="+document.getElementById("fid").value+"&shangid="+document.getElementById("sid").value+"&userid="+<%=uid%>+"&t=" +  new Date().getTime());
  		xmlhttp.onreadystatechange=function()
   		{
   		if(4==xmlhttp.readyState)
	 	{
	  		if(200==xmlhttp.status)
	  		{	
				if (xmlhttp.responseText=="no")
				{ 
				document.form1.isyouhui.checked = false;document.getElementById("youhuiquanzhi").value=0;
		   	 	checkcoupon.innerHTML="<font color=red>获取参数错误</font>";
				return jisuan();return false;
				}
		    	else if(xmlhttp.responseText=="1111")
				{
				document.form1.isyouhui.checked = false;document.getElementById("youhuiquanzhi").value=0;
		    	checkcoupon.innerHTML="<font color=red>未找到优惠券信息</font>";
		    	return jisuan();return false;
		    	}
				else if(xmlhttp.responseText=="0000")
		    	{
				document.form1.isyouhui.checked = false;document.getElementById("youhuiquanzhi").value=0;
		    	checkcoupon.innerHTML="<font color=red>优惠券已过期或已无效</font>";
		    	return jisuan();return false;
		   		}
				else if (xmlhttp.responseText=="2222")
		   	 	{
				document.form1.isyouhui.checked = false;document.getElementById("youhuiquanzhi").value=0;
		    	checkcoupon.innerHTML="<font color=red>此优惠券不允许在此商品分类下使用</font>";
		    	return jisuan();return false;
		    	}
				else if (xmlhttp.responseText=="3333")
				{
				document.form1.isyouhui.checked = false;document.getElementById("youhuiquanzhi").value=0;
		   	 	checkcoupon.innerHTML="<font color=red>此优惠券不允许在此商品下使用</font>";
		    	return jisuan();return false;
		    	}
		    	else
			    {
			    document.form1.isyouhui.checked = true;
				var yhstr=xmlhttp.responseText;
				arrStryou=yhstr.split("|");
		 		if(arrStryou.length==2){checkcoupon.innerHTML ="优惠总价的"+arrStryou[0]+"% (充值卡支付暂不支持使用优惠券)";document.getElementById("youhuiquanzhi").value=arrStryou[0]+"|%";}
		 		if(arrStryou.length==1){checkcoupon.innerHTML ="优惠"+arrStryou[0]+"元 (充值卡支付暂不支持使用优惠券)";document.getElementById("youhuiquanzhi").value=arrStryou[0];}
				return jisuan();
				}

	   		}
	  		else
	  		{
	    	alert("连接失败e1");
			return false;
	   		}
		}
   		}
  		xmlhttp.send(null); 




	}
}  

<%'获取分类信息 farrStr[0] 列表  farrStr[1] ID farrStr[2] 点卡  farrStr[3] 描述 farrStr[4] QQ farrStr[5] URL %>
function fenlei(str,str2)
{
if(str==0){alert("请选择商品分类");return false;}
document.getElementById("istelka").checked = false;
loading.style.display = "";
shangpin.style.display ="none";
document.getElementById("sid").value="";
fenlei_miaoshu.innerHTML="";                       <%'商品描述%>
good_miaoshu.innerHTML="";
document.getElementById("fqq").value="";           <%'分类qq%>
document.getElementById("fu").value="";            <%'分类url%>
xmlhttp2.open("get","/show/cha/?fenleiid="+str+"&uid="+<%=uid%>+"&gid="+str2+"&act=chafenlei&isduliurl=<%=isduliurl%>&isduliurlg=<%=isduliurlg%>");
   xmlhttp2.onreadystatechange=function()
   {
   //document.getElementById("lishi").value=xmlhttp2.responseText;
	   if(200==xmlhttp2.status)
	   {	
			loading.style.display = "none";
	   		shangpin.style.display ="";
			var fstr=xmlhttp2.responseText;
			farrStr=fstr.split("|");
			shangpin.innerHTML=farrStr[0];                             <%'商品列表%>
			document.getElementById("fid").value=farrStr[1];           <%'分类ID%>
			fenlei_miaoshu.innerHTML=HTMLEncode(farrStr[3]);           <%'分类描述%> 
			
			<%'########检测是否有独立QQ 普通购买【需要】 VIP【不需要】%>
			if(farrStr[4])
			{
				if(parseInt(farrStr[4])!==0)
				{
				jsqq.innerHTML=farrStr[4];
				document.getElementById("fqq").value=farrStr[4];
				sqq.innerHTML=farrStr[4];
				sqq2.innerHTML="<a href=tencent://message/?uin="+farrStr[4]+"&Site="+farrStr[4]+"&Menu=yes title="+farrStr[4]+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>";
				sqqd.innerHTML=farrStr[4];
				sqqd2.innerHTML="<a href=tencent://message/?uin="+farrStr[4]+"&Site="+farrStr[4]+"&Menu=yes title="+farrStr[4]+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>";
				document.getElementById("shanghuqq").value=farrStr[4];
				}
			}else{
				jsqq.innerHTML=<%=shanghuqq%>;
				sqq.innerHTML=<%=shanghuqq%>;
				sqq2.innerHTML="<a href=tencent://message/?uin="+<%=shanghuqq%>+"&Site="+<%=shanghuqq%>+"&Menu=yes title="+<%=shanghuqq%>+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>";
				sqqd.innerHTML=<%=shanghuqq%>;
				sqqd2.innerHTML="<a href=tencent://message/?uin="+<%=shanghuqq%>+"&Site="+<%=shanghuqq%>+"&Menu=yes title="+<%=shanghuqq%>+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>";
				document.getElementById("shanghuqq").value=<%=shanghuqq%>;
				}
				
			<%'########检测是否有独立URL  普通购买【需要】 VIP【不需要】%>
			if(farrStr[5])
			{			
			document.getElementById("fu").value=farrStr[5];
			surl.innerHTML="<a href="+HTMLEncode(arrStr[5]);+" target=_blank>"+HTMLEncode(arrStr[5]);+"</a>";	
			}
			else 
			{
			surl.innerHTML="<a href=<%=ayweburl%> target=_blank><%=ayweburl%></a>";
			}
			
	   }
	   //else{alert("获取失败e1");return false;}
   }
   xmlhttp2.send(null); 
   //return false;
}  

function good(str)
{
if(str==0){alert("请选择商品");return false;}
document.getElementById("istelka").checked = false;
loadingj.style.display = "";          			<%'加载中%>
price.innerHTML=""
document.getElementById("quantity").value=1;    <%'数量1%>
document.getElementById("buypasscha").value=0   <%'购卡密码检测%>
limit_quantity_tip.style.display = "none";      <%'限购%>
pifayouhui.style.display = "none";              <%'批发优惠详细%>
pifashow1.style.display = "none";               <%'批发1%>
pifashow2.style.display = "none";				<%'批发2%>
pifashow3.style.display = "none";               <%'批发3%>
pifashow4.style.display = "none";				<%'批发4%>
pifashow5.style.display = "none";				<%'批发5%>
is_buypass.style.display = "none";				<%'购卡密码%>
form1.tikapass.value=="";        				<%'提卡密码%>
pinfo1.style.display = "none";   				<%'pinfo1 选择最佳支付%>
pinfo2.style.display = "";       				<%'pinfo2 提示支付金额%>
good_miaoshu.innerHTML="";       				<%'商品描述%>
goodxx.style.display = "none";   				<%'商品详细说明%>
goodxxcon.innerHTML="."           				<%'商品详细说明内容%>
document.getElementById("pi1").value="";
document.getElementById("pi2").value="";
document.getElementById("pi3").value="";
document.getElementById("pi4").value="";
document.getElementById("pi5").value="";
document.getElementById("pij1").value="";
document.getElementById("pij2").value="";
document.getElementById("pij3").value="";
document.getElementById("pij4").value="";
document.getElementById("pij5").value="";
document.getElementById("gooduserid").value=<%=uid%>;	<%'商户ID%>
document.form1.isyouhui.checked = false; 				<%'优惠券%>
document.getElementById("youhuiquan").value=""; 		<%'优惠券%>
document.getElementById("youhuiquanzhi").value=""; 		<%'优惠券值%>
checkcoupon.style.display = "none";           			<%'优惠券提示%>
youhuiquancon.style.display = "none";           		<%'优惠券框%>
document.getElementById("goodzongjia").value=0;


<%'商品详细说明%>
xmlhttpx.open("get","/show/cha/?goodid="+str+"&uid="+<%=uid%>+"&act=chagoodx&isduliurlg=<%=isduliurlg%>&isduliurl=<%=isduliurl%>");
xmlhttpx.onreadystatechange=function(){if(200==xmlhttpx.status){	
if(xmlhttpx.responseText!=="")
{
goodxx.style.display = "";
goodxxcon.innerHTML=xmlhttpx.responseText;
}
}}
xmlhttpx.send(null); 

	xmlhttp.open("get","/show/cha/?goodid="+str+"&uid="+<%=uid%>+"&act=chagood&isduliurlg=<%=isduliurlg%>&isduliurl=<%=isduliurl%>");
	xmlhttp.onreadystatechange=function()
	{
	<%'临时测试数据%> 
	//document.getElementById("lishi").value=xmlhttp.responseText;
	   if(200==xmlhttp.status)
	   {		 
			<%'取消加载%>
			loadingj.style.display = "none";

			<%'代理商品错误信息%>
			if(xmlhttp.responseText=="ERR01"){alert("上级商品ID错误，请联系商家ERR01");window.location.href="/";return false;}
			if(xmlhttp.responseText=="ERR02"){alert("上级商品ID错误，请联系商家ERR02");window.location.href="/";return false;}
			if(xmlhttp.responseText=="ERR03"){alert("代理价格设置错误，请联系商家ERR03");window.location.href="/";return false;}
			if(xmlhttp.responseText=="ERR04"){alert("未找到代理关系，请联系商家ERR04");window.location.href="/";return false;}
			if(xmlhttp.responseText=="ERR05"){alert("未找到代理商品，请联系商家ERR05");window.location.href="/";return false;}
			if(xmlhttp.responseText=="ERR06"){alert("商品成本价格低于代理价，请联系商家ERR06");window.location.href="/";return false;}
			
			<%'开始载入数据%>
			var gstr=xmlhttp.responseText;
			arrStr=gstr.split("|");
			//document.getElementById("lishi").value=arrStr[19];
			price.innerHTML=parseFloat(arrStr[0]).toFixed(2);            <%'显示价格%>
			tprice.innerHTML=parseFloat(arrStr[0]).toFixed(2);           <%'显示提示价格%>
			document.getElementById("goodyj").value=arrStr[0];           <%'原单价%>
			document.getElementById("danjia").value=arrStr[0];           <%'单价%>
			document.getElementById("goodzongjia").value=arrStr[0];      <%'总价%>
			document.getElementById("jc_xiangou").value=arrStr[14];      <%'限购数量%>
			document.getElementById("jc_s").value=arrStr[29];            <%'库存卡%>
			document.getElementById("sid").value=arrStr[30];             <%'商品ID%>



			good_miaoshu.innerHTML=HTMLEncode(arrStr[24]);               <%'商品描述%>
			
			document.getElementById("buylx").value=arrStr[37];     		  <%'买家下单指定方式%>
			
			if(arrStr[37]==0){lxfs.innerHTML="&nbsp;联系方式为任意字符";}
			if(arrStr[37]==1){lxfs.innerHTML="&nbsp;联系方式必须为数字";}
			if(arrStr[37]==2){lxfs.innerHTML="&nbsp;联系方式必须为字母";}
			if(arrStr[37]==3){lxfs.innerHTML="&nbsp;联系方式必须为字母和数字";}
			if(arrStr[37]==4){lxfs.innerHTML="&nbsp;联系方式为数字或字母和下划线";}
			if(arrStr[37]==5){lxfs.innerHTML="&nbsp;联系方式必须为中文";}
			if(arrStr[37]==6){lxfs.innerHTML="&nbsp;联系方式必须为邮箱账号";}
			if(arrStr[37]==7){lxfs.innerHTML="&nbsp;联系方式必须为手机号码";}
			
			<%'检测是否开启购卡密码%>
			if(arrStr[36]==1){is_buypass.style.display = "";document.getElementById("buypasscha").value=1;}
			
			<%'检测支付接口%>
			var ayisbankpay=<%=ayisbankpay%>;
			var ayisalipay=<%=ayisalipay%>;
			var ayistenpay=<%=ayistenpay%>;
			var ayissaopay=<%=ayissaopay%>;
			var ayisqqpay=<%=ayisqqpay%>;
			var ayisjdpay=<%=ayisjdpay%>;
			
			var isjiekou0=<%=isjiekoustr(0)%>;
			var isjiekou1=<%=isjiekoustr(1)%>;
			var isjiekou2=<%=isjiekoustr(2)%>;
			var isjiekou3=<%=isjiekoustr(3)%>;
			var isjiekou4=<%=isjiekoustr(4)%>;
			var isjiekou5=<%=isjiekoustr(5)%>;
			
			
			
			if(ayisbankpay==1 && arrStr[20]==1 && isjiekou0==1){bankzhifu.style.display = "";}else{bankzhifu.style.display = "none";} 	<%'网银支付%>
			if(ayisalipay==1 && arrStr[21]==1 && isjiekou1==1){alipayzhifu.style.display = "";}else{alipayzhifu.style.display = "none";}  <%'支付宝支付%>
			if(ayistenpay==1 && arrStr[22]==1 && isjiekou2==1){tenpayzhifu.style.display = "";}else{tenpayzhifu.style.display = "none";}  <%'财付通支付%>
			if(ayissaopay==1 && arrStr[31]==1 && isjiekou3==1){saozhifu.style.display = "";}else{saozhifu.style.display = "none";} 		<%'微信支付%>
			if(ayisqqpay==1 && arrStr[34]==1 && isjiekou4==1){qqzhifu.style.display = "";}else{qqzhifu.style.display = "none";} 			<%'QQ支付%>
			if(ayisjdpay==1 && arrStr[38]==1 && isjiekou5==1){jdzhifu.style.display = "";}else{jdzhifu.style.display = "none";} 			<%'QQ支付%>
			
			
			<%'######检测是否有独立QQ 普通购买【需要】 VIP【不需要】%>
			if(arrStr[25])
			{
				if(parseInt(arrStr[25])!==0)
				{
				jsqq.innerHTML=arrStr[25];
				sqq.innerHTML=arrStr[25];
				sqq2.innerHTML="<a href=tencent://message/?uin="+arrStr[25]+"&Site="+arrStr[25]+"&Menu=yes title="+arrStr[25]+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>";
				sqqd.innerHTML=arrStr[25];
				sqqd2.innerHTML="<a href=tencent://message/?uin="+arrStr[25]+"&Site="+arrStr[25]+"&Menu=yes title="+arrStr[25]+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>";
				document.getElementById("shanghuqq").value=arrStr[25];
				}
			}else
			{
				var fqq=document.getElementById("fqq").value;
				if(fqq!="")
				{
				jsqq.innerHTML=fqq;
				sqq.innerHTML=fqq;
				sqq2.innerHTML="<a href=tencent://message/?uin="+fqq+"&Site="+fqq+"&Menu=yes title="+fqq+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>";
				sqqd.innerHTML=fqq;
				sqqd2.innerHTML="<a href=tencent://message/?uin="+fqq+"&Site="+fqq+"&Menu=yes title="+fqq+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>";
				document.getElementById("shanghuqq").value=fqq;
				}
				else
				{
				jsqq.innerHTML=<%=shanghuqq%>;
				sqq.innerHTML=<%=shanghuqq%>;
				sqq2.innerHTML="<a href=tencent://message/?uin="+<%=shanghuqq%>+"&Site="+<%=shanghuqq%>+"&Menu=yes title="+<%=shanghuqq%>+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>";
				sqqd.innerHTML=<%=shanghuqq%>;
				sqqd2.innerHTML="<a href=tencent://message/?uin="+<%=shanghuqq%>+"&Site="+<%=shanghuqq%>+"&Menu=yes title="+<%=shanghuqq%>+"><img src=<%=ossurl%>images/kf_qq.gif alt=点击咨询 align=absmiddle></a>";
				document.getElementById("shanghuqq").value=<%=shanghuqq%>;
				}
			}
			
			//document.getElementById("lishi").value=arrStr[19];	
			<%'######检测是否有独立URL 普通购买【需要】 VIP【不需要】%>
			//if(arrStr[33])
			//{
			//surl.innerHTML="<a href="+HTMLEncode(arrStr[33])+" target=_blank>"+HTMLEncode(arrStr[33])+"</a>";	
			//}
			//else
			//{
			//var fu=document.getElementById("fu").value;
			//	if(fu!="")
			//	{
			//	surl.innerHTML="<a href="+HTMLEncode(fu)+" target=_blank>"+HTMLEncode(fu)+"</a>";	
			//	}
			//	else
			//	{
			//	surl.innerHTML="<a href=<%=ayweburl%> target=_blank><%=ayweburl%></a>";
			//	}
			//}
			
			<%'库存卡数量%>
			//document.getElementById("lishi").value=arrStr[19];
			if(arrStr[19]==0)
			{
				if(parseInt(arrStr[29])>9998){kucunka.innerHTML="(库存大于"+arrStr[29]+"张)";}else{kucunka.innerHTML="(库存"+arrStr[29]+"张)";}
			}
			else if(arrStr[19]==1)
			{
				if(arrStr[29]=="0"){kucunka.innerHTML="(无货)";}
				if(parseInt(arrStr[29])>0 && parseInt(arrStr[29])<21){kucunka.innerHTML="(库存紧张)";}
				if(parseInt(arrStr[29])>20 && parseInt(arrStr[29])<51){kucunka.innerHTML="(库存一般)";}
				if(parseInt(arrStr[29])>50){kucunka.innerHTML="(库存充足)";}
			}
				
			<%'是否开启提卡密码%>
			if (arrStr[18]==1){is_tikapass.style.display = "";document.getElementById("tikacha").value=1;}else{is_tikapass.style.display = "none";document.getElementById("tikacha").value=0;}
				
			<%'是否使用优惠券%>
			if (arrStr[15]==1){goodCoupon.style.display = "";}else{goodCoupon.style.display = "none";}
			
			<%'批发优惠 而不限购%>
			if (arrStr[14]==0 && arrStr[3]==1)   
			{
			pifayouhui.style.display = "";
			//document.getElementById("lishi").value=arrStr[14]+"|"+arrStr[3];
				if (parseInt(arrStr[4])>0)  <%'批发数量1%>
				{
				pifashow1.style.display = "";pifa1.innerHTML=arrStr[4];pifaj1.innerHTML=parseFloat(arrStr[9]).toFixed(2);
				document.getElementById("pi1").value=arrStr[4];
				document.getElementById("pi2").value=arrStr[4];
				document.getElementById("pi3").value=arrStr[4];
				document.getElementById("pi4").value=arrStr[4];
				document.getElementById("pi5").value=arrStr[4];	
				document.getElementById("pij1").value=parseFloat(arrStr[9]).toFixed(2);
				document.getElementById("pij2").value=parseFloat(arrStr[9]).toFixed(2);
				document.getElementById("pij3").value=parseFloat(arrStr[9]).toFixed(2);
				document.getElementById("pij4").value=parseFloat(arrStr[9]).toFixed(2);
				document.getElementById("pij5").value=parseFloat(arrStr[9]).toFixed(2);
				}
				if (parseInt(arrStr[5])>0)  <%'批发数量2%>
				{
				pifashow2.style.display = "";pifa2.innerHTML=arrStr[5];pifaj2.innerHTML=parseFloat(arrStr[10]).toFixed(2);
				document.getElementById("pi2").value=arrStr[5];
				document.getElementById("pi3").value=arrStr[5];
				document.getElementById("pi4").value=arrStr[5];
				document.getElementById("pi5").value=arrStr[5];
				document.getElementById("pij2").value=parseFloat(arrStr[10]).toFixed(2);
				document.getElementById("pij3").value=parseFloat(arrStr[10]).toFixed(2);
				document.getElementById("pij4").value=parseFloat(arrStr[10]).toFixed(10);
				document.getElementById("pij5").value=parseFloat(arrStr[10]).toFixed(2);
				}
				if (parseInt(arrStr[6])>0)   <%'批发数量3%>
				{
				pifashow3.style.display = "";pifa3.innerHTML=arrStr[6];pifaj3.innerHTML=parseFloat(arrStr[11]).toFixed(2);
				document.getElementById("pi3").value=arrStr[6];
				document.getElementById("pi4").value=arrStr[6];
				document.getElementById("pi5").value=arrStr[6];
				document.getElementById("pij3").value=parseFloat(arrStr[11]).toFixed(2);
				document.getElementById("pij4").value=parseFloat(arrStr[11]).toFixed(2);
				document.getElementById("pij5").value=parseFloat(arrStr[11]).toFixed(2);
				}
				if (parseInt(arrStr[7])>0)   <%'批发数量4%>
				{
				pifashow4.style.display = "";pifa4.innerHTML=arrStr[7];pifaj4.innerHTML=parseFloat(arrStr[12]).toFixed(2);
				document.getElementById("pi4").value=arrStr[7];
				document.getElementById("pi5").value=arrStr[7];
				document.getElementById("pij4").value=parseFloat(arrStr[12]).toFixed(2);
				document.getElementById("pij5").value=parseFloat(arrStr[12]).toFixed(2);
				}
				if (parseInt(arrStr[8])>0)  <%'批发数量5%>
				{
				pifashow5.style.display = "";pifa5.innerHTML=arrStr[8];pifaj5.innerHTML=parseFloat(arrStr[13]).toFixed(2);
				document.getElementById("pi5").value=arrStr[8];	
				document.getElementById("pij5").value=parseFloat(arrStr[13]).toFixed(2);
				}
			}


			<%'限购%>
			if (parseInt(arrStr[14])>0){limit_quantity_tip.style.display = "";document.getElementById("quantity").value=arrStr[14];return jisuan();}
	   }
	   //else{alert("获取失败e2");return false;}
	}
xmlhttp.send(null); 
//return false;
}  

<%'检测输入的购买数量%>
function upperCase(zhi){
var goodyj=document.getElementById("goodyj").value; 


	if(zhi != null || zhi != '')
	{

		if(!CheckIfid(zhi))
		{
		document.getElementById("quantity").value="1";
		price.innerHTML = parseFloat(goodyj).toFixed(2);
		tprice.innerHTML=parseFloat(goodyj).toFixed(2);
		document.getElementById("goodzongjia").value=goodyj;
		alert("购买数量输入有误！");
		return jisuan();
		return false;
		}
		   
		if(zhi=='0')
		{
		document.getElementById("quantity").value="1";
		price.innerHTML = parseFloat(goodyj).toFixed(2);
		tprice.innerHTML=parseFloat(goodyj).toFixed(2);
		document.getElementById("goodzongjia").value=goodyj;
		alert('购买数量范围有误！');
		return jisuan();
		return false;
		}
		
		if(zhi<=0 || zhi>9999)
		{
		document.getElementById("quantity").value="1";
		price.innerHTML = parseFloat(goodyj).toFixed(2);
		tprice.innerHTML=parseFloat(goodyj).toFixed(2);
		document.getElementById("goodzongjia").value=goodyj;
		alert('购买数量范围有误！！');
		return jisuan();
		return false;
		}
		
	
		<%'批发优惠 而不限购%>
		if (arrStr[14]==0 && arrStr[3]==1)  
		{
		var quantity=document.getElementById("quantity").value;   <%'数量%>
		document.getElementById("danjia").value=arrStr[0];        <%'初始化单价%>
		price.innerHTML=parseFloat(arrStr[0]).toFixed(2);         <%'初始化单价%>
		
			if (parseInt(quantity)>=parseInt(document.getElementById("pi1").value) && parseInt(quantity)<parseInt(document.getElementById("pi2").value))
			{document.getElementById("danjia").value=document.getElementById("pij1").value;price.innerHTML=document.getElementById("pij1").value;}
			if (parseInt(quantity)>=parseInt(document.getElementById("pi2").value) && parseInt(quantity)<parseInt(document.getElementById("pi3").value))
			{document.getElementById("danjia").value=document.getElementById("pij2").value;price.innerHTML=document.getElementById("pij2").value;}
			if (parseInt(quantity)>=parseInt(document.getElementById("pi3").value) && parseInt(quantity)<parseInt(document.getElementById("pi4").value))
			{document.getElementById("danjia").value=document.getElementById("pij3").value;price.innerHTML=document.getElementById("pij3").value;}
			if (parseInt(quantity)>=parseInt(document.getElementById("pi4").value) && parseInt(quantity)<parseInt(document.getElementById("pi5").value))
			{document.getElementById("danjia").value=document.getElementById("pij4").value;price.innerHTML=document.getElementById("pij4").value;}
			if (parseInt(quantity)>=parseInt(document.getElementById("pi5").value))
			{document.getElementById("danjia").value=document.getElementById("pij5").value;price.innerHTML=document.getElementById("pij5").value;}
		}
		return jisuan();
	}
	else
	{
	price.innerHTML = parseFloat('0').toFixed(2);
	tprice.innerHTML=parseFloat('0').toFixed(2);
	document.getElementById("goodzongjia").value='0';
	}
	
}

<%'点卡参数%>
function showdklboff(str)
{
document.getElementById("wangyinzhi").value=str;
//return jisuan();
}

<%'导航切换%>
function g(o){return document.getElementById (o);}
function cmne(n) 
{
document.getElementById("wangyinzhi").value="";
var zt = document.getElementsByName("pid");for(var i=0;i<zt.length;i++){if(zt[i].checked)	{zt[i].checked = false;}}
	if(n!=3){
	
	}else{
	pinfo1.style.display = "none";
	pinfo2.style.display = "";
	}
for(var i=1;i<=4;i++){if (g('menune_'+i)){g('menune_'+i).className='';g('contxi_'+i).style.display='none';}}
var e=g('menune_'+n);
e.className='selected';
g('contxi_'+n).style.display='';
return jisuan();
}


<%'价格计算%>
function jisuan(){
var quantity=document.getElementById("quantity").value;           <%'数量%>
var danjia=document.getElementById("danjia").value;               <%'单价%>
var youhuiquanzhi=document.getElementById("youhuiquanzhi").value; <%'优惠券值%>
var a=quantity*danjia;  


		<%'计算优惠券%>
		if(youhuiquanzhi!="")
		{    
		yarrStr=youhuiquanzhi.split("|");
			if(yarrStr.length==2){var zhekou=yarrStr[0]/100;var zhzj=a-(a*zhekou);var a=zhzj;}
			if(yarrStr.length==1){var zhzj=a-yarrStr[0];var a=zhzj;}
		}


if(form1.istelka.checked == true)
{
a=a+0.1;
}

if(a<0){a=0;}
tprice.innerHTML = parseFloat(a).toFixed(2); 
document.getElementById("goodzongjia").value=parseFloat(a).toFixed(2);
}


<%'检测提交表单%>
function check_add()
{
if('<%=isbuylog%>' == '1' && '<%=isbuymailog%>'=='no'){$('#logclub').show();$('#bg123').show();return false;}
	
<%'#######协议 普通购买【需要】 VIP【不需要】%>
if(form1.isagree.checked == false){alert("请阅读并勾选合作协议");return false;}
//if(form1.istelka.checked == false){alert("为方便提取卡密，请勾选短信接收卡密！");return false;}

if(form1.feilei.value=="0"){alert("请选择商品分类");return false}
if(form1.shangid.value=="0"){alert("请选择商品");return false}

if(form1.contact.value==""){alert("请填写联系方式，以便查询订单使用");return false;}
if(form1.contact.value.length<6){alert("联系方式不能少于6位");return false;}
if((form1.contact.value=="123456")||(form1.contact.value=="000000")||(form1.contact.value=="0000000")||(form1.contact.value=="888888")||(form1.contact.value=="112233")||(form1.contact.value=="111111")){alert("联系方式过于简单，请重新填写");return false;}



if(form1.buylx.value==1)//只能数字
{
var shuzi = /^[-]{0,1}[0-9]{1,}$/; 
if(shuzi.test(form1.contact.value)==false){alert("联系方式必须为数字");return false;}
}
if(form1.buylx.value==2)//只能字母
{
var zimu= /^[A-Za-z]+$/;
if(zimu.test(form1.contact.value)==false){alert("联系方式必须为字母");return false;}
}
if(form1.buylx.value==3)//只能数字和字母
{
var shuzizimu = /^(?!\D+$)(?![^a-zA-Z]+$)/;  
if(shuzizimu.test(form1.contact.value)==false){alert("联系方式必须为数字和字母");return false;}
if (/[\u4E00-\u9FA5]/i.test(form1.contact.value)){alert("联系方式禁止输入中文");return false;}
}
if(form1.buylx.value==4)//数字或字母 下划线
{
var shuzizimux = /^[0-9a-zA-Z]*_+$/;
if(shuzizimux.test(form1.contact.value)==false){alert("联系方式为数字或字母和下划线，禁止中文");return false;}
}
if(form1.buylx.value==5)//必须为中文
{
if (/[\u4E00-\u9FA5]/i.test(form1.contact.value)==false){alert("联系方式必须为中文");return false;}
}
if(form1.buylx.value==6)//必须为邮箱
{
var jc_mail = /^[-_A-Za-z0-9]+@([_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/;
if(jc_mail.test(form1.contact.value)==false){alert("联系方式需填写正确邮箱");return false;}
}
if(form1.buylx.value==7)//必须为手机
{
var tel =/^[1][3-9][0-9]{9}$/; 
if (tel.test(form1.contact.value)==false){alert("联系方式必须为正确手机号码");return false;}
}

if(form1.istelka.checked == true)
{
var tel =/^[1][3-9][0-9]{9}$/; 
if (tel.test(form1.contact.value)==false){alert("勾选短信接收卡密,联系方式请填写手机号码");return false;}
}

if(form1.tikacha.value=="1"){if(form1.tikapass.value==""){alert("请添加提卡密码");return false;}else{if((form1.tikapass.value.length<3)||(form1.tikapass.value.length>10)){alert("提卡密码长度3-10字符");return false;}}}
var shuliang = /^[-]{0,1}[0-9]{1,}$/; 
if(form1.quantity.value>9999){alert("购买数量过多");return false;}
if(shuliang.test(form1.quantity.value)==false){alert("购买数量填写有误");return false;}
if(parseInt(form1.quantity.value)>parseInt(form1.jc_s.value)){alert("库存不足，请联系商户加卡");return false;}
if(form1.jc_xiangou.value!=0){if(parseInt(form1.quantity.value)<parseInt(form1.jc_xiangou.value)){alert("商品设置了限购数量,购买数量不能少于"+form1.jc_xiangou.value+"张");return false;}}
if(form1.buypasscha.value==1){if(form1.bugpass.value==""){alert("请正确填写购卡密码");return false;}}

if(document.form1.wangyinzhi.value==""){alert("请选择一种支付方式");return false;}
   
//document.form1.tijiao.setAttribute("class", "newlogin2");
//document.form1.tijiao.disabled="disabled";

$(".newlogin").attr("disabled",true);
$(".newlogin").addClass('newlogin2');
//tijiaocon.innerHTML="提交中，请稍等···";
}
</script>

<div id="container">
<!--页头-->
    <div id="header">
	<div class="logo"><A href="<%=weburl%>"><IMG src="<%=ossurl%>Template/Template4/logo/logo.png" alt="<%=webname%>" title="<%=webname%>"></A></div>
	<div class="bottom_shadow"></div>
    </div>
<!--页头END-->

<!--查询订单-->
	<div id="main">
	    <div id="buy_top">
		    <div id="buy_top_title">您目前订购的商家信息</div>
			<div id="search">
			<%if request.Cookies("aynameid")<>"" then%>
            已登录账号：<a href="/u/index"><%=request.Cookies("aytrueuser")%></a>  <a href="/index/exit">[退出]</a>&nbsp;&nbsp;
            <%else%>
            <input name="submit" type="button" class="submit" value=" 买家登录 " onClick="openlog()" style="cursor:pointer" />
            <%end if%>
			<input name="submit" type="button" class="submit" value=" 订单查询 " onClick="javascript:window.location.href='/chaxun'" style="cursor:pointer" />
            <input name="ts" type="button" class="submit" id="ts" value=" 订单投诉 "  onClick="javascript:window.location.href='/tousu'" style="cursor:pointer" />
			</div>  
		</div>
<!--查询订单END-->
		
	<form action="/shop/newp" method="post" name="form1" target="_self" id="form1" onSubmit="return check_add()">
	<div class="buyinfo">
		<table id="buy_info"><tbody>
			<tr>
			    <td width="500">
                商家名称： <%=aywebname%> <a style="color:#F00" href="/index/weiguijubao?id=<%=thispcurl%>">【违法举报】</a>
                <div style="width:1px; height:1px; background-image:url(<%=ossurl%>Template/Template4/images/button2.png)"></div>
                </td>
				<td width="500">
				商家信誉：<%
				if ccur(aychengjiao)=0 then 
				response.Write("未成交过")
				else
				if ccur(aychengjiao)>0 and ccur(aychengjiao)<11 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/11.gif title='成交1-10笔' align='absmiddle'>"
				if ccur(aychengjiao)>10 and ccur(aychengjiao)<41 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/12.gif title='成交11-40笔' align='absmiddle'>"
				if ccur(aychengjiao)>40 and ccur(aychengjiao)<91 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/13.gif title='成交41-90笔' align='absmiddle'>"
				if ccur(aychengjiao)>90 and ccur(aychengjiao)<151 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/14.gif title='成交91-150笔' align='absmiddle'>"
				if ccur(aychengjiao)>150 and ccur(aychengjiao)<251 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/15.gif title='成交151-250笔' align='absmiddle'>"
				if ccur(aychengjiao)>250 and ccur(aychengjiao)<501 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/21.gif title='成交251-500笔' align='absmiddle'>"
				if ccur(aychengjiao)>500 and ccur(aychengjiao)<1001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/22.gif title='成交501-1000笔' align='absmiddle'>"
				if ccur(aychengjiao)>1000 and ccur(aychengjiao)<2001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/23.gif title='成交1001-2000笔' align='absmiddle'>"
				if ccur(aychengjiao)>2000 and ccur(aychengjiao)<5001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/24.gif title='成交2001-5000笔' align='absmiddle'>"
				if ccur(aychengjiao)>5000 and ccur(aychengjiao)<10001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/25.gif title='成交5001-10000笔' align='absmiddle'>"
				if ccur(aychengjiao)>10000 and ccur(aychengjiao)<20001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/31.gif title='成交10001-20000笔' align='absmiddle'>"
				if ccur(aychengjiao)>20000 and ccur(aychengjiao)<50001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/32.gif title='成交20001-50000笔' align='absmiddle'>"
				if ccur(aychengjiao)>50000 and ccur(aychengjiao)<100001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/33.gif title='成交50001-100000笔' align='absmiddle'>"
				if ccur(aychengjiao)>100000 and ccur(aychengjiao)<200001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/34.gif title='成交100001-200000笔' align='absmiddle'>"
				if ccur(aychengjiao)>200000 and ccur(aychengjiao)<500001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/35.gif title='成交200001-500000笔' align='absmiddle'>"
				if ccur(aychengjiao)>500000 and ccur(aychengjiao)<1000001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/41.gif title='成交500001-1000000笔' align='absmiddle'>"
				if ccur(aychengjiao)>1000000 and ccur(aychengjiao)<2000001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/42.gif title='成交1000001-2000000笔' align='absmiddle'>"
				if ccur(aychengjiao)>2000000 and ccur(aychengjiao)<5000001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/43.gif title='成交2000001-5000000笔' align='absmiddle'>"
				if ccur(aychengjiao)>5000000 and ccur(aychengjiao)<10000001 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/44.gif title='成交5000001-10000000笔' align='absmiddle'>"
				if ccur(aychengjiao)>10000000 then response.Write "<img src="&ossurl&"Template/Template4/gou/cup/45.gif title='成交10000000笔以上' align='absmiddle'>"
				end if%> <span class="gray">(<%=aydata%>注册至今活跃<%=DateDiff("d",aydata,now())%>天)</span>
                </td>
			</tr>
		    <tr>
			    <td width="500">
商家ＱＱ：<span id="sqq"><%=shanghuqq%> </span>
<%if Ubound(split(request.serverVariables("HTTP_USER_AGENT"),"IE"))>0 then%>
<a href="tencent://message/?uin=<%=shanghuqq%>&Site=<%=shanghuqq%>&Menu=yes" title="<%=shanghuqq%>"><img src="<%=ossurl%>images/kf_qq.gif" alt="点击咨询" align="absmiddle"></a>
<span id="sqq2" style="display:none"></span>
<%else%>
<div style=" float:right;padding-top:2px; padding-right:146px; width:130px;">
<span id="sqq2"><a href="tencent://message/?uin=<%=shanghuqq%>&Site=<%=shanghuqq%>&Menu=yes" title="<%=shanghuqq%>"><img src="<%=ossurl%>images/kf_qq.gif" alt="点击咨询" align="absmiddle"></a></span>
</div>
<%end if%>
                
				</td>
				<td width="500">
			    VIP商家：
				<%if cint(ayisxiaobao)=0 then %>
				<span class="STYLE9">非平台VIP商家！</span>
				<%elseif cint(ayisxiaobao)=1 then%>
				<img src="<%=ossurl%>images/renzheng/vip1.jpg" width="27" height="20" align="absmiddle">
				<span class="STYLE9">平台VIP商家！</span>
				<%end if%> 
                </td>
			</tr>
		    <tr>
		      	<td>
				商家微信：<%=ayweixinid%>
                <%if showweixinerweima<>"" then%>
                &nbsp;&nbsp;<a onMouseOver="weixinid.style.display='';" onMouseOut="weixinid.style.display='none';"  style="cursor:pointer;color:#39F">[扫一扫 添加微信好友]</a>
                <%end if%>
				</td>
				<td width="500">商家认证：

				<%if cint(istelrz)=1 then%>
				<img src="<%=ossurl%>images/renzheng/rztel.jpg" alt="已认证" width="22" height="22" style="padding-bottom:3px;" title="电话已认证" align="absmiddle"/>
				<%else%>
				<img src="<%=ossurl%>images/renzheng/rztelh.jpg" alt="未认证" width="22" height="22" style="padding-bottom:3px;" border="0" title="电话未认证" align="absmiddle"/>
				<%end if%>
				<%if cint(ischengxin)=1 then%>
				<img src="<%=ossurl%>images/kexin.gif" alt="可信商家" height="23" style="padding-bottom:2px;" title="可信商家 订单交易累计超过30笔 不含虚假/无效卡密 未收到投诉或举报" align="absmiddle"/>
				<%else%>
				<img src="<%=ossurl%>images/kexin2.gif" alt="非可信商家" height="23" style="padding-bottom:2px;" border="0" title="暂未达到可信商家标准 再接再厉！" align="absmiddle"/>
				<%end if%>

				</td>
		    </tr>
			<tr>
			  <td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0">
			    <tr>
			      <td width="70">商家公告：</td>
				  <%if isnull(trim(ayusermiaoshu))=true or trim(ayusermiaoshu)="" then ayusermiaoshu="-"%>
			      <td><span class="gray"><%=server.HTMLEncode(trim(ayusermiaoshu))%></span></td>
			      </tr>
		      </table></td>
		    </tr>
			<tr>
			    <td colspan="2">发货类型：
				<span><img src="<%=ossurl%>Template/Template4/images/ico_1.gif" align="absmiddle" title="自动发货">&nbsp;
				<strong style="color:#74ad15;">自动发货</strong>
				<span style="font-size:12px;">（订单支付成功后，即可在网页上获得卡密，也可通过<a style="color:#59aa15"  href="<%=weburl%>chaxun" target="_blank">【订单查询】</a>获取卡密信息）</span>
				</span>
				</td>
			</tr>
			<tr>
			    <td colspan="2">
				<input type="checkbox" name="isagree" id="isagree" value="true" checked=""> 
                <span class="agreed" onClick=agreed()>同意接受 <a href="#shengming"><%=webname%>《免责声明》</a></span>
				</td>
			</tr>
		</tbody></table>
      </div>

	<div class="step stp1">请选择购买的商品 
    <%if iswap="yes" and cint(iswappay)=1 then%>
    <span style="padding-left:600px; color:#FFF;"><span style="cursor:pointer;" onMouseOver="Layer1.style.display='';" onMouseOut="Layer1.style.display='none';"><img src="<%=ossurl%>Template/Template4/images/telsao.gif" align="absmiddle">扫一扫 手机支付</span></span>
    <%end if%>
    </div>
	<div id="step_one">
<%if iswap="yes" and cint(iswappay)=1 then%>
<div id="Layer1" style="display:none; padding-left:700px;position:absolute;"><div id="qrcode"></div></div> 
<script type="text/javascript">var qrcode = new QRCode(document.getElementById("qrcode"), {width:198,height:198});qrcode.makeCode("<%=wapurl%>");</script>
<%end if%>
	<ul>
<!--商品分类-->
	<li><span class="red">*</span> 商品分类：
	<%if trim(isduliurl)="y" then
	
		rs.open "select aykanamesuoyou,aykafenleiid,aykafenleikg,aykafenleiname,ayfldlmd5url,iszhuxiao from aykafenlei where aykafenleiid='"&clng(fid)&"' and aykanamesuoyou="&clng(uid)&" and aykafenleikg=0 and iszhuxiao=0",conn,1,1
		if rs.bof and rs.eof then call PopErr2("未找到商品分类,请联系商户!错误代码ERR_G05A",weburl&"index.html")
		response.Write trim(rs("aykafenleiname"))%> <span id="fenlei_miaoshu" class="gray"></span>
		<input type="hidden" name="feilei" id="feilei" value="<%=trim(rs("ayfldlmd5url"))%>"/>
		<%rs.close%>
		
	<%else%>
	<select name="feilei" id="feilei" onChange="fenlei(this.value,' ');">
	<option value="0">选择商品分类</option>
	<%
rs.open "select aykanamesuoyou,aykafenleikg,ayshangjiid,aykafenleisx,aykafenleimd5,aykafenleiid,aykafenleiname,iszhuxiao from aykafenlei where aykanamesuoyou="&clng(uid)&" and aykafenleikg=0 and ayshangjiid=0 and  iszhuxiao=0 order by aykafenleisx asc",conn,1,1
	if rs.bof and rs.eof then call PopErr2("未找到商品分类,请联系商户!错误代码ERR_G05B",weburl&"index.html")
	do while not rs.eof%>
	<option value="<%if ismd5="yes" then:response.Write trim(rs("aykafenleimd5")):else:response.Write rs("aykafenleiid"):end if%>"<%if clng(fid)=clng(rs("aykafenleiid")) then response.Write" selected"%>><%=trim(rs("aykafenleiname"))%></option>
		<%'二级商品分类
		rserji.open "select aykanamesuoyou,aykafenleikg,ayshangjiid,aykafenleisx,aykafenleimd5,aykafenleiid,aykafenleiname,iszhuxiao from aykafenlei where ayshangjiid="&rs("aykafenleiid")&" and aykanamesuoyou="&clng(uid)&" and aykafenleikg=0 and iszhuxiao=0 order by aykafenleisx asc",conn,1,1
		if not(rserji.bof and rserji.eof) then
		do while not rserji.eof%>
		<option value="<%if ismd5="yes" then:response.Write trim(rserji("aykafenleimd5")):else:response.Write rserji("aykafenleiid"):end if%>"<%if clng(fid)=clng(rserji("aykafenleiid")) then response.Write" selected" %>>&nbsp;&nbsp;┕<%=trim(rserji("aykafenleiname"))%></option>
		<%
		rserji.movenext 
		loop
		end if
		rserji.close
	rs.movenext 
	loop
	rs.close
	%>
	</select>
	<span id="fenlei_miaoshu" class="gray"></span>
	
	<%end if%>	
	</li>
<!--商品名称-->
	<li><span class="red">*</span> 商品名称：
	<span id="loading" style="display: none;"><img src="<%=ossurl%>Template/Template4/images/load.gif"> 加载中...</span>
	<span id="shangpin"><select name="select"><option value="0">请选择商品</option></select></span>	<span id="good_miaoshu" class="gray"></span></li>
<!--商品价格-->		
	<li><span class="red">*</span> 商品价格：
	<span id="loadingj" style="display: none;"><img src="<%=ossurl%>Template/Template4/images/load.gif"> 加载中...</span>
	<strong class="red" id="price">0.00</strong> 元	</li>
<!--购买数量-->	
	<li><span class="red">*</span> 购买数量：
	<input type="text" class="input" onKeyUp="upperCase(this.value)" onBlur="upperCase(this.value)" name="quantity" id="quantity" value="1" style="width:100px;">
	<input type="hidden" name="jc_xiangou" id="jc_xiangou" value="0"/><span id="kucunka" class="gray"></span> 
	<span id="limit_quantity_tip" class="gray" style="display:none">本商品限制了最少购买数量，购买数量必须等于或大于此数值</span>
	<span id="pifayouhui" class="gray" style="display:none">单价优惠：
	<span id="pifashow1">≥<span id="pifa1"></span>张<span id="pifaj1"></span>元</span>
	<span id="pifashow2">≥<span id="pifa2"></span>张<span id="pifaj2"></span>元</span>
	<span id="pifashow3">≥<span id="pifa3"></span>张<span id="pifaj3"></span>元</span>
	<span id="pifashow4">≥<span id="pifa4"></span>张<span id="pifaj4"></span>元</span>
	<span id="pifashow5">≥<span id="pifa5"></span>张<span id="pifaj5"></span>元</span></span>	</li>
<!--联系方式-->	
	<li><span class="red">*</span> 联系方式： 
	<input type="text" class="input" name="contact" style="width:130px" value="<%if trim(maitel)<>"" then response.Write maitel%>"> <!--  onBlur="return checklx(this.value);"  -->
	<span style="font-size:13px;color:#828282;" id="lxfs">&nbsp;请填写联系方式</span>	
    <span style="font-size:13px;color:#F00;padding-left:5px;">联系方式是订单查询重要凭证</span>
    </li>
    
<!--取卡密码-->	
	<input name="tikacha" type="hidden" id="tikacha" value="0" />
	<li style="height:22px;line-height:22px;display:none" id="is_tikapass"><span class="red">*</span> 取卡密码： 
	<input name="tikapass" type="text" class="input" id="tikapass" style="width:130px"> 
	<span style="font-size:13px;color:#828282;">&nbsp;请设置一个提卡密码，在提取卡密时 需要正确输入密码, 请不要与联系方式相同</span></li>
<!--购买密码-->	
	<input name="buypasscha" type="hidden" id="buypasscha" value="0" />
	<li style="height:22px;line-height:22px;display:none" id="is_buypass"><span class="red">*</span> 购卡密码： 
	<input name="bugpass" type="text" class="input" id="bugpass" style="width:130px" maxlength="15"> 
	<span style="font-size:13px;color:#828282;">&nbsp;商家对商品设置了一个购卡密码，只有输入正确才可以购买</span></li>
<!--优惠券-->	
	<li style="margin:0;display:none" id="goodCoupon"><span style="color:#FFF">*</span> <input type="checkbox" name="isyouhui" value="1" id="isyouhui" onClick="is_youhui()">
	<label for="isyouhui" onClick="isyouhui()" style="cursor:pointer">是否使用优惠券。</label> 
	<span id="youhuiquancon" style="display:none">请输入优惠券：<input type="text" name="youhuiquan"  id="youhuiquan" class="input" style="width:260px;" onBlur="ckyouhuiquan()"></span> 
	<span id="checkcoupon" style="display:none"><img src="<%=ossurl%>Template/Template4/images/load.gif"> 正在查询...</span>	
    </li>
    
	<li><span style="color:#FFF">*</span> <input name="istelka" type="checkbox" id="istelka" value="yes" onClick="jisuan()" /> 短信接收卡密(0.1元，联系方式请填写手机号)
    <%if isgzhtika="yes" then%>
    <span style="font-size:13px;color:#06C;">【<span id="hqopenid"><a style="color:#06C;cursor:pointer" onClick="huoquopenid()">还可以使用微信接收卡密</a></span>】</span>
    <%end if%>
    </li>
    
	</ul>
	</div>
<!--相关参数-->
	<input type="hidden" name="act" id="buy" value="buy"/> 
	<input type="hidden" name="ismd5" id="ismd5" value=<%if ismd5="yes" then response.Write("yes"):else:response.Write("no"):end if%> />
	<input type="hidden" name="jc_s" id="jc_s"/>      								<%'库存数量%>
	<input type="hidden" name="fqq" id="fqq"/> 
	<input type="hidden" name="fu" id="fu"/> 
	<input type="hidden" name="pi1" id="pi1"/> 
	<input type="hidden" name="pij1" id="pij1"/> 
	<input type="hidden" name="pi2" id="pi2"/> 
	<input type="hidden" name="pij2" id="pij2"/>
	<input type="hidden" name="pi3" id="pi3"/> 
	<input type="hidden" name="pij3" id="pij3"/>
	<input type="hidden" name="pi4" id="pi4"/> 
	<input type="hidden" name="pij4" id="pij4"/>
	<input type="hidden" name="pi5" id="pi5"/> 
	<input type="hidden" name="pij5" id="pij5"/>
	<input type="hidden" name="fid" id="fid" value="" /> 						 	<%'分类ID%>
	<input type="hidden" name="sid" id="sid" value="" />  						 	<%'商品ID%>
	<input type="hidden" name="goodyj" id="goodyj" value=""/>     				 	<%'原 单价%>
	<input type="hidden" name="goodzongjia" id="goodzongjia" value="" />  			<%'总价%>
	<input type="hidden" name="danjia" id="danjia" value="" />    				 	<%'单价%>
	<input type="hidden" name="gooduserid" id="gooduserid" value=""/>      		 	<%'商品所属会员ID%>
	<input type="hidden" name="buyuser" value="<%=request.Cookies("aynameid")%>"/>  <%'买家ID%> 
	<input type="hidden" name="isgoodurl" id="isgoodurl" value="<%=isgoodurl%>"/>   <%'独立链接%>
	<input type="hidden" name="shanghuqq" id="shanghuqq" value="<%=shanghuqq%>"/>   <%'商户qq%>
	<input type="hidden" name="youhuiquanzhi" id="youhuiquanzhi" value="" /> 		<%'优惠券值%>





	<input type="hidden" name="wangyinzhi" id="wangyinzhi" value="" />     			<%'网银值  1支付宝网银 2财付通网银 3易宝网银 ALIPAY  TENPAY  99余额%>
	<input type="hidden" name="buyuseryuekou" id="buyuseryuekou" value=""/>    		<%'应扣除账户金额%>
	<input type="hidden" name="buyyue" id="buyyue" value=""/> 
	<input type="hidden" name="isfan" id="isfan" value="<%=isfan%>"/> 
	<input type="hidden" name="buylx" id="buylx" value="" />
<!--金额提示-->
		<div id="payinfo">
		<div class="pinfo1" id="pinfo1" style="">请选择最佳支付方式购买</div>
		<div class="pinfo2" id="pinfo2" style="display: none;">应付金额：<span class="red tprice" id="tprice">0.0</span>元<span class="bt">RMB</span></div>
		<div style="clear:both"></div>
		</div>
		
<!--详细说明  overflow: hidden;   -->
		<div id="goodxx" style="display:none">
		<div id="payinfox" style="border:1px solid #FF6B04;padding:6px 30px;margin:10px 0;overflow: scroll;">
		 
		<strong>详细说明：</strong><br><span id="goodxxcon"></span>
		
		<div style="clear:both"></div>
		</div>
		</div>

<div class="step stp2">请选择付款方式</div> 
<!--三方支付-->
<div id="step_two2">
	<ul id="select_pay"><li id=menune_22 class="selected"><img src="<%=ossurl%>images/pay/bank.gif" align="absmiddle">第三方支付</li></ul>
	<div class="paylist">
 				<ul>
                   <li id="alipayzhifu" onClick=showdklboff("ALIPAY")><input name="pid" type="radio" value="ALIPAY"> <img src="<%=ossurl%>images/pay/ALIPAY.gif" alt="支付宝支付" align="absmiddle"></li>
				   <li id="saozhifu" onClick=showdklboff("WEIXIN")><input name="pid" type="radio" value="WEIXIN"> <img src="<%=ossurl%>images/pay/<%=wxbiao%>" alt="微信支付" align="absmiddle"></li>
				   <li id="tenpayzhifu" onClick=showdklboff("TENPAY")><input name="pid" type="radio" value="TENPAY"> <img src="<%=ossurl%>images/pay/TENPAY.gif" alt="财付通支付" align="absmiddle"></li>
				   <li id="qqzhifu" onClick=showdklboff("QQPAY")><input name="pid" type="radio" value="QQPAY"> <img src="<%=ossurl%>images/pay/QQPAY.gif" alt="QQ钱包支付" align="absmiddle"></li>
				   <li id="jdzhifu" onClick=showdklboff("JDPAY")><input name="pid" type="radio" value="JDPAY"> <img src="<%=ossurl%>images/pay/JDPAY.gif" alt="京东钱包支付" align="absmiddle"></li>
                </ul>
	 <div style="clear:left"></div>
	 </div>
</div>
<!--其他支付方式-->
<div id="step_two">
<!--其他支付方式选择-->
	<ul id="select_pay">
		<li id=menune_2 class="selected"><label onClick=cmne(2) style="cursor:pointer"><img src="<%=ossurl%>images/pay/bank.gif" align="absmiddle">网银支付</label></li>
	</ul>
<!--网银支付-->
	<div class="paylist">
	    <div id=contxi_2>
			<ul>
			<div id="bankzhifu">
			<%if cint(aybankpay)=1 then '支付宝网银 
			call alipaybank()
			elseif cint(aybankpay)=2 then '财付通网银 
			call tenpaybank()
			elseif cint(aybankpay)=3 then '易宝网银 
			call yeepaybank()
			elseif cint(aybankpay)=4 then '盛付通网银 
			call sftbank()
			elseif cint(aybankpay)=5 then '国付宝网银 
			call gfbbank()
			elseif cint(aybankpay)=6 then '聚合网银 
			call juhebank()
			end if%>
            <%if cint(aybankpay)=5 then%>
            <br><br><br><br><br><br><br><br><br><br><br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="isxinyongka" id="isxinyongka" value="1"> 信用卡支付
            <%end if%>
			</div>
			</ul>
	    <div style="clear:left"></div>
	    </div>


	</div>
</div>

<!--免责声明-->
			<div id="protect">
				<strong>免责声明:</strong>
				<ul>
				<li>本平台仅提供自动发卡服务。本平台不是商品销售商，有关商品售后服务等问题均属于商家服务范畴，与本平台无关！</li>
				<li>在使用本平台进行支付之前，请认真阅读<a onClick=agreed() href="#shengming">《<%=webname%>免责声明》</a>，在操作过程中请仔细按提示与步骤进行，否则造成充值卡报废损失自负！</li>
                <li>在购买前务必先联系商家，确认商品可以正常使用，或了解如何使用！商家联系QQ：<span id="sqqd"><%=shanghuqq%> </span>
                <span id="sqqd2"><a href="tencent://message/?uin=<%=shanghuqq%>&Site=<%=shanghuqq%>&Menu=yes" title="联系商家"><img src="<%=ossurl%>images/kf_qq.gif" alt="联系商家" align="absmiddle"></a></span></li>
				<li>如果您在支付过程中遇到虚假商品或取卡问题，请点击联系我们平台客服</li>
				<li style="color:#F30">注意：订单投诉时效为24小时，付款后出现任何问题请在24小时内进行投诉，超过24小时的订单将不再受理投诉问题！</li>
				</ul>
	 		 </div>
<!--支付协议-->
			<div id="protect2" style="display: none;background:url(<%=ossurl%>images/statement.png) no-repeat scroll 24px 50% #fff6d6; border:1px solid #ff6b04; font-size:12px; margin-top:10px; padding:15px 0 15px 40px;">
                <strong><%=webname%>免责声明：</strong>
				<a name="shengming" id="shengming"></a>
				<ul>
				<li>一、本平台服务范围仅限为商家提供商品寄售、为买家提供多途径在线支付和自动发卡的便捷服务，该项服务适用于您对售卡商家及商品有充分了解和信任的小额交易。</li>
				<li>二、本平台支付服务交易方式为非担保性质的交易，有关商品售后服务相关问题均属于商家服务范畴，与本平台无关。</li>
				<li>三、使用本平台系统购买商品之前，请确认商品数量及金额，如果支付过程中出现余额不足，请通过查询订单号补足余额之后即可获取卡密。</li>
				<li>四、如果您选择使用充值卡类支付，面额超出的部分无法退还及找零；同时请您确认所选择的充卡面额与充值卡实际面额相符，否则造成充值卡报废损失由您自行承担。</li>
				<li>五、如果出现商品交易纠纷、商品使用及售后服务等相关问题，请与售卡商家自行协商处理，<%=webname%>不负责支付过程以外的任何后续问题。</li>
				<li>六、一旦您确认付款购买商家寄售在本平台的商品，即表示您认同<%=webname%>《免责声明》。</li>
                <!--
    			<input name="lishi" type="text" id="lishi" size="160">
   				-->
				</ul>
	 		 </div> 
			
		<div align="center"><span id="tijiaocon"></span></div>
		<div id="submit"><input style="cursor:pointer"  class="newlogin" type="submit" name="Submit" id="tijiao" value=""></div>
	  </form>
	</div>

<!--页底-->
<div id="footer">
    <div class="top_shadow pngFix"></div>
    <div class="footer_main">
	    <div class="footer_left">
		    <p style="font-weight:bold;">

			Copyright ? 2013-<%=year(now())%>&nbsp;<%=gsname%> <br>
				<%if icpzheng<>"" then%>
                增值电信业务经营许可证： <%=icpzheng%>
                <%end if%>
				<script>
//                var _hmt = _hmt || [];
//                (function() {
//                  var hm = document.createElement("script");
//                  hm.src = "https://hm.baidu.com/hm.js?";
//                  var s = document.getElementsByTagName("script")[0]; 
//                  s.parentNode.insertBefore(hm, s);
//                })();
                </script>
               


			 </p>
		</div>
		<div style="clear:both"></div>
	</div>
    </div>
</div>



<script>
$(function(){
	$('.paylist ul li').each(function()
	{
		$(this).hover(
			function()
			{
			$(this).addClass('yb');
			$(this).addClass('cursor');
			},
			function(){$(this).removeClass("yb");
		});

	    $(this).click(function()
			{

			$('.paylist li').removeClass('ybh');
			$(this).addClass('ybh');
		    $(this).find('input').attr('checked',true);
			});
	})
})
</script>


<div style="display:none">

</div>

<%if iswxkfon="yes" then%>
<a href="https://open.weixin.qq.com/connect/qrconnect?appid=<%=wxkfappid%>&redirect_uri=<%=wxkfre%>&response_type=code&scope=snsapi_login&state=<%=thispcurl%>#wechat_redirect" target="_blank"><div class="wxdl"></div></a>
<%end if%>

<%if isqqkfon="yes" then%>
<a href="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=<%=qqkfappid%>&redirect_uri=<%=qqkfre%>&state=<%=thispcurl%>" target="_blank"><div class="qqdl"></div></a>
<%end if%>


</body></html>