// JavaScript Document
function prendiElementoDaId(id_elemento) 
{
	// elemento da restituire
 	var elemento;
  	// se esiste il metodo getElementById
 	// questo if sarà diverso da false, null o undefined
 	// e sarà quindi considerato valido, come un true
 	if(document.getElementById)
	{
  		elemento = document.getElementById(id_elemento);
 
 // altrimenti è necessario usare un vecchio sistema
	} else {
  		elemento = document.all[id_elemento];
	}
 	// restituzione elemento
 	return elemento;
}



function getXY(obj)
{
  var curleft = 0;
  var curtop = obj.offsetHeight + 5;
  var border;
  if (obj.offsetParent)
  {
    do
    {
      // XXX: If the element is position: relative we have to add borderWidth
      if (getStyle(obj, 'position') == 'relative')
      {
        if (border = _pub.getStyle(obj, 'border-top-width')) curtop += parseInt(border);
        if (border = _pub.getStyle(obj, 'border-left-width')) curleft += parseInt(border);
      }
      curleft += obj.offsetLeft;
      curtop += obj.offsetTop;
    }
    while (obj = obj.offsetParent)
  }
  else if (obj.x)
  {
    curleft += obj.x;
    curtop += obj.y;
  }
  return {'x': curleft, 'y': curtop};
}
function getStyle(obj, styleProp)
{
  if (obj.currentStyle)
    return obj.currentStyle[styleProp];
  else if (window.getComputedStyle)
    return document.defaultView.getComputedStyle(obj,null).getPropertyValue(styleProp);
}



function popup_privacy()
{
	var parametri='left='+(screen.width/2-500/2);
	//parametri+=',top='+(screen.height-132);
	parametri+=',width=650,height=630,status=no,location=no,titlebar=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes';
	
	window.open('privacy.php','popup_privacy',parametri);
}

function popup_notelegali()
{
	var parametri='left='+(screen.width/2-500/2);
	//parametri+=',top='+(screen.height-132);
	parametri+=',width=650,height=550,status=no,location=no,titlebar=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes';
	
	window.open('notelegali.php','popup_notelegali',parametri);
}


