
Main.$ = function ()
{
	var Aux  = document.getElementById (arguments [0]);
	var Pars = null;
	
	switch (arguments.length)
	{	case 1: return Aux;
		case 2: return Aux ? Aux [arguments [1]] : null;
		case 3: 
			if (Aux) 
			{	Pars = arguments [1].split ('.');
				for (var i = 0; i < Pars.length - 1; i++) Aux = Aux [Pars [i]];
			  Aux [Pars [i]] = arguments [2]; 
			}
			break;
		default: alert ('$, número de parámetros incorrectos.');
	}
}


Main.flash = function (oflash)
{
	var div = null;

	if (typeof (oflash.contenedor) == 'string') div = document.getElementById (oflash.contenedor);
	else if (typeof (oflash.contenedor) == 'object') div = oflash.contenedor;
	else alert ('No se ha encontrado el contenedor.');

	if (window.ActiveXObject) // IE
	{	div.innerHTML = '<object id="idFlash_' + (Main.idFlash++) + '"' +
		                ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
		                ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.115"' +
		                ' width="' + oflash.ancho + '"' +
		                ' height="' + oflash.alto + '">' +
		                '<param name="movie" value="' + oflash.swf + '">' +
		                '<param name="allowfullscreen" value="true">' +
		                '<param name="allowscriptaccess" value="always">' +
		                '<param name="wmode" value="transparent">' +
		                '</object>';
	} else
	{	var emb = document.createElement ('embed', 'wmode');
		
		emb.setAttribute ('name', 'idFlash_' + (Main.idFlash++));
		emb.setAttribute ('id', 'idFlash_' + (Main.idFlash++));
		emb.setAttribute ('type', 'application/x-shockwave-flash');
		emb.setAttribute ('pluginspage', 'http://www.macromedia.com/go/getflashplayer');
		emb.setAttribute ('width', oflash.ancho);
		emb.setAttribute ('height', oflash.alto);
		emb.setAttribute ('src', oflash.swf);
		emb.setAttribute ('allowfullscreen', 'true');
		emb.setAttribute ('allowscriptaccess', 'always');
		emb.setAttribute ('wmode', 'transparent');
		div.appendChild (emb);
	}
}


function Main ()
{
}

