/**
 * 初始化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(); 


var oneScroll,
    logomsOffset,
	pullDownEl, pullDownOffset,
	pullUpEl, pullUpOffset,
	twoScroll,
	TwologomsOffset,
	TwoDownEl, TwoDownOffset,
	footerScroll,
	footerDownEl, footerDownOffset
	

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


	
	
/**
 * 登陆判断
 */
//function cookiesLogin(txt){if(txt=="登陆失效"){scscms_alert('该账户已在别处登陆','ok',function(){self.location='Login.asp'});}}
function cookiesLogin(txt){if(txt=="登陆失效"){checkWatchLinkDIV();return;}}



/**
 * 无样式切换
 */
function nonsKeys(nam){
var menu = document.getElementById(nam+"nn");
if(menu.style.display=="block"){
menu.style.display="none";	
}else{
menu.style.display="block";
}
}

/**
 * 有样式切换
 */
function nsKeys(co,n,nam){

for(i=1;i<=n;i++){
	
var menu = document.getElementById(nam+"nn"+i);
menu.style.display=i==co?"block":"none";

var bann = document.getElementById(nam+"cc"+i);
bann.className=i==co?"bangdingx_hover":"bangdingx";

}

}


/**
 * 分享层关闭与显示
 */
function checkShareLinkDIV(){
var sharetxtON = document.formUrl.sharetxtON.value;	

	
if(sharetxtON==0){
document.getElementById("sharetxt").style.display="block";
document.formUrl.sharetxtON.value=1;
}else{
document.getElementById("sharetxt").style.display="none";
document.formUrl.sharetxtON.value=0;	
}


}

/**
 * 推客分享层关闭与显示
 */
function checkShareLinkDIVtk(){
var sharetxtON = document.formUrl.sharetxtON.value;
var utitle = document.thisutitle.utitle.value;
var flag = is_weixin();
if (utitle!="0"){
if(flag){
if(sharetxtON==0){
document.getElementById("sharetxt").style.display="block";
document.formUrl.sharetxtON.value=1;
}else{
document.getElementById("sharetxt").style.display="none";
document.formUrl.sharetxtON.value=0;	
}
}else{
if(sharetxtON==0){
document.getElementById("nowxsharetxt").style.display="block";
document.formUrl.sharetxtON.value=1;
}else{
document.getElementById("nowxsharetxt").style.display="none";
document.formUrl.sharetxtON.value=0;	
}
}
}else{
scscms_alert('请填写店铺名称','ok',function(){oneChickUrl('Push.edit.asp',1)});

}
}


/**
 * 关注层关闭与显示
 */
function checkWatchLinkDIV(){
var is_wxtype = document.formUrl.is_wxtype.value;
var is_weixin = document.formUrl.is_weixin.value;
var watchtxtON = document.formUrl.watchtxtON.value;	

if(is_wxtype==4 && is_weixin==1){
	top.location.href = "http://"+document.domain+"/MP5.0/TenWXOpenid/Login.asp";
}else{

if(watchtxtON==0){
document.getElementById("watchtel").style.display="block";
document.formUrl.watchtxtON.value=1;
}else{
document.getElementById("watchtel").style.display="none";
document.formUrl.watchtxtON.value=0;	
}

}
}

	

/**
 * 关闭其他浮动层
 */
document.onclick = function (event) {  
    var e = event || window.event;  
    var elem = e.srcElement || e.target;  
  
    while (elem) {  
        if (elem != document) {  
            if (elem.id == "headerListButton") {  
				//document.getElementById("headerList").style.display = "block"; 
				Let('#headerList')
				  .set('opacity', 0)
				  .set({'display': 'block'})
				  .then() 
				  .duration(300) 
				  .set('opacity', 1)
				.pop()
				.end() 
                return;  
            } 
			if (elem.id == "titlebutton") {  
				//document.getElementById("titleadd").style.display = "block";
				Let('#titleadd')
				  .set('opacity', 0)
				  .set({'display': 'block'})
				  .then() 
				  .duration(300) 
				  .set('opacity', 1)
				.pop()
				.end()
                return;  
            } 
            elem = elem.parentNode;  
        } else {  
			
			Let('#headerList')
			  .set('opacity', 1)
			  .then() 
			  .duration(300) 
			  .set('opacity', 0)    
			  .set({'display': 'none'})
			.pop()
			.end()
			
			Let('#titleadd')
			  .set('opacity', 1)
			  .then() 
			  .duration(300) 
			  .set('opacity', 0)    
			  .set({'display': 'none'})
			.pop()
			.end()

            return;  
        }  
    }  
}








	
	
	
	
	
	
/*菜单伸缩按钮*/
function footmenuON(id,url,t) {
var wh = document.body.clientWidth-45;
var on2 = document.formUrl.twoON.value;
var on3 = document.formUrl.threeON.value;
var on4 = document.formUrl.fourON.value;
var on5 = document.formUrl.fiveON.value;
var on6 = document.formUrl.sixON.value;

//document.getElementById('footbb'+id).style.background = 'url(Images/footertitle_2.png)';
document.getElementById('wrapper').style.width = wh+'px';
document.getElementById('main').style.width = wh+'px';
document.getElementById('scroller').style.width = wh+'px';
document.getElementById('OneTitle').style.width = wh+'px';
document.getElementById('OneTitlex').style.width = wh+'px';


//Let('#footbb'+id)
//    .set('opacity', 1)
//    .then()
//    .set({
//			'background':'url(Images/footertitle_2.png)'
// 		})
//    .pop()
//    .end()	
//	
//Let('#wrapper')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
//	
//Let('#main')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
//
//Let('#scroller')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
//	
//Let('#OneTitle')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()


if(id==9){
SixON(url,t);	
}else{

if(on2==1){TwoON();}
if(on3==1){ThreeON();}
if(on4==1){FourON();}
if(on5==1){FiveON();}
if(on6==1){SixON();}

oneChickUrl(url,t);
clearTimeout(mGetTime);
}


}





//第二层开关
function TwoON(url,t){
var on = document.formUrl.twoON.value;
var wh = document.body.clientWidth-45;

document.getElementById('Twomain').style.width = wh+'px';
document.getElementById('TwoContent').style.width = wh+'px';
document.getElementById('TwoTitle').style.width = wh+'px';
document.getElementById('TwoTitlex').style.width = wh+'px';

//Let('#TwoContent')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
//Let('#TwoTitle')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
									
if(on==0){
	
document.getElementById('Twomain').style.display = "block";

//Let('#Twomain')
//    .set({'width': wh})
//	.to(wh, 0)
//	.set({
//			'display': 'block'
// 		})
//    .then() //中间动作,上面是开始动作 下面是结束动作
//    .duration(300) //持续时间
//    .to(-wh, 0)
//    .pop()
//    .end()
document.formUrl.twoON.value=1;
twoChickUrl(url,t);
}else{

document.getElementById('Twomain').style.display = "none";

//WeixinApi.ready(function(Api) {
//  var wxData = {
//      "appId": '', // 服务号可以填写appId
//      "imgUrl" : document.formUrl.ShareWximgUrl.value,
//      "link" : document.formUrl.ShareWxlink.value,
//      "desc" : document.formUrl.ShareWxdesc.value,
//      "title" : document.formUrl.ShareWxtitle.value
//  };
//  var wxCallbacks = {
//      fail : function(resp) {
//      scscms_alert("分享失败:" + resp.err_msg,"",2);
//      }
//  };
//  Api.shareToFriend(wxData, wxCallbacks);
//  Api.shareToTimeline(wxData, wxCallbacks);
//  Api.shareToWeibo(wxData, wxCallbacks);
//  Api.generalShare(wxData,wxCallbacks);
//  });
//Let('#Twomain')
//	.to(wh, 0)
//    .then() //中间动作,上面是开始动作 下面是结束动作
//    .duration(300) //持续时间
//	.set({
//			'display': 'none'
// 		})
//    .pop()
//    .end()
document.formUrl.twoON.value=0;
}	
}





//第三层开关
function ThreeON(url,t){
var on = document.formUrl.threeON.value;
var wh = document.body.clientWidth-45;

document.getElementById('Threemain').style.width = wh+'px';
document.getElementById('ThreeContent').style.width = wh+'px';
document.getElementById('ThreeTitle').style.width = wh+'px';
document.getElementById('ThreeTitlex').style.width = wh+'px';

//Let('#ThreeContent')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
//Let('#ThreeTitle')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
							
if(on==0){

document.getElementById('Threemain').style.display = "block";

//Let('#Threemain')  
//	.set({'width': wh})
//	.to(wh, 0)
//	.set({
//			'display': 'block'
// 		})
//    .then() //中间动作,上面是开始动作 下面是结束动作
//    .duration(300) //持续时间
//    .to(-wh, 0)
//    .pop()
//    .end()
document.formUrl.threeON.value=1;
threeChickUrl(url,t);
}else{

document.getElementById('Threemain').style.display = "none";

//Let('#Threemain')
//	.to(wh, 0)
//    .then() //中间动作,上面是开始动作 下面是结束动作
//    .duration(300) //持续时间
//	.set({
//			'display': 'none'
// 		})
//    .pop()
//    .end()
document.formUrl.threeON.value=0;
}	
}








//第四层开关
function FourON(url,t){
var on = document.formUrl.fourON.value;
var wh = document.body.clientWidth-45;

document.getElementById('Fourmain').style.width = wh+'px';
document.getElementById('FourContent').style.width = wh+'px';
document.getElementById('FourTitle').style.width = wh+'px';
document.getElementById('FourTitlex').style.width = wh+'px';

//Let('#FourContent')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
//Let('#FourTitle')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
								
if(on==0){

document.getElementById('Fourmain').style.display = "block";

//Let('#Fourmain')  
//    .set({'width': wh})
//	.to(wh, 0)
//	.set({
//			'display': 'block'
// 		})
//    .then() //中间动作,上面是开始动作 下面是结束动作
//    .duration(300) //持续时间
//    .to(-wh, 0)
//    .pop()
//    .end()
document.formUrl.fourON.value=1;
fourChickUrl(url,t);
}else{

document.getElementById('Fourmain').style.display = "none";

//Let('#Fourmain')
//	.to(wh, 0)
//    .then() //中间动作,上面是开始动作 下面是结束动作
//    .duration(300) //持续时间
//	.set({
//			'display': 'none'
// 		})
//    .pop()
//    .end()
document.formUrl.fourON.value=0;
}	
}












//第五层开关
function FiveON(url,t){
var on = document.formUrl.fiveON.value;
var wh = document.body.clientWidth-45;

document.getElementById('Fivemain').style.width = wh+'px';
document.getElementById('FiveContent').style.width = wh+'px';
document.getElementById('FiveTitle').style.width = wh+'px';
document.getElementById('FiveTitlex').style.width = wh+'px';

//Let('#FiveContent')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
//Let('#FiveTitle')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
								
if(on==0){

document.getElementById('Fivemain').style.display = "block";
	
//Let('#Fivemain')  
//	.set({'width': wh})
//	.to(wh, 0)
//	.set({
//			'display': 'block'
// 		})
//    .then() //中间动作,上面是开始动作 下面是结束动作
//    .duration(300) //持续时间
//    .to(-wh, 0)
//    .pop()
//    .end()
document.formUrl.fiveON.value=1;
fiveChickUrl(url,t);
}else{

document.getElementById('Fivemain').style.display = "none";

//Let('#Fivemain')
//	.to(wh, 0)
//    .then() //中间动作,上面是开始动作 下面是结束动作
//    .duration(300) //持续时间
//	.set({
//			'display': 'none'
// 		})
//    .pop()
//    .end()
document.formUrl.fiveON.value=0;
}	
}









//第六层开关
function SixON(url,t){
var on = document.formUrl.sixON.value;
var wh = document.body.clientWidth-45;

document.getElementById('Sixmain').style.width = wh+'px';
document.getElementById('SixContent').style.width = wh+'px';
document.getElementById('SixTitle').style.width = wh+'px';
document.getElementById('SixTitlex').style.width = wh+'px';

//Let('#SixContent')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
//Let('#SixTitle')
//	.set({'width': wh})
//	.then()
//	.set('opacity', 1)
//    .pop()
//    .end()
								
if(on==0){

document.getElementById('Sixmain').style.display = "block";

//Let('#Sixmain')  
//	.set({'width': wh})
//	.to(wh, 0)
//	.set({
//			'display': 'block'
// 		})
//    .then() //中间动作,上面是开始动作 下面是结束动作
//    .duration(300) //持续时间
//    .to(-wh, 0)
//    .pop()
//    .end()
document.formUrl.sixON.value=1;
sixChickUrl(url,t);
}else{

document.getElementById('Sixmain').style.display = "none";

//Let('#Sixmain')
//	.to(wh, 0)
//    .then() //中间动作,上面是开始动作 下面是结束动作
//    .duration(300) //持续时间
//	.set({
//			'display': 'none'
// 		})
//    .pop()
//    .end()
document.formUrl.sixON.value=0;
}	
}





























/*内容部分伸缩按钮*/
function SlideON(iv) {
var on = document.getElementById("a_"+iv).value;
var cl = document.getElementById(iv+"n").className;
if(on==0){

if(cl=="SlideButtonHrefArr"){
Let('#'+iv+'n')
    .set('opacity', 1)
    .then() 
    .duration(300) 
    .to(0, 0)
    .pop()
    .end()	
}else{
Let('#'+iv+'n')
    .set('opacity', 1)
    .then() 
    .duration(300) 
    .to(22, 0)
    .pop()
    .end()
}
	
Let('#'+iv)
    .set({
			'background-color': '#D7D7D7',
 		})
    .then() 
    .duration(300) 
    .set({
			'background-color': '#00E367',
 		})
    .pop()
    .end()
	
document.getElementById("a_"+iv).value = 1;

}else{

if(cl=="SlideButtonHrefArr"){
Let('#'+iv+'n')
    .set('opacity', 1)
    .then() 
    .duration(300) 
    .to(-22, 0)
    .pop()
    .end()	
}else{
Let('#'+iv+'n')
    .set('opacity', 1)
    .then() 
    .duration(300) 
    .to(0, 0)
    .pop()
    .end()
}	
	
Let('#'+iv)
    .set({
			'background-color': '#00E367',
 		})
    .then() 
    .duration(300) 
    .set({
			'background-color': '#D7D7D7',
 		})
    .pop()
    .end()	

document.getElementById("a_"+iv).value = 0;

}		
}


















//区域选择
function City(t,ceng){
var city_id = document.paybuyform.city_id.value;
var city1_id = document.paybuyform.city1_id.value;
var city2_id = document.paybuyform.city2_id.value;

var url = "City.asp?t="+t+"&city_id="+city_id+"&city1_id="+city1_id+"&city2_id="+city2_id+"&ceng="+ceng;

if(t==2){
    if(city_id=="" || city_id==0){scscms_alert("请先选择所在省","","",1);return false;}	
}

if(t==3){
    if(city1_id=="" || city1_id==0){scscms_alert("请先选择所在市","","",1);return false;}		
}

if(ceng==2){
	TwoON(url,2);
}else if(ceng==3){
	ThreeON(url,2);
}else if(ceng==4){
	FourON(url,2);
}else if(ceng==5){
	FiveON(url,2);
}

}


//区域值回传
function CitySelected(id,nam,t,ceng){

if(t==1){
	document.paybuyform.city_id.value = id;
	document.paybuyform.city.value = nam;
	document.paybuyform.city1_id.value = 0;
	document.paybuyform.city1.value = "";
	document.paybuyform.city2_id.value = 0;
	document.paybuyform.city2.value = "";
}else if(t==2){
	document.paybuyform.city1_id.value = id;
	document.paybuyform.city1.value = nam;
	document.paybuyform.city2_id.value = 0;
	document.paybuyform.city2.value = "";
}else if(t==3){
	document.paybuyform.city2_id.value = id;
	document.paybuyform.city2.value = nam;
}


if(ceng==2){
	TwoON();
}else if(ceng==3){
	ThreeON();
}else if(ceng==4){
	FourON();
}else if(ceng==5){
	FiveON();
}	
	
}







//运费区域选择
function CityYunfei(t,ceng,iii){
var selid = document.paybuyform.selid.value;
var city_id = document.paybuyform.city_id.value;
var city1_id = document.paybuyform.city1_id.value;
var city2_id = document.paybuyform.city2_id.value;

var url = "City.yunfei.asp?t="+t+"&city_id="+city_id+"&city1_id="+city1_id+"&city2_id="+city2_id+"&ceng="+ceng+"&selid="+selid+"&iii="+iii;

if(t==2){
    if(city_id=="" || city_id==0){scscms_alert("请先选择所在省","","",1);return false;}	
}

if(t==3){
    if(city1_id=="" || city1_id==0){scscms_alert("请先选择所在市","","",1);return false;}		
}

if(ceng==2){
	TwoON(url,2);
}else if(ceng==3){
	ThreeON(url,2);
}else if(ceng==4){
	FourON(url,2);
}else if(ceng==5){
	FiveON(url,2);
}

}


//区域值回传
function CityYunfeiSelected(id,nam,t,ceng,selid,iii){
var v_amount = document.paybuyform.v_amount.value;
var iiiw = document.paybuyform.iiiw.value;
var iiim = document.paybuyform.iiim.value;
var d = new Date();
var url = "Pay.buy.yunfei.asp";
var postStr = "t="+t+"&cityid="+id+"&selid="+selid+"&v_amount="+v_amount+"&iii="+iii;
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("paybuyxxxtxt1").innerHTML = v[0];
		document.getElementById("paybuyxxxtxt2").innerHTML = v[1];
		document.paybuyform.yunfei.value = v[2];
		document.paybuyform.chengbenyunfei.value = v[3];
		
		document.paybuyform.qdyh.value = 0;
		document.paybuyform.qdyhVS.value = "";	
		
		document.paybuyform.smzt.value = 0;
		if(iiiw==1 || iiim==1){
        document.getElementById("Websmzt").className = "payfs";	
		}
				
		if(t==1){
			document.paybuyform.city_id.value = id;
			document.paybuyform.city.value = nam;
			document.paybuyform.city1_id.value = 0;
			document.paybuyform.city1.value = "";
			document.paybuyform.city2_id.value = 0;
			document.paybuyform.city2.value = "";
		}else if(t==2){
			document.paybuyform.city1_id.value = id;
			document.paybuyform.city1.value = nam;
			document.paybuyform.city2_id.value = 0;
			document.paybuyform.city2.value = "";
		}else if(t==3){
			document.paybuyform.city2_id.value = id;
			document.paybuyform.city2.value = nam;
		}

		if(ceng==2){
			TwoON();
		}else if(ceng==3){
			ThreeON();
		}else if(ceng==4){
			FourON();
		}else if(ceng==5){
			FiveON();
		}		
    }
}	
	
}







//全店旺铺优惠选择
function GameMan(ceng){
var v_amount = document.paybuyform.v_amount.value;
var yunfei = document.paybuyform.yunfei.value;
var countall = document.paybuyform.countall.value;
var qdyh = document.paybuyform.qdyh.value;
var v_qianggoupay = document.paybuyform.v_qianggoupay.value;

var url = "Game.man.asp?amount="+v_amount+"&yunfei="+yunfei+"&countall="+countall+"&ceng="+ceng+"&game_id="+qdyh+"&v_qianggoupay="+v_qianggoupay;

if(ceng==2){
	TwoON(url,2);
}else if(ceng==3){
	ThreeON(url,2);
}else if(ceng==4){
	FourON(url,2);
}else if(ceng==5){
	FiveON(url,2);
}

}


//全店旺铺优惠值回传
function GameManSelected(nam,ceng,v,vs){

	document.paybuyform.qdyh.value = v;
	document.paybuyform.qdyhVS.value = nam;
	//document.paybuyform.v_amount.value = v;
	document.getElementById("paybuyxxxtxt2").innerHTML = vs;

if(ceng==2){
	TwoON();
}else if(ceng==3){
	ThreeON();
}else if(ceng==4){
	FourON();
}else if(ceng==5){
	FiveON();
}	
	
}










//URL 跳转
function cengRefresh(ceng){
	
  if(ceng==-1){
	        fooScroll.refresh();
  }else if(ceng==1){
	        oneScroll.refresh();
  }else if(ceng==2){
	        twoScroll.refresh();
  }else if(ceng==3){
	        threeScroll.refresh();
  }else if(ceng==4){
	        fourScroll.refresh();
  }else if(ceng==5){
	        fiveScroll.refresh();
  }

}

























//激活textarea高度根据内容自适应
if (window.attachEvent) {
    observe = function (element, event, handler) {
        element.attachEvent('on'+event, handler);
    };
}
else {
    observe = function (element, event, handler) {
        element.addEventListener(event, handler, false);
    };
}
function formTextareaHeight(ceng) {
    var text = document.getElementById('formTextareasumText');
    function resize () {
        text.style.height = 'auto';
        text.style.height = text.scrollHeight+'px';
    }
    /* 0-timeout to get the already changed text */
    function delayedResize () {
        window.setTimeout(resize, 0);
    }
    observe(text, 'change',  resize);
    observe(text, 'cut',     delayedResize);
    observe(text, 'paste',   delayedResize);
    observe(text, 'drop',    delayedResize);
    observe(text, 'keydown', delayedResize);

    text.focus();
    text.select();
    resize();
	cengRefresh(ceng);
}





//激活textarea表单
function formTextarea(title,nam,ceng,id){
var url = "formTextarea.asp?nam="+nam+"&title="+title+"&ceng="+ceng+"&id="+id;

if(ceng==2){
	TwoON(url,1);
}else if(ceng==3){
	ThreeON(url,1);
}else if(ceng==4){
	FourON(url,1);
}else if(ceng==5){
	FiveON(url,1);
}

}



//返回textarea表单值
function formTextareaOk(){
var nam = document.formTextareasum.nam.value;
var ceng = document.formTextareasum.ceng.value;
var v = document.formTextareasum.v.value;

var namev = document.getElementById(nam);

namev.value = v;

if(ceng==2){
    TwoON();
}else if(ceng==3){
    ThreeON();
}else if(ceng==4){
	FourON();
}else if(ceng==5){
	FiveON();
}
  
}































//横向滑动总触发
function touchAll(id) {
	
  switch(id){
	case "Buy.asp": 
	     touchmoveON("move",60); 
	     break;
	
  }
	
}

//横向滑动单个触发
function touchmoveON(id,v) {
var ic=document.touchmove.ic.value;	
if(ic>0){
	
$("#"+id).ready(function(){
var stx=sty=etx=ety=curX=curY=0;

  for(i=1;i<=ic;i++){
  $("#"+id+"div"+i).get(0).addEventListener("touchstart",function(event){
    stx=event.touches[0].pageX;
    sty=event.touches[0].pageY;
  },false);
  $("#"+id+"div"+i).get(0).addEventListener("touchmove",function(event){
    event.preventDefault(); 
    curX = event.targetTouches[0].pageX - stx+etx; 
    curY = 0;//event.targetTouches[0].pageY - sty+ety;
					 
      if(curX>-49){
      event.targetTouches[0].target.style.webkitTransform =  'translate(' + (0) + 'px, ' + (curY) + 'px)';
      }else if(curX>-50){
      event.targetTouches[0].target.style.webkitTransform =  'translate(' + (curX) + 'px, ' + (curY) + 'px)';
      }else if(curX<-50){
      event.targetTouches[0].target.style.webkitTransform =  'translate(' + (-v) + 'px, ' + (curY) + 'px)';
      } 
					 
    },false);
                
  }
						 
});
}		   
}




























































































//商品类目检索
function shopmenuSelected(nt){
var url = "Shop.asp?menu="+nt;
footmenuON(4,url,2)
}


//商品关键词检索
function searchShopKyes(){
var menu = document.shopkeys.menu.value;
var keys = document.shopkeys.keys.value;

var url = "Shop.asp?menu="+menu+"&keys="+keys;

oneChickUrl(url,2);
 
}



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

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

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 = "Show.show.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;
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 Kanshowxrr(name,cursel,n,fo,Va){
for(i=0;i<=n;i++){
var menu=document.getElementById(name+i);
menu.className=i==cursel?"xLinkb":"xLinka";
}

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

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_id = document.shopshowaddform.HY_id.value;
var HY_artflag = document.shopshowaddform.HY_artflag.value;

var d = new Date();
var url = "Kan.show.wincolor.asp";
var postStr = "HY_win="+HY_win+"&HY_color="+HY_color+"&HY_paystr="+HY_paystr+"&HY_Count="+HY_Count+"&d="+d+"&HY_gyNpaystr="+HY_gyNpaystr+"&HY_id="+HY_id+"&HY_artflag="+HY_artflag;
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];
		document.shopshowaddform.HY_timepay.value = v[7];
    }
}
}

//砍价购买数量
function CheckFormKanshowCount(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 kanjiaShopshowBuy(){
var HY_id = document.shopshowaddform.HY_id.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_timepay = document.shopshowaddform.HY_timepay.value;
var HY_win = document.shopshowaddform.HY_win.value;
var HY_color = document.shopshowaddform.HY_color.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_hisCount = document.shopshowaddform.HY_hisCount.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 = "kan.show.reg.asp";
var postStr = "HY_id="+HY_id+"&HY_pay="+HY_pay+"&HY_payl="+HY_payl+"&HY_xpayl="+HY_xpayl+"&HY_timepay="+HY_timepay+"&HY_win="+HY_win+"&HY_color="+HY_color;
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]=="登陆失效"){checkWatchLinkDIV();return;}
		
        if(v[0]==1){
		scscms_alert(v[1],"","",1);
		document.getElementById("kanjiabut").innerHTML = v[2];
		document.getElementById("kanjiabuttxt").innerHTML = v[3];
		document.getElementById("shopshowaddpaylll").innerHTML = v[4];
		document.shopshowaddform.HY_payl.value = v[5];
		document.shopshowaddform.HY_timepay.value = v[6];
		}else{
		scscms_alert(v[1],"","",1);
		}

    }
}

}






//加入购物车
function saveShopshowBuy(){
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_www = document.shopshowaddform.HY_www.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 = "Show.show.buy.asp";
var postStr = "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_www="+HY_www+"&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("$$$");
		
		if(v[0]=="登陆失效"){checkWatchLinkDIV();return;}
		
        scscms_alert(v[0],"","",1);
		footerDownAction()
    }
}
	
}

//下单
function saveShopshowBuyOK(){
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 is_weixin = document.formUrl.is_weixin.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_www = document.shopshowaddform.HY_www.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 = "Show.show.buyok.asp";
var postStr = "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_www="+HY_www+"&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("$$$");
		
		if(v[0]=="登陆失效"){checkWatchLinkDIV();return;}
		
		var backurl = "Pay.buy.asp?iii="+v[2]+"&Nidsel="+v[1]+"&d="+d+"&is_wx="+is_weixin;
		
		if(v[1]!=0){
		scscms_alert(v[0],'ok',function(){oneChickUrl(backurl,1)});
		}else{
		scscms_alert(v[0],"","",1);
		}
		footerDownAction();
    }
}	
}










//购物车复选合计
function CheckBuyCheckboxSel(id,nam,cv){
var name = document.getElementById(nam);	
var sel = document.editbuyform.sel.value;

if(cv<=0){
scscms_alert("该商品库存不足","","",1);
return false;
}else{

if(name.className=="boucheckboxnull"){
suanfa = "jia";	
name.className = "boucheckboxright";
}else{
suanfa = "jian";
name.className = "boucheckboxnull";	
}

var url = "Buy.checkbox.asp";
var postStr = "id="+id+"&sel="+sel+"&suanfa="+suanfa;
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.editbuyform.sel.value = v[0];
		document.getElementById("buyheji").innerHTML = v[1];
    }
}

}
}


//购物车删除后合计
function delBuyboxSel(id){
var sel = document.editbuyform.sel.value;
var selallstr = "";
selstr = sel.split(",");
for(i=0;i<selstr.length;i++){
    if(id!=selstr[i]){
	    if(selallstr!=""){
			selallstr = selallstr+","+selstr[i];
		}else{
			selallstr = selstr[i];
		}
    }
}

var url = "Buy.checkbox.asp";
var postStr = "id="+id+"&sel="+selallstr+"&suanfa=jia";
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.editbuyform.sel.value = v[0];
		document.getElementById("buyheji").innerHTML = v[1];
    }
}

}


//购物车删除
function delBuy(id,dv){
var d = new Date();
var url = "Buy.del.asp";
var postStr = "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){
    delBuyboxSel(id);
	document.getElementById(dv).style.display = "none";
	//footerDownAction();
  }
 oneScroll.refresh();
 }	
}



//提交购物车
function saveBuy(uiii){
var sel = document.editbuyform.sel.value;
var is_weixin = document.formUrl.is_weixin.value;

if(sel==""){
  scscms_alert("请选择结算商品","","",1);
  return false;    	
}
 
var url = "Buy.right.asp";
var postStr = "sel="+sel;
 
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==""){
	TwoON("Pay.buy.asp?iii="+uiii+"&sel="+sel+"&is_wx="+is_weixin,1)
	}else{
	scscms_alert(vs,"","",1);
	}
	
  }
 }
 
}




//支付方式选择
function PayfsON(nam,v){
var c=document.paybuyform.zffsc.value
for(i=0;i<c;i++){
document.getElementById("Webzffs"+i).className = "payfs";	
}

document.getElementById(nam).className = "payfsArr";
document.paybuyform.zffs.value = v;
}

//加盟支付方式选择
function PayfxfsON(nam,v){
var c=document.zmsform.zffsc.value
for(i=0;i<c;i++){
document.getElementById("Webzffs"+i).className = "payfs";	
}

document.getElementById(nam).className = "payfsArr";
document.zmsform.zffs.value = v;
}

//加盟支付方式选择
function PaymdfsON(nam,v){
var c=document.checkform.zffsc.value
for(i=0;i<c;i++){
document.getElementById("Webzffs"+i).className = "payfs";	
}

document.getElementById(nam).className = "payfsArr";
document.checkform.zffs.value = v;
}






//保存个人信息
function saveUserdata(){
var gourl = document.paybuyform.gourl.value;
var ex_nice = document.paybuyform.ex_nice.value;
var ex_weixin = document.paybuyform.ex_weixin.value;
var ex_city = document.paybuyform.city_id.value;
var ex_city1 = document.paybuyform.city1_id.value;
var ex_city2 = document.paybuyform.city2_id.value;
var ex_add = document.paybuyform.ex_add.value;
var ex_name = document.paybuyform.ex_name.value;

var d = new Date();
var url = "User.add.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;

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

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(){top.location.href = gourl});
	  }else{
	    scscms_alert(v[1],"","",1);
	  }
  }
 }	

}


//保存手机及密码
function saveUserteldata(){
var gourl = document.paybuyform.gourl.value;
var ex_mtel = document.paybuyform.ex_mtel.value;
var ex_code = document.paybuyform.ex_code.value;
var ex_pass = document.paybuyform.ex_pass.value;
var ex_pass2 = document.paybuyform.ex_pass2.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(ex_code==""){
 scscms_alert("请输入有效的短信验证码","","",1);
 return false;
}

var url = "User.tel.ok.asp";
var postStr = "ex_mtel="+ex_mtel+"&ex_code="+ex_code+"&ex_pass="+ex_pass+"&ex_pass2="+ex_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(){top.location.href = gourl});
	  }else{
	    scscms_alert(v[1],"","",1);
	  }
	
	
  }
 }

}


var codeUsermtel;
function Usermtelcode_chk(){
var ex_mtel = document.paybuyform.ex_mtel.value;
var a_s = document.paybuyform.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("Usermteltt").innerHTML = "";
	  
var url = "User.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.paybuyform.a_s.value=1; 
		scscms_alert("验证码已发送，请注意查看手机","","",1);
		codeUsermtel = setInterval("Usermtelcode_chk()",1000);
		}else{
		scscms_alert(vs,"","",1);
		document.getElementById("Usermteltt").innerHTML = "<a href='javascript:Usermtelcode_chk();'><font color='#ffffff'>获取</font></a>";
		clearTimeout(codeUsermtel);	
		}
    }
  }	  	
		
}else if(a_s>0 && a_s<300){
	  allas = Number(document.paybuyform.a_s.value)+1;
	  allsa = 300 - allas;
	  document.paybuyform.a_s.value = allas; 
	  document.getElementById("Usermteltt").innerHTML = allsa;
}else if(a_s>=300){
      document.getElementById("Usermteltt").innerHTML = "<a href='javascript:Usermtelcode_chk();'><font color='#ffffff'>获取</font></a>";
	  document.paybuyform.a_s.value = 0;
	  clearTimeout(codeUsermtel);	
}



}








//分销商加盟申请
function saveUserfxdata(){
var openid = document.zmsform.openid.value; 
var username = document.zmsform.username.value;
var userpass = document.zmsform.userpass.value;
var userpass2 = document.zmsform.userpass2.value;
var usertel = document.zmsform.usertel.value;
var userweixin = document.zmsform.userweixin.value;
var userqq = document.zmsform.userqq.value;
var fxpay = document.zmsform.fxpay.value;
var zffs = document.zmsform.zffs.value;

var is_weixin = document.formUrl.is_weixin.value;

var url = "Zms.ok.asp";
var postStr = "username="+username+"&userpass="+userpass+"&usertel="+usertel+"&userweixin="+userweixin+"&userqq="+userqq+"&fxpay="+fxpay+"&zffs="+zffs;

if(username==""){
scscms_alert("请填写旺铺用户名","","",1);
}else if(is_zw(username)){
scscms_alert("旺铺用户名不能是中文文字","","",1);
}else if(username.length<5){
scscms_alert("旺铺用户名不能小于5个字符","","",1);
}else if(userpass==""){
scscms_alert("密码不能是空值","","",1);
}else if(userpass.length<8){
scscms_alert("密码不能小于8个字符","","",1);
}else if(userpass2==""){
scscms_alert("确认密码不能是空值","","",1);
}else if(userpass!=userpass2){
scscms_alert("两次密码不相辅","","",1);
}else if(usertel==""){
scscms_alert("请输您的联系手机号码","","",1);
}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;
      v = new Array;
      v = vs.split("$$$");
	  
	  document.zmsform.username.value = "";

	  if(v[1]!=0){
		  if(v[2]==3){
		  	  scscms_alert(v[0],'ok',function(){top.location.href='tenWXpay/index.asp?tt=JM&id='+ v[1] +'&openid='+openid});
		  }else if(v[2]==2){
			  scscms_alert(v[0],'ok',function(){top.location.href='Tenpay/topay.asp?total_fee='+ Number(fxpay) +'&sp_billno='+ v[1] +'&desc='+ username +'开通分销'});
		  }else if(v[2]==0){
			  scscms_alert(v[0],'ok',function(){top.location.href='alipayFX/alipayto.asp?total_fee='+ Number(fxpay) +'&out_trade_no='+ v[1] +'&subject='+ username +'开通分销'});
			  
		  }
	  }else{
		  scscms_alert(v[0],'ok',function(){top.location.href='Index.zms.asp'});
	  }
	
  }
 oneScroll.refresh();
 }	
}
}








//推客注册
function regPush(){
var uName = document.usertkform.uName.value;
var uPass = document.usertkform.uPass.value;
var uPass2 = document.usertkform.uPass2.value;
var uAlipay = document.usertkform.uAlipay.value;
var uAlipayname = document.usertkform.uAlipayname.value;
var uWX = document.usertkform.uWX.value;
var puName = document.usertkform.puName.value;
var ut = document.usertkform.ut.value;
var puNameall = document.usertkform.puNameall.value;
var utitle = document.usertkform.utitle.value;


var url = "Push.reg.ok.asp";
var postStr = "uName="+uName+"&uPass="+uPass+"&uAlipay="+uAlipay+"&uAlipayname="+uAlipayname+"&uWX="+uWX+"&puName="+puName+"&ut="+ut+"&puNameall="+puNameall+"&utitle="+utitle;

if(uName==""){
scscms_alert("没有生成推客ID，请重新注册","","",1);
}else if(uPass==""){
scscms_alert("密码不能是空值","","",1);
}else if(uPass.length<8){
scscms_alert("密码不能小于8个字符","","",1);
}else if(uPass2==""){
scscms_alert("确认密码不能是空值","","",1);
}else if(uPass!=uPass2){
scscms_alert("两次密码不相辅","","",1);
}else if(utitle==""){
scscms_alert("请输入店铺名称","","",1);
}else if(uAlipay==""){
scscms_alert("请输您的结算支付宝账户","","",1);
}else if(uAlipayname==""){
scscms_alert("请输您的结算账户实名","","",1);
}else if(uWX==""){
scscms_alert("请输您的联系微信","","",1);
}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;
      v = new Array;
      v = vs.split("$$$");
		
	  if(v[1]==1){
		  scscms_alert(v[0],'ok',function(){oneChickUrl('push.login.asp',1)});
	  }else{
		  scscms_alert(v[0],'ok',function(){oneChickUrl('push.asp',2)});  
	  }
	
  }
 oneScroll.refresh();
 }	
}

}

//推客修改
function editPush(){
var uName = document.useretkform.uName.value;
//var uPass = document.useretkform.uPass.value;
//var uPass2 = document.useretkform.uPass2.value;
var uAlipay = document.useretkform.uAlipay.value;
var uAlipayname = document.useretkform.uAlipayname.value;
var uWX = document.useretkform.uWX.value;
var utitle = document.useretkform.utitle.value;

var url = "Push.edit.ok.asp";
var postStr = "uName="+uName+"&uAlipay="+uAlipay+"&uAlipayname="+uAlipayname+"&uWX="+uWX+"&utitle="+utitle;


//if(uPass!="" && uPass.length<8){
//scscms_alert("密码不能小于8个字符","","",1);
//}else if(uPass!="" && uPass2==""){
//scscms_alert("确认密码不能是空值","","",1);
//}else if(uPass!="" && uPass!=uPass2){
//scscms_alert("两次密码不相辅","","",1);
//}else 
if(utitle==""){
scscms_alert("请输入店铺名称","","",1);
//}else if(uAlipay==""){
//scscms_alert("请输您的结算支付宝账户","","",1);
//}else if(uAlipayname==""){
//scscms_alert("请输您的结算账户实名","","",1);
}else if(uWX==""){
scscms_alert("请输您的联系微信","","",1);
}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;
      v = new Array;
      v = vs.split("$$$");
		
	  if(v[1]==1){
		  scscms_alert(v[0],'ok',function(){oneChickUrl('push.login.asp',1)});
	  }else{
		  scscms_alert(v[0],'ok',function(){oneChickUrl('push.asp',2)});  
	  }
	
  }
 oneScroll.refresh();
 }	
}
}



//推客佣金提现
function txPushshow(){
var tableIDs = document.pushtxform.tableIDs.value;
var maxMoney = document.pushtxform.maxMoney.value;
var nids = document.pushtxform.nids.value;
var Money = document.pushtxform.Money.value;
var uName = document.pushtxform.uName.value;
var alipayuser = document.pushtxform.alipayuser.value;
var alipayname = document.pushtxform.alipayname.value;
var openurl = document.pushtxform.openurl.value;

if(nids==""){
scscms_alert("没有要结算的订单","","",1);
return false;
}
if(Money<=0 || Number(Money)<Number(maxMoney)){
scscms_alert("提现金额不足","","",1);
return false;
}
if(uName==""){
scscms_alert("未获取到推客ID，请刷新","","",1);
return false;
}
if(alipayuser==""){
scscms_alert("未获取到提现者身份",'ok',function(){top.location.href = openurl});
return false;
}
if(alipayname==""){
scscms_alert("请填写提现者实名","","",1);
return false;
}

var url = "Push.Tx.ok.asp";
var postStr = "tableIDs="+tableIDs+"&nids="+nids+"&Money="+Money+"&uName="+uName+"&alipayuser="+alipayuser+"&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 = 'index.push.asp'});
	  }else{
		  scscms_alert(v[1],"","",1);  
		  return false;
	  }
	
  }
}
}



//推客登陆
function loginPush(){
var uName = document.usertkform.uName.value;
var uPass = document.usertkform.uPass.value;

var url = "Push.login.ok.asp";
var postStr = "uName="+uName+"&uPass="+uPass;

if(uName==""){
scscms_alert("请填写推客ID","","",1);
}else if(uPass==""){
scscms_alert("请填写登陆密码","","",1);
}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;
      v = new Array;
      v = vs.split("$$$");
		
	  if(v[1]==1){
		  scscms_alert(v[0],'ok',function(){oneChickUrl(v[2],1)});
	  }else{
		  scscms_alert(v[0],'ok',function(){oneChickUrl('push.asp',2)});  
	  }
	
  }
 oneScroll.refresh();
 }	
}	
	
}




//推广商品关键词检索
function searchPushShopKyes(){
var menu = document.pushshopkeys.menu.value;
var keys = document.pushshopkeys.keys.value;

var url = "Push.shop.asp?menu="+menu+"&keys="+keys;

oneChickUrl(url,2);
 
}







//领取会员卡
function saveKa(){
var kaID = document.kaform.kaID.value;
var kaNum = document.kaform.kaNum.value;

var url = "Ka.show.ok.asp";
var postStr = "kaID="+kaID+"&kaNum="+kaNum;

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],'ok',function(){top.location.href = 'index.Ka.show.asp?ID='+v[1]});
	
  }
 }	
}





//订单检索
function searchPayKyes(){
var	menu = document.Paykeys.menu.value;
var keys1 = document.Paykeys.keys1.value;
var keys2 = document.Paykeys.keys2.value;
var keys3 = document.Paykeys.keys3.value;

var url = "Pay.asp?keys="+keys1+","+keys2+","+keys3+"&menu="+menu;

TwoON();
oneChickUrl(url,2);
 
}




//保存订单
function savePaybuy(){
var	selid = document.paybuyform.selid.value;
var city_id = document.paybuyform.city_id.value;
var city = document.paybuyform.city.value;
var city1_id = document.paybuyform.city1_id.value;
var city1 = document.paybuyform.city1.value;
var city2_id = document.paybuyform.city2_id.value;
var city2 = document.paybuyform.city2.value;

var useradd = document.paybuyform.useradd.value;
var username = document.paybuyform.username.value;
var usertel = document.paybuyform.usertel.value;
var weixinuser = document.paybuyform.weixinuser.value;
var seltext = document.paybuyform.seltext.value;
var remark1 = document.paybuyform.remark1.value;
var zffs = document.paybuyform.zffs.value;

var iii = document.paybuyform.iii.value;
var	tableIDs = document.paybuyform.tableIDs.value;
var yunfei = document.paybuyform.yunfei.value;
var chengbenyunfei = document.paybuyform.chengbenyunfei.value;
var v_amount = document.paybuyform.v_amount.value;
var v_bmount = document.paybuyform.v_bmount.value;
var v_cmount = document.paybuyform.v_cmount.value;
var v_TKP = document.paybuyform.v_TKP.value;
var v_JFP = document.paybuyform.v_JFP.value;
var v_JFDK = document.paybuyform.v_JFDK.value;
var v_qianggou = document.paybuyform.v_qianggou.value;
var kazk = document.paybuyform.kazk.value;

var qdyh = document.paybuyform.qdyh.value;
var qdyhVS = document.paybuyform.qdyhVS.value;

var v_x = document.paybuyform.v_x.value;
var v_y = document.paybuyform.v_y.value;
var ggg_x = document.paybuyform.ggg_x.value;
var ggg_y = document.paybuyform.ggg_y.value;

var openid = document.paybuyform.openid.value;

var is_weixin = document.formUrl.is_weixin.value;
var smzt = document.paybuyform.smzt.value;
var jinbiall = document.paybuyform.jinbiall.value;

var v_fxhywwwall = document.paybuyform.v_fxhywwwall.value;

if(v_x!="" || v_x>0 || v_y!="" || v_y>0 || ggg_x!="" || ggg_x>0 || ggg_y!="" || ggg_y>0){
var start = new qq.maps.LatLng(v_x, v_y), end = new qq.maps.LatLng(ggg_x, ggg_y);
DIS = Math.round(qq.maps.geometry.spherical.computeDistanceBetween(start, end)*10)/10;
}else{
DIS = 0;
}

var url = "Pay.buy.ok.asp";
var postStr = "selid="+selid+"&city_id="+city_id+"&city="+city+"&city1_id="+city1_id+"&city1="+city1+"&city2_id="+city2_id+"&city2="+city2+"&useradd="+useradd+"&username="+username+"&usertel="+usertel+"&weixinuser="+weixinuser+"&seltext="+seltext+"&remark1="+remark1+"&zffs="+zffs+"&yunfei="+yunfei+"&chengbenyunfei="+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+"&kazk="+kazk+"&v_qianggou="+v_qianggou+"&qdyh="+qdyh+"&qdyhVS="+qdyhVS+"&v_disggg="+DIS+"&is_weixin="+is_weixin+"&iii="+iii+"&tableIDs="+tableIDs+"&smzt="+smzt+"&jinbiall="+jinbiall+"&v_fxhywwwall="+v_fxhywwwall;

if(city_id=="" || city_id==0){
scscms_alert("请选择所在省","","",1);
return false;
}
if(useradd==""){
scscms_alert("请填写收件地址","","",1);
return false;
}
if(username==""){
scscms_alert("请填写收件人姓名","","",1);
return false;
}
if(usertel==""){
scscms_alert("请填写联系手机号","","",1);
return false;
}
if(tableIDs==""){
scscms_alert("没有生成订单号，请重新下单","","",1);
return false;
}

scscms_alert("提交中，请等待","","",99999999);

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 allamount = Number(v_amount)+Number(yunfei);
      
	  if(v[1]!=0){
		  
	  if(zffs==0){		 
		 //scscms_alert(v[0],'ok',function(){top.location.href='Index.Pay.asp'});
		 scscms_alert(v[0]+'，请付款','ok',function(){top.location.href='aliPay/alipayto.asp?total_fee='+ v[2] +'&out_trade_no='+ v[1] +'&subject='+ username +'手机购物'});
	  }else if(zffs==1){
		 scscms_alert(v[0],'ok',function(){top.location.href='Index.Pay.asp'}); 
	  }else if(zffs==2){
		 //scscms_alert(v[0],'ok',function(){top.location.href='Index.Pay.asp'});
		 scscms_alert(v[0],'ok',function(){top.location.href='Tenpay/topay.asp?total_fee='+ v[2] +'&sp_billno='+ v[1] +'&desc='+ username +'手机购物'});
	  }else if(zffs==3){
		 scscms_alert(v[0]+'，请付款','ok',function(){top.location.href='tenWXpay/index.asp?tt=XD&id='+ v[1] +'&openid='+openid});
		 //scscms_alert(v[0],'ok',function(){footmenuON(6,'Pay.asp',2)});
	  }
	  
	  }else{
	  scscms_alert(v[0],'ok',function(){top.location.href='Index.Buy.asp'});
	  }

  }
 }

}






//删除订单
function delPayflag(id,dv){
var d = new Date();
var url = "Pay.del.asp";
var postStr = "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){
    document.getElementById(dv).style.display = "none";
	footerDownAction();
  }
 oneScroll.refresh();
 }
 
}






//综合处理订单状态信息
function flagPay(id,dv,nam){
var postStr = "id="+id+"&dv="+dv+"&nam="+nam;

if(nam=="wuliu"){
var url = "Pay.wuliu.asp";	
}else if(nam=="tuihuo"){
var url = "Pay.tuihuo.asp";	
}else if(nam=="pingjia"){
var url = "Pay.pingjia.asp";	
}else if(nam=="shouhuo"){
var url = "Pay.shouhuo.asp";	
}

TwoON(url+"?"+postStr,1);
 
}


//综合处理订单状态信息
function flagPayOK(id,dv,nam){
if(nam=="tuihuo"){

var ids=document.orderfahuo.ids.value;
var zhifubao=document.orderfahuo.zhifubao.value;
var xingming=document.orderfahuo.xingming.value;
var tkly=document.orderfahuo.tkly.value;
var jiner=document.orderfahuo.jiner.value;

if(jiner=="" || jiner<=0){
 scscms_alert("请填写退款金额","","",1);
 return false;
}
if(zhifubao==""){
 scscms_alert("参数不全，请重新进入旺铺","","",1);
 return false;
}
if(xingming==""){
 scscms_alert("请填写真实姓名","","",1);
 return false;
}
if(tkly==""){
 scscms_alert("请填写退货/退款理由","","",1);
 return false;
}
var postStr = "ids="+ids+"&zhifubao="+zhifubao+"&xingming="+xingming+"&tkly="+tkly+"&dv="+dv+"&jiner="+jiner;
var url = "Pay.tuihuo.ok.asp";	

}else if(nam=="pingjia"){
	
var ids=document.orderfahuo.ids.value;
var p_fen1=document.orderfahuo.p_fen1.value;
var p_fen2=document.orderfahuo.p_fen2.value;
var p_fen3=document.orderfahuo.p_fen3.value;
var p_mtxt=document.orderfahuo.p_mtxt.value;

if(p_fen1<0){
 scscms_alert("请给描述相符打分","","",1);
 return false;
}
if(p_fen2<0){
 scscms_alert("请给服务态度打分","","",1);
 return false;
}
if(p_fen3<0){
 scscms_alert("请给发货速度打分","","",1);
 return false;
}
var postStr = "ids="+ids+"&p_fen1="+p_fen1+"&p_fen2="+p_fen2+"&p_fen3="+p_fen3+"&p_mtxt="+p_mtxt+"&dv="+dv;
var url = "Pay.pingjia.ok.asp";	

}else if(nam=="shouhuo"){

var ids=document.orderfahuo.ids.value;

var postStr = "ids="+ids+"&dv="+dv;
var url = "Pay.shouhuo.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(dv).innerHTML = ajax.responseText;
	vs = ajax.responseText;
	if(vs!=""){
	scscms_alert(vs,"","",1);
	}else{
	scscms_alert("操作成功","","",1);
	}
	TwoON();
  }
 }
 
}






//星星打分
function flagXing(id){
var postStr = "id="+id;
var url = "Pay.pingjia.xing.asp";

ThreeON(url+"?"+postStr,1);
 
}


//星星打分处理
function flagXingOK(id,fen){
var d = new Date();
var postStr = "fen="+fen;
var url = "Pay.pingjia.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.orderfahuo.p_fen1.value = fen;}
	if(id==2){document.orderfahuo.p_fen2.value = fen;}
	if(id==3){document.orderfahuo.p_fen3.value = fen;}
	ThreeON();
  }
 }
 
}






var watchtelTime;
function watchtelcode_chk(){
var atel = document.bangdingTel.atel.value;
var a_s = document.bangdingTel.a_s.value;

var apass = document.bangdingTel.apass.value;
var apass2 = document.bangdingTel.apass2.value;

if (atel.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(atel)){
 scscms_alert("请输入有效的手机号码","","",1);
 return false;
}
if (apass==""){
 scscms_alert("请输入登陆密码","","",1);
 return false;
}
if (apass.length<8){
 scscms_alert("密码不能小于8位","","",1);
 return false;
}
if (apass2==""){
 scscms_alert("请输入确认密码","","",1);
 return false;
}
if (apass!=apass2){
 scscms_alert("两次密码不一致","","",1);
 return false;
}


if(a_s==0){

document.getElementById("watchteltt").innerHTML = "";
  
var url = "Index.tel.code.asp";
var postStr = "atel="+atel;

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.bangdingTel.a_s.value=1; 
		scscms_alert("验证码已发送，请注意查看手机","","",1);
		watchtelTime = setInterval("watchtelcode_chk()",1000);
		}else{
		scscms_alert(vs,"","",1);
		document.getElementById("watchteltt").innerHTML = "<a href='javascript:watchtelcode_chk();'><font color='#ffffff'>获取验证码</font></a>";
		clearTimeout(watchtelTime);	
		}
    }
  }	  	
		
}else if(a_s>0 && a_s<300){
	  allas = Number(document.bangdingTel.a_s.value)+1;
	  allsa = 300 - allas;
	  document.bangdingTel.a_s.value = allas; 
	  document.getElementById("watchteltt").innerHTML = "倒计时 "+ allsa;
}else if(a_s>=300){
      document.getElementById("watchteltt").innerHTML = "<a href='javascript:watchtelcode_chk();'><font color='#ffffff'>获取验证码</font></a>";
	  document.bangdingTel.a_s.value = 0;
	  clearTimeout(watchtelTime);	
}



}



function watchtelSave_chk(){
var atel = document.bangdingTel.atel.value;
var apass = document.bangdingTel.apass.value;
var apass2 = document.bangdingTel.apass2.value;
var acode = document.bangdingTel.acode.value;
var gourl = document.bangdingTel.gourl.value;
var wxOpenID = document.bangdingTel.wxOpenID.value;
var tkID = document.bangdingTel.tkID.value;

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

var url = "Index.tel.reg.asp";
var postStr = "atel="+atel+"&apass="+apass+"&acode="+acode+"&wxOpenID="+wxOpenID+"&tkID="+tkID;

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 = gourl;
		}else{
		  scscms_alert(vs,"","",1);
		}
    }
  }

}




function watchtelSave_chk2(){
var atel = document.bangdingTel2.atel.value;
var apass = document.bangdingTel2.apass.value;
var gourl = document.bangdingTel2.gourl.value;
var wxOpenID = document.bangdingTel2.wxOpenID.value;
var tkID = document.bangdingTel2.tkID.value;

if (atel.length!=11){
 scscms_alert("请输入有效的手机号码","","",1);
 return false;
}
var myreg = /^1\d{10}$/;
if(!myreg.test(atel)){
 scscms_alert("请输入有效的手机号码","","",1);
 return false;
}
if (apass==""){
 scscms_alert("请输入登陆密码","","",1);
 return false;
}
if (apass.length<8){
 scscms_alert("密码不能小于8位","","",1);
 return false;
}


var url = "Index.tel.login.asp";
var postStr = "atel="+atel+"&apass="+apass+"&wxOpenID="+wxOpenID+"&tkID="+tkID;

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 = gourl;
		}else{
		  scscms_alert(vs,"","",1);
		}
    }
  }
	
}




























































































//点赞点贬
function checkChanDerogatory(nameT,nameTable,nameID,id){
var d = new Date();
var postStr = "nameT="+nameT+"&nameTable="+nameTable+"&nameID="+nameID+"&id="+id+"&d="+d;

ajax.open("POST", "Chan.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("$$$");
					
  scscms_alert(v[0],"","",1);
  document.getElementById(nameID).className=v[1];
  document.getElementById(nameID+"c").innerHTML=v[2];
					
  }
}
}



//评论按钮
function checkpinglunForm(t,ceng){
	
el = document.getElementById('txtlist');
li = document.createElement('li');
pinglunusername = document.getElementById('pinglunusername');
	
if (document.pinglun.username.value == ""){
 scscms_alert("请填写您的昵称","","",1);
 pinglunusername.style.display = "block";	
 cengRefresh(ceng);
 return false;
}else if (document.pinglun.txt.value == ""){
 scscms_alert("请填写评论内容","","",1);
 return false;
}else{
            //开始
			var id = document.pinglun.id.value;
			var username = document.pinglun.username.value;
			var txt = document.pinglun.txt.value;
			var postStr = "id="+id+"&username="+username+"&txt="+txt+"&t="+t;
			ajax.open("POST", "Pinglun.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("$$$");
					
					scscms_alert("评论成功","","",1);
					el.innerHTML = v[0];

			    }
			pinglunusername.style.display = "none";
			document.pinglun.txt.value = "";

			cengRefresh(ceng);
			
			}
			//结束
}	
}





//购物车复选合计
function CheckBuyAllCheckboxSel(id,nam,cv,iii){
var name = document.getElementById(nam);	
var sel = document.getElementById("sel"+iii).value;

if(cv<=0){
scscms_alert("该商品库存不足","","",1);
return false;
}else{

if(name.className=="boucheckboxnull"){
suanfa = "jia";	
name.className = "boucheckboxright";
}else{
suanfa = "jian";
name.className = "boucheckboxnull";	
}

var url = "Buy.all.checkbox.asp";
var postStr = "id="+id+"&sel="+sel+"&suanfa="+suanfa;
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.editbuyform.sel.value = v[0];
		document.getElementById("sel"+iii).value = v[0];
		document.getElementById("buyheji_"+iii).innerHTML = v[1];
    }
}

}
}



//购物车删除后合计
function delBuyAllboxSel(id,iii){
var sel = document.getElementById("sel"+iii).value;
var selallstr = "";
selstr = sel.split(",");
for(i=0;i<selstr.length;i++){
    if(id!=selstr[i]){
	    if(selallstr!=""){
			selallstr = selallstr+","+selstr[i];
		}else{
			selallstr = selstr[i];
		}
    }
}

var url = "Buy.all.checkbox.asp";
var postStr = "id="+id+"&sel="+selallstr+"&suanfa=jia";
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("sel"+iii).value = v[0];
		document.getElementById("buyheji_"+iii).innerHTML = v[1];
    }
}

}


//购物车删除
function delBuyAll(id,dv,iii){
var d = new Date();
var url = "Buy.del.asp";
var postStr = "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){
    delBuyAllboxSel(id,iii);
	document.getElementById(dv).style.display = "none";
	//footerDownAction();
  }
 oneScroll.refresh();
 }	
}


//提交购物车
function saveBuyAll(iii){
var sel = document.getElementById("sel"+iii).value;
var is_weixin = document.formUrl.is_weixin.value;

if(sel==""){
  scscms_alert("请选择结算商品","","",1);
  return false;    	
}
 
var url = "Buy.all.right.asp";
var postStr = "sel="+sel;
 
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==""){
	TwoON("Pay.buy.all.asp?iii="+iii+"&sel="+sel+"&is_wx="+is_weixin,1)
	}else{
	scscms_alert(vs,"","",1);
	}
	
  }
 }
 
}



//保存订单
function savePaybuyall(){
var	selid = document.paybuyform.selid.value;
var city_id = document.paybuyform.city_id.value;
var city = document.paybuyform.city.value;
var city1_id = document.paybuyform.city1_id.value;
var city1 = document.paybuyform.city1.value;
var city2_id = document.paybuyform.city2_id.value;
var city2 = document.paybuyform.city2.value;

var useradd = document.paybuyform.useradd.value;
var username = document.paybuyform.username.value;
var usertel = document.paybuyform.usertel.value;
var weixinuser = document.paybuyform.weixinuser.value;
var seltext = document.paybuyform.seltext.value;
var remark1 = document.paybuyform.remark1.value;
var zffs = document.paybuyform.zffs.value;

var yunfei = document.paybuyform.yunfei.value;
var chengbenyunfei = document.paybuyform.chengbenyunfei.value;
var v_amount = document.paybuyform.v_amount.value;
var v_bmount = document.paybuyform.v_bmount.value;
var v_cmount = document.paybuyform.v_cmount.value;
var v_TKP = document.paybuyform.v_TKP.value;
var v_JFP = document.paybuyform.v_JFP.value;
var v_JFDK = document.paybuyform.v_JFDK.value;
var v_qianggou = document.paybuyform.v_qianggou.value;
var kazk = document.paybuyform.kazk.value;

var qdyh = document.paybuyform.qdyh.value;
var qdyhVS = document.paybuyform.qdyhVS.value;

var v_x = document.paybuyform.v_x.value;
var v_y = document.paybuyform.v_y.value;
var ggg_x = document.paybuyform.ggg_x.value;
var ggg_y = document.paybuyform.ggg_y.value;

var openid = document.paybuyform.openid.value;
var iii = document.paybuyform.iii.value;
var tableIDs = document.paybuyform.tableIDs.value;

var is_weixin = document.formUrl.is_weixin.value;
var smzt = document.paybuyform.smzt.value;
var jinbiall = document.paybuyform.jinbiall.value;

var v_fxhywwwall = document.paybuyform.v_fxhywwwall.value;

//if(v_x!="" || v_x>0 || v_y!="" || v_y>0 || ggg_x!="" || ggg_x>0 || ggg_y!="" || ggg_y>0){
//var start = new qq.maps.LatLng(v_x, v_y), end = new qq.maps.LatLng(ggg_x, ggg_y);
//DIS = Math.round(qq.maps.geometry.spherical.computeDistanceBetween(start, end)*10)/10;
//}else{
DIS = 0;
//}

var url = "Pay.buy.all.ok.asp";
var postStr = "selid="+selid+"&city_id="+city_id+"&city="+city+"&city1_id="+city1_id+"&city1="+city1+"&city2_id="+city2_id+"&city2="+city2+"&useradd="+useradd+"&username="+username+"&usertel="+usertel+"&weixinuser="+weixinuser+"&seltext="+seltext+"&remark1="+remark1+"&zffs="+zffs+"&yunfei="+yunfei+"&chengbenyunfei="+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+"&kazk="+kazk+"&v_qianggou="+v_qianggou+"&qdyh="+qdyh+"&qdyhVS="+qdyhVS+"&v_disggg="+DIS+"&is_weixin="+is_weixin+"&iii="+iii+"&tableIDs="+tableIDs+"&smzt="+smzt+"&jinbiall="+jinbiall+"&v_fxhywwwall="+v_fxhywwwall;

if(city_id=="" || city_id==0){
scscms_alert("请选择所在省","","",1);
}else if(useradd==""){
scscms_alert("请填写收件地址","","",1);
}else if(username==""){
scscms_alert("请填写收件人姓名","","",1);
}else if(usertel==""){
scscms_alert("请填写联系手机号","","",1);
}else{

scscms_alert("提交中，请等待","","",99999999);

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 allamount = Number(v_amount)+Number(yunfei);
      
	  if(v[1]!=0){
		  
	  if(zffs==0){		 
		 //scscms_alert(v[0],'ok',function(){top.location.href='Index.Pay.asp'});
		 scscms_alert(v[0]+'，请付款','ok',function(){top.location.href='aliPay/alipayto.asp?total_fee='+ v[2] +'&out_trade_no='+ v[1] +'&subject='+ username +'手机购物'});
	  }else if(zffs==1){
		 scscms_alert(v[0],'ok',function(){top.location.href='Index.Pay.asp'}); 
	  }else if(zffs==2){
		 //scscms_alert(v[0],'ok',function(){top.location.href='Index.Pay.asp'});
		 scscms_alert(v[0],'ok',function(){top.location.href='Tenpay/topay.asp?total_fee='+ v[2] +'&sp_billno='+ v[1] +'&desc='+ username +'手机购物'});
	  }else if(zffs==3){
		 scscms_alert(v[0]+'，请付款','ok',function(){top.location.href='tenWXpay/index.asp?tt=XD&id='+ v[1] +'&openid='+openid});
		 //scscms_alert(v[0],'ok',function(){footmenuON(6,'Pay.asp',2)});
	  }
	  
	  }else{
	  scscms_alert(v[0],'ok',function(){top.location.href='Index.Buy.asp'});
	  }

  }
 }
}
}


//上门自提方式选择
function PaysmztON(){
var smzt = document.paybuyform.smzt.value;
var yunfei = document.paybuyform.yunfei.value;
var v_amount = document.paybuyform.v_amount.value;
var qdyh = document.paybuyform.qdyh.value;

var url = "Pay.buy.smzt.asp";
var postStr = "smzt="+smzt+"&yunfei="+yunfei+"&v_amount="+v_amount+"&qdyh="+qdyh;
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]==0){
          document.paybuyform.smzt.value = v[0];
          document.getElementById("Websmzt").className = "payfs";	
          document.getElementById("paybuyxxxtxt1").innerHTML = v[2];
          document.getElementById("paybuyxxxtxt2").innerHTML = v[1];
      }else{
          document.paybuyform.smzt.value = v[0];
          document.getElementById("Websmzt").className = "payfsArr";
          document.getElementById("paybuyxxxtxt1").innerHTML = v[2];
          document.getElementById("paybuyxxxtxt2").innerHTML = v[1];
      }
	  
  }
}

}




//购物加加减
function CheckBuyAllCheckboxSelcar(IDs,tt){
var url = "Buy.count.asp";
var postStr = "IDs="+IDs+"&tt="+tt;

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(v[1],"","",1);
	  }else{
	  document.getElementById("carcount"+IDs).innerHTML = v[0];	
	  }

  }
}

}



//加入收藏
function addfavorites(tt,IDs,title,pic){
var url = "Favorites.asp";
var postStr = "IDs="+IDs+"&tt="+tt+"&title="+title+"&pic="+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;
      v = new Array;
      v = vs.split("$$$");

	  scscms_alert(vs,"","",1);

  }
}

}



//确认支付
function uPayMchtopay(){
scscms_alert("支付中，请等待","","",99999999);
var payid = document.payForm.payid.value;

$.ajax({
  type: "post",
  url: "http://"+document.domain+"/mp5.0/TenWXpay/JSSDK.asp",
  data: {orderid: payid},
  success: function(data){

  v = new Array;
  v = data.split("$$$");
  
  document.payForm.payid.value = v[0];
  document.payForm.callback.value = v[1];
  document.payForm.action="/pay/JsApiPay";
  document.payForm.submit();

  },
  error:function(data){scscms_alert("支付失败，请重试","","",1);}
});


}



//粉丝金币提现
function txJinbishow(){
var tableIDs = document.jinbitxform.tableIDs.value;
var maxMoney = document.jinbitxform.maxMoney.value;
var Money = document.jinbitxform.Money.value;
var Jinbi = document.jinbitxform.Jinbi.value;
var alipayuser = document.jinbitxform.alipayuser.value;
var alipayname = document.jinbitxform.alipayname.value;
var openurl = document.jinbitxform.openurl.value;

if(Money<=0 || Number(Money)<Number(maxMoney)){
scscms_alert("提现金额不足","","",1);
return false;
}
if(alipayuser==""){
scscms_alert("未获取到提现者身份",'ok',function(){top.location.href = openurl});
return false;
}
if(alipayname==""){
scscms_alert("请填写提现真实姓名","","",1);
return false;
}

var url = "Jinbi.Tx.ok.asp";
var postStr = "tableIDs="+tableIDs+"&Money="+Money+"&alipayuser="+alipayuser+"&alipayname="+alipayname+"&Jinbi="+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("$$$");
		
	  if(v[0]==1){
		  scscms_alert(v[1],'ok',function(){top.location.href = 'index.jinbi.asp'});
	  }else{
		  scscms_alert(v[1],"","",1);  
		  return false;
	  }
	
  }
}
}




//签到
function ChinkinON(){
var url = "Chinkin.on.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 = 'Chinkin.jinbi.asp'});
	  //document.getElementById("chinkincount").innerHTML = v[2];	
	  //document.getElementById("chinkintxt").innerHTML = v[3];	
	  }

  }
}

}

//签到送金币
function ChinkinJinbi(){
var url = "Chinkin.jinbi.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(vs!=""){
	  scscms_alert(vs,"","",1);
	  }

  }
}

}



//不优惠价格
function checkamountOutnone(nam){
var nn = document.getElementById(nam+"nn");
var tt = document.getElementById(nam+"tt");
if(nn.style.display=="block"){
nn.style.display="none";
tt.className="checkjiatxt";	
}else{
nn.style.display="block";
tt.className="checkjiantxt";		
}
oneScroll.refresh();
}



//优惠买单
function CheckPay(){
var tableIDs = document.checkform.tableIDs.value;
var amount_all = document.checkform.amount_all.value;
var amount_out = document.checkform.amount_out.value;
var zffs = document.checkform.zffs.value;
var is_weixin = document.formUrl.is_weixin.value;
var openid = document.checkform.openid.value;
var openurl = document.checkform.openurl.value;

if(is_weixin==1){
if(openid==""){
scscms_alert("请重新获取参数",'ok',function(){top.location.href = openurl});
return false;
}
}

if(amount_all<=0 || amount_all==""){
scscms_alert("消费金额不足","","",1);
return false;
}
if(amount_out!=""){
  if(Number(amount_out) > Number(amount_all)){
  scscms_alert("不优惠金额不可大于消费金额","","",1);
  return false;
  }
}
if(zffs==""){
scscms_alert("请选择支付方式","","",1);
return false;
}

scscms_alert("支付中，请等待","","",99999999);

var url = "Check.ok.asp";
var postStr = "tableIDs="+tableIDs+"&amount_all="+amount_all+"&amount_out="+amount_out+"&zffs="+zffs+"&is_weixin="+is_weixin;

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){
		  
	    if(zffs==0){		 
		  scscms_alert(v[0]+'，请付款','ok',function(){top.location.href='aliPay/alipayto.asp?total_fee='+ v[2] +'&out_trade_no='+ v[1] +'&subject=优惠买单'});
	    }else if(zffs==1){
		  scscms_alert(v[0],"","",1);
	    }else if(zffs==2){
		  scscms_alert(v[0]+'，请付款','ok',function(){top.location.href='Tenpay/topay.asp?total_fee='+ v[2] +'&sp_billno='+ v[1] +'&desc=优惠买单'});
	    }else if(zffs==3){
		  scscms_alert(v[0]+'，请付款','ok',function(){top.location.href='tenWXpay/index.asp?tt=XD&id='+ v[1] +'&openid='+openid});
	    }
	  
	  }else{
	    scscms_alert(v[0],"","",1);
	  }

  }
}

}



//优惠买单实时验证
function CheckPaynow(){
var amount_all = document.checkform.amount_all.value;
var amount_out = document.checkform.amount_out.value;

var url = "Check.now.asp";
var postStr = "amount_all="+amount_all+"&amount_out="+amount_out;

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("check_amout_ssss").innerHTML = vs;	
  }
}
}




//预约查询
function searchbookingKyes(){
var Menu = document.bookingkeys.Menu.value;
var keys = document.bookingkeys.keys.value;

var url = "Booking.asp?Menu="&Menu&"&keys="+keys;

oneChickUrl(url,2);

}



//预约报名
function saveBookingdata(){
var PID = document.bookingshowform.PID.value;
var WWW = document.bookingshowform.WWW.value;
var nam = document.bookingshowform.nam.value;
var tel = document.bookingshowform.tel.value;
var tim = document.bookingshowform.tim.value;
var people = document.bookingshowform.people.value;

var str="";
var strArr = document.getElementsByName("str");
for(var i=0;i<strArr.length;i++){
    if(str!=""){
	    str = str+","+strArr[i].value;
	}else{
		str = strArr[i].value;
	}
}

if(nam==""){
scscms_alert("请填写联系人姓名","","",1);
return false;
}
if(tel==""){
scscms_alert("请填写手机号","","",1);
return false;
}
if(tim==""){
scscms_alert("请选择预约日期","","",1);
return false;
}
if(people==""){
scscms_alert("请填写预约人数","","",1);
return false;
}

var url = "Booking.reg.asp";
var postStr = "PID="+PID+"&WWW="+WWW+"&nam="+nam+"&tel="+tel+"&tim="+tim+"&people="+people+"&str="+str;

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(){oneChickUrl("Booking.show.asp?id="+PID,2)});
	  }else{
	      scscms_alert(v[1],"","",1);
	  }

  }
}

}



//摇一摇中奖
function getErnieok(){
var url = "Ernie.reg.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]=="登陆失效"){
	  myDialog.alert(v[1]);
	  }else{
	  myDialog.alert(vs);
	  }

  }
}

}




//生成推广二维码
function erweimaDiv(){
var a_s = document.erweimatheForm.a_s.value;
var www = document.erweimatheForm.www.value;
var pic = encodeURIComponent(document.erweimatheForm.pic.value);
var emurl = encodeURIComponent(document.erweimatheForm.url.value);
var num = document.erweimatheForm.num.value;
var tt = document.erweimatheForm.tt.value;
var txt = document.erweimatheForm.txt.value;
var uid = document.erweimatheForm.uid.value;
var pushpic = document.erweimatheForm.pushpic.value;
var uptkid = document.erweimatheForm.uptkid.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+"&uid="+uid+"&pushpic="+pushpic+"&uptkid="+uptkid;

scscms_alert("获取中，请等待","","",99999999);

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(pushpic==1){
		scscms_alert("海报已生成",'ok',function(){oneChickUrl("Push.asp",2)});
	  }else{
        scscms_alert("已获取，有效期7天","","",1);  
		document.getElementById("tk_erweima").innerHTML =  "<div style='text-align:center;width:100%;font-size:14px;line-height:30px;color:#0EC100;'><div style='width:100%;height:220px;'><img src='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="+v[1]+"' width='220' height='220' /></div><div style='width:100%;height:30px;'>您的微信推广二维码</div></div>";	
	  }
	  
  }
}
}



//生成推广海报
function haibaoOK(){
//var data = document.haibaoform.data.value;
  document.haibaoform.action="/mp5.0/fok/merge.ashx";
  document.haibaoform.submit();
//var url = "/mp5.0/fok/merge.ashx";
//var postStr = "data="+data;

//scscms_alert("海报生成中，请等待","","",99999999);
//alert("海报生成中，请等待");
//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;
//top.location.href = "/mp5.0/fok/Index.Push.asp"
////	  if(vs=="true"){        
////		scscms_alert("海报已生成",'ok',function(){top.location.href = "/mp5.0/fok/Index.Push.asp";});
////	  }else{
////        scscms_alert("海报生成失败",'ok',function(){top.location.href = "/mp5.0/fok/Index.Push.asp";}); 	
////	  }
//	  
//  }
//}
}





//供应商入住申请
function saveUserRegdata(){
var username = document.zmsform.username.value;
var userpass = document.zmsform.userpass.value;
var userpass2 = document.zmsform.userpass2.value;
var usertel = document.zmsform.usertel.value;
var userweixin = document.zmsform.userweixin.value;
var userqq = document.zmsform.userqq.value;

var url = "Reg.ok.asp";
var postStr = "username="+username+"&userpass="+userpass+"&usertel="+usertel+"&userweixin="+userweixin+"&userqq="+userqq;

if(username==""){
scscms_alert("请填写旺铺用户名","","",1);
}else if(is_zw(username)){
scscms_alert("旺铺用户名不能是中文文字","","",1);
}else if(username.length<5){
scscms_alert("旺铺用户名不能小于5个字符","","",1);
}else if(userpass==""){
scscms_alert("密码不能是空值","","",1);
}else if(userpass.length<8){
scscms_alert("密码不能小于8个字符","","",1);
}else if(userpass2==""){
scscms_alert("确认密码不能是空值","","",1);
}else if(userpass!=userpass2){
scscms_alert("两次密码不相辅","","",1);
}else if(usertel==""){
scscms_alert("请输您的联系手机号码","","",1);
}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;
      v = new Array;
      v = vs.split("$$$");

	  if(v[1]!=0){
		  footmenuON(1,'Reg.asp?kt='+v[2],1);
	  }else{
		  scscms_alert(v[0],"","",1);  
	  }
	
  }
 oneScroll.refresh();
 }	
}
}



//多选周
function BookingWeek(nam){
var sel = document.getElementById(nam).value;
var url = "Booking.show.week.asp?nam="+nam+"&sel="+sel;
TwoON(url);
}


//复选周
function BookingWeekSelect(id){
var w2 = document.BookingWeekList.w2.value;
var w3 = document.BookingWeekList.w3.value;
var w4 = document.BookingWeekList.w4.value;
var w5 = document.BookingWeekList.w5.value;
var w6 = document.BookingWeekList.w6.value;
var w7 = document.BookingWeekList.w7.value;
var w1 = document.BookingWeekList.w1.value;

if(id==1){
	if(w1==1){
		document.BookingWeekList.w1.value = 0;
		document.getElementById("BookingWeekbg1").className = "bookingweek";
	}else{
		document.BookingWeekList.w1.value = 1;
		document.getElementById("BookingWeekbg1").className = "bookingweekhover";
	}
}

if(id==2){
	if(w2==2){
		document.BookingWeekList.w2.value = 0;
		document.getElementById("BookingWeekbg2").className = "bookingweek";
	}else{
		document.BookingWeekList.w2.value = 2;
		document.getElementById("BookingWeekbg2").className = "bookingweekhover";
	}
}

if(id==3){
	if(w3==3){
		document.BookingWeekList.w3.value = 0;
		document.getElementById("BookingWeekbg3").className = "bookingweek";
	}else{
		document.BookingWeekList.w3.value = 3;
		document.getElementById("BookingWeekbg3").className = "bookingweekhover";
	}
}

if(id==4){
	if(w4==4){
		document.BookingWeekList.w4.value = 0;
		document.getElementById("BookingWeekbg4").className = "bookingweek";
	}else{
		document.BookingWeekList.w4.value = 4;
		document.getElementById("BookingWeekbg4").className = "bookingweekhover";
	}
}

if(id==5){
	if(w5==5){
		document.BookingWeekList.w5.value = 0;
		document.getElementById("BookingWeekbg5").className = "bookingweek";
	}else{
		document.BookingWeekList.w5.value = 5;
		document.getElementById("BookingWeekbg5").className = "bookingweekhover";
	}
}

if(id==6){
	if(w6==6){
		document.BookingWeekList.w6.value = 0;
		document.getElementById("BookingWeekbg6").className = "bookingweek";
	}else{
		document.BookingWeekList.w6.value = 6;
		document.getElementById("BookingWeekbg6").className = "bookingweekhover";
	}
}

if(id==7){
	if(w7==7){
		document.BookingWeekList.w7.value = 0;
		document.getElementById("BookingWeekbg7").className = "bookingweek";
	}else{
		document.BookingWeekList.w7.value = 7;
		document.getElementById("BookingWeekbg7").className = "bookingweekhover";
	}
}

}



//保存预约周
function BookingWeekListOK(){
var w1 = document.BookingWeekList.w1.value;
var w2 = document.BookingWeekList.w2.value;
var w3 = document.BookingWeekList.w3.value;
var w4 = document.BookingWeekList.w4.value;
var w5 = document.BookingWeekList.w5.value;
var w6 = document.BookingWeekList.w6.value;
var w7 = document.BookingWeekList.w7.value;
var nam = document.BookingWeekList.nam.value;
document.getElementById(nam).value = w2+","+w3+","+w4+","+w5+","+w6+","+w7+","+w1;
TwoON();
}












































/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//实时刷新
var footGetTime;


//加载提示消息
function Now(){

var url = "_Now.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("$$$");
	 
	 document.getElementById("footbb5count").innerHTML = v[0];
	 document.getElementById("footbb6count").innerHTML = v[1];
	 document.getElementById("footbb9count").innerHTML = v[2];
	 footGetTime = setTimeout("Now()",8000);
	 if(v[2]>0){
				   
	    Let('#footbb9')
           .set({'background':'#FFEE5D'})
           .then() 
           .duration(800) 
           .set({'background':'#FF5D5D'})
           .pop()
           .end()	
		   		
	 }else{
		 
	    Let('#footbb9')
           .set('opacity', 1)
           .then() 
           .duration(800) 
           .set({'background':'none'})
           .pop()
           .end()
		   		 
	 }
	 
  }
}

//	var bb9 = document.getElementById("footbb9count").innerHTML;
//	
//	
//	footGetTime = setTimeout("Now()",8000);
//	if(bb9>0){
//				   
//	    Let('#footbb9')
//           .set({'background':'#FFEE5D'})
//           .then() 
//           .duration(800) 
//           .set({'background':'#FF5D5D'})
//           .pop()
//           .end()	
//		   		
//		}
		
}




































var mGetTime;

//加载更多实时消息
function saveNowmessList()
{
var eh = document.body.clientHeight-45;
var el = document.getElementById("Sixlist");
var li = document.createElement('li');

var userid = document.SNSMess.userid.value;
var usertoid = document.SNSMess.usertoid.value;
var lastID = document.SNSMess.lastID.value;

var url = "_Nowmess.asp";
var postStr    = "userid="+ userid +"&usertoid="+ usertoid +"&lastID="+ lastID;               
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("$$$");
	 
	 li.innerHTML = v[0];
	 document.SNSMess.lastID.value = v[1];
	 mGetTime = setTimeout("saveNowmessList()",8000);
	 
    }
el.appendChild(li, el.childNodes[0]);
sixScroll.refresh();
if(sixScroll.maxScrollY<0){sixScroll.scrollTo(0,sixScroll.maxScrollY,500);}


}
}




//提交实时消息
function saveNowmessInfo()
{
var el = document.getElementById("Sixlist");
var li = document.createElement('li');

var userid = document.SNSMess.userid.value;
var usertoid = document.SNSMess.usertoid.value;
var snstxt = document.SNSMess.snstxt.value;

var url = "_Nowmess.ok.asp";
var postStr = "userid="+ userid +"&usertoid="+ usertoid +"&snstxt="+ snstxt;    

if(snstxt==""){
scscms_alert("说点什么吧","","",1);
}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;
	 if(vs!=""){scscms_alert(vs,"","",1);}
	 document.SNSMess.snstxt.value="";
	 saveNowmessList();
	 
    }
clearTimeout(mGetTime);
}
}
}