document.SetTimeOut = 'true';
document.CookiesEnabled;
document.CookiesEnabled = CheckCookiesEnabled();
var iBuyerCount = 0;
window.onunload = Logout;

function CheckCookiesEnabled()
{
	var tmpcookie = new Date();
	chkcookie = (tmpcookie.getTime() + '');
	document.cookie = "chkcookie=" + chkcookie + "; path=/";
	if (document.cookie.indexOf(chkcookie,0) < 0)
    {
		return false;
    }
    else
    {
		return true;
    }
}

function Logout()
{
	try
	{
		if( event.clientY < 0 )
		{
			sendRequest( strBuyerURL + "RemoveProActive.aspx", 1, 1 );
			window.opener.closed;
		}
	}
	catch(e)
	{}
}
	
function pgBuyerTranscriptPull()
{

	if ( (document.SetTimeOut != 'true') || (!document.CookiesEnabled) ) return;
	
	var strReqURL;

	document.PageTitle = document.title;
	if( document.PageTitle == "" )
	{
		document.PageTitle = document.location;
	}

	strReqURL = strBuyerURL + "ProActiveBuyerPull.aspx?LocationID=" + document.LocationID + "&CompanyID=" + document.CompanyID + "&TeamID=" + document.TeamID + "&srcnum=" + iBuyerCount + "&HostAddress=" + document.PageTitle + "&OpenerURL=" + document.location + "&ReVisitor=" + getIsUserReVisitor() + "&sid=" + document.sid;

	try
	{
		if (document.OneTimePull == 'true')
		{
			strReqURL += "&OneTimePull=true";
		}
	}
	catch(e)
	{}

	sendRequest( strReqURL, 1, iBuyerCount);

	try
	{
		if( document.SetTimeOut == 'true' )
		{
			setTimeout("pgBuyerTranscriptPull()", TimeOutTime);
		}
	}
	catch(e){}
	
	iBuyerCount++;
	
}

function showProactiveRequest()
{
	document.SetTimeOut = 'false';
	try
	{
		var w = new WindowClass(document.strMessage);
		w.Show();
	}
	catch(errormsg1)
	{}
}