function openCenter(w,h,lnk,attributi,winName)
{
  newWin = null;

  if (winName == null)
    winName = "noName";

  if (attributi== null)
    attributi = "toolbar=0,location=no,directories=0,status=0,menubar=0,scrollbar=1,resizable=0,";

  if (parseFloat(navigator.appVersion) >= 4 )
  {

    if (screen.availWidth < w)
      w=screen.availWidth;

    if (screen.availHeight < h)
      h=screen.availHeight;


    t  = (screen.availWidth - w) / 2;
    l  = (screen.availHeight - h) / 2;

    if (screen.availWidth <= 800 && t < 30)
    {
      t=0;
      l=0;
    }

    if (navigator.appName == "Netscape")
    {
     newWin = window.open(lnk,
                          winName,
                          attributi+"width="+w+",height="+h+",screenX="+t+",screenY="+l,"Prova");
    }
    else
    {
      newWin = window.open(lnk,
                           winName,
                           attributi+'width='+w+',height='+h+',left='+t+',top='+l,'Prova');
    }
    if (screen.availWidth<= 800)
      newWin.resizeTo(w,h);
    newWin.focus();
  }
}
// nella stessa pagina :

function move_box(an, box) {
  var cleft = 220;
  var ctop = 0;
  var obj = an;
  while (obj.offsetParent) {
    cleft += obj.offsetLeft;
    ctop += obj.offsetTop;
    obj = obj.offsetParent;
  }
  box.style.left = cleft + 'px';
  ctop += an.offsetHeight + 8;
  if (document.body.currentStyle &&
    document.body.currentStyle['marginTop']) {
    ctop += parseInt(
      document.body.currentStyle['marginTop']);
  }
  box.style.top = ctop + 'px';
}

function apri(an, width, height, borderStyle) {
  var href = an.href;
  var boxdiv = document.getElementById(href);

  if (boxdiv != null) {
    if (boxdiv.style.display=='none') {
      move_box(an, boxdiv);
      boxdiv.style.display='block';
    } else
      boxdiv.style.display='none';
    return false;
  }

  boxdiv = document.createElement('div');
  boxdiv.setAttribute('id', href);
  boxdiv.style.display = 'block';
  boxdiv.style.position = 'absolute';
  boxdiv.style.width = width + 'px';
  boxdiv.style.height = height + 'px';
  boxdiv.style.border = borderStyle;
  boxdiv.style.backgroundColor = '#fff';

  var contents = document.createElement('iframe');
  contents.scrolling = 'yes';
  contents.frameBorder = '0';
  contents.style.width = width + 'px';
  contents.style.height = height + 'px';
  contents.src = href;

  boxdiv.appendChild(contents);
  document.body.appendChild(boxdiv);
  move_box(an, boxdiv);

  return false;
}

function setPointer(theRow, theCss)
{
	if (typeof(document.styleSheets[0].cssRules) != 'undefined')
	{
		var ruls = document.styleSheets[0].cssRules;
	} else {
		var ruls = document.styleSheets[0].rules;
	}
	
	function findcss(x,n)
	{
	    for (i = 0; i < x.length; i++) if(x[i].selectorText==n) return i;
	}

	function scambiaCss(oldcss,newcss)
	{
		oldcss.backgroundColor=newcss.backgroundColor;
		oldcss.borderBottomWidth=newcss.borderBottomWidth;
		oldcss.borderBottomStyle=newcss.borderBottomStyle;
		oldcss.borderBottomColor=newcss.borderBottomColor;
	}

	if (typeof(document.getElementsByTagName) != 'undefined')
	{
		theCells = theRow.getElementsByTagName('td');
	} else if (typeof(theRow.cells) != 'undefined') {
		theCells = theRow.cells;
	} else {
		return false;
	}

	for (c = 0; c < theCells.length; c++)
	{
		x=findcss(ruls,theCss);
		scambiaCss(theCells[c].style, ruls[x].style)
	}

    return true;
}