function pageXY( el)
{
var XY={x:0, y:0};
for( var node = el; node; node=node.offsetParent)
{ XY.x += node.offsetLeft;
XY.y += node.offsetTop;
}
return XY;
}
function mostra_cmt(name)
{
name="comentario-"+name;
var anchors, anchor, XY;
anchors=document.anchors;
anchor=anchors[name];

if(!anchor) // IE sucks
{ for( var i = 0; i < anchors.length; ++i)
{ if(anchors[i].name==name)
{ anchor = anchors[i];
break;
}
}
}
if(!anchor)
{ if( document.getElementById)
anchor=document.getElementById(name);
else if( document.all) // untested
anchor=document.all[name];
}
if(anchor)
{ XY = pageXY(anchor);
window.scrollTo(XY.x, XY.y);
}
}
