

//顶部搜索

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 leftmenuover(){

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

 if(document.getElementById("leftnone")){yhifdis(1);}

}



function leftmenuout(){

 if(!document.getElementById("leftnone")){document.getElementById("leftmenu").style.display="none";}else{yhifdis(0);}

}



function yhmenuover(x){

document.getElementById("yhmenu"+x).className="menu1 menu2";	

document.getElementById("rmenu"+x).style.display="";	

}



function yhmenuout(x){

document.getElementById("yhmenu"+x).className="menu1";	

document.getElementById("rmenu"+x).style.display="none";	

}



//等待

function tjwait(){

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

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

}



//弹窗

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

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

}else{

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

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

document.getElementById("openw").style.top=window.document.body.offsetHeight/2-170+st;

}

}



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,'');

   if(response=="0"){document.getElementById("notlogin").style.display="";document.getElementById("yeslogin").style.display="none";return false;}

   else{

   r=response.split(" ");

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

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

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

   if(r[1]=="yes"){document.getElementById("dontqd").style.display="";document.getElementById("needqd").style.display="none";}

   else{document.getElementById("dontqd").style.display="none";document.getElementById("needqd").style.display="";}

   return false;

   }

  }

}



//头部下拉导航

function lover(x){

document.getElementById("topu1l"+x).className="l"+x+" l"+x+"h";document.getElementById("umenu"+x).style.display="";

}

function lout(x){

document.getElementById("topu1l"+x).className="l"+x;document.getElementById("umenu"+x).style.display="none";

}





//拉伸广告开始

function slideUp(){

if($("toplsad").offsetHeight>0){

if($("toplsad").offsetHeight>10){

$("toplsad").style.height=$("toplsad").offsetHeight-10+"px"

setTimeout("slideUp();",30);

}else{

$("toplsad").style.display="none";

$("toplsimg").src=$("toplsimg").innerHTML;

$("toplsad").style.display="block";

slideDown();

}

}

}

function slideDown(){

if($("toplsad").offsetHeight<80){

if($("toplsad").offsetHeight<70){

$("toplsad").style.height=$("toplsad").offsetHeight+10+"px";

setTimeout("slideDown();",30);

}else{

$("toplsad").style.height="80px";

}

}

}

//拉伸广告结束









//团购倒计时开始

var responsesj;

var time_server_client,timerID,xs,time_end1,time_end2,time_end3,time_end4,timerID1,timerID2,timerID3,timerID4;



function show_time(djsid)

{

 var time_now,time_distance,str_time;

 var int_day,int_hour,int_minute,int_second;

 var time_now=new Date();

 time_now=time_now.getTime()+time_server_client;

 if(djsid==1){time_end=time_end1;timerID=timerID1;}

 else if(djsid==2){time_end=time_end2;timerID=timerID2;}

 else if(djsid==3){time_end=time_end3;timerID=timerID3;}

 else if(djsid==4){time_end=time_end4;timerID=timerID4;}

 

 time_distance=time_end-time_now;

 if(time_distance>0)

 {

  int_day=parseInt(Math.floor(time_distance/86400000))

  time_distance-=int_day*86400000;

  int_hour=parseInt(Math.floor(time_distance/3600000))

  time_distance-=int_hour*3600000;

  int_minute=parseInt(Math.floor(time_distance/60000))

  time_distance-=int_minute*60000;

  int_second=parseInt(Math.floor(time_distance/1000))

  mm = Math.floor((time_distance % 1000)/100);

   tv=int_day+"<span class='s1'>天</span>";

   tv=tv+int_hour+"<span class='s1'>时</span>";

   tv=tv+int_minute+"<span class='s1'>分</span>";

   tv=tv+int_second+"." + mm+"<span class='s1'>秒</span>";

   document.getElementById("djs"+djsid).innerHTML=tv;

   setTimeout("show_time("+djsid+")",100);

  }

  else

 {

  tv="<span class='feng'>已结束</span>";

  document.getElementById("djs"+djsid).innerHTML=tv;

  document.getElementById("s"+djsid+"sj1").innerHTML=0;

  document.getElementById("s"+djsid+"sj2").innerHTML=0;

  document.getElementById("s"+djsid+"sj3").innerHTML=0;

  clearTimeout(timerID)

 }

}



var xmlHttpsj = false;

try {

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

} catch (e) {

  try {

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

  } catch (e2) {

    xmlHttpsj = false;

  }

}

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

  xmlHttpsj = new XMLHttpRequest();

}





function updatePagesj() {

  if (xmlHttpsj.readyState == 4) {

   responsesj = xmlHttpsj.responseText;

   if($("dqsj1")){dsj1=document.getElementById("dqsj1").innerHTML;time_end1=new Date(dsj1);time_end1=time_end1.getTime();}//结束的时间

   if($("dqsj2")){dsj2=document.getElementById("dqsj2").innerHTML;time_end2=new Date(dsj2);time_end2=time_end2.getTime();}//结束的时间

   if($("dqsj3")){dsj3=document.getElementById("dqsj3").innerHTML;time_end3=new Date(dsj3);time_end3=time_end3.getTime();}//结束的时间

   if($("dqsj4")){dsj4=document.getElementById("dqsj4").innerHTML;time_end4=new Date(dsj4);time_end4=time_end4.getTime();}//结束的时间



time_now_server=new Date(responsesj);time_now_server=time_now_server.getTime();

time_now_client=new Date();time_now_client=time_now_client.getTime();

time_server_client=time_now_server-time_now_client;



   if($("dqsj1")){timerID1=setTimeout("show_time(1)",100);}

   if($("dqsj2")){timerID2=setTimeout("show_time(2)",100);}

   if($("dqsj3")){timerID3=setTimeout("show_time(3)",100);}

   if($("dqsj4")){timerID4=setTimeout("show_time(4)",100);}

  }

}



function userChecksj(){

	if($("dqsj1")){

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

    xmlHttpsj.open("post", url, true);

    xmlHttpsj.onreadystatechange = updatePagesj;

    xmlHttpsj.send(null);

	}

	}

//团购倒计时结束