// JavaScript Document

function ventana_ayuda( archivo )
{
   window.open( archivo,
		 "ayuda", "WIDTH=" + (screen.width-100) + ",HEIGHT=" + (screen.height-100) + ",TOP=20,LEFT=50,resizable=yes,scrollbars=yes,status=yes" );
   window.status='';
}

function mostrar_icono_ayuda( archivo, basedir ) 
{
	var basedir = (basedir == null) ? "../" : basedir;
	
	if( window.parent.frames.length > 0 )
	{
		var theframe = window.parent.frames[0];
		var div_ayuda = theframe.document.getElementsByName("iconoayuda");
		
		if( div_ayuda.length > 0 )
		{
			var link = 'javascript:ventana_ayuda( "' + basedir + 'ayuda/' + archivo + '" );';
			
			div_ayuda[0].innerHTML = "<a title='Haga clic aquí para ver la ayuda sobre este tema' href='" + link + "'><img src='/images/iconos/ayuda.png'></a>";;
		}
	}
}

function mostrar_icono_ayuda_noframes( contenedor, archivo, basedir ) 
{
	var theframe = document.getElementsByName( contenedor );
	
	if( theframe.length > 0 )
	{
		// <div style='display:inline' name=iconoayuda id=iconoayuda>&nbsp;</div>
		var div_ayuda = document.createElement('div');
					
		var link = 'javascript:ventana_ayuda( "'+basedir+'ayuda/' + archivo + '" );';
			
		div_ayuda.style.position = "absolute";
				
		div_ayuda.name = "iconoayuda";
		div_ayuda.id   = "iconoayuda";
		div_ayuda.style.top  = 35;
		div_ayuda.style.left = 10;
		
		div_ayuda.innerHTML = "<a title='Haga clic aquí para ver la ayuda sobre este tema' href='" + link + "'><img src='" + basedir + "images/iconos/ayuda.png'></a>";;		
		
		document.body.appendChild(div_ayuda);
	}

}
