var surveyAustria = "";

function Intercept(Identifier, cond1, cond2, cond3, cond4, cond5, maxConds, CookieName, CookieExpiration, FunctionName)
	{
		this.Identifier = Identifier;
		this.cond1 = cond1;
		this.cond2 = cond2;
		this.cond3 = cond3;
		this.cond4 = cond4;
		this.cond5 = cond5;
		this.maxConds = maxConds;
		this.CookieName = CookieName;
		this.CookieExpiration = CookieExpiration;
		this.FunctionName = FunctionName;
	}


function DoIntercept( interceptIndex ) {

	var ok = false;
	var ckName	= Intercepts[interceptIndex].CookieName;

	if (ckName == null)	ok = true;
	if ( ckName != null && (getCookie(ckName) == null || getCookie(ckName) == false) ) {
		ok = true;
		var ckExp	= Intercepts[interceptIndex].CookieExpiration;
		var exp		= new Date();
		var exp2	= exp.getTime() + (ckExp * 1000 * 60 * 60);
		exp.setTime(exp2);
		setCookie ( ckName, 'ok', exp, '/', '.docguide.com', null);
	}
	

	if (ok) {
		eval(Intercepts[interceptIndex].FunctionName);

		var exp = new Date();
		var exp2 = exp.getTime() + (15 * 60 * 1000);
		exp.setTime(exp2);

		if (getCookie("inter_seen") != "y") {
			setCookie ( 'inter_seen', 'y', exp, '/', '.docguide.com', null);
			
			// Log that a popup just showed
			Image1 = new Image(1,1);
			Image1.src = "http://ww3.docguide.com/pe/LogServlet?App=InterstitialLogHandler&name=" + Intercepts[interceptIndex].Identifier +"&u=http://ww3.peerviewpress.com/opn.gif";		
		}
	}
}



function ProcessIntercepts() {
	if (getCookie("inter_seen") == "y" && getCookie("inter_seen2") == "y") {
		return false;
	} else {

		if (getCookie("inter_seen") != "y" ) {
			for( x = 0 ; x < Intercepts.length ; x ++ ) {
				if (InterstitialSeen == 0) {
					var maxConditions = Intercepts[x].maxConds;
					eval ( "ShowIntercept" + maxConditions + "(" + x + ")")
				} else {
					return false;		
				}			
			}
		} else {
			if (getCookie("inter_seen2") == null && (intConfigDoc=="f53e28b896da600085256cdf005d2aea" || intConfigDoc=="88647749bb7e68c085256deb005a706d")) {

				var exp = new Date();
				var exp2 = exp.getTime() + (15 * 60 * 1000);
				exp.setTime(exp2);
				setCookie ( 'inter_seen2', 'y', exp, '/', '.docguide.com', null);
				if (intConfigDoc=="f53e28b896da600085256cdf005d2aea") {
					eval(Intercepts[7].FunctionName);
				} else {
					eval(Intercepts[1].FunctionName);
				}

			}
		}
		return false;
	}
}

function ShowIntercept0(interceptIndex) {
	return DoIntercept(interceptIndex);	
}
function ShowIntercept1(interceptIndex) {

	if (eval(Intercepts[interceptIndex].cond1)) {
		return DoIntercept(interceptIndex);	
	} else {		
		return false;
	} 
}
function ShowIntercept2(interceptIndex) {

	if (eval(Intercepts[interceptIndex].cond1)) {
	if (eval(Intercepts[interceptIndex].cond2)) {
		return DoIntercept(interceptIndex);			
	}} 
	return false;  
}
function ShowIntercept3(interceptIndex) {

	if (eval(Intercepts[interceptIndex].cond1)) {	
	if (eval(Intercepts[interceptIndex].cond2)) {	
	if (eval(Intercepts[interceptIndex].cond3)) {
		return DoIntercept(interceptIndex);			
	}}}
	return false;  
}
function ShowIntercept4(interceptIndex) {
	if (eval(Intercepts[interceptIndex].cond1)) {	
	if (eval(Intercepts[interceptIndex].cond2)) {	
	if (eval(Intercepts[interceptIndex].cond3)) {
	if (eval(Intercepts[interceptIndex].cond4)) {
		return DoIntercept(interceptIndex);			
	}}}}
	return false;  
}
function ShowIntercept5(interceptIndex) {
	if (eval(Intercepts[interceptIndex].cond1)) {	
	if (eval(Intercepts[interceptIndex].cond2)) {	
	if (eval(Intercepts[interceptIndex].cond3)) {
	if (eval(Intercepts[interceptIndex].cond4)) {
	if (eval(Intercepts[interceptIndex].cond5)) {
		return DoIntercept(interceptIndex);			
	}}}}}
	return false;  
}

function setCookie ( name, value, expires, path, domain, secure ) {
    	document.cookie = name + "=" + escape(value) + 
     ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
    	((path == null) ? "" : "; path=" + path) +
     ((domain == null) ? "" : "; domain=" + domain) +
    	((secure == null) ? "" : "; secure");
}

