// Acrobat detector.
//
// For recent versions, set version = 4.
//

var acrobatDetected = -1;

function detectAdobeAcrobat ( version ) 
{
	if ( acrobatDetected != -1 )
	{
		return acrobatDetected;
	}

	var pluginFound = false;

	var plugin = detectPlugin ( 'PDFViewer', 'Acrobat' );

	// Check version of Adobe Acrobat.
	//

	if ( plugin != null && parseFloat ( plugin.description.substring ( 30 ) ) >= version )
	{
		pluginFound = true;
	}
	else
	{
		if ( version >= 4 )
		{
			pluginFound = detectActiveXControl ( 'PDF.PdfCtrl.5', 0 );
		}
		else
		{
			pluginFound = detectActiveXControl ( 'PDF.PdfCtrl.1', 0 );
		}
	}

	acrobatDetected = pluginFound;

	return pluginFound;
}
