//等待

function tjwait(){

document.getElementById("tjbtn").style.display="none";

document.getElementById("tjing").style.display="";	

}



//跳转

function gourl(x){

location.href=x;

}



//顶部搜索

var nsi=1;

function topover(){

document.getElementById("topdiv").style.display="";

}

function topout(){

document.getElementById("topdiv").style.display="none";

}

function topjconc(x,y){

nsi=x;

document.getElementById("topnwd").innerHTML=y;

topout();

}

function topftj(){

if((document.topf1.topt.value).replace("/\s/","")==""){alert("请输入搜索关键词");document.topf1.topt.focus();return false;}

topf1.action="../search/index.php?admin="+nsi;

}

function tserdivout(){

document.getElementById("tserdiv").style.display="none";

}

var xmlHttpts = false;

try {

  xmlHttpts = new ActiveXObject("Msxml2.XMLHTTP");

} catch (e) {

  try {

    xmlHttpts = new ActiveXObject("Microsoft.XMLHTTP");

  } catch (e2) {

    xmlHttpts = false;

  }

}

if (!xmlHttpts && typeof XMLHttpRequest != 'undefined') {

  xmlHttpts = new XMLHttpRequest();

}

function tserdivC(){

 xmlHttpts.open("get", document.getElementById("webhttp").innerHTML+"tem/tser.php?admin="+nsi+"&wd="+document.topf1.topt.value,true);

 xmlHttpts.onreadystatechange = updatePagets;

 xmlHttpts.send(null);

}

function updatePagets() {

  if (xmlHttpts.readyState == 4) {

   response = xmlHttpts.responseText;

   document.getElementById("tserdiv").innerHTML=response;

   document.getElementById("tserdiv").style.display="";

  }

}



//购物车

var xmlHttptgw = false;

try {

  xmlHttptgw = new ActiveXObject("Msxml2.XMLHTTP");

} catch (e) {

  try {

    xmlHttptgw = new ActiveXObject("Microsoft.XMLHTTP");

  } catch (e2) {

    xmlHttptgw = false;

  }

}

if (!xmlHttptgw && typeof XMLHttpRequest != 'undefined') {

  xmlHttptgw = new XMLHttpRequest();

}

function topcarover(){

 url =document.getElementById("webhttp").innerHTML+"tem/topcar.php";

 xmlHttptgw.open("get", url, true);

 xmlHttptgw.onreadystatechange = updatePagetgw;

 xmlHttptgw.send(null);

}

function updatePagetgw() {

  if (xmlHttptgw.readyState == 4) {

   response = xmlHttptgw.responseText;

   response=response.replace(/[\r\n]/g,'');

   a=response.split("xcfCAR");

   document.getElementById("gouwuc").innerHTML=a[0];

   document.getElementById("topcarNum").innerHTML=a[1];

  }

}



//弹窗

function tangc(x){

if(1==x){document.getElementById("bghui").style.display="";document.getElementById("openw").style.display="";}

else if(0==x){document.getElementById("bghui").style.display="none";document.getElementById("openw").style.display="none";}

document.getElementById("bghui").style.width="100%";

st=Math.max(document.documentElement.scrollTop,document.body.scrollTop);

if(!+[1,]){

document.getElementById("bghui").style.height=document.body.clientHeight;

document.getElementById("openw").style.left=document.body.clientWidth/2-362;

document.getElementById("openw").style.top=200;

}else{

document.getElementById("bghui").style.height=document.documentElement.clientHeight;

document.getElementById("openw").style.left=document.documentElement.clientWidth/2-362;

document.getElementById("openw").style.top=200;

}

}



function objdis(x,y){

 if(0==x){document.getElementById(y).style.display="none";}	

 else if(1==x){document.getElementById(y).style.display="";}	

}



//登录验证

var xmlHttpses = false;

try {

  xmlHttpses = new ActiveXObject("Msxml2.XMLHTTP");

} catch (e) {

  try {

    xmlHttpses = new ActiveXObject("Microsoft.XMLHTTP");

  } catch (e2) {

    xmlHttpses = false;

  }

}

if (!xmlHttpses && typeof XMLHttpRequest != 'undefined') {

  xmlHttpses = new XMLHttpRequest();

}

function userCheckses(){

    url =document.getElementById("webhttp").innerHTML+"tem/sesCheck.php";

    xmlHttpses.open("get", url, true);

    xmlHttpses.onreadystatechange = updatePageses;

    xmlHttpses.send(null);

	}

function updatePageses() {

  if (xmlHttpses.readyState == 4) {

   response = xmlHttpses.responseText;

   response=response.replace(/[\r\n]/g,'');

   jg=response.split("xcf");

   if(document.getElementById("topcarNum")){document.getElementById("topcarNum").innerHTML=jg[1];}

   if(jg[0]=="0"){

   document.getElementById("notlogin").style.display="";document.getElementById("yeslogin").style.display="none";return false;

   }else{

   document.getElementById("yeslogin").style.display="";

   document.getElementById("notlogin").style.display="none";

   document.getElementById("yesuid").innerHTML=jg[0];

   return false;

   }

  }

}



//回到顶部

function gotoTop(acceleration,stime){acceleration=acceleration||0.1;stime=stime||10;var x1=0;var y1=0;var x2=0;var y2=0;var x3=0;var y3=0;if(document.documentElement){x1=document.documentElement.scrollLeft||0;y1=document.documentElement.scrollTop||0;}

if(document.body){x2=document.body.scrollLeft||0;y2=document.body.scrollTop||0;}

var x3=window.scrollX||0;var y3=window.scrollY||0;var x=Math.max(x1,Math.max(x2,x3));var y=Math.max(y1,Math.max(y2,y3));var speeding=1+ acceleration;window.scrollTo(Math.floor(x/speeding),Math.floor(y/speeding));if(x>0||y>0){var run="gotoTop("+ acceleration+", "+ stime+")";window.setTimeout(run,stime);}}

