//
var __to_FLogout="_admin/plogout.asp?forced=1"
var __to_FAbort="_timeoutabortx.asp"
var __to_FLoggedOut="_loggedoutx.asp"
var __to_FTimeout=""
var __to_FN
var __to_SessionTime
var __to_CountDown=5*60
var __to_Tmr	
var __to_Path
var __to_Start

function _TO_Go(pPath,pFile,pTime){
	__to_Path=pPath
	__to_FTimeout=pFile
	__to_SessionTime=(pTime*60-__to_CountDown-60)*1000
	_TO_Fire()
}

function _TO_Fire(){
	_TO_Kill()
	__to_Tmr = setTimeout("_TO_Call('"+__to_FTimeout+"','_TO_Start()')",__to_SessionTime)
}	
function _TO_Kill(){
	_TO_Clear()
	var o=document.getElementById("popbox")
	if(o){
		o.style.display="none"
		o.firstChild.innerHTML=""
	}	
}	
function _TO_Tick(){
	var now=new Date()
	var t=__to_CountDown-parseInt((now.getTime()-__to_Start)/1000)
	if(t<0){
		location.replace(__to_Path+__to_FLogout)
	}else{	
		var m=Math.floor(t/60)
		var s=t%60
		if(s<=9)
			s="0"+s
		//if(t<30){
		//	obj.style.color="#FFFFFF"
		//	obj.style.backgroundColor="#FF6666"
		//}else if(t<=60)
		//	obj.style.backgroundColor="#FFFF66"
		var obj=document.getElementById("box")
		obj.value=m+"m "+s+"s"
	}	
}
function _TO_Aborted(){
	_TO_Fire()
}
function _TO_Call(pFile,pFN){
	_oAX=_Ajax()
	if(_oAX){
		_oAX.open("GET",__to_Path+pFile,true)
		_oAX.send(null)
		__to_FN=pFN
		__to_Tmr=setInterval('_TO_Poll()',100)
	}	
	return false
}
function _TO_Poll(){
	var o=document.getElementById("popbox")
	if(o)if(o.style.display!="none"){_TO_Clear();_moveTimeOut();if(__to_FN)eval(__to_FN)}
}	
function _TO_Clear(){
	clearTimeout(__to_Tmr)
}
function _TO_Start(){
	__to_Tmr=setInterval('_TO_Tick()',500)
	__to_Start=new Date().getTime()
}
function _TO_Cancel(){
	_TO_Clear()
	_TO_Call(__to_FAbort,"__to_Tmr=setTimeout('_TO_Aborted()',5000)")
}
function _TO_Check4Abort(){
	_TO_Clear()
	if(/forced=1/i.test(location.search)){
		_TO_Call(__to_FLoggedOut,"")
	}
}		
		
