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


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


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

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

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



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

light.style.display='block';

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

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

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

	}
}



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

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




/**
 * 二维码关注
 */
function erweima(){
document.LogintheForm.a_s.value = 0;
setTimeout(function(){
var lightCount = Obj_ById("erweima_IMG");
var a_s = document.LogintheForm.a_s.value;
var www = document.LogintheForm.www.value;
var num = document.LogintheForm.num.value;
var tt = document.LogintheForm.tt.value;
var txt = document.LogintheForm.txt.value;
var uptkid = document.LogintheForm.uptkid.value;

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

ajax.open("POST", url, true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
    if (ajax.readyState == 4 && ajax.status == 200) {	
	
	vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	alert(vs);
	if(v[1]!=""){
		lightCount.innerHTML = "<img src='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="+v[1]+"' width='100' height='100' />";
	}
      	
      
	}
}
},3000);
}

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

light.style.display='block';

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

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

//clearTimeout(LoginDivTime);	
document.LogintheForm.a_s.value = 0;
	  
//LoginDivTime = setInterval(function(){

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

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

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

	}
}

//},3000);





}


//查询
function topSearch(){
var pid = document.toplistSearch.pid.value;
var keys = document.toplistSearch.keys.value;

var url = "/Index.asp";

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

}

//分类切换
function addlist(PID,co,ba){
var el = document.getElementById('daohang_list');
var li = document.getElementById('daohang_menu_li_'+PID);

var postStr = "PID="+PID;
ajax.open("POST", "/I/List.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
	
	if(v[0]==""){
		scscms_alert("暂无内容","","",1);
	}else{
		
	var pid_old = document.nlist.pid.value;
	if(pid_old>0){
	var li_old = document.getElementById('daohang_menu_li_'+pid_old);
	li_old.style.color = "#444";
	li_old.style.backgroundColor = "#fff";
	}
	window.scrollTo(0,0);
						  					
    el.innerHTML = v[0];
	li.style.color = co;
	li.style.backgroundColor = ba;
    document.nlist.lastid.value = v[1];
	document.nlist.lastnum.value = v[2];
	document.nlist.pid.value = PID;
	
	}

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

//加载更多分类信息
function morelist(){
var el = document.getElementById('daohang_list');
var li = document.createElement('li');
var lastid = document.nlist.lastid.value;
var lastnum = document.nlist.lastnum.value;
var pid = document.nlist.pid.value;
var keys = document.nlist.keys.value;

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

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


//加载更多右侧信息
function rightlist(IDs,PID){
var e4 = document.getElementById('right_list_4');
var e1 = document.getElementById('right_list_1');
var e2 = document.getElementById('right_list_2');
var e3 = document.getElementById('right_list_3');
var e5 = document.getElementById('right_list_5');

var postStr = "IDs="+IDs+"&PID="+PID;
ajax.open("POST", "/I/Right.More.asp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(postStr);
ajax.onreadystatechange = function() {
  if (ajax.readyState == 4 && ajax.status == 200) {
					
    vs  = ajax.responseText;
    v = new Array;
    v = vs.split("$$$");
						  					
    e1.innerHTML = v[1];
	e2.innerHTML = v[2];
	e3.innerHTML = v[3];
	e4.innerHTML = v[0];
	e5.innerHTML = v[4];


  }
 }	
}




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

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

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


//播放视频
//获取腾讯视频
function TenV_openvideo(vid,modId){
var wh = 600;

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

}
