//Detect ActiveX Architecture on Both IE and on Gecko
//Defer to plugin architecture for other browsers

function detectWMP()
{
	var wmpInfo = {
		installed: false,
		scriptable: false,
		type: null,
		versionInfo: null
	};
	var wmp64 = "MediaPlayer.MediaPlayer.1";
	var wmp7 = "WMPlayer.OCX.7";
	if((window.ActiveXObject && navigator.userAgent.indexOf('Windows') != -1) || window.GeckoActiveXObject)
	{
		wmpInfo.type = "ActiveX";
		var player = createActiveXObject(wmp7);
		if(player)
		{
			wmpInfo.installed = true;
			wmpInfo.scriptable = true;
			wmpInfo.versionInfo = player.versionInfo;
			return wmpInfo;
		}
		else
		{
			player = createActiveXObject(wmp64);
			if(player)
			{
				wmpInfo.installed = true;
				wmpInfo.scriptable = true;
				wmpInfo.versionInfo = "6.4";
				return wmpInfo;
			}
			else
			{
				wmpInfo.versionInfo = "none";
				return wmpInfo;
			}
		}
	}
	else if(navigator.mimeTypes)
	{
		wmpInfo.type = "NetscapePlugin";
		var player = navigator.mimeTypes['application/x-mplayer2'].enabledPlugin;
		if(player)
		{	
			
			wmpInfo.installed = true;
			//wmpInfo.scriptable = false;
			wmpInfo.versionInfo = "PluginVersion";
			return wmpInfo;
		}
		return wmpInfo;
	}
	
	
}
function createActiveXObject(id)
{
  var error;
  var control = null;

  try
  {
    if (window.ActiveXObject)
    {
      control = new ActiveXObject(id);
    }
    else if (window.GeckoActiveXObject)
    {
      control = new GeckoActiveXObject(id);
    }
  }
  catch (error)
  {
    ;
  }
  return control;
}
	

function printResults()
{
	var detectionResults = detectWMP();
        document.write("<html><head><body bgcolor=#CCCCCC>");
	document.write("<blockquote><font face=Verdana size=1>");
        if(detectionResults.type=="ActiveX"){
	document.write("<b>Arquitectura que soporta el navegador: </b><font color=#00FF00>" + detectionResults.type + "</font><br>");
	}
        else {
	document.write("<b>Arquitectura que soporta el navegador:</b><font color=#FF0000>" + detectionResults.type + "</font><br>");
	}
	if(detectionResults.installed){
		document.write("<b>Instalado Windows Media Player ¿?: </b><font color=#00FF00>SI</font><br>");
		if(detectionResults.scriptable){
		document.write("<b>Acepta Scripts el reproductor:  </b><font color=#00FF00>SI</font><br>");
		document.write("<b>Versión del reproductor: </b>" + detectionResults.versionInfo + "<br>");
		document.write("La Versión DEBE SER superior/igual a 4.~ para la musica<br> y superior/igual a 9.~ para escuchar los directos y audioletras<br>");
		}
		else{document.write("<b>Acepta Scripts el reproductor:  </b><font color=#00FF00>NO</font><br>");
		}
	}
        else { 
		document.write("<b>Instalado Windows Media Player ¿?: </b><font color=#FF0000>NO</font><br><a target=_blank href=http://windowsmedia.com/download/download.asp>Install the latest windows media Player</a><br>");
		}
	if (navigator.javaEnabled()){ 
		document.write("<b>Java: </b> <font color=#00FF00>SI</font> ");
                }
		else 
		document.write("<b>Java-Off </b>");
       
        if (document.getElementById || document.all || document.layers){
	        document.write("<br><b>DHTML:</b> <font color=#00FF00>Activado</font>");// browser can do DHTML
        }
        else {
		document.write("<br><b><b>DHTML:</b> <font color=#FF0000>Descativado</font> </b><br> Tienes algunos problemas con tu navegador, trata de actualizarlo"); }
        //if (document.getElementById && document.createElement) {
	//	document.write("<br><b>DHTML-On2 </b>");
	//}
        //else {
	//document.write("<br><b><b>DHTML:</b> <font color=#FF0000>Off2</font> </b><br><font color=#FF0000> Tienes algunos problemas con tu navegador, trata de actualizarlo");
	//}
	document.write("<br>No es seguro que DHTML funcione con Netscape");
        


	
}




