//---------------------------------------------------------------------//
//abre ventane de popup
function multimedia(mult,nombre) {
	/*w = 402;
	h = 424;*/
	w = 425;
	h = 282;
	LeftPosition = (screen.width) ? (screen.width - w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height - h)/2 : 0;
	settings = 'height=' + h  + ',width=' + w+ ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll
	window.open('../portada/audios_portada.php?ida=' + mult + '&nombre=' + nombre,"_blank",settings);
}
//---------------------------------------------------------------------//
//abre ventane de popup
function multimediaAI(mult,nombre) {
	/*w = 402;
	h = 424;*/
	w = 425;
	h = 282;
	LeftPosition = (screen.width) ? (screen.width - w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height - h)/2 : 0;
	settings = 'height=' + h  + ',width=' + w+ ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll
	window.open('../home/audios_informativos.php?ida=' + mult + '&nombre=' + nombre ,"_blank",settings);
}
//---------------------------------------------------------------------//
//abre ventane de popup
function multimediaAD(mult,nombre){
	/*w = 402;
	h = 424;*/
	w = 425;
	h = 282;
	LeftPosition = (screen.width) ? (screen.width - w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height - h)/2 : 0;
	settings = 'height=' + h  + ',width=' + w+ ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll
	window.open('../home/audios_destacados.php?ida=' + mult + '&nombre=' + nombre ,"_blank",settings);
}
//---------------------------------------------------------------------//
//abre ventane de popup
function multimediaRadio(tipo){/*tipo=am ó fm*/
	/*w = 402;
	h = 424;*/
	w = 425;
	if(tipo=='am') h = 282;
	else h = 282
	LeftPosition = (screen.width) ? (screen.width - w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height - h)/2 : 0;
	settings = 'height=' + h  + ',width=' + w+ ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll
	window.open('/home/audios_radios.php?tipo=' + tipo ,"_blank",settings);
}

//---------------------------------------------------------------------//	
/*DETECTO EL PLUGIN QUE TIENE INSTALADO*/
//---------------------------------------------------------------------//	
var detectableWithVB = false;
var pluginFound = false;

function detectReal() {
    pluginFound = detectPlugin('RealPlayer');
    // si no lo encontro, lo detecto con VisualBasic
    if(!pluginFound && detectableWithVB) {
		pluginFound = (detectActiveXControl('rmocx.RealPlayer G2 Control') ||
		       detectActiveXControl('RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)') ||
		       detectActiveXControl('RealVideo.RealVideo(tm) ActiveX Control (32-bit)'));
    }
    return (pluginFound);
}

function detectQuickTime() {
	pluginFound = detectPlugin( 'QuickTime' );
	// if not found, try to detect with VisualBasic
	if ( !pluginFound && detectableWithVB ) {
		//pluginFound = detectQuickTimeActiveXControl();
		pluginFound = detectActiveXControl('QuickTimeCheckObject.QuickTimeCheck');
	}
	return pluginFound;
}

function detectPlugin() {
    var daPlugins = detectPlugin.arguments;
    var pluginFound = false;
    if (navigator.plugins && navigator.plugins.length > 0) {
		var pluginsArrayLength = navigator.plugins.length;
		// for each plugin...
		for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) {
		    var numFound = 0;
		    for(namesCounter=0; namesCounter < daPlugins.length; namesCounter++) {
				if ( (navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) >= 0) ||
				    (navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) >= 0) ) {
					// se contro el nombre
					numFound++;
				}
		    }
		    // ahora que checkeamos todos los nombres contra este plugin,
		    // si el numero que encontramos coincide con el total, entonces ya esta
		    if(numFound == daPlugins.length) {
				pluginFound = true;
				// Si se encuentra el plugin, sale
				break;
		    }
		}
    }
    return pluginFound;
} // detectPlugin

// Aqui se escribe el codigo VBScript para MSIE
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
    document.writeln('<scr' + 'ipt language="VBscript">');
    document.writeln('detectableWithVB = False');
    document.writeln('If ScriptEngineMajorVersion >= 2 then');
    document.writeln('  detectableWithVB = True');
    document.writeln('End If');
	//Esta funcion detectara la mayoria de los plugins
    document.writeln('Function detectActiveXControl(activeXControlName)');
    document.writeln('  on error resume next');
    document.writeln('  detectActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
    document.writeln('  End If');
    document.writeln('End Function');
    document.writeln('</sc' + 'ript>');
}



//----------------------------------------------------
function cerrarVentana(){
	window.close();	
}

function get_audio_replace(id){
	
	var miArray = [1,2,3]
	i=0;
	while(i<3){
		
		if(miArray[i]!=id){
			
		
		var ocultar = document.getElementById(miArray[i]+"_contenedor_aud");
		if(ocultar != null)
		ocultar.style.display = "none";		
			
		}
		i++;
		
	}
	var mostrar = document.getElementById(id+"_contenedor_aud");
		mostrar.style.display = "block";
	
	
	
}

