function objFlash_alt(nombre, ancho, alto, param) 
{	
    if (AC_FL_RunContent == 0) {
        alert("Esta página requiere el archivo AC_RunActiveContent.js.");
    } else {
        AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
            'width', ancho,
            'height', alto,
            'src', nombre,
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'transparent',
            'devicefont', 'false',
            'id', nombre,
            'bgcolor', '#ffffff',
            'name', nombre,
            'menu', 'true',
            'allowFullScreen', 'false',
            'allowScriptAccess','sameDomain',
            'movie', nombre,
            'salign', '',
	    'flashvars', param
            ); 
    }
}

function objFlash(url, id, ancho, alto, parametros)
{
    document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0' width='" + ancho + "' height='" + alto + "' id='" + id + "' align='middle'>");
    document.write("<param name='allowScriptAccess' value='sameDomain' />");
    document.write("<param name='allowFullScreen' value='false' />");
    document.write("<param name='wmode' value='transparent' />");
    document.write("<param name='movie' value='"+url+"' />");
    document.write("<param name='quality' value='high' />");
    document.write("<param name='bgcolor' value='#ffffff' />");    
    document.write("<param name='flashvars' value='" + parametros + "' />");
    document.write("<embed src='"+url+"' wmode='transparent' quality='high' bgcolor='#ffffff' width='" + ancho + "' height='" + alto + "' name='" + id +"' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' flashvars='" + parametros + "' />");
    document.write("</object>");
}

function recargar_banner_navegacion(id_banner, id_script)
{
	var peticion=new request_http;
	var url='http://www.sanro.com/ajax/banner_navegacion.ajax.php?modo=recargar_banner&id_banner='+id_banner+'&id_script='+id_script;

	peticion.cargar
	(
		url,
		function(resultado)
		{
			if(resultado.substr(0,2)=='si')
			{
				eval(resultado.substr(2));				
			}
		}
	);
}

function montar_elemento(tipo, clases, contenido, padre)
{
	var temporal=document.createElement(tipo);
	temporal.className=clases;
	if(contenido) temporal.innerHTML=contenido;

	if(padre)
	{
		padre.appendChild(temporal);
	}
	return temporal;
}


function Pelicula_flash(v_padre, v_origen, v_ancho, v_alto, v_param)
{
	this.objeto=null;
	this.params=Array();
	this.elemento_embed=null;

	this.padre=v_padre;
	this.origen=v_origen;
	this.ancho=(v_ancho ? v_ancho : 500);
	this.alto=(v_alto ? v_alto : 400);
	this.param=(v_param ? v_param : null);

	this.crear();	
}

Pelicula_flash.prototype.crear=function()
{

	this.objeto=montar_elemento('object', null, null, null);
	this.objeto.width=this.ancho;
	this.objeto.height=this.alto;
	this.objeto.id=this.id;

	this.params.push(Array('src', this.origen));
	this.params.push(Array('allowScriptAccess', 'always'));
	this.params.push(Array('allowFullScreen', 'false')); //true

	this.elemento_embed=montar_elemento('embed', null, null, this.objeto);
	this.elemento_embed.src=this.origen;
	this.elemento_embed.type='application/x-shockwave-flash';
	this.elemento_embed.allowScriptAccess='always';
	this.elemento_embed.allowFullScreen='false';
	this.elemento_embed.width=this.ancho;
	this.elemento_embed.height=this.alto;

//	this.elemento_embed.flashvars=this.param;

	var x;
	for(x in this.params)
	{
		this.objeto.appendChild(this.montar_param(this.params[x]));
	}

	this.padre.appendChild(this.objeto);
}

Pelicula_flash.prototype.montar_param=function(param)
{
	var temp=montar_elemento('param', null, null, null);
	temp.name=param[0];
	temp.value=param[1];

	return temp;
}

function request_http()
{		
	this.crear_request = function ()	//Esto, obviamente, no es mio... Nos ayuda a separar si es un objeto para IE o para el resto del mundo.
	{ 	
		if (typeof XMLHttpRequest != 'undefined') return new XMLHttpRequest(); 		//Para el resto del mundo.
		try { return new ActiveXObject("Msxml2.XMLHTTP");} 	//Para explorer...
		catch (e) 
		{ 
			try {return new ActiveXObject("Microsoft.XMLHTTP");}	//Para Dios sabe que otra versión de Explorer.
			catch (e) {} 
		} 
		return false; 	//Para Mosaic :P.
	}
	
	this.cargar = function(url, metodo)
	{					
		var funcion_respuesta = this.respuesta;	//Necesitamos hacer accesible al siguiente ámbito esto...
		var request_temporal=this.request;		//...y esto...			
		var funcion = function () {funcion_respuesta(request_temporal, metodo)}; //Y ahora creamos esto otro para poder usarlo de respuesta.			
		this.request.open("GET", url, true);	//Prepara...						
		this.request.onreadystatechange = funcion; //La respuesta cuando haya cambio			
		this.request.send(null);	//Lanza.						
	}
			
	this.respuesta = function(request_temporal, metodo)	//Cuando cambia el estado (según el método cargar()) lanzaremos esto, que recibe el request completo...
	{						
		if (request_temporal.readyState == 4) metodo(request_temporal.responseText);	//Cuando el estado sea 4 llamaremos a la función que pásamos... Nótese que al ser de ámbito global al objeto la podemos usar.
	}
	
	this.request = this.crear_request(); //Finalmente esto es lo primerísimo que ocurre cuando creamos un objeto: dentro del objeto se crea una instancia de XMLHTTPRequest en función del navegador que sea.		
}

