// JavaScript Document
window.onload=onloadPage;
function showDiv(){
document.getElementById('popDiv').style.display='block';
document.getElementById('bg').style.display='block';
}

function closeDiv(){
document.getElementById('popDiv').style.display='none';
document.getElementById('bg').style.display='none';
}

function setOk()
{
	closeDiv();
	//关闭的同时判断一下是不是上班时间
	var now;
	now = new Date(); //获取系统日期，即Sat Jul 29 08:24:48 UTC+0800 2006 
	var hourMin = now.getHours();//得到当前小时  要得到分钟是now.getMinutes()
	if((hourMin>=13&&hourMin<17)||(hourMin>=8&&hourMin<12)) //8上班12下班   13上班17下班
	{
		window.open("http://sighttp.qq.com/authd?IDKEY=bd539a90872ecfc75634732cd89a4e1f31150582d0b62dce"); 
	
	}
	if(hourMin>=17||(hourMin>=12&&hourMin<13)||hourMin<8)//下班时间
	{
		window.open("http://sighttp.qq.com/authd?IDKEY=bd539a90872ecfc75634732cd89a4e1f31150582d0b62dce"); 
	}
}

function onloadPage()
{
 setTimeout("showDiv()",15000);//延时时间 以毫秒为单位，功能要求网页打开N秒钟之后，弹出邀请框。用邀请框中的按钮去判断时间选择客服链接。
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


var intervalId = null;    
function slideAd(id,nStayTime,sState,nMaxHth,nMinHth)
{    
this.stayTime=nStayTime*1000 || 3000;    
this.maxHeigth=nMaxHth || 226;    
this.minHeigth=nMinHth || 2.5;    
this.state=sState || "down" ;    
var obj = document.getElementById(id);    
if(intervalId != null)window.clearInterval(intervalId);    
function openBox()
{    
   var h = obj.offsetHeight;
   obj.style.height = ((this.state == "down") ? (h + 2) : (h - 2))+"px";    
   if(obj.offsetHeight>this.maxHeigth)
   {    
    window.clearInterval(intervalId);    
    intervalId=window.setInterval(closeBox,this.stayTime);    
   }    
   if (obj.offsetHeight<this.minHeigth)
   {
    window.clearInterval(intervalId);
    obj.style.display="none";
   }
}    
function closeBox()
{    
   slideAd(id,this.stayTime,"up",nMaxHth,nMinHth);    
}    
intervalId = window.setInterval(openBox,30);    
}
