var timeoutMinutes = 30;
var timeoutMilliseconds = timeoutMinutes*60000;
var warnMilliseconds = timeoutMinutes*60000-60000;
var timeoutTimer;
var timeOutWin = null;

//window.onerror = function() { return true;};

function setSecurityTimer()
{
	timeoutTimer = window.setTimeout("location.href='http://www.desire2cam.com/logout.aspx?Result=timeout'", timeoutMilliseconds);
}

function CCBLoadPage()
{
	window.setTimeout('displayAlert()', warnMilliseconds);
	setSecurityTimer();
}

function displayAlert()
{
	timeOutWin = window.open("http://www.desire2cam.com/TimeOutPopup_n.aspx","smallwindow",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=no,width=420,height=230');
	timeOutWin.focus();
}

function keepalive()
{
	window.setTimeout('displayAlert()', warnMilliseconds);
	window.clearTimeout(timeoutTimer);
	setSecurityTimer();
}

function closePrinterFriendly()
{
	if(timeOutWin != null && !timeOutWin.closed)
		timeOutWin.close();
}

function popupWin() { //v2.0
 popupWin = window.open('m_msg_popup.asp','newWin','scrollbars=yes,width=400,height=500');
 if (popupWin.focus) {
	    popupWin.focus();
    }
}

function showdetails(p,n){
                var s='';
                var width=550;
                var height=500;
                s=s+'left='+(screen.availWidth-width)/2+',';
                s=s+'top='+(screen.availHeight-height)/2+',';
                s=s+'width='+width+',height='+height+',toolbar=0,location=0,status=0,menubar=1,scrollbars=1,resizable=1';
                w=window.open(p,n,s);
                w.focus();
}

function showdetails2(p,n,w,h){
                var s='';
                var width=w;
                var height=h;
                s=s+'left='+(screen.availWidth-width)/2+',';
                s=s+'top='+(screen.availHeight-height)/2+',';
                s=s+'width='+width+',height='+height+',toolbar=0,location=0,status=0,menubar=1,scrollbars=1,resizable=1';
                w=window.open(p,n,s);
                w.focus();
}

function launch(p,n,w,h,scroll){
                var s='';
                var width=w;
                var height=h;
                s=s+'left='+(screen.availWidth-width)/2+',';
                s=s+'top='+(screen.availHeight-height)/2+',';
                s=s+'width='+width+',height='+height+',toolbar=0,location=0,status=0,menubar=0,scrollbars='+1+',resizable=1';
                w=window.open(p,n,s);
                w.focus();
}

