<!--// Intercept - executed on page load
//***************************************************

var pctOfferedSurvey = 0.3333;
var popupLocation = "http://surveys.epoll.com/ask/?sid=3489";
var popupFeatures = "width=600,height=400,screenX=175,screenY=75,top=75,left=175,resizable,scrollbars";
var cookieSurveyDisplayed = "epoll_survey3489";
var startDate = new Date(2004, 10, 05); // Month is zero based
var endDate = new Date(2004, 10, 11);
var expDate = new Date(2004, 11, 11);

function errortrap(msg,url,line)
{
	GenRandomIntercept();
}

onerror = errortrap;

function GenRandomIntercept()
{	
	var today = new Date();
	var cn = Math.random();
	var storedValue = GetCookie(cookieSurveyDisplayed);
	if ((storedValue == null) && (cn <= pctOfferedSurvey) &&
	    (today >= startDate) && (today <= endDate))
	{
		SetCookie(cookieSurveyDisplayed, 'alreadyOffered', expDate, '/');
		window.open(popupLocation,'intercept',popupFeatures);
	}	
}

function GetCookie (name)
{
	var mycookie = document.cookie;
	var start = mycookie.indexOf(name, 0);
	if(start >= 0)
	{
		var end = mycookie.indexOf(';', start);
		if(end < 0)
		{
			end = mycookie.length;
		}
		return mycookie.substring(start, end);
	}
	else
	{
		return null;
	}
}

function SetCookie (name,value,expires,path,domain,secure)
{
        document.cookie = name + "=" + escape (value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

GenRandomIntercept();


