// Acrobat Reader Detection / Redirect (cookie variant)


var dontKnowAcrobatVersion = false;
var acrobatVersion = 0;

// Retrieve acrobat cookie
var cookieStart = document.cookie.indexOf('acrobat');
if (cookieStart != -1) {
	var cookieEnd = document.cookie.indexOf(';', cookieStart);
	if (cookieEnd == -1) cookieEnd = document.cookie.length;
	acrobatVersion = document.cookie.substring(cookieStart + 8, cookieEnd); 
}

// If the cookie doesn't exist...
else {
	
	// use acrobat_detect.js to return the Acrobat version
	acrobatVersion = getAcrobatVersion();
	
	// write the version information to a cookie
	document.cookie = 'acrobat=' + acrobatVersion;
}

// For the situation where we can't detect, set the values of the reference variables
if (acrobatVersion == acrobatVersion_DONTKNOW) {
	acrobatVersion = 0;
	dontKnowAcrobatVersion = true;
}
