/* * Rafael Cansigno Mayo 2004.
 * Copyright (c) 2004 SciNET Systems.
*/


//Este Script detecta los siguientes programas:
//Flash
//Windows Media Player
//Java
//Shockwave
//RealPlayer
//QuickTime
//Acrobat Reader
//SVG Viewer

Flash=0
WMP=0
Java=0
Shockwave=0
RealPlayer=0
QuickTime=0
AcrobatReader=0
SVG_Viewer=0


var agt=navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

if (ie && win) {
   pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader"); 
   }
if (ns || !win) {
   nse = "";
   for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
     pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
   }

function detectIE(ClassID,name) {
  result = false; 
  document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); 
  if (result) 
    return name+','; 
  else 
    return ''; }

function detectNS(ClassID,name) {
  n = "";
  if (nse.indexOf(ClassID) != -1)
    if (navigator.mimeTypes[ClassID].enabledPlugin != null) 
      n = name+",";
  return n; 
  }

pluginlist += navigator.javaEnabled() ? "Java," : "";
  if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);

//USO- deteccion

function Status_Flash() {
   if (pluginlist.indexOf("Flash")!=-1)
     { document.write("Tu navegador tiene el visor flash instalado");
       Flash=1
     }
   else
    { document.write("Tu navegador NO tiene el visor flash instalado, NO PODRAS VER CONTENIDO FLASH");
      document.write("<BR>Esta pagina tiene contenido Flash, por lo que no puedes verla correctamente");
	}
   }

function Status_Java() {
   if (pluginlist.indexOf("Java")!=-1)
    { document.write("Tu navegador tiene Java instalado");
      Java=1
    }
   else
     document.write("Tu navegador NO tiene Java instalado, TU NOVEGADOR NO PODRA VER CORRECTAMENTE ESTA PAGINA POR FAVOR ACTIVA EL SOPORTE JAVA EN TU EQUIPO");   }

function Status_WMP() {
   if (pluginlist.indexOf("Windows Media Player")!=-1)
   {  document.write("Tu navegador tiene Windows Media Player instalado");
      WMP=1
   }
   else
     document.write("Tu navegador NO tiene Windows Media Player instalado");
   }


function Status_RealPlayer() {
   if (pluginlist.indexOf("Real Player")!=-1)
   {  document.write("Tu navegador tiene Real Player instalado");
      RealPlayer=1  
   }
   else
     document.write("Tu navegador NO tiene Real Player instalado");
   }

function Status_QuickTime() {
   if (pluginlist.indexOf("Quick Time")!=-1)
   {  document.write("Tu navegador tiene Quick Time instalado");
      QuickTime=1
   }
   else
     document.write("Tu navegador NO tiene Quick Time instalado");
   }

function Status_AcrobatReader() {
   if (pluginlist.indexOf("Acrobat Reader")!=-1)
   {  document.write("Tu navegador tiene Acrobat Reader instalado");
      AcrobatReader=1
   }
   else
     document.write("Tu navegador NO tiene Acrobat Reader instalado, no podras ver contenido PDF");
   }

function Status_ShockWave() {
   if (pluginlist.indexOf("Shock Wave")!=-1)
   {  document.write("Tu navegador tiene Shock Wave instalado");
   SVGViewer=1
   }
   else
     document.write("Tu navegador NO tiene Shock Wave instalado");
   }

function Status_SVG_viewer() {
   if (pluginlist.indexOf("SVG Viewer")!=-1)
   {  document.write("Tu navegador tiene SVG Viewer instalado");
      SVG_Viewer=1
   }
   else
     document.write("Tu navegador NO tiene SVG Viewer instalado");
   }

function Flash_download(){
  if (Flash==1)
    document.write("Visor Flash ya esta instalado");
  else
    document.write("Descargar visor Flash");
}

function Java_download(){
  if (Java==1)
    document.write("JavaScript ya esta instalado");
  else
    document.write("Descargar Java");
}

function AcrobatReader_download(){
  if (AcrobatReader==1)
    document.write("Acrobat reader ya esta instalado");
  else
    document.write("Descargar Acrobat Reader");
}

function WMP_download(){
  if (WMP==1)
    document.write("Windows Media Player ya esta instalado");
  else
    document.write("Descargar Windows Media Player");
}

function ShockWave_download(){
  if (Shockwave==1)
    document.write("Shock Wave ya esta instalado");
  else
    document.write("Descargar Shock Wave");
}

function RealPlayer_download(){
  if (RealPlayer==1)
    document.write("RealPlayer ya esta instalado");
  else
    document.write("Descargar RealPlayer");
}

function QuickTime_download(){
  if (QuickTime==1)
    document.write("Quick Time ya esta instalado");
  else
    { document.writeln('<href="http://download.quicktime.com"> Descargar Quick Time');

//<a href="http://download.quicktime.com" onMouseover="window.status='descargar';return true" onMouseout="window.status=''" >Open window</a>

    }

}


function SVG_download(){
  if (SVG_Viewer==1)
    document.write("SVG Viewer ya esta instalado");
  else
    document.write("Descargar SVG Viewer");
}