/**
 * 初始化ajax
 */
function creat_Object() { 
var xmlhttp; 
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { 
try { 
xmlhttp = new XMLHttpRequest(); 
} 
catch (e) { 
alert("Your browser is not supporting XMLHTTPRequest");
 xmlhttp = false; 
} 
} 
else { 
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
} 
return xmlhttp; 
} 
var ajax = creat_Object(); 

/**
 * 非中文判断
 */
function is_zw(str){
	exp=/^[A-Za-z0-9]*$/;
	if(exp.test(str))
	{
		return false;
	}
	return true;
}

/**
 * getElementById
 */
function Obj_ById(idname)
{
 var my_obj = document.getElementById(idname);
 return my_obj;
}

/**
 * getElementsByName
 */
function Obj_ByName(idname)
{
 var my_obj = document.getElementsByName(idname);
 return my_obj;
}



/**
 * 弹出层显示
 */
function showDiv(tag,w,h,url,postStr){
var light = Obj_ById(tag);
var fade = Obj_ById('bg');
var Iframe = Obj_ById('popIframe');
var lightCount = Obj_ById(tag+"Count");

light.style.display='block';

light.style.width=w+"px";
light.style.height=h+"px";
light.style.marginLeft=-Math.round(w/2)+"px";
light.style.marginTop=-Math.round(h/2)+"px";

Iframe.style.display='block';
fade.style.display='block';

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
    if (ajax.readyState == 4 && ajax.status == 200) {	
		
		lightCount.innerHTML = ajax.responseText;	

	}
}



}
/**
 * 弹出层隐藏
 */
function hideDiv(tag){
var light = Obj_ById(tag);
var fade = Obj_ById('bg');
var Iframe = Obj_ById('popIframe');
var lightCount = Obj_ById(tag+"Count");

light.style.display='none';
Iframe.style.display='none';
fade.style.display='none';
lightCount.innerHTML = "加载中...";
}





/**
 * 登陆
 */
var LoginDivTime;
function LoginDiv(w,h){
var light = Obj_ById('addDiv');
var fade = Obj_ById('bg');
var Iframe = Obj_ById('popIframe');
var lightCount = Obj_ById("addDivCount");

light.style.display='block';

light.style.width=w+"px";
light.style.height=h+"px";
light.style.marginLeft=-Math.round(w/2)+"px";
light.style.marginTop=-Math.round(h/2)+"px";

Iframe.style.display='block';
fade.style.display='block';

LoginDivTime = setInterval(function(){

var a_s = document.LogintheForm.a_s.value;
var www = document.LogintheForm.www.value;
var num = document.LogintheForm.num.value;
var tt = document.LogintheForm.tt.value;
var txt = document.LogintheForm.txt.value;


//$.ajax({
//  type: "post",
//  url: "http://"+document.domain+"/shopmp/fok/SCAN.asp",
//  data: {www: www,num: num,tt: tt,txt: txt,ccc: a_s},
//  success: function(data){
//  LoginDivCount = LoginDivCount+1;
//  v = new Array;
//  v = data.split("$$$");
//  
//  if(v[3]==1){
//	  clearTimeout(LoginDivTime);	
//	  document.LogintheForm.a_s.value = 0;
//	  top.location.href = "/Shop/Login.ok.asp?id="+v[3];
//  }else{
//      document.LogintheForm.a_s.value = v[0];
//  }
//  lightCount.innerHTML = v[0];
//
//  }
//});


var url = "/mp5.0/fok/SCAN.asp";
var postStr = "www="+www+"&num="+num+"&tt="+tt+"&txt="+txt+"&ccc="+a_s;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
    if (ajax.readyState == 4 && ajax.status == 200) {	
	
	vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
    if(v[3]==1){
	  clearTimeout(LoginDivTime);	
	  document.LogintheForm.a_s.value = 0;
	  top.location.href = "/ShopMy/Login.ok.asp?id="+v[4];
    }else{
	  document.LogintheForm.a_s.value = v[0];
    }
	
	if(a_s==1){
      lightCount.innerHTML = "<div style='text-align:center;font-size:14px;line-height:30px;color:#0EC100;'><div style='width:400px;height:390px;'><img src='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="+v[1]+"' width='390' height='390' /></div><div style='width:400px;height:40px;'>微信扫一扫授权登陆</div></div>";		
	}

	}
}

},1000);



//$.ajax({
//  type: "post",
//  url: "http://"+document.domain+"/shopmp/fok/SCAN.asp",
//  data: {www: www,num: num,tt: 1,txt: "成功授权登陆"},
//  success: function(data){
//  LoginDivCount = LoginDivCount+1;
//  v = new Array;
//  v = data.split("$$$");
//  
//  if(v[2]==1){
//	  clearTimeout(LoginDivTime);	
//	  top.location.href = "/Shop/Login.ok.asp?id="+v[3];
//  }else{
//      LoginDivTime = setInterval("LoginDiv()",1000);
//  }
//  lightCount.innerHTML = LoginDivCount;
//
//  }
//});




}





function mall_navs(url,obj,pid,bg){
var sub_nav = Obj_ById("mall_navs");
var c = document.mallmenus.c.value;

var url = url+"_Menu2.ok.asp";
var postStr = "pid="+pid+"&num="+obj;

 for (i = 1; i <= c; i++ ){ 
 var sub_mall = Obj_ById("mall_"+i);
  if(obj == i){
	sub_mall.style.background = Obj_ById("mallmenus_bg_hover").value;
  }else{
    sub_mall.style.background = Obj_ById("mallmenus_bg_"+i).value;
  }
  
 }   

   ajax.open("POST", url, true);
   ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
   ajax.send(postStr);
   ajax.onreadystatechange = function() {
    if (ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;
        //v = new Array;
        //v = vs.split("$$$");								
        
		if(vs!=""){
			sub_nav.innerHTML = vs;
			sub_nav.style.display = "block";
			
//			Let('#mall_navs')
//			    .set('display', 'block')
//			    .set('opacity', 0)
//  			  .then()
//  			  .duration(100)
//				.set('opacity', 1)
//  			  .pop()
//  			  .end()
			  
//			 Let('#mall_navs_List')
//				.to(-20, 0)
//  			  .then()
//  			  .duration(100)
//  			    .to(20, 0)
//  			  .pop()
//  			  .end()
	
		}else{
			sub_nav.style.display = "none";
//			//scscms_alert("无子类目","","",1);
//			
//			Let('#mall_navs')			    
//				.set('opacity', 0)
//  			  .then()
//  			  .duration(100)
//				//.set('opacity', 0)
//			    .set('display', 'none')
//  			  .pop()
//  			  .end()
//			
		}
     }
   }
   
}


function mall_navs_none(id){
var sub_nav = Obj_ById("mall_navs");
var sub_mall = Obj_ById("mall_"+id);

sub_nav.style.display = "none";
sub_mall.style.background = Obj_ById("mallmenus_bg_"+id).value;

//			Let('#mall_navs')			    
//			    .set('opacity', 0)
//  			  .then()
//  			  .duration(100)
//				//.set('opacity', 0)
//			    .set('display', 'none')
//  			  .pop()
//  			  .end()
}



function mall_no(){
if(Obj_ById('mall_mu').style.display=='block'){

  Obj_ById('mall_mu').style.display='none';

}else{
	
  Obj_ById('mall_mu').style.display='block';
  Obj_ById('mall_mu').style.overflow='';	
  
}
}


function mall_off(){


  Obj_ById('mall_mu').style.height='0px';

}





function nsKeys(co,n){

for(i=1;i<=n;i++){
	
var menu = Obj_ById("txtpic"+i);
menu.style.display=i==co?"block":"none";

var bann = Obj_ById("txtbann"+i);
bann.style.background=i==co?"#fff":"";

}

}





function AddKeys(co,id,nam,n){

var mccc = Obj_ById("nlistkey"+id);
mccc.value=nam;

for(i=0;i<=n;i++){
var menu = Obj_ById("nkey"+id+"_n"+i);
menu.className=i==co?"nkeyhover":"nkey";
}

}



function AddFxKeys(co,id,nam,n){

var mccc = Obj_ById("nlistkeyn_"+id);
mccc.value=nam;

for(i=0;i<=n;i++){
var menu = Obj_ById("keyn1_n"+i);
menu.className=i==co?"fxkeyhover":"fxkey";
}

}





//加载更多商品
function proSearchMore(){
var el = document.getElementById('proList');
var li = document.createElement('li');
var lastid = document.nlist.lastid.value;
var lastnum = document.nlist.lastnum.value;
var Theorder = document.nlist.Theorder.value;
var keys = document.nlist.keys.value;
var keyn = document.nlist.keyn.value;
var key1 = document.nlist.key1.value;
var key2 = document.nlist.key2.value;

var postStr = "keys="+keys+"&keyn="+keyn+"&key1="+key1+"&key2="+key2+"&Theorder="+Theorder+"&lastid="+lastid+"&lastnum="+lastnum;
ajax.open("POST", "N.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.nlist.lastid.value = v[1];
	document.nlist.lastnum.value = v[2];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }	
}




//加载更多商品
function prowwwSearchMore(){
var el = document.getElementById('proList');
var li = document.createElement('li');
var lastid = document.wwwlist.lastid.value;
var lastnum = document.wwwlist.lastnum.value;
var www = document.wwwlist.www.value; 

var postStr = "lastid="+lastid+"&lastnum="+lastnum+"&www="+www;
ajax.open("POST", "Fenx.S.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.wwwlist.lastid.value = v[1];
	document.wwwlist.lastnum.value = v[2];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }	
}



//加载更多活动商品
function actSearchMore(){
var el = document.getElementById('actList');
var li = document.createElement('li');
var lastid = document.actlist.lastid.value;
var lastnum = document.actlist.lastnum.value;
var keys = document.actlist.keys.value;
var Theorder = document.actlist.Theorder.value;

var postStr = "keys="+keys+"&Theorder="+Theorder+"&lastid="+lastid+"&lastnum="+lastnum;
ajax.open("POST", "Act.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.actlist.lastid.value = v[1];
	document.actlist.lastnum.value = v[2];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }	
}





//加载更多加盟
function userSearchMore(){
var el = document.getElementById('userList');
var li = document.createElement('li');
var lastid = document.ulist.lastid.value;
var lastnum = document.ulist.lastnum.value;
var keys = document.ulist.keys.value;
var keyn = document.ulist.keyn.value;
var key1 = document.ulist.key1.value;
var Theorder = document.ulist.Theorder.value;

var postStr = "keyn="+keyn+"&key1="+key1+"&keys="+keys+"&Theorder="+Theorder+"&lastid="+lastid+"&lastnum="+lastnum;
ajax.open("POST", "Fenx.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.ulist.lastid.value = v[1];
	document.ulist.lastnum.value = v[2];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }	
}





//加载更多公告
function newsSearchMore(){
var el = document.getElementById('newsnewsList');
var li = document.createElement('li');
var lastid = document.newslist.lastid.value;
var lastnum = document.newslist.lastnum.value;
var keys = document.newslist.keys.value;
var keyn = document.newslist.keyn.value;

var postStr = "keyn="+keyn+"&keys="+keys+"&lastid="+lastid+"&lastnum="+lastnum;
ajax.open("POST", "News.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.newslist.lastid.value = v[1];
	document.newslist.lastnum.value = v[2];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }	
}






//加载更多公告
function nowActSearchMore(){
var el = document.getElementById('nowActList');
var lastid = document.nowActthe.lastid.value;
var lastnum = document.nowActthe.lastnum.value;

var postStr = "lastid="+lastid+"&lastnum="+lastnum;
ajax.open("POST", "/shop/Act.More.Index.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    el.innerHTML = v[0];
    document.nowActthe.lastid.value = v[1];
	document.nowActthe.lastnum.value = v[2];
	
	}

  }
 }	
}



//加载更多评价
function proPingjiaMore(){
var el = document.getElementById('proshowpingjia');
var li = document.createElement('li');
var SNS_id = document.pingjialist.SNS_id.value;
var lastid = document.pingjialist.lastid.value;
var lastnum = document.pingjialist.lastnum.value;

var postStr = "SNS_id="+SNS_id+"&lastid="+lastid+"&lastnum="+lastnum;
ajax.open("POST", "S.Ping.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.pingjialist.lastid.value = v[1];
	document.pingjialist.lastnum.value = v[2];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }	
}






//加载更多订单
function DioMore(){
var el = document.getElementById('dingdanlist');
var li = document.createElement('li');
var lastid = document.dingdantxt.lastid.value;
var lastnum = document.dingdantxt.lastnum.value;
var t = document.dingdantxt.t.value;

var postStr = "t="+t+"&lastid="+lastid+"&lastnum="+lastnum;
ajax.open("POST", "Dio.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.dingdantxt.lastid.value = v[1];
	document.dingdantxt.lastnum.value = v[2];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }	
}






//选择规格尺码
function Shopshowxrr(name,cursel,n,fo,Va){
for(i=0;i<=n;i++){
var menu=document.getElementById(name+i);
menu.className=i==cursel?"xLinkG":"xLinkF";
}

var con=document.getElementById(fo);
con.value=Va;

var COOK_55 = document.shopshowaddform.COOK_55.value;
var COOK_112 = document.shopshowaddform.COOK_112.value;
var COOK_121 = document.shopshowaddform.COOK_121.value;
var HY_id = document.shopshowaddform.HY_id.value;
var HY_win = document.shopshowaddform.HY_win.value;
var HY_color = document.shopshowaddform.HY_color.value;
var HY_paystr = document.shopshowaddform.HY_paystr.value;
var HY_Count = document.shopshowaddform.HY_Count.value;
var HY_gyNpaystr = document.shopshowaddform.HY_gyNpaystr.value;
var HY_artflag = document.shopshowaddform.HY_artflag.value;

var d = new Date();
var url = "S.Wincolor.asp";
var postStr = "HY_id="+HY_id+"&HY_win="+HY_win+"&HY_color="+HY_color+"&HY_paystr="+HY_paystr+"&HY_Count="+HY_Count+"&d="+d+"&HY_gyNpaystr="+HY_gyNpaystr+"&HY_artflag="+HY_artflag+"&COOK_55="+COOK_55+"&COOK_112="+COOK_112+"&COOK_121="+COOK_121;
ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
    if (ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;
        v = new Array;
        v = vs.split("$$$");
											
        document.getElementById("shopshowaddpaylll").innerHTML = v[0];
		document.getElementById("shopshowaddkucunlll").innerHTML = v[1];
		document.shopshowaddform.HY_pay.value = v[2];
		document.shopshowaddform.HY_payl.value = v[3];
		document.shopshowaddform.HY_zhong.value = v[4];
		document.shopshowaddform.HY_kucun.value = v[5];
		document.shopshowaddform.HY_xpayl.value = v[6];
    }
}
}

//购买数量
function CheckFormShopshowCount(id){
if (id=="+"){
  
  var HYCount = Number(document.shopshowaddform.HY_Count.value)+1;
  var HYkucun = Number(document.shopshowaddform.HY_kucun.value)-1;
  
  if(document.shopshowaddform.HY_timeCount.value>0){  
     if(document.shopshowaddform.HY_timeCount.value<HYCount){
	   scscms_alert("超过限购数量","","",1);
	   return false;
	 }
  }	
    
  if(document.shopshowaddform.HY_kucun.value<=0){
    scscms_alert("库存不足","","",1);
	return false;
		 //document.shopshowaddform.HY_kucun.value=0;
  }else{
		 document.shopshowaddform.HY_Count.value=HYCount;
		 document.shopshowaddform.HY_kucun.value=HYkucun;		 
  }
	   	  
}else if(id=="-"){
	
 if(document.shopshowaddform.HY_Count.value<2){
     scscms_alert("购买数量至少一件","","",1);
     document.shopshowaddform.HY_Count.value=1;
	 return false;
 }else{
     document.shopshowaddform.HY_Count.value=Number(document.shopshowaddform.HY_Count.value)-1;
     document.shopshowaddform.HY_kucun.value=Number(document.shopshowaddform.HY_kucun.value)+1;
 }
 
}

 document.getElementById("shopshowaddkucunlll").innerHTML = document.shopshowaddform.HY_kucun.value;
}







//加入购物车
function saveShopshowBuy(){
var COOK_user = document.shopshowaddform.COOK_user.value;
var COOK_55 = document.shopshowaddform.COOK_55.value;
var HY_buy = document.shopshowaddform.HY_buy.value;
var HY_TK = document.shopshowaddform.HY_TK.value;
var HY_TKP = document.shopshowaddform.HY_TKP.value;
var HY_payj = document.shopshowaddform.HY_payj.value;
var HY_pay = document.shopshowaddform.HY_pay.value;
var HY_payl = document.shopshowaddform.HY_payl.value;
var HY_xpayl = document.shopshowaddform.HY_xpayl.value;
var HY_zhong = document.shopshowaddform.HY_zhong.value;
var HY_id = document.shopshowaddform.HY_id.value;
var HY_yfner = document.shopshowaddform.HY_yfner.value;
var HY_win = document.shopshowaddform.HY_win.value;
var HY_color = document.shopshowaddform.HY_color.value;
var HY_paystr = document.shopshowaddform.HY_paystr.value;
var HY_kucun = document.shopshowaddform.HY_kucun.value;
var HY_Count = document.shopshowaddform.HY_Count.value;
var HY_timeCount = document.shopshowaddform.HY_timeCount.value;
var HY_timeZhekou = document.shopshowaddform.HY_timeZhekou.value;
var HY_hisCount = document.shopshowaddform.HY_hisCount.value;
var HY_JINBI = document.shopshowaddform.HY_JINBI.value;

if(HY_win==""){
scscms_alert("请选择规格","","",1);
return false;
}
if(HY_kucun<=0){
scscms_alert("库存不足，请正确选择购买数量","","",1);
return false;
}
if(HY_timeCount>0){
  if(HY_Count>HY_timeCount){
    scscms_alert("超过了限购数量","","",1);
    return false;
  }
  var hisCount = Number(HY_Count)+Number(HY_hisCount);
  if(hisCount>HY_timeCount){
    scscms_alert("超过了限购数量","","",1);
    return false;
  }
}

var url = "S.Buy.asp";
var postStr = "COOK_user="+COOK_user+"&COOK_55="+COOK_55+"&HY_buy="+HY_buy+"&HY_TK="+HY_TK+"&HY_TKP="+HY_TKP+"&HY_payj="+HY_payj+"&HY_pay="+HY_pay+"&HY_payl="+HY_payl+"&HY_xpayl="+HY_xpayl+"&HY_zhong="+HY_zhong+"&HY_id="+HY_id+"&HY_yfner="+HY_yfner+"&HY_win="+HY_win+"&HY_color="+HY_color+"&HY_paystr="+HY_paystr+"&HY_kucun="+HY_kucun+"&HY_Count="+HY_Count+"&HY_timeCount="+HY_timeCount+"&HY_timeZhekou="+HY_timeZhekou+"&HY_JINBI="+HY_JINBI;
ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
    if (ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;
        v = new Array;
        v = vs.split("$$$");
		
        scscms_alert(v[0],"","",1);
		
		if(v[1]>0){
		document.getElementById("IndexUpCatcccc").innerHTML = v[1];
		}


    }
}
	
}

//下单
function saveShopshowBuyOK(){
var COOK_user = document.shopshowaddform.COOK_user.value;
var COOK_55 = document.shopshowaddform.COOK_55.value;
var HY_buy = document.shopshowaddform.HY_buy.value;
var HY_TK = document.shopshowaddform.HY_TK.value;
var HY_TKP = document.shopshowaddform.HY_TKP.value;
var HY_payj = document.shopshowaddform.HY_payj.value;
var HY_pay = document.shopshowaddform.HY_pay.value;
var HY_payl = document.shopshowaddform.HY_payl.value;
var HY_xpayl = document.shopshowaddform.HY_xpayl.value;
var HY_zhong = document.shopshowaddform.HY_zhong.value;
var HY_id = document.shopshowaddform.HY_id.value;
var HY_yfner = document.shopshowaddform.HY_yfner.value;
var HY_win = document.shopshowaddform.HY_win.value;
var HY_color = document.shopshowaddform.HY_color.value;
var HY_paystr = document.shopshowaddform.HY_paystr.value;
var HY_kucun = document.shopshowaddform.HY_kucun.value;
var HY_Count = document.shopshowaddform.HY_Count.value;
var HY_timeCount = document.shopshowaddform.HY_timeCount.value;
var HY_timeZhekou = document.shopshowaddform.HY_timeZhekou.value;
var HY_hisCount = document.shopshowaddform.HY_hisCount.value;
var HY_JINBI = document.shopshowaddform.HY_JINBI.value;

if(HY_win==""){
scscms_alert("请选择规格","","",1);
return false;
}
if(HY_kucun<=0){
scscms_alert("库存不足，请正确选择购买数量","","",1);
return false;
}
if(HY_timeCount>0){
  if(HY_Count>HY_timeCount){
    scscms_alert("超过了限购数量","","",1);
    return false;
  }
  var hisCount = Number(HY_Count)+Number(HY_hisCount);
  if(hisCount>HY_timeCount){
    scscms_alert("超过了限购数量","","",1);
    return false;
  }
}

var d = new Date();
var url = "S.Buyok.asp";
var postStr = "COOK_user="+COOK_user+"&COOK_55="+COOK_55+"&HY_buy="+HY_buy+"&HY_TK="+HY_TK+"&HY_TKP="+HY_TKP+"&HY_payj="+HY_payj+"&HY_pay="+HY_pay+"&HY_payl="+HY_payl+"&HY_xpayl="+HY_xpayl+"&HY_zhong="+HY_zhong+"&HY_id="+HY_id+"&HY_yfner="+HY_yfner+"&HY_win="+HY_win+"&HY_color="+HY_color+"&HY_paystr="+HY_paystr+"&HY_kucun="+HY_kucun+"&HY_Count="+HY_Count+"&HY_timeCount="+HY_timeCount+"&HY_timeZhekou="+HY_timeZhekou+"&HY_JINBI="+HY_JINBI;
ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
    if (ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;
        v = new Array;
        v = vs.split("$$$");
		
		var backurl = "/ShopMy/Home/Pay.asp?Nidsel="+v[1]+"&is_wx=shop";
		
		if(v[1]!=0){
		scscms_alert(v[0],'ok',function(){top.location.href = backurl;});
		}else{
		scscms_alert(v[0],"","",1);
		}

    }
}	
}





//从购物车结算下单
function saveCatshowBuyOK(){
var k = document.listform.k.value;
var selArrs="";
var coArrs="";


for (var i=0;i<k;i++ ){
var nn = i+1;
var selArr = document.getElementsByName("sel"+nn);
var coArr = document.getElementsByName("co"+nn);

for (var ii=0;ii<selArr.length;ii++ ){
 if(selArr[ii].checked){ //判断复选框是否选中
  if(selArrs!=""){
      selArrs = selArrs+","+selArr[ii].value;
      coArrs = coArrs+","+coArr[ii].value;
  }else{
	  selArrs = selArr[ii].value;
      coArrs = coArr[ii].value;	
  }
 }
}

}



if(selArrs==""){
scscms_alert("请选择结算商品","","",1);
return false;
}


var url = "Cat.ok.asp";
var postStr = "selArrs="+selArrs+"&coArrs="+coArrs;
ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
    if (ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;
        v = new Array;
        v = vs.split("$$$");
		
		var backurl = "/ShopMy/Home/Pay.asp?Nselall="+v[1]+"&is_wx=shop";
		
		if(v[1]!=0){
		top.location.href = backurl;
		}else{
		scscms_alert(v[0],"","",1);
		}

     }
  }	
  
  
}














//登陆免注册
function LogintheFormSave(){
var auser = document.LogintheForm.auser.value;
var apass = document.LogintheForm.apass.value;

if (auser.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 document.LogintheForm.auser.focus();
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(auser)){
 scscms_alert("请输入有效的手机号码","","",1);
 document.LogintheForm.auser.focus();
 return false;
}
if (apass==""){
 scscms_alert("请输入密码","","",1);
 document.LogintheForm.acode.focus();
 return false;
}

var url = "/ShopMy/Login.ok.asp";
var postStr = "auser="+auser+"&apass="+apass;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs=="ok"){
		  top.location.href = "/ShopMy/Home/i.asp";
		}else{
		  scscms_alert(vs,"","",1);
		}
    }
  }

}


function RegtheFormSave(){
var auser = document.LogintheForm.auser.value;
var apass = document.LogintheForm.apass.value;
var apass2 = document.LogintheForm.apass2.value;
var acode = document.LogintheForm.acode.value;

if (auser.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 document.LogintheForm.auser.focus();
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(auser)){
 scscms_alert("请输入有效的手机号码","","",1);
 document.LogintheForm.auser.focus();
 return false;
}
if (apass==""){
 scscms_alert("请输入密码","","",1);
 document.LogintheForm.apass.focus();
 return false;
}
if (apass2==""){
 scscms_alert("请输入确认密码","","",1);
 document.LogintheForm.apass2.focus();
 return false;
}
if (apass2!=apass){
 scscms_alert("二次密码不一致","","",1);
 document.LogintheForm.apass2.focus();
 return false;
}
if (acode==""){
 scscms_alert("请输入验证码","","",1);
 document.LogintheForm.acode.focus();
 return false;
}

var url = "/ShopMy/Reg.ok.asp";
var postStr = "auser="+auser+"&apass="+apass+"&acode="+acode;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs=="ok"){
		  top.location.href = "/ShopMy/Home/i.asp";
		}else{
		  scscms_alert(vs,"","",1);
		}
    }
  }

}



var codeSearTime;
function Searcode_chk(){
var auser = document.LogintheForm.auser.value;
var a_s = document.LogintheForm.a_s.value;

if (auser.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 document.LogintheForm.auser.focus();
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(auser)){
 scscms_alert("请输入有效的手机号码","","",1);
 document.LogintheForm.auser.focus();
 return false;
}


if(a_s==0){

document.getElementById("regusertt").innerHTML = "";
	  
var url = "/ShopMy/Login.tel.code.asp";
var postStr = "auser="+auser;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs==1){
		document.LogintheForm.a_s.value=1; 
		scscms_alert("验证码已发送，请注意查看手机","","",1);
		codeSearTime = setInterval("Searcode_chk()",1000);
		}else{
		scscms_alert(vs,"","",1);
		document.getElementById("regusertt").innerHTML = "<a href='javascript:Searcode_chk();'>获取动态验证码</a>";
		clearTimeout(codeSearTime);	
		}
    }
  }	  	
		
}else if(a_s>0 && a_s<300){
	  allas = Number(document.LogintheForm.a_s.value)+1;
	  allsa = 300 - allas;
	  document.LogintheForm.a_s.value = allas; 
	  document.getElementById("regusertt").innerHTML = "验证码已发送，倒计时 "+ allsa;
}else if(a_s>=300){
      document.getElementById("regusertt").innerHTML = "<a href='javascript:Searcode_chk();'>获取动态验证码</a>";
	  document.LogintheForm.a_s.value = 0;
	  clearTimeout(codeSearTime);	
}



}






















function DatatheFormSave(){
var ex_nice = document.theForm.ex_nice.value;
var ex_weixin = document.theForm.ex_weixin.value;
var ex_city = document.theForm.ex_city.value;
var ex_city1 = document.theForm.ex_city1.value;
var ex_city2 = document.theForm.ex_city2.value;
var ex_add = document.theForm.ex_add.value;
var ex_name = document.theForm.ex_name.value;

if (ex_nice==""){
 scscms_alert("请填写昵称","","",1);
 return false;
}
if (ex_weixin==""){
 scscms_alert("请填写微信号","","",1);
 return false;
}
if (ex_city==""){
 scscms_alert("请选择所在区域","","",1);
 return false;
}
if (ex_add==""){
 scscms_alert("请填写收件地址","","",1);
 return false;
}
if (ex_name==""){
 scscms_alert("请填写收件人","","",1);
 return false;
}

var url = "Data.ok.asp";
var postStr = "ex_nice="+ex_nice+"&ex_weixin="+ex_weixin+"&ex_city="+ex_city+"&ex_city1="+ex_city1+"&ex_city2="+ex_city2+"&ex_add="+ex_add+"&ex_name="+ex_name;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs=="ok"){
		  scscms_alert("已保存","","",1);
		}else{
		  scscms_alert(vs,"","",1);
		}
    }
  }

}




//绑定手机号
function DatateltheFormSave(){
var ex_mtel = document.theForm.ex_mtel.value;
var ex_code = document.theForm.ex_code.value;
var pass1 = document.theForm.pass1.value;
var pass2 = document.theForm.pass2.value;

if (ex_mtel==""){
 scscms_alert("请填写手机号","","",1);
 return false;
}
if (ex_code==""){
 scscms_alert("请填写验证码","","",1);
 return false;
}

var url = "Data.tel.ok.asp";
var postStr = "ex_mtel="+ex_mtel+"&ex_code="+ex_code+"&pass1="+pass1+"&pass2="+pass2;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs=="ok"){
		  scscms_alert("绑定成功","","",1);
		  document.theForm.ex_code.value="";
		}else{
		  scscms_alert(vs,"","",1);
		}
    }
  }

}






var codeDataTime;
function Datacode_chk(){
var ex_mtel = document.theForm.ex_mtel.value;
var a_s = document.theForm.a_s.value;

if (ex_mtel.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(ex_mtel)){
 scscms_alert("请输入有效的手机号码","","",1);
 return false;
}

if(a_s==0){
	
document.getElementById("regusertt").innerHTML = "";
	  
var url = "/ShopMy/Home/Data.tel.code.asp";
var postStr = "ex_mtel="+ex_mtel;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs==1){
		document.theForm.a_s.value=1; 
		scscms_alert("验证码已发送，请注意查看手机","","",1);
		codeDataTime = setInterval("Datacode_chk()",1000);
		}else{
		scscms_alert(vs,"","",1);
		document.getElementById("regusertt").innerHTML = "<a href='javascript:Searcode_chk();'>获取动态验证码</a>";
		clearTimeout(codeDataTime);	
		}
    }
  }	  	
		
}else if(a_s>0 && a_s<300){
	  allas = Number(document.theForm.a_s.value)+1;
	  allsa = 300 - allas;
	  document.theForm.a_s.value = allas; 
	  document.getElementById("regusertt").innerHTML = "验证码已发送，倒计时 "+ allsa;
}else if(a_s>=300){
      document.getElementById("regusertt").innerHTML = "<a href='javascript:Searcode_chk();'>获取动态验证码</a>";
	  document.theForm.a_s.value = 0;
	  clearTimeout(codeDataTime);	
}



}













function topSearch(){
//var tt = document.toplistSearch.tt.value;
var keys = document.toplistSearch.keys.value;

if (keys==""){
 scscms_alert("请填写关键词","","",1);
 return false;
}

var url = "/ShopMy/N.asp";


document.toplistSearch.action = url+"?keys="+keys;
document.toplistSearch.submit();	

}







function delCatCookies(www,id){
var url = "/ShopMy/home/Cat.Del.cookies.asp";
var postStr = "www="+www+"&id="+id;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {						       
		top.location.href = "Cat.asp";
    }
  }	

}







function delCatUser(www,id){
var url = "/ShopMy/home/Cat.Del.User.asp";
var postStr = "www="+www+"&id="+id;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {						       
		top.location.href = "Cat.asp";
    }
  }	

}







function cityYunfei(){
var selid = document.theForm.selid.value;
var ex_q = document.theForm.ex_city.value;

var url = "/ShopMy/home/Pay.Yunfei.asp";
var postStr = "selid="+selid+"&ex_q="+ex_q;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {						       
      vs = ajax.responseText;
	  v = new Array;
      v = vs.split("$$$");		
		

      for (var i=0;i<v.length;i++ ){
		  
		  vx = v[i];
		  vxv = new Array;
          vxv = vx.split("|");
          ii = Number(i + 1);

	      document.getElementById('v_yunfei'+ii).value = vxv[0];
		  document.getElementById('v_yunfei_txt'+ii).innerHTML = vxv[1];
		  document.getElementById('v_chengbenyunfei'+ii).value = vxv[2];		  		  
		  document.getElementById('v_amount_all_txt'+ii).innerHTML = vxv[3];
          document.getElementById('youhui'+ii).value = "|0";
      }	
		
		
		
    }
  }	
}





function youhuiShop(id){
var youhui = document.getElementById('youhui'+id).value;
var amount = document.getElementById('v_amount'+id).value;
var yunfei = document.getElementById('v_yunfei'+id).value;

var url = "/ShopMy/home/Pay.Youhui.asp";
var postStr = "youhui="+youhui+"&amount="+amount+"&yunfei="+yunfei;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {						       
      vs = ajax.responseText;
	  v = new Array;
      v = vs.split("$$$");	
	  	  
      document.getElementById('qdyh'+id).value = v[1];
      document.getElementById('qdyhVS'+id).value = v[0];
      document.getElementById('v_amount_all_txt'+id).innerHTML = v[2];

   }
 }

}






function savePay(n){
var selid = document.theForm.selid.value;
var ex_city = document.theForm.ex_city.value;
var ex_city1 = document.theForm.ex_city1.value;
var ex_city2 = document.theForm.ex_city2.value;
var ex_add = document.theForm.ex_add.value;
var ex_name = document.theForm.ex_name.value;
var ex_mtel = document.theForm.ex_mtel.value;
var ex_weixin = document.theForm.ex_weixin.value;
var payttt = document.theForm.payttt.value;

	var ii = 0;
	var v_ggg = "";
	var v_www = "";
	var seltext = "";
	var v_countall = "";
	var v_yunfei = "";
	var v_chengbenyunfei = "";
	var v_amount = "";
	var v_bmount = "";
	var v_cmount = "";
	var v_TKP = "";
	var v_JFP = "";
	var v_JFDK = "";
	var v_qianggou = "";
	var v_kazk = "";
	var openid = "";
	var v_fxhywwwall = "";
	var jinbiall = "";
	var remark1 = "";
	var qdyh = "";
	var qdyhVS = "";
	var tableIDs = "";
	
  for (i=0;i<n;i++ ){
	  
	 ii = Number(i + 1);
	
	 v_ggg = v_ggg+"$"+document.getElementById('v_ggg'+ii).value;
	 v_www = v_www+"$"+document.getElementById('v_www'+ii).value;
	 seltext = seltext+"$"+document.getElementById('seltext'+ii).value;
	 v_countall = v_countall+"$"+document.getElementById('v_countall'+ii).value;
	 v_yunfei = v_yunfei+"$"+document.getElementById('v_yunfei'+ii).value;
	 v_chengbenyunfei = v_chengbenyunfei+"$"+document.getElementById('v_chengbenyunfei'+ii).value;
	 v_amount = v_amount+"$"+document.getElementById('v_amount'+ii).value;
	 v_bmount = v_bmount+"$"+document.getElementById('v_bmount'+ii).value;
	 v_cmount = v_cmount+"$"+document.getElementById('v_cmount'+ii).value;
	 v_TKP = v_TKP+"$"+document.getElementById('v_TKP'+ii).value;
	 v_JFP = v_JFP+"$"+document.getElementById('v_JFP'+ii).value;
	 v_JFDK = v_JFDK+"$"+document.getElementById('v_JFDK'+ii).value;
	 v_qianggou = v_qianggou+"$"+document.getElementById('v_qianggou'+ii).value;
	 v_kazk = v_kazk+"$"+document.getElementById('v_kazk'+ii).value;
	 remark1 = remark1+"$"+document.getElementById('remark1'+ii).value;
	 qdyh = qdyh+"$"+document.getElementById('qdyh'+ii).value;
	 qdyhVS = qdyhVS+"$"+document.getElementById('qdyhVS'+ii).value;
	 v_fxhywwwall = v_fxhywwwall+"$"+document.getElementById('v_fxhywwwall'+ii).value;
	 jinbiall = jinbiall+"$"+document.getElementById('jinbiall'+ii).value;
	 tableIDs = tableIDs+"$"+document.getElementById('tableIDs'+ii).value;
	
  }
  
var url = "/ShopMy/home/Pay.ok.asp";
var postStr = "selid="+selid+"&ex_city="+ex_city+"&ex_city1="+ex_city1+"&ex_city2="+ex_city2+"&ex_add="+ex_add+"&ex_name="+ex_name+"&ex_mtel="+ex_mtel+"&ex_weixin="+ex_weixin+"&v_ggg="+v_ggg+"&v_www="+v_www+"&seltext="+seltext+"&v_countall="+v_countall+"&v_yunfei="+v_yunfei+"&v_chengbenyunfei="+v_chengbenyunfei+"&v_amount="+v_amount+"&v_bmount="+v_bmount+"&v_cmount="+v_cmount+"&v_TKP="+v_TKP+"&v_JFP="+v_JFP+"&v_JFDK="+v_JFDK+"&v_qianggou="+v_qianggou+"&v_kazk="+v_kazk+"&remark1="+remark1+"&qdyh="+qdyh+"&qdyhVS="+qdyhVS+"&v_fxhywwwall="+v_fxhywwwall+"&jinbiall="+jinbiall+"&tableIDs="+tableIDs+"&payttt="+payttt;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {						       
      vs = ajax.responseText;
	  v = new Array;
      v = vs.split("$$$");	
	  	  
      if(v[1]!=0){
		  scscms_alert(v[0],'ok',function(){top.location.href='Dio.asp'});
//		 if(ii>1){
//			 scscms_alert(v[0],'ok',function(){top.location.href='Dio.asp'});
//		 }else{
//		     if(payttt==3){
//			     scscms_alert(v[0],'ok',function(){top.location.href='Dio.asp'});
//		     }else{
//		         scscms_alert(v[0],'ok',function(){top.location.href="../Api/alipay/alipayto.asp?total_fee="+v_amount+"&out_trade_no="+tableIDs+"&subject="+ex_name+"PC购物"});
//		     }
//		 }
	  }else{
		 scscms_alert(v[0],"","",1);
	  }

   }
 }

}






//删除订单
function delOrdersflag(id,backdiv){
var url = "Dio.del.asp";
var postStr = "IDs="+id;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	    vs  = ajax.responseText;
				
		    hideDiv('addDiv');
			scscms_alert(vs,"","",1);
			document.getElementById(backdiv).style.display='none';


  }
 }
}













var codeSinaTime;
function Sinacode_chk(){
var auser = document.SinatheForm.auser.value;
var a_s = document.SinatheForm.a_s.value;

if (auser.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 document.SinatheForm.auser.focus();
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(auser)){
 scscms_alert("请输入有效的手机号码","","",1);
 document.SinatheForm.auser.focus();
 return false;
}


if(a_s==0){

document.getElementById("regsinatt").innerHTML = "";
	  
var url = "/ShopMy/Sina.tel.code.asp";
var postStr = "auser="+auser;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs==1){
		document.SinatheForm.a_s.value=1; 
		scscms_alert("验证码已发送，请注意查看手机","","",1);
		codeSinaTime = setInterval("Sinacode_chk()",1000);
		}else{
		scscms_alert(vs,"","",1);
		document.getElementById("regsinatt").innerHTML = "<a href='javascript:Sinacode_chk();'>获取动态验证码</a>";
		clearTimeout(codeSinaTime);	
		}
    }
  }	  	
		
}else if(a_s>0 && a_s<300){
	  allas = Number(document.SinatheForm.a_s.value)+1;
	  allsa = 300 - allas;
	  document.SinatheForm.a_s.value = allas; 
	  document.getElementById("regsinatt").innerHTML = "验证码已发送，倒计时 "+ allsa;
}else if(a_s>=300){
      document.getElementById("regsinatt").innerHTML = "<a href='javascript:Sinacode_chk();'>获取动态验证码</a>";
	  document.SinatheForm.a_s.value = 0;
	  clearTimeout(codeSinaTime);	
}



}










//绑定手机验证码
function SinatheFormSave(){
var auser = document.SinatheForm.auser.value;
var apass = document.SinatheForm.apass.value;
var apass2 = document.SinatheForm.apass2.value;
var acode = document.SinatheForm.acode.value;
var sina_name = document.SinatheForm.sina_name.value;
var sina_oauth_token = document.SinatheForm.sina_oauth_token.value;
var ex_nice = document.SinatheForm.ex_nice.value;
var ex_pic = document.SinatheForm.ex_pic.value;

if (auser.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 document.SinatheForm.auser.focus();
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(auser)){
 scscms_alert("请输入有效的手机号码","","",1);
 document.SinatheForm.auser.focus();
 return false;
}
if (apass==""){
 scscms_alert("请输入登陆密码","","",1);
 document.SinatheForm.apass.focus();
 return false;
}
if (apass2==""){
 scscms_alert("请输入确认密码","","",1);
 document.SinatheForm.apass2.focus();
 return false;
}
if (apass!=apass2){
 scscms_alert("两次密码不一致","","",1);
 document.SinatheForm.apass.focus();
 return false;
}
if (acode==""){
 scscms_alert("请输入验证码","","",1);
 document.SinatheForm.acode.focus();
 return false;
}

var url = "/ShopMy/Sina.reg.ok.asp";
var postStr = "auser="+auser+"&apass="+apass+"&acode="+acode+"&sina_name="+sina_name+"&sina_oauth_token="+sina_oauth_token+"&ex_nice="+ex_nice+"&ex_pic="+ex_pic;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs=="ok"){
		  top.location.href = "/ShopMy/Home/i.asp";
		}else{
		  scscms_alert(vs,"","",1);
		}
    }
  }

}



function SinatheFormSave2(){
var auser = document.SinatheForm2.auser.value;
var apass = document.SinatheForm2.apass.value;
var sina_name = document.SinatheForm2.sina_name.value;
var sina_oauth_token = document.SinatheForm2.sina_oauth_token.value;
var ex_nice = document.SinatheForm2.ex_nice.value;
var ex_pic = document.SinatheForm2.ex_pic.value;

if (auser.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 document.SinatheForm2.auser.focus();
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(auser)){
 scscms_alert("请输入有效的手机号码","","",1);
 document.SinatheForm2.auser.focus();
 return false;
}
if (apass==""){
 scscms_alert("请输入登陆密码","","",1);
 document.SinatheForm2.apass.focus();
 return false;
}

var url = "/ShopMy/Sina.login.ok.asp";
var postStr = "auser="+auser+"&apass="+apass+"&sina_name="+sina_name+"&sina_oauth_token="+sina_oauth_token+"&ex_nice="+ex_nice+"&ex_pic="+ex_pic;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs=="ok"){
		  top.location.href = "/ShopMy/Home/i.asp";
		}else{
		  scscms_alert(vs,"","",1);
		}
    }
  }

}









var codeqqTime;
function qqcode_chk(){
var auser = document.qqtheForm.auser.value;
var a_s = document.qqtheForm.a_s.value;

if (auser.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 document.qqtheForm.auser.focus();
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(auser)){
 scscms_alert("请输入有效的手机号码","","",1);
 document.qqtheForm.auser.focus();
 return false;
}


if(a_s==0){

document.getElementById("regqqtt").innerHTML = "";
	  
var url = "/ShopMy/QQ.tel.code.asp";
var postStr = "auser="+auser;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs==1){
		document.qqtheForm.a_s.value=1; 
		scscms_alert("验证码已发送，请注意查看手机","","",1);
		codeqqTime = setInterval("qqcode_chk()",1000);
		}else{
		scscms_alert(vs,"","",1);
		document.getElementById("regqqtt").innerHTML = "<a href='javascript:qqcode_chk();'>获取动态验证码</a>";
		clearTimeout(codeqqTime);	
		}
    }
  }	  	
		
}else if(a_s>0 && a_s<300){
	  allas = Number(document.qqtheForm.a_s.value)+1;
	  allsa = 300 - allas;
	  document.qqtheForm.a_s.value = allas; 
	  document.getElementById("regqqtt").innerHTML = "验证码已发送，倒计时 "+ allsa;
}else if(a_s>=300){
      document.getElementById("regqqtt").innerHTML = "<a href='javascript:qqcode_chk();'>获取动态验证码</a>";
	  document.qqtheForm.a_s.value = 0;
	  clearTimeout(codeqqTime);	
}



}





function qqtheFormSave(){
var auser = document.qqtheForm.auser.value;
var apass = document.qqtheForm.apass.value;
var apass2 = document.qqtheForm.apass2.value;
var acode = document.qqtheForm.acode.value;
var qq_name = document.qqtheForm.qq_name.value;
var qq_oauth_token = document.qqtheForm.qq_oauth_token.value;
var qq_oauth_Secret = document.qqtheForm.qq_oauth_Secret.value;
var ex_nice = document.qqtheForm.ex_nice.value;
var ex_pic = document.qqtheForm.ex_pic.value;

if (auser.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 document.qqtheForm.auser.focus();
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(auser)){
 scscms_alert("请输入有效的手机号码","","",1);
 document.qqtheForm.auser.focus();
 return false;
}
if (apass==""){
 scscms_alert("请输入登陆密码","","",1);
 document.qqtheForm.apass.focus();
 return false;
}
if (apass2==""){
 scscms_alert("请输入确认密码","","",1);
 document.qqtheForm.apass2.focus();
 return false;
}
if (apass!=apass2){
 scscms_alert("两次密码不一致","","",1);
 document.qqtheForm.apass.focus();
 return false;
}
if (acode==""){
 scscms_alert("请输入验证码","","",1);
 document.qqtheForm.acode.focus();
 return false;
}

var url = "/ShopMy/QQ.reg.ok.asp";
var postStr = "auser="+auser+"&apass="+apass+"&acode="+acode+"&qq_name="+qq_name+"&qq_oauth_token="+qq_oauth_token+"&qq_oauth_Secret="+qq_oauth_Secret+"&ex_nice="+ex_nice+"&ex_pic="+ex_pic;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs=="ok"){
		  top.location.href = "/ShopMy/Home/i.asp";
		}else{
		  scscms_alert(vs,"","",1);
		}
    }
  }

}



function qqtheFormSave2(){
var auser = document.qqtheForm2.auser.value;
var apass = document.qqtheForm2.apass.value;
var qq_name = document.qqtheForm2.qq_name.value;
var qq_oauth_token = document.qqtheForm2.qq_oauth_token.value;
var qq_oauth_Secret = document.qqtheForm2.qq_oauth_Secret.value;
var ex_nice = document.qqtheForm2.ex_nice.value;
var ex_pic = document.qqtheForm2.ex_pic.value;

if (auser.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 document.qqtheForm2.auser.focus();
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(auser)){
 scscms_alert("请输入有效的手机号码","","",1);
 document.qqtheForm2.auser.focus();
 return false;
}
if (apass==""){
 scscms_alert("请输入登陆密码","","",1);
 document.qqtheForm2.apass.focus();
 return false;
}

var url = "/ShopMy/QQ.login.ok.asp";
var postStr = "auser="+auser+"&apass="+apass+"&qq_name="+qq_name+"&qq_oauth_token="+qq_oauth_token+"&qq_oauth_Secret="+qq_oauth_Secret+"&ex_nice="+ex_nice+"&ex_pic="+ex_pic;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if(ajax.readyState == 4 && ajax.status == 200) {	
	    vs  = ajax.responseText;						
        if(vs=="ok"){
		  top.location.href = "/ShopMy/Home/i.asp";
		}else{
		  scscms_alert(vs,"","",1);
		}
    }
  }

}










//退换货
function DioTHtheFormSave(){
var IDs = document.theForm.IDs.value;
var backdiv = document.theForm.backdiv.value;

var skzh = document.theForm.skzh.value;
var skxm = document.theForm.skxm.value;
var tkly = document.theForm.tkly.value;
var jiner = document.theForm.jiner.value;

if(jiner=="" || jiner<=0){
 scscms_alert("请填写退款金额","","",1);
 return false;
}
if (tkly==""){
 scscms_alert("请填写买家附言","","",1);
 return false;
}
if (skxm==""){
 scscms_alert("请填写微信钱包认证的实名","","",1);
 return false;
}


var url = "Dio.th.ok.asp";
var postStr = "IDs="+IDs+"&skzh="+skzh+"&skxm="+skxm+"&tkly="+tkly+"&jiner="+jiner ;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	    vs  = ajax.responseText;
        v = new Array;
        v = vs.split("$$$");
		
		if(v[0]=="ok"){		
		    hideDiv('addDiv');
			scscms_alert(v[1],"","",1);
			document.getElementById(backdiv).innerHTML = v[2];
		}else{
			scscms_alert(v[1],"","",1);
		}

  }
 }		
}




//确认收货
function DioSHtheFormSave(){
var IDs = document.theForm.IDs.value;
var backdiv = document.theForm.backdiv.value;

var url = "Dio.qr.ok.asp";
var postStr = "IDs="+IDs;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	    vs  = ajax.responseText;
        v = new Array;
        v = vs.split("$$$");
				
		    hideDiv('addDiv');
			scscms_alert(v[0],"","",1);
			document.getElementById(backdiv).innerHTML = v[1];


  }
 }		
}






//星星打分处理
function flagXingOK(id,fen){
var d = new Date();
var postStr = "fen="+fen;
var url = "Dio.xing.ok.asp";	

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
    document.getElementById("xingfen"+id).innerHTML = ajax.responseText;
	if(id==1){document.theForm.p_fen1.value = fen;}
	if(id==2){document.theForm.p_fen2.value = fen;}
	if(id==3){document.theForm.p_fen3.value = fen;}
	ThreeON();
  }
 }
 
}





//评价
function DioPJtheFormSave(){
var IDs = document.theForm.IDs.value;
var backdiv = document.theForm.backdiv.value;

var p_fen1 = document.theForm.p_fen1.value;
var p_fen2 = document.theForm.p_fen2.value;
var p_fen3 = document.theForm.p_fen3.value;
var p_mtxt = document.theForm.p_mtxt.value;

var url = "Dio.pj.ok.asp";
var postStr = "IDs="+IDs+"&p_fen1="+p_fen1+"&p_fen2="+p_fen2+"&p_fen3="+p_fen3+"&p_mtxt="+p_mtxt;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	    vs  = ajax.responseText;
        v = new Array;
        v = vs.split("$$$");
				
		    hideDiv('addDiv');
			scscms_alert(v[0],"","",1);
			document.getElementById(backdiv).innerHTML = v[1];


  }
 }
}




function is_zw(str){
	exp=/[0-9a-zA-Z_]/g;
	if(str.search(exp) != -1){
		return false;
	}
return true;
}

function CheckRegEmail(){ 
var a_user = document.RegForm.a_user.value;
var url = "FXReg.Check.asp";
var postStr = "action=Regemail&value="+a_user;

  if(a_user=="" || a_user.length < 5){ 
  document.getElementById("Reguseremail").innerHTML ='<font color=#FF0000><b>×</b> 请输入有效合法的域名前缀！</font>';
  }else{	
  ajax.open("POST", url, true);
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
  ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
	  document.getElementById("Regurl2").innerHTML = a_user;
      document.getElementById("Reguseremail").innerHTML = vs;
    }
  }
  }
}


function CheckRegPass1(){ 
  if(document.RegForm.a_pass.value.length<6){ 
  document.getElementById("Regpass1").innerHTML ='<font color=#FF0000><b>×</b> 密码不能小于6位,注意大小写。</font>';
  }else{	
  document.getElementById("Regpass1").innerHTML ='<font color=#3CC428><b>√</b> 密码格式正确。</font>';
  }
 }

function CheckRegPass2(){ 
  if(document.RegForm.a_pass.value!=document.RegForm.a_pass2.value){ 
  document.getElementById("Regpass2").innerHTML ='<font color=#FF0000><b>×</b> 两次密码不相符。</font>';
  }else{	
  document.getElementById("Regpass2").innerHTML ='<font color=#3CC428><b>√</b> 密码格式正确。</font>';
  }
 }
 
function CheckRegWW(){ 
var a_w = document.RegForm.a_w.value;
var url = "FXReg.Check.asp";
var postStr = "action=Regww&value="+a_w;

  if(a_w==""){ 
  document.getElementById("Reguserww").innerHTML ='<font color=#FF0000><b>×</b> 请准确填写您的微信号！</font>';
  }else{	
  ajax.open("POST", url, true);
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
  ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      document.getElementById("Reguserww").innerHTML = vs;
    }
  }
  }
}

function CheckRegQQ(){ 
var a_q = document.RegForm.a_q.value;
var url = "FXReg.Check.asp";
var postStr = "action=Regqq&value="+a_q;

  if(a_q==""){ 
  document.getElementById("Reguserqq").innerHTML ='<font color=#FF0000><b>×</b> 请准确填写您的QQ号！</font>';
  }else{	
  ajax.open("POST", url, true);
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
  ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      document.getElementById("Reguserqq").innerHTML = vs;
    }
  }
  }
}

function CheckRegTel(ruser){ 
var a_t = document.RegForm.a_t.value;
var url = "FXReg.Check.asp";
var postStr = "action=Regtel&value="+a_t;

  if(a_t==""){ 
  document.getElementById("Regusertel").innerHTML ='<font color=#FF0000><b>×</b> 请准确填写您的电话号码！</font>';
  }else{	
  ajax.open("POST", url, true);
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
  ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      document.getElementById("Regusertel").innerHTML = vs;
    }
  }
  }
}
 
  
 
function FXReg_chk(){
var fxpay = document.RegForm.fxpay.value;
var U = document.RegForm.U.value;
var R = document.RegForm.R.value;
var a_user = document.RegForm.a_user.value;
var a_pass = document.RegForm.a_pass.value;
var a_pass2 = document.RegForm.a_pass2.value;
var a_w = document.RegForm.a_w.value;
var a_t = document.RegForm.a_t.value;
var a_q = document.RegForm.a_q.value;

 if (R==2 && U==0){
 scscms_alert("请先登陆再申请加盟","","",1);
 return false;
 }
 if (a_user==""){
 scscms_alert("请输您的用户名","","",1);
 document.RegForm.a_user.focus();
 return false;
 }
 if (is_zw(a_user)){
  scscms_alert("用户名不能是中文文字","","",1);
  document.RegForm.a_user.focus();
  return false;
 }
 if (a_user.length<5){
 scscms_alert("用户名不能小于5个字符","","",1);
 document.RegForm.a_user.focus();
 return false;
 }
 if (a_pass==""){
 scscms_alert("密码不能是空值","","",1);
 document.RegForm.a_pass.focus();
 return false;
 }
 if (a_pass==a_user){
 scscms_alert("密码不能与用户名相同","","",1);
 document.RegForm.a_pass.focus();
 return false;
 } 
 if (a_pass.length<8){
 scscms_alert("密码不能低于6位的符号","","",1);
 document.RegForm.a_pass.focus();
 return false;
 }
 if (a_pass2==""){
 scscms_alert("确认密码不能是空值","","",1);
 document.RegForm.a_pass2.focus();
 return false;
 }
 if (a_pass2!=a_pass){
 scscms_alert("两次密码不一致","","",1);
 document.RegForm.a_pass2.focus();
 return false;
 }	
 if (a_w==""){
 scscms_alert("请输您的微信号","","",1);
 document.RegForm.a_w.focus();
 return false;
 }
 if (a_t=="" || a_t.length!=11){
 scscms_alert("请输您的联系电话","","",1);
 document.RegForm.a_t.focus();
 return false;
 }
 if (a_q==""){
 scscms_alert("请输您的QQ号","","",1);
 document.RegForm.a_q.focus();
 return false;
 }
	
var url = "FXReg.ok.asp";
var postStr = "fxpay="+fxpay+"&a_user="+a_user+"&a_pass="+a_pass+"&a_pass2="+a_pass2+"&a_w="+a_w+"&a_t="+a_t+"&a_q="+a_q+"&R="+R;
	
  ajax.open("POST", url, true);
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
  ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      v = new Array;
      v = vs.split("$$$");
		
	  if(v[0]=="ok"){
		  if(Number(fxpay)>0 && R==2){
			  scscms_alert(v[1],'ok',function(){top.location.href = "api/Alipay/alipayto.asp?out_trade_no="+v[2]+"&subject="+a_user+"加盟&total_fee="+fxpay});
		  }else{
			  scscms_alert(v[1],'ok',function(){top.location.href = "FXReg.asp?kt="+a_user});
		  }		  
	  }else{
		  scscms_alert(v[1],"","",1);
	  }
	  
    }
  }

}





//修改分销登陆密码
function FxDatatheFormSave(){
var pass1 = document.theForm.pass1.value;
var pass2 = document.theForm.pass2.value;

if(pass1==""){
 scscms_alert("密码不能是空值","","",1);
 return false;
}
if(pass1.length<8){
 scscms_alert("密码不能低于6位的符号","","",1);
 return false;
}
if(pass2==""){
 scscms_alert("确认密码不能是空值","","",1);
 return false;
}
if(pass2!=pass1){
 scscms_alert("两次密码不一致","","",1);
 return false;
}
 
var url = "Fxdata.ok.asp";
var postStr = "pass1="+pass1+"&pass2="+pass2;

  ajax.open("POST", url, true);
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
  ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      v = new Array;
      v = vs.split("$$$");
		
	  if(v[0]=="ok"){
		  
			  scscms_alert(v[1],'ok',function(){
				  document.theForm.pass1.value = "";
				  document.theForm.pass2.value = "";
				  });
		  
	  }else{
		  scscms_alert(v[1],"","",1);
	  }
	  
    }
  }

}




//更多会员卡
function kaSearchMore(){
var el = document.getElementById('kanewsList');
var li = document.createElement('li');
var lastid = document.kalist.lastid.value;
var lastnum = document.kalist.lastnum.value;

var postStr = "lastid="+lastid+"&lastnum="+lastnum;
ajax.open("POST", "Ka.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.kalist.lastid.value = v[1];
	document.kalist.lastnum.value = v[2];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }	
}





//生成推广二维码
function setTKerweima(){
var a_s = document.theForm.a_s.value;
var www = document.theForm.www.value;
var pic = encodeURIComponent(document.theForm.pic.value);
var emurl = encodeURIComponent(document.theForm.url.value);
var num = document.theForm.num.value;
var tt = document.theForm.tt.value;
var txt = document.theForm.txt.value;

var url = "/mp5.0/fok/SCAN.asp";
var postStr = "www="+www+"&pic="+pic+"&url="+emurl+"&num="+num+"&tt="+tt+"&txt="+txt+"&ccc="+a_s;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      v = new Array;
      v = vs.split("$$$");
	  //if(v[0]=="ok"){
        scscms_alert("已获取，有效期30天","","",3);  
		document.getElementById("tkerweima_div").style.display = "block";
		document.getElementById("tkerweima_img").innerHTML =  "<img src='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="+v[1]+"' width='200' height='200' />";	
	  //}else{
		//scscms_alert(v[0],"","",1);  
	  //}
  }
}
}




//加载更多推客订单
function TkDioMore(){
var el = document.getElementById('tkdingdanlist');
var li = document.createElement('li');
var lastid = document.tkdingdantxt.lastid.value;
var lastnum = document.tkdingdantxt.lastnum.value;
var t = document.tkdingdantxt.t.value;

var postStr = "t="+t+"&lastid="+lastid+"&lastnum="+lastnum;
ajax.open("POST", "Tk.Dio.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.tkdingdantxt.lastid.value = v[1];
	document.tkdingdantxt.lastnum.value = v[2];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }	
}





//推客佣金提现
function TktxtheFormSave(){
var alipayname = document.pushtxform.alipayname.value;

if(alipayname==""){
scscms_alert("请填写提现者实名","","",1);
return false;
}

var url = "Tk.tx.ok.asp";
var postStr = "alipayname="+alipayname;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      v = new Array;
      v = vs.split("$$$");
		
	  if(v[0]==1){
		  scscms_alert(v[1],'ok',function(){top.location.href = 'Tk.tx.asp'});
	  }else{
		  scscms_alert(v[1],"","",1);  
		  return false;
	  }
	
  }
}
}





//生成推广二维码
function sBuyerweima(){
var wwwpic = document.wxBuysForm.wwwpic.value;
var a_s = document.wxBuysForm.a_s.value;
var www = document.wxBuysForm.www.value;
var pic = encodeURIComponent(document.wxBuysForm.pic.value);
var emurl = encodeURIComponent(document.wxBuysForm.url.value);
var num = document.wxBuysForm.num.value;
var tt = document.wxBuysForm.tt.value;
var txt = document.wxBuysForm.txt.value;

var url = "/mp5.0/fok/SCAN.asp";
var postStr = "www="+www+"&pic="+pic+"&url="+emurl+"&num="+num+"&tt="+tt+"&txt="+txt+"&ccc="+a_s;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      v = new Array;
      v = vs.split("$$$");
	  if(v[1]!=""){
        //scscms_alert("已获取，有效期30天","","",3);  
		document.getElementById("wxBuyshowerweima").innerHTML =  "<img src='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="+v[1]+"' width='178' height='178' />";	
	  }else{
		document.getElementById("wxBuyshowerweima").innerHTML =  "<img src='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="+wwwpic+"' width='178' height='178' />";
	  }
  }
}
}






//收藏切换
function tabfavo(id){
var titfavo_dh_1 = Obj_ById('titfavo_dh_1');
var titfavo_dh_2 = Obj_ById('titfavo_dh_2');
var titfavo_txt = Obj_ById('titfavo_txt');

if(id==1){
	titfavo_dh_1.className = "titfavo_hover";
    titfavo_dh_2.className = "titfavo";
}else{
	titfavo_dh_1.className = "titfavo";
    titfavo_dh_2.className = "titfavo_hover";
}

var url = "Favorites.asp";
var postStr = "tt="+id;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      v = new Array;
      v = vs.split("$$$"); 
	  
	  titfavo_txt.innerHTML = v[0];	
	  document.titfavo.lastnum.value = v[1];
	  document.titfavo.tt.value = v[2];

  }
}

}




//更多收藏
function titfavoMore(){
var el = document.getElementById('titfavo_txt');
var li = document.createElement('li');
var tt = document.titfavo.tt.value;
var lastnum = document.titfavo.lastnum.value;

var postStr = "tt="+tt+"&lastnum="+lastnum;
ajax.open("POST", "Favorites.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.titfavo.tt.value = v[2];
	document.titfavo.lastnum.value = v[1];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }
}




//删除收藏
function deltitfavo(id){

var url = "Favorites.Del.asp";
var postStr = "IDs="+id;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      v = new Array;
      v = vs.split("$$$"); 
	  
	  scscms_alert(vs,"","",1);
	  Obj_ById('titfavo_dec'+id).style.display = "none";

  }
}	
}



//领卡
function editKa(id){
var U = document.kalist.U.value;

if(Number(U)<=0){
scscms_alert("请先登录","","",1);
return false;
}

var url = "Home/Ka.ok.asp";
var postStr = "kaID="+id;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      v = new Array;
      v = vs.split("$$$");

	  if(v[0]=="ok"){
	      scscms_alert(v[1],'ok',function(){document.getElementById("katxt").innerHTML = v[2]});
	  }else{
		  scscms_alert(v[1],"","",1);
	  }
	
  }
 }	
}






//加载更多金币订单
function JbDioMore(){
var el = document.getElementById('jbdingdanlist');
var li = document.createElement('li');
var lastid = document.jbdingdantxt.lastid.value;
var lastnum = document.jbdingdantxt.lastnum.value;
var t = document.jbdingdantxt.t.value;
var postStr = "t="+t+"&lastid="+lastid+"&lastnum="+lastnum;
ajax.open("POST", "Jb.Dio.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.jbdingdantxt.lastid.value = v[1];
	document.jbdingdantxt.lastnum.value = v[2];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }	
}



//金币提现
function JbtxtheFormSave(){
var alipayname = document.jinbitxform.alipayname.value;

if(alipayname==""){
scscms_alert("请填写提现者实名","","",1);
return false;
}

var url = "Jb.tx.ok.asp";
var postStr = "alipayname="+alipayname;

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      v = new Array;
      v = vs.split("$$$");
		
	  if(v[0]==1){
		  scscms_alert(v[1],'ok',function(){top.location.href = 'Jb.tx.asp'});
	  }else{
		  scscms_alert(v[1],"","",1);  
		  return false;
	  }
	
  }
}	
}



//签到
function ChinkinON(){
var U = document.signlist.U.value;

if(Number(U)<=0){
scscms_alert("请先登录","","",1);
return false;
}

var url = "Home/Sign.ok.asp";
var postStr = "";

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      v = new Array;
      v = vs.split("$$$");

      if(v[0]!=""){
	  scscms_alert(v[0],"","",1);
	  }else{
	  scscms_alert(v[1],'ok',function(){top.location.href = 'Home/Sign.jinbi.asp'});
	  }

  }
}

}




//更多签到
function signSearchMore(){
var el = document.getElementById('signList');
var li = document.createElement('li');
var lastid = document.signlist.lastid.value;
var lastnum = document.signlist.lastnum.value;
var postStr = "lastid="+lastid+"&lastnum="+lastnum;
ajax.open("POST", "Sign.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("没有更多内容加载","","",1);
	}else{
						  					
    li.innerHTML = v[0];
    document.signlist.lastid.value = v[1];
	document.signlist.lastnum.value = v[2];
	
	}

  }
  el.appendChild(li, el.childNodes[0]);
 }

}



//加盟入驻切换
function fxregfavo(id){
if(id==1){
	document.RegForm.R.value = 1;
	document.RegForm.sum.value = "立即入驻";
	Obj_ById('fxregfavo_money').style.display = "none";
	Obj_ById('fxregfavo_dh_1').className = "fxregfavo_hover";
	Obj_ById('fxregfavo_dh_2').className = "fxregfavo";
}else{
	document.RegForm.R.value = 2;
	document.RegForm.sum.value = "立即加盟";
	Obj_ById('fxregfavo_money').style.display = "block";
	Obj_ById('fxregfavo_dh_1').className = "fxregfavo";
	Obj_ById('fxregfavo_dh_2').className = "fxregfavo_hover";
}

}



//微信扫码支付
function wxNativePay(){
document.NativePay.action="/pay/NativePay";
document.NativePay.submit();
}



