/*  
 this script is used to detect if client has enabled Adobe Acrobat plugin for it's browser 
  support version of Acrobat: 3, 4, 5  
*/


   var isKnownAcrobatInstalled = false
   var detectedAcrobatVersion = 0 //if this variable stay in zero after acrobat detection - so I was unable to detect it's version
                                  //if this variable becames = -1 then no acrobat detection were done

function detectAcrobat()
{
 window.status="Detecting Adobe Acrobat Plugin ..."
 if( //if win32 AND IE show VBS code to detect
   (navigator.userAgent.indexOf('MSIE') != -1) && 
   (navigator.userAgent.indexOf('Win') != -1)) 
 {
  detectAcrobatIenWin32()
 }
 else // Mac OS, Win32/NN6
  detectAcrobatSilence() 
 window.status=""
} 

function detectAcrobatSilence()
{
 if( //if win32 AND IE show VBS code to detect
    (navigator.userAgent.indexOf('MSIE') != -1) && 
    (navigator.userAgent.indexOf('Win')  != -1)
   ) 
 {
  detectedAcrobatVersion=-1
  return
 }
  window.status="Detection Adobe Acrobat plugin ..."  
  
  var arPl = window.navigator.plugins
  for(i=0; i<arPl.length; i++)
   if( arPl[i].name.search("Acrobat")!=-1 ||
       arPl[i].name.search("PDF")!=-1
     ) 
    {
     isKnownAcrobatInstalled = true
     
     var descr=arPl[i].description
     if(descr.search(" 4.")!=-1 || descr.search("v4.")!=-1) detectedAcrobatVersion=4
     else if(descr.search(" 5.")!=-1 || descr.search("v5.")!=-1) detectedAcrobatVersion=5
     else detectedAcrobatVersion = 0

     break
    }
   else detectedAcrobatVersion = 0
  window.status=""
}

//this function is used only under Internet Explorer running on Win32
function detectAcrobatIenWin32() 
{
	if((isKnownAcrobatInstalled=getSupp("PDF.PdfCtrl.5")))     detectedAcrobatVersion=5;
	else if((isKnownAcrobatInstalled=getSupp("PDF.PdfCtrl.1")))detectedAcrobatVersion=4;
}







