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


document.write("<script src='/a_Inc/Md5.js' type='text/javascript'></script>");


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 == "headerListButton2") {  
				//document.getElementById("headerList").style.display = "block"; 
				Let('#headerList2')
				  .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;  
            } 
			if (elem.id == "titlebutton2") {  
				//document.getElementById("titleadd").style.display = "block";
				Let('#titleadd2')
				  .set('opacity', 0)
				  .set({'display': 'block'})
				  .then() 
				  .duration(300) 
				  .set('opacity', 1)
				.pop()
				.end()
                return;  
            }
			if (elem.id == "titlebutton3") {  
				//document.getElementById("titleadd").style.display = "block";
				Let('#titleadd3')
				  .set('opacity', 0)
				  .set({'display': 'block'})
				  .then() 
				  .duration(300) 
				  .set('opacity', 1)
				.pop()
				.end()
                return;  
            }
			if (elem.id == "titlebutton4") {  
				//document.getElementById("titleadd").style.display = "block";
				Let('#titleadd4')
				  .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()
			
			Let('#titleadd2')
			  .set('opacity', 1)
			  .then() 
			  .duration(300) 
			  .set('opacity', 0)    
			  .set({'display': 'none'})
			.pop()
			.end()
			
			Let('#titleadd3')
			  .set('opacity', 1)
			  .then() 
			  .duration(300) 
			  .set('opacity', 0)    
			  .set({'display': 'none'})
			.pop()
			.end()
			
			Let('#titleadd4')
			  .set('opacity', 1)
			  .then() 
			  .duration(300) 
			  .set('opacity', 0)    
			  .set({'display': 'none'})
			.pop()
			.end()

            return;  
        }  
    }  
}


/**
 * 中文及表情符号转unicode码
 */
function  parseStandard(str){
    if(str.length==1){
     return "000"+str;
    }else if(str.length==2){
     return "00"+str;
    }else if(str.length==3){
     return "0"+str;
    }else{
     return str;
    }
}

function encode(s){
       var t='';
       for(i=0;i<s.length;i++){
        t+='@u'+parseStandard(s.charCodeAt(i).toString(16));
      }
    //alert(t);
	return t;
    //var t=eval_r('\''+t.replace(/\\\\/g, '\\')+'\'');
    //alert(t);
}




	
function footer_menu_off(id){

if(id==0){
Let('#footer_menu')
	.set('display', 'none')
	.then()
	.set('opacity', 1)
    .pop()
    .end()

Let('#footer')
	.set('display', 'block')
	.then()
	.set('opacity', 1)
    .pop()
    .end()
	
Let('#footer_bg')
	.set('display', 'block')
	.then()
	.set('opacity', 0.2)
    .pop()
    .end()
	
fooScroll.refresh();
}else{
Let('#footer_menu')
	.set('display', 'block')
	.then()
	.set('opacity', 1)
    .pop()
    .end()

Let('#footer')
	.set('display', 'none')
	.then()
	.set('opacity', 1)
    .pop()
    .end()
	
Let('#footer_bg')
	.set('display', 'none')
	.then()
	.set('opacity', 0)
    .pop()
    .end()	
}
//document.getElementById('footer_menu').style.display="none";
//document.getElementById('footer').style.display="block";

}	



function footer_menu_off_2(id){

if(id==0){

Let('#footer')
	.set('display', 'block')
	.then()
	.set('opacity', 1)
    .pop()
    .end()
	
Let('#footer_bg')
	.set('display', 'block')
	.then()
	.set('opacity', 0.2)
    .pop()
    .end()
	
document.formUrl.Cls_MPScrollbar_off.value=1;
fooScroll.refresh();
}else{

Let('#footer')
	.set('display', 'none')
	.then()
	.set('opacity', 1)
    .pop()
    .end()
	
Let('#footer_bg')
	.set('display', 'none')
	.then()
	.set('opacity', 0)
    .pop()
    .end()	

document.formUrl.Cls_MPScrollbar_off.value=0;
}
//document.getElementById('footer_menu').style.display="none";
//document.getElementById('footer').style.display="block";

}	
	

function footer_menu_off_2ON(){
var id = document.formUrl.Cls_MPScrollbar_off.value;	

if(id==0){

Let('#footer')
	.set('display', 'block')
	.then()
	.set('opacity', 1)
    .pop()
    .end()
	
Let('#footer_bg')
	.set('display', 'block')
	.then()
	.set('opacity', 0.2)
    .pop()
    .end()
	
document.formUrl.Cls_MPScrollbar_off.value=1;
fooScroll.refresh();
}else{

Let('#footer')
	.set('display', 'none')
	.then()
	.set('opacity', 1)
    .pop()
    .end()
	
Let('#footer_bg')
	.set('display', 'none')
	.then()
	.set('opacity', 0)
    .pop()
    .end()	

document.formUrl.Cls_MPScrollbar_off.value=0;
}

}	
	
	
/*菜单伸缩按钮*/
function footmenuON(id,url,t) {
var Cls_MPScrollbar = document.formUrl.Cls_MPScrollbar.value;
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;

if(Cls_MPScrollbar!=0){wh=document.body.clientWidth}
//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;

var Cls_MPScrollbar = document.formUrl.Cls_MPScrollbar.value;
if(Cls_MPScrollbar!=0){wh=document.body.clientWidth}

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";

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

if(Cls_MPScrollbar==2){
    document.getElementById('footer_menu').style.display = "block";
}
					
}	
}





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

var Cls_MPScrollbar = document.formUrl.Cls_MPScrollbar.value;
if(Cls_MPScrollbar!=0){wh=document.body.clientWidth}

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;

var Cls_MPScrollbar = document.formUrl.Cls_MPScrollbar.value;
if(Cls_MPScrollbar!=0){wh=document.body.clientWidth}

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;

var Cls_MPScrollbar = document.formUrl.Cls_MPScrollbar.value;
if(Cls_MPScrollbar!=0){wh=document.body.clientWidth}

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;

var Cls_MPScrollbar = document.formUrl.Cls_MPScrollbar.value;
if(Cls_MPScrollbar!=0){wh=document.body.clientWidth}

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;

}		
}






//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();
  }

}



//URL 跳转
function cengUrl(ceng,url,more){
	
  if(ceng==1){
      oneChickUrl(url,more);
  }else if(ceng==2){
	  twoChickUrl(url,more);
  }else if(ceng==3){
	  threeChickUrl(url,more);
  }else if(ceng==4){
	  fourChickUrl(url,more);
  }else if(ceng==5){
	  fiveChickUrl(url,more);
  }

}

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

}

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

}





















//激活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);
}
function formTextareaHeightID(ID,ceng) {
    var text = document.getElementById(ID);
    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 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');
	
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 = encode(document.pinglun.txt.value);
			var ceng = document.pinglun.ceng.value;
			//var txts = txt.replace(/\u/g,'u+')
			var postStr = "id="+id+"&ceng="+ceng+"&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(v[3],"","",1);
					el.innerHTML = v[0];
					document.pinglun.txt.value = "";
					
					
					if(ceng==1){
     				 document.formUrl.posti.value = v[2];
	 				 document.formUrl.postlastID.value = v[1];
					}else if(ceng==2){
	 				 document.formUrl.posti2.value = v[2];
	 				 document.formUrl.postlastID2.value = v[1];
    				}else if(ceng==3){
     				 document.formUrl.posti3.value = v[2];
	 				 document.formUrl.postlastID3.value = v[1];
    				}else if(ceng==4){
	 				 document.formUrl.posti4.value = v[2];
	 				 document.formUrl.postlastID4.value = v[1];
    				}else if(ceng==5){
	 				 document.formUrl.posti5.value = v[2];
	 				 document.formUrl.postlastID5.value = v[1];
    				}
					
					cengRefresh(ceng);

			    }

			}
			//结束
}	
}



//评论回复按钮
function checkpinglun2Form(t,ceng){
	
el = document.getElementById('txtlist2');
li = document.createElement('li');
	
if (document.pinglun2.txt.value == ""){
 scscms_alert("请填写评论内容","","",1);
 return false;
}else{
            //开始
			var id = document.pinglun2.id.value;
			var hid = document.pinglun2.hid.value;
			var username = document.pinglun2.username.value;
			var txt = encode(document.pinglun2.txt.value);
			var ceng = document.pinglun2.ceng.value;
			var postStr = "id="+id+"&ceng="+ceng+"&hid="+hid+"&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];
					document.pinglun2.txt.value = "";
					cengRefresh(ceng);

			    }

			}
			//结束
}	
}










//生成推广二维码
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 Mapspic(url){
wx.previewImage({
    current: url, // 当前显示图片的http链接
    urls: [url] // 需要预览的图片http链接列表
});
}
//查看多张图片
function ViewpicSnsShow(url){
var pic = document.erweima2theForm.pic.value;

imgLists = new Array;
imgLists = pic.split("|");

wx.previewImage({
    current: url, // 当前显示图片的http链接
    urls: imgLists // 需要预览的图片http链接列表
});
}

//单图片文件上传
function Upload_One_Pic_FilsToo(IDs,IDt){
wx.chooseImage({
    count: 1, // 默认9
    sizeType: ['compressed'], // 可以指定是原图还是压缩图，默认二者都有
    sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
    success: function (res) {
        var localIds = res.localIds; // 返回选定照片的本地ID列表，localId可以作为img标签的src属性显示图片
		var errMsg1 = res.errMsg;
		document.getElementById(IDs+"id").value = localIds;
		//scscms_alert("上传中，请等待","","",99999999);
		
		if(errMsg1=="chooseImage:ok"){
		wx.uploadImage({
		    localId: document.getElementById(IDs+"id").value, // 需要上传的图片的本地ID，由chooseImage接口获得
		    isShowProgressTips: 1, // 默认为1，显示进度提示
 		   success: function (res2) {
 		       var serverId = res2.serverId; // 返回图片的服务器端ID
			   var errMsg2 = res2.errMsg;
			   
		       if(errMsg2=="uploadImage:ok"){
                   document.getElementById(IDs+"id").value = serverId;
				   
//				   var utt=0;
//				   if(navigator.userAgent.match(/Android/i)){
//					   utt=1;
//				   }else{
//					   utt=0;
//				   }
		           scscms_alert("保存中，请等待","","",99999999);
                   var upicid = document.getElementById(IDs+"id").value;	
                   var url = "Upload.One.Pic.ok.asp";
                   var postStr = "upicid="+upicid;
                   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(){
								  if(IDt==0){
								      document.getElementById(IDs).value = v[2];
								  }else{
								      document.getElementById(IDs).value = v[2];
									  document.getElementById(IDs+"src").src = v[2];
								  }
						      });
                   		  }else{
                   			  scscms_alert("保存失败","","",1); 
                   		  }

                   	}
                   }		
				   
				   
				   
               }else{
			       scscms_alert("上传失败","","",1);
                   return false;
		       }
			   
		    }
		});		
		}else{
			scscms_alert("请重新选择上传文件","","",1);
            return false;
		}
		
    }
});
}

function PushUserFilsTooDow(utitle){
wx.downloadImage({
    serverId: utitle, // 需要下载的图片的服务器端ID，由uploadImage接口获得
    isShowProgressTips: 1, // 默认为1，显示进度提示
    success: function (res) {
        var localId = res.localId; // 返回图片下载后的本地ID
		document.getElementById("tk_myselfpic").src = localId;
    }
});
}


//视频上传
function Upload_One_Video_FilsToo(){
var uvideo = document.useretkform.uvideo.value;
scscms_alert("上传中，请等待","","",99999999);
var url = "Upload.One.Video.ok.asp";
var postStr = "uvideo="+uvideo;
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("$$$");

        alert(vs);

	}
}
}



//公开群私密群切换设置
function GrouplistON(IDs){
var GID = document.Grouplist.GID.value;
var OC = document.Grouplist.OC.value;
var PC = document.Grouplist.PC.value;
var code = hex_md5("IDs="+IDs+"&GID="+GID);

if(IDs==0){
	document.Grouplist.tt.value = 0;
    document.getElementById("group_open").className = "payfsArr";
	document.getElementById("group_pass").className = "payfs";
}else if(IDs==1){
	document.Grouplist.tt.value = 1;
    document.getElementById("group_open").className = "payfs";
	document.getElementById("group_pass").className = "payfsArr";
}

var url = "Sns.Group.Add.ccc.asp";
var postStr = "IDs="+IDs+"&GID="+GID+"&code="+code;
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"){
	      document.getElementById("group_open_ccc").innerHTML = v[1];
		  document.Grouplist.OC.value = v[1];
	      document.getElementById("group_pass_ccc").innerHTML = v[2];
		  document.Grouplist.PC.value = v[2];
		  document.Grouplist.amount.value = v[3];
		  document.Grouplist.MAXamount.value = v[3];
	  }else{
		  scscms_alert(v[1],"","",1); 
		  return false;
	  }
  }
}

}




//发帖审核开关
function GrouplistViewflag(){
var viewflag = document.Grouplist.viewflag.value;

if(viewflag==0){
	document.Grouplist.viewflag.value = 1;
    document.getElementById("group_viewflag").className = "payfsArr";
}else{
	document.Grouplist.viewflag.value = 0;
    document.getElementById("group_viewflag").className = "payfs";
}
}


//评论审核开关
function GrouplistReviewflag(){
var reviewflag = document.Grouplist.reviewflag.value;

if(reviewflag==0){
	document.Grouplist.reviewflag.value = 1;
    document.getElementById("group_reviewflag").className = "payfsArr";
}else{
	document.Grouplist.reviewflag.value = 0;
    document.getElementById("group_reviewflag").className = "payfs";
}
}



//创建群组
function saveGroupdata(){
var gpic = document.Grouplist.gpic.value;
var tt = document.Grouplist.tt.value;
var gtitle = document.Grouplist.gtitle.value;
var amount = document.Grouplist.amount.value;
var ceng = document.Grouplist.ceng.value;

var OC = document.Grouplist.OC.value;
var PC = document.Grouplist.PC.value;
var MAXamount = document.Grouplist.MAXamount.value;

var gam_t = document.Grouplist.gam_t.value;
var gam_tx = document.Grouplist.gam_tx.value;
var gam_x = document.Grouplist.gam_x.value;
var gam_xx = document.Grouplist.gam_xx.value;
var gam_s = document.Grouplist.gam_s.value;
var gam_sx = document.Grouplist.gam_sx.value;
var gam_z = document.Grouplist.gam_z.value;
var gam_zx = document.Grouplist.gam_zx.value;

var messoff = document.Grouplist.messoff.value;
var messtxt = encodeURIComponent(document.Grouplist.messtxt.value);

var viewflag = document.Grouplist.viewflag.value;
var reviewflag = document.Grouplist.reviewflag.value;

var code = hex_md5("tt="+tt+"&amount="+amount+"&OC="+OC+"&PC="+PC);

if(tt==0){
	if(Number(OC)<0){
		scscms_alert("公开群名额已用完","","",1);
		return false;
	}
}else if(tt=1){
	if(Number(PC)<0){
		scscms_alert("私密群名额已用完","","",1);
		return false;
	}
}
if(gpic==""){
scscms_alert("请上传群标","","",1);
return false;
}
if(gtitle==""){
scscms_alert("请填写群名称","","",1);
return false;
}
if(Number(amount)<0 || Number(amount)>MAXamount){
scscms_alert("群费为"+MAXamount+"以内的数","","",1);
return false;
}

scscms_alert("创建中，请等待","","",99999999);

var url = "Sns.Group.Add.ok.asp";
var postStr = "gpic="+gpic+"&tt="+tt+"&gtitle="+gtitle+"&amount="+amount+"&OC="+OC+"&PC="+PC+"&code="+code+"&gam_t="+gam_t+"&gam_tx="+gam_tx+"&gam_x="+gam_x+"&gam_xx="+gam_xx+"&gam_s="+gam_s+"&gam_sx="+gam_sx+"&gam_z="+gam_z+"&gam_zx="+gam_zx+"&messoff="+messoff+"&messtxt="+messtxt+"&viewflag="+viewflag+"&reviewflag="+reviewflag;
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(){
			  if(ceng==1){
			  oneChickUrl('Sns.Group.asp',2);
			  }else if(ceng==2){
			  TwoON();
			  }else if(ceng==3){
			  ThreeON();
			  }else if(ceng==4){
			  FourON();
			  }else if(ceng==5){
			  FiveON();
			  }
		  });	  
	  }else{
		  scscms_alert(v[1],"","",1); 
		  return false;
	  }
  }
}
}

//修改群组
function editGroupdata(ceng){
var IDs = document.Grouplist.IDs.value;
var gpic = document.Grouplist.gpic.value;
var gtitle = document.Grouplist.gtitle.value;
var amount = document.Grouplist.amount.value;

var OC = document.Grouplist.OC.value;
var PC = document.Grouplist.PC.value;
var MAXamount = document.Grouplist.MAXamount.value;

var gam_t = document.Grouplist.gam_t.value;
var gam_tx = document.Grouplist.gam_tx.value;
var gam_x = document.Grouplist.gam_x.value;
var gam_xx = document.Grouplist.gam_xx.value;
var gam_s = document.Grouplist.gam_s.value;
var gam_sx = document.Grouplist.gam_sx.value;
var gam_z = document.Grouplist.gam_z.value;
var gam_zx = document.Grouplist.gam_zx.value;

var messoff = document.Grouplist.messoff.value;
var messtxt = encodeURIComponent(document.Grouplist.messtxt.value);

var viewflag = document.Grouplist.viewflag.value;
var reviewflag = document.Grouplist.reviewflag.value;

var code = hex_md5("IDs="+IDs+"&amount="+amount+"&OC="+OC+"&PC="+PC);

if(gpic==""){
scscms_alert("请上传群标","","",1);
return false;
}
if(gtitle==""){
scscms_alert("请填写群名称","","",1);
return false;
}
if(Number(amount)<0 || Number(amount)>MAXamount){
scscms_alert("群费为"+MAXamount+"以内的数","","",1);
return false;
}

scscms_alert("保存中，请等待","","",99999999);

var url = "Sns.Group.Edit.ok.asp";
var postStr = "gpic="+gpic+"&IDs="+IDs+"&gtitle="+gtitle+"&amount="+amount+"&OC="+OC+"&PC="+PC+"&code="+code+"&gam_t="+gam_t+"&gam_tx="+gam_tx+"&gam_x="+gam_x+"&gam_xx="+gam_xx+"&gam_s="+gam_s+"&gam_sx="+gam_sx+"&gam_z="+gam_z+"&gam_zx="+gam_zx+"&messoff="+messoff+"&messtxt="+messtxt+"&viewflag="+viewflag+"&reviewflag="+reviewflag;
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(){
			  if(ceng==2){
			  	TwoON();
			  }else if(ceng==3){
			  	ThreeON();
			  }else if(ceng==4){
			  	FourON();
			  }else if(ceng==5){
			  	FiveON();
			  }
			  });	  
	  }else{
		  scscms_alert(v[1],"","",1); 
		  return false;
	  }
  }
}
}


//单图片文件上传
function Upload_More_Pic_FilsToo(IDs,ceng){
var s = document.SnsGroupListNew.s.value;

var ftxt="";	
if(Number(s) > 0){	
	for(i=1;i<=s;i++){
		//if(ftxt==""){
		//	ftxt = document.getElementById("file_title_"+i).value ;
		//}else{
			//alert(s+"\r\n"+ document.getElementById("file_pic_"+s).value);
			ftxt = ftxt+"$$$"+document.getElementById("file_title_"+i).value ;
		//}
	}
    document.SnsGroupListNew.ftxt.value = ftxt;
}
						  
wx.chooseImage({
    count: 1, // 默认9
    sizeType: ['compressed'], // 可以指定是原图还是压缩图，默认二者都有
    sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
    success: function (res) {
        var localIds = res.localIds; // 返回选定照片的本地ID列表，localId可以作为img标签的src属性显示图片
		var errMsg1 = res.errMsg;
		document.SnsGroupListNew.fid.value = localIds;
		//scscms_alert("上传中，请等待","","",99999999);
		
		if(errMsg1=="chooseImage:ok"){
		wx.uploadImage({
		    localId: document.SnsGroupListNew.fid.value, // 需要上传的图片的本地ID，由chooseImage接口获得
		    isShowProgressTips: 1, // 默认为1，显示进度提示
 		   success: function (res2) {
 		       var serverId = res2.serverId; // 返回图片的服务器端ID
			   var errMsg2 = res2.errMsg;
			   
		       if(errMsg2=="uploadImage:ok"){
                   document.SnsGroupListNew.fid.value = serverId;
				   
//				   var utt=0;
//				   if(navigator.userAgent.match(/Android/i)){
//					   utt=1;
//				   }else{
//					   utt=0;
//				   }
		           scscms_alert("保存中，请等待","","",99999999);
                   var upicid = document.SnsGroupListNew.fid.value;	
                   var url = "Upload.More.Pic.ok.asp";
                   var postStr = "upicid="+upicid+"&s="+s+"&ceng="+ceng;
                   ajax.open("POST", url, true);
                   ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
                   ajax.send(postStr);
                   ajax.onreadystatechange = function(){
                   	if(ajax.readyState == 4 && ajax.status == 200){
                   		vs  = ajax.responseText;
                        v = new Array;
                        v = vs.split("$$$");
		
                   		  if(v[0]=="ok"){
                   		  	  //scscms_alert(v[1],'ok',function(){
								  
								  document.SnsGroupListNew.s.value = v[2];
								  document.getElementById(IDs).innerHTML += v[3];
									  
								  if(Number(s) > 0 && ftxt!=""){
									  //var ftxts = document.SnsGroupListNew.ftxt.value;
									  fv = new Array;
                                      fv = ftxt.split("$$$");
						              for(ii=1;ii<=s;ii++){
								          document.getElementById("file_title_"+ii).value = fv[ii] ;
						              }
								  }
						      if(ceng==1){oneScroll.refresh();}
							  if(ceng==2){twoScroll.refresh();}
							  if(ceng==3){threeScroll.refresh();}
							  if(ceng==4){fourScroll.refresh();}
							  if(ceng==5){fiveScroll.refresh();}
							  
							  $("#mask_layer999").remove();
							  $("#scs_alert999").remove();
						      //});
                   		  }else{
                   			  scscms_alert("保存失败","","",1); 
                   		  }

                   	}
                   }		
				   
				   
				   
               }else{
			       scscms_alert("上传失败","","",1);
                   return false;
		       }
			   
		    }
		});		
		}else{
			scscms_alert("请重新选择上传文件","","",1);
            return false;
		}
		
    }
});
}



//获取腾讯视频
function TenV_openvideo(vid,modId){
var Cls_MPScrollbar = document.formUrl.Cls_MPScrollbar.value;	
var wh = document.body.clientWidth-45;

if(Cls_MPScrollbar!=0){wh=document.body.clientWidth}

tvp.$.getScript('http://'+document.domain+'/mp5.0/js/video_setting.js', function(){

var video = new tvp.VideoInfo();
video.setVid(vid);
var width = parseInt(wh*0.95),
  height = parseInt(width*0.75),
  height = height > window.innerHeight ? window.innerHeight : height;

var player = new tvp.Player();
player.create({
  width  : width,
  height : height,
  pic: tvp.common.getVideoSnapMobile(vid),
  video  : video,
  playerType: 'html5',
  modId  : modId,
  autoplay: true,//是否自动播放true/false
  isHtml5UseUI:true,
  isiPhoneShowPlaysinline: !!tvp.$.browser.WeChat,
  isiPhoneShowPosterOnPause: false,
  isHtml5UseFakeFullScreen: false,
  isContinuePlay: false,
  plugins: {
    AppRecommend: {
      // vid: 123,
      // isInsertCurId: 1
    }
  }

});


});
//document.write("<div id='"+modId+"'></div>");

}

//获取图片
function TenV_openvideoimage(vid){
var images=tvp.common.getVideoSnapMobile(vid)//获取图片
return "http:"+images ;
}

//获取视频ID
function TenV_getvid(url){
var isvid=url.indexOf('vid=');
if (isvid>0){
urlaar=url.split('?');
urls=urlaar[1];
vidaar=urls.split('&');
for(var i=0;i<vidaar.length;i++){
vidstr=vidaar[i];
var isvids=vidstr.indexOf('vid=');
if (isvids>=0){
break;
}
}
vidsaar=vidstr.split('=');
vid=vidsaar[1];
}else{
urlaar=url.split('/');
urls=urlaar[urlaar.length-1];
vidaar=urls.split('.');
vid=vidaar[0];
}
return vid;
}
//载入视频
function saveUploadVideo(){
var ceng = document.Upload_Video.ceng.value;
var title = document.Upload_Video.title.value;
var s = document.SnsGroupListNew.s.value;

if(title==""){
scscms_alert("请粘贴视频链接","","",1);
return false;
}

var vid = TenV_getvid(title);

if(vid==""){
scscms_alert("视频链接有误","","",1);
return false;
}

var vpic = encodeURIComponent(TenV_openvideoimage(vid));

scscms_alert("载入中，请等待","","",99999999);

var file_ttrr = document.getElementsByName("file_tt");
var file_tt = "";

var file_urlrr = document.getElementsByName("file_url");
var file_url = "";

for(i=0;i<file_ttrr.length;i++){
    if(file_ttrr[i].value=="video"){
	    if(file_url!=""){
			file_url = file_url+","+file_urlrr[i].value;
		}else{
			file_url = file_urlrr[i].value;
		}
    }
}

var ftxt="";	
if(Number(s) > 0){	
	for(i=1;i<=s;i++){
		//if(ftxt==""){
		//	ftxt = document.getElementById("file_title_"+i).value ;
		//}else{
			//alert(s+"\r\n"+ document.getElementById("file_pic_"+s).value);
			ftxt = ftxt+"$$$"+document.getElementById("file_title_"+i).value ;
		//}
	}
    document.SnsGroupListNew.ftxt.value = ftxt;
}

var url = "Upload.Video.ok.asp";
var postStr = "ceng="+ceng+"&title="+title+"&vid="+vid+"&vpic="+vpic+"&s="+s;
ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function(){
  if(ajax.readyState == 4 && ajax.status == 200){
	  vs  = ajax.responseText;
      v = new Array;
      v = vs.split("$$$");

      if(v[0]=="ok"){
	      if(file_url.indexOf(v[4]) >= 0 ){
			  scscms_alert("请勿重复载入","","",1); 
		      return false;
		  }
		  //alert(file_url.indexOf(v[4]));
		  document.SnsGroupListNew.s.value = v[2];
		  document.getElementById("GL_txt_now").innerHTML += v[3];	
		  if(Number(s) > 0 && ftxt!=""){						  
		      fv = new Array;
              fv = ftxt.split("$$$");
			  for(ii=1;ii<=s;ii++){
				  document.getElementById("file_title_"+ii).value = fv[ii] ;
			  }
		  }
		  //if(ceng==1){oneScroll.refresh();}
		  if(ceng==2){oneScroll.refresh();TwoON();}
		  if(ceng==3){twoScroll.refresh();ThreeON();}
		  if(ceng==4){threeScroll.refresh();FourON();}
		  if(ceng==5){fourScroll.refresh();FiveON();}
		  
		  $("#mask_layer999").remove();
		  $("#scs_alert999").remove();
	  }else{
		  scscms_alert(v[1],"","",1); 
		  return false;
	  }
  }
}
}





//载入视频
function saveUploadLive(){
var ceng = document.Upload_Live.ceng.value;
var title = encodeURIComponent(document.Upload_Live.title.value);
var s = document.SnsGroupListNew.s.value;

if(title==""){
scscms_alert("请粘贴直播链接","","",1);
return false;
}

scscms_alert("载入中，请等待","","",99999999);

var file_ttrr = document.getElementsByName("file_tt");
var file_tt = "";

var file_urlrr = document.getElementsByName("file_url");
var file_url = "";

for(i=0;i<file_ttrr.length;i++){
    if(file_ttrr[i].value=="live"){
	    if(file_url!=""){
			file_url = file_url+","+file_urlrr[i].value;
		}else{
			file_url = file_urlrr[i].value;
		}
    }
}

var ftxt="";	
if(Number(s) > 0){	
	for(i=1;i<=s;i++){
		//if(ftxt==""){
		//	ftxt = document.getElementById("file_title_"+i).value ;
		//}else{
			//alert(s+"\r\n"+ document.getElementById("file_pic_"+s).value);
			ftxt = ftxt+"$$$"+document.getElementById("file_title_"+i).value ;
		//}
	}
    document.SnsGroupListNew.ftxt.value = ftxt;
}

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

      if(v[0]=="ok"){
	      if(file_url.indexOf(v[4]) >= 0 ){
			  scscms_alert("请勿重复载入","","",1); 
		      return false;
		  }
		  //alert(file_url.indexOf(v[4]));
		  document.SnsGroupListNew.s.value = v[2];
		  document.getElementById("GL_txt_now").innerHTML += v[3];	
		  if(Number(s) > 0 && ftxt!=""){						  
		      fv = new Array;
              fv = ftxt.split("$$$");
			  for(ii=1;ii<=s;ii++){
				  document.getElementById("file_title_"+ii).value = fv[ii] ;
			  }
		  }
		  //if(ceng==1){oneScroll.refresh();}
		  if(ceng==2){oneScroll.refresh();TwoON();}
		  if(ceng==3){twoScroll.refresh();ThreeON();}
		  if(ceng==4){threeScroll.refresh();FourON();}
		  if(ceng==5){fourScroll.refresh();FiveON();}
		  
		  $("#mask_layer999").remove();
		  $("#scs_alert999").remove();
	  }else{
		  scscms_alert(v[1],"","",1); 
		  return false;
	  }
  }
}
}



//开启关闭直播
function onoffLive(IDs,tt){
var url = "Sns.Show.Live.on.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(tt==0){
		 document.getElementById("show_mess").style.display="table";
		 document.getElementById("show_live").style.display="none";
	 }else{
		 document.getElementById("show_mess").style.display="none";
		 document.getElementById("show_live").style.display="table";
	 }

    }
  }	 
}

//60秒统计
function runCountSoundLive(t){
var sec = document.erweima2theForm.sec.value;
if(t>0){
    document.getElementById("alert_txt777").innerHTML = t+"'";
	document.erweima2theForm.sec.value = Number(sec) + 1;
    t--;
    setTimeout(function(){runCountSoundLive(t);},1000);
}else{
    stopSoundLive();
}
}

//开始发语音
function stratSoundLive(){
scscms_alert("最长1分钟","","",77777777);

var el = document.getElementById("mSoundLiveTime");
var li = document.createElement('li');
var SnsListID = document.erweima2theForm.SnsListID.value;
var ceng = document.erweima2theForm.ceng.value;
var sec = document.erweima2theForm.sec.value;

var M0 = 0;
var ii = 0;
if(ceng==1){
    M0 = document.formUrl.postlastID.value;
	ii = document.formUrl.posti.value;
}else if(ceng==2){
    M0 = document.formUrl.postlastID2.value;
	ii = document.formUrl.posti2.value;
}else if(ceng==3){
    M0 = document.formUrl.postlastID3.value;
	ii = document.formUrl.posti3.value;
}else if(ceng==4){
    M0 = document.formUrl.postlastID4.value;
	ii = document.formUrl.posti4.value;
}else if(ceng==5){
    M0 = document.formUrl.postlastID5.value;
	ii = document.formUrl.posti5.value;
}


wx.startRecord();

runCountSoundLive(60);

wx.onVoiceRecordEnd({
    // 录音时间超过一分钟没有停止的时候会执行 complete 回调
    complete: function (res) {
        var localId = res.localId; 
		//alert("自动停止："+localId);
		
		$("#mask_layer777").remove();
		$("#scs_alert777").remove();
		scscms_alert("发送中","","",99999999);
		
		wx.uploadVoice({
		    localId: localId, // 需要上传的音频的本地ID，由stopRecord接口获得
 		   isShowProgressTips: 1, // 默认为1，显示进度提示
 		       success: function (res) {
 		       var serverId = res.serverId; // 返回音频的服务器端ID
			   
			   var url = "Sns.Show.Live.ok.asp";
			   var postStr = "SnsListID="+SnsListID+"&serverId="+ serverId +"&sec="+sec+"&M0="+ M0 +"&ii="+ ii;
 
			   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"){
			   		   li.innerHTML = v[2];
					   document.erweima2theForm.sec.value = 0;
					   if(v[3]==0){document.getElementById('refreshSnsMess_tt').style.display="none";}else{document.getElementById('refreshSnsMess_tt').style.display="block";}
			   	   }else{
			   		  scscms_alert(v[1],"","",1); 
		              return false;
			   	   }
				   $("#mask_layer999").remove();
		           $("#scs_alert999").remove();

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


}


//取消录音
function escSoundLive(){
wx.stopRecord({
    success: function (res) {
        var localId = res.localId;
		
		document.erweima2theForm.sec.value = 0;
		$("#mask_layer777").remove();
		$("#scs_alert777").remove();
	
    }
});
}

//停止发语音
function stopSoundLive(){
var el = document.getElementById("mSoundLiveTime");
var li = document.createElement('li');
var SnsListID = document.erweima2theForm.SnsListID.value;
var ceng = document.erweima2theForm.ceng.value;
var sec = document.erweima2theForm.sec.value;

var M0 = 0;
var ii = 0;
if(ceng==1){
    M0 = document.formUrl.postlastID.value;
	ii = document.formUrl.posti.value;
}else if(ceng==2){
    M0 = document.formUrl.postlastID2.value;
	ii = document.formUrl.posti2.value;
}else if(ceng==3){
    M0 = document.formUrl.postlastID3.value;
	ii = document.formUrl.posti3.value;
}else if(ceng==4){
    M0 = document.formUrl.postlastID4.value;
	ii = document.formUrl.posti4.value;
}else if(ceng==5){
    M0 = document.formUrl.postlastID5.value;
	ii = document.formUrl.posti5.value;
}

wx.stopRecord({
    success: function (res) {
        var localId = res.localId;
		//alert("停止："+localId);
		$("#mask_layer777").remove();
		$("#scs_alert777").remove();
		
		scscms_alert("发送中","","",99999999);
		
		
		
		
		wx.uploadVoice({
		    localId: localId, // 需要上传的音频的本地ID，由stopRecord接口获得
 		   isShowProgressTips: 1, // 默认为1，显示进度提示
 		       success: function (res) {
 		       var serverId = res.serverId; // 返回音频的服务器端ID
			   
			   var url = "Sns.Show.Live.ok.asp";
			   var postStr = "SnsListID="+SnsListID+"&serverId="+ serverId +"&sec="+sec+"&M0="+M0+"&ii="+ii;

			   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"){
			   		   li.innerHTML = v[2];
					   document.erweima2theForm.sec.value = 0;
					   if(v[3]==0){document.getElementById('refreshSnsMess_tt').style.display="none";}else{document.getElementById('refreshSnsMess_tt').style.display="block";}
			   	   }else{
			   		  scscms_alert(v[1],"","",1); 
		              return false;
			   	   }
				   $("#mask_layer999").remove();
		           $("#scs_alert999").remove();

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

		
		
		
		
		
		
    }
});
}

  
//下载并播放语音
function playSoundLive(sid,pi){
var piserid = document.erweima2theForm.piserid.value;
var pilocid = document.erweima2theForm.pilocid.value;
var piser = document.erweima2theForm.piser.value;

if(piserid != ""){
    wx.stopVoice({
        localId: pilocid // 需要停止的音频的本地ID，由stopRecord接口获得
    });
	document.getElementById("s_li_"+piserid+"_"+piser).style.background = "#7797D2";
	document.getElementById("s_pl_"+piserid+"_"+piser).value = 0;
    document.erweima2theForm.piserid.value = "";
	document.erweima2theForm.pilocid.value = "";
	document.erweima2theForm.piser.value = 0;
	if(pi==piser){return false}
}
			
wx.downloadVoice({
    serverId: sid, // 需要下载的音频的服务器端ID，由uploadVoice接口获得
    isShowProgressTips: 1, // 默认为1，显示进度提示
    success: function (res) {
        var localId = res.localId; // 返回音频的本地ID
		var pl = document.getElementById("s_pl_"+sid+"_"+pi).value;
		
		//播放语音接口
		if(pl==0){
		wx.playVoice({
            localId: localId // 需要播放的音频的本地ID，由stopRecord接口获得
        });
		document.getElementById("s_li_"+sid+"_"+pi).style.background = "#E56C54";
		document.getElementById("s_pl_"+sid+"_"+pi).value = 1;
		document.erweima2theForm.piserid.value = sid;
		document.erweima2theForm.pilocid.value = localId;
		document.erweima2theForm.piser.value = pi;
		}else{
		wx.stopVoice({
            localId: localId // 需要停止的音频的本地ID，由stopRecord接口获得
        });
		document.getElementById("s_li_"+sid+"_"+pi).style.background = "#7797D2";
		document.getElementById("s_pl_"+sid+"_"+pi).value = 0;
		document.erweima2theForm.piserid.value = "";
		document.erweima2theForm.pilocid.value = "";
		document.erweima2theForm.piser.value = 0;
		}
		wx.onVoicePlayEnd({
            success: function (res) {
            var localId = res.localId; // 返回音频的本地ID
            document.getElementById("s_li_"+sid+"_"+pi).style.background = "#7797D2";
			document.getElementById("s_pl_"+sid+"_"+pi).value = 0;
		    document.erweima2theForm.piserid.value = "";
			document.erweima2theForm.pilocid.value = "";
		    document.erweima2theForm.piser.value = 0;
			}
        });
    }
});
}


//群主语音直播信息加载
var mSoundLiveTime;
//加载更多实时消息
function SoundLiveList()
{
var el = document.getElementById("mSoundLiveTime");
var li = document.createElement('li');

var SnsListID = document.erweima2theForm.SnsListID.value;
var lastID = document.getElementById("s_lastID").value;
var lastPI = document.getElementById("s_lastPI").value;
var ceng = document.erweima2theForm.ceng.value;

var M0 = 0;
var ii = 0;
if(ceng==1){
    M0 = document.formUrl.postlastID.value;
	ii = document.formUrl.posti.value;
}else if(ceng==2){
    M0 = document.formUrl.postlastID2.value;
	ii = document.formUrl.posti2.value;
}else if(ceng==3){
    M0 = document.formUrl.postlastID3.value;
	ii = document.formUrl.posti3.value;
}else if(ceng==4){
    M0 = document.formUrl.postlastID4.value;
	ii = document.formUrl.posti4.value;
}else if(ceng==5){
    M0 = document.formUrl.postlastID5.value;
	ii = document.formUrl.posti5.value;
}
	
var url = "Sns.Show.Live.asp";
var postStr = "SnsListID="+ SnsListID +"&lastID="+ lastID +"&lastPI="+ lastPI +"&M0="+ M0 +"&ii="+ ii;               
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.getElementById("s_lastID").value = v[1];
	 document.getElementById("s_lastPI").value = v[2];
	 if(v[3]==0){document.getElementById('refreshSnsMess_tt').style.display="none";}else{document.getElementById('refreshSnsMess_tt').style.display="block";}
	 mSoundLiveTime = setTimeout("SoundLiveList()",1000);
	 
    }
  el.appendChild(li, el.childNodes[0]);
  cengRefresh(ceng);
}
}




//删除上传图片
function file_div_del(IDs){
document.getElementById("file_div_"+IDs).style.display = "none";
document.getElementById("file_id_"+IDs).value = 0;
}






//保存社区帖子
function SnsGroupListNewSave(){
var GLid = document.SnsGroupListNew.GLid.value;
var nid = document.SnsGroupListNew.nid.value;
var ceng = document.SnsGroupListNew.ceng.value;
var s = document.SnsGroupListNew.s.value;
var title = document.SnsGroupListNew.title.value;
var txts = document.SnsGroupListNew.txts.value;
var txts2 = txts.replace(/\n/g,'<br>')
var txts3 = encodeURIComponent(txts2);
var sPeople = document.SnsGroupListNew.sPeople.value;
var sMoney = document.SnsGroupListNew.sMoney.value;
var gsm_l = document.SnsGroupListNew.gsm_l.value;
var gsm_lx = document.SnsGroupListNew.gsm_lx.value;
var gsm_p = document.SnsGroupListNew.gsm_p.value;
var gsm_px = document.SnsGroupListNew.gsm_px.value;
var pid = document.SnsGroupListNew.pid.value;

var code = hex_md5("nid="+nid+"&sMoney="+sMoney+"&sPeople="+sPeople+"&GLid="+GLid);

if(pid==0){
scscms_alert("请选择分类","","",1);
return false;
}
if(title==""){
scscms_alert("请填写标题","","",1);
return false;
}
if(txts==""){
scscms_alert("请填写内容摘要","","",1);
return false;
}

var file_ttrr = document.getElementsByName("file_tt");
var file_tt = "";

var file_idrr = document.getElementsByName("file_id");
var file_id = "";

var file_picrr = document.getElementsByName("file_pic");
var file_pic = "";

var file_urlrr = document.getElementsByName("file_url");
var file_url = "";

var file_titlerr = document.getElementsByName("file_title");
var file_title = "";

for(i=0;i<file_ttrr.length;i++){
    if(file_tt!=""){
        file_tt = file_tt+"$$$"+file_ttrr[i].value;
		file_id = file_id+"$$$"+file_idrr[i].value;
		file_pic = file_pic+"$$$"+file_picrr[i].value;
		file_url = file_url+"$$$"+file_urlrr[i].value;
		file_title = file_title+"$$$"+file_titlerr[i].value;
    }else{
        file_tt = file_ttrr[i].value;
		file_id = file_idrr[i].value;
		file_pic = file_picrr[i].value;
		file_url = file_urlrr[i].value;
		file_title = file_titlerr[i].value;
    }
}

var file_title1 = file_title.replace(/\n/g,'<br>')
var file_title2 = encodeURIComponent(file_title1);

var url = "Sns.Group.Show.Edit.ok.asp";
var postStr = "GLid="+GLid+"&nid="+nid+"&ceng="+ceng+"&s="+s+"&title="+title+"&txts="+txts3+"&file_tt="+file_tt+"&file_id="+file_id+"&file_pic="+file_pic+"&file_url="+file_url+"&file_title="+file_title2+"&sPeople="+sPeople+"&sMoney="+sMoney+"&code="+code+"&gsm_l="+gsm_l+"&gsm_lx="+gsm_lx+"&gsm_p="+gsm_p+"&gsm_px="+gsm_px+"&pid="+pid;

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(v[0]=="ok"){
	      scscms_alert(v[1],'ok',function(){
			  if(ceng==2){TwoON();}
		      if(ceng==3){ThreeON();}
		      if(ceng==4){FourON();}
		      if(ceng==5){FiveON();}
			  });	  
	  }else{
		  scscms_alert(v[1],"","",1); 
		  return false;
	  }
  }
}

}



//群贴删除
function snsGroupDel(id,ceng){
scscms_alert("删除中，请等待","","",99999999);
var url = "Sns.Group.Show.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("sns_group_admin_"+id).style.display = "none";
	$("#mask_layer999").remove();
	$("#scs_alert999").remove();

  }
  cengRefresh(ceng);
 }	
}


//群贴显示与不显示
function snsGroupFlag(id,ceng){
scscms_alert("提交中，请等待","","",99999999);
var url = "Sns.Group.Show.flag.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){
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	document.getElementById("sns_group_admin_flag_"+id).innerHTML = v[0];
	document.getElementById("sns_group_admin_flagbatton_"+id).innerHTML = v[1];
	$("#mask_layer999").remove();
	$("#scs_alert999").remove();

  }
  cengRefresh(ceng);
 }	
}



//发送私信消息
function SnsSelfMessSave(){
var GLuid = document.SnsGroupListNew.GLuid.value;
var GLid = document.SnsGroupListNew.GLid.value;
var nid = document.SnsGroupListNew.nid.value;
var ceng = document.SnsGroupListNew.ceng.value;
var s = document.SnsGroupListNew.s.value;
var title = document.SnsGroupListNew.title.value;
var txts = document.SnsGroupListNew.txts.value;

if(title==""){
scscms_alert("请填写标题","","",1);
return false;
}
if(txts==""){
scscms_alert("请填写内容摘要","","",1);
return false;
}

var file_ttrr = document.getElementsByName("file_tt");
var file_tt = "";

var file_idrr = document.getElementsByName("file_id");
var file_id = "";

var file_picrr = document.getElementsByName("file_pic");
var file_pic = "";

var file_urlrr = document.getElementsByName("file_url");
var file_url = "";

var file_titlerr = document.getElementsByName("file_title");
var file_title = "";

for(i=0;i<file_ttrr.length;i++){
    if(file_tt!=""){
        file_tt = file_tt+"$$$"+file_ttrr[i].value;
		file_id = file_id+"$$$"+file_idrr[i].value;
		file_pic = file_pic+"$$$"+file_picrr[i].value;
		file_url = file_url+"$$$"+file_urlrr[i].value;
		file_title = file_title+"$$$"+file_titlerr[i].value;
    }else{
        file_tt = file_ttrr[i].value;
		file_id = file_idrr[i].value;
		file_pic = file_picrr[i].value;
		file_url = file_urlrr[i].value;
		file_title = file_titlerr[i].value;
    }
}

var url = "Sns.Group.Mess.ok.asp";
var postStr = "GLuid="+GLuid+"&GLid="+GLid+"&nid="+nid+"&ceng="+ceng+"&s="+s+"&title="+title+"&txts="+txts+"&file_tt="+file_tt+"&file_id="+file_id+"&file_pic="+file_pic+"&file_url="+file_url+"&file_title="+file_title;

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(v[0]=="ok"){
	      scscms_alert(v[1],'ok',function(){
			  if(ceng==2){TwoON();}
		      if(ceng==3){ThreeON();}
		      if(ceng==4){FourON();}
		      if(ceng==5){FiveON();}
			  });	  
	  }else{
		  scscms_alert(v[1],"","",1); 
		  return false;
	  }
  }
}

}




//私信删除
function delMsgDiv(id,ceng){
scscms_alert("删除中，请等待","","",99999999);
var url = "Sns.Msg.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("g_l_"+id).style.display = "none";
	$("#mask_layer999").remove();
	$("#scs_alert999").remove();

  }
  cengRefresh(ceng);
 }	
}


//搜索私信
function searchSNSMsgKyes(ceng){
var keys = document.snsmsgtheForm.keys.value;

var url = "Sns.Msg.Self.asp?keys="+keys+"&ceng="+ceng;

cengUrl(ceng,url,2);
}


//搜索群组
function searchGroupKyes(){
var keys = document.groupkeys.keys.value;

var url = "Sns.Group.asp?keys="+keys;

oneChickUrl(url,2);
}


//生成群推广二维码
function erweimaGroupListDiv(div){

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

var a_s = document.GradeMesstheForm.a_s.value;
var tt = document.GradeMesstheForm.tt.value;
var www = document.GradeMesstheForm.www.value;
var uid = document.GradeMesstheForm.uid.value;
var pushpic = document.GradeMesstheForm.pushpic.value;
var uptkid = document.GradeMesstheForm.uptkid.value;

var txt = encodeURIComponent(document.getElementById(div+"_txt").value);
var pic = encodeURIComponent(document.getElementById(div+"_pic").value);
var emurl = encodeURIComponent(document.getElementById(div+"_url").value);
var num = document.getElementById(div+"_num").value;
var Glid = document.getElementById(div+"_Glid").value;
var SnsListID = document.getElementById(div+"_SnsListID").value;

var url = "/mp5.0/fok/SCAN.Group.asp";
var postStr = "www="+www+"&pic="+pic+"&url="+emurl+"&num="+num+"&tt="+tt+"&txt="+txt+"&ccc="+a_s+"&uid="+uid+"&pushpic="+pushpic+"&uptkid="+uptkid+"&Glid="+Glid+"&SnsListID="+SnsListID;


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(){
			$("#mask_layer999").remove();
		    $("#scs_alert999").remove();
			Mapspic("http://"+document.domain+v[3]);
			});
	  }else{
        scscms_alert(v[1],"","",1);  
		return false;
	  }
	  
  }
}
}
function NowerweimaGroupListDiv(div){

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

var a_s = document.GradeMesstheForm.a_s.value;
var tt = document.GradeMesstheForm.tt.value;
var www = document.GradeMesstheForm.www.value;
var uid = document.GradeMesstheForm.uid.value;
var pushpic = document.GradeMesstheForm.pushpic.value;
var uptkid = document.GradeMesstheForm.uptkid.value;

var txt = encodeURIComponent(document.getElementById(div+"_txt").value);
var pic = encodeURIComponent(document.getElementById(div+"_pic").value);
var emurl = encodeURIComponent(document.getElementById(div+"_url").value);
var num = document.getElementById(div+"_num").value;
var Glid = document.getElementById(div+"_Glid").value;
var SnsListID = document.getElementById(div+"_SnsListID").value;

var url = "/mp5.0/fok/SCAN.Group.asp";
var postStr = "www="+www+"&pic="+pic+"&url="+emurl+"&num="+num+"&tt="+tt+"&txt="+txt+"&ccc="+a_s+"&uid="+uid+"&pushpic="+pushpic+"&uptkid="+uptkid+"&Glid="+Glid+"&SnsListID="+SnsListID;


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(){
			$("#mask_layer999").remove();
		    $("#scs_alert999").remove();
			Mapspic("http://"+document.domain+v[3]);
			});
	  }else{
        scscms_alert(v[1],"","",1);  
		return false;
	  }
	  
  }
}
}


//动态详情生成群推广二维码
function erweima2GroupListDiv(div){

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

var a_s = document.erweima2theForm.a_s.value;
var tt = document.erweima2theForm.tt.value;
var www = document.erweima2theForm.www.value;
var uid = document.erweima2theForm.uid.value;
var pushpic = document.erweima2theForm.pushpic.value;
var uptkid = document.erweima2theForm.uptkid.value;

var txt = encodeURIComponent(document.getElementById(div+"_txt").value);
var pic = encodeURIComponent(document.getElementById(div+"_pic").value);
var emurl = encodeURIComponent(document.getElementById(div+"_url").value);
var num = document.getElementById(div+"_num").value;
var Glid = document.getElementById(div+"_Glid").value;
var SnsListID = document.getElementById(div+"_SnsListID").value;

var url = "/mp5.0/fok/SCAN.Group.asp";
var postStr = "www="+www+"&pic="+pic+"&url="+emurl+"&num="+num+"&tt="+tt+"&txt="+txt+"&ccc="+a_s+"&uid="+uid+"&pushpic="+pushpic+"&uptkid="+uptkid+"&Glid="+Glid+"&SnsListID="+SnsListID;


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(){
			$("#mask_layer999").remove();
		    $("#scs_alert999").remove();
			Mapspic("http://"+document.domain+v[3]);
			});
	  }else{
        scscms_alert(v[1],"","",1);  
		return false;
	  }
	  
  }
}
}




//加入私密群
function AddSnsGroup(ts){
var ceng = document.erweimatheForm.ceng.value;
var Glid = document.erweimatheForm.Glid.value;
var amount = document.erweimatheForm.amount.value;
var nid = document.erweimatheForm.nid.value;
var openid = document.erweimatheForm.openid.value;
var zffs = document.erweimatheForm.zffs.value;
var MchURL = document.erweimatheForm.MchURL.value;
var code = hex_md5("glid="+Glid+"&amount="+amount+"&zffs="+zffs+"&ts="+ts);
var timestamp = Date.parse(new Date());	

var url = "Sns.Group.Show.ok.asp";
var postStr = "Glid="+Glid+"&amount="+amount+"&nid="+nid+"&openid="+openid+"&zffs="+zffs+"&ts="+ts+"&code="+code;

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

	  if(v[0]=="ok"){
		  
		  if(ts==1){
			  
			  cengUrl(ceng,"Sns.Group.Show.asp?ID="+v[1]+"&num=last&ceng="+ceng+"&nid="+timestamp,2);
			  
		  }else if(ts==2){
			  
		      cengUrl(ceng,"Sns.Group.Show.asp?ID="+v[1]+"&num=last&ceng="+ceng+"&nid="+timestamp,1);
			  
		  }else if(ts==3){
			  
		      cengUrl(ceng,"Sns.Group.Show.asp?ID="+v[1]+"&num=last&ceng="+ceng+"&nid="+timestamp,1);
			  
		  }else if(ts==4){
			  
			  cengUrl(ceng,"Sns.Group.Show.asp?ID="+v[1]+"&num=last&ceng="+ceng+"&nid="+timestamp,1);
			  
		  }else if(ts==5){
			  
			  cengUrl(ceng,"Sns.Group.Show.asp?ID="+v[1]+"&num=last&ceng="+ceng+"&nid="+timestamp,1);
			  
		  }

	  }else{
        scscms_alert(v[1],"","",1);  
		return false;
	  }
	  
  }
}
}

function NowAddSnsGroup(ts){
var ceng = document.GradeMesstheForm.ceng.value;
var Glid = document.GradeMesstheForm.Glid.value;
var amount = document.GradeMesstheForm.amount.value;
var nid = document.GradeMesstheForm.nid.value;
var openid = document.GradeMesstheForm.openid.value;
var zffs = document.GradeMesstheForm.zffs.value;
var MchURL = document.GradeMesstheForm.MchURL.value;
var code = hex_md5("glid="+Glid+"&amount="+amount+"&zffs="+zffs+"&ts="+ts);
var timestamp = Date.parse(new Date());	

var url = "Sns.Group.Show.ok.asp";
var postStr = "Glid="+Glid+"&amount="+amount+"&nid="+nid+"&openid="+openid+"&zffs="+zffs+"&ts="+ts+"&code="+code;

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

	  if(v[0]=="ok"){
		  
		  if(ts==1){
			  
			  cengUrl(ceng,"Sns.Group.Show.asp?ID="+v[1]+"&num=last&ceng="+ceng+"&nid="+timestamp,2);
			  
		  }else if(ts==2){
			  
		      cengUrl(ceng,"Sns.Group.Show.asp?ID="+v[1]+"&num=last&ceng="+ceng+"&nid="+timestamp,1);
			  
		  }else if(ts==3){
			  
		      cengUrl(ceng,"Sns.Group.Show.asp?ID="+v[1]+"&num=last&ceng="+ceng+"&nid="+timestamp,1);
			  
		  }else if(ts==4){
			  
			  cengUrl(ceng,"Sns.Group.Show.asp?ID="+v[1]+"&num=last&ceng="+ceng+"&nid="+timestamp,1);
			  
		  }else if(ts==5){
			  
		      //alert("Sns.Group.Show.asp?ID="+v[1]+"&num=last&ceng="+ceng+"&nid="+timestamp);
			  cengUrl(ceng,"Sns.Group.Show.asp?ID="+v[1]+"&num=last&ceng="+ceng+"&nid="+timestamp,1);
			  
		  }

	  }else{
        scscms_alert(v[1],"","",1);  
		return false;
	  }
	  
  }
}
}


//搜索群动态
function searchSNSKyes(){
var keys = document.erweimatheForm.keys.value;

var url = "Sns.asp?keys="+keys;

oneChickUrl(url,2);
}



//搜索群组成员
function PushGroupPeoKyes(uid){
scscms_alert("推送中，请等待","","",99999999);

var IDs = document.grouppeokeys.IDs.value;
var ceng = document.grouppeokeys.ceng.value;
var keys = document.grouppeokeys.keys.value;
var emurl = encodeURIComponent(document.grouppeokeys.url.value);

if(keys==""){
scscms_alert("请选择推送贴或填写推送内容","","",1);
return false;
}

var url = "Sns.Group.Peo.Push.asp";
var postStr = "IDs="+IDs+"&ceng="+ceng+"&keys="+keys+"&url="+emurl+"&uid="+uid;
//alert(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]=="ok"){
		//scscms_alert(v[1],'ok',function(){
			$("#mask_layer999").remove();
		    $("#scs_alert999").remove();
			document.getElementById("peo_push_"+uid).innerHTML = "-";
			//});
	  }else{
        scscms_alert(v[1],"","",1);  
		return false;
	  }
	  
  }
}

}


//搜索群动态
function searchSNSselfKyes(){
var ceng = document.snslisttheForm.ceng.value;
var keys = document.snslisttheForm.keys.value;

var url = "Sns.List.asp?ceng="+ceng+"&keys="+keys;

cengUrl(ceng,url,2);
}


//素材库删除
function delGroupListDiv(id,ceng){
scscms_alert("删除中，请等待","","",99999999);
var url = "Sns.List.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("g_l_"+id).style.display = "none";
	$("#mask_layer999").remove();
	$("#scs_alert999").remove();

  }
 cengRefresh(ceng);
 }	
}


//处理群成员状态
function SNSGroupPeoFlag(IDs,tt){
var url = "Sns.Group.Flag.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[0]=="ok"){
	  if(tt==0){
		  document.getElementById("peo_"+IDs).style.display = "none";
	  }else if(tt==3){
	      document.getElementById("peo_nomess_"+IDs).innerHTML = v[1];
	  }else{
		  document.getElementById("peo_flag_"+IDs).innerHTML = v[1];
	  }

      }else{
        scscms_alert(v[1],"","",1);  
		return false;
	  }
	  $("#mask_layer888").remove();
	  $("#scs_alert888").remove();
  }
 //threeScroll.refresh();
 }
}





//退群或解散群
function DelGroupList(IDs,tt,ceng,txt){
scscms_alert(txt,'confirm',function(){

var timestamp = Date.parse(new Date());	
var url = "Sns.Group.del.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){

	cengUrl(ceng,"Sns.Group.Show.asp?ID="+IDs+"&num=last&ceng="+ceng+"&nid="+timestamp,2);

  }
 }
 
});
}



//刷新评论
function refreshSnsMess(IDs,ceng){
var url = "Pinglun.now.asp";
var postStr = "IDs="+IDs+"&ceng="+ceng;

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('refreshSnsMess_tt').style.display="none";
	document.getElementById('refreshSnsMess_txt').innerHTML=v[3];
	document.getElementById('txtlist').innerHTML = v[0];
	cengRefresh(ceng);
	
    if(ceng==1){
      document.formUrl.posti.value = v[1];
	  document.formUrl.postlastID.value = v[2];
	}else if(ceng==2){
	  document.formUrl.posti2.value = v[1];
	  document.formUrl.postlastID2.value = v[2];
    }else if(ceng==3){
      document.formUrl.posti3.value = v[1];
	  document.formUrl.postlastID3.value = v[2];
    }else if(ceng==4){
	  document.formUrl.posti4.value = v[1];
	  document.formUrl.postlastID4.value = v[2];
    }else if(ceng==5){
	  document.formUrl.posti5.value = v[1];
	  document.formUrl.postlastID5.value = v[2];
    }
  }
 }
}



//选择等级权限
function SnsGroupGradeSelect(tm,tmx,tmxs,exps,title,ceng){
document.getElementById(tm).value = exps;
document.getElementById(tmx).value = title;
document.getElementById(tmxs).innerHTML = title;
if(ceng==2){TwoON();}
if(ceng==3){ThreeON();}
if(ceng==4){FourON();}
if(ceng==5){FiveON();}
}



//保存加精属性
function saveSnsShowJing(){
var nid = document.SnsShowJing.nid.value;
var ceng = document.SnsShowJing.ceng.value;
var snsid = document.SnsShowJing.snsid.value;
var jing_num = document.SnsShowJing.jing_num.value;
var jing_time = document.SnsShowJing.jing_time.value;
var jing_amount = document.SnsShowJing.jing_amount.value;
var jing_jinbi = document.SnsShowJing.jing_jinbi.value;

var code = hex_md5("nid="+nid+"&snsid="+snsid+"&jing_amount="+jing_amount+"&jing_jinbi="+jing_jinbi);

if(jing_num==""){
scscms_alert("请填写加精级数","","",1);
return false;
}
if(jing_time==""){
scscms_alert("请选择置顶到期时间","","",1);
return false;
}

var url = "Sns.Show.Jing.ok.asp";
var postStr = "nid="+nid+"&snsid="+snsid+"&jing_num="+jing_num+"&jing_time="+jing_time+"&jing_amount="+jing_amount+"&jing_jinbi="+jing_jinbi+"&code="+code;

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(){
	      if(ceng==2){TwoON();}
	      if(ceng==3){ThreeON();}
	      if(ceng==4){FourON();}
	      if(ceng==5){FiveON();}
		});
      }else{
        scscms_alert(v[1],"","",1);  
		return false;
	  }

  }
 }

}



//搜索群动态
function searchExltkkeys(){
var ceng = document.exltkkeys.ceng.value;
var keys = document.exltkkeys.keys.value;

var url = "Sns.Peo.asp?ceng="+ceng+"&keys="+keys;

cengUrl(ceng,url,2);
}


//搜索待加入的群组
function searchPeoGroupKyes(){
var ceng = document.peogroupkeys.ceng.value;
var tkid = document.peogroupkeys.tkid.value;
var keys = document.peogroupkeys.keys.value;

var url = "Sns.Peo.Addgroup.asp?ceng="+ceng+"&tkid="+tkid+"&keys="+keys;

cengUrl(ceng,url,2);
}


//拉人进群
function peoaddgroup(tkid,ids,ceng){
scscms_alert("确定要加入吗？",'confirm',function(){
	
var url = "Sns.Peo.Addgroup.ok.asp";
var postStr = "tkid="+tkid+"&ids="+ids+"&ceng="+ceng;

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],"","",1); 
		document.getElementById('peoaddgroup_txt_'+ids).style.display = "none";
      }else{
        scscms_alert(v[1],"","",1);  
		return false;
	  }

  }
 }
 
});

}







//选中群组
function piliang_gr_add(id){
var flag = document.getElementById("gr_add_id_"+id).value;

if(flag==0){
	document.getElementById("gr_add_id_"+id).value = id;
	document.getElementById("gr_add_sel_"+id).className = "groudselhover";
}else{
	document.getElementById("gr_add_id_"+id).value = 0;
	document.getElementById("gr_add_sel_"+id).className = "groudsel";
}

}




//群组批量保存
function piliang_gr_ok(){
var gr_add_idrr = document.getElementsByName("gr_add_id");
var gr_add_id = "";

for(i=0;i<gr_add_idrr.length;i++){
    if(gr_add_id!=""){
        gr_add_id = gr_add_id+","+gr_add_idrr[i].value;
    }else{
        gr_add_id = gr_add_idrr[i].value;
    }
}

if(gr_add_id==""){
scscms_alert("请至少选择一个群","","",1);
return false;
}

var url = "Sns.Piliang.ok.asp";
var postStr = "gr_add_id="+gr_add_id;

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

	vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	  if(v[0]=="ok"){

		scscms_alert(v[1],'ok',function(){top.location.href='Index.Sns.asp'});
		
      }else{
        scscms_alert(v[1],"","",1);  
		return false;
	  }

  }
 }

}





//取消录音
function SelescSoundLive(){
wx.stopRecord({
    success: function (res) {
        var localId = res.localId;
		
		document.GradeMess.sec.value = 0;
		$("#mask_layer666").remove();
		$("#scs_alert666").remove();
	
    }
});
}

//停止发语音
function SelstopSoundLive(){
var messnow = document.GradeMess.messnow.value;
var www = document.GradeMess.www.value;
var flag = document.GradeMess.flag.value;
var Gid = document.GradeMess.Gid.value;
var uid = document.GradeMess.uid.value;
var uidpic = encodeURIComponent(document.GradeMess.uidpic.value);
var uidtxt = document.GradeMess.uidtxt.value;
var sec = document.GradeMess.sec.value;

wx.stopRecord({
    success: function (res) {
        var localId = res.localId;
		//alert("停止："+localId);
		$("#mask_layer666").remove();
		$("#scs_alert666").remove();
		
		scscms_alert("发送中","","",99999999);
		
		
		
		
		wx.uploadVoice({
		    localId: localId, // 需要上传的音频的本地ID，由stopRecord接口获得
 		   isShowProgressTips: 1, // 默认为1，显示进度提示
 		       success: function (res) {
 		       var serverId = res.serverId; // 返回音频的服务器端ID
			   
			   var url = "Sns.Group.Show.yuyin.asp";
			   var postStr = "serverId="+ serverId +"&sec="+sec+"&messnow="+ messnow +"&www="+ www +"&Gid="+ Gid +"&uid="+ uid +"&uidpic="+ uidpic +"&uidtxt="+ uidtxt;
      
			   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"){

					   document.GradeMess.sec.value = 0;

			   	   }else{
			   		  scscms_alert(v[1],"","",1); 
		              return false;
			   	   }
				   $("#mask_layer999").remove();
		           $("#scs_alert999").remove();

               }

          }
			   
			   
			   
			   
 		   }
		});

		
		
		
		
		
		
    }
});
}

//下载并播放语音
function SelplaySoundLive(sid,pi,self){
var piserid = document.GradeMess.piserid.value;
var pilocid = document.GradeMess.pilocid.value;
var piser = document.GradeMess.piser.value;

if(piserid != ""){
    wx.stopVoice({
        localId: pilocid // 需要停止的音频的本地ID，由stopRecord接口获得
    });
	document.getElementById("sg_li_"+piserid+"_"+piser).style.background = "url(Images/sns_sound"+self+"_off.png) left center no-repeat";
	document.getElementById("sg_li_"+piserid+"_"+piser).style.backgroundSize = "20px";
	document.getElementById("sg_pl_"+piserid+"_"+piser).value = 0;
    document.GradeMess.piserid.value = "";
	document.GradeMess.pilocid.value = "";
	document.GradeMess.piser.value = 0;
	if(pi==piser){return false}
}
			
wx.downloadVoice({
    serverId: sid, // 需要下载的音频的服务器端ID，由uploadVoice接口获得
    isShowProgressTips: 1, // 默认为1，显示进度提示
    success: function (res) {
        var localId = res.localId; // 返回音频的本地ID
		var pl = document.getElementById("sg_pl_"+sid+"_"+pi).value;
		
		//播放语音接口
		if(pl==0){
		wx.playVoice({
            localId: localId // 需要播放的音频的本地ID，由stopRecord接口获得
        });
		document.getElementById("sg_li_"+sid+"_"+pi).style.background = "url(Images/sns_sound"+self+"_on.png) left center no-repeat";
		document.getElementById("sg_li_"+sid+"_"+pi).style.backgroundSize = "20px";
		document.getElementById("sg_pl_"+sid+"_"+pi).value = 1;
		document.GradeMess.piserid.value = sid;
		document.GradeMess.pilocid.value = localId;
		document.GradeMess.piser.value = pi;
		}else{
		wx.stopVoice({
            localId: localId // 需要停止的音频的本地ID，由stopRecord接口获得
        });
		document.getElementById("sg_li_"+sid+"_"+pi).style.background = "url(Images/sns_sound"+self+"_off.png) left center no-repeat";
		document.getElementById("sg_li_"+sid+"_"+pi).style.backgroundSize = "20px";
		document.getElementById("sg_pl_"+sid+"_"+pi).value = 0;
		document.GradeMess.piserid.value = "";
		document.GradeMess.pilocid.value = "";
		document.GradeMess.piser.value = 0;
		}
		wx.onVoicePlayEnd({
            success: function (res) {
            var localId = res.localId; // 返回音频的本地ID
            document.getElementById("sg_li_"+sid+"_"+pi).style.background = "url(Images/sns_sound"+self+"_off.png) left center no-repeat";
			document.getElementById("sg_li_"+sid+"_"+pi).style.backgroundSize = "20px";
			document.getElementById("sg_pl_"+sid+"_"+pi).value = 0;
		    document.GradeMess.piserid.value = "";
			document.GradeMess.pilocid.value = "";
		    document.GradeMess.piser.value = 0;
			}
        });
    }
});
}








//@谁
function nowmessAdd(vs){
document.GradeMess.snstxt.value += vs;	
}


//搜索群成员
function searchGroupPeokeys(){
var IDs = document.GroupPeokeys.IDs.value;
var ceng = document.GroupPeokeys.ceng.value;
var snsid = document.GroupPeokeys.snsid.value;
var keys = document.GroupPeokeys.keys.value;

var url = "Sns.Group.Peo.asp?IDs="+IDs+"&ceng="+ceng+"&snsid="+snsid+"&keys="+keys;

cengUrl(ceng,url,2);
}








//评论删除
function snsGroupREViewDel(id,ceng){
scscms_alert("删除中，请等待","","",99999999);
var url = "Sns.Group.adminreview.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("sns_group_adminreview_"+id).style.display = "none";
	$("#mask_layer999").remove();
	$("#scs_alert999").remove();

  }
  cengRefresh(ceng);
 }	
}


//评论显示与不显示
function snsGroupREViewFlag(id,ceng){
scscms_alert("提交中，请等待","","",99999999);
var url = "Sns.Group.adminreview.flag.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){
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	document.getElementById("sns_group_adminreview_flag_"+id).innerHTML = v[0];
	document.getElementById("sns_group_adminreview_flagbatton_"+id).innerHTML = v[1];
	$("#mask_layer999").remove();
	$("#scs_alert999").remove();

  }
  cengRefresh(ceng);
 }	
}






/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//实时刷新
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{     

document.SNSMess.snstxt.value="";  
      
ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
    if (ajax.readyState == 4 && ajax.status == 200) {
     vs  = ajax.responseText;
	 if(vs!=""){scscms_alert(vs,"","",1);}
	 document.SNSMess.snstxt.value="";
	 saveNowmessList();
	 
    }
clearTimeout(mGetTime);
}
}
}