Creo que éste sería el código Final, en donde he conseguido luego de buscar y buscar centrar el texto, al igual que el div. sin necesidad de colocar un div en cada página que desees colocar un mensaje con fondo transparente
Código PHP:
function tag(id) {return document.getElementById(id);}
function crear(e) {return document.createElement(e);}
function texto(t) {return document.createTextNode(t);}
function generaDiv(ide,color,opacity,ancho,alto,msj){
var navegador=1;
if(navigator.userAgent.indexOf("MSIE")>=0) navegador=0;
var layer = crear('div');
with(layer){
id=ide;
style.width='100%';
style.height='100%';
style.backgroundColor=color;
style.position='absolute';
style.top=0;
style.left=0;
style.zIndex=100;
if(navegador==0) style.filter='alpha(opacity='+opacity+')';
else style.opacity=opacity/100;
}
document.body.appendChild(layer);
var wds=crear('div');
with(wds){
id=ide+ide;
style.position="absolute";
style.width=ancho+"px";
style.height=alto+"px";
style.top="50%";
style.left="50%";
style.marginLeft=(-ancho/2)+"px";
style.marginTop=(-alto/2)+"px";
style.lineHeight=alto+"px"; //éste parametro centra el texto verticalmente
style.textAlign="center";
style.backgroundColor="#FFFFFF";
style.zIndex=200;
innerHTML=msj;
}
var div = tag(ide);
div.appendChild(wds);
}
De ésta forma llamaríamos la función.
Código:
<a href="javaScript:generaDiv('fon','#000000','80',400,60,'Mensaje!');">Click</a>
Vuelvo a explicar fon seria el nombre que le asignaríamos al div de
fondo, el div de
mensaje se llamaria fonfon [idid] luego viene el valor de
opacidad (funcional en firefox y en IE) luego el
Ancho, Alto del div que muestra el mensaje, finalmente el
mensaje en el cual se puede incluir etiquetas html, ya que lo incluye con innerHTML.
Aún no he comprobado algo que me dijieron sobre las capas en IE6, si no funciona avisarme para buscar alguna solución. por ahora és todo